Compare commits
152 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1508267fd6 | ||
|
|
8f1f93603d | ||
|
|
f1bd39c937 | ||
|
|
ec252c806f | ||
|
|
2a903a0608 | ||
|
|
71b4e48ea5 | ||
|
|
ae2d92ee76 | ||
|
|
21cf1fd851 | ||
|
|
02c281cc2f | ||
|
|
a938d3956a | ||
|
|
02b0ed4199 | ||
|
|
76f93d05b7 | ||
|
|
24ab20fe11 | ||
|
|
1eb31db71f | ||
|
|
ef95b4d6e3 | ||
|
|
514c0417dd | ||
|
|
67f6ac848c | ||
|
|
5d95ebec4e | ||
|
|
bb7317d398 | ||
|
|
550268eaf3 | ||
|
|
7f9af46da5 | ||
|
|
e38eb83358 | ||
|
|
af00c9f70b | ||
|
|
5c7545da0c | ||
|
|
d6e8bb5452 | ||
|
|
435032f5bc | ||
|
|
1ef50c89db | ||
|
|
2e4b4454b3 | ||
|
|
4b33b7e1c1 | ||
|
|
69279229cc | ||
|
|
5b7028c7bb | ||
|
|
0018db344c | ||
|
|
e9a4f4e70d | ||
|
|
be03de3ad6 | ||
|
|
d235325a95 | ||
|
|
6daa6e422e | ||
|
|
07913c3ff2 | ||
|
|
71ba7ea717 | ||
|
|
3b0e6cecd6 | ||
|
|
544de60d36 | ||
|
|
d652221071 | ||
|
|
4d5d3b7685 | ||
|
|
3bf9071598 | ||
|
|
46af07cc09 | ||
|
|
27692670b1 | ||
|
|
3708df61bf | ||
|
|
3f2dd04b10 | ||
|
|
fd598d8f3a | ||
|
|
4e0999dda7 | ||
|
|
eef3f62ff7 | ||
|
|
104eb8c6ad | ||
|
|
3959c7c3c1 | ||
|
|
b43f4073db | ||
|
|
01659271be | ||
|
|
c616a4a527 | ||
|
|
00ae424cac | ||
|
|
7b6e09b9a7 | ||
|
|
90a3e60de7 | ||
|
|
f3e91e2b2b | ||
|
|
846f5d4bd8 | ||
|
|
51520f9de6 | ||
|
|
9d457d3e34 | ||
|
|
8ddd946dea | ||
|
|
c20abf6b2a | ||
|
|
68a48c9cfc | ||
|
|
8c3f99f12e | ||
|
|
9b09ff29d2 | ||
|
|
f4e908bd91 | ||
|
|
5d8803b23e | ||
|
|
f970ca4d35 | ||
|
|
29cebbb0cd | ||
|
|
89d001caf3 | ||
|
|
67526f244e | ||
|
|
ae450fc23b | ||
|
|
82e816054e | ||
|
|
cb650f836e | ||
|
|
f4fc30a72d | ||
|
|
095701e86b | ||
|
|
dccceb44f9 | ||
|
|
5f389c999a | ||
|
|
29fa0a9a17 | ||
|
|
81bb2c9f3c | ||
|
|
3bf5a38c6f | ||
|
|
c93de0e803 | ||
|
|
d03203966a | ||
|
|
577e4c4e28 | ||
|
|
ebaea08225 | ||
|
|
1a78a3244b | ||
|
|
8f51a5e527 | ||
|
|
1d962dd3f7 | ||
|
|
bbf81aa3a4 | ||
|
|
862302f02d | ||
|
|
408336e7ad | ||
|
|
ab49c3100d | ||
|
|
ec27a30069 | ||
|
|
5e994ddf65 | ||
|
|
4eced4acec | ||
|
|
6df26422f6 | ||
|
|
a951e56f9c | ||
|
|
1f8e5fbcb1 | ||
|
|
ca6fed359b | ||
|
|
9961fb82d6 | ||
|
|
8326028d33 | ||
|
|
666d004b40 | ||
|
|
9a8f33f855 | ||
|
|
8181a7463e | ||
|
|
ac08fbd438 | ||
|
|
210b6f8f7e | ||
|
|
25366a22ad | ||
|
|
919a74ad88 | ||
|
|
b3c8f44b3e | ||
|
|
759f669214 | ||
|
|
70eca9462b | ||
|
|
60d9446656 | ||
|
|
934105bf34 | ||
|
|
26b8f5c3ce | ||
|
|
36693e27be | ||
|
|
a5d5403bf3 | ||
|
|
0e35651e94 | ||
|
|
837ffbddbc | ||
|
|
ff25573558 | ||
|
|
82a199d6d7 | ||
|
|
d15a507567 | ||
|
|
01e79f033e | ||
|
|
9a6e675b41 | ||
|
|
7331f169fc | ||
|
|
d09f35fa98 | ||
|
|
52d703a232 | ||
|
|
e4e00d2215 | ||
|
|
60944e3397 | ||
|
|
0b642cd414 | ||
|
|
b4de1c771b | ||
|
|
aedaac63ea | ||
|
|
2cb598f644 | ||
|
|
f070c548de | ||
|
|
ac3ad0810a | ||
|
|
1e96b7bbe5 | ||
|
|
0ea5d941e6 | ||
|
|
881491cd2b | ||
|
|
2c77165fc6 | ||
|
|
6561b8ade9 | ||
|
|
840c757b12 | ||
|
|
7055446508 | ||
|
|
e0434ad40e | ||
|
|
d53dd7f4c9 | ||
|
|
fed9816213 | ||
|
|
a35839aa47 | ||
|
|
5491275b66 | ||
|
|
70fe968f02 | ||
|
|
a3aa6a4449 | ||
|
|
8fa1e03367 | ||
|
|
0f0b121669 |
@@ -1,5 +1,6 @@
|
|||||||
language: python
|
language: python
|
||||||
dist: trusty
|
dist: trusty
|
||||||
|
group: deprecated-2017Q2
|
||||||
|
|
||||||
python:
|
python:
|
||||||
- "2.7"
|
- "2.7"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
__version__ = '8.1.1'
|
__version__ = '8.2.0'
|
||||||
|
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 0,
|
"allow_import": 0,
|
||||||
"allow_rename": 0,
|
"allow_rename": 0,
|
||||||
"beta": 0,
|
"beta": 0,
|
||||||
@@ -10,6 +11,7 @@
|
|||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -20,7 +22,9 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Payment Document",
|
"label": "Payment Document",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -30,6 +34,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -37,17 +42,20 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 1,
|
"columns": 2,
|
||||||
"fieldname": "payment_entry",
|
"fieldname": "payment_entry",
|
||||||
"fieldtype": "Dynamic Link",
|
"fieldtype": "Dynamic Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Payment Entry",
|
"label": "Payment Entry",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -58,6 +66,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -66,6 +75,7 @@
|
|||||||
"width": "50"
|
"width": "50"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -76,7 +86,9 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Against Account",
|
"label": "Against Account",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -86,6 +98,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -94,6 +107,7 @@
|
|||||||
"width": "15"
|
"width": "15"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -104,7 +118,9 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Amount",
|
"label": "Amount",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -115,6 +131,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -122,6 +139,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -132,7 +150,9 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
@@ -140,6 +160,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -148,6 +169,7 @@
|
|||||||
"width": "50%"
|
"width": "50%"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -158,7 +180,9 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Posting Date",
|
"label": "Posting Date",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -168,6 +192,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -175,17 +200,20 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 1,
|
"columns": 2,
|
||||||
"fieldname": "cheque_number",
|
"fieldname": "cheque_number",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Cheque Number",
|
"label": "Cheque Number",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -195,6 +223,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -202,6 +231,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -212,7 +242,9 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Cheque Date",
|
"label": "Cheque Date",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -222,6 +254,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -229,6 +262,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -239,7 +273,9 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Clearance Date",
|
"label": "Clearance Date",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -249,6 +285,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -256,18 +293,18 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"has_web_view": 0,
|
||||||
"hide_heading": 0,
|
"hide_heading": 0,
|
||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"image_view": 0,
|
"image_view": 0,
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"in_dialog": 0,
|
|
||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"menu_index": 0,
|
"menu_index": 0,
|
||||||
"modified": "2016-11-17 11:39:00.308624",
|
"modified": "2017-06-23 12:07:50.883515",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Bank Reconciliation Detail",
|
"name": "Bank Reconciliation Detail",
|
||||||
@@ -276,6 +313,8 @@
|
|||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"read_only_onload": 0,
|
"read_only_onload": 0,
|
||||||
|
"show_name_in_global_search": 0,
|
||||||
"sort_order": "ASC",
|
"sort_order": "ASC",
|
||||||
|
"track_changes": 0,
|
||||||
"track_seen": 0
|
"track_seen": 0
|
||||||
}
|
}
|
||||||
@@ -224,9 +224,9 @@ cur_frm.fields_dict.cash_bank_account.get_query = function(doc) {
|
|||||||
return {
|
return {
|
||||||
filters: [
|
filters: [
|
||||||
["Account", "account_type", "in", ["Cash", "Bank"]],
|
["Account", "account_type", "in", ["Cash", "Bank"]],
|
||||||
["Account", "root_type", "=", "Asset"],
|
|
||||||
["Account", "is_group", "=",0],
|
["Account", "is_group", "=",0],
|
||||||
["Account", "company", "=", doc.company]
|
["Account", "company", "=", doc.company],
|
||||||
|
["Account", "report_type", "=", "Balance Sheet"]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -502,8 +502,20 @@ frappe.ui.form.on('Sales Invoice', {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
frm.set_query('company_address', function(doc) {
|
||||||
|
if(!doc.company) {
|
||||||
|
frappe.throw(_('Please set Company'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
query: 'frappe.contacts.doctype.address.address.address_query',
|
||||||
|
filters: {
|
||||||
|
link_doctype: 'Company',
|
||||||
|
link_name: doc.company
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
project: function(frm){
|
project: function(frm){
|
||||||
|
|||||||
@@ -940,22 +940,22 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"description": "",
|
"fieldname": "company_address",
|
||||||
"fieldname": "customer_group",
|
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 1,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_global_search": 0,
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 0,
|
||||||
"label": "Customer Group",
|
"label": "Company Address",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"options": "Customer Group",
|
"options": "Address",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 1,
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"remember_last_selected_value": 0,
|
"remember_last_selected_value": 0,
|
||||||
@@ -3489,6 +3489,37 @@
|
|||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"description": "",
|
||||||
|
"fieldname": "customer_group",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"hidden": 1,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Customer Group",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "Customer Group",
|
||||||
|
"permlevel": 0,
|
||||||
|
"print_hide": 1,
|
||||||
|
"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_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
@@ -4596,7 +4627,7 @@
|
|||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"menu_index": 0,
|
"menu_index": 0,
|
||||||
"modified": "2017-06-16 17:07:55.483734",
|
"modified": "2017-06-22 14:45:35.257640",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Sales Invoice",
|
"name": "Sales Invoice",
|
||||||
|
|||||||
@@ -54,7 +54,10 @@ class SalesInvoice(SellingController):
|
|||||||
def validate(self):
|
def validate(self):
|
||||||
super(SalesInvoice, self).validate()
|
super(SalesInvoice, self).validate()
|
||||||
self.validate_auto_set_posting_time()
|
self.validate_auto_set_posting_time()
|
||||||
self.so_dn_required()
|
|
||||||
|
if not self.is_pos:
|
||||||
|
self.so_dn_required()
|
||||||
|
|
||||||
self.validate_proj_cust()
|
self.validate_proj_cust()
|
||||||
self.validate_with_previous_doc()
|
self.validate_with_previous_doc()
|
||||||
self.validate_uom_is_integer("stock_uom", "stock_qty")
|
self.validate_uom_is_integer("stock_uom", "stock_qty")
|
||||||
|
|||||||
@@ -576,11 +576,15 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
|||||||
})
|
})
|
||||||
|
|
||||||
$(this.numeric_keypad).find('.numeric-del').click(function(){
|
$(this.numeric_keypad).find('.numeric-del').click(function(){
|
||||||
me.selected_field = $(me.wrapper).find('.selected-item').find('.' + me.numeric_id)
|
if(me.numeric_id) {
|
||||||
me.numeric_val = cstr(flt(me.selected_field.val())).slice(0, -1);
|
me.selected_field = $(me.wrapper).find('.selected-item').find('.' + me.numeric_id)
|
||||||
me.selected_field.val(me.numeric_val);
|
me.numeric_val = cstr(flt(me.selected_field.val())).slice(0, -1);
|
||||||
me.selected_field.trigger("change")
|
me.selected_field.val(me.numeric_val);
|
||||||
// me.render_selected_item()
|
me.selected_field.trigger("change")
|
||||||
|
} else {
|
||||||
|
//Remove an item from the cart, if focus is at selected item
|
||||||
|
me.remove_selected_item()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
$(this.numeric_keypad).find('.pos-pay').click(function(){
|
$(this.numeric_keypad).find('.pos-pay').click(function(){
|
||||||
@@ -591,6 +595,14 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
remove_selected_item: function() {
|
||||||
|
this.remove_item = []
|
||||||
|
idx = $(this.wrapper).find(".pos-selected-item-action").attr("data-idx")
|
||||||
|
this.remove_item.push(idx)
|
||||||
|
this.remove_zero_qty_item()
|
||||||
|
this.update_paid_amount_status(false)
|
||||||
|
},
|
||||||
|
|
||||||
render_list_customers: function () {
|
render_list_customers: function () {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
|
|||||||
@@ -7,11 +7,12 @@ import frappe
|
|||||||
import datetime
|
import datetime
|
||||||
from frappe import _, msgprint, scrub
|
from frappe import _, msgprint, scrub
|
||||||
from frappe.defaults import get_user_permissions
|
from frappe.defaults import get_user_permissions
|
||||||
|
from frappe.model.utils import get_fetch_values
|
||||||
from frappe.utils import add_days, getdate, formatdate, get_first_day, date_diff, \
|
from frappe.utils import add_days, getdate, formatdate, get_first_day, date_diff, \
|
||||||
add_years, get_timestamp, nowdate, flt
|
add_years, get_timestamp, nowdate, flt
|
||||||
from frappe.contacts.doctype.address.address import get_address_display, get_default_address
|
from frappe.contacts.doctype.address.address import get_address_display, get_default_address
|
||||||
from frappe.contacts.doctype.contact.contact import get_contact_details, get_default_contact
|
from frappe.contacts.doctype.contact.contact import get_contact_details, get_default_contact
|
||||||
from erpnext.exceptions import PartyFrozen, InvalidCurrency, PartyDisabled, InvalidAccountCurrency
|
from erpnext.exceptions import PartyFrozen, PartyDisabled, InvalidAccountCurrency
|
||||||
from erpnext.accounts.utils import get_fiscal_year
|
from erpnext.accounts.utils import get_fiscal_year
|
||||||
from erpnext import get_default_currency
|
from erpnext import get_default_currency
|
||||||
|
|
||||||
@@ -42,7 +43,7 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
|
|||||||
|
|
||||||
party = frappe.get_doc(party_type, party)
|
party = frappe.get_doc(party_type, party)
|
||||||
|
|
||||||
set_address_details(out, party, party_type)
|
set_address_details(out, party, party_type, doctype, company)
|
||||||
set_contact_details(out, party, party_type)
|
set_contact_details(out, party, party_type)
|
||||||
set_other_values(out, party, party_type)
|
set_other_values(out, party, party_type)
|
||||||
set_price_list(out, party, party_type, price_list)
|
set_price_list(out, party, party_type, price_list)
|
||||||
@@ -60,10 +61,11 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
|
|||||||
|
|
||||||
return out
|
return out
|
||||||
|
|
||||||
def set_address_details(out, party, party_type):
|
def set_address_details(out, party, party_type, doctype=None, company=None):
|
||||||
billing_address_field = "customer_address" if party_type == "Lead" \
|
billing_address_field = "customer_address" if party_type == "Lead" \
|
||||||
else party_type.lower() + "_address"
|
else party_type.lower() + "_address"
|
||||||
out[billing_address_field] = get_default_address(party_type, party.name)
|
out[billing_address_field] = get_default_address(party_type, party.name)
|
||||||
|
out.update(get_fetch_values(doctype, billing_address_field, out[billing_address_field]))
|
||||||
|
|
||||||
# address display
|
# address display
|
||||||
out.address_display = get_address_display(out[billing_address_field])
|
out.address_display = get_address_display(out[billing_address_field])
|
||||||
@@ -72,6 +74,11 @@ def set_address_details(out, party, party_type):
|
|||||||
if party_type in ["Customer", "Lead"]:
|
if party_type in ["Customer", "Lead"]:
|
||||||
out.shipping_address_name = get_default_address(party_type, party.name, 'is_shipping_address')
|
out.shipping_address_name = get_default_address(party_type, party.name, 'is_shipping_address')
|
||||||
out.shipping_address = get_address_display(out["shipping_address_name"])
|
out.shipping_address = get_address_display(out["shipping_address_name"])
|
||||||
|
out.update(get_fetch_values(doctype, 'shipping_address_name', out.shipping_address_name))
|
||||||
|
|
||||||
|
if doctype and doctype in ['Sales Invoice']:
|
||||||
|
out.company_address = get_default_address('Company', company)
|
||||||
|
out.update(get_fetch_values(doctype, 'company_address', out.company_address))
|
||||||
|
|
||||||
def set_contact_details(out, party, party_type):
|
def set_contact_details(out, party, party_type):
|
||||||
out.contact_person = get_default_contact(party_type, party.name)
|
out.contact_person = get_default_contact(party_type, party.name)
|
||||||
@@ -363,28 +370,28 @@ def get_timeline_data(doctype, name):
|
|||||||
out.update({ timestamp: count })
|
out.update({ timestamp: count })
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
|
||||||
def get_dashboard_info(party_type, party):
|
def get_dashboard_info(party_type, party):
|
||||||
current_fiscal_year = get_fiscal_year(nowdate(), as_dict=True)
|
current_fiscal_year = get_fiscal_year(nowdate(), as_dict=True)
|
||||||
company = frappe.db.get_default("company") or frappe.get_all("Company")[0].name
|
company = frappe.db.get_default("company") or frappe.get_all("Company")[0].name
|
||||||
party_account_currency = get_party_account_currency(party_type, party, company)
|
party_account_currency = get_party_account_currency(party_type, party, company)
|
||||||
company_default_currency = get_default_currency() \
|
company_default_currency = get_default_currency() \
|
||||||
or frappe.db.get_value('Company', company, 'default_currency')
|
or frappe.db.get_value('Company', company, 'default_currency')
|
||||||
|
|
||||||
if party_account_currency==company_default_currency:
|
if party_account_currency==company_default_currency:
|
||||||
total_field = "base_grand_total"
|
total_field = "base_grand_total"
|
||||||
else:
|
else:
|
||||||
total_field = "grand_total"
|
total_field = "grand_total"
|
||||||
|
|
||||||
doctype = "Sales Invoice" if party_type=="Customer" else "Purchase Invoice"
|
doctype = "Sales Invoice" if party_type=="Customer" else "Purchase Invoice"
|
||||||
|
|
||||||
billing_this_year = frappe.db.sql("""
|
billing_this_year = frappe.db.sql("""
|
||||||
select sum({0})
|
select sum({0})
|
||||||
from `tab{1}`
|
from `tab{1}`
|
||||||
where {2}=%s and docstatus=1 and posting_date between %s and %s
|
where {2}=%s and docstatus=1 and posting_date between %s and %s
|
||||||
""".format(total_field, doctype, party_type.lower()),
|
""".format(total_field, doctype, party_type.lower()),
|
||||||
(party, current_fiscal_year.year_start_date, current_fiscal_year.year_end_date))
|
(party, current_fiscal_year.year_start_date, current_fiscal_year.year_end_date))
|
||||||
|
|
||||||
total_unpaid = frappe.db.sql("""
|
total_unpaid = frappe.db.sql("""
|
||||||
select sum(debit_in_account_currency) - sum(credit_in_account_currency)
|
select sum(debit_in_account_currency) - sum(credit_in_account_currency)
|
||||||
from `tabGL Entry`
|
from `tabGL Entry`
|
||||||
@@ -396,5 +403,5 @@ def get_dashboard_info(party_type, party):
|
|||||||
info["total_unpaid"] = flt(total_unpaid[0][0]) if total_unpaid else 0
|
info["total_unpaid"] = flt(total_unpaid[0][0]) if total_unpaid else 0
|
||||||
if party_type == "Supplier":
|
if party_type == "Supplier":
|
||||||
info["total_unpaid"] = -1 * info["total_unpaid"]
|
info["total_unpaid"] = -1 * info["total_unpaid"]
|
||||||
|
|
||||||
return info
|
return info
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ frappe.query_reports["General Ledger"] = {
|
|||||||
}
|
}
|
||||||
return party_type;
|
return party_type;
|
||||||
},
|
},
|
||||||
change: function() {
|
on_change: function() {
|
||||||
var party_type = frappe.query_report_filters_by_name.party_type.get_value();
|
var party_type = frappe.query_report_filters_by_name.party_type.get_value();
|
||||||
var party = frappe.query_report_filters_by_name.party.get_value();
|
var party = frappe.query_report_filters_by_name.party.get_value();
|
||||||
if(!party_type || !party) {
|
if(!party_type || !party) {
|
||||||
|
|||||||
@@ -7,11 +7,14 @@ from frappe import _
|
|||||||
from frappe.utils import flt
|
from frappe.utils import flt
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
|
return _execute(filters)
|
||||||
|
|
||||||
|
def _execute(filters=None, additional_table_columns=None, additional_query_columns=None):
|
||||||
if not filters: filters = {}
|
if not filters: filters = {}
|
||||||
columns = get_columns()
|
columns = get_columns(additional_table_columns)
|
||||||
last_col = len(columns)
|
last_col = len(columns)
|
||||||
|
|
||||||
item_list = get_items(filters)
|
item_list = get_items(filters, additional_query_columns)
|
||||||
aii_account_map = get_aii_accounts()
|
aii_account_map = get_aii_accounts()
|
||||||
if item_list:
|
if item_list:
|
||||||
item_row_tax, tax_accounts = get_tax_accounts(item_list, columns)
|
item_row_tax, tax_accounts = get_tax_accounts(item_list, columns)
|
||||||
@@ -23,7 +26,7 @@ def execute(filters=None):
|
|||||||
"width": 80
|
"width": 80
|
||||||
})
|
})
|
||||||
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
|
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
|
||||||
|
|
||||||
data = []
|
data = []
|
||||||
for d in item_list:
|
for d in item_list:
|
||||||
purchase_receipt = None
|
purchase_receipt = None
|
||||||
@@ -35,8 +38,16 @@ def execute(filters=None):
|
|||||||
|
|
||||||
expense_account = d.expense_account or aii_account_map.get(d.company)
|
expense_account = d.expense_account or aii_account_map.get(d.company)
|
||||||
row = [d.item_code, d.item_name, d.item_group, d.parent, d.posting_date, d.supplier,
|
row = [d.item_code, d.item_name, d.item_group, d.parent, d.posting_date, d.supplier,
|
||||||
d.supplier_name, d.credit_to, d.mode_of_payment, d.project, d.company, d.purchase_order,
|
d.supplier_name]
|
||||||
purchase_receipt, expense_account, d.qty, d.base_net_rate, d.base_net_amount]
|
|
||||||
|
if additional_query_columns:
|
||||||
|
for col in additional_query_columns:
|
||||||
|
row.append(d.get(col))
|
||||||
|
|
||||||
|
row += [
|
||||||
|
d.credit_to, d.mode_of_payment, d.project, d.company, d.purchase_order,
|
||||||
|
purchase_receipt, expense_account, d.qty, d.base_net_rate, d.base_net_amount
|
||||||
|
]
|
||||||
|
|
||||||
for tax in tax_accounts:
|
for tax in tax_accounts:
|
||||||
row.append(item_row_tax.get(d.name, {}).get(tax, 0))
|
row.append(item_row_tax.get(d.name, {}).get(tax, 0))
|
||||||
@@ -49,17 +60,27 @@ def execute(filters=None):
|
|||||||
return columns, data
|
return columns, data
|
||||||
|
|
||||||
|
|
||||||
def get_columns():
|
def get_columns(additional_table_columns):
|
||||||
return [_("Item Code") + ":Link/Item:120", _("Item Name") + "::120",
|
columns = [
|
||||||
|
_("Item Code") + ":Link/Item:120", _("Item Name") + "::120",
|
||||||
_("Item Group") + ":Link/Item Group:100", _("Invoice") + ":Link/Purchase Invoice:120",
|
_("Item Group") + ":Link/Item Group:100", _("Invoice") + ":Link/Purchase Invoice:120",
|
||||||
_("Posting Date") + ":Date:80", _("Supplier") + ":Link/Supplier:120",
|
_("Posting Date") + ":Date:80", _("Supplier") + ":Link/Supplier:120",
|
||||||
"Supplier Name::120", "Payable Account:Link/Account:120",
|
"Supplier Name::120"
|
||||||
|
]
|
||||||
|
|
||||||
|
if additional_table_columns:
|
||||||
|
columns += additional_table_columns
|
||||||
|
|
||||||
|
columns += [
|
||||||
|
"Payable Account:Link/Account:120",
|
||||||
_("Mode of Payment") + ":Link/Mode of Payment:80", _("Project") + ":Link/Project:80",
|
_("Mode of Payment") + ":Link/Mode of Payment:80", _("Project") + ":Link/Project:80",
|
||||||
_("Company") + ":Link/Company:100", _("Purchase Order") + ":Link/Purchase Order:100",
|
_("Company") + ":Link/Company:100", _("Purchase Order") + ":Link/Purchase Order:100",
|
||||||
_("Purchase Receipt") + ":Link/Purchase Receipt:100", _("Expense Account") + ":Link/Account:140",
|
_("Purchase Receipt") + ":Link/Purchase Receipt:100", _("Expense Account") + ":Link/Account:140",
|
||||||
_("Qty") + ":Float:120", _("Rate") + ":Currency/currency:120", _("Amount") + ":Currency/currency:120"
|
_("Qty") + ":Float:120", _("Rate") + ":Currency/currency:120", _("Amount") + ":Currency/currency:120"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
return columns
|
||||||
|
|
||||||
def get_conditions(filters):
|
def get_conditions(filters):
|
||||||
conditions = ""
|
conditions = ""
|
||||||
|
|
||||||
@@ -74,21 +95,23 @@ def get_conditions(filters):
|
|||||||
|
|
||||||
return conditions
|
return conditions
|
||||||
|
|
||||||
def get_items(filters):
|
def get_items(filters, additional_query_columns):
|
||||||
conditions = get_conditions(filters)
|
conditions = get_conditions(filters)
|
||||||
match_conditions = frappe.build_match_conditions("Purchase Invoice")
|
match_conditions = frappe.build_match_conditions("Purchase Invoice")
|
||||||
|
if additional_query_columns:
|
||||||
|
additional_query_columns = ', ' + ', '.join(additional_query_columns)
|
||||||
|
|
||||||
return frappe.db.sql("""
|
return frappe.db.sql("""
|
||||||
select
|
select
|
||||||
pi_item.name, pi_item.parent, pi.posting_date, pi.credit_to, pi.company,
|
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.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.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.base_net_rate,
|
pi_item.po_detail, pi_item.expense_account, pi_item.qty, pi_item.base_net_rate,
|
||||||
pi_item.base_net_amount, pi.supplier_name, pi.mode_of_payment
|
pi_item.base_net_amount, pi.supplier_name, pi.mode_of_payment {0}
|
||||||
from `tabPurchase Invoice` pi, `tabPurchase Invoice Item` pi_item
|
from `tabPurchase Invoice` pi, `tabPurchase Invoice Item` pi_item
|
||||||
where pi.name = pi_item.parent and pi.docstatus = 1 %s %s
|
where pi.name = pi_item.parent and pi.docstatus = 1 %s %s
|
||||||
order by pi.posting_date desc, pi_item.item_code desc
|
order by pi.posting_date desc, pi_item.item_code desc
|
||||||
""" % (conditions, match_conditions), filters, as_dict=1)
|
""".format(additional_query_columns) % (conditions, match_conditions), filters, as_dict=1)
|
||||||
|
|
||||||
def get_aii_accounts():
|
def get_aii_accounts():
|
||||||
return dict(frappe.db.sql("select name, stock_received_but_not_billed from tabCompany"))
|
return dict(frappe.db.sql("select name, stock_received_but_not_billed from tabCompany"))
|
||||||
@@ -104,11 +127,11 @@ def get_tax_accounts(item_list, columns):
|
|||||||
item_row_map.setdefault(d.parent, {}).setdefault(d.item_code, []).append(d)
|
item_row_map.setdefault(d.parent, {}).setdefault(d.item_code, []).append(d)
|
||||||
|
|
||||||
tax_details = frappe.db.sql("""
|
tax_details = frappe.db.sql("""
|
||||||
select
|
select
|
||||||
parent, account_head, item_wise_tax_detail, charge_type, base_tax_amount_after_discount_amount
|
parent, account_head, item_wise_tax_detail, charge_type, base_tax_amount_after_discount_amount
|
||||||
from `tabPurchase Taxes and Charges`
|
from `tabPurchase Taxes and Charges`
|
||||||
where parenttype = 'Purchase Invoice' and docstatus = 1
|
where parenttype = 'Purchase Invoice' and docstatus = 1
|
||||||
and (account_head is not null and account_head != '')
|
and (account_head is not null and account_head != '')
|
||||||
and category in ('Total', 'Valuation and Total')
|
and category in ('Total', 'Valuation and Total')
|
||||||
and parent in (%s)
|
and parent in (%s)
|
||||||
""" % ', '.join(['%s']*len(invoice_item_row)), tuple(invoice_item_row.keys()))
|
""" % ', '.join(['%s']*len(invoice_item_row)), tuple(invoice_item_row.keys()))
|
||||||
@@ -120,17 +143,17 @@ def get_tax_accounts(item_list, columns):
|
|||||||
if item_wise_tax_detail:
|
if item_wise_tax_detail:
|
||||||
try:
|
try:
|
||||||
item_wise_tax_detail = json.loads(item_wise_tax_detail)
|
item_wise_tax_detail = json.loads(item_wise_tax_detail)
|
||||||
|
|
||||||
for item_code, tax_amount in item_wise_tax_detail.items():
|
for item_code, tax_amount in item_wise_tax_detail.items():
|
||||||
tax_amount = flt(tax_amount[1]) if isinstance(tax_amount, list) else flt(tax_amount)
|
tax_amount = flt(tax_amount[1]) if isinstance(tax_amount, list) else flt(tax_amount)
|
||||||
|
|
||||||
item_net_amount = sum([flt(d.base_net_amount)
|
item_net_amount = sum([flt(d.base_net_amount)
|
||||||
for d in item_row_map.get(parent, {}).get(item_code, [])])
|
for d in item_row_map.get(parent, {}).get(item_code, [])])
|
||||||
|
|
||||||
for d in item_row_map.get(parent, {}).get(item_code, []):
|
for d in item_row_map.get(parent, {}).get(item_code, []):
|
||||||
item_tax_amount = flt((tax_amount * d.base_net_amount) / item_net_amount) if item_net_amount else 0
|
item_tax_amount = flt((tax_amount * d.base_net_amount) / item_net_amount) if item_net_amount else 0
|
||||||
item_row_tax.setdefault(d.name, {})[account_head] = item_tax_amount
|
item_row_tax.setdefault(d.name, {})[account_head] = item_tax_amount
|
||||||
|
|
||||||
except ValueError:
|
except ValueError:
|
||||||
continue
|
continue
|
||||||
elif charge_type == "Actual" and tax_amount:
|
elif charge_type == "Actual" and tax_amount:
|
||||||
|
|||||||
@@ -8,11 +8,14 @@ from frappe.utils import flt
|
|||||||
from erpnext.accounts.report.sales_register.sales_register import get_mode_of_payments
|
from erpnext.accounts.report.sales_register.sales_register import get_mode_of_payments
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
|
return _execute(filters)
|
||||||
|
|
||||||
|
def _execute(filters=None, additional_table_columns=None, additional_query_columns=None):
|
||||||
if not filters: filters = {}
|
if not filters: filters = {}
|
||||||
columns = get_columns()
|
columns = get_columns(additional_table_columns)
|
||||||
last_col = len(columns)
|
last_col = len(columns)
|
||||||
|
|
||||||
item_list = get_items(filters)
|
item_list = get_items(filters, additional_query_columns)
|
||||||
if item_list:
|
if item_list:
|
||||||
item_row_tax, tax_accounts = get_tax_accounts(item_list, columns)
|
item_row_tax, tax_accounts = get_tax_accounts(item_list, columns)
|
||||||
columns.append({
|
columns.append({
|
||||||
@@ -35,10 +38,17 @@ def execute(filters=None):
|
|||||||
if not delivery_note and d.update_stock:
|
if not delivery_note and d.update_stock:
|
||||||
delivery_note = d.parent
|
delivery_note = d.parent
|
||||||
|
|
||||||
row = [d.item_code, d.item_name, d.item_group, d.parent, d.posting_date, d.customer, d.customer_name,
|
row = [d.item_code, d.item_name, d.item_group, d.parent, d.posting_date, d.customer, d.customer_name]
|
||||||
d.customer_group, d.debit_to, ", ".join(mode_of_payments.get(d.parent, [])),
|
|
||||||
|
if additional_query_columns:
|
||||||
|
for col in additional_query_columns:
|
||||||
|
row.append(d.get(col))
|
||||||
|
|
||||||
|
row += [
|
||||||
|
d.customer_group, d.debit_to, ", ".join(mode_of_payments.get(d.parent, [])),
|
||||||
d.territory, d.project, d.company, d.sales_order,
|
d.territory, d.project, d.company, d.sales_order,
|
||||||
delivery_note, d.income_account, d.cost_center, d.qty, d.base_net_rate, d.base_net_amount]
|
delivery_note, d.income_account, d.cost_center, d.qty, d.base_net_rate, d.base_net_amount
|
||||||
|
]
|
||||||
|
|
||||||
for tax in tax_accounts:
|
for tax in tax_accounts:
|
||||||
row.append(item_row_tax.get(d.name, {}).get(tax, 0))
|
row.append(item_row_tax.get(d.name, {}).get(tax, 0))
|
||||||
@@ -50,12 +60,18 @@ def execute(filters=None):
|
|||||||
|
|
||||||
return columns, data
|
return columns, data
|
||||||
|
|
||||||
def get_columns():
|
def get_columns(additional_table_columns):
|
||||||
return [
|
columns = [
|
||||||
_("Item Code") + ":Link/Item:120", _("Item Name") + "::120",
|
_("Item Code") + ":Link/Item:120", _("Item Name") + "::120",
|
||||||
_("Item Group") + ":Link/Item Group:100", _("Invoice") + ":Link/Sales Invoice:120",
|
_("Item Group") + ":Link/Item Group:100", _("Invoice") + ":Link/Sales Invoice:120",
|
||||||
_("Posting Date") + ":Date:80", _("Customer") + ":Link/Customer:120",
|
_("Posting Date") + ":Date:80", _("Customer") + ":Link/Customer:120",
|
||||||
_("Customer Name") + "::120", _("Customer Group") + ":Link/Customer Group:120",
|
_("Customer Name") + "::120"]
|
||||||
|
|
||||||
|
if additional_table_columns:
|
||||||
|
columns += additional_table_columns
|
||||||
|
|
||||||
|
columns += [
|
||||||
|
_("Customer Group") + ":Link/Customer Group:120",
|
||||||
_("Receivable Account") + ":Link/Account:120",
|
_("Receivable Account") + ":Link/Account:120",
|
||||||
_("Mode of Payment") + "::120", _("Territory") + ":Link/Territory:80",
|
_("Mode of Payment") + "::120", _("Territory") + ":Link/Territory:80",
|
||||||
_("Project") + ":Link/Project:80", _("Company") + ":Link/Company:100",
|
_("Project") + ":Link/Project:80", _("Company") + ":Link/Company:100",
|
||||||
@@ -66,6 +82,8 @@ def get_columns():
|
|||||||
_("Amount") + ":Currency/currency:120"
|
_("Amount") + ":Currency/currency:120"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
return columns
|
||||||
|
|
||||||
def get_conditions(filters):
|
def get_conditions(filters):
|
||||||
conditions = ""
|
conditions = ""
|
||||||
|
|
||||||
@@ -76,15 +94,18 @@ def get_conditions(filters):
|
|||||||
("to_date", " and si.posting_date<=%(to_date)s")):
|
("to_date", " and si.posting_date<=%(to_date)s")):
|
||||||
if filters.get(opts[0]):
|
if filters.get(opts[0]):
|
||||||
conditions += opts[1]
|
conditions += opts[1]
|
||||||
|
|
||||||
if filters.get("mode_of_payment"):
|
if filters.get("mode_of_payment"):
|
||||||
conditions += """ and exists(select name from `tabSales Invoice Payment`
|
conditions += """ and exists(select name from `tabSales Invoice Payment`
|
||||||
where parent=si.name
|
where parent=si.name
|
||||||
and ifnull(`tabSales Invoice Payment`.mode_of_payment, '') = %(mode_of_payment)s)"""
|
and ifnull(`tabSales Invoice Payment`.mode_of_payment, '') = %(mode_of_payment)s)"""
|
||||||
|
|
||||||
return conditions
|
return conditions
|
||||||
|
|
||||||
def get_items(filters):
|
def get_items(filters, additional_query_columns):
|
||||||
|
if additional_query_columns:
|
||||||
|
additional_query_columns = ', ' + ', '.join(additional_query_columns)
|
||||||
|
|
||||||
conditions = get_conditions(filters)
|
conditions = get_conditions(filters)
|
||||||
return frappe.db.sql("""
|
return frappe.db.sql("""
|
||||||
select
|
select
|
||||||
@@ -93,10 +114,11 @@ def get_items(filters):
|
|||||||
si_item.item_code, si_item.item_name, si_item.item_group, si_item.sales_order,
|
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.delivery_note, si_item.income_account, si_item.cost_center, si_item.qty,
|
||||||
si_item.base_net_rate, si_item.base_net_amount, si.customer_name,
|
si_item.base_net_rate, si_item.base_net_amount, si.customer_name,
|
||||||
si.customer_group, si_item.so_detail, si.update_stock
|
si.customer_group, si_item.so_detail, si.update_stock {0}
|
||||||
from `tabSales Invoice` si, `tabSales Invoice Item` si_item
|
from `tabSales Invoice` si, `tabSales Invoice Item` si_item
|
||||||
where si.name = si_item.parent and si.docstatus = 1 %s
|
where si.name = si_item.parent and si.docstatus = 1 %s
|
||||||
order by si.posting_date desc, si_item.item_code desc""" % conditions, filters, as_dict=1)
|
order by si.posting_date desc, si_item.item_code desc
|
||||||
|
""".format(additional_query_columns or '') % conditions, filters, as_dict=1)
|
||||||
|
|
||||||
def get_tax_accounts(item_list, columns):
|
def get_tax_accounts(item_list, columns):
|
||||||
import json
|
import json
|
||||||
|
|||||||
@@ -7,10 +7,13 @@ from frappe.utils import flt
|
|||||||
from frappe import msgprint, _
|
from frappe import msgprint, _
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
|
return _execute(filters)
|
||||||
|
|
||||||
|
def _execute(filters=None, additional_table_columns=None, additional_query_columns=None):
|
||||||
if not filters: filters = {}
|
if not filters: filters = {}
|
||||||
|
|
||||||
invoice_list = get_invoices(filters)
|
invoice_list = get_invoices(filters, additional_query_columns)
|
||||||
columns, expense_accounts, tax_accounts = get_columns(invoice_list)
|
columns, expense_accounts, tax_accounts = get_columns(invoice_list, additional_table_columns)
|
||||||
|
|
||||||
if not invoice_list:
|
if not invoice_list:
|
||||||
msgprint(_("No record found"))
|
msgprint(_("No record found"))
|
||||||
@@ -20,8 +23,9 @@ def execute(filters=None):
|
|||||||
invoice_expense_map, invoice_tax_map = get_invoice_tax_map(invoice_list,
|
invoice_expense_map, invoice_tax_map = get_invoice_tax_map(invoice_list,
|
||||||
invoice_expense_map, expense_accounts)
|
invoice_expense_map, expense_accounts)
|
||||||
invoice_po_pr_map = get_invoice_po_pr_map(invoice_list)
|
invoice_po_pr_map = get_invoice_po_pr_map(invoice_list)
|
||||||
supplier_details = get_supplier_details(invoice_list)
|
suppliers = list(set([d.supplier for d in invoice_list]))
|
||||||
|
supplier_details = get_supplier_details(suppliers)
|
||||||
|
|
||||||
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
|
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
|
||||||
|
|
||||||
data = []
|
data = []
|
||||||
@@ -31,10 +35,18 @@ def execute(filters=None):
|
|||||||
purchase_receipt = list(set(invoice_po_pr_map.get(inv.name, {}).get("purchase_receipt", [])))
|
purchase_receipt = list(set(invoice_po_pr_map.get(inv.name, {}).get("purchase_receipt", [])))
|
||||||
project = list(set(invoice_po_pr_map.get(inv.name, {}).get("project", [])))
|
project = list(set(invoice_po_pr_map.get(inv.name, {}).get("project", [])))
|
||||||
|
|
||||||
row = [inv.name, inv.posting_date, inv.supplier, inv.supplier_name,
|
row = [inv.name, inv.posting_date, inv.supplier, inv.supplier_name]
|
||||||
supplier_details.get(inv.supplier),
|
|
||||||
inv.credit_to, inv.mode_of_payment, ", ".join(project), inv.bill_no, inv.bill_date, inv.remarks,
|
if additional_query_columns:
|
||||||
", ".join(purchase_order), ", ".join(purchase_receipt), company_currency]
|
for col in additional_query_columns:
|
||||||
|
row.append(inv.get(col))
|
||||||
|
|
||||||
|
row += [
|
||||||
|
supplier_details.get(inv.supplier), # supplier_type
|
||||||
|
inv.credit_to, inv.mode_of_payment, ", ".join(project),
|
||||||
|
inv.bill_no, inv.bill_date, inv.remarks,
|
||||||
|
", ".join(purchase_order), ", ".join(purchase_receipt), company_currency
|
||||||
|
]
|
||||||
|
|
||||||
# map expense values
|
# map expense values
|
||||||
base_net_total = 0
|
base_net_total = 0
|
||||||
@@ -61,15 +73,20 @@ def execute(filters=None):
|
|||||||
return columns, data
|
return columns, data
|
||||||
|
|
||||||
|
|
||||||
def get_columns(invoice_list):
|
def get_columns(invoice_list, additional_table_columns):
|
||||||
"""return columns based on filters"""
|
"""return columns based on filters"""
|
||||||
columns = [
|
columns = [
|
||||||
_("Invoice") + ":Link/Purchase Invoice:120", _("Posting Date") + ":Date:80",
|
_("Invoice") + ":Link/Purchase Invoice:120", _("Posting Date") + ":Date:80",
|
||||||
_("Supplier Id") + "::120", _("Supplier Name") + "::120",
|
_("Supplier Id") + "::120", _("Supplier Name") + "::120"]
|
||||||
_("Supplier Type") + ":Link/Supplier Type:120", _("Payable Account") + ":Link/Account:120",
|
|
||||||
_("Mode of Payment") + ":Link/Mode of Payment:80", _("Project") + ":Link/Project:80",
|
if additional_table_columns:
|
||||||
|
columns += additional_table_columns
|
||||||
|
|
||||||
|
columns += [
|
||||||
|
_("Supplier Type") + ":Link/Supplier Type:120", _("Payable Account") + ":Link/Account:120",
|
||||||
|
_("Mode of Payment") + ":Link/Mode of Payment:80", _("Project") + ":Link/Project:80",
|
||||||
_("Bill No") + "::120", _("Bill Date") + ":Date:80", _("Remarks") + "::150",
|
_("Bill No") + "::120", _("Bill Date") + ":Date:80", _("Remarks") + "::150",
|
||||||
_("Purchase Order") + ":Link/Purchase Order:100",
|
_("Purchase Order") + ":Link/Purchase Order:100",
|
||||||
_("Purchase Receipt") + ":Link/Purchase Receipt:100",
|
_("Purchase Receipt") + ":Link/Purchase Receipt:100",
|
||||||
{
|
{
|
||||||
"fieldname": "currency",
|
"fieldname": "currency",
|
||||||
@@ -114,27 +131,31 @@ def get_conditions(filters):
|
|||||||
|
|
||||||
if filters.get("from_date"): conditions += " and posting_date>=%(from_date)s"
|
if filters.get("from_date"): conditions += " and posting_date>=%(from_date)s"
|
||||||
if filters.get("to_date"): conditions += " and posting_date<=%(to_date)s"
|
if filters.get("to_date"): conditions += " and posting_date<=%(to_date)s"
|
||||||
|
|
||||||
if filters.get("mode_of_payment"): conditions += " and ifnull(mode_of_payment, '') = %(mode_of_payment)s"
|
if filters.get("mode_of_payment"): conditions += " and ifnull(mode_of_payment, '') = %(mode_of_payment)s"
|
||||||
|
|
||||||
return conditions
|
return conditions
|
||||||
|
|
||||||
def get_invoices(filters):
|
def get_invoices(filters, additional_query_columns):
|
||||||
|
if additional_query_columns:
|
||||||
|
additional_query_columns = ', ' + ', '.join(additional_query_columns)
|
||||||
|
|
||||||
conditions = get_conditions(filters)
|
conditions = get_conditions(filters)
|
||||||
return frappe.db.sql("""
|
return frappe.db.sql("""
|
||||||
select
|
select
|
||||||
name, posting_date, credit_to, supplier, supplier_name, bill_no, bill_date, remarks,
|
name, posting_date, credit_to, supplier, supplier_name, bill_no, bill_date,
|
||||||
base_net_total, base_grand_total, outstanding_amount, mode_of_payment
|
remarks, base_net_total, base_grand_total, outstanding_amount,
|
||||||
from `tabPurchase Invoice`
|
mode_of_payment {0}
|
||||||
|
from `tabPurchase Invoice`
|
||||||
where docstatus = 1 %s
|
where docstatus = 1 %s
|
||||||
order by posting_date desc, name desc""" % conditions, filters, as_dict=1)
|
order by posting_date desc, name desc""".format(additional_query_columns or '') % conditions, filters, as_dict=1)
|
||||||
|
|
||||||
|
|
||||||
def get_invoice_expense_map(invoice_list):
|
def get_invoice_expense_map(invoice_list):
|
||||||
expense_details = frappe.db.sql("""
|
expense_details = frappe.db.sql("""
|
||||||
select parent, expense_account, sum(base_net_amount) as amount
|
select parent, expense_account, sum(base_net_amount) as amount
|
||||||
from `tabPurchase Invoice Item`
|
from `tabPurchase Invoice Item`
|
||||||
where parent in (%s)
|
where parent in (%s)
|
||||||
group by parent, expense_account
|
group by parent, expense_account
|
||||||
""" % ', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1)
|
""" % ', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1)
|
||||||
|
|
||||||
@@ -149,7 +170,7 @@ def get_invoice_tax_map(invoice_list, invoice_expense_map, expense_accounts):
|
|||||||
tax_details = frappe.db.sql("""
|
tax_details = frappe.db.sql("""
|
||||||
select parent, account_head, case add_deduct_tax when "Add" then sum(base_tax_amount_after_discount_amount)
|
select parent, account_head, case add_deduct_tax when "Add" then sum(base_tax_amount_after_discount_amount)
|
||||||
else sum(base_tax_amount_after_discount_amount) * -1 end as tax_amount
|
else sum(base_tax_amount_after_discount_amount) * -1 end as tax_amount
|
||||||
from `tabPurchase Taxes and Charges`
|
from `tabPurchase Taxes and Charges`
|
||||||
where parent in (%s) and category in ('Total', 'Valuation and Total')
|
where parent in (%s) and category in ('Total', 'Valuation and Total')
|
||||||
group by parent, account_head, add_deduct_tax
|
group by parent, account_head, add_deduct_tax
|
||||||
""" % ', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1)
|
""" % ', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1)
|
||||||
@@ -169,8 +190,8 @@ def get_invoice_tax_map(invoice_list, invoice_expense_map, expense_accounts):
|
|||||||
|
|
||||||
def get_invoice_po_pr_map(invoice_list):
|
def get_invoice_po_pr_map(invoice_list):
|
||||||
pi_items = frappe.db.sql("""
|
pi_items = frappe.db.sql("""
|
||||||
select parent, purchase_order, purchase_receipt, po_detail, project
|
select parent, purchase_order, purchase_receipt, po_detail, project
|
||||||
from `tabPurchase Invoice Item`
|
from `tabPurchase Invoice Item`
|
||||||
where parent in (%s) and (ifnull(purchase_order, '') != '' or ifnull(purchase_receipt, '') != '')
|
where parent in (%s) and (ifnull(purchase_order, '') != '' or ifnull(purchase_receipt, '') != '')
|
||||||
""" % ', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1)
|
""" % ', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1)
|
||||||
|
|
||||||
@@ -205,9 +226,8 @@ def get_account_details(invoice_list):
|
|||||||
|
|
||||||
return account_map
|
return account_map
|
||||||
|
|
||||||
def get_supplier_details(invoice_list):
|
def get_supplier_details(suppliers):
|
||||||
supplier_details = {}
|
supplier_details = {}
|
||||||
suppliers = list(set([inv.supplier for inv in invoice_list]))
|
|
||||||
for supp in frappe.db.sql("""select name, supplier_type from `tabSupplier`
|
for supp in frappe.db.sql("""select name, supplier_type from `tabSupplier`
|
||||||
where name in (%s)""" % ", ".join(["%s"]*len(suppliers)), tuple(suppliers), as_dict=1):
|
where name in (%s)""" % ", ".join(["%s"]*len(suppliers)), tuple(suppliers), as_dict=1):
|
||||||
supplier_details.setdefault(supp.name, supp.supplier_type)
|
supplier_details.setdefault(supp.name, supp.supplier_type)
|
||||||
|
|||||||
@@ -7,10 +7,13 @@ from frappe.utils import flt
|
|||||||
from frappe import msgprint, _
|
from frappe import msgprint, _
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
|
return _execute(filters)
|
||||||
|
|
||||||
|
def _execute(filters, additional_table_columns=None, additional_query_columns=None):
|
||||||
if not filters: filters = frappe._dict({})
|
if not filters: filters = frappe._dict({})
|
||||||
|
|
||||||
invoice_list = get_invoices(filters)
|
invoice_list = get_invoices(filters, additional_query_columns)
|
||||||
columns, income_accounts, tax_accounts = get_columns(invoice_list)
|
columns, income_accounts, tax_accounts = get_columns(invoice_list, additional_table_columns)
|
||||||
|
|
||||||
if not invoice_list:
|
if not invoice_list:
|
||||||
msgprint(_("No record found"))
|
msgprint(_("No record found"))
|
||||||
@@ -21,7 +24,8 @@ def execute(filters=None):
|
|||||||
invoice_income_map, income_accounts)
|
invoice_income_map, income_accounts)
|
||||||
|
|
||||||
invoice_so_dn_map = get_invoice_so_dn_map(invoice_list)
|
invoice_so_dn_map = get_invoice_so_dn_map(invoice_list)
|
||||||
customer_map = get_customer_details(invoice_list)
|
customers = list(set([inv.customer for inv in invoice_list]))
|
||||||
|
customer_map = get_customer_details(customers)
|
||||||
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
|
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
|
||||||
mode_of_payments = get_mode_of_payments([inv.name for inv in invoice_list])
|
mode_of_payments = get_mode_of_payments([inv.name for inv in invoice_list])
|
||||||
|
|
||||||
@@ -31,12 +35,22 @@ def execute(filters=None):
|
|||||||
sales_order = list(set(invoice_so_dn_map.get(inv.name, {}).get("sales_order", [])))
|
sales_order = list(set(invoice_so_dn_map.get(inv.name, {}).get("sales_order", [])))
|
||||||
delivery_note = list(set(invoice_so_dn_map.get(inv.name, {}).get("delivery_note", [])))
|
delivery_note = list(set(invoice_so_dn_map.get(inv.name, {}).get("delivery_note", [])))
|
||||||
|
|
||||||
row = [inv.name, inv.posting_date, inv.customer, inv.customer_name,
|
customer_details = customer_map.get(inv.customer, {})
|
||||||
customer_map.get(inv.customer, {}).get("customer_group"),
|
row = [
|
||||||
customer_map.get(inv.customer, {}).get("territory"),
|
inv.name, inv.posting_date, inv.customer, inv.customer_name
|
||||||
inv.debit_to, ", ".join(mode_of_payments.get(inv.name, [])), inv.project, inv.remarks,
|
]
|
||||||
", ".join(sales_order), ", ".join(delivery_note), company_currency]
|
|
||||||
|
|
||||||
|
if additional_query_columns:
|
||||||
|
for col in additional_query_columns:
|
||||||
|
row.append(inv.get(col))
|
||||||
|
|
||||||
|
row +=[
|
||||||
|
customer_details.get("customer_group"),
|
||||||
|
customer_details.get("territory"),
|
||||||
|
inv.debit_to, ", ".join(mode_of_payments.get(inv.name, [])),
|
||||||
|
inv.project, inv.remarks,
|
||||||
|
", ".join(sales_order), ", ".join(delivery_note), company_currency
|
||||||
|
]
|
||||||
# map income values
|
# map income values
|
||||||
base_net_total = 0
|
base_net_total = 0
|
||||||
for income_acc in income_accounts:
|
for income_acc in income_accounts:
|
||||||
@@ -62,15 +76,20 @@ def execute(filters=None):
|
|||||||
|
|
||||||
return columns, data
|
return columns, data
|
||||||
|
|
||||||
|
def get_columns(invoice_list, additional_table_columns):
|
||||||
def get_columns(invoice_list):
|
|
||||||
"""return columns based on filters"""
|
"""return columns based on filters"""
|
||||||
columns = [
|
columns = [
|
||||||
_("Invoice") + ":Link/Sales Invoice:120", _("Posting Date") + ":Date:80",
|
_("Invoice") + ":Link/Sales Invoice:120", _("Posting Date") + ":Date:80",
|
||||||
_("Customer Id") + "::120", _("Customer Name") + "::120",
|
_("Customer") + ":Link/Customer:120", _("Customer Name") + "::120"
|
||||||
_("Customer Group") + ":Link/Customer Group:120", _("Territory") + ":Link/Territory:80",
|
]
|
||||||
_("Receivable Account") + ":Link/Account:120", _("Mode of Payment") + "::120",
|
|
||||||
_("Project") +":Link/Project:80", _("Remarks") + "::150",
|
if additional_table_columns:
|
||||||
|
columns += additional_table_columns
|
||||||
|
|
||||||
|
columns +=[
|
||||||
|
_("Customer Group") + ":Link/Customer Group:120", _("Territory") + ":Link/Territory:80",
|
||||||
|
_("Receivable Account") + ":Link/Account:120", _("Mode of Payment") + "::120",
|
||||||
|
_("Project") +":Link/Project:80", _("Remarks") + "::150",
|
||||||
_("Sales Order") + ":Link/Sales Order:100", _("Delivery Note") + ":Link/Delivery Note:100",
|
_("Sales Order") + ":Link/Sales Order:100", _("Delivery Note") + ":Link/Delivery Note:100",
|
||||||
{
|
{
|
||||||
"fieldname": "currency",
|
"fieldname": "currency",
|
||||||
@@ -113,20 +132,23 @@ def get_conditions(filters):
|
|||||||
|
|
||||||
if filters.get("from_date"): conditions += " and posting_date >= %(from_date)s"
|
if filters.get("from_date"): conditions += " and posting_date >= %(from_date)s"
|
||||||
if filters.get("to_date"): conditions += " and posting_date <= %(to_date)s"
|
if filters.get("to_date"): conditions += " and posting_date <= %(to_date)s"
|
||||||
|
|
||||||
if filters.get("mode_of_payment"):
|
if filters.get("mode_of_payment"):
|
||||||
conditions += """ and exists(select name from `tabSales Invoice Payment`
|
conditions += """ and exists(select name from `tabSales Invoice Payment`
|
||||||
where parent=`tabSales Invoice`.name
|
where parent=`tabSales Invoice`.name
|
||||||
and ifnull(`tabSales Invoice Payment`.mode_of_payment, '') = %(mode_of_payment)s)"""
|
and ifnull(`tabSales Invoice Payment`.mode_of_payment, '') = %(mode_of_payment)s)"""
|
||||||
|
|
||||||
return conditions
|
return conditions
|
||||||
|
|
||||||
def get_invoices(filters):
|
def get_invoices(filters, additional_query_columns):
|
||||||
|
if additional_query_columns:
|
||||||
|
additional_query_columns = ', ' + ', '.join(additional_query_columns)
|
||||||
|
|
||||||
conditions = get_conditions(filters)
|
conditions = get_conditions(filters)
|
||||||
return frappe.db.sql("""select name, posting_date, debit_to, project, customer, customer_name, remarks,
|
return frappe.db.sql("""select name, posting_date, debit_to, project, customer, customer_name, remarks,
|
||||||
base_net_total, base_grand_total, base_rounded_total, outstanding_amount
|
base_net_total, base_grand_total, base_rounded_total, outstanding_amount {0}
|
||||||
from `tabSales Invoice`
|
from `tabSales Invoice`
|
||||||
where docstatus = 1 %s order by posting_date desc, name desc""" %
|
where docstatus = 1 %s order by posting_date desc, name desc""".format(additional_query_columns or '') %
|
||||||
conditions, filters, as_dict=1)
|
conditions, filters, as_dict=1)
|
||||||
|
|
||||||
def get_invoice_income_map(invoice_list):
|
def get_invoice_income_map(invoice_list):
|
||||||
@@ -184,9 +206,8 @@ def get_invoice_so_dn_map(invoice_list):
|
|||||||
|
|
||||||
return invoice_so_dn_map
|
return invoice_so_dn_map
|
||||||
|
|
||||||
def get_customer_details(invoice_list):
|
def get_customer_details(customers):
|
||||||
customer_map = {}
|
customer_map = {}
|
||||||
customers = list(set([inv.customer for inv in invoice_list]))
|
|
||||||
for cust in frappe.db.sql("""select name, territory, customer_group from `tabCustomer`
|
for cust in frappe.db.sql("""select name, territory, customer_group from `tabCustomer`
|
||||||
where name in (%s)""" % ", ".join(["%s"]*len(customers)), tuple(customers), as_dict=1):
|
where name in (%s)""" % ", ".join(["%s"]*len(customers)), tuple(customers), as_dict=1):
|
||||||
customer_map.setdefault(cust.name, cust)
|
customer_map.setdefault(cust.name, cust)
|
||||||
|
|||||||
@@ -311,6 +311,9 @@ def make_purchase_invoice(source_name, target_doc=None):
|
|||||||
doc = get_mapped_doc("Purchase Order", source_name, {
|
doc = get_mapped_doc("Purchase Order", source_name, {
|
||||||
"Purchase Order": {
|
"Purchase Order": {
|
||||||
"doctype": "Purchase Invoice",
|
"doctype": "Purchase Invoice",
|
||||||
|
"field_map": {
|
||||||
|
"party_account_currency": "party_account_currency"
|
||||||
|
},
|
||||||
"validation": {
|
"validation": {
|
||||||
"docstatus": ["=", 1],
|
"docstatus": ["=", 1],
|
||||||
}
|
}
|
||||||
|
|||||||
3
erpnext/buying/doctype/supplier/regional/india.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{% include "erpnext/regional/india/party.js" %}
|
||||||
|
|
||||||
|
erpnext.setup_gst_reminder_button('Supplier');
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
frappe.listview_settings['Supplier'] = {
|
frappe.listview_settings['Supplier'] = {
|
||||||
add_fields: ["supplier_name", "supplier_type"],
|
add_fields: ["supplier_name", "supplier_type", "image"],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ def get_data():
|
|||||||
{
|
{
|
||||||
"type": "report",
|
"type": "report",
|
||||||
"name": "Accounts Receivable",
|
"name": "Accounts Receivable",
|
||||||
"doctype": "Sales Invoice",
|
"doctype": "Sales Invoice",
|
||||||
"is_query_report": True
|
"is_query_report": True
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -198,6 +198,39 @@ def get_data():
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": _("Goods and Services Tax (GST India)"),
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"name": "GST Settings",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"name": "GST HSN Code",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "report",
|
||||||
|
"name": "GST Sales Register",
|
||||||
|
"is_query_report": True
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "report",
|
||||||
|
"name": "GST Purchase Register",
|
||||||
|
"is_query_report": True
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "report",
|
||||||
|
"name": "GST Itemised Sales Register",
|
||||||
|
"is_query_report": True
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "report",
|
||||||
|
"name": "GST Itemised Purchase Register",
|
||||||
|
"is_query_report": True
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": _("Budget and Cost Center"),
|
"label": _("Budget and Cost Center"),
|
||||||
"items": [
|
"items": [
|
||||||
|
|||||||
@@ -49,6 +49,12 @@ def get_data():
|
|||||||
"doctype": "Issue",
|
"doctype": "Issue",
|
||||||
"is_query_report": True
|
"is_query_report": True
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "report",
|
||||||
|
"name": "Support Hours",
|
||||||
|
"doctype": "Issue",
|
||||||
|
"is_query_report": True
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ class BuyingController(StockController):
|
|||||||
|
|
||||||
def get_items_from_bom(self, item_code, bom):
|
def get_items_from_bom(self, item_code, bom):
|
||||||
bom_items = frappe.db.sql("""select t2.item_code,
|
bom_items = frappe.db.sql("""select t2.item_code,
|
||||||
t2.qty / ifnull(t1.quantity, 1) as qty_consumed_per_unit,
|
t2.stock_qty / ifnull(t1.quantity, 1) as qty_consumed_per_unit,
|
||||||
t2.rate, t2.stock_uom, t2.name, t2.description
|
t2.rate, t2.stock_uom, t2.name, t2.description
|
||||||
from `tabBOM` t1, `tabBOM Item` t2, tabItem t3
|
from `tabBOM` t1, `tabBOM Item` t2, tabItem t3
|
||||||
where t2.parent = t1.name and t1.item = %s
|
where t2.parent = t1.name and t1.item = %s
|
||||||
|
|||||||
@@ -316,6 +316,8 @@ def setup_account():
|
|||||||
doc.parent_account = frappe.db.get_value('Account', {'account_name': doc.parent_account})
|
doc.parent_account = frappe.db.get_value('Account', {'account_name': doc.parent_account})
|
||||||
doc.insert()
|
doc.insert()
|
||||||
|
|
||||||
|
frappe.flags.in_import = False
|
||||||
|
|
||||||
def setup_account_to_expense_type():
|
def setup_account_to_expense_type():
|
||||||
company_abbr = frappe.db.get_value("Company", erpnext.get_default_company(), "abbr")
|
company_abbr = frappe.db.get_value("Company", erpnext.get_default_company(), "abbr")
|
||||||
expense_types = [{'name': _('Calls'), "account": "Sales Expenses - "+ company_abbr},
|
expense_types = [{'name': _('Calls'), "account": "Sales Expenses - "+ company_abbr},
|
||||||
@@ -380,4 +382,6 @@ def import_json(doctype, submit=False, values=None):
|
|||||||
|
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
|
|
||||||
|
frappe.flags.in_import = False
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
erpnext/docs/assets/img/accounts/pos_deleted_item.gif
Normal file
|
After Width: | Height: | Size: 426 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
BIN
erpnext/docs/assets/img/buying/purchase-taxes.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
erpnext/docs/assets/img/buying/supplier-quotation-f.jpg
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
erpnext/docs/assets/img/crm/sales-analytics-customer.gif
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
erpnext/docs/assets/img/crm/sales-partner-listing.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
erpnext/docs/assets/img/customize/kanban-board-1.png
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
erpnext/docs/assets/img/customize/kanban-board-2.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
erpnext/docs/assets/img/customize/kanban-board-3.gif
Normal file
|
After Width: | Height: | Size: 152 KiB |
BIN
erpnext/docs/assets/img/customize/kanban-board-4.gif
Normal file
|
After Width: | Height: | Size: 568 KiB |
BIN
erpnext/docs/assets/img/customize/kanban-board-5.gif
Normal file
|
After Width: | Height: | Size: 429 KiB |
BIN
erpnext/docs/assets/img/customize/kanban-board-6.gif
Normal file
|
After Width: | Height: | Size: 113 KiB |
BIN
erpnext/docs/assets/img/customize/kanban-board-7.gif
Normal file
|
After Width: | Height: | Size: 268 KiB |
BIN
erpnext/docs/assets/img/manufacturing/subcontract.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
erpnext/docs/assets/img/manufacturing/subcontract2.png
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
erpnext/docs/assets/img/manufacturing/subcontract3.png
Normal file
|
After Width: | Height: | Size: 72 KiB |
BIN
erpnext/docs/assets/img/manufacturing/subcontract4.png
Normal file
|
After Width: | Height: | Size: 117 KiB |
BIN
erpnext/docs/assets/img/manufacturing/subcontract5.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
erpnext/docs/assets/img/regional/india/gst-in-coa.png
Normal file
|
After Width: | Height: | Size: 279 KiB |
BIN
erpnext/docs/assets/img/regional/india/gst-invoice.gif
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
BIN
erpnext/docs/assets/img/regional/india/gst-itemised.png
Normal file
|
After Width: | Height: | Size: 106 KiB |
BIN
erpnext/docs/assets/img/regional/india/gst-menu.png
Normal file
|
After Width: | Height: | Size: 170 KiB |
BIN
erpnext/docs/assets/img/regional/india/gst-settings.png
Normal file
|
After Width: | Height: | Size: 120 KiB |
BIN
erpnext/docs/assets/img/regional/india/gst-template-in-state.png
Normal file
|
After Width: | Height: | Size: 162 KiB |
BIN
erpnext/docs/assets/img/regional/india/gstin-company.gif
Normal file
|
After Width: | Height: | Size: 538 KiB |
BIN
erpnext/docs/assets/img/regional/india/gstin-customer.gif
Normal file
|
After Width: | Height: | Size: 789 KiB |
BIN
erpnext/docs/assets/img/regional/india/gstin-portal-update.png
Normal file
|
After Width: | Height: | Size: 107 KiB |
BIN
erpnext/docs/assets/img/regional/india/gstin-reminder-email.png
Normal file
|
After Width: | Height: | Size: 109 KiB |
BIN
erpnext/docs/assets/img/regional/india/hsn-item.gif
Normal file
|
After Width: | Height: | Size: 337 KiB |
BIN
erpnext/docs/assets/img/selling/Item-UOM.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
erpnext/docs/assets/img/selling/Sale-Order-UOM.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
erpnext/docs/assets/img/selling/portal-new-ticket.png
Normal file
|
After Width: | Height: | Size: 84 KiB |
BIN
erpnext/docs/assets/img/selling/portal-ticket-1.gif
Normal file
|
After Width: | Height: | Size: 380 KiB |
BIN
erpnext/docs/assets/img/selling/portal-ticket-list-empty.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
erpnext/docs/assets/img/selling/portal-ticket-reply.gif
Normal file
|
After Width: | Height: | Size: 565 KiB |
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 1.7 MiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 58 KiB |
BIN
erpnext/docs/assets/img/selling/target-distribution.png
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
erpnext/docs/assets/img/setup/data-import/data-import-4.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
erpnext/docs/assets/img/setup/data-import/data-import-excel.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
BIN
erpnext/docs/assets/img/setup/sms-settings1.png
Normal file
|
After Width: | Height: | Size: 88 KiB |
BIN
erpnext/docs/assets/img/stock/batch_no_modal.png
Normal file
|
After Width: | Height: | Size: 92 KiB |
BIN
erpnext/docs/assets/img/stock/item-manufacturing-website.png
Normal file
|
After Width: | Height: | Size: 97 KiB |
BIN
erpnext/docs/assets/img/stock/item-price-1.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
erpnext/docs/assets/img/stock/item-price-2.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
erpnext/docs/assets/img/stock/item-price-3.png
Normal file
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 162 KiB |
BIN
erpnext/docs/assets/img/stock/serial_no_modal.gif
Normal file
|
After Width: | Height: | Size: 3.6 MiB |
BIN
erpnext/docs/assets/img/support/support_hours.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 53 KiB |
BIN
erpnext/docs/assets/img/website/portal-new-ticket.png
Normal file
|
After Width: | Height: | Size: 84 KiB |
BIN
erpnext/docs/assets/img/website/portal-ticket-1.gif
Normal file
|
After Width: | Height: | Size: 380 KiB |
BIN
erpnext/docs/assets/img/website/portal-ticket-list-empty.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
erpnext/docs/assets/img/website/portal-ticket-reply.gif
Normal file
|
After Width: | Height: | Size: 565 KiB |
BIN
erpnext/docs/assets/img/website/shopping-cart-1.png
Normal file
|
After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 128 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 17 KiB |