Compare commits
155 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd39e6f3c8 | ||
|
|
8ea3bb0d90 | ||
|
|
45dce89cae | ||
|
|
bf8e331135 | ||
|
|
a6d78ef842 | ||
|
|
f8458ed9e4 | ||
|
|
9a0db392de | ||
|
|
c443c9f05d | ||
|
|
50312b54a0 | ||
|
|
e47bd4f477 | ||
|
|
67dfd26639 | ||
|
|
54099e592e | ||
|
|
580f39a12c | ||
|
|
c9e96c15af | ||
|
|
d54d6bc572 | ||
|
|
38830e54d8 | ||
|
|
e5716e3b1e | ||
|
|
47605cae16 | ||
|
|
e2149cb46f | ||
|
|
509bca36b1 | ||
|
|
cfb9310d13 | ||
|
|
f5cbb9c7b9 | ||
|
|
b9d158076e | ||
|
|
438088f69d | ||
|
|
80b2ba2b9a | ||
|
|
197901108e | ||
|
|
425f1df799 | ||
|
|
06b22e9ac1 | ||
|
|
68a4146999 | ||
|
|
d4316f0264 | ||
|
|
7faac85fff | ||
|
|
10fdf5a8c3 | ||
|
|
11cf44986b | ||
|
|
cf9e986f82 | ||
|
|
d6922b2de3 | ||
|
|
9012a9b414 | ||
|
|
4f939b82b6 | ||
|
|
2a4328b4f5 | ||
|
|
d974bcd2fa | ||
|
|
d7ff9dca1d | ||
|
|
e7e29b7f10 | ||
|
|
84be137b4e | ||
|
|
1252c30edf | ||
|
|
1458d7fea6 | ||
|
|
7f8a259beb | ||
|
|
56e31d05e9 | ||
|
|
3c635e219e | ||
|
|
de278635a3 | ||
|
|
5096c45dec | ||
|
|
a896e52489 | ||
|
|
fd6b371dac | ||
|
|
c0f34f454b | ||
|
|
1a947dbf6a | ||
|
|
b9939a6449 | ||
|
|
6f50b3a5b2 | ||
|
|
6ccb6562f1 | ||
|
|
847f9f80c1 | ||
|
|
7ed4bfe7ee | ||
|
|
8fbc08f91f | ||
|
|
872bebbbf8 | ||
|
|
f8e6c44996 | ||
|
|
5d0c4361ab | ||
|
|
aaec42ebc2 | ||
|
|
95e13ea629 | ||
|
|
d44af40de8 | ||
|
|
2df0788c11 | ||
|
|
914b8463b7 | ||
|
|
7ba2a83182 | ||
|
|
554cf9be44 | ||
|
|
da2164373c | ||
|
|
c3a2204653 | ||
|
|
2558daf6b7 | ||
|
|
2f7cb82ca0 | ||
|
|
7dc113e977 | ||
|
|
579c8e68f9 | ||
|
|
e33a1e0515 | ||
|
|
bf4a974124 | ||
|
|
9a04da27b0 | ||
|
|
8de7c0245c | ||
|
|
17b2720f5b | ||
|
|
caab582943 | ||
|
|
1010a2a2a4 | ||
|
|
3da5574d79 | ||
|
|
6b651d734e | ||
|
|
7e506af0b9 | ||
|
|
72fa958f2c | ||
|
|
641d88fd6b | ||
|
|
4a546e6c18 | ||
|
|
dc9744f353 | ||
|
|
dd8c0febd5 | ||
|
|
2d2b12c800 | ||
|
|
06f5ae0e78 | ||
|
|
918f029d98 | ||
|
|
cb40bd86f8 | ||
|
|
b903c86076 | ||
|
|
fcb2462902 | ||
|
|
b69ec059fe | ||
|
|
7379e4e5de | ||
|
|
bb326f2bbd | ||
|
|
34c218b2de | ||
|
|
382f5eb1b1 | ||
|
|
a6a93cbe06 | ||
|
|
a1637d8343 | ||
|
|
5cf3bdd593 | ||
|
|
3b3ab4d574 | ||
|
|
7d9452f4e4 | ||
|
|
6c6e45157b | ||
|
|
52cc08dd2d | ||
|
|
adbf8adfb9 | ||
|
|
c87c1dbbbf | ||
|
|
575ab3ab70 | ||
|
|
62f0722325 | ||
|
|
196b491ac4 | ||
|
|
dd351c585a | ||
|
|
8fd5b325e0 | ||
|
|
592e8c2e77 | ||
|
|
5a27aead06 | ||
|
|
ca63cc6439 | ||
|
|
2890fa74a2 | ||
|
|
97c1bcf14f | ||
|
|
780f11ec16 | ||
|
|
5b266eff89 | ||
|
|
0650d8e155 | ||
|
|
ee9f9863ff | ||
|
|
9727a3fe50 | ||
|
|
df83191ea0 | ||
|
|
13218f7d76 | ||
|
|
bea7d9f919 | ||
|
|
1b43515160 | ||
|
|
48058a88e5 | ||
|
|
f7e42211b9 | ||
|
|
abd3419632 | ||
|
|
b5ed6823d6 | ||
|
|
f37eacdee5 | ||
|
|
9eb8680ec9 | ||
|
|
5fc5b68a49 | ||
|
|
0371d5a326 | ||
|
|
44b088c6b3 | ||
|
|
289400d944 | ||
|
|
f6544e95d4 | ||
|
|
0973161ae5 | ||
|
|
4ca3e8f70a | ||
|
|
7186131d65 | ||
|
|
a5cb9ae8bd | ||
|
|
2fa8af3b02 | ||
|
|
67e2ef30c4 | ||
|
|
22baba2cff | ||
|
|
7273cb7f54 | ||
|
|
4157b64776 | ||
|
|
9e30969243 | ||
|
|
dbb5154f37 | ||
|
|
5ae39ae79a | ||
|
|
a854ea00a5 | ||
|
|
e97f587411 | ||
|
|
17e5f4132c |
@@ -53,6 +53,9 @@ before_script:
|
||||
|
||||
script:
|
||||
- set -e
|
||||
- bench --verbose run-tests
|
||||
- bench run-tests
|
||||
- sleep 5
|
||||
- bench --verbose run-ui-tests --app erpnext
|
||||
- bench reinstall --yes
|
||||
- bench execute erpnext.setup.setup_wizard.utils.complete
|
||||
- bench execute erpnext.setup.utils.enable_all_roles_and_domains
|
||||
- bench run-ui-tests --app erpnext
|
||||
|
||||
@@ -4,7 +4,7 @@ import inspect
|
||||
import frappe
|
||||
from erpnext.hooks import regional_overrides
|
||||
|
||||
__version__ = '8.9.0'
|
||||
__version__ = '8.11.3'
|
||||
|
||||
def get_default_company(user=None):
|
||||
'''Get default company for user'''
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
"editable_grid": 0,
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -42,6 +43,7 @@
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -70,6 +72,7 @@
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -100,6 +103,7 @@
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -130,6 +134,7 @@
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -161,6 +166,7 @@
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -190,6 +196,7 @@
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -219,6 +226,7 @@
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -250,6 +258,7 @@
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -278,6 +287,7 @@
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -309,6 +319,7 @@
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -341,6 +352,7 @@
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -372,6 +384,7 @@
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -404,6 +417,7 @@
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -433,6 +447,7 @@
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -461,6 +476,7 @@
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -489,6 +505,7 @@
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -528,7 +545,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-04-21 17:22:41.150984",
|
||||
"modified": "2017-08-11 15:28:35.855809",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Account",
|
||||
@@ -641,6 +658,6 @@
|
||||
"search_fields": "",
|
||||
"show_name_in_global_search": 1,
|
||||
"sort_order": "ASC",
|
||||
"track_changes": 0,
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
}
|
||||
@@ -78,6 +78,7 @@ def get_chart(chart_template, existing_company=None):
|
||||
for folder in folders:
|
||||
path = os.path.join(os.path.dirname(__file__), folder)
|
||||
for fname in os.listdir(path):
|
||||
fname = frappe.as_unicode(fname)
|
||||
if fname.endswith(".json"):
|
||||
with open(os.path.join(path, fname), "r") as f:
|
||||
chart = f.read()
|
||||
@@ -105,6 +106,7 @@ def get_charts_for_country(country):
|
||||
path = os.path.join(os.path.dirname(__file__), folder)
|
||||
|
||||
for fname in os.listdir(path):
|
||||
fname = frappe.as_unicode(fname)
|
||||
if (fname.startswith(country_code) or fname.startswith(country)) and fname.endswith(".json"):
|
||||
with open(os.path.join(path, fname), "r") as f:
|
||||
_get_chart_name(f.read())
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"""
|
||||
Import chart of accounts from OpenERP sources
|
||||
"""
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import print_function, unicode_literals
|
||||
|
||||
import os, json
|
||||
import ast
|
||||
@@ -229,7 +229,7 @@ def make_charts():
|
||||
|
||||
filename = src["id"][5:] + "_" + chart_id
|
||||
|
||||
print "building " + filename
|
||||
print("building " + filename)
|
||||
chart = {}
|
||||
chart["name"] = src["name"]
|
||||
chart["country_code"] = src["id"][5:]
|
||||
|
||||
@@ -1607,4 +1607,4 @@
|
||||
"root_type": "Income"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,722 @@
|
||||
{
|
||||
"country_code": "tw",
|
||||
"name": "Taiwan - Chart of Accounts",
|
||||
"tree": {
|
||||
"1-\u8cc7\u7522": {
|
||||
"11~12-\u6d41\u52d5\u8cc7\u7522": {
|
||||
"111-\u73fe\u91d1\u53ca\u7d04\u7576\u73fe\u91d1": {
|
||||
"1111-\u5eab\u5b58\u73fe\u91d1": {
|
||||
"account_type": "Cash"
|
||||
},
|
||||
"1112-\u96f6\u7528\u91d1/\u9031\u8f49\u91d1": {
|
||||
"account_type": "Cash"
|
||||
},
|
||||
"1113-\u9280\u884c\u5b58\u6b3e": {
|
||||
"account_type": "Bank",
|
||||
"\u4e2d\u570b\u4fe1\u8a17": {
|
||||
"account_type": "Bank"
|
||||
},
|
||||
"\u53f0\u5317\u5bcc\u90a6": {
|
||||
"account_type": "Bank"
|
||||
}
|
||||
},
|
||||
"1116-\u5728\u9014\u73fe\u91d1": {
|
||||
"account_type": "Cash"
|
||||
},
|
||||
"1117-\u7d04\u7576\u73fe\u91d1": {
|
||||
"account_type": "Cash"
|
||||
},
|
||||
"1118-\u5176\u4ed6\u73fe\u91d1\u53ca\u7d04\u7576\u73fe\u91d1": {
|
||||
"account_type": "Cash"
|
||||
},
|
||||
"account_type": "Cash"
|
||||
},
|
||||
"112-\u77ed\u671f\u6295\u8cc7": {
|
||||
"1121-\u77ed\u671f\u6295\u8cc7 \u2014\u80a1\u7968": {}
|
||||
},
|
||||
"113-\u61c9\u6536\u7968\u64da": {
|
||||
"1131-\u61c9\u6536\u7968\u64da": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"1132-\u61c9\u6536\u7968\u64da\u8cbc\u73fe ": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"1138-\u5176\u4ed6\u61c9\u6536\u7968\u64da ": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"1139-\u5099\u62b5\u5446\u5e33 \uff0d\u61c9\u6536\u7968\u64da ": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"114-\u61c9\u6536\u5e33\u6b3e": {
|
||||
"1141-\u61c9\u6536\u5e33\u6b3e ": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"1142-\u61c9\u6536\u5206\u671f\u5e33\u6b3e ": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"1149-\u5099\u62b5\u5446\u5e33 \uff0d\u61c9\u6536\u5e33\u6b3e ": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"118-\u5176\u4ed6\u61c9\u6536\u6b3e": {
|
||||
"1184-\u61c9\u6536\u6536\u76ca": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"1185-\u61c9\u6536\u9000\u7a05\u6b3e": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"1189-\u5099\u62b5\u5446\u5e33 \u2014 \u5176\u4ed6\u61c9\u6536\u6b3e ": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"121~122-\u5b58\u8ca8": {
|
||||
"1219-\u5099\u62b5\u5b58\u8ca8\u8dcc\u50f9\u640d\u5931": {},
|
||||
"1229-\u5099\u62b5\u5b58\u8ca8\u8dcc\u50f9\u640d\u5931": {},
|
||||
"account_type": "Stock",
|
||||
"is_group": 1
|
||||
},
|
||||
"125-\u9810\u4ed8\u8cbb\u7528": {
|
||||
"1251-\u9810\u4ed8\u85aa\u8cc7": {},
|
||||
"1252-\u9810\u4ed8\u79df\u91d1": {},
|
||||
"1253-\u9810\u4ed8\u4fdd\u96aa\u8cbb": {},
|
||||
"1254-\u7528\u54c1\u76e4\u5b58": {},
|
||||
"1255-\u9810\u4ed8\u6240\u5f97\u7a05": {},
|
||||
"1258-\u5176\u4ed6\u9810\u4ed8\u8cbb\u7528": {}
|
||||
},
|
||||
"126-\u9810\u4ed8\u6b3e\u9805": {
|
||||
"1261-\u9810\u4ed8\u8ca8\u6b3e": {},
|
||||
"1268-\u5176\u4ed6\u9810\u4ed8\u6b3e\u9805": {}
|
||||
},
|
||||
"128~129-\u5176\u4ed6\u6d41\u52d5\u8cc7\u7522": {
|
||||
"1281-\u9032\u9805\u7a05\u984d": {},
|
||||
"1282-\u7559\u62b5\u7a05\u984d": {},
|
||||
"1283-\u66ab\u4ed8\u6b3e": {},
|
||||
"1284-\u4ee3\u4ed8\u6b3e": {},
|
||||
"1285-\u54e1\u5de5\u501f\u652f": {}
|
||||
}
|
||||
},
|
||||
"13-\u57fa\u91d1\u53ca\u9577\u671f\u6295\u8cc7": {
|
||||
"131-\u57fa\u91d1": {
|
||||
"1311-\u511f\u50b5\u57fa\u91d1": {},
|
||||
"1313-\u610f\u5916\u640d\u5931\u6e96\u5099\u57fa\u91d1": {},
|
||||
"1314-\u9000\u4f11\u57fa\u91d1": {},
|
||||
"1318-\u5176\u4ed6\u57fa\u91d1": {}
|
||||
},
|
||||
"132-\u9577\u671f\u6295\u8cc7": {
|
||||
"1321-\u9577\u671f\u80a1\u6b0a\u6295\u8cc7": {},
|
||||
"1322-\u9577\u671f\u50b5\u5238\u6295\u8cc7": {},
|
||||
"1323-\u9577\u671f\u4e0d\u52d5\u7522\u6295\u8cc7": {},
|
||||
"1328-\u5176\u4ed6\u9577\u671f\u6295\u8cc7": {}
|
||||
}
|
||||
},
|
||||
"14~15-\u56fa\u5b9a\u8cc7\u7522": {
|
||||
"141-\u571f\u5730": {
|
||||
"1411-\u571f\u5730": {
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"142-\u571f\u5730\u6539\u826f\u7269": {
|
||||
"1421-\u571f\u5730\u6539\u826f\u7269": {
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"143-\u623f\u5c4b\u53ca\u5efa\u7269": {
|
||||
"1431-\u623f\u5c4b\u53ca\u5efa\u7269": {
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"144~146-\u6a5f(\u5668)\u5177\u53ca\u8a2d\u5099": {
|
||||
"1441-\u6a5f(\u5668)\u5177": {
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"151-\u79df\u8cc3\u8cc7\u7522": {
|
||||
"1511-\u79df\u8cc3\u8cc7\u7522": {
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"152-\u79df\u8cc3\u6b0a\u76ca\u6539\u826f": {
|
||||
"1521-\u79df\u8cc3\u6b0a\u76ca\u6539\u826f": {
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"156-\u672a\u5b8c\u5de5\u7a0b\u53ca\u9810\u4ed8\u8cfc\u7f6e\u8a2d\u5099\u6b3e": {
|
||||
"1561-\u672a\u5b8c\u5de5\u7a0b": {
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"158-\u96dc\u9805\u56fa\u5b9a\u8cc7\u7522": {
|
||||
"1581-\u96dc\u9805\u56fa\u5b9a\u8cc7\u7522": {
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"account_type": "Fixed Asset"
|
||||
},
|
||||
"16-\u905e\u8017\u8cc7\u7522": {
|
||||
"161-\u905e\u8017\u8cc7\u7522": {
|
||||
"is_group": 1
|
||||
}
|
||||
},
|
||||
"17-\u7121\u5f62\u8cc7\u7522": {
|
||||
"171-\u5546\u6a19\u6b0a": {
|
||||
"1711-\u5546\u6a19\u6b0a": {}
|
||||
},
|
||||
"172-\u5c08\u5229\u6b0a": {
|
||||
"1721-\u5c08\u5229\u6b0a": {}
|
||||
},
|
||||
"176-\u5546\u8b7d": {
|
||||
"1761-\u5546\u8b7d": {}
|
||||
},
|
||||
"177-\u958b\u8fa6\u8cbb": {
|
||||
"1771-\u958b\u8fa6\u8cbb": {}
|
||||
},
|
||||
"178-\u5176\u4ed6\u7121\u5f62\u8cc7\u7522": {
|
||||
"1781-\u905e\u5ef6\u9000\u4f11\u91d1\u6210\u672c": {}
|
||||
}
|
||||
},
|
||||
"18-\u5176\u4ed6\u8cc7\u7522": {
|
||||
"181-\u905e\u5ef6\u8cc7\u7522": {
|
||||
"1811-\u50b5\u5238\u767c\u884c\u6210\u672c": {},
|
||||
"1812-\u9577\u671f\u9810\u4ed8\u79df\u91d1": {},
|
||||
"1813-\u9577\u671f\u9810\u4ed8\u4fdd\u96aa\u8cbb": {},
|
||||
"1814-\u905e\u5ef6\u6240\u5f97\u7a05\u8cc7\u7522": {},
|
||||
"1815-\u9810\u4ed8\u9000\u4f11\u91d1": {},
|
||||
"1818-\u5176\u4ed6\u905e\u5ef6\u8cc7\u7522": {}
|
||||
},
|
||||
"182-\u9592\u7f6e\u8cc7\u7522": {
|
||||
"1821-\u9592\u7f6e\u8cc7\u7522": {}
|
||||
},
|
||||
"184-\u9577\u671f\u61c9\u6536\u7968\u64da\u53ca\u6b3e\u9805\u8207\u50ac\u6536\u5e33\u6b3e": {
|
||||
"1841-\u9577\u671f\u61c9\u6536\u7968\u64da": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"1842-\u9577\u671f\u61c9\u6536\u5e33\u6b3e": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"1843-\u50ac\u6536\u5e33\u6b3e": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"1848-\u5176\u4ed6\u9577\u671f\u61c9\u6536\u6b3e\u9805": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"1849-\u5099\u62b5\u5446\u5e33\u2014\u9577\u671f\u61c9\u6536\u7968\u64da\u53ca\u6b3e\u9805\u8207\u50ac\u6536\u5e33\u6b3e": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"185-\u51fa\u79df\u8cc7\u7522": {
|
||||
"1851-\u51fa\u79df\u8cc7\u7522": {},
|
||||
"1858-\u51fa\u79df\u8cc7\u7522 \u2014\u91cd\u4f30\u589e\u503c": {},
|
||||
"1859-\u7d2f\u7a4d\u6298\u820a \u2014\u51fa\u79df\u8cc7\u7522": {
|
||||
"account_type": "Accumulated Depreciation"
|
||||
}
|
||||
},
|
||||
"186-\u5b58\u51fa\u4fdd\u8b49\u91d1": {
|
||||
"1861-\u5b58\u51fa\u4fdd\u8b49\u91d1": {}
|
||||
},
|
||||
"188-\u96dc\u9805\u8cc7\u7522": {
|
||||
"1881-\u53d7\u9650\u5236\u5b58\u6b3e": {},
|
||||
"1888-\u96dc\u9805\u8cc7\u7522 \u2014\u5176\u4ed6": {}
|
||||
}
|
||||
},
|
||||
"Temporary Accounts": {
|
||||
"Temporary Opening": {
|
||||
"account_type": "Temporary"
|
||||
},
|
||||
"account_type": "Temporary"
|
||||
},
|
||||
"root_type": "Asset"
|
||||
},
|
||||
"2-\u8ca0\u50b5": {
|
||||
"21~22-\u6d41\u52d5\u8ca0\u50b5": {
|
||||
"211-\u77ed\u671f\u501f\u6b3e": {
|
||||
"2111-\u9280\u884c\u900f\u652f": {},
|
||||
"2112-\u9280\u884c\u501f\u6b3e": {}
|
||||
},
|
||||
"212-\u61c9\u4ed8\u77ed\u671f\u7968\u5238": {
|
||||
"2121-\u61c9\u4ed8\u5546\u696d\u672c\u7968": {
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"2122-\u9280\u884c\u627f\u514c\u532f\u7968": {
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"213-\u61c9\u4ed8\u7968\u64da": {
|
||||
"2131-\u61c9\u4ed8\u7968\u64da": {
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"214-\u61c9\u4ed8\u5e33\u6b3e": {
|
||||
"2141-\u61c9\u4ed8\u5e33\u6b3e": {
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"216-\u61c9\u4ed8\u6240\u5f97\u7a05": {
|
||||
"2161-\u61c9\u4ed8\u6240\u5f97\u7a05": {
|
||||
"account_type": "Tax",
|
||||
"tax_rate": 5.0
|
||||
},
|
||||
"account_type": "Tax",
|
||||
"tax_rate": 5.0
|
||||
},
|
||||
"217-\u61c9\u4ed8\u8cbb\u7528": {
|
||||
"2171-\u61c9\u4ed8\u85aa\u5de5": {},
|
||||
"2172-\u61c9\u4ed8\u79df\u91d1": {},
|
||||
"2173-\u61c9\u4ed8\u5229\u606f": {},
|
||||
"2174-\u61c9\u4ed8\u71df\u696d\u7a05": {},
|
||||
"2175-\u61c9\u4ed8\u7a05\u6350 \u2014\u5176\u4ed6": {
|
||||
"account_type": "Tax",
|
||||
"tax_rate": 5.0
|
||||
},
|
||||
"2178-\u5176\u4ed6\u61c9\u4ed8\u8cbb\u7528": {}
|
||||
},
|
||||
"218~219-\u5176\u4ed6\u61c9\u4ed8\u6b3e": {
|
||||
"2184-\u61c9\u4ed8\u571f\u5730\u623f\u5c4b\u6b3e": {},
|
||||
"2185-\u61c9\u4ed8\u8a2d\u5099\u6b3e": {},
|
||||
"2192-\u61c9\u4ed8\u80a1\u5229": {}
|
||||
},
|
||||
"226-\u9810\u6536\u6b3e\u9805": {
|
||||
"2261-\u9810\u6536\u8ca8\u6b3e": {},
|
||||
"2262-\u9810\u6536\u6536\u5165": {},
|
||||
"2268-\u5176\u4ed6\u9810\u6536\u6b3e": {}
|
||||
},
|
||||
"227-\u4e00\u5e74\u6216\u4e00\u71df\u696d\u9031\u671f\u5167\u5230\u671f\u9577\u671f\u8ca0\u50b5": {
|
||||
"is_group": 1
|
||||
},
|
||||
"228~229-\u5176\u4ed6\u6d41\u52d5\u8ca0\u50b5": {
|
||||
"2281-\u92b7\u9805\u7a05\u984d": {},
|
||||
"2283-\u66ab\u6536\u6b3e ": {},
|
||||
"2284-\u4ee3\u6536\u6b3e": {},
|
||||
"2285-\u4f30\u8a08\u552e\u5f8c\u670d\u52d9/\u4fdd\u56fa\u8ca0\u50b5": {},
|
||||
"2291-\u905e\u5ef6\u6240\u5f97\u7a05\u8ca0\u50b5": {},
|
||||
"2292-\u905e\u5ef6\u514c\u63db\u5229\u76ca": {}
|
||||
}
|
||||
},
|
||||
"23-\u9577\u671f\u8ca0\u50b5": {
|
||||
"231-\u61c9\u4ed8\u516c\u53f8\u50b5": {
|
||||
"2311-\u61c9\u4ed8\u516c\u53f8\u50b5": {},
|
||||
"2319-\u61c9\u4ed8\u516c\u53f8\u50b5\u6ea2(\u6298)\u50f9": {}
|
||||
},
|
||||
"232-\u9577\u671f\u501f\u6b3e": {
|
||||
"2321-\u9577\u671f\u9280\u884c\u501f\u6b3e": {},
|
||||
"2324-\u9577\u671f\u501f\u6b3e \u2014\u696d\u4e3b": {},
|
||||
"2325-\u9577\u671f\u501f\u6b3e \u2014\u54e1\u5de5": {},
|
||||
"2327-\u9577\u671f\u501f\u6b3e \u2014\u95dc\u4fc2\u4eba": {},
|
||||
"2328-\u9577\u671f\u501f\u6b3e \u2014\u5176\u4ed6": {}
|
||||
},
|
||||
"233-\u9577\u671f\u61c9\u4ed8\u7968\u64da\u53ca\u6b3e\u9805": {
|
||||
"2331-\u9577\u671f\u61c9\u4ed8\u7968\u64da": {
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"2332-\u9577\u671f\u61c9\u4ed8\u5e33\u6b3e": {
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"2333-\u9577\u671f\u61c9\u4ed8\u79df\u8cc3\u8ca0\u50b5": {
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"234-\u4f30\u8a08\u61c9\u4ed8\u571f\u5730\u589e\u503c\u7a05": {
|
||||
"2341-\u4f30\u8a08\u61c9\u4ed8\u571f\u5730\u589e\u503c\u7a05": {}
|
||||
},
|
||||
"235-\u61c9\u8a08\u9000\u4f11\u91d1\u8ca0\u50b5": {
|
||||
"2351-\u61c9\u8a08\u9000\u4f11\u91d1\u8ca0\u50b5": {}
|
||||
},
|
||||
"238-\u5176\u4ed6\u9577\u671f\u8ca0\u50b5": {
|
||||
"2388-\u5176\u4ed6\u9577\u671f\u8ca0\u50b5\u2014\u5176\u4ed6": {}
|
||||
}
|
||||
},
|
||||
"28-\u5176\u4ed6\u8ca0\u50b5": {
|
||||
"281-\u905e\u5ef6\u8ca0\u50b5": {
|
||||
"2811-\u905e\u5ef6\u6536\u5165": {},
|
||||
"2814-\u905e\u5ef6\u6240\u5f97\u7a05\u8ca0\u50b5": {},
|
||||
"2818-\u5176\u4ed6\u905e\u5ef6\u8ca0\u50b5": {}
|
||||
},
|
||||
"286-\u5b58\u5165\u4fdd\u8b49\u91d1": {
|
||||
"2861-\u5b58\u5165\u4fdd\u8b49\u91d1": {}
|
||||
},
|
||||
"288-\u96dc\u9805\u8ca0\u50b5": {
|
||||
"2888-\u96dc\u9805\u8ca0\u50b5 \u2014\u5176\u4ed6": {}
|
||||
}
|
||||
},
|
||||
"Stock Received But Not Billed": {
|
||||
"account_type": "Stock Received But Not Billed"
|
||||
},
|
||||
"root_type": "Liability"
|
||||
},
|
||||
"3-\u696d\u4e3b\u6b0a\u76ca": {
|
||||
"31-\u8cc7\u672c": {
|
||||
"311-\u8cc7\u672c\uff08\u80a1\u672c\uff09 ": {
|
||||
"3111-\u666e\u901a\u80a1\u80a1\u672c": {},
|
||||
"3112-\u7279\u5225\u80a1\u80a1\u672c": {},
|
||||
"3113-\u9810\u6536\u80a1\u672c": {},
|
||||
"3114-\u5f85\u5206\u914d\u80a1\u7968\u80a1\u5229": {},
|
||||
"3115-\u8cc7\u672c": {}
|
||||
}
|
||||
},
|
||||
"32-\u8cc7\u672c\u516c\u7a4d": {
|
||||
"321-\u80a1\u7968\u6ea2\u50f9": {
|
||||
"3211-\u666e\u901a\u80a1\u80a1\u7968\u6ea2\u50f9": {},
|
||||
"3212-\u7279\u5225\u80a1\u80a1\u7968\u6ea2\u50f9": {}
|
||||
},
|
||||
"323-\u8cc7\u7522\u91cd\u4f30\u589e\u503c\u6e96\u5099": {
|
||||
"3231-\u8cc7\u7522\u91cd\u4f30\u589e\u503c\u6e96\u5099": {}
|
||||
},
|
||||
"324-\u8655\u5206\u8cc7\u7522\u6ea2\u50f9\u516c\u7a4d": {
|
||||
"3241-\u8655\u5206\u8cc7\u7522\u6ea2\u50f9\u516c\u7a4d": {}
|
||||
},
|
||||
"325-\u5408\u4f75\u516c\u7a4d": {
|
||||
"3251-\u5408\u4f75\u516c\u7a4d": {}
|
||||
},
|
||||
"326-\u53d7\u8d08\u516c\u7a4d": {
|
||||
"3261-\u53d7\u8d08\u516c\u7a4d": {}
|
||||
},
|
||||
"328-\u5176\u4ed6\u8cc7\u672c\u516c\u7a4d": {
|
||||
"3281-\u6b0a\u76ca\u6cd5\u9577\u671f\u80a1\u6b0a\u6295\u8cc7\u8cc7\u672c\u516c\u7a4d": {},
|
||||
"3282-\u8cc7\u672c\u516c\u7a4d\u2014 \u5eab\u85cf\u80a1\u7968\u4ea4\u6613": {}
|
||||
}
|
||||
},
|
||||
"33-\u4fdd\u7559\u76c8\u9918(\u7d2f\u7a4d\u8667\u640d)": {
|
||||
"331-\u6cd5\u5b9a\u76c8\u9918\u516c\u7a4d": {
|
||||
"3311-\u6cd5\u5b9a\u76c8\u9918\u516c\u7a4d": {}
|
||||
},
|
||||
"332-\u7279\u5225\u76c8\u9918\u516c\u7a4d": {
|
||||
"3321-\u610f\u5916\u640d\u5931\u6e96\u5099": {},
|
||||
"3322-\u6539\u826f\u64f4\u5145\u6e96\u5099": {},
|
||||
"3323-\u511f\u50b5\u6e96\u5099": {},
|
||||
"3328-\u5176\u4ed6\u7279\u5225\u76c8\u9918\u516c\u7a4d": {}
|
||||
},
|
||||
"335-\u672a\u5206\u914d\u76c8\u9918(\u7d2f\u7a4d\u8667\u640d) ": {
|
||||
"is_group": 1
|
||||
}
|
||||
},
|
||||
"34-\u6b0a\u76ca\u8abf\u6574": {
|
||||
"341-\u9577\u671f\u80a1\u6b0a\u6295\u8cc7\u672a\u5be6\u73fe\u8dcc\u50f9\u640d\u5931": {
|
||||
"3411-\u9577\u671f\u80a1\u6b0a\u6295\u8cc7\u672a\u5be6\u73fe\u8dcc\u50f9\u640d\u5931": {}
|
||||
},
|
||||
"342-\u7d2f\u7a4d\u63db\u7b97\u8abf\u6574\u6578": {
|
||||
"3421-\u7d2f\u7a4d\u63db\u7b97\u8abf\u6574\u6578": {}
|
||||
},
|
||||
"343-\u672a\u8a8d\u5217\u70ba\u9000\u4f11\u91d1\u6210\u672c\u4e4b\u6de8\u640d\u5931": {
|
||||
"3431-\u672a\u8a8d\u5217\u70ba\u9000\u4f11\u91d1\u6210\u672c\u4e4b\u6de8\u640d\u5931": {}
|
||||
}
|
||||
},
|
||||
"35-\u5eab\u85cf\u80a1": {
|
||||
"351-\u5eab\u85cf\u80a1": {
|
||||
"3511-\u5eab\u85cf\u80a1": {}
|
||||
}
|
||||
},
|
||||
"36-\u5c11\u6578\u80a1\u6b0a": {
|
||||
"361-\u5c11\u6578\u80a1\u6b0a": {
|
||||
"3611-\u5c11\u6578\u80a1\u6b0a": {}
|
||||
}
|
||||
},
|
||||
"root_type": "Equity"
|
||||
},
|
||||
"4-\u71df\u696d\u6536\u5165": {
|
||||
"41-\u92b7\u8ca8\u6536\u5165": {
|
||||
"411-\u92b7\u8ca8\u6536\u5165": {
|
||||
"4111-\u92b7\u8ca8\u6536\u5165": {},
|
||||
"4112-\u5206\u671f\u4ed8\u6b3e\u92b7\u8ca8\u6536\u5165": {}
|
||||
},
|
||||
"417-\u92b7\u8ca8\u9000\u56de": {
|
||||
"4171-\u92b7\u8ca8\u9000\u56de": {}
|
||||
},
|
||||
"419-\u92b7\u8ca8\u6298\u8b93": {
|
||||
"4191-\u92b7\u8ca8\u6298\u8b93": {}
|
||||
}
|
||||
},
|
||||
"46-\u52de\u52d9\u6536\u5165": {
|
||||
"461-\u52de\u52d9\u6536\u5165": {
|
||||
"4611-\u52de\u52d9\u6536\u5165": {}
|
||||
}
|
||||
},
|
||||
"47-\u696d\u52d9\u6536\u5165": {
|
||||
"471-\u696d\u52d9\u6536\u5165": {
|
||||
"4711-\u696d\u52d9\u6536\u5165": {}
|
||||
}
|
||||
},
|
||||
"48-\u5176\u4ed6\u71df\u696d\u6536\u5165": {
|
||||
"488-\u5176\u4ed6\u71df\u696d\u6536\u5165\u2014\u5176\u4ed6": {
|
||||
"4888-\u5176\u4ed6\u71df\u696d\u6536\u5165\u2014\u5176\u4ed6": {}
|
||||
}
|
||||
},
|
||||
"root_type": "Income"
|
||||
},
|
||||
"5-\u71df\u696d\u6210\u672c": {
|
||||
"51-\u92b7\u8ca8\u6210\u672c": {
|
||||
"511-\u92b7\u8ca8\u6210\u672c": {
|
||||
"5111-\u92b7\u8ca8\u6210\u672c": {
|
||||
"account_type": "Cost of Goods Sold"
|
||||
},
|
||||
"5112-\u5206\u671f\u4ed8\u6b3e\u92b7\u8ca8\u6210\u672c": {
|
||||
"account_type": "Cost of Goods Sold"
|
||||
},
|
||||
"account_type": "Cost of Goods Sold"
|
||||
},
|
||||
"512-\u9032\u8ca8": {
|
||||
"5121-\u9032\u8ca8": {},
|
||||
"5122-\u9032\u8ca8\u8cbb\u7528": {},
|
||||
"5123-\u9032\u8ca8\u9000\u51fa": {},
|
||||
"5124-\u9032\u8ca8\u6298\u8b93": {}
|
||||
},
|
||||
"513-\u9032\u6599": {
|
||||
"5131-\u9032\u6599": {},
|
||||
"5132-\u9032\u6599\u8cbb\u7528": {},
|
||||
"5133-\u9032\u6599\u9000\u51fa": {},
|
||||
"5134-\u9032\u6599\u6298\u8b93": {}
|
||||
},
|
||||
"514-\u76f4\u63a5\u4eba\u5de5": {
|
||||
"5141-\u76f4\u63a5\u4eba\u5de5": {}
|
||||
},
|
||||
"515~518-\u88fd\u9020\u8cbb\u7528": {
|
||||
"5151-\u9593\u63a5\u4eba\u5de5": {},
|
||||
"5152-\u79df\u91d1\u652f\u51fa": {},
|
||||
"5153-\u6587\u5177\u7528\u54c1": {},
|
||||
"5154-\u65c5\u8cbb": {},
|
||||
"5155-\u904b\u8cbb": {},
|
||||
"5156-\u90f5\u96fb\u8cbb": {},
|
||||
"5157-\u4fee\u7e55\u8cbb": {},
|
||||
"5158-\u5305\u88dd\u8cbb": {},
|
||||
"5161-\u6c34\u96fb\u74e6\u65af\u8cbb": {},
|
||||
"5162-\u4fdd\u96aa\u8cbb": {},
|
||||
"5163-\u52a0\u5de5\u8cbb": {},
|
||||
"5166-\u7a05\u6350": {
|
||||
"account_type": "Tax",
|
||||
"tax_rate": 5.0
|
||||
},
|
||||
"5168-\u6298\u820a ": {
|
||||
"account_type": "Depreciation"
|
||||
},
|
||||
"5169-\u5404\u9805\u8017\u7aed\u53ca\u6524\u63d0": {},
|
||||
"5172-\u4f19\u98df\u8cbb": {},
|
||||
"5173-\u8077\u5de5\u798f\u5229": {},
|
||||
"5176-\u8a13\u7df4\u8cbb": {},
|
||||
"5177-\u9593\u63a5\u6750\u6599": {},
|
||||
"5188-\u5176\u4ed6\u88fd\u9020\u8cbb\u7528": {}
|
||||
},
|
||||
"Expenses Included In Valuation": {
|
||||
"account_type": "Expenses Included In Valuation"
|
||||
},
|
||||
"account_type": "Cost of Goods Sold"
|
||||
},
|
||||
"56-\u52de\u52d9\u6210\u672c\u88fd": {
|
||||
"561-\u52de\u52d9\u6210\u672c": {
|
||||
"5611-\u52de\u52d9\u6210\u672c": {}
|
||||
}
|
||||
},
|
||||
"57-\u696d\u52d9\u6210\u672c": {
|
||||
"571-\u696d\u52d9\u6210\u672c": {
|
||||
"5711-\u696d\u52d9\u6210\u672c": {}
|
||||
}
|
||||
},
|
||||
"58-\u5176\u4ed6\u71df\u696d\u6210\u672c": {
|
||||
"588-\u5176\u4ed6\u71df\u696d\u6210\u672c\u2014\u5176\u4ed6 ": {
|
||||
"5888-\u5176\u4ed6\u71df\u696d\u6210\u672c\u2014\u5176\u4ed6": {}
|
||||
}
|
||||
},
|
||||
"Stock Adjustment": {
|
||||
"account_type": "Stock Adjustment"
|
||||
},
|
||||
"root_type": "Expense"
|
||||
},
|
||||
"6-\u71df\u696d\u8cbb\u7528": {
|
||||
"61-\u63a8\u92b7\u8cbb\u7528": {
|
||||
"615~618-\u63a8\u92b7\u8cbb\u7528": {
|
||||
"6151-\u85aa\u8cc7\u652f\u51fa": {},
|
||||
"6152-\u79df\u91d1\u652f\u51fa": {},
|
||||
"6153-\u6587\u5177\u7528\u54c1": {},
|
||||
"6154-\u65c5\u8cbb": {},
|
||||
"6155-\u904b\u8cbb": {},
|
||||
"6156-\u90f5\u96fb\u8cbb": {},
|
||||
"6157-\u4fee\u7e55\u8cbb": {},
|
||||
"6159-\u5ee3\u544a\u8cbb": {},
|
||||
"6161-\u6c34\u96fb\u74e6\u65af\u8cbb": {},
|
||||
"6162-\u4fdd\u96aa\u8cbb": {},
|
||||
"6164-\u4ea4\u969b\u8cbb": {},
|
||||
"6165-\u6350\u8d08": {},
|
||||
"6166-\u7a05\u6350": {
|
||||
"account_type": "Tax",
|
||||
"tax_rate": 5.0
|
||||
},
|
||||
"6167-\u5446\u5e33\u640d\u5931": {},
|
||||
"6168-\u6298\u820a ": {
|
||||
"account_type": "Depreciation"
|
||||
},
|
||||
"6169-\u5404\u9805\u8017\u7aed\u53ca\u6524\u63d0": {},
|
||||
"6172-\u4f19\u98df\u8cbb": {},
|
||||
"6173-\u8077\u5de5\u798f\u5229": {},
|
||||
"6175-\u4f63\u91d1\u652f\u51fa": {},
|
||||
"6176-\u8a13\u7df4\u8cbb": {},
|
||||
"6188-\u5176\u4ed6\u63a8\u92b7\u8cbb\u7528": {}
|
||||
}
|
||||
},
|
||||
"62-\u7ba1\u7406\u53ca\u7e3d\u52d9\u8cbb\u7528": {
|
||||
"625~628-\u7ba1\u7406\u53ca\u7e3d\u52d9\u8cbb\u7528": {
|
||||
"6251-\u85aa\u8cc7\u652f\u51fa": {},
|
||||
"6252-\u79df\u91d1\u652f\u51fa": {},
|
||||
"6253-\u6587\u5177\u7528\u54c1": {},
|
||||
"6254-\u65c5\u8cbb": {},
|
||||
"6255-\u904b\u8cbb": {},
|
||||
"6256-\u90f5\u96fb\u8cbb": {},
|
||||
"6257-\u4fee\u7e55\u8cbb": {},
|
||||
"6259-\u5ee3\u544a\u8cbb": {},
|
||||
"6261-\u6c34\u96fb\u74e6\u65af\u8cbb": {},
|
||||
"6262-\u4fdd\u96aa\u8cbb": {},
|
||||
"6264-\u4ea4\u969b\u8cbb": {},
|
||||
"6265-\u6350\u8d08": {},
|
||||
"6266-\u7a05\u6350": {
|
||||
"account_type": "Tax",
|
||||
"tax_rate": 5.0
|
||||
},
|
||||
"6267-\u5446\u5e33\u640d\u5931": {},
|
||||
"6268-\u6298\u820a": {
|
||||
"account_type": "Depreciation"
|
||||
},
|
||||
"6269-\u5404\u9805\u8017\u7aed\u53ca\u6524\u63d0": {},
|
||||
"6271-\u5916\u92b7\u640d\u5931": {},
|
||||
"6272-\u4f19\u98df\u8cbb": {},
|
||||
"6273-\u8077\u5de5\u798f\u5229": {},
|
||||
"6274-\u7814\u7a76\u767c\u5c55\u8cbb\u7528": {},
|
||||
"6275-\u4f63\u91d1\u652f\u51fa": {},
|
||||
"6276-\u8a13\u7df4\u8cbb": {},
|
||||
"6278-\u52de\u52d9\u8cbb": {},
|
||||
"6288-\u5176\u4ed6\u7ba1\u7406\u53ca\u7e3d\u52d9\u8cbb\u7528": {}
|
||||
}
|
||||
},
|
||||
"63-\u7814\u7a76\u767c\u5c55\u8cbb\u7528": {
|
||||
"635~638-\u7814\u7a76\u767c\u5c55\u8cbb\u7528": {
|
||||
"6351-\u85aa\u8cc7\u652f\u51fa": {},
|
||||
"6352-\u79df\u91d1\u652f\u51fa": {},
|
||||
"6353-\u6587\u5177\u7528\u54c1": {},
|
||||
"6354-\u65c5\u8cbb": {},
|
||||
"6355-\u904b\u8cbb": {},
|
||||
"6356-\u90f5\u96fb\u8cbb": {},
|
||||
"6357-\u4fee\u7e55\u8cbb": {},
|
||||
"6361-\u6c34\u96fb\u74e6\u65af\u8cbb": {},
|
||||
"6362-\u4fdd\u96aa\u8cbb": {},
|
||||
"6364-\u4ea4\u969b\u8cbb": {},
|
||||
"6366-\u7a05\u6350": {
|
||||
"account_type": "Tax",
|
||||
"tax_rate": 5.0
|
||||
},
|
||||
"6368-\u6298\u820a": {
|
||||
"account_type": "Depreciation"
|
||||
},
|
||||
"6369-\u5404\u9805\u8017\u7aed\u53ca\u6524\u63d0": {},
|
||||
"6372-\u4f19\u98df\u8cbb": {},
|
||||
"6373-\u8077\u5de5\u798f\u5229": {},
|
||||
"6376-\u8a13\u7df4\u8cbb": {},
|
||||
"6378-\u5176\u4ed6\u7814\u7a76\u767c\u5c55\u8cbb\u7528": {}
|
||||
}
|
||||
},
|
||||
"root_type": "Expense"
|
||||
},
|
||||
"7-\u71df\u696d\u5916\u6536\u5165\u53ca\u8cbb\u7528": {
|
||||
"71~74-\u71df\u696d\u5916\u6536\u5165": {
|
||||
"711-\u5229\u606f\u6536\u5165": {
|
||||
"7111-\u5229\u606f\u6536\u5165": {}
|
||||
},
|
||||
"712-\u6295\u8cc7\u6536\u76ca": {
|
||||
"7121-\u6b0a\u76ca\u6cd5\u8a8d\u5217\u4e4b\u6295\u8cc7\u6536\u76ca": {},
|
||||
"7122-\u80a1\u5229\u6536\u5165": {},
|
||||
"7123-\u77ed\u671f\u6295\u8cc7\u5e02\u50f9\u56de\u5347\u5229\u76ca": {}
|
||||
},
|
||||
"713-\u514c\u63db\u5229\u76ca": {
|
||||
"7131-\u514c\u63db\u5229\u76ca": {}
|
||||
},
|
||||
"714-\u8655\u5206\u6295\u8cc7\u6536\u76ca": {
|
||||
"7141-\u8655\u5206\u6295\u8cc7\u6536\u76ca": {}
|
||||
},
|
||||
"715-\u8655\u5206\u8cc7\u7522\u6ea2\u50f9\u6536\u5165": {
|
||||
"7151-\u8655\u5206\u8cc7\u7522\u6ea2\u50f9\u6536\u5165": {}
|
||||
},
|
||||
"748-\u5176\u4ed6\u71df\u696d\u5916\u6536\u5165": {
|
||||
"7481-\u6350\u8d08\u6536\u5165": {},
|
||||
"7482-\u79df\u91d1\u6536\u5165": {},
|
||||
"7483-\u4f63\u91d1\u6536\u5165": {},
|
||||
"7484-\u51fa\u552e\u4e0b\u8173\u53ca\u5ee2\u6599\u6536\u5165": {},
|
||||
"7485-\u5b58\u8ca8\u76e4\u76c8": {},
|
||||
"7486-\u5b58\u8ca8\u8dcc\u50f9\u56de\u5347\u5229\u76ca": {},
|
||||
"7487-\u58de\u5e33\u8f49\u56de\u5229\u76ca": {},
|
||||
"7488-\u5176\u4ed6\u71df\u696d\u5916\u6536\u5165\u2014\u5176\u4ed6": {}
|
||||
}
|
||||
},
|
||||
"75~78-\u71df\u696d\u5916\u8cbb\u7528": {
|
||||
"751-\u5229\u606f\u8cbb\u7528": {
|
||||
"7511-\u5229\u606f\u8cbb\u7528": {}
|
||||
},
|
||||
"752-\u6295\u8cc7\u640d\u5931": {
|
||||
"7521-\u6b0a\u76ca\u6cd5\u8a8d\u5217\u4e4b\u6295\u8cc7\u640d\u5931": {},
|
||||
"7523-\u77ed\u671f\u6295\u8cc7\u672a\u5be6\u73fe\u8dcc\u50f9\u640d\u5931": {}
|
||||
},
|
||||
"753-\u514c\u63db\u640d\u5931": {
|
||||
"7531-\u514c\u63db\u640d\u5931": {}
|
||||
},
|
||||
"754-\u8655\u5206\u6295\u8cc7\u640d\u5931": {
|
||||
"7541-\u8655\u5206\u6295\u8cc7\u640d\u5931": {}
|
||||
},
|
||||
"755-\u8655\u5206\u8cc7\u7522\u640d\u5931": {
|
||||
"7551-\u8655\u5206\u8cc7\u7522\u640d\u5931 ": {}
|
||||
},
|
||||
"788-\u5176\u4ed6\u71df\u696d\u5916\u8cbb\u7528": {
|
||||
"7881-\u505c\u5de5\u640d\u5931": {},
|
||||
"7882-\u707d\u5bb3\u640d\u5931": {},
|
||||
"7885-\u5b58\u8ca8\u76e4\u640d": {},
|
||||
"7886-\u5b58\u8ca8\u8dcc\u50f9\u53ca\u5446\u6eef\u640d\u5931": {},
|
||||
"7888-\u5176\u4ed6\u71df\u696d\u5916\u8cbb\u7528\u2014\u5176\u4ed6": {}
|
||||
}
|
||||
},
|
||||
"root_type": "Income"
|
||||
},
|
||||
"8-\u6240\u5f97\u7a05\u8cbb\u7528(\u5229\u76ca)": {
|
||||
"81-\u6240\u5f97\u7a05\u8cbb\u7528(\u5229\u76ca)": {
|
||||
"811-\u6240\u5f97\u7a05\u8cbb\u7528(\u5229\u76ca) ": {
|
||||
"8111-\u6240\u5f97\u7a05\u8cbb\u7528(\u5229\u76ca) ": {}
|
||||
}
|
||||
},
|
||||
"root_type": "Expense"
|
||||
},
|
||||
"9-\u975e\u7d93\u5e38\u71df\u696d\u640d\u76ca": {
|
||||
"91-\u505c\u696d\u90e8\u9580\u640d\u76ca": {
|
||||
"911-\u505c\u696d\u90e8\u9580\u640d\u76ca\u2014\u505c\u696d\u524d\u71df\u696d\u640d\u76ca": {
|
||||
"9111-\u505c\u696d\u90e8\u9580\u640d\u76ca\u2014\u505c\u696d\u524d\u71df\u696d\u640d\u76ca": {}
|
||||
},
|
||||
"912-\u505c\u696d\u90e8\u9580\u640d\u76ca\u2014\u8655\u5206\u640d\u76ca": {
|
||||
"9121-\u505c\u696d\u90e8\u9580\u640d\u76ca\u2014\u8655\u5206\u640d\u76ca": {}
|
||||
}
|
||||
},
|
||||
"92-\u975e\u5e38\u640d\u76ca": {
|
||||
"921-\u975e\u5e38\u640d\u76ca": {
|
||||
"9211-\u975e\u5e38\u640d\u76ca": {}
|
||||
}
|
||||
},
|
||||
"93-\u6703\u8a08\u539f\u5247\u8b8a\u52d5\u7d2f\u7a4d\u5f71\u97ff\u6578": {
|
||||
"931-\u6703\u8a08\u539f\u5247\u8b8a\u52d5\u7d2f\u7a4d\u5f71\u97ff\u6578": {
|
||||
"9311-\u6703\u8a08\u539f\u5247\u8b8a\u52d5\u7d2f\u7a4d\u5f71\u97ff\u6578": {}
|
||||
}
|
||||
},
|
||||
"94-\u5c11\u6578\u80a1\u6b0a\u6de8\u5229": {
|
||||
"941-\u5c11\u6578\u80a1\u6b0a\u6de8\u5229": {
|
||||
"9411-\u5c11\u6578\u80a1\u6b0a\u6de8\u5229": {}
|
||||
}
|
||||
},
|
||||
"root_type": "Expense"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
QUnit.module('Account');
|
||||
|
||||
QUnit.test("test Bank Reconciliation", function(assert) {
|
||||
assert.expect(0);
|
||||
let done = assert.async();
|
||||
frappe.run_serially([
|
||||
() => frappe.set_route('Form', 'Bank Reconciliation'),
|
||||
() => cur_frm.set_value('bank_account','Cash - FT'),
|
||||
() => frappe.click_button('Get Payment Entries'),
|
||||
() => {
|
||||
for(var i=0;i<=cur_frm.doc.payment_entries.length-1;i++){
|
||||
cur_frm.doc.payment_entries[i].clearance_date = frappe.datetime.add_days(frappe.datetime.now_date(), 2);
|
||||
}
|
||||
},
|
||||
() => {cur_frm.refresh_fields('payment_entries');},
|
||||
() => frappe.click_button('Update Clearance Date'),
|
||||
() => frappe.timeout(0.5),
|
||||
() => frappe.click_button('Close'),
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
|
||||
39
erpnext/accounts/doctype/journal_entry/test_journal_entry.js
Normal file
@@ -0,0 +1,39 @@
|
||||
QUnit.module('Journal Entry');
|
||||
|
||||
QUnit.test("test journal entry", function(assert) {
|
||||
assert.expect(2);
|
||||
let done = assert.async();
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Journal Entry', [
|
||||
{posting_date:frappe.datetime.add_days(frappe.datetime.nowdate(), 0)},
|
||||
{accounts: [
|
||||
[
|
||||
{'account':'Debtors - '+frappe.get_abbr(frappe.defaults.get_default('Company'))},
|
||||
{'party_type':'Customer'},
|
||||
{'party':'Test Customer 1'},
|
||||
{'credit_in_account_currency':1000},
|
||||
{'is_advance':'Yes'},
|
||||
],
|
||||
[
|
||||
{'account':'HDFC - '+frappe.get_abbr(frappe.defaults.get_default('Company'))},
|
||||
{'debit_in_account_currency':1000},
|
||||
]
|
||||
]},
|
||||
{cheque_no:1234},
|
||||
{cheque_date: frappe.datetime.add_days(frappe.datetime.nowdate(), -1)},
|
||||
{user_remark: 'Test'},
|
||||
]);
|
||||
},
|
||||
() => cur_frm.save(),
|
||||
() => {
|
||||
// get_item_details
|
||||
assert.ok(cur_frm.doc.total_debit==1000, "total debit correct");
|
||||
assert.ok(cur_frm.doc.total_credit==1000, "total credit correct");
|
||||
},
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(0.3),
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
@@ -569,7 +569,7 @@ frappe.ui.form.on('Payment Entry', {
|
||||
})
|
||||
|
||||
var allocated_negative_outstanding = 0;
|
||||
if((frm.doc.payment_type=="Receive" && frm.doc.party_type=="Customer") ||
|
||||
if ((frm.doc.payment_type=="Receive" && frm.doc.party_type=="Customer") ||
|
||||
(frm.doc.payment_type=="Pay" && frm.doc.party_type=="Supplier") ||
|
||||
(frm.doc.payment_type=="Pay" && frm.doc.party_type=="Employee")) {
|
||||
if(total_positive_outstanding_including_order > paid_amount) {
|
||||
@@ -579,7 +579,7 @@ frappe.ui.form.on('Payment Entry', {
|
||||
}
|
||||
|
||||
var allocated_positive_outstanding = paid_amount + allocated_negative_outstanding;
|
||||
} else {
|
||||
} else if (in_list(["Customer", "Supplier"], frm.doc.party_type)) {
|
||||
if(paid_amount > total_negative_outstanding) {
|
||||
if(total_negative_outstanding == 0) {
|
||||
frappe.msgprint(__("Cannot {0} {1} {2} without any negative outstanding invoice",
|
||||
|
||||
@@ -393,7 +393,7 @@ class PaymentEntry(AccountsController):
|
||||
if self.payment_type=="Receive":
|
||||
against_account = self.paid_to
|
||||
else:
|
||||
against_account = self.paid_from
|
||||
against_account = self.paid_from
|
||||
|
||||
|
||||
party_gl_dict = self.get_gl_dict({
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
QUnit.module('Accounts');
|
||||
|
||||
QUnit.test("test payment entry", function(assert) {
|
||||
assert.expect(1);
|
||||
let done = assert.async();
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Payment Entry', [
|
||||
{payment_type:'Receive'},
|
||||
{mode_of_payment:'Cash'},
|
||||
{party_type:'Customer'},
|
||||
{party:'Test Customer 3'},
|
||||
{paid_amount:675},
|
||||
{reference_no:123},
|
||||
{reference_date: frappe.datetime.add_days(frappe.datetime.nowdate(), 0)},
|
||||
]);
|
||||
},
|
||||
() => cur_frm.save(),
|
||||
() => {
|
||||
// get_item_details
|
||||
assert.ok(cur_frm.doc.total_allocated_amount==675, "Allocated AmountCorrect");
|
||||
},
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(0.3),
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
QUnit.module('Purchaes Invoice');
|
||||
|
||||
QUnit.test("test purchase invoice", function(assert) {
|
||||
assert.expect(4);
|
||||
let done = assert.async();
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Purchase Invoice', [
|
||||
{supplier: 'Test Supplier'},
|
||||
{items: [
|
||||
[
|
||||
{'qty': 5},
|
||||
{'item_code': 'Test Product 1'},
|
||||
{'rate':100},
|
||||
]
|
||||
]},
|
||||
{update_stock:1},
|
||||
{supplier_address: 'Test1-Billing'},
|
||||
{contact_person: 'Contact 3-Test Supplier'},
|
||||
{taxes_and_charges: 'TEST In State GST'},
|
||||
{tc_name: 'Test Term 1'},
|
||||
{terms: 'This is Test'}
|
||||
]);
|
||||
},
|
||||
() => cur_frm.save(),
|
||||
() => {
|
||||
// get_item_details
|
||||
assert.ok(cur_frm.doc.items[0].item_name=='Test Product 1', "Item name correct");
|
||||
// get tax details
|
||||
assert.ok(cur_frm.doc.taxes_and_charges=='TEST In State GST', "Tax details correct");
|
||||
// get tax account head details
|
||||
assert.ok(cur_frm.doc.taxes[0].account_head=='CGST - '+frappe.get_abbr(frappe.defaults.get_default('Company')), " Account Head abbr correct");
|
||||
// grand_total Calculated
|
||||
assert.ok(cur_frm.doc.grand_total==590, "Grad Total correct");
|
||||
|
||||
},
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(0.3),
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
QUnit.module('Sales Taxes and Charges Template');
|
||||
|
||||
QUnit.test("test sales taxes and charges template", function(assert) {
|
||||
assert.expect(1);
|
||||
let done = assert.async();
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Purchase Taxes and Charges Template', [
|
||||
{title: "TEST In State GST"},
|
||||
{taxes:[
|
||||
[
|
||||
{charge_type:"On Net Total"},
|
||||
{account_head:"CGST - "+frappe.get_abbr(frappe.defaults.get_default("Company")) }
|
||||
],
|
||||
[
|
||||
{charge_type:"On Net Total"},
|
||||
{account_head:"SGST - "+frappe.get_abbr(frappe.defaults.get_default("Company")) }
|
||||
]
|
||||
]}
|
||||
]);
|
||||
},
|
||||
() => {assert.ok(cur_frm.doc.title=='TEST In State GST');},
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -320,8 +320,7 @@ def make_invoice(doc_list={}, email_queue_list={}, customers_list={}):
|
||||
si_doc.set_posting_time = 1
|
||||
si_doc.customer = get_customer_id(doc)
|
||||
si_doc.due_date = doc.get('posting_date')
|
||||
submit_invoice(si_doc, name, doc)
|
||||
name_list.append(name)
|
||||
name_list = submit_invoice(si_doc, name, doc, name_list)
|
||||
else:
|
||||
name_list.append(name)
|
||||
|
||||
@@ -475,19 +474,29 @@ def validate_item(doc):
|
||||
frappe.db.commit()
|
||||
|
||||
|
||||
def submit_invoice(si_doc, name, doc):
|
||||
def submit_invoice(si_doc, name, doc, name_list):
|
||||
try:
|
||||
si_doc.insert()
|
||||
si_doc.submit()
|
||||
frappe.db.commit()
|
||||
name_list.append(name)
|
||||
except Exception as e:
|
||||
if frappe.message_log: frappe.message_log.pop()
|
||||
frappe.db.rollback()
|
||||
save_invoice(e, si_doc, name)
|
||||
frappe.log_error(frappe.get_traceback())
|
||||
name_list = save_invoice(e, si_doc, name, name_list)
|
||||
|
||||
def save_invoice(e, si_doc, name):
|
||||
if not frappe.db.exists('Sales Invoice', {'offline_pos_name': name}):
|
||||
si_doc.docstatus = 0
|
||||
si_doc.flags.ignore_mandatory = True
|
||||
si_doc.due_date = si_doc.posting_date
|
||||
si_doc.insert()
|
||||
return name_list
|
||||
|
||||
def save_invoice(e, si_doc, name, name_list):
|
||||
try:
|
||||
if not frappe.db.exists('Sales Invoice', {'offline_pos_name': name}):
|
||||
si_doc.docstatus = 0
|
||||
si_doc.flags.ignore_mandatory = True
|
||||
si_doc.due_date = si_doc.posting_date
|
||||
si_doc.insert()
|
||||
name_list.append(name)
|
||||
except Exception:
|
||||
frappe.log_error(frappe.get_traceback())
|
||||
|
||||
return name_list
|
||||
|
||||
@@ -109,7 +109,7 @@ class SalesInvoice(SellingController):
|
||||
|
||||
if not self.recurring_id:
|
||||
frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype,
|
||||
self.company, self.base_grand_total, self)
|
||||
self.company, self.base_grand_total, self)
|
||||
|
||||
self.check_prev_docstatus()
|
||||
|
||||
|
||||
43
erpnext/accounts/doctype/sales_invoice/test_sales_invoice.js
Normal file
@@ -0,0 +1,43 @@
|
||||
QUnit.module('Sales Invoice');
|
||||
|
||||
QUnit.test("test sales Invoice", function(assert) {
|
||||
assert.expect(4);
|
||||
let done = assert.async();
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Sales Invoice', [
|
||||
{customer: 'Test Customer 1'},
|
||||
{items: [
|
||||
[
|
||||
{'qty': 5},
|
||||
{'item_code': 'Test Product 1'},
|
||||
]
|
||||
]},
|
||||
{update_stock:1},
|
||||
{customer_address: 'Test1-Billing'},
|
||||
{shipping_address_name: 'Test1-Shipping'},
|
||||
{contact_person: 'Contact 1-Test Customer 1'},
|
||||
{taxes_and_charges: 'TEST In State GST'},
|
||||
{tc_name: 'Test Term 1'},
|
||||
{terms: 'This is Test'}
|
||||
]);
|
||||
},
|
||||
() => cur_frm.save(),
|
||||
() => {
|
||||
// get_item_details
|
||||
assert.ok(cur_frm.doc.items[0].item_name=='Test Product 1', "Item name correct");
|
||||
// get tax details
|
||||
assert.ok(cur_frm.doc.taxes_and_charges=='TEST In State GST', "Tax details correct");
|
||||
// get tax account head details
|
||||
assert.ok(cur_frm.doc.taxes[0].account_head=='CGST - '+frappe.get_abbr(frappe.defaults.get_default('Company')), " Account Head abbr correct");
|
||||
// grand_total Calculated
|
||||
assert.ok(cur_frm.doc.grand_total==590, "Grad Total correct");
|
||||
|
||||
},
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(0.3),
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
QUnit.module('Sales Invoice');
|
||||
|
||||
QUnit.test("test sales Invoice", function(assert) {
|
||||
assert.expect(4);
|
||||
let done = assert.async();
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Sales Invoice', [
|
||||
{customer: 'Test Customer 1'},
|
||||
{items: [
|
||||
[
|
||||
{'qty': 5},
|
||||
{'item_code': 'Test Product 1'},
|
||||
]
|
||||
]},
|
||||
{update_stock:1},
|
||||
{customer_address: 'Test1-Billing'},
|
||||
{shipping_address_name: 'Test1-Shipping'},
|
||||
{contact_person: 'Contact 1-Test Customer 1'},
|
||||
{taxes_and_charges: 'TEST In State GST'},
|
||||
{tc_name: 'Test Term 1'},
|
||||
{terms: 'This is Test'}
|
||||
]);
|
||||
},
|
||||
() => cur_frm.save(),
|
||||
() => {
|
||||
// get_item_details
|
||||
assert.ok(cur_frm.doc.items[0].item_name=='Test Product 1', "Item name correct");
|
||||
// get tax details
|
||||
assert.ok(cur_frm.doc.taxes_and_charges=='TEST In State GST', "Tax details correct");
|
||||
// get tax account head details
|
||||
assert.ok(cur_frm.doc.taxes[0].account_head=='CGST - '+frappe.get_abbr(frappe.defaults.get_default('Company')), " Account Head abbr correct");
|
||||
// grand_total Calculated
|
||||
assert.ok(cur_frm.doc.grand_total==590, "Grad Total correct");
|
||||
|
||||
},
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(0.3),
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
QUnit.module('Sales Invoice');
|
||||
|
||||
QUnit.test("test sales Invoice with payment", function(assert) {
|
||||
assert.expect(4);
|
||||
let done = assert.async();
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Sales Invoice', [
|
||||
{customer: 'Test Customer 1'},
|
||||
{items: [
|
||||
[
|
||||
{'qty': 5},
|
||||
{'item_code': 'Test Product 1'},
|
||||
]
|
||||
]},
|
||||
{update_stock:1},
|
||||
{customer_address: 'Test1-Billing'},
|
||||
{shipping_address_name: 'Test1-Shipping'},
|
||||
{contact_person: 'Contact 1-Test Customer 1'},
|
||||
{taxes_and_charges: 'TEST In State GST'},
|
||||
{tc_name: 'Test Term 1'},
|
||||
{terms: 'This is Test'}
|
||||
]);
|
||||
},
|
||||
() => cur_frm.save(),
|
||||
() => {
|
||||
// get_item_details
|
||||
assert.ok(cur_frm.doc.items[0].item_name=='Test Product 1', "Item name correct");
|
||||
// get tax details
|
||||
assert.ok(cur_frm.doc.taxes_and_charges=='TEST In State GST', "Tax details correct");
|
||||
// grand_total Calculated
|
||||
assert.ok(cur_frm.doc.grand_total==590, "Grad Total correct");
|
||||
|
||||
},
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(2),
|
||||
() => frappe.tests.click_button('Close'),
|
||||
() => frappe.tests.click_button('Make'),
|
||||
() => frappe.tests.click_link('Payment'),
|
||||
() => frappe.timeout(0.2),
|
||||
() => { cur_frm.set_value('mode_of_payment','Cash');},
|
||||
() => { cur_frm.set_value('paid_to','Cash - '+frappe.get_abbr(frappe.defaults.get_default('Company')));},
|
||||
() => {cur_frm.set_value('reference_no','TEST1234');},
|
||||
() => {cur_frm.set_value('reference_date',frappe.datetime.add_days(frappe.datetime.nowdate(), 0));},
|
||||
() => cur_frm.save(),
|
||||
() => {
|
||||
// get payment details
|
||||
assert.ok(cur_frm.doc.paid_amount==590, "Paid Amount Correct");
|
||||
},
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
QUnit.module('Sales Invoice');
|
||||
|
||||
QUnit.test("test sales Invoice with payment request", function(assert) {
|
||||
assert.expect(4);
|
||||
let done = assert.async();
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Sales Invoice', [
|
||||
{customer: 'Test Customer 1'},
|
||||
{items: [
|
||||
[
|
||||
{'qty': 5},
|
||||
{'item_code': 'Test Product 1'},
|
||||
]
|
||||
]},
|
||||
{update_stock:1},
|
||||
{customer_address: 'Test1-Billing'},
|
||||
{shipping_address_name: 'Test1-Shipping'},
|
||||
{contact_person: 'Contact 1-Test Customer 1'},
|
||||
{taxes_and_charges: 'TEST In State GST'},
|
||||
{tc_name: 'Test Term 1'},
|
||||
{terms: 'This is Test'}
|
||||
]);
|
||||
},
|
||||
() => cur_frm.save(),
|
||||
() => {
|
||||
// get_item_details
|
||||
assert.ok(cur_frm.doc.items[0].item_name=='Test Product 1', "Item name correct");
|
||||
// get tax details
|
||||
assert.ok(cur_frm.doc.taxes_and_charges=='TEST In State GST', "Tax details correct");
|
||||
// grand_total Calculated
|
||||
assert.ok(cur_frm.doc.grand_total==590, "Grad Total correct");
|
||||
|
||||
},
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(2),
|
||||
() => frappe.tests.click_button('Close'),
|
||||
() => frappe.tests.click_button('Make'),
|
||||
() => frappe.tests.click_link('Payment Request'),
|
||||
() => frappe.timeout(0.2),
|
||||
() => { cur_frm.set_value('print_format','GST Tax Invoice');},
|
||||
() => { cur_frm.set_value('email_to','test@gmail.com');},
|
||||
() => cur_frm.save(),
|
||||
() => {
|
||||
// get payment details
|
||||
assert.ok(cur_frm.doc.grand_total==590, "grand total Correct");
|
||||
},
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
QUnit.module('Sales Invoice');
|
||||
|
||||
QUnit.test("test sales Invoice with serialize item", function(assert) {
|
||||
assert.expect(5);
|
||||
let done = assert.async();
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Sales Invoice', [
|
||||
{customer: 'Test Customer 1'},
|
||||
{items: [
|
||||
[
|
||||
{'qty': 2},
|
||||
{'item_code': 'Test Product 4'},
|
||||
]
|
||||
]},
|
||||
{update_stock:1},
|
||||
{customer_address: 'Test1-Billing'},
|
||||
{shipping_address_name: 'Test1-Shipping'},
|
||||
{contact_person: 'Contact 1-Test Customer 1'},
|
||||
{taxes_and_charges: 'TEST In State GST'},
|
||||
{tc_name: 'Test Term 1'},
|
||||
{terms: 'This is Test'}
|
||||
]);
|
||||
},
|
||||
() => cur_frm.save(),
|
||||
() => {
|
||||
// get_item_details
|
||||
assert.ok(cur_frm.doc.items[0].item_name=='Test Product 4', "Item name correct");
|
||||
// get tax details
|
||||
assert.ok(cur_frm.doc.taxes_and_charges=='TEST In State GST', "Tax details correct");
|
||||
// get tax account head details
|
||||
assert.ok(cur_frm.doc.taxes[0].account_head=='CGST - '+frappe.get_abbr(frappe.defaults.get_default('Company')), " Account Head abbr correct");
|
||||
// get batch number
|
||||
assert.ok(cur_frm.doc.items[0].batch_no=='TEST-BATCH-001', " Batch Details correct");
|
||||
// grand_total Calculated
|
||||
assert.ok(cur_frm.doc.grand_total==218, "Grad Total correct");
|
||||
|
||||
},
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(0.3),
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -54,13 +54,15 @@ class ShippingRule(Document):
|
||||
d.idx = i + 1
|
||||
|
||||
def validate_overlapping_shipping_rule_conditions(self):
|
||||
def overlap_exists_between((x1, x2), (y1, y2)):
|
||||
def overlap_exists_between(num_range1, num_range2):
|
||||
"""
|
||||
(x1, x2) and (y1, y2) are two ranges
|
||||
if condition x = 100 to 300
|
||||
then condition y can only be like 50 to 99 or 301 to 400
|
||||
num_range1 and num_range2 are two ranges
|
||||
ranges are represented as a tuple e.g. range 100 to 300 is represented as (100, 300)
|
||||
if condition num_range1 = 100 to 300
|
||||
then condition num_range2 can only be like 50 to 99 or 301 to 400
|
||||
hence, non-overlapping condition = (x1 <= x2 < y1 <= y2) or (y1 <= y2 < x1 <= x2)
|
||||
"""
|
||||
(x1, x2), (y1, y2) = num_range1, num_range2
|
||||
separate = (x1 <= x2 <= y1 <= y2) or (y1 <= y2 <= x1 <= x2)
|
||||
return (not separate)
|
||||
|
||||
|
||||
@@ -260,9 +260,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
this.calculate_outstanding_amount();
|
||||
}
|
||||
|
||||
if (this.frm.doc.customer) {
|
||||
this.party_field.$input.val(this.frm.doc.customer);
|
||||
}
|
||||
this.set_customer_value_in_party_field();
|
||||
|
||||
if (!this.frm.doc.write_off_account) {
|
||||
this.frm.doc.write_off_account = doc.write_off_account
|
||||
@@ -273,6 +271,12 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
}
|
||||
},
|
||||
|
||||
set_customer_value_in_party_field: function() {
|
||||
if (this.frm.doc.customer) {
|
||||
this.party_field.$input.val(this.frm.doc.customer);
|
||||
}
|
||||
},
|
||||
|
||||
get_invoice_doc: function (si_docs) {
|
||||
var me = this;
|
||||
this.si_docs = this.get_doc_from_localstorage();
|
||||
@@ -426,11 +430,16 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
});
|
||||
|
||||
this.serach_item.make_input();
|
||||
this.serach_item.$input.on("keyup", function () {
|
||||
setTimeout(function () {
|
||||
me.items = me.get_items();
|
||||
me.make_item_list();
|
||||
}, 1000);
|
||||
|
||||
this.serach_item.$input.on("keypress", function (event) {
|
||||
|
||||
clearTimeout(me.last_search_timeout);
|
||||
me.last_search_timeout = setTimeout(() => {
|
||||
if((me.serach_item.$input.val() != "") || (event.which == 13)) {
|
||||
me.items = me.get_items();
|
||||
me.make_item_list();
|
||||
}
|
||||
}, 400);
|
||||
});
|
||||
|
||||
this.search_item_group = this.wrapper.find('.search-item-group');
|
||||
@@ -681,6 +690,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
|
||||
set_focus: function () {
|
||||
if (this.default_customer || this.frm.doc.customer) {
|
||||
this.set_customer_value_in_party_field();
|
||||
this.serach_item.$input.focus();
|
||||
} else {
|
||||
this.party_field.$input.focus();
|
||||
@@ -727,14 +737,12 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
|
||||
input = input.toLowerCase();
|
||||
item = this.get_item(item.value);
|
||||
var searchtext =
|
||||
Object.keys(item)
|
||||
.filter(key => ['customer_name', 'customer_group', 'value', 'label', 'email_id', 'phone', 'mobile_no'].includes(key))
|
||||
.map(key => item[key])
|
||||
.join(" ")
|
||||
.toLowerCase();
|
||||
|
||||
return searchtext.includes(input)
|
||||
result = item ? item.searchtext.includes(input) : '';
|
||||
if(!result) {
|
||||
me.prepare_customer_mapper(input);
|
||||
} else {
|
||||
return result;
|
||||
}
|
||||
},
|
||||
item: function (item, input) {
|
||||
var d = this.get_item(item.value);
|
||||
@@ -755,6 +763,9 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
|
||||
this.party_field.$input
|
||||
.on('input', function (e) {
|
||||
if(me.customers_mapper.length <= 1) {
|
||||
me.prepare_customer_mapper(e.target.value);
|
||||
}
|
||||
me.party_field.awesomeplete.list = me.customers_mapper;
|
||||
})
|
||||
.on('awesomplete-select', function (e) {
|
||||
@@ -795,20 +806,56 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
});
|
||||
},
|
||||
|
||||
prepare_customer_mapper: function() {
|
||||
prepare_customer_mapper: function(key) {
|
||||
var me = this;
|
||||
var customer_data = '';
|
||||
|
||||
this.customers_mapper = this.customers.map(function (c) {
|
||||
contact = me.contacts[c.name];
|
||||
return {
|
||||
label: c.name,
|
||||
value: c.name,
|
||||
customer_name: c.customer_name,
|
||||
customer_group: c.customer_group,
|
||||
territory: c.territory,
|
||||
phone: contact ? contact["phone"] : '',
|
||||
mobile_no: contact ? contact["mobile_no"] : '',
|
||||
email_id: contact ? contact["email_id"] : ''
|
||||
if (key) {
|
||||
key = key.toLowerCase().trim();
|
||||
var re = new RegExp('%', 'g');
|
||||
var reg = new RegExp(key.replace(re, '\\w*\\s*[a-zA-Z0-9]*'));
|
||||
|
||||
customer_data = $.grep(this.customers, function(data) {
|
||||
contact = me.contacts[data.name];
|
||||
if(reg.test(data.name.toLowerCase())
|
||||
|| reg.test(data.customer_name.toLowerCase())
|
||||
|| (contact && reg.test(contact["mobile_no"]))
|
||||
|| (contact && reg.test(contact["phone"]))
|
||||
|| (data.customer_group && reg.test(data.customer_group.toLowerCase()))){
|
||||
return data;
|
||||
}
|
||||
})
|
||||
} else {
|
||||
customer_data = this.customers;
|
||||
}
|
||||
|
||||
this.customers_mapper = [];
|
||||
|
||||
customer_data.forEach(function (c, index) {
|
||||
if(index < 30) {
|
||||
contact = me.contacts[c.name];
|
||||
if(contact && !c['phone']) {
|
||||
c["phone"] = contact["phone"];
|
||||
c["email_id"] = contact["email_id"];
|
||||
c["mobile_no"] = contact["mobile_no"];
|
||||
}
|
||||
|
||||
me.customers_mapper.push({
|
||||
label: c.name,
|
||||
value: c.name,
|
||||
customer_name: c.customer_name,
|
||||
customer_group: c.customer_group,
|
||||
territory: c.territory,
|
||||
phone: contact ? contact["phone"] : '',
|
||||
mobile_no: contact ? contact["mobile_no"] : '',
|
||||
email_id: contact ? contact["email_id"] : '',
|
||||
searchtext: ['customer_name', 'customer_group', 'name', 'value',
|
||||
'label', 'email_id', 'phone', 'mobile_no']
|
||||
.map(key => c[key]).join(' ')
|
||||
.toLowerCase()
|
||||
});
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ QUnit.test("test:POS Profile", function(assert) {
|
||||
() => {
|
||||
return frappe.tests.make("POS Profile", [
|
||||
{naming_series: "SINV"},
|
||||
{company: "_Test Company"},
|
||||
{company: "Test Company"},
|
||||
{country: "India"},
|
||||
{currency: "INR"},
|
||||
{write_off_account: "Write Off - _TC"},
|
||||
{write_off_cost_center: "Main - _TC"},
|
||||
{write_off_account: "Write Off - TC"},
|
||||
{write_off_cost_center: "Main - TC"},
|
||||
{payments: [
|
||||
[
|
||||
{"default": 1},
|
||||
@@ -35,15 +35,16 @@ QUnit.test("test:Sales Invoice", function(assert) {
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make("Sales Invoice", [
|
||||
{customer: "_Test Customer 2"},
|
||||
{company: "_Test Company"},
|
||||
{customer: "Test Customer 2"},
|
||||
{company: "Test Company"},
|
||||
{is_pos: 1},
|
||||
{posting_date: frappe.datetime.get_today()},
|
||||
{due_date: frappe.datetime.get_today()},
|
||||
{items: [
|
||||
[
|
||||
{"item_code": "_Test Item"},
|
||||
{"qty": 5}
|
||||
{"item_code": "Test Product 1"},
|
||||
{"qty": 5},
|
||||
{"warehouse":'Stores - TC'}
|
||||
]]
|
||||
}
|
||||
]);
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"align_labels_right": 0,
|
||||
"creation": "2017-08-08 12:33:04.773099",
|
||||
"custom_format": 1,
|
||||
"disabled": 0,
|
||||
"doc_type": "Sales Invoice",
|
||||
"docstatus": 0,
|
||||
"doctype": "Print Format",
|
||||
"font": "Default",
|
||||
"html": "<style>\n\t.print-format table, .print-format tr, \n\t.print-format td, .print-format div, .print-format p {\n\t\tfont-family: Monospace;\n\t\tline-height: 200%;\n\t\tvertical-align: middle;\n\t}\n\t@media screen {\n\t\t.print-format {\n\t\t\twidth: 4in;\n\t\t\tpadding: 0.25in;\n\t\t\tmin-height: 8in;\n\t\t}\n\t}\n</style>\n\n<p class=\"text-center\">\n\t{{ doc.company }}<br>\n\t{% if doc.company_address_display %}\n\t\t{% set company_address = doc.company_address_display.replace(\"\\n\", \" \").replace(\"<br>\", \" \") %}\n\t\t{% if \"GSTIN\" not in company_address %}\n\t\t\t{{ company_address }}\n\t\t\t<b>{{ _(\"GSTIN\") }}:</b>{{ doc.company_gstin }}\n\t\t{% else %}\n\t\t\t{{ company_address.replace(\"GSTIN\", \"<br>GSTIN\") }}\n\t\t{% endif %}\n\t{% endif %}\n\t<br>\n\t<b>{{ doc.select_print_heading or _(\"Invoice\") }}</b><br>\n</p>\n<p>\n\t<b>{{ _(\"Receipt No\") }}:</b> {{ doc.name }}<br>\n\t<b>{{ _(\"Date\") }}:</b> {{ doc.get_formatted(\"posting_date\") }}<br>\n\t{% if doc.grand_total > 50000 %}\n\t\t{% set customer_address = doc.address_display.replace(\"\\n\", \" \").replace(\"<br>\", \" \") %}\n\t\t<b>{{ _(\"Customer\") }}:</b><br>\n\t\t{{ doc.customer_name }}<br>\n\t\t{{ customer_address }}\n\t{% endif %}\n</p>\n\n<hr>\n<table class=\"table table-condensed cart no-border\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"40%\">{{ _(\"Item\") }}</b></th>\n\t\t\t<th width=\"30%\" class=\"text-right\">{{ _(\"Qty\") }}</th>\n\t\t\t<th width=\"30%\" class=\"text-right\">{{ _(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{%- for item in doc.items -%}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_code }}\n\t\t\t\t{%- if item.item_name != item.item_code -%}\n\t\t\t\t\t<br>{{ item.item_name }}\n\t\t\t\t{%- endif -%}\n\t\t\t\t{%- if item.gst_hsn_code -%}\n\t\t\t\t\t<br><b>{{ _(\"HSN/SAC\") }}:</b> {{ item.gst_hsn_code }}\n\t\t\t\t{%- endif -%}\n\t\t\t\t{%- if item.serial_no -%}\n\t\t\t\t\t<br><b>{{ _(\"Serial No\") }}:</b> {{ item.serial_no }}\n\t\t\t\t{%- endif -%}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ item.qty }}<br>@ {{ item.rate }}</td>\n\t\t\t<td class=\"text-right\">{{ item.get_formatted(\"amount\") }}</td>\n\t\t</tr>\n\t\t{%- endfor -%}\n\t</tbody>\n</table>\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ _(\"Net Total\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"net_total\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- for row in doc.taxes -%}\n\t\t{%- if not row.included_in_print_rate -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ row.description }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ row.get_formatted(\"tax_amount\", doc) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- endif -%}\n\t\t{%- endfor -%}\n\t\t{%- if doc.discount_amount -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t{{ _(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"discount_amount\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- endif -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ _(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"grand_total\") }}\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n</table>\n<p><b>Tax Breakup:</b></p>\n<div style=\"font-size: 8px\">\n\t{{ doc.other_charges_calculation }}\n</div>\n<p>{{ doc.terms or \"\" }}</p>\n<p class=\"text-center\">{{ _(\"Thank you, please visit again.\") }}</p>",
|
||||
"idx": 0,
|
||||
"line_breaks": 0,
|
||||
"modified": "2017-09-14 15:54:19.467642",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "GST POS Invoice",
|
||||
"owner": "Administrator",
|
||||
"print_format_builder": 0,
|
||||
"print_format_type": "Server",
|
||||
"show_section_headings": 0,
|
||||
"standard": "Yes"
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"align_labels_left": 0,
|
||||
"align_labels_right": 0,
|
||||
"creation": "2016-05-05 17:16:18.564460",
|
||||
"custom_format": 1,
|
||||
"disabled": 0,
|
||||
@@ -10,7 +10,7 @@
|
||||
"html": "<style>\n\t.print-format table, .print-format tr, \n\t.print-format td, .print-format div, .print-format p {\n\t\tfont-family: Monospace;\n\t\tline-height: 200%;\n\t\tvertical-align: middle;\n\t}\n\t@media screen {\n\t\t.print-format {\n\t\t\twidth: 4in;\n\t\t\tpadding: 0.25in;\n\t\t\tmin-height: 8in;\n\t\t}\n\t}\n</style>\n\n<p class=\"text-center\">\n\t{{ company }}<br>\n\t{{ __(\"POS No : \") }} {{ offline_pos_name }}<br>\n</p>\n<p>\n\t<b>{{ __(\"Customer\") }}:</b> {{ customer }}<br>\n</p>\n\n<p>\n\t<b>{{ __(\"Date\") }}:</b> {{ dateutil.global_date_format(posting_date) }}<br>\n</p>\n\n<hr>\n<table class=\"table table-condensed cart no-border\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"50%\">{{ __(\"Item\") }}</b></th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Qty\") }}</th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{% for item in items %}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_name }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ format_number(item.qty, null,precision(\"difference\")) }}<br>@ {{ format_currency(item.rate, currency) }}</td>\n\t\t\t<td class=\"text-right\">{{ format_currency(item.amount, currency) }}</td>\n\t\t</tr>\n\t\t{% endfor %}\n\t</tbody>\n</table>\n\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ __(\"Net Total\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% for row in taxes %}\n\t\t{% if not row.included_in_print_rate %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ row.description }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(row.tax_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t{% endfor %}\n\t\t{% if discount_amount %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t{{ __(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(discount_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(grand_total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Paid Amount\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(paid_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n\n<hr>\n<p>{{ terms }}</p>\n<p class=\"text-center\">{{ __(\"Thank you, please visit again.\") }}</p>",
|
||||
"idx": 0,
|
||||
"line_breaks": 0,
|
||||
"modified": "2017-05-19 14:36:04.740728",
|
||||
"modified": "2017-09-14 14:36:04.740728",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Point of Sale",
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
<thead>
|
||||
<tr>
|
||||
{% if(report.report_name === "Accounts Receivable" || report.report_name === "Accounts Payable") { %}
|
||||
<th style="width: 15%">{%= __("Date") %}</th>
|
||||
<th style="width: 15%">{%= __("Ref") %}</th>
|
||||
<th style="width: 40%">{%= __("Party") %}</th>
|
||||
<th style="width: 15%">{%= __("Invoiced Amount") %}</th>
|
||||
<th style="width: 15%">{%= __("Paid Amount") %}</th>
|
||||
<th style="width: 15%">{%= report.report_name === "Accounts Receivable" ? __('Credit Note') : __('Debit Note') %}</th>
|
||||
<th style="width: 15%">{%= __("Outstanding Amount") %}</th>
|
||||
<th style="width: 14%">{%= __("Date") %}</th>
|
||||
<th style="width: 16%">{%= __("Ref") %}</th>
|
||||
<th style="width: 30%">{%= (filters.customer || filters.supplier) ? __("Remarks"): __("Party") %}</th>
|
||||
<th style="width: 10%">{%= __("Invoiced Amount") %}</th>
|
||||
<th style="width: 10%">{%= __("Paid Amount") %}</th>
|
||||
<th style="width: 10%">{%= report.report_name === "Accounts Receivable" ? __('Credit Note') : __('Debit Note') %}</th>
|
||||
<th style="width: 10%">{%= __("Outstanding Amount") %}</th>
|
||||
{% } else { %}
|
||||
<th style="width: 40%">{%= __("Party") %}</th>
|
||||
<th style="width: 40%">{%= (filters.customer || filters.supplier) ? __("Remarks"): __("Party") %}</th>
|
||||
<th style="width: 15%">{%= __("Total Invoiced Amount") %}</th>
|
||||
<th style="width: 15%">{%= __("Total Paid Amount") %}</th>
|
||||
<th style="width: 15%">{%= report.report_name === "Accounts Receivable Summary" ? __('Credit Note Amount') : __('Debit Note Amount') %}</th>
|
||||
@@ -34,8 +34,12 @@
|
||||
<td>{%= dateutil.str_to_user(data[i][__("Posting Date")]) %}</td>
|
||||
<td>{%= data[i][__("Voucher Type")] %}
|
||||
<br>{%= data[i][__("Voucher No")] %}</td>
|
||||
<td>{%= data[i][__("Customer Name")] || data[i][__("Customer")] || data[i][__("Supplier Name")] || data[i][__("Supplier")] %}
|
||||
<br>{%= __("Remarks") %}: {%= data[i][__("Remarks")] %}</td>
|
||||
<td>
|
||||
{% if(!(filters.customer || filters.supplier)) { %}
|
||||
{%= data[i][__("Customer Name")] || data[i][__("Customer")] || data[i][__("Supplier Name")] || data[i][__("Supplier")] %}<br>{%= __("Remarks") %}:
|
||||
{% } %}
|
||||
{%= data[i][__("Remarks")] %}
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
{%= format_currency(data[i]["Invoiced Amount"], data[i]["currency"]) %}</td>
|
||||
<td style="text-align: right">
|
||||
@@ -59,8 +63,13 @@
|
||||
{% } else { %}
|
||||
{% if(data[i][__("Customer")] || data[i][__("Supplier")]|| " ") { %}
|
||||
{% if((data[i][__("Customer")] || data[i][__("Supplier")]) != __("'Total'")) { %}
|
||||
<td>{%= data[i][__("Customer")] || data[i][__("Supplier")] %}
|
||||
<br>{%= __("Remarks") %}: {%= data[i][__("Remarks")] %}</td>
|
||||
<td>
|
||||
{% if(!(filters.customer || filters.supplier)) { %}
|
||||
{%= data[i][__("Customer")] || data[i][__("Supplier")] %}
|
||||
<br>{%= __("Remarks") %}:
|
||||
{% } %}
|
||||
{%= data[i][__("Remarks")] %}
|
||||
</td>
|
||||
{% } else { %}
|
||||
<td><b>{%= __("Total") %}</b></td>
|
||||
{% } %}
|
||||
|
||||
@@ -99,7 +99,8 @@ def get_actual_details(name, filters):
|
||||
where
|
||||
b.name = ba.parent
|
||||
and b.docstatus = 1
|
||||
and ba.account=gl.account
|
||||
and ba.account=gl.account
|
||||
and b.{budget_against} = gl.{budget_against}
|
||||
and gl.fiscal_year=%s
|
||||
and b.{budget_against}=%s
|
||||
and exists(select name from `tab{tab}` where name=gl.{budget_against} and {cond})
|
||||
|
||||
@@ -7,7 +7,7 @@ frappe.query_reports["Item-wise Purchase Register"] = {
|
||||
"fieldname":"from_date",
|
||||
"label": __("From Date"),
|
||||
"fieldtype": "Date",
|
||||
"default": frappe.defaults.get_user_default("year_start_date"),
|
||||
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
|
||||
"width": "80"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
import frappe, erpnext
|
||||
from frappe import _
|
||||
from frappe.utils import flt
|
||||
from erpnext.accounts.report.item_wise_sales_register.item_wise_sales_register import get_tax_accounts
|
||||
@@ -14,10 +14,12 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
|
||||
if not filters: filters = {}
|
||||
columns = get_columns(additional_table_columns)
|
||||
|
||||
company_currency = erpnext.get_company_currency(filters.company)
|
||||
|
||||
item_list = get_items(filters, additional_query_columns)
|
||||
aii_account_map = get_aii_accounts()
|
||||
if item_list:
|
||||
itemised_tax, tax_columns = get_tax_accounts(item_list, columns,
|
||||
itemised_tax, tax_columns = get_tax_accounts(item_list, columns, company_currency,
|
||||
doctype="Purchase Invoice", tax_doctype="Purchase Taxes and Charges")
|
||||
|
||||
columns.append({
|
||||
@@ -26,7 +28,7 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
|
||||
"fieldtype": "Data",
|
||||
"width": 80
|
||||
})
|
||||
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
|
||||
|
||||
po_pr_map = get_purchase_receipts_against_purchase_order(item_list)
|
||||
|
||||
data = []
|
||||
@@ -47,7 +49,7 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
|
||||
|
||||
row += [
|
||||
d.credit_to, d.mode_of_payment, d.project, d.company, d.purchase_order,
|
||||
purchase_receipt, expense_account, d.qty, d.stock_uom, d.base_net_rate, d.base_net_amount
|
||||
purchase_receipt, expense_account, d.stock_qty, d.stock_uom, d.base_net_rate, d.base_net_amount
|
||||
]
|
||||
|
||||
total_tax = 0
|
||||
@@ -79,7 +81,7 @@ def get_columns(additional_table_columns):
|
||||
_("Mode of Payment") + ":Link/Mode of Payment:80", _("Project") + ":Link/Project:80",
|
||||
_("Company") + ":Link/Company:100", _("Purchase Order") + ":Link/Purchase Order:100",
|
||||
_("Purchase Receipt") + ":Link/Purchase Receipt:100", _("Expense Account") + ":Link/Account:140",
|
||||
_("Qty") + ":Float:120", _("Stock UOM") + "::100",
|
||||
_("Stock Qty") + ":Float:120", _("Stock UOM") + "::100",
|
||||
_("Rate") + ":Currency/currency:120", _("Amount") + ":Currency/currency:120"
|
||||
]
|
||||
|
||||
@@ -110,7 +112,7 @@ def get_items(filters, additional_query_columns):
|
||||
pi_item.name, pi_item.parent, pi.posting_date, pi.credit_to, pi.company,
|
||||
pi.supplier, pi.remarks, pi.base_net_total, pi_item.item_code, pi_item.item_name,
|
||||
pi_item.item_group, pi_item.project, pi_item.purchase_order, pi_item.purchase_receipt,
|
||||
pi_item.po_detail, pi_item.expense_account, pi_item.qty, pi_item.stock_uom,
|
||||
pi_item.po_detail, pi_item.expense_account, pi_item.stock_qty, pi_item.stock_uom,
|
||||
pi_item.base_net_rate, pi_item.base_net_amount,
|
||||
pi.supplier_name, pi.mode_of_payment {0}
|
||||
from `tabPurchase Invoice` pi, `tabPurchase Invoice Item` pi_item
|
||||
@@ -125,14 +127,15 @@ def get_purchase_receipts_against_purchase_order(item_list):
|
||||
po_pr_map = frappe._dict()
|
||||
po_item_rows = list(set([d.po_detail for d in item_list]))
|
||||
|
||||
purchase_receipts = frappe.db.sql("""
|
||||
select parent, purchase_order_item
|
||||
from `tabPurchase Receipt Item`
|
||||
where docstatus=1 and purchase_order_item in (%s)
|
||||
group by purchase_order_item, parent
|
||||
""" % (', '.join(['%s']*len(po_item_rows))), tuple(po_item_rows), as_dict=1)
|
||||
if po_item_rows:
|
||||
purchase_receipts = frappe.db.sql("""
|
||||
select parent, purchase_order_item
|
||||
from `tabPurchase Receipt Item`
|
||||
where docstatus=1 and purchase_order_item in (%s)
|
||||
group by purchase_order_item, parent
|
||||
""" % (', '.join(['%s']*len(po_item_rows))), tuple(po_item_rows), as_dict=1)
|
||||
|
||||
for pr in purchase_receipts:
|
||||
po_pr_map.setdefault(pr.po_detail, []).append(pr.parent)
|
||||
for pr in purchase_receipts:
|
||||
po_pr_map.setdefault(pr.po_detail, []).append(pr.parent)
|
||||
|
||||
return po_pr_map
|
||||
@@ -7,7 +7,7 @@ frappe.query_reports["Item-wise Sales Register"] = frappe.query_reports["Sales R
|
||||
"fieldname":"from_date",
|
||||
"label": __("From Date"),
|
||||
"fieldtype": "Date",
|
||||
"default": frappe.defaults.get_default("year_start_date"),
|
||||
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
|
||||
"width": "80"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
import frappe, erpnext
|
||||
from frappe import _
|
||||
from frappe.utils import flt
|
||||
from frappe.model.meta import get_field_precision
|
||||
from erpnext.accounts.report.sales_register.sales_register import get_mode_of_payments
|
||||
|
||||
def execute(filters=None):
|
||||
@@ -14,16 +15,17 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
|
||||
if not filters: filters = {}
|
||||
columns = get_columns(additional_table_columns)
|
||||
|
||||
company_currency = erpnext.get_company_currency(filters.company)
|
||||
|
||||
item_list = get_items(filters, additional_query_columns)
|
||||
if item_list:
|
||||
itemised_tax, tax_columns = get_tax_accounts(item_list, columns)
|
||||
itemised_tax, tax_columns = get_tax_accounts(item_list, columns, company_currency)
|
||||
columns.append({
|
||||
"fieldname": "currency",
|
||||
"label": _("Currency"),
|
||||
"fieldtype": "Data",
|
||||
"width": 80
|
||||
})
|
||||
company_currency = frappe.db.get_value("Company", filters.get("company"), "default_currency")
|
||||
mode_of_payments = get_mode_of_payments(set([d.parent for d in item_list]))
|
||||
so_dn_map = get_delivery_notes_against_sales_order(item_list)
|
||||
|
||||
@@ -47,7 +49,7 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
|
||||
row += [
|
||||
d.customer_group, d.debit_to, ", ".join(mode_of_payments.get(d.parent, [])),
|
||||
d.territory, d.project, d.company, d.sales_order,
|
||||
delivery_note, d.income_account, d.cost_center, d.qty, d.stock_uom,
|
||||
delivery_note, d.income_account, d.cost_center, d.stock_qty, d.stock_uom,
|
||||
d.base_net_rate, d.base_net_amount
|
||||
]
|
||||
|
||||
@@ -80,7 +82,7 @@ def get_columns(additional_table_columns):
|
||||
_("Project") + ":Link/Project:80", _("Company") + ":Link/Company:100",
|
||||
_("Sales Order") + ":Link/Sales Order:100", _("Delivery Note") + ":Link/Delivery Note:100",
|
||||
_("Income Account") + ":Link/Account:140", _("Cost Center") + ":Link/Cost Center:140",
|
||||
_("Qty") + ":Float:120", _("Stock UOM") + "::100",
|
||||
_("Stock Qty") + ":Float:120", _("Stock UOM") + "::100",
|
||||
_("Rate") + ":Currency/currency:120",
|
||||
_("Amount") + ":Currency/currency:120"
|
||||
]
|
||||
@@ -116,7 +118,7 @@ def get_items(filters, additional_query_columns):
|
||||
si.customer, si.remarks, si.territory, si.company, si.base_net_total,
|
||||
si_item.item_code, si_item.item_name, si_item.item_group, si_item.sales_order,
|
||||
si_item.delivery_note, si_item.income_account, si_item.cost_center,
|
||||
si_item.qty, si_item.stock_uom, si_item.base_net_rate, si_item.base_net_amount,
|
||||
si_item.stock_qty, si_item.stock_uom, si_item.base_net_rate, si_item.base_net_amount,
|
||||
si.customer_name, si.customer_group, si_item.so_detail, si.update_stock {0}
|
||||
from `tabSales Invoice` si, `tabSales Invoice Item` si_item
|
||||
where si.name = si_item.parent and si.docstatus = 1 %s
|
||||
@@ -127,28 +129,38 @@ def get_delivery_notes_against_sales_order(item_list):
|
||||
so_dn_map = frappe._dict()
|
||||
so_item_rows = list(set([d.so_detail for d in item_list]))
|
||||
|
||||
delivery_notes = frappe.db.sql("""
|
||||
select parent, so_detail
|
||||
from `tabDelivery Note Item`
|
||||
where docstatus=1 and so_detail in (%s)
|
||||
group by so_detail, parent
|
||||
""" % (', '.join(['%s']*len(so_item_rows))), tuple(so_item_rows), as_dict=1)
|
||||
if so_item_rows:
|
||||
delivery_notes = frappe.db.sql("""
|
||||
select parent, so_detail
|
||||
from `tabDelivery Note Item`
|
||||
where docstatus=1 and so_detail in (%s)
|
||||
group by so_detail, parent
|
||||
""" % (', '.join(['%s']*len(so_item_rows))), tuple(so_item_rows), as_dict=1)
|
||||
|
||||
for dn in delivery_notes:
|
||||
so_dn_map.setdefault(dn.so_detail, []).append(dn.parent)
|
||||
for dn in delivery_notes:
|
||||
so_dn_map.setdefault(dn.so_detail, []).append(dn.parent)
|
||||
|
||||
return so_dn_map
|
||||
|
||||
def get_tax_accounts(item_list, columns, doctype="Sales Invoice", tax_doctype="Sales Taxes and Charges"):
|
||||
def get_tax_accounts(item_list, columns, company_currency,
|
||||
doctype="Sales Invoice", tax_doctype="Sales Taxes and Charges"):
|
||||
import json
|
||||
item_row_map = {}
|
||||
tax_columns = []
|
||||
invoice_item_row = {}
|
||||
itemised_tax = {}
|
||||
|
||||
tax_amount_precision = get_field_precision(frappe.get_meta(tax_doctype).get_field("tax_amount"),
|
||||
currency=company_currency) or 2
|
||||
|
||||
for d in item_list:
|
||||
invoice_item_row.setdefault(d.parent, []).append(d)
|
||||
item_row_map.setdefault(d.parent, {}).setdefault(d.item_code, []).append(d)
|
||||
|
||||
conditions = ""
|
||||
if doctype == "Purchase Invoice":
|
||||
conditions = " and category in ('Total', 'Valuation and Total')"
|
||||
|
||||
tax_details = frappe.db.sql("""
|
||||
select
|
||||
parent, description, item_wise_tax_detail,
|
||||
@@ -158,8 +170,9 @@ def get_tax_accounts(item_list, columns, doctype="Sales Invoice", tax_doctype="S
|
||||
parenttype = %s and docstatus = 1
|
||||
and (description is not null and description != '')
|
||||
and parent in (%s)
|
||||
%s
|
||||
order by description
|
||||
""" % (tax_doctype, '%s', ', '.join(['%s']*len(invoice_item_row))),
|
||||
""" % (tax_doctype, '%s', ', '.join(['%s']*len(invoice_item_row)), conditions),
|
||||
tuple([doctype] + invoice_item_row.keys()))
|
||||
|
||||
for parent, description, item_wise_tax_detail, charge_type, tax_amount in tax_details:
|
||||
@@ -191,7 +204,7 @@ def get_tax_accounts(item_list, columns, doctype="Sales Invoice", tax_doctype="S
|
||||
if item_tax_amount:
|
||||
itemised_tax.setdefault(d.name, {})[description] = frappe._dict({
|
||||
"tax_rate": tax_rate,
|
||||
"tax_amount": item_tax_amount
|
||||
"tax_amount": flt(item_tax_amount, tax_amount_precision)
|
||||
})
|
||||
|
||||
except ValueError:
|
||||
@@ -200,7 +213,8 @@ def get_tax_accounts(item_list, columns, doctype="Sales Invoice", tax_doctype="S
|
||||
for d in invoice_item_row.get(parent, []):
|
||||
itemised_tax.setdefault(d.name, {})[description] = frappe._dict({
|
||||
"tax_rate": "NA",
|
||||
"tax_amount": flt((tax_amount * d.base_net_amount) / d.base_net_total)
|
||||
"tax_amount": flt((tax_amount * d.base_net_amount) / d.base_net_total,
|
||||
tax_amount_precision)
|
||||
})
|
||||
|
||||
tax_columns.sort()
|
||||
|
||||
@@ -7,7 +7,7 @@ frappe.query_reports["Purchase Register"] = {
|
||||
"fieldname":"from_date",
|
||||
"label": __("From Date"),
|
||||
"fieldtype": "Date",
|
||||
"default": frappe.defaults.get_user_default("year_start_date"),
|
||||
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
|
||||
"width": "80"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ frappe.query_reports["Sales Register"] = {
|
||||
"fieldname":"from_date",
|
||||
"label": __("From Date"),
|
||||
"fieldtype": "Date",
|
||||
"default": frappe.defaults.get_default("year_start_date"),
|
||||
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
|
||||
"width": "80"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
QUnit.module('Buying');
|
||||
|
||||
QUnit.test("test: purchase order", function(assert) {
|
||||
assert.expect(11);
|
||||
let done = assert.async();
|
||||
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Purchase Order', [
|
||||
{supplier: 'Test Supplier'},
|
||||
{is_subcontracted: 'No'},
|
||||
{currency: 'INR'},
|
||||
{items: [
|
||||
[
|
||||
{"item_code": 'Test Product 4'},
|
||||
{"schedule_date": frappe.datetime.add_days(frappe.datetime.now_date(), 1)},
|
||||
{"expected_delivery_date": frappe.datetime.add_days(frappe.datetime.now_date(), 5)},
|
||||
{"qty": 5},
|
||||
{"uom": 'Unit'},
|
||||
{"rate": 100},
|
||||
{"warehouse": 'Stores - '+frappe.get_abbr(frappe.defaults.get_default("Company"))}
|
||||
]
|
||||
]},
|
||||
|
||||
{tc_name: 'Test Term 1'},
|
||||
{terms: 'This is a term.'}
|
||||
]);
|
||||
},
|
||||
|
||||
() => {
|
||||
// Get supplier details
|
||||
assert.ok(cur_frm.doc.supplier_name == 'Test Supplier', "Supplier name correct");
|
||||
assert.ok($('div.control-value.like-disabled-input.for-description').text().includes('Contact 3'), "Contact display correct");
|
||||
assert.ok(cur_frm.doc.contact_email == 'test@supplier.com', "Contact email correct");
|
||||
// Get item details
|
||||
assert.ok(cur_frm.doc.items[0].item_name == 'Test Product 4', "Item name correct");
|
||||
assert.ok(cur_frm.doc.items[0].description == 'Test Product 4', "Description correct");
|
||||
assert.ok(cur_frm.doc.items[0].qty == 5, "Quantity correct");
|
||||
// Calculate total
|
||||
assert.ok(cur_frm.doc.total == 500, "Total correct");
|
||||
// Get terms
|
||||
assert.ok(cur_frm.doc.terms == 'This is a term.', "Terms correct");
|
||||
},
|
||||
|
||||
() => cur_frm.print_doc(),
|
||||
() => frappe.timeout(2),
|
||||
() => {
|
||||
assert.ok($('.btn-print-print').is(':visible'), "Print Format Available");
|
||||
assert.ok($('div > div:nth-child(5) > div > div > table > tbody > tr > td:nth-child(4) > div').text().includes('Test Product 4'), "Print Preview Works");
|
||||
},
|
||||
|
||||
() => cur_frm.print_doc(),
|
||||
() => frappe.timeout(1),
|
||||
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(0.3),
|
||||
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.status == 'To Receive and Bill', "Submitted successfully");
|
||||
},
|
||||
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
@@ -0,0 +1,61 @@
|
||||
QUnit.module('Buying');
|
||||
|
||||
QUnit.test("test: purchase order with get items", function(assert) {
|
||||
assert.expect(4);
|
||||
let done = assert.async();
|
||||
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Purchase Order', [
|
||||
{supplier: 'Test Supplier'},
|
||||
{is_subcontracted: 'No'},
|
||||
{buying_price_list: 'Test-Buying-USD'},
|
||||
{currency: 'USD'},
|
||||
{items: [
|
||||
[
|
||||
{"item_code": 'Test Product 4'},
|
||||
{"qty": 5},
|
||||
{"schedule_date": frappe.datetime.add_days(frappe.datetime.now_date(), 1)},
|
||||
{"expected_delivery_date": frappe.datetime.add_days(frappe.datetime.now_date(), 5)},
|
||||
{"warehouse": 'Stores - '+frappe.get_abbr(frappe.defaults.get_default("Company"))}
|
||||
]
|
||||
]}
|
||||
]);
|
||||
},
|
||||
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.supplier_name == 'Test Supplier', "Supplier name correct");
|
||||
},
|
||||
|
||||
() => frappe.timeout(0.3),
|
||||
() => frappe.click_button('Get items from'),
|
||||
() => frappe.timeout(0.3),
|
||||
|
||||
() => frappe.click_link('Product Bundle'),
|
||||
() => frappe.timeout(0.5),
|
||||
|
||||
() => cur_dialog.set_value('product_bundle', 'Computer'),
|
||||
() => frappe.click_button('Get Items'),
|
||||
() => frappe.timeout(1),
|
||||
|
||||
// Check if items are fetched from Product Bundle
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.items[1].item_name == 'CPU', "Product bundle item 1 correct");
|
||||
assert.ok(cur_frm.doc.items[2].item_name == 'Screen', "Product bundle item 2 correct");
|
||||
assert.ok(cur_frm.doc.items[3].item_name == 'Keyboard', "Product bundle item 3 correct");
|
||||
},
|
||||
|
||||
() => cur_frm.doc.items[1].warehouse = 'Stores - '+frappe.get_abbr(frappe.defaults.get_default("Company")),
|
||||
() => cur_frm.doc.items[2].warehouse = 'Stores - '+frappe.get_abbr(frappe.defaults.get_default("Company")),
|
||||
() => cur_frm.doc.items[3].warehouse = 'Stores - '+frappe.get_abbr(frappe.defaults.get_default("Company")),
|
||||
|
||||
() => cur_frm.save(),
|
||||
() => frappe.timeout(1),
|
||||
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(0.3),
|
||||
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
@@ -0,0 +1,74 @@
|
||||
QUnit.module('Buying');
|
||||
|
||||
QUnit.test("test: purchase order receipt", function(assert) {
|
||||
assert.expect(5);
|
||||
let done = assert.async();
|
||||
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Purchase Order', [
|
||||
{supplier: 'Test Supplier'},
|
||||
{is_subcontracted: 'No'},
|
||||
{buying_price_list: 'Test-Buying-USD'},
|
||||
{currency: 'USD'},
|
||||
{items: [
|
||||
[
|
||||
{"item_code": 'Test Product 1'},
|
||||
{"schedule_date": frappe.datetime.add_days(frappe.datetime.now_date(), 1)},
|
||||
{"expected_delivery_date": frappe.datetime.add_days(frappe.datetime.now_date(), 5)},
|
||||
{"qty": 5},
|
||||
{"uom": 'Unit'},
|
||||
{"rate": 100},
|
||||
{"warehouse": 'Stores - '+frappe.get_abbr(frappe.defaults.get_default("Company"))}
|
||||
]
|
||||
]},
|
||||
]);
|
||||
},
|
||||
|
||||
() => {
|
||||
|
||||
// Check supplier and item details
|
||||
assert.ok(cur_frm.doc.supplier_name == 'Test Supplier', "Supplier name correct");
|
||||
assert.ok(cur_frm.doc.items[0].item_name == 'Test Product 1', "Item name correct");
|
||||
assert.ok(cur_frm.doc.items[0].description == 'Test Product 1', "Description correct");
|
||||
assert.ok(cur_frm.doc.items[0].qty == 5, "Quantity correct");
|
||||
|
||||
},
|
||||
|
||||
() => frappe.timeout(1),
|
||||
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
|
||||
() => frappe.timeout(1.5),
|
||||
() => frappe.click_button('Close'),
|
||||
() => frappe.timeout(0.3),
|
||||
|
||||
// Make Purchase Receipt
|
||||
() => frappe.click_button('Make'),
|
||||
() => frappe.timeout(0.3),
|
||||
|
||||
() => frappe.click_link('Receipt'),
|
||||
() => frappe.timeout(2),
|
||||
|
||||
() => cur_frm.save(),
|
||||
|
||||
// Save and submit Purchase Receipt
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(1),
|
||||
|
||||
// View Purchase order in Stock Ledger
|
||||
() => frappe.click_button('View'),
|
||||
() => frappe.timeout(0.3),
|
||||
|
||||
() => frappe.click_link('Stock Ledger'),
|
||||
() => frappe.timeout(2),
|
||||
() => {
|
||||
assert.ok($('div.slick-cell.l2.r2 > a').text().includes('Test Product 1')
|
||||
&& $('div.slick-cell.l9.r9 > div').text().includes(5), "Stock ledger entry correct");
|
||||
},
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
@@ -0,0 +1,47 @@
|
||||
QUnit.module('Buying');
|
||||
|
||||
QUnit.test("test: purchase order with discount on grand total", function(assert) {
|
||||
assert.expect(4);
|
||||
let done = assert.async();
|
||||
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Purchase Order', [
|
||||
{supplier: 'Test Supplier'},
|
||||
{is_subcontracted: 'No'},
|
||||
{buying_price_list: 'Test-Buying-EUR'},
|
||||
{currency: 'EUR'},
|
||||
{items: [
|
||||
[
|
||||
{"item_code": 'Test Product 4'},
|
||||
{"qty": 5},
|
||||
{"uom": 'Unit'},
|
||||
{"rate": 500 },
|
||||
{"schedule_date": frappe.datetime.add_days(frappe.datetime.now_date(), 1)},
|
||||
{"expected_delivery_date": frappe.datetime.add_days(frappe.datetime.now_date(), 5)},
|
||||
{"warehouse": 'Stores - '+frappe.get_abbr(frappe.defaults.get_default("Company"))}
|
||||
]
|
||||
]},
|
||||
{apply_discount_on: 'Grand Total'},
|
||||
{additional_discount_percentage: 10}
|
||||
]);
|
||||
},
|
||||
|
||||
() => frappe.timeout(1),
|
||||
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.supplier_name == 'Test Supplier', "Supplier name correct");
|
||||
assert.ok(cur_frm.doc.items[0].rate == 500, "Rate correct");
|
||||
// Calculate total
|
||||
assert.ok(cur_frm.doc.total == 2500, "Total correct");
|
||||
// Calculate grand total after discount
|
||||
assert.ok(cur_frm.doc.grand_total == 2250, "Grand total correct");
|
||||
},
|
||||
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(0.3),
|
||||
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
@@ -0,0 +1,44 @@
|
||||
QUnit.module('Buying');
|
||||
|
||||
QUnit.test("test: purchase order with item wise discount", function(assert) {
|
||||
assert.expect(4);
|
||||
let done = assert.async();
|
||||
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Purchase Order', [
|
||||
{supplier: 'Test Supplier'},
|
||||
{is_subcontracted: 'No'},
|
||||
{buying_price_list: 'Test-Buying-EUR'},
|
||||
{currency: 'EUR'},
|
||||
{items: [
|
||||
[
|
||||
{"item_code": 'Test Product 4'},
|
||||
{"qty": 5},
|
||||
{"uom": 'Unit'},
|
||||
{"schedule_date": frappe.datetime.add_days(frappe.datetime.now_date(), 1)},
|
||||
{"expected_delivery_date": frappe.datetime.add_days(frappe.datetime.now_date(), 5)},
|
||||
{"warehouse": 'Stores - '+frappe.get_abbr(frappe.defaults.get_default("Company"))},
|
||||
{"discount_percentage": 20}
|
||||
]
|
||||
]}
|
||||
]);
|
||||
},
|
||||
|
||||
() => frappe.timeout(1),
|
||||
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.supplier_name == 'Test Supplier', "Supplier name correct");
|
||||
assert.ok(cur_frm.doc.items[0].discount_percentage == 20, "Discount correct");
|
||||
// Calculate totals after discount
|
||||
assert.ok(cur_frm.doc.total == 2000, "Total correct");
|
||||
assert.ok(cur_frm.doc.grand_total == 2000, "Grand total correct");
|
||||
},
|
||||
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(0.3),
|
||||
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
@@ -0,0 +1,39 @@
|
||||
QUnit.module('Buying');
|
||||
|
||||
QUnit.test("test: purchase order with multi UOM", function(assert) {
|
||||
assert.expect(3);
|
||||
let done = assert.async();
|
||||
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Purchase Order', [
|
||||
{supplier: 'Test Supplier'},
|
||||
{is_subcontracted: 'No'},
|
||||
{items: [
|
||||
[
|
||||
{"item_code": 'Test Product 4'},
|
||||
{"qty": 5},
|
||||
{"uom": 'Unit'},
|
||||
{"rate": 100},
|
||||
{"schedule_date": frappe.datetime.add_days(frappe.datetime.now_date(), 1)},
|
||||
{"expected_delivery_date": frappe.datetime.add_days(frappe.datetime.now_date(), 5)},
|
||||
{"warehouse": 'Stores - '+frappe.get_abbr(frappe.defaults.get_default("Company"))}
|
||||
]
|
||||
]}
|
||||
]);
|
||||
},
|
||||
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.supplier_name == 'Test Supplier', "Supplier name correct");
|
||||
assert.ok(cur_frm.doc.items[0].item_name == 'Test Product 4', "Item name correct");
|
||||
assert.ok(cur_frm.doc.items[0].uom == 'Unit', "Multi UOM correct");
|
||||
},
|
||||
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(0.3),
|
||||
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
@@ -0,0 +1,43 @@
|
||||
QUnit.module('Buying');
|
||||
|
||||
QUnit.test("test: purchase order with taxes and charges", function(assert) {
|
||||
assert.expect(3);
|
||||
let done = assert.async();
|
||||
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Purchase Order', [
|
||||
{supplier: 'Test Supplier'},
|
||||
{is_subcontracted: 'No'},
|
||||
{buying_price_list: 'Test-Buying-USD'},
|
||||
{currency: 'USD'},
|
||||
{items: [
|
||||
[
|
||||
{"item_code": 'Test Product 4'},
|
||||
{"qty": 5},
|
||||
{"uom": 'Unit'},
|
||||
{"rate": 500 },
|
||||
{"schedule_date": frappe.datetime.add_days(frappe.datetime.now_date(), 1)},
|
||||
{"expected_delivery_date": frappe.datetime.add_days(frappe.datetime.now_date(), 5)},
|
||||
{"warehouse": 'Stores - '+frappe.get_abbr(frappe.defaults.get_default("Company"))}
|
||||
]
|
||||
]},
|
||||
|
||||
{taxes_and_charges: 'TEST In State GST'}
|
||||
]);
|
||||
},
|
||||
|
||||
() => {
|
||||
// Check taxes and calculate grand total
|
||||
assert.ok(cur_frm.doc.taxes[1].account_head=='SGST - '+frappe.get_abbr(frappe.defaults.get_default('Company')), "Account Head abbr correct");
|
||||
assert.ok(cur_frm.doc.total_taxes_and_charges == 225, "Taxes and charges correct");
|
||||
assert.ok(cur_frm.doc.grand_total == 2725, "Grand total correct");
|
||||
},
|
||||
|
||||
() => frappe.timeout(0.3),
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(0.3),
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
@@ -12,11 +12,11 @@ frappe.ui.form.on("Request for Quotation",{
|
||||
'Supplier Quotation': 'Supplier Quotation'
|
||||
}
|
||||
|
||||
frm.fields_dict["suppliers"].grid.get_field("contact").get_query = function(doc, cdt, cdn){
|
||||
var d =locals[cdt][cdn];
|
||||
frm.fields_dict["suppliers"].grid.get_field("contact").get_query = function(doc, cdt, cdn) {
|
||||
let d = locals[cdt][cdn];
|
||||
return {
|
||||
query: "erpnext.buying.doctype.request_for_quotation.request_for_quotation.get_supplier_contacts",
|
||||
filters: {'supplier': doc.supplier}
|
||||
filters: {'supplier': d.supplier}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -138,7 +138,6 @@ frappe.ui.form.on("Request for Quotation",{
|
||||
dialog.show();
|
||||
|
||||
},
|
||||
|
||||
make_suppplier_quotation: function(frm) {
|
||||
var doc = frm.doc;
|
||||
var dialog = new frappe.ui.Dialog({
|
||||
@@ -207,6 +206,29 @@ frappe.ui.form.on("Request for Quotation Supplier",{
|
||||
if(!w) {
|
||||
frappe.msgprint(__("Please enable pop-ups")); return;
|
||||
}
|
||||
},
|
||||
no_quote: function(frm, cdt, cdn) {
|
||||
var d = locals[cdt][cdn];
|
||||
if (d.no_quote) {
|
||||
if (d.quote_status != __('Received')) {
|
||||
frappe.model.set_value(cdt, cdn, 'quote_status', 'No Quote');
|
||||
} else {
|
||||
frappe.msgprint(__("Cannot set a received RFQ to No Quote"));
|
||||
frappe.model.set_value(cdt, cdn, 'no_quote', 0);
|
||||
}
|
||||
} else {
|
||||
d.quote_status = __('Pending');
|
||||
frm.call({
|
||||
method:"update_rfq_supplier_status",
|
||||
doc: frm.doc,
|
||||
args: {
|
||||
sup_name: d.supplier
|
||||
},
|
||||
callback: function(r) {
|
||||
frm.refresh_field("suppliers");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ class RequestforQuotation(BuyingController):
|
||||
frappe.db.set(self, 'status', 'Submitted')
|
||||
for supplier in self.suppliers:
|
||||
supplier.email_sent = 0
|
||||
supplier.quote_status = 'Pending'
|
||||
|
||||
def on_cancel(self):
|
||||
frappe.db.set(self, 'status', 'Cancelled')
|
||||
@@ -157,6 +158,28 @@ class RequestforQuotation(BuyingController):
|
||||
attachments.append(frappe.attach_print(self.doctype, self.name, doc=self))
|
||||
return attachments
|
||||
|
||||
def update_rfq_supplier_status(self, sup_name=None):
|
||||
for supplier in self.suppliers:
|
||||
if sup_name == None or supplier.supplier == sup_name:
|
||||
if supplier.quote_status != _('No Quote'):
|
||||
quote_status = _('Received')
|
||||
for item in self.items:
|
||||
sqi_count = frappe.db.sql("""
|
||||
SELECT
|
||||
COUNT(sqi.name) as count
|
||||
FROM
|
||||
`tabSupplier Quotation Item` as sqi,
|
||||
`tabSupplier Quotation` as sq
|
||||
WHERE sq.supplier = %(supplier)s
|
||||
AND sqi.docstatus = 1
|
||||
AND sqi.request_for_quotation_item = %(rqi)s
|
||||
AND sqi.parent = sq.name""",
|
||||
{"supplier": supplier.supplier, "rqi": item.name}, as_dict=1)[0]
|
||||
if (sqi_count.count) == 0:
|
||||
quote_status = _('Pending')
|
||||
supplier.quote_status = quote_status
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def send_supplier_emails(rfq_name):
|
||||
check_portal_enabled('Request for Quotation')
|
||||
@@ -172,13 +195,18 @@ def check_portal_enabled(reference_doctype):
|
||||
def get_list_context(context=None):
|
||||
from erpnext.controllers.website_list_for_contact import get_list_context
|
||||
list_context = get_list_context(context)
|
||||
list_context["show_sidebar"] = True
|
||||
list_context.update({
|
||||
'show_sidebar': True,
|
||||
'show_search': True,
|
||||
'no_breadcrumbs': True,
|
||||
'title': _('Request for Quotation'),
|
||||
})
|
||||
return list_context
|
||||
|
||||
def get_supplier_contacts(doctype, txt, searchfield, start, page_len, filters):
|
||||
return frappe.db.sql(""" select `tabContact`.name from `tabContact`, `tabDynamic Link`
|
||||
where `tabDynamic Link`.link_doctype = 'Supplier' and (`tabDynamic Link`.link_name = %(name)s
|
||||
or `tabDynamic Link`.link_name like %(txt)s) and `tabContact`.name = `tabDynamic Link`.parent
|
||||
return frappe.db.sql("""select `tabContact`.name from `tabContact`, `tabDynamic Link`
|
||||
where `tabDynamic Link`.link_doctype = 'Supplier' and (`tabDynamic Link`.link_name=%(name)s
|
||||
and `tabDynamic Link`.link_name like %(txt)s) and `tabContact`.name = `tabDynamic Link`.parent
|
||||
limit %(start)s, %(page_len)s""", {"start": start, "page_len":page_len, "txt": "%%%s%%" % txt, "name": filters.get('supplier')})
|
||||
|
||||
# This method is used to make supplier quotation from material request form.
|
||||
|
||||
@@ -10,21 +10,41 @@ from erpnext.templates.pages.rfq import check_supplier_has_docname_access
|
||||
from frappe.utils import nowdate
|
||||
|
||||
class TestRequestforQuotation(unittest.TestCase):
|
||||
def test_quote_status(self):
|
||||
from erpnext.buying.doctype.request_for_quotation.request_for_quotation import make_supplier_quotation
|
||||
rfq = make_request_for_quotation()
|
||||
|
||||
self.assertEquals(rfq.get('suppliers')[0].quote_status, 'Pending')
|
||||
self.assertEquals(rfq.get('suppliers')[1].quote_status, 'Pending')
|
||||
|
||||
# Submit the first supplier quotation
|
||||
sq = make_supplier_quotation(rfq.name, rfq.get('suppliers')[0].supplier)
|
||||
sq.submit()
|
||||
|
||||
# No Quote first supplier quotation
|
||||
rfq.get('suppliers')[1].no_quote = 1
|
||||
rfq.get('suppliers')[1].quote_status = 'No Quote'
|
||||
|
||||
rfq.update_rfq_supplier_status() #rfq.get('suppliers')[1].supplier)
|
||||
|
||||
self.assertEquals(rfq.get('suppliers')[0].quote_status, 'Received')
|
||||
self.assertEquals(rfq.get('suppliers')[1].quote_status, 'No Quote')
|
||||
|
||||
def test_make_supplier_quotation(self):
|
||||
from erpnext.buying.doctype.request_for_quotation.request_for_quotation import make_supplier_quotation
|
||||
rfq = make_request_for_quotation()
|
||||
|
||||
|
||||
sq = make_supplier_quotation(rfq.name, rfq.get('suppliers')[0].supplier)
|
||||
sq.submit()
|
||||
|
||||
|
||||
sq1 = make_supplier_quotation(rfq.name, rfq.get('suppliers')[1].supplier)
|
||||
sq1.submit()
|
||||
|
||||
|
||||
self.assertEquals(sq.supplier, rfq.get('suppliers')[0].supplier)
|
||||
self.assertEquals(sq.get('items')[0].request_for_quotation, rfq.name)
|
||||
self.assertEquals(sq.get('items')[0].item_code, "_Test Item")
|
||||
self.assertEquals(sq.get('items')[0].qty, 5)
|
||||
|
||||
|
||||
self.assertEquals(sq1.supplier, rfq.get('suppliers')[1].supplier)
|
||||
self.assertEquals(sq1.get('items')[0].request_for_quotation, rfq.name)
|
||||
self.assertEquals(sq1.get('items')[0].item_code, "_Test Item")
|
||||
@@ -61,15 +81,15 @@ class TestRequestforQuotation(unittest.TestCase):
|
||||
rfq.get('items')[0].rate = 100
|
||||
rfq.supplier = rfq.suppliers[0].supplier
|
||||
supplier_quotation_name = create_supplier_quotation(rfq)
|
||||
|
||||
|
||||
supplier_quotation_doc = frappe.get_doc('Supplier Quotation', supplier_quotation_name)
|
||||
|
||||
|
||||
self.assertEquals(supplier_quotation_doc.supplier, rfq.get('suppliers')[0].supplier)
|
||||
self.assertEquals(supplier_quotation_doc.get('items')[0].request_for_quotation, rfq.name)
|
||||
self.assertEquals(supplier_quotation_doc.get('items')[0].item_code, "_Test Item")
|
||||
self.assertEquals(supplier_quotation_doc.get('items')[0].qty, 5)
|
||||
self.assertEquals(supplier_quotation_doc.get('items')[0].amount, 500)
|
||||
|
||||
|
||||
|
||||
def make_request_for_quotation(supplier_data=None):
|
||||
"""
|
||||
@@ -81,10 +101,10 @@ def make_request_for_quotation(supplier_data=None):
|
||||
rfq.status = 'Draft'
|
||||
rfq.company = '_Test Company'
|
||||
rfq.message_for_supplier = 'Please supply the specified items at the best possible rates.'
|
||||
|
||||
|
||||
for data in supplier_data:
|
||||
rfq.append('suppliers', data)
|
||||
|
||||
|
||||
rfq.append("items", {
|
||||
"item_code": "_Test Item",
|
||||
"description": "_Test Item",
|
||||
@@ -93,11 +113,11 @@ def make_request_for_quotation(supplier_data=None):
|
||||
"warehouse": "_Test Warehouse - _TC",
|
||||
"schedule_date": nowdate()
|
||||
})
|
||||
|
||||
|
||||
rfq.submit()
|
||||
|
||||
|
||||
return rfq
|
||||
|
||||
|
||||
def get_supplier_data():
|
||||
return [{
|
||||
"supplier": "_Test Supplier",
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
QUnit.module('Buying');
|
||||
|
||||
QUnit.test("test: request_for_quotation", function(assert) {
|
||||
assert.expect(14);
|
||||
let done = assert.async();
|
||||
let date;
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
date = frappe.datetime.add_days(frappe.datetime.now_date(), 10);
|
||||
return frappe.tests.make('Request for Quotation', [
|
||||
{transaction_date: date},
|
||||
{suppliers: [
|
||||
[
|
||||
{"supplier": 'Test Supplier'},
|
||||
{"email_id": 'test@supplier.com'}
|
||||
]
|
||||
]},
|
||||
{items: [
|
||||
[
|
||||
{"item_code": 'Test Product 4'},
|
||||
{"qty": 5},
|
||||
{"schedule_date": frappe.datetime.add_days(frappe.datetime.now_date(),20)},
|
||||
{"warehouse": 'All Warehouses - '+frappe.get_abbr(frappe.defaults.get_default("Company"))}
|
||||
]
|
||||
]},
|
||||
{message_for_supplier: 'Please supply the specified items at the best possible rates'},
|
||||
{tc_name: 'Test Term 1'}
|
||||
]);
|
||||
},
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.transaction_date == date, "Date correct");
|
||||
assert.ok(cur_frm.doc.company == cur_frm.doc.company, "Company correct");
|
||||
assert.ok(cur_frm.doc.suppliers[0].supplier_name == 'Test Supplier', "Supplier name correct");
|
||||
assert.ok(cur_frm.doc.suppliers[0].contact == 'Contact 3-Test Supplier', "Contact correct");
|
||||
assert.ok(cur_frm.doc.suppliers[0].email_id == 'test@supplier.com', "Email id correct");
|
||||
assert.ok(cur_frm.doc.items[0].item_name == 'Test Product 4', "Item Name correct");
|
||||
assert.ok(cur_frm.doc.items[0].warehouse == 'All Warehouses - '+frappe.get_abbr(frappe.defaults.get_default("Company")), "Warehouse correct");
|
||||
assert.ok(cur_frm.doc.message_for_supplier == 'Please supply the specified items at the best possible rates', "Reply correct");
|
||||
assert.ok(cur_frm.doc.tc_name == 'Test Term 1', "Term name correct");
|
||||
},
|
||||
() => frappe.timeout(0.3),
|
||||
() => cur_frm.print_doc(),
|
||||
() => frappe.timeout(1),
|
||||
() => {
|
||||
assert.ok($('.btn-print-print').is(':visible'), "Print Format Available");
|
||||
assert.ok($('.section-break+ .section-break .column-break:nth-child(1) .value').text().includes("Test Product 4"), "Print Preview Works");
|
||||
},
|
||||
() => cur_frm.print_doc(),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.click_button('Get items from'),
|
||||
() => frappe.timeout(0.3),
|
||||
() => frappe.click_link('Material Request'),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.click_button('Get Items'),
|
||||
() => frappe.timeout(1),
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.items[1].item_name == 'Test Product 1', "Getting items from material requests work");
|
||||
},
|
||||
() => cur_frm.save(),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(1),
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.docstatus == 1, "Quotation request submitted");
|
||||
},
|
||||
() => frappe.click_button('Send Supplier Emails'),
|
||||
() => frappe.timeout(3),
|
||||
() => {
|
||||
assert.ok($('div.modal.fade.in > div.modal-dialog > div > div.modal-body.ui-front > div.msgprint').text().includes("Email sent to supplier Test Supplier"), "Send emails working");
|
||||
},
|
||||
() => frappe.click_button('Close'),
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
@@ -0,0 +1,132 @@
|
||||
QUnit.module('buying');
|
||||
|
||||
QUnit.test("Test: Request for Quotation", function (assert) {
|
||||
assert.expect(5);
|
||||
let done = assert.async();
|
||||
let rfq_name = "";
|
||||
|
||||
frappe.run_serially([
|
||||
// Go to RFQ list
|
||||
() => frappe.set_route("List", "Request for Quotation"),
|
||||
// Create a new RFQ
|
||||
() => frappe.new_doc("Request for Quotation"),
|
||||
() => frappe.timeout(1),
|
||||
() => cur_frm.set_value("transaction_date", "04-04-2017"),
|
||||
() => cur_frm.set_value("company", "_Test Company"),
|
||||
// Add Suppliers
|
||||
() => {
|
||||
cur_frm.fields_dict.suppliers.grid.grid_rows[0].toggle_view();
|
||||
},
|
||||
() => frappe.timeout(1),
|
||||
() => {
|
||||
cur_frm.fields_dict.suppliers.grid.grid_rows[0].doc.supplier = "_Test Supplier";
|
||||
frappe.click_check('Send Email');
|
||||
cur_frm.cur_grid.frm.script_manager.trigger('supplier');
|
||||
},
|
||||
() => frappe.timeout(1),
|
||||
() => {
|
||||
cur_frm.cur_grid.toggle_view();
|
||||
},
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.click_button('Add Row',0),
|
||||
() => frappe.timeout(1),
|
||||
() => {
|
||||
cur_frm.fields_dict.suppliers.grid.grid_rows[1].toggle_view();
|
||||
},
|
||||
() => frappe.timeout(1),
|
||||
() => {
|
||||
cur_frm.fields_dict.suppliers.grid.grid_rows[1].doc.supplier = "_Test Supplier 1";
|
||||
frappe.click_check('Send Email');
|
||||
cur_frm.cur_grid.frm.script_manager.trigger('supplier');
|
||||
},
|
||||
() => frappe.timeout(1),
|
||||
() => {
|
||||
cur_frm.cur_grid.toggle_view();
|
||||
},
|
||||
() => frappe.timeout(1),
|
||||
// Add Item
|
||||
() => {
|
||||
cur_frm.fields_dict.items.grid.grid_rows[0].toggle_view();
|
||||
},
|
||||
() => frappe.timeout(1),
|
||||
() => {
|
||||
cur_frm.fields_dict.items.grid.grid_rows[0].doc.item_code = "_Test Item";
|
||||
frappe.set_control('item_code',"_Test Item");
|
||||
frappe.set_control('qty',5);
|
||||
frappe.set_control('schedule_date', "05-05-2017");
|
||||
cur_frm.cur_grid.frm.script_manager.trigger('supplier');
|
||||
},
|
||||
() => frappe.timeout(2),
|
||||
() => {
|
||||
cur_frm.cur_grid.toggle_view();
|
||||
},
|
||||
() => frappe.timeout(2),
|
||||
() => {
|
||||
cur_frm.fields_dict.items.grid.grid_rows[0].doc.warehouse = "_Test Warehouse - _TC";
|
||||
},
|
||||
() => frappe.click_button('Save'),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.click_button('Submit'),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.click_button('Yes'),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.click_button('Menu'),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.click_link('Reload'),
|
||||
() => frappe.timeout(1),
|
||||
() => {
|
||||
assert.equal(cur_frm.doc.docstatus, 1);
|
||||
rfq_name = cur_frm.doc.name;
|
||||
assert.ok(cur_frm.fields_dict.suppliers.grid.grid_rows[0].doc.quote_status == "Pending");
|
||||
assert.ok(cur_frm.fields_dict.suppliers.grid.grid_rows[1].doc.quote_status == "Pending");
|
||||
},
|
||||
() => {
|
||||
cur_frm.fields_dict.suppliers.grid.grid_rows[0].toggle_view();
|
||||
},
|
||||
() => frappe.timeout(1),
|
||||
() => {
|
||||
frappe.click_check('No Quote');
|
||||
},
|
||||
() => frappe.timeout(1),
|
||||
() => {
|
||||
cur_frm.cur_grid.toggle_view();
|
||||
},
|
||||
() => frappe.click_button('Update'),
|
||||
() => frappe.timeout(1),
|
||||
|
||||
() => frappe.click_button('Supplier Quotation'),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.click_link('Make'),
|
||||
() => frappe.timeout(1),
|
||||
() => {
|
||||
frappe.set_control('supplier',"_Test Supplier 1");
|
||||
},
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.click_button('Make Supplier Quotation'),
|
||||
() => frappe.timeout(1),
|
||||
() => cur_frm.set_value("company", "_Test Company"),
|
||||
() => cur_frm.fields_dict.items.grid.grid_rows[0].doc.rate = 4.99,
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.click_button('Save'),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.click_button('Submit'),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.click_button('Yes'),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.set_route("List", "Request for Quotation"),
|
||||
() => frappe.timeout(2),
|
||||
() => frappe.set_route("List", "Request for Quotation"),
|
||||
() => frappe.timeout(2),
|
||||
() => frappe.click_link(rfq_name),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.click_button('Menu'),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.click_link('Reload'),
|
||||
() => frappe.timeout(1),
|
||||
() => {
|
||||
assert.ok(cur_frm.fields_dict.suppliers.grid.grid_rows[1].doc.quote_status == "Received");
|
||||
assert.ok(cur_frm.fields_dict.suppliers.grid.grid_rows[0].doc.no_quote == 1);
|
||||
},
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
@@ -137,6 +137,69 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.docstatus >= 1 && doc.quote_status != 'Received'",
|
||||
"fieldname": "no_quote",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "No Quote",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.docstatus >= 1 && !doc.no_quote",
|
||||
"fieldname": "quote_status",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Quote Status",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Pending\nReceived\nNo Quote",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
@@ -269,7 +332,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-07-24 06:52:19.542717",
|
||||
"modified": "2017-07-26 22:25:58.096584",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Buying",
|
||||
"name": "Request for Quotation Supplier",
|
||||
|
||||
@@ -8,9 +8,8 @@ QUnit.test("test: supplier", function(assert) {
|
||||
return frappe.tests.make('Supplier', [
|
||||
{supplier_name: 'Test Supplier'},
|
||||
{supplier_type: 'Hardware'},
|
||||
{country: 'United States'},
|
||||
{default_currency: 'USD'},
|
||||
{default_price_list: 'Test-Buying-USD'},
|
||||
{country: 'India'},
|
||||
{default_currency: 'INR'},
|
||||
{credit_days_based_on: 'Fixed Days'},
|
||||
{accounts: [
|
||||
[
|
||||
@@ -68,7 +67,7 @@ QUnit.test("test: supplier", function(assert) {
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.supplier_name == 'Test Supplier', "Name correct");
|
||||
assert.ok(cur_frm.doc.supplier_type == 'Hardware', "Type correct");
|
||||
assert.ok(cur_frm.doc.default_currency == 'USD', "Currency correct");
|
||||
assert.ok(cur_frm.doc.default_currency == 'INR', "Currency correct");
|
||||
assert.ok(cur_frm.doc.accounts[0].account == 'Creditors - '+frappe.get_abbr('Test Company'), " Account Head abbr correct");
|
||||
assert.ok($('.address-box:nth-child(3) p').text().includes('Shipping City 3'), "Address correct");
|
||||
assert.ok($('.col-sm-6+ .col-sm-6 .h6').text().includes('Contact 3'), "Contact correct");
|
||||
|
||||
@@ -31,9 +31,11 @@ class SupplierQuotation(BuyingController):
|
||||
|
||||
def on_submit(self):
|
||||
frappe.db.set(self, "status", "Submitted")
|
||||
self.update_rfq_supplier_status(1)
|
||||
|
||||
def on_cancel(self):
|
||||
frappe.db.set(self, "status", "Cancelled")
|
||||
self.update_rfq_supplier_status(0)
|
||||
|
||||
def on_trash(self):
|
||||
pass
|
||||
@@ -50,6 +52,41 @@ class SupplierQuotation(BuyingController):
|
||||
"is_child_table": True
|
||||
}
|
||||
})
|
||||
def update_rfq_supplier_status(self, include_me):
|
||||
rfq_list = set([])
|
||||
for item in self.items:
|
||||
if item.request_for_quotation:
|
||||
rfq_list.add(item.request_for_quotation)
|
||||
for rfq in rfq_list:
|
||||
doc = frappe.get_doc('Request for Quotation', rfq)
|
||||
doc_sup = frappe.get_all('Request for Quotation Supplier', filters=
|
||||
{'parent': doc.name, 'supplier': self.supplier}, fields=['name', 'quote_status'])[0]
|
||||
|
||||
quote_status = _('Received')
|
||||
for item in doc.items:
|
||||
sqi_count = frappe.db.sql("""
|
||||
SELECT
|
||||
COUNT(sqi.name) as count
|
||||
FROM
|
||||
`tabSupplier Quotation Item` as sqi,
|
||||
`tabSupplier Quotation` as sq
|
||||
WHERE sq.supplier = %(supplier)s
|
||||
AND sqi.docstatus = 1
|
||||
AND sq.name != %(me)s
|
||||
AND sqi.request_for_quotation_item = %(rqi)s
|
||||
AND sqi.parent = sq.name""",
|
||||
{"supplier": self.supplier, "rqi": item.name, 'me': self.name}, as_dict=1)[0]
|
||||
self_count = sum(my_item.request_for_quotation_item == item.name
|
||||
for my_item in self.items) if include_me else 0
|
||||
if (sqi_count.count + self_count) == 0:
|
||||
quote_status = _('Pending')
|
||||
if quote_status == _('Received') and doc_sup.quote_status == _('No Quote'):
|
||||
frappe.msgprint(_("{0} indicates that {1} will not provide a quotation, but all items \
|
||||
have been quoted. Updating the RFQ quote status.").format(doc.name, self.supplier))
|
||||
frappe.db.set_value('Request for Quotation Supplier', doc_sup.name, 'quote_status', quote_status)
|
||||
frappe.db.set_value('Request for Quotation Supplier', doc_sup.name, 'no_quote', 0)
|
||||
elif doc_sup.quote_status != _('No Quote'):
|
||||
frappe.db.set_value('Request for Quotation Supplier', doc_sup.name, 'quote_status', quote_status)
|
||||
|
||||
def get_list_context(context=None):
|
||||
from erpnext.controllers.website_list_for_contact import get_list_context
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
QUnit.module('Buying');
|
||||
|
||||
QUnit.test("test: supplier quotation", function(assert) {
|
||||
assert.expect(11);
|
||||
let done = assert.async();
|
||||
let date;
|
||||
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
date = frappe.datetime.add_days(frappe.datetime.now_date(), 10);
|
||||
return frappe.tests.make('Supplier Quotation', [
|
||||
{supplier: 'Test Supplier'},
|
||||
{transaction_date: date},
|
||||
{currency: 'INR'},
|
||||
{items: [
|
||||
[
|
||||
{"item_code": 'Test Product 4'},
|
||||
{"qty": 5},
|
||||
{"uom": 'Unit'},
|
||||
{"rate": 200},
|
||||
{"warehouse": 'All Warehouses - '+frappe.get_abbr(frappe.defaults.get_default("Company"))}
|
||||
]
|
||||
]},
|
||||
{apply_discount_on: 'Grand Total'},
|
||||
{additional_discount_percentage: 10},
|
||||
{tc_name: 'Test Term 1'},
|
||||
{terms: 'This is a term'}
|
||||
]);
|
||||
},
|
||||
() => {
|
||||
// Get Supplier details
|
||||
assert.ok(cur_frm.doc.supplier == 'Test Supplier', "Supplier correct");
|
||||
assert.ok(cur_frm.doc.company == cur_frm.doc.company, "Company correct");
|
||||
// Get Contact details
|
||||
assert.ok(cur_frm.doc.contact_display == 'Contact 3', "Conatct correct");
|
||||
assert.ok(cur_frm.doc.contact_email == 'test@supplier.com', "Email correct");
|
||||
// Get uom
|
||||
assert.ok(cur_frm.doc.items[0].uom == 'Unit', "Multi uom correct");
|
||||
assert.ok(cur_frm.doc.total == 1000, "Total correct");
|
||||
// Calculate total after discount
|
||||
assert.ok(cur_frm.doc.grand_total == 900, "Grand total correct");
|
||||
// Get terms
|
||||
assert.ok(cur_frm.doc.tc_name == 'Test Term 1', "Terms correct");
|
||||
},
|
||||
|
||||
() => cur_frm.print_doc(),
|
||||
() => frappe.timeout(2),
|
||||
() => {
|
||||
assert.ok($('.btn-print-print').is(':visible'), "Print Format Available");
|
||||
assert.ok($("table > tbody > tr > td:nth-child(3) > div").text().includes("Test Product 4"), "Print Preview Works As Expected");
|
||||
},
|
||||
() => cur_frm.print_doc(),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.click_button('Get items from'),
|
||||
() => frappe.timeout(0.3),
|
||||
() => frappe.click_link('Material Request'),
|
||||
() => frappe.timeout(0.3),
|
||||
() => frappe.click_button('Get Items'),
|
||||
() => frappe.timeout(1),
|
||||
() => {
|
||||
// Get item from Material Requests
|
||||
assert.ok(cur_frm.doc.items[1].item_name == 'Test Product 1', "Getting items from material requests work");
|
||||
},
|
||||
|
||||
() => cur_frm.save(),
|
||||
() => frappe.timeout(1),
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(0.3),
|
||||
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
QUnit.module('Buying');
|
||||
|
||||
QUnit.test("test: supplier quotation with item wise discount", function(assert){
|
||||
assert.expect(2);
|
||||
let done = assert.async();
|
||||
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Supplier Quotation', [
|
||||
{supplier: 'Test Supplier'},
|
||||
{company: 'Test Company'},
|
||||
{items: [
|
||||
[
|
||||
{"item_code": 'Test Product 4'},
|
||||
{"qty": 5},
|
||||
{"uom": 'Unit'},
|
||||
{"warehouse": 'All Warehouses - TC'},
|
||||
{'discount_percentage': 10},
|
||||
]
|
||||
]}
|
||||
]);
|
||||
},
|
||||
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.total == 900, "Total correct");
|
||||
assert.ok(cur_frm.doc.grand_total == 900, "Grand total correct");
|
||||
},
|
||||
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(0.3),
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
@@ -0,0 +1,37 @@
|
||||
QUnit.module('Buying');
|
||||
|
||||
QUnit.test("test: supplier quotation with taxes and charges", function(assert) {
|
||||
assert.expect(3);
|
||||
let done = assert.async();
|
||||
let supplier_quotation_name;
|
||||
|
||||
frappe.run_serially([
|
||||
() => {
|
||||
return frappe.tests.make('Supplier Quotation', [
|
||||
{supplier: 'Test Supplier'},
|
||||
{items: [
|
||||
[
|
||||
{"item_code": 'Test Product 4'},
|
||||
{"qty": 5},
|
||||
{"rate": 100},
|
||||
{"warehouse": 'Stores - '+frappe.get_abbr(frappe.defaults.get_default('Company'))},
|
||||
]
|
||||
]},
|
||||
{taxes_and_charges:'TEST In State GST'},
|
||||
]);
|
||||
},
|
||||
() => {supplier_quotation_name = cur_frm.doc.name;},
|
||||
() => {
|
||||
assert.ok(cur_frm.doc.taxes[0].account_head=='CGST - '+frappe.get_abbr(frappe.defaults.get_default('Company')), " Account Head abbr correct");
|
||||
assert.ok(cur_frm.doc.total_taxes_and_charges == 45, "Taxes and charges correct");
|
||||
assert.ok(cur_frm.doc.grand_total == 545, "Grand total correct");
|
||||
},
|
||||
|
||||
() => cur_frm.save(),
|
||||
() => frappe.timeout(0.3),
|
||||
() => frappe.tests.click_button('Submit'),
|
||||
() => frappe.tests.click_button('Yes'),
|
||||
() => frappe.timeout(0.3),
|
||||
() => done()
|
||||
]);
|
||||
});
|
||||
@@ -70,8 +70,8 @@ def get_data():
|
||||
"items": [
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "BOM Replace Tool",
|
||||
"description": _("Replace Item / BOM in all BOMs"),
|
||||
"name": "BOM Update Tool",
|
||||
"description": _("Replace BOM and update latest price in all BOMs"),
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
@@ -16,6 +16,8 @@ from erpnext.controllers.stock_controller import StockController
|
||||
class BuyingController(StockController):
|
||||
def __setup__(self):
|
||||
if hasattr(self, "taxes"):
|
||||
self.flags.print_taxes_with_zero_amount = cint(frappe.db.get_single_value("Print Settings",
|
||||
"print_taxes_with_zero_amount"))
|
||||
self.print_templates = {
|
||||
"taxes": "templates/print_formats/includes/taxes.html"
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ def get_delivery_notes_to_be_billed(doctype, txt, searchfield, start, page_len,
|
||||
select `tabDelivery Note`.name, `tabDelivery Note`.customer, `tabDelivery Note`.posting_date
|
||||
from `tabDelivery Note`
|
||||
where `tabDelivery Note`.`%(key)s` like %(txt)s and
|
||||
`tabDelivery Note`.docstatus = 1 and `tabDelivery Note`.is_return = 0
|
||||
`tabDelivery Note`.docstatus = 1 and `tabDelivery Note`.is_return = 0
|
||||
and status not in ("Stopped", "Closed") %(fcond)s
|
||||
and (`tabDelivery Note`.per_billed < 100 or `tabDelivery Note`.grand_total = 0)
|
||||
%(mcond)s order by `tabDelivery Note`.`%(key)s` asc
|
||||
@@ -367,31 +367,30 @@ def warehouse_query(doctype, txt, searchfield, start, page_len, filters):
|
||||
sub_query = """ select round(`tabBin`.actual_qty, 2) from `tabBin`
|
||||
where `tabBin`.warehouse = `tabWarehouse`.name
|
||||
{bin_conditions} """.format(
|
||||
bin_conditions=get_filters_cond(doctype, filter_dict.get("Bin"),
|
||||
bin_conditions=get_filters_cond(doctype, filter_dict.get("Bin"),
|
||||
bin_conditions, ignore_permissions=True))
|
||||
|
||||
response = frappe.db.sql("""select `tabWarehouse`.name,
|
||||
query = """select `tabWarehouse`.name,
|
||||
CONCAT_WS(" : ", "Actual Qty", ifnull( ({sub_query}), 0) ) as actual_qty
|
||||
from `tabWarehouse`
|
||||
where
|
||||
`tabWarehouse`.`{key}` like %(txt)s
|
||||
`tabWarehouse`.`{key}` like '{txt}'
|
||||
{fcond} {mcond}
|
||||
order by
|
||||
`tabWarehouse`.name desc
|
||||
limit
|
||||
%(start)s, %(page_len)s
|
||||
{start}, {page_len}
|
||||
""".format(
|
||||
sub_query=sub_query,
|
||||
key=frappe.db.escape(searchfield),
|
||||
fcond=get_filters_cond(doctype, filter_dict.get("Warehouse"), conditions),
|
||||
mcond=get_match_cond(doctype)
|
||||
),
|
||||
{
|
||||
"txt": "%%%s%%" % frappe.db.escape(txt),
|
||||
"start": start,
|
||||
"page_len": page_len
|
||||
})
|
||||
return response
|
||||
mcond=get_match_cond(doctype),
|
||||
start=start,
|
||||
page_len=page_len,
|
||||
txt=frappe.db.escape('%{0}%'.format(txt))
|
||||
)
|
||||
|
||||
return frappe.db.sql(query)
|
||||
|
||||
|
||||
def get_doctype_wise_filters(filters):
|
||||
|
||||
@@ -14,6 +14,8 @@ from erpnext.controllers.stock_controller import StockController
|
||||
class SellingController(StockController):
|
||||
def __setup__(self):
|
||||
if hasattr(self, "taxes"):
|
||||
self.flags.print_taxes_with_zero_amount = cint(frappe.db.get_single_value("Print Settings",
|
||||
"print_taxes_with_zero_amount"))
|
||||
self.print_templates = {
|
||||
"taxes": "templates/print_formats/includes/taxes.html"
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ class calculate_taxes_and_totals(object):
|
||||
if tax.item_wise_tax_detail.get(key):
|
||||
item_wise_tax_amount += tax.item_wise_tax_detail[key][1]
|
||||
|
||||
tax.item_wise_tax_detail[key] = [tax_rate,flt(item_wise_tax_amount, tax.precision("base_tax_amount"))]
|
||||
tax.item_wise_tax_detail[key] = [tax_rate,flt(item_wise_tax_amount)]
|
||||
|
||||
def round_off_totals(self, tax):
|
||||
tax.tax_amount = flt(tax.tax_amount, tax.precision("tax_amount"))
|
||||
@@ -521,12 +521,20 @@ def get_itemised_tax_breakup_html(doc):
|
||||
frappe.flags.company = doc.company
|
||||
|
||||
# get headers
|
||||
tax_accounts = list(set([d.description for d in doc.taxes]))
|
||||
tax_accounts = []
|
||||
for tax in doc.taxes:
|
||||
if getattr(tax, "category", None) and tax.category=="Valuation":
|
||||
continue
|
||||
if tax.description not in tax_accounts:
|
||||
tax_accounts.append(tax.description)
|
||||
|
||||
headers = get_itemised_tax_breakup_header(doc.doctype + " Item", tax_accounts)
|
||||
|
||||
# get tax breakup data
|
||||
itemised_tax, itemised_taxable_amount = get_itemised_tax_breakup_data(doc)
|
||||
|
||||
|
||||
get_rounded_tax_amount(itemised_tax, doc.precision("tax_amount", "taxes"))
|
||||
|
||||
frappe.flags.company = None
|
||||
|
||||
return frappe.render_template(
|
||||
@@ -554,6 +562,9 @@ def get_itemised_tax_breakup_data(doc):
|
||||
def get_itemised_tax(taxes):
|
||||
itemised_tax = {}
|
||||
for tax in taxes:
|
||||
if getattr(tax, "category", None) and tax.category=="Valuation":
|
||||
continue
|
||||
|
||||
tax_amount_precision = tax.precision("tax_amount")
|
||||
tax_rate_precision = tax.precision("rate")
|
||||
|
||||
@@ -562,16 +573,16 @@ def get_itemised_tax(taxes):
|
||||
for item_code, tax_data in item_tax_map.items():
|
||||
itemised_tax.setdefault(item_code, frappe._dict())
|
||||
|
||||
if isinstance(tax_data, list) and tax_data[0]:
|
||||
if isinstance(tax_data, list):
|
||||
precision = tax_amount_precision if tax.charge_type == "Actual" else tax_rate_precision
|
||||
|
||||
itemised_tax[item_code][tax.description] = frappe._dict(dict(
|
||||
tax_rate=flt(tax_data[0], precision),
|
||||
tax_amount=flt(tax_data[1], tax_amount_precision)
|
||||
tax_rate=flt(tax_data[0]),
|
||||
tax_amount=flt(tax_data[1])
|
||||
))
|
||||
else:
|
||||
itemised_tax[item_code][tax.description] = frappe._dict(dict(
|
||||
tax_rate=flt(tax_data, tax_rate_precision),
|
||||
tax_rate=flt(tax_data),
|
||||
tax_amount=0.0
|
||||
))
|
||||
|
||||
@@ -584,4 +595,10 @@ def get_itemised_taxable_amount(items):
|
||||
itemised_taxable_amount.setdefault(item_code, 0)
|
||||
itemised_taxable_amount[item_code] += item.net_amount
|
||||
|
||||
return itemised_taxable_amount
|
||||
return itemised_taxable_amount
|
||||
|
||||
def get_rounded_tax_amount(itemised_tax, precision):
|
||||
# Rounding based on tax_amount precision
|
||||
for taxes in itemised_tax.values():
|
||||
for tax_account in taxes:
|
||||
taxes[tax_account]["tax_amount"] = flt(taxes[tax_account]["tax_amount"], precision)
|
||||
@@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
||||
import json
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils import flt
|
||||
from frappe.utils import flt, has_common
|
||||
from frappe.utils.user import is_website_user
|
||||
|
||||
def get_list_context(context=None):
|
||||
@@ -55,28 +55,30 @@ def get_transaction_list(doctype, txt=None, filters=None, limit_start=0, limit_p
|
||||
return post_process(doctype, get_list_for_transactions(doctype, txt, filters, limit_start, limit_page_length,
|
||||
fields="name", order_by="modified desc"))
|
||||
|
||||
def get_list_for_transactions(doctype, txt, filters, limit_start, limit_page_length=20, ignore_permissions=False,fields=None, order_by=None):
|
||||
def get_list_for_transactions(doctype, txt, filters, limit_start, limit_page_length=20,
|
||||
ignore_permissions=False,fields=None, order_by=None):
|
||||
""" Get List of transactions like Invoices, Orders """
|
||||
from frappe.www.list import get_list
|
||||
meta = frappe.get_meta(doctype)
|
||||
data = []
|
||||
or_filters = []
|
||||
|
||||
for d in get_list(doctype, txt, filters=filters, fields="name", limit_start=limit_start,
|
||||
limit_page_length=limit_page_length, ignore_permissions=True, order_by="modified desc"):
|
||||
limit_page_length=limit_page_length, ignore_permissions=ignore_permissions, order_by="modified desc"):
|
||||
data.append(d)
|
||||
|
||||
if txt:
|
||||
if meta.get_field('items'):
|
||||
if meta.get_field('items').options:
|
||||
child_doctype = meta.get_field('items').options
|
||||
for item in frappe.get_all(child_doctype, {"item_name": ['like', "%" + txt + "%"]}):
|
||||
child_doctype = meta.get_field('items').options
|
||||
for item in frappe.get_all(child_doctype, {"item_name": ['like', "%" + txt + "%"]}):
|
||||
child = frappe.get_doc(child_doctype, item.name)
|
||||
or_filters.append([doctype, "name", "=", child.parent])
|
||||
|
||||
if or_filters:
|
||||
for r in frappe.get_list(doctype, fields=fields,filters=filters, or_filters=or_filters, limit_start=limit_start,
|
||||
limit_page_length=limit_page_length, ignore_permissions=ignore_permissions,
|
||||
order_by=order_by):
|
||||
for r in frappe.get_list(doctype, fields=fields,filters=filters, or_filters=or_filters,
|
||||
limit_start=limit_start, limit_page_length=limit_page_length,
|
||||
ignore_permissions=ignore_permissions, order_by=order_by):
|
||||
data.append(r)
|
||||
|
||||
return data
|
||||
@@ -124,13 +126,30 @@ def post_process(doctype, data):
|
||||
return result
|
||||
|
||||
def get_customers_suppliers(doctype, user):
|
||||
customers = []
|
||||
suppliers = []
|
||||
meta = frappe.get_meta(doctype)
|
||||
contacts = frappe.db.sql(""" select `tabContact`.email_id, `tabDynamic Link`.link_doctype, `tabDynamic Link`.link_name
|
||||
from `tabContact`, `tabDynamic Link` where
|
||||
`tabContact`.name = `tabDynamic Link`.parent and `tabContact`.email_id =%s """, user, as_dict=1)
|
||||
|
||||
customers = [c.link_name for c in contacts if c.link_doctype == 'Customer'] if meta.get_field("customer") else None
|
||||
suppliers = [c.link_name for c in contacts if c.link_doctype == 'Supplier'] if meta.get_field("supplier") else None
|
||||
if has_common(["Supplier", "Customer"], frappe.get_roles(user)):
|
||||
contacts = frappe.db.sql("""
|
||||
select
|
||||
`tabContact`.email_id,
|
||||
`tabDynamic Link`.link_doctype,
|
||||
`tabDynamic Link`.link_name
|
||||
from
|
||||
`tabContact`, `tabDynamic Link`
|
||||
where
|
||||
`tabContact`.name=`tabDynamic Link`.parent and `tabContact`.email_id =%s
|
||||
""", user, as_dict=1)
|
||||
customers = [c.link_name for c in contacts if c.link_doctype == 'Customer'] \
|
||||
if meta.get_field("customer") else None
|
||||
suppliers = [c.link_name for c in contacts if c.link_doctype == 'Supplier'] \
|
||||
if meta.get_field("supplier") else None
|
||||
elif frappe.has_permission(doctype, 'read', user=user):
|
||||
customers = [customer.name for customer in frappe.get_list("Customer")] \
|
||||
if meta.get_field("customer") else None
|
||||
suppliers = [supplier.name for supplier in frappe.get_list("Customer")] \
|
||||
if meta.get_field("supplier") else None
|
||||
|
||||
return customers, suppliers
|
||||
|
||||
|
||||
@@ -76,36 +76,6 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "salutation",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Salutation",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Salutation",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -141,21 +111,21 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "gender",
|
||||
"fieldtype": "Link",
|
||||
"fieldname": "company_name",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Gender",
|
||||
"label": "Organization Name",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Gender",
|
||||
"oldfieldname": "company_name",
|
||||
"oldfieldtype": "Data",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
@@ -260,6 +230,37 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "gender",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Gender",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Gender",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
@@ -295,36 +296,6 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "company_name",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Organization Name",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "company_name",
|
||||
"oldfieldtype": "Data",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -435,6 +406,7 @@
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Follow Up",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -514,11 +486,12 @@
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "contact_by",
|
||||
"fieldtype": "Link",
|
||||
"description": "",
|
||||
"fieldname": "contact_date",
|
||||
"fieldtype": "Datetime",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
@@ -526,12 +499,11 @@
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Next Contact By",
|
||||
"label": "Next Contact Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "contact_by",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "User",
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "contact_date",
|
||||
"oldfieldtype": "Date",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
@@ -550,9 +522,8 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "Add to calendar on this date",
|
||||
"fieldname": "contact_date",
|
||||
"fieldtype": "Datetime",
|
||||
"fieldname": "contact_by",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
@@ -560,11 +531,12 @@
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Next Contact Date",
|
||||
"label": "Next Contact By",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "contact_date",
|
||||
"oldfieldtype": "Date",
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "contact_by",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "User",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
@@ -726,6 +698,37 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "salutation",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Salutation",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Salutation",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
@@ -1144,7 +1147,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-06-22 14:29:12.700000",
|
||||
"modified": "2017-08-21 02:28:21.581948",
|
||||
"modified_by": "Administrator",
|
||||
"module": "CRM",
|
||||
"name": "Lead",
|
||||
|
||||
@@ -419,6 +419,164 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 1,
|
||||
"collapsible_depends_on": "contact_by",
|
||||
"columns": 0,
|
||||
"fieldname": "next_contact",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Follow Up",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "",
|
||||
"fieldname": "contact_by",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Next Contact By",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "contact_by",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "User",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0,
|
||||
"width": "75px"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "",
|
||||
"fieldname": "contact_date",
|
||||
"fieldtype": "Datetime",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Next Contact Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "contact_date",
|
||||
"oldfieldtype": "Date",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break2",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldtype": "Column Break",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0,
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "to_discuss",
|
||||
"fieldtype": "Small Text",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "To Discuss",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "to_discuss",
|
||||
"oldfieldtype": "Small Text",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
@@ -435,7 +593,7 @@
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "",
|
||||
"label": "Items",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldtype": "Section Break",
|
||||
@@ -986,164 +1144,6 @@
|
||||
"unique": 0,
|
||||
"width": "50px"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 1,
|
||||
"collapsible_depends_on": "contact_by",
|
||||
"columns": 0,
|
||||
"fieldname": "next_contact",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Next Contact",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "Your sales person who will contact the customer in future",
|
||||
"fieldname": "contact_by",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Next Contact By",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "contact_by",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "User",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0,
|
||||
"width": "75px"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "Your sales person will get a reminder on this date to contact the customer",
|
||||
"fieldname": "contact_date",
|
||||
"fieldtype": "Datetime",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Next Contact Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "contact_date",
|
||||
"oldfieldtype": "Date",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break2",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldtype": "Column Break",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0,
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "to_discuss",
|
||||
"fieldtype": "Small Text",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "To Discuss",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "to_discuss",
|
||||
"oldfieldtype": "Small Text",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
@@ -1189,7 +1189,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-08-07 21:25:10.836517",
|
||||
"modified": "2017-08-21 02:07:46.486433",
|
||||
"modified_by": "Administrator",
|
||||
"module": "CRM",
|
||||
"name": "Opportunity",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import print_function, unicode_literals
|
||||
|
||||
import random, json
|
||||
import frappe, erpnext
|
||||
@@ -42,7 +42,7 @@ def setup(domain):
|
||||
frappe.clear_cache()
|
||||
|
||||
def complete_setup(domain='Manufacturing'):
|
||||
print "Complete Setup..."
|
||||
print("Complete Setup...")
|
||||
from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
|
||||
|
||||
if not frappe.get_all('Company', limit=1):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import print_function, unicode_literals
|
||||
|
||||
import frappe, random
|
||||
from frappe.desk import query_report
|
||||
@@ -36,7 +36,7 @@ def make_purchase_receipt():
|
||||
try:
|
||||
pr.submit()
|
||||
except NegativeStockError:
|
||||
print 'Negative stock for {0}'.format(po)
|
||||
print('Negative stock for {0}'.format(po))
|
||||
pass
|
||||
frappe.db.commit()
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 9.2 KiB |
BIN
erpnext/docs/assets/img/articles/capacity-1.png
Normal file
|
After Width: | Height: | Size: 83 KiB |
BIN
erpnext/docs/assets/img/articles/capacity-2.png
Normal file
|
After Width: | Height: | Size: 62 KiB |
BIN
erpnext/docs/assets/img/articles/capacity-3.png
Normal file
|
After Width: | Height: | Size: 86 KiB |
BIN
erpnext/docs/assets/img/articles/child-1.png
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
erpnext/docs/assets/img/articles/child-2.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
erpnext/docs/assets/img/articles/child-3.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
erpnext/docs/assets/img/articles/child-4.gif
Normal file
|
After Width: | Height: | Size: 424 KiB |
BIN
erpnext/docs/assets/img/articles/child-5.png
Normal file
|
After Width: | Height: | Size: 79 KiB |
BIN
erpnext/docs/assets/img/articles/child-6.png
Normal file
|
After Width: | Height: | Size: 71 KiB |
BIN
erpnext/docs/assets/img/articles/common-receivable.png
Normal file
|
After Width: | Height: | Size: 84 KiB |
BIN
erpnext/docs/assets/img/articles/email-setup-error.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
erpnext/docs/assets/img/articles/hr-working-days.png
Normal file
|
After Width: | Height: | Size: 108 KiB |
|
After Width: | Height: | Size: 55 KiB |
BIN
erpnext/docs/assets/img/articles/report-permission-1.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
erpnext/docs/assets/img/articles/report-permission-2.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
erpnext/docs/assets/img/articles/role-deskperm.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
erpnext/docs/assets/img/articles/sections-1.png
Normal file
|
After Width: | Height: | Size: 95 KiB |
BIN
erpnext/docs/assets/img/articles/sections-2.gif
Normal file
|
After Width: | Height: | Size: 312 KiB |
BIN
erpnext/docs/assets/img/articles/types-in-tax-masters.png
Normal file
|
After Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 47 KiB |
BIN
erpnext/docs/assets/img/manufacturing/bom-update-tool.png
Normal file
|
After Width: | Height: | Size: 92 KiB |
BIN
erpnext/docs/assets/img/setup/integrations/razorpay-api.gif
Normal file
|
After Width: | Height: | Size: 765 KiB |
BIN
erpnext/docs/assets/img/setup/print/print-style.png
Normal file
|
After Width: | Height: | Size: 189 KiB |
@@ -1,47 +0,0 @@
|
||||
#C-Form
|
||||
|
||||
C-Form functionality is only applicable for Indian customers.
|
||||
|
||||
**What is C-Form?**
|
||||
|
||||
C-Form is issued by the Customer. If Customer Issues C-Form, supplier applies discounted CST (central sales tax) in the invoice. C-Form is only applicable on the inter-state transactions.
|
||||
|
||||
C-Form functionality in ERPNext allows Supplier to update C-Form No. as received from Customer in the submitted Sales Invoice. Also you can create report on Sales Invoice and track invoices for which C-Form has not yet been received from Customer.
|
||||
|
||||
Following are step to manage C-Form related sales in ERPNext.
|
||||
|
||||
####Set C-Form Applicability
|
||||
|
||||
While creating Sales invoice for the customer, set C-Form applicability in Sales Invoice. In More Info section of Sales Invoice, set field called **Is C-Form Applicable** as **Yes**. Bydefault, this field will have No for a value.
|
||||
|
||||

|
||||
|
||||
Updating this field as Yes will allow you to pull this Sales Invoice in the C-Form Tool, and update C-Form No. as received from the Customer.
|
||||
|
||||
####Create C-Form Record
|
||||
|
||||
After receiving C-Form from your Customer, you should update that C-Form no. in the Sales Invoice by creating C-Form record.
|
||||
|
||||
Go to `Accounts > Setup > C-Form > New`
|
||||
|
||||
Enter details like C-Form No, Received Date, State and Amount etc. Select Customer and pull related Sales Invoices under provided table.
|
||||
|
||||

|
||||
|
||||
####Save & Submit C-Form
|
||||
|
||||
After entering details, save and submit C-Form record. On save system will generate C-Form record and on submission update that C-Form No. in the Sales Invoice.
|
||||
|
||||

|
||||
|
||||
C-Form serial no will be updated in related invoice under the field 'C-Form No'.
|
||||
|
||||

|
||||
|
||||
####Tracking Pending Invoice for C-Form
|
||||
|
||||
To track invoices for which C-Form has not yet been received from Customer, you can create custom report on Sales Invoice. In this report, you can filter invoices which doesn't have C-Form updated in them yet, and followup with the customer accordingly.
|
||||
|
||||

|
||||
|
||||
<!-- markdown -->
|
||||
@@ -0,0 +1,13 @@
|
||||
# Common Receivable Account
|
||||
|
||||
As per the party model, a common receivable account called **Debtor** is auto-created. This is a default Receivable Account for all the Customers.
|
||||
|
||||
<img alt="Role Desk Permission" class="screenshot" src="/docs/assets/img/articles/common-receivable.png">
|
||||
|
||||
If needed, you can also create a new receivable account and update in the Customer master.
|
||||
|
||||
**Question:** Should I create separate Receivable Account Account for each Customer?
|
||||
|
||||
**Answer:** You can, but it's not a recommend approach. If you want to create separate Receivable Account for each Customer for tracking receivable, then it not needed. You still view Account Receivable & General Ledger report for each Customer.
|
||||
|
||||
Just like Debtors, for tracking payables, default account called Creditors is created under Account Payables.
|
||||