Compare commits
1035 Commits
v11.0.3-be
...
v11.1.18
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
05c8474db3 | ||
|
|
75b4de3e20 | ||
|
|
892f675cf7 | ||
|
|
223bd45e06 | ||
|
|
f3a1fa0bae | ||
|
|
5fdbdd50f9 | ||
|
|
52ae923566 | ||
|
|
9d159be826 | ||
|
|
d4365e25c4 | ||
|
|
6f82f96816 | ||
|
|
8dadd4b0b2 | ||
|
|
fd2b1385a3 | ||
|
|
29dc744354 | ||
|
|
6343a697a2 | ||
|
|
13752774ab | ||
|
|
c4599c21c3 | ||
|
|
fb8f1b93d6 | ||
|
|
f7f85f7379 | ||
|
|
862f77cc13 | ||
|
|
66d07c2700 | ||
|
|
cf7538c17f | ||
|
|
043cfe99ad | ||
|
|
c268682772 | ||
|
|
9da14747aa | ||
|
|
573d1dd31f | ||
|
|
86fb523ea7 | ||
|
|
0a90ce5cf6 | ||
|
|
6262c9ed6a | ||
|
|
6cc9831ce9 | ||
|
|
f2036dd1d1 | ||
|
|
1271dea39b | ||
|
|
89a2577ae5 | ||
|
|
bd80fd13cb | ||
|
|
ea19250884 | ||
|
|
010acf75fa | ||
|
|
a7992ecb62 | ||
|
|
abc2a64d5e | ||
|
|
1b7059b867 | ||
|
|
2405e14dde | ||
|
|
36824cf7fb | ||
|
|
4510e3a836 | ||
|
|
e43b6beff0 | ||
|
|
22ebaf1b11 | ||
|
|
1df62097f6 | ||
|
|
6d2bb9126a | ||
|
|
411f66a177 | ||
|
|
3eeb1cacb0 | ||
|
|
a0927c1ba6 | ||
|
|
8aaee57921 | ||
|
|
c45c2bdabb | ||
|
|
7aefc15352 | ||
|
|
fdbb516a1b | ||
|
|
1c785a99b1 | ||
|
|
843b7f6dd5 | ||
|
|
0a03e3d30c | ||
|
|
4ed7d035cb | ||
|
|
794b6b6c0d | ||
|
|
689490e4de | ||
|
|
4f9ac0ad55 | ||
|
|
ec56122876 | ||
|
|
1af3c41da3 | ||
|
|
67876d1026 | ||
|
|
f7f32634c8 | ||
|
|
6ab6d35f92 | ||
|
|
9673d0ddae | ||
|
|
0f1271612a | ||
|
|
021ccf572a | ||
|
|
138e030055 | ||
|
|
1d04ea1212 | ||
|
|
56e491bccd | ||
|
|
d562e9530e | ||
|
|
c0de5b741e | ||
|
|
da87a491ab | ||
|
|
7678c7b179 | ||
|
|
ff04142d9b | ||
|
|
7defd6f3b5 | ||
|
|
199aae0fe8 | ||
|
|
9c214b6129 | ||
|
|
2f9c7171fa | ||
|
|
a7cf7fbccc | ||
|
|
ce8d20c489 | ||
|
|
83cc587f8f | ||
|
|
f45db71ba2 | ||
|
|
f288866130 | ||
|
|
e521f51e5f | ||
|
|
7fc1bc0b27 | ||
|
|
a322687897 | ||
|
|
40046721b2 | ||
|
|
8808a3fc8e | ||
|
|
4904ce649e | ||
|
|
1a6e01542a | ||
|
|
1e7d768a45 | ||
|
|
642a5b69f5 | ||
|
|
2f5f17fcbb | ||
|
|
2046024de9 | ||
|
|
ac199580af | ||
|
|
4c8627e88d | ||
|
|
d4e4316d0b | ||
|
|
01086ff60c | ||
|
|
11bba571af | ||
|
|
cc65447e62 | ||
|
|
f71cb8dc6d | ||
|
|
73acb8c837 | ||
|
|
d787ef8b8e | ||
|
|
88c990901d | ||
|
|
0407bf1e00 | ||
|
|
2def228da8 | ||
|
|
a57d58f756 | ||
|
|
1a4bfdd090 | ||
|
|
aa03ea2a56 | ||
|
|
3ead70ba3c | ||
|
|
2ae7ed4cf0 | ||
|
|
fd33c55760 | ||
|
|
08a209bc52 | ||
|
|
ef74e94374 | ||
|
|
59a3012a5c | ||
|
|
e14758c897 | ||
|
|
947d573276 | ||
|
|
e8258fc352 | ||
|
|
d63e0f490c | ||
|
|
20af5a2b40 | ||
|
|
52729bf369 | ||
|
|
1692fbaf1c | ||
|
|
2ae018a653 | ||
|
|
3406229152 | ||
|
|
6b33c9b934 | ||
|
|
821a002125 | ||
|
|
9ec4816b32 | ||
|
|
78a32ae172 | ||
|
|
1b0f5fd430 | ||
|
|
d4754619d0 | ||
|
|
d06212e408 | ||
|
|
7ab961f798 | ||
|
|
59699bf46e | ||
|
|
4f1737c2dd | ||
|
|
783331c645 | ||
|
|
db8500c03a | ||
|
|
9757a603fa | ||
|
|
29c46bb311 | ||
|
|
33d0a9f684 | ||
|
|
fb491a568f | ||
|
|
acb7238ad6 | ||
|
|
1f0792d5ea | ||
|
|
55c382a780 | ||
|
|
f6a8b17717 | ||
|
|
369d20ac2b | ||
|
|
e552170ce6 | ||
|
|
8c96e06e19 | ||
|
|
0c9945e0bf | ||
|
|
02138b6bfc | ||
|
|
9842ce5a79 | ||
|
|
44ff41188d | ||
|
|
40743840b7 | ||
|
|
e1f72cc010 | ||
|
|
1e4e61bd94 | ||
|
|
f3bdeedc68 | ||
|
|
2bfb063fdb | ||
|
|
c2090939d7 | ||
|
|
4ef924d0ba | ||
|
|
9ce994a320 | ||
|
|
3ec0bb7e53 | ||
|
|
066da6b1b6 | ||
|
|
5e71a56c7a | ||
|
|
6a4625b94c | ||
|
|
b30a9b1869 | ||
|
|
6635583103 | ||
|
|
c21cda2790 | ||
|
|
5d414af86b | ||
|
|
58135976dd | ||
|
|
ab4ff984c4 | ||
|
|
1d41c1c2de | ||
|
|
75e17c664a | ||
|
|
b48effebce | ||
|
|
cd34c70670 | ||
|
|
74cfe57716 | ||
|
|
a9a1552e32 | ||
|
|
76f36f68d3 | ||
|
|
f95171e808 | ||
|
|
2ca1f135ef | ||
|
|
5a14e46a1b | ||
|
|
311a9c79e3 | ||
|
|
39c489bfdc | ||
|
|
be5124fe10 | ||
|
|
0f98cb8b83 | ||
|
|
d2d84e3c9d | ||
|
|
1ca2d47d35 | ||
|
|
5636f924a9 | ||
|
|
9990306399 | ||
|
|
e2de8e0fa5 | ||
|
|
3ed3332c46 | ||
|
|
2dadc1ef98 | ||
|
|
bf6b36a39b | ||
|
|
56b52d43e6 | ||
|
|
539c77c591 | ||
|
|
76cd402ca5 | ||
|
|
e5ff28a92c | ||
|
|
367d7c104e | ||
|
|
47738f9792 | ||
|
|
e08cb3a49b | ||
|
|
31f46b313c | ||
|
|
e328869b10 | ||
|
|
e3b1b11bc5 | ||
|
|
a05ccb76f4 | ||
|
|
e797ec7463 | ||
|
|
1915e15a9e | ||
|
|
a49f59fcec | ||
|
|
90691dc0d8 | ||
|
|
b24caad789 | ||
|
|
143973166f | ||
|
|
463a3cf8cf | ||
|
|
26972c954d | ||
|
|
14ff6bfc32 | ||
|
|
816a4655a0 | ||
|
|
40c15d2e74 | ||
|
|
bc3bdd77f6 | ||
|
|
ada93e5d77 | ||
|
|
0d64d622e5 | ||
|
|
485bd93dae | ||
|
|
c18e925d61 | ||
|
|
9fcfc63f77 | ||
|
|
ef3f864123 | ||
|
|
e141865c43 | ||
|
|
c09ffe1308 | ||
|
|
d48393541d | ||
|
|
3bf0acbac6 | ||
|
|
7e02e1c3cd | ||
|
|
1b04534095 | ||
|
|
942c894f93 | ||
|
|
f4049f9dfd | ||
|
|
389cd6ad63 | ||
|
|
2b7ce3dc71 | ||
|
|
f5c511c193 | ||
|
|
2c23f98b65 | ||
|
|
06e6e87e3b | ||
|
|
3f046136d4 | ||
|
|
e4f73929c4 | ||
|
|
ff6d2692d3 | ||
|
|
8e9d947527 | ||
|
|
21706894af | ||
|
|
2c65ef0286 | ||
|
|
818ead4041 | ||
|
|
157526c978 | ||
|
|
6bd3098824 | ||
|
|
e938306e7d | ||
|
|
2670ad7eb2 | ||
|
|
f1e28e0e8d | ||
|
|
a4aa80fe05 | ||
|
|
de0f59b818 | ||
|
|
5821b672ad | ||
|
|
750fe6eaea | ||
|
|
982ed555d2 | ||
|
|
9a19e06856 | ||
|
|
99e7362006 | ||
|
|
48a7262fae | ||
|
|
879e5fd8bb | ||
|
|
42a106c7ba | ||
|
|
1bcbe9069b | ||
|
|
61f981ae05 | ||
|
|
f3b33f3ab2 | ||
|
|
c8e05206cc | ||
|
|
053d6a2ca1 | ||
|
|
3a2f342ac1 | ||
|
|
1399fbe986 | ||
|
|
8cbe824c5b | ||
|
|
cc0222a28a | ||
|
|
58dda68430 | ||
|
|
acf26c8569 | ||
|
|
8a01342e48 | ||
|
|
09a4df74f0 | ||
|
|
eb0627356b | ||
|
|
b5c249583a | ||
|
|
b819f104e6 | ||
|
|
c45962e3ef | ||
|
|
aa80a223d8 | ||
|
|
8788a5c712 | ||
|
|
b1cbe221b7 | ||
|
|
a0c9c7501b | ||
|
|
9d85876086 | ||
|
|
379e6a4635 | ||
|
|
4df7679c65 | ||
|
|
ebdd8a9710 | ||
|
|
921f468950 | ||
|
|
6f7a4d94ce | ||
|
|
f66c6874ca | ||
|
|
54f8ed1282 | ||
|
|
c3698e458f | ||
|
|
1c6a1dd5c0 | ||
|
|
0d1ccc357f | ||
|
|
867ca63750 | ||
|
|
20008946a3 | ||
|
|
4902f7b2a0 | ||
|
|
34f4f24e21 | ||
|
|
29fcb14c42 | ||
|
|
4d1bc0ca85 | ||
|
|
4f0fd38209 | ||
|
|
a748ca69e7 | ||
|
|
a0aaeafae8 | ||
|
|
795102125c | ||
|
|
db527bfb24 | ||
|
|
1a3c27bbea | ||
|
|
5631ffca68 | ||
|
|
6447069e50 | ||
|
|
e11f2c0107 | ||
|
|
6837ae3377 | ||
|
|
4324dc6ea8 | ||
|
|
4df6003bd9 | ||
|
|
2894f7935a | ||
|
|
88baf53cc1 | ||
|
|
fdefbdb23b | ||
|
|
c46d995480 | ||
|
|
e6abee4bd5 | ||
|
|
ca536efe7b | ||
|
|
da7c20e474 | ||
|
|
e0412a177c | ||
|
|
fc88029d7d | ||
|
|
b614fb1d45 | ||
|
|
afef9c1cc7 | ||
|
|
fd3998cfc9 | ||
|
|
ab50211e18 | ||
|
|
aaa57026ac | ||
|
|
f70d4089bc | ||
|
|
4e92414850 | ||
|
|
1a7e438fb2 | ||
|
|
d95c8cfac3 | ||
|
|
a032f0528e | ||
|
|
a206f06af9 | ||
|
|
bb6438af5a | ||
|
|
453964728d | ||
|
|
17e0513270 | ||
|
|
8d4bb3e327 | ||
|
|
450fe309d6 | ||
|
|
e3b0f4f9f6 | ||
|
|
27af6b377f | ||
|
|
1906f6da3a | ||
|
|
504f317434 | ||
|
|
8ae5dbcac8 | ||
|
|
088886e082 | ||
|
|
76120309e3 | ||
|
|
8aa34a0ce0 | ||
|
|
34df5d27a1 | ||
|
|
4cb0a250a0 | ||
|
|
efff826e15 | ||
|
|
8a46df5c4b | ||
|
|
38b05a1296 | ||
|
|
294319e71b | ||
|
|
ad69e29334 | ||
|
|
1c288ca4ab | ||
|
|
fe6f1ad244 | ||
|
|
d4e029665c | ||
|
|
b6d2c7eb80 | ||
|
|
7b93e738ad | ||
|
|
025e780f31 | ||
|
|
56bff95e15 | ||
|
|
ac18498ca5 | ||
|
|
780c6b0d77 | ||
|
|
125505f2aa | ||
|
|
bbebceb31a | ||
|
|
ff05ee50e0 | ||
|
|
d442d06947 | ||
|
|
f667cff5a6 | ||
|
|
752f2f1805 | ||
|
|
aba611e09f | ||
|
|
e1c75a9d55 | ||
|
|
f3f4ce9b87 | ||
|
|
a4645b6d17 | ||
|
|
ec5faaeae6 | ||
|
|
9ea19b8fe1 | ||
|
|
7a2163ca39 | ||
|
|
fea55fc018 | ||
|
|
a85f008f30 | ||
|
|
7ea2497b9a | ||
|
|
76728b87ab | ||
|
|
38384be42b | ||
|
|
664e21acbf | ||
|
|
245b73b94f | ||
|
|
66833f109b | ||
|
|
78fc158b39 | ||
|
|
429996752d | ||
|
|
16d7b49d73 | ||
|
|
5fdcd91847 | ||
|
|
bb2031941e | ||
|
|
562516dcc4 | ||
|
|
5c12490709 | ||
|
|
25e63e806c | ||
|
|
7ddbd386a5 | ||
|
|
1c44a6a0ba | ||
|
|
605fbf4f89 | ||
|
|
3f1fb9ca7e | ||
|
|
1a4cd3b66a | ||
|
|
606bd37316 | ||
|
|
b5dda63ddd | ||
|
|
51a27b3524 | ||
|
|
f3cfad7595 | ||
|
|
898977bda8 | ||
|
|
b32d9458b5 | ||
|
|
f8e9734f16 | ||
|
|
a95ed44d3d | ||
|
|
9f33c208d7 | ||
|
|
bad36ef3ef | ||
|
|
7ef69b68f8 | ||
|
|
cc41b876fb | ||
|
|
49c1f023b1 | ||
|
|
115a252f55 | ||
|
|
4e45663297 | ||
|
|
8f6509fa9a | ||
|
|
9520e345bd | ||
|
|
1df9a23e7b | ||
|
|
07f75a3e54 | ||
|
|
a8e743e3c4 | ||
|
|
6f7cc8b186 | ||
|
|
25cb13c0f8 | ||
|
|
7fc9825954 | ||
|
|
8ba9545b72 | ||
|
|
a8cc4b105d | ||
|
|
3b8623e207 | ||
|
|
1467962f8a | ||
|
|
ff2922cbbb | ||
|
|
7c0fbfab0a | ||
|
|
3ccc16e4e0 | ||
|
|
0bfd990ada | ||
|
|
e8190473f5 | ||
|
|
1c5d681f65 | ||
|
|
8fae0b3017 | ||
|
|
57928a5382 | ||
|
|
b44b200e7c | ||
|
|
9acb885e60 | ||
|
|
ec570026e1 | ||
|
|
385e3bb284 | ||
|
|
92bb84aa70 | ||
|
|
f0cfe98860 | ||
|
|
0bee62b460 | ||
|
|
a1a946fcd6 | ||
|
|
aac404a155 | ||
|
|
4e4b200972 | ||
|
|
c2ffcc5e71 | ||
|
|
1b63fa1920 | ||
|
|
e1f5d22a02 | ||
|
|
000e216354 | ||
|
|
0be2aa33ac | ||
|
|
c6c1628c8a | ||
|
|
1187d61b56 | ||
|
|
76556e1a3e | ||
|
|
8c84b7b888 | ||
|
|
49cca7ac76 | ||
|
|
01ca3e5e36 | ||
|
|
3476a457ad | ||
|
|
67c338fd51 | ||
|
|
f44dfb1582 | ||
|
|
d71de2a23e | ||
|
|
9731a02657 | ||
|
|
3f9b231f31 | ||
|
|
1f9a6febdd | ||
|
|
596c1b3489 | ||
|
|
ddc65dfb87 | ||
|
|
50e552321b | ||
|
|
cce96758fc | ||
|
|
42462fac9d | ||
|
|
05f1c0e1b9 | ||
|
|
e21bdf020c | ||
|
|
a6ab38665d | ||
|
|
393080ecbe | ||
|
|
f6459335da | ||
|
|
fc9e733d7f | ||
|
|
1c9dd67f15 | ||
|
|
e14cc8f2b6 | ||
|
|
74df01d3d1 | ||
|
|
7e4cf62a15 | ||
|
|
a40c43e414 | ||
|
|
2a1aedfff1 | ||
|
|
49b41e49ae | ||
|
|
c48efaba6e | ||
|
|
d6f837c5e5 | ||
|
|
badf1c42e0 | ||
|
|
7a45887fa1 | ||
|
|
dd0496f7aa | ||
|
|
c165838228 | ||
|
|
c16c7fffb4 | ||
|
|
19ab86a3a7 | ||
|
|
e9778d9556 | ||
|
|
f51661b225 | ||
|
|
853d3fd1ab | ||
|
|
9aeabce3d3 | ||
|
|
57d7c837aa | ||
|
|
fb256d68ff | ||
|
|
037d0f8ba6 | ||
|
|
f74e28bc64 | ||
|
|
2d5bf69dc4 | ||
|
|
34121bc81a | ||
|
|
d801437f5f | ||
|
|
342854f6f2 | ||
|
|
06607fda4e | ||
|
|
141c543f97 | ||
|
|
36706c04bb | ||
|
|
d2e2ca31ac | ||
|
|
fb8c0bd664 | ||
|
|
5b2922f76c | ||
|
|
4ef578e1c4 | ||
|
|
49e09624d6 | ||
|
|
8c2a2c8f60 | ||
|
|
819a16d0f5 | ||
|
|
f79937d64b | ||
|
|
55a08dee78 | ||
|
|
4b4265f8a7 | ||
|
|
237a871f17 | ||
|
|
da32916396 | ||
|
|
f3c22f342c | ||
|
|
4d418b98f3 | ||
|
|
5555b2802f | ||
|
|
c84e3fe21b | ||
|
|
33bc3f3309 | ||
|
|
2a9a867f05 | ||
|
|
ecf6467799 | ||
|
|
815c575a0b | ||
|
|
64d774d178 | ||
|
|
a5270e561f | ||
|
|
ceacacc320 | ||
|
|
8c8e4fd130 | ||
|
|
1e61dd024b | ||
|
|
cdcf474f12 | ||
|
|
ddd9136d10 | ||
|
|
d157ae17b7 | ||
|
|
270c4c2a87 | ||
|
|
c8d632ddff | ||
|
|
22923ed663 | ||
|
|
f0ea152022 | ||
|
|
a334ed879f | ||
|
|
9adfd2d7b4 | ||
|
|
b9b8d575bc | ||
|
|
48fa697d54 | ||
|
|
16bbf09947 | ||
|
|
0abfcb5516 | ||
|
|
de718dacb2 | ||
|
|
f2d0be7299 | ||
|
|
dd461636e3 | ||
|
|
11ce45077d | ||
|
|
a39f324682 | ||
|
|
ff1078f271 | ||
|
|
31d58eac01 | ||
|
|
55566b7f8e | ||
|
|
79d4400c16 | ||
|
|
fcaed12a53 | ||
|
|
442c85c006 | ||
|
|
f523611e12 | ||
|
|
7e71e132a3 | ||
|
|
0c44701901 | ||
|
|
7bea25a23a | ||
|
|
6cc2a36c79 | ||
|
|
6202d0ed68 | ||
|
|
30667c160d | ||
|
|
5a87ac0ad8 | ||
|
|
425dff93d7 | ||
|
|
fa7ee0b3b6 | ||
|
|
f725816809 | ||
|
|
61c781325d | ||
|
|
1ed819bb10 | ||
|
|
c338188ce2 | ||
|
|
c8ac825f0d | ||
|
|
873442a55d | ||
|
|
983d102a19 | ||
|
|
cd40d87ebd | ||
|
|
4fd710a392 | ||
|
|
28ccaa3c88 | ||
|
|
0e0f7c0d32 | ||
|
|
3dd5f55412 | ||
|
|
78ccbe24a3 | ||
|
|
158e7dcd8b | ||
|
|
3dde949419 | ||
|
|
693e81db48 | ||
|
|
34766c0c50 | ||
|
|
fccb1e55ec | ||
|
|
7bb7f95aa8 | ||
|
|
29552c1ec4 | ||
|
|
7686aa9ff6 | ||
|
|
7b3ee0e31c | ||
|
|
7213895095 | ||
|
|
f0571ddf4b | ||
|
|
d98315c41c | ||
|
|
7d630b3e29 | ||
|
|
529cc1ca51 | ||
|
|
d36bc5a9fd | ||
|
|
affeb3dfec | ||
|
|
1a4c1e11cb | ||
|
|
cef56b5147 | ||
|
|
b2d08a498b | ||
|
|
a3dd798bad | ||
|
|
bdee57ca8d | ||
|
|
f86123ad5a | ||
|
|
876d868fa1 | ||
|
|
df7215dcb2 | ||
|
|
68ea608ca8 | ||
|
|
627be1de51 | ||
|
|
9080221d46 | ||
|
|
d92024bb0f | ||
|
|
acd7f73d57 | ||
|
|
55c672eefd | ||
|
|
910a744263 | ||
|
|
4ed7cfc515 | ||
|
|
ba54209c86 | ||
|
|
7facc34851 | ||
|
|
5c86cf54a2 | ||
|
|
cd8908362a | ||
|
|
7e3c80bd8a | ||
|
|
0d208851a4 | ||
|
|
f99e013ebc | ||
|
|
6b466fe230 | ||
|
|
07cf4e8f5b | ||
|
|
187bdf08a6 | ||
|
|
afbdaa525e | ||
|
|
c693cd7f10 | ||
|
|
00d0f8bf26 | ||
|
|
2825b929c1 | ||
|
|
9c5e9d79f1 | ||
|
|
d29ee97307 | ||
|
|
701c762a68 | ||
|
|
2689dea72a | ||
|
|
319ca86c81 | ||
|
|
c0ac849776 | ||
|
|
45c5138eaf | ||
|
|
f2d7e3309f | ||
|
|
17bb0da278 | ||
|
|
c3804230cd | ||
|
|
52ac72e63e | ||
|
|
c0097ad729 | ||
|
|
fb7b5292b3 | ||
|
|
3e01891e22 | ||
|
|
f3c4f5a901 | ||
|
|
f4d0fcb836 | ||
|
|
b2c9268ece | ||
|
|
9671438435 | ||
|
|
1516e29609 | ||
|
|
bf0b6fd8a9 | ||
|
|
c13b0562ba | ||
|
|
142d8aa973 | ||
|
|
e6ec6cccfa | ||
|
|
0f3ccba741 | ||
|
|
2da5937864 | ||
|
|
e2762df90b | ||
|
|
1836285c01 | ||
|
|
ffdadbf97f | ||
|
|
c190192d5f | ||
|
|
4c08aaef3d | ||
|
|
4216d86dd9 | ||
|
|
9ed6deb452 | ||
|
|
49ca9dceb2 | ||
|
|
4e3e784691 | ||
|
|
7c45f45ebc | ||
|
|
e5091cbc0f | ||
|
|
7d60c03ed9 | ||
|
|
f5a00dc0c1 | ||
|
|
cad20abe83 | ||
|
|
a4af874a43 | ||
|
|
278d7a44f9 | ||
|
|
92cab55c72 | ||
|
|
f14c56488f | ||
|
|
fd78339a7c | ||
|
|
db40ea4f76 | ||
|
|
26e5c9480b | ||
|
|
1310c238a9 | ||
|
|
f733a39089 | ||
|
|
fbadb19d93 | ||
|
|
d40743a570 | ||
|
|
3c74266763 | ||
|
|
23a1b98957 | ||
|
|
ed6725172d | ||
|
|
0eca1646e6 | ||
|
|
4772ae2755 | ||
|
|
16745c2553 | ||
|
|
b12c7358b1 | ||
|
|
f840c92c10 | ||
|
|
094d539cd9 | ||
|
|
0d54271d15 | ||
|
|
5efc7973ea | ||
|
|
e2ea987610 | ||
|
|
676a106d7a | ||
|
|
8e47a543f6 | ||
|
|
75ab042632 | ||
|
|
1bb9287b2d | ||
|
|
aea25b147f | ||
|
|
53cac1b616 | ||
|
|
3ac57c756b | ||
|
|
eabf260706 | ||
|
|
bb6a7eb9d3 | ||
|
|
add6bf35a3 | ||
|
|
68aedfd176 | ||
|
|
9de81cda77 | ||
|
|
f2b29a0488 | ||
|
|
547229fef1 | ||
|
|
32f054b901 | ||
|
|
6fe5c5c84d | ||
|
|
cda289dc27 | ||
|
|
8bac5b6e73 | ||
|
|
47c9826b6f | ||
|
|
53c040f838 | ||
|
|
a09a6e4020 | ||
|
|
3dc5b93db7 | ||
|
|
c14c7c84e3 | ||
|
|
1ff1fc4725 | ||
|
|
4c8c50e464 | ||
|
|
0f8eb37e1c | ||
|
|
016f29f09b | ||
|
|
e194a655df | ||
|
|
772e2c4e20 | ||
|
|
9c69e40970 | ||
|
|
5865fcca3c | ||
|
|
74306cc5ea | ||
|
|
9c0c633259 | ||
|
|
c349ae26b9 | ||
|
|
94e35e7a7e | ||
|
|
8300f5ede7 | ||
|
|
78ad6c4cb7 | ||
|
|
9eb99dc61e | ||
|
|
318dc422bc | ||
|
|
1451304526 | ||
|
|
fac6b59627 | ||
|
|
c186f153ff | ||
|
|
0885485a61 | ||
|
|
77d779424b | ||
|
|
a3b5f5f6e4 | ||
|
|
8f62aec2e3 | ||
|
|
137a24f457 | ||
|
|
cacbdec565 | ||
|
|
f07cde6351 | ||
|
|
50f0a99330 | ||
|
|
3637e14e9f | ||
|
|
0c8411d085 | ||
|
|
df4fe922c0 | ||
|
|
fcbe410c2f | ||
|
|
af75d9a384 | ||
|
|
e87eb07e16 | ||
|
|
8d71015bf8 | ||
|
|
b7339d7dcb | ||
|
|
43c7bd57e4 | ||
|
|
641d3e0073 | ||
|
|
77cde832d6 | ||
|
|
0f9c47c242 | ||
|
|
02aa9fb240 | ||
|
|
ffb411d9e2 | ||
|
|
d7777696d7 | ||
|
|
1fa3f7d81e | ||
|
|
23beec2bd1 | ||
|
|
22e05b24f3 | ||
|
|
e8c2fdfb8c | ||
|
|
23ee3c6fbe | ||
|
|
9a9c9c2ba3 | ||
|
|
56c5d8b784 | ||
|
|
8406720a7a | ||
|
|
9c1db688d1 | ||
|
|
53a38e8edc | ||
|
|
899b9b1ea7 | ||
|
|
9d31452c25 | ||
|
|
ed94317df9 | ||
|
|
33ba694f3a | ||
|
|
a1d015cc2f | ||
|
|
52a692ee08 | ||
|
|
64238ee91f | ||
|
|
12f5cefc12 | ||
|
|
136c4c4820 | ||
|
|
488aa86f70 | ||
|
|
6684c1ebff | ||
|
|
d3530125dd | ||
|
|
deb96dab3e | ||
|
|
94500a9d62 | ||
|
|
7ec5e80b70 | ||
|
|
5a9579bae4 | ||
|
|
78bc405eeb | ||
|
|
c4d38c0afc | ||
|
|
1790a6faaa | ||
|
|
349040db6d | ||
|
|
052033a76e | ||
|
|
4265c5a772 | ||
|
|
70c5aa5f5d | ||
|
|
91ddadeefa | ||
|
|
083f1c5370 | ||
|
|
d2b9093ecc | ||
|
|
9100740ba9 | ||
|
|
ed3561279d | ||
|
|
1c1798c7f2 | ||
|
|
3ae2517867 | ||
|
|
e095648810 | ||
|
|
772e8780b4 | ||
|
|
b58c317abb | ||
|
|
a509d4855b | ||
|
|
7067727c0c | ||
|
|
e9a2d57357 | ||
|
|
813485023b | ||
|
|
16c3240ab7 | ||
|
|
0866b2b75a | ||
|
|
ba8c041206 | ||
|
|
7ed37ae6c3 | ||
|
|
b645c2c75e | ||
|
|
530453e4fc | ||
|
|
5de603c6af | ||
|
|
4ac8fcf4af | ||
|
|
a944f88b94 | ||
|
|
17544d7ad6 | ||
|
|
e7a91b9526 | ||
|
|
f98adf2be5 | ||
|
|
b6c083706a | ||
|
|
24f8d3ed0c | ||
|
|
a8ab9b5c3d | ||
|
|
a78947f2de | ||
|
|
f6f503a1f6 | ||
|
|
7ae2d59ffd | ||
|
|
a8d9bfdcfd | ||
|
|
159897d88d | ||
|
|
c4921d235a | ||
|
|
c5c2124bba | ||
|
|
ca62b19bff | ||
|
|
a5dc08ee8e | ||
|
|
0543f03b58 | ||
|
|
37d7d25018 | ||
|
|
d6ca23b277 | ||
|
|
c963ac20a6 | ||
|
|
4ac9ea0e85 | ||
|
|
c8337c6d83 | ||
|
|
1ee19e4167 | ||
|
|
871f4e5df5 | ||
|
|
22a1e281a9 | ||
|
|
4994d84565 | ||
|
|
d8f497ce98 | ||
|
|
614559f234 | ||
|
|
82e01bc923 | ||
|
|
9fde660aaf | ||
|
|
58a4f0e157 | ||
|
|
35ff4a8576 | ||
|
|
4ba9594b04 | ||
|
|
9c5676292c | ||
|
|
58db3c1c7c | ||
|
|
0e728972e9 | ||
|
|
d59b61cbd9 | ||
|
|
4da8dced94 | ||
|
|
b274f8cb2a | ||
|
|
47118ab72a | ||
|
|
9282e08099 | ||
|
|
c3a49b9cad | ||
|
|
c0f90beb7c | ||
|
|
1aee75aadc | ||
|
|
8469b27c3a | ||
|
|
aeb8abf1ed | ||
|
|
6f7233229e | ||
|
|
6bf22fa7d7 | ||
|
|
c1c057611e | ||
|
|
dabf349599 | ||
|
|
b422458224 | ||
|
|
179d82702e | ||
|
|
39b8765961 | ||
|
|
907e9080c4 | ||
|
|
d630370183 | ||
|
|
b53231595d | ||
|
|
b07d108bee | ||
|
|
41236ed0e5 | ||
|
|
eeab3ee5d3 | ||
|
|
4f3fd030ae | ||
|
|
caed845f3e | ||
|
|
377511165e | ||
|
|
298796bea6 | ||
|
|
ee97a46fde | ||
|
|
cc552b7e39 | ||
|
|
c1eb94d37f | ||
|
|
07e5786e1b | ||
|
|
43c95e397a | ||
|
|
0509d82701 | ||
|
|
afc55ca821 | ||
|
|
b52bd9c093 | ||
|
|
f43433b43d | ||
|
|
5472fff027 | ||
|
|
402ffa8b29 | ||
|
|
65a9991d84 | ||
|
|
bc0ef0beca | ||
|
|
398e47ecad | ||
|
|
57633b75ed | ||
|
|
4c5bd253a2 | ||
|
|
39b31ece31 | ||
|
|
0c3c148316 | ||
|
|
86853296a1 | ||
|
|
5608bc6d81 | ||
|
|
3248e0bb3e | ||
|
|
da9c96e9f5 | ||
|
|
1b529d997c | ||
|
|
01ccb8b099 | ||
|
|
2bd6ab9fba | ||
|
|
6967b44ac8 | ||
|
|
67db77cfa8 | ||
|
|
4f1c659050 | ||
|
|
ee5d7e6d0f | ||
|
|
efb2712d14 | ||
|
|
be0a349a52 | ||
|
|
32c95c3292 | ||
|
|
40c15348da | ||
|
|
f85856d9f8 | ||
|
|
675567419b | ||
|
|
e61430b471 | ||
|
|
636d186d08 | ||
|
|
114cc810a0 | ||
|
|
9dc85153e0 | ||
|
|
3ecb995485 | ||
|
|
94eafb6674 | ||
|
|
999dfda37b | ||
|
|
046a99acf8 | ||
|
|
02aad03e74 | ||
|
|
6b93f2fe0a | ||
|
|
0b4ea25f83 | ||
|
|
dd7b020b01 | ||
|
|
dce68422a7 | ||
|
|
b60deebaa9 | ||
|
|
db43c3af68 | ||
|
|
a8003c1af7 | ||
|
|
4c79274054 | ||
|
|
ec5bbe351c | ||
|
|
ce72d26e95 | ||
|
|
16b8ecbe05 | ||
|
|
94a3539015 | ||
|
|
37b6a2ca0b | ||
|
|
eda0a6eb33 | ||
|
|
ca332bdcdb | ||
|
|
ee05e358d1 | ||
|
|
c981fb389b | ||
|
|
3c7c4a61be | ||
|
|
3eef6411dd | ||
|
|
9ed13f4a90 | ||
|
|
1a1c013b2a | ||
|
|
5780e865b7 | ||
|
|
2806d83362 | ||
|
|
e3136c38e1 | ||
|
|
ebe1e12a82 | ||
|
|
305c8b1fba | ||
|
|
ce870316c5 | ||
|
|
f642f86982 | ||
|
|
96598936ad | ||
|
|
c1a3c72b49 | ||
|
|
10bcd5113c | ||
|
|
f31caffa74 | ||
|
|
3b16dd7377 | ||
|
|
dfd79b0349 | ||
|
|
15ca2f438f | ||
|
|
676a2fbc8a | ||
|
|
6372fbba54 | ||
|
|
3854940e42 | ||
|
|
e4cc062cf1 | ||
|
|
b98d08a2cb | ||
|
|
ccb03fb255 | ||
|
|
5281fe8e50 | ||
|
|
72fc1b57be | ||
|
|
3c31e4ad4b | ||
|
|
6743219dc2 | ||
|
|
5f7b37ee11 | ||
|
|
6cc2f52fa4 | ||
|
|
dde952d591 | ||
|
|
a9f72bd3ce | ||
|
|
9a06543453 | ||
|
|
9a4cf4dce9 | ||
|
|
f48cf001ed | ||
|
|
be65af5dfe | ||
|
|
57fa8759ee | ||
|
|
df8fb59511 | ||
|
|
f806cfecaa | ||
|
|
2d0b788105 | ||
|
|
bc513a8828 | ||
|
|
a9525de0da | ||
|
|
6a9d9d76ef | ||
|
|
78d9fac0ce | ||
|
|
15951e6e93 | ||
|
|
93595fa60a | ||
|
|
91c811f170 | ||
|
|
c5064069c7 | ||
|
|
218fa51dba | ||
|
|
9fba32a917 | ||
|
|
73e3138a5b | ||
|
|
05c2989698 | ||
|
|
0ccc05bdf7 | ||
|
|
7f02659425 | ||
|
|
9170c2daab | ||
|
|
b32abde2ac | ||
|
|
2598c475ed | ||
|
|
5fdbc68ca3 | ||
|
|
b4a5993ece | ||
|
|
21983b8432 | ||
|
|
bcd0ba0d69 | ||
|
|
56dc5c1be3 | ||
|
|
212a29ae2c | ||
|
|
25e60f3934 | ||
|
|
4191d7eb52 | ||
|
|
d0af0887be | ||
|
|
70642a0ae4 | ||
|
|
36f266355d | ||
|
|
736ce9a176 | ||
|
|
147fa73d3f | ||
|
|
d1a85a3637 | ||
|
|
15ed7a6351 | ||
|
|
e5248b6933 | ||
|
|
5b6dd58b3e | ||
|
|
fc6194e640 | ||
|
|
d5fc05c10b | ||
|
|
e8469daf0c | ||
|
|
bd87903b56 | ||
|
|
e657fe84b8 | ||
|
|
6ddb15b3df | ||
|
|
7b2c445707 | ||
|
|
059c6f8da5 | ||
|
|
73ca3cfca6 | ||
|
|
42d3af3bbb | ||
|
|
533066eb87 | ||
|
|
758ca946fa | ||
|
|
3893ba302c | ||
|
|
66bd5810c5 | ||
|
|
bc4574b59d | ||
|
|
2665c37f38 | ||
|
|
48e0e19b03 | ||
|
|
2508d11097 | ||
|
|
f77cd54a6c | ||
|
|
9cdece4ca2 | ||
|
|
5dbb9f5312 | ||
|
|
a1cffc3490 | ||
|
|
0e8c36473a | ||
|
|
920dc1400f | ||
|
|
037a151ef5 | ||
|
|
2a2f2742eb | ||
|
|
6424f47f3b | ||
|
|
1879e91148 | ||
|
|
23eef11cf5 | ||
|
|
1eb098caf9 | ||
|
|
f838597b5f | ||
|
|
770a13ebc3 | ||
|
|
5d2e52c4ef | ||
|
|
64e42e1e88 | ||
|
|
ee6b317ab5 | ||
|
|
45695c9bcb | ||
|
|
dc3ae114cd | ||
|
|
f99a68a695 | ||
|
|
5607762c0f | ||
|
|
b9a95e29b7 | ||
|
|
27a0c37963 | ||
|
|
f4dc71661d | ||
|
|
795686d1cc | ||
|
|
4c366eed23 |
2
.github/stale.yml
vendored
2
.github/stale.yml
vendored
@@ -1,7 +1,7 @@
|
||||
# Configuration for probot-stale - https://github.com/probot/stale
|
||||
|
||||
# Number of days of inactivity before an Issue or Pull Request becomes stale
|
||||
daysUntilStale: 10
|
||||
daysUntilStale: 30
|
||||
|
||||
# Number of days of inactivity before a stale Issue or Pull Request is closed.
|
||||
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -12,3 +12,5 @@ erpnext/docs/current
|
||||
*.swo
|
||||
__pycache__
|
||||
*~
|
||||
.vscode/
|
||||
node_modules/
|
||||
@@ -15,7 +15,7 @@ install:
|
||||
- sudo rm /etc/apt/sources.list.d/docker.list
|
||||
- sudo apt-get install hhvm && rm -rf /home/travis/.kiex/
|
||||
- sudo apt-get purge -y mysql-common mysql-server mysql-client
|
||||
- nvm install v7.10.0
|
||||
- nvm install 10
|
||||
- pip install python-coveralls
|
||||
- wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
|
||||
- sudo python install.py --develop --user travis --without-bench-setup
|
||||
@@ -33,8 +33,7 @@ before_script:
|
||||
- cd ~/frappe-bench
|
||||
- bench get-app erpnext $TRAVIS_BUILD_DIR
|
||||
- bench use test_site
|
||||
- bench reinstall --yes
|
||||
- bench build
|
||||
- bench reinstall --mariadb-root-username root --mariadb-root-password travis --yes
|
||||
- bench scheduler disable
|
||||
- sed -i 's/9000/9001/g' sites/common_site_config.json
|
||||
- bench start &
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
</p>
|
||||
|
||||
[](https://travis-ci.com/frappe/erpnext)
|
||||
[](https://gitter.im/frappe/erpnext?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://www.codetriage.com/frappe/erpnext)
|
||||
[](https://coveralls.io/github/frappe/erpnext?branch=develop)
|
||||
|
||||
@@ -18,7 +17,7 @@ Includes: Accounting, Inventory, Manufacturing, CRM, Sales, Purchase, Project Ma
|
||||
|
||||
ERPNext is built on the [Frappe](https://github.com/frappe/frappe) Framework, a full-stack web app framework in Python & JavaScript.
|
||||
|
||||
- [User Guide](https://erpnext.org/docs/user)
|
||||
- [User Guide](https://erpnext.com/docs/user)
|
||||
- [Discussion Forum](https://discuss.erpnext.com/)
|
||||
|
||||
---
|
||||
|
||||
@@ -5,7 +5,7 @@ import frappe
|
||||
from erpnext.hooks import regional_overrides
|
||||
from frappe.utils import getdate
|
||||
|
||||
__version__ = '10.1.72'
|
||||
__version__ = '11.1.18'
|
||||
|
||||
def get_default_company(user=None):
|
||||
'''Get default company for user'''
|
||||
@@ -74,7 +74,7 @@ def is_perpetual_inventory_enabled(company):
|
||||
frappe.local.enable_perpetual_inventory = {}
|
||||
|
||||
if not company in frappe.local.enable_perpetual_inventory:
|
||||
frappe.local.enable_perpetual_inventory[company] = frappe.get_cached_value('Company',
|
||||
frappe.local.enable_perpetual_inventory[company] = frappe.get_cached_value('Company',
|
||||
company, "enable_perpetual_inventory") or 0
|
||||
|
||||
return frappe.local.enable_perpetual_inventory[company]
|
||||
@@ -87,7 +87,7 @@ def get_default_finance_book(company=None):
|
||||
frappe.local.default_finance_book = {}
|
||||
|
||||
if not company in frappe.local.default_finance_book:
|
||||
frappe.local.default_finance_book[company] = frappe.get_cached_value('Company',
|
||||
frappe.local.default_finance_book[company] = frappe.get_cached_value('Company',
|
||||
company, "default_finance_book")
|
||||
|
||||
return frappe.local.default_finance_book[company]
|
||||
@@ -108,7 +108,7 @@ def get_region(company=None):
|
||||
You can also set global company flag in `frappe.flags.company`
|
||||
'''
|
||||
if company or frappe.flags.company:
|
||||
return frappe.get_cached_value('Company',
|
||||
return frappe.get_cached_value('Company',
|
||||
company or frappe.flags.company, 'country')
|
||||
elif frappe.flags.country:
|
||||
return frappe.flags.country
|
||||
|
||||
@@ -2,9 +2,9 @@ from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils import date_diff, add_months, today, getdate, add_days, flt
|
||||
from frappe.utils import date_diff, add_months, today, getdate, add_days, flt, get_last_day
|
||||
from erpnext.accounts.utils import get_account_currency
|
||||
from erpnext.accounts.general_ledger import make_gl_entries
|
||||
from frappe.email import sendmail_to_system_managers
|
||||
|
||||
def validate_service_stop_date(doc):
|
||||
''' Validates service_stop_date for Purchase Invoice and Sales Invoice '''
|
||||
@@ -29,51 +29,53 @@ def validate_service_stop_date(doc):
|
||||
if date_diff(item.service_stop_date, item.service_end_date) > 0:
|
||||
frappe.throw(_("Service Stop Date cannot be after Service End Date"))
|
||||
|
||||
if old_stop_dates and old_stop_dates[item.name] and item.service_stop_date!=old_stop_dates[item.name]:
|
||||
if old_stop_dates and old_stop_dates.get(item.name) and item.service_stop_date!=old_stop_dates[item.name]:
|
||||
frappe.throw(_("Cannot change Service Stop Date for item in row {0}".format(item.idx)))
|
||||
|
||||
def convert_deferred_expense_to_expense(start_date=None, end_date=None):
|
||||
# book the expense/income on the last day, but it will be trigger on the 1st of month at 12:00 AM
|
||||
if not start_date:
|
||||
start_date = add_months(today(), -1)
|
||||
if not end_date:
|
||||
end_date = add_days(today(), -1)
|
||||
|
||||
# check for the purchase invoice for which GL entries has to be done
|
||||
invoices = frappe.db.sql_list('''
|
||||
select distinct parent from `tabPurchase Invoice Item` where service_start_date<=%s and service_end_date>=%s
|
||||
select distinct parent from `tabPurchase Invoice Item`
|
||||
where service_start_date<=%s and service_end_date>=%s
|
||||
and enable_deferred_expense = 1 and docstatus = 1 and ifnull(amount, 0) > 0
|
||||
''', (end_date or today(), start_date or add_months(today(), -1)))
|
||||
''', (end_date, start_date))
|
||||
|
||||
# For each invoice, book deferred expense
|
||||
for invoice in invoices:
|
||||
doc = frappe.get_doc("Purchase Invoice", invoice)
|
||||
book_deferred_income_or_expense(doc, start_date, end_date)
|
||||
book_deferred_income_or_expense(doc, end_date)
|
||||
|
||||
def convert_deferred_revenue_to_income(start_date=None, end_date=None):
|
||||
# book the expense/income on the last day, but it will be trigger on the 1st of month at 12:00 AM
|
||||
if not start_date:
|
||||
start_date = add_months(today(), -1)
|
||||
if not end_date:
|
||||
end_date = add_days(today(), -1)
|
||||
|
||||
# check for the sales invoice for which GL entries has to be done
|
||||
invoices = frappe.db.sql_list('''
|
||||
select distinct parent from `tabSales Invoice Item` where service_start_date<=%s and service_end_date>=%s
|
||||
select distinct parent from `tabSales Invoice Item`
|
||||
where service_start_date<=%s and service_end_date>=%s
|
||||
and enable_deferred_revenue = 1 and docstatus = 1 and ifnull(amount, 0) > 0
|
||||
''', (end_date or today(), start_date or add_months(today(), -1)))
|
||||
''', (end_date, start_date))
|
||||
|
||||
# For each invoice, book deferred revenue
|
||||
for invoice in invoices:
|
||||
doc = frappe.get_doc("Sales Invoice", invoice)
|
||||
book_deferred_income_or_expense(doc, start_date, end_date)
|
||||
book_deferred_income_or_expense(doc, end_date)
|
||||
|
||||
def get_booking_dates(doc, item, posting_date=None):
|
||||
if not posting_date:
|
||||
posting_date = add_days(today(), -1)
|
||||
|
||||
last_gl_entry = False
|
||||
|
||||
def get_booking_dates(doc, item, start_date=None, end_date=None):
|
||||
deferred_account = "deferred_revenue_account" if doc.doctype=="Sales Invoice" else "deferred_expense_account"
|
||||
last_gl_entry, skip = False, False
|
||||
|
||||
booking_end_date = getdate(add_days(today(), -1)) if not end_date else end_date
|
||||
if booking_end_date < item.service_start_date or \
|
||||
(item.service_stop_date and booking_end_date.month > item.service_stop_date.month):
|
||||
return None, None, None, True
|
||||
elif booking_end_date >= item.service_end_date:
|
||||
last_gl_entry = True
|
||||
booking_end_date = item.service_end_date
|
||||
elif item.service_stop_date and item.service_stop_date <= booking_end_date:
|
||||
last_gl_entry = True
|
||||
booking_end_date = item.service_stop_date
|
||||
|
||||
booking_start_date = getdate(add_months(today(), -1)) if not start_date else start_date
|
||||
booking_start_date = booking_start_date \
|
||||
if booking_start_date > item.service_start_date else item.service_start_date
|
||||
|
||||
prev_gl_entry = frappe.db.sql('''
|
||||
select name, posting_date from `tabGL Entry` where company=%s and account=%s and
|
||||
@@ -81,17 +83,28 @@ def get_booking_dates(doc, item, start_date=None, end_date=None):
|
||||
order by posting_date desc limit 1
|
||||
''', (doc.company, item.get(deferred_account), doc.doctype, doc.name, item.name), as_dict=True)
|
||||
|
||||
if not prev_gl_entry and item.service_start_date < booking_start_date:
|
||||
booking_start_date = item.service_start_date
|
||||
elif prev_gl_entry:
|
||||
booking_start_date = getdate(add_days(prev_gl_entry[0].posting_date, 1))
|
||||
skip = True if booking_start_date > booking_end_date else False
|
||||
if prev_gl_entry:
|
||||
start_date = getdate(add_days(prev_gl_entry[0].posting_date, 1))
|
||||
else:
|
||||
start_date = item.service_start_date
|
||||
|
||||
return last_gl_entry, booking_start_date, booking_end_date, skip
|
||||
end_date = get_last_day(start_date)
|
||||
if end_date >= item.service_end_date:
|
||||
end_date = item.service_end_date
|
||||
last_gl_entry = True
|
||||
elif item.service_stop_date and end_date >= item.service_stop_date:
|
||||
end_date = item.service_stop_date
|
||||
last_gl_entry = True
|
||||
|
||||
def calculate_amount_and_base_amount(doc, item, last_gl_entry, total_days, total_booking_days):
|
||||
account_currency = get_account_currency(item.expense_account)
|
||||
if end_date > getdate(posting_date):
|
||||
end_date = posting_date
|
||||
|
||||
if getdate(start_date) <= getdate(end_date):
|
||||
return start_date, end_date, last_gl_entry
|
||||
else:
|
||||
return None, None, None
|
||||
|
||||
def calculate_amount(doc, item, last_gl_entry, total_days, total_booking_days, account_currency):
|
||||
if doc.doctype == "Sales Invoice":
|
||||
total_credit_debit, total_credit_debit_currency = "debit", "debit_in_account_currency"
|
||||
deferred_account = "deferred_revenue_account"
|
||||
@@ -113,7 +126,6 @@ def calculate_amount_and_base_amount(doc, item, last_gl_entry, total_days, total
|
||||
group by voucher_detail_no
|
||||
'''.format(total_credit_debit, total_credit_debit_currency),
|
||||
(doc.company, item.get(deferred_account), doc.doctype, doc.name, item.name), as_dict=True)
|
||||
|
||||
already_booked_amount = gl_entries_details[0].total_credit if gl_entries_details else 0
|
||||
base_amount = flt(item.base_net_amount - already_booked_amount, item.precision("base_net_amount"))
|
||||
if account_currency==doc.company_currency:
|
||||
@@ -124,24 +136,15 @@ def calculate_amount_and_base_amount(doc, item, last_gl_entry, total_days, total
|
||||
|
||||
return amount, base_amount
|
||||
|
||||
def book_deferred_income_or_expense(doc, start_date=None, end_date=None):
|
||||
# book the expense/income on the last day, but it will be trigger on the 1st of month at 12:00 AM
|
||||
# start_date: 1st of the last month or the start date
|
||||
# end_date: end_date or today-1
|
||||
def book_deferred_income_or_expense(doc, posting_date=None):
|
||||
enable_check = "enable_deferred_revenue" \
|
||||
if doc.doctype=="Sales Invoice" else "enable_deferred_expense"
|
||||
|
||||
gl_entries = []
|
||||
for item in doc.get('items'):
|
||||
skip = False
|
||||
last_gl_entry, booking_start_date, booking_end_date, skip = \
|
||||
get_booking_dates(doc, item, start_date, end_date)
|
||||
|
||||
if skip: continue
|
||||
total_days = date_diff(item.service_end_date, item.service_start_date)
|
||||
total_booking_days = date_diff(booking_end_date, booking_start_date) + 1
|
||||
def _book_deferred_revenue_or_expense(item):
|
||||
start_date, end_date, last_gl_entry = get_booking_dates(doc, item, posting_date=posting_date)
|
||||
if not (start_date and end_date): return
|
||||
|
||||
account_currency = get_account_currency(item.expense_account)
|
||||
amount, base_amount = calculate_amount_and_base_amount(doc, item, last_gl_entry, total_days, total_booking_days)
|
||||
|
||||
if doc.doctype == "Sales Invoice":
|
||||
against, project = doc.customer, doc.project
|
||||
credit_account, debit_account = item.income_account, item.deferred_revenue_account
|
||||
@@ -149,32 +152,62 @@ def book_deferred_income_or_expense(doc, start_date=None, end_date=None):
|
||||
against, project = doc.supplier, item.project
|
||||
credit_account, debit_account = item.deferred_expense_account, item.expense_account
|
||||
|
||||
# GL Entry for crediting the amount in the deferred expense
|
||||
gl_entries.append(
|
||||
doc.get_gl_dict({
|
||||
"account": credit_account,
|
||||
"against": against,
|
||||
"credit": base_amount,
|
||||
"credit_in_account_currency": amount,
|
||||
"cost_center": item.cost_center,
|
||||
"voucher_detail_no": item.name,
|
||||
'posting_date': booking_end_date,
|
||||
'project': project
|
||||
}, account_currency)
|
||||
)
|
||||
# GL Entry to debit the amount from the expense
|
||||
gl_entries.append(
|
||||
doc.get_gl_dict({
|
||||
"account": debit_account,
|
||||
"against": against,
|
||||
"debit": base_amount,
|
||||
"debit_in_account_currency": amount,
|
||||
"cost_center": item.cost_center,
|
||||
"voucher_detail_no": item.name,
|
||||
'posting_date': booking_end_date,
|
||||
'project': project
|
||||
}, account_currency)
|
||||
)
|
||||
total_days = date_diff(item.service_end_date, item.service_start_date) + 1
|
||||
total_booking_days = date_diff(end_date, start_date) + 1
|
||||
|
||||
amount, base_amount = calculate_amount(doc, item, last_gl_entry,
|
||||
total_days, total_booking_days, account_currency)
|
||||
|
||||
make_gl_entries(doc, credit_account, debit_account, against,
|
||||
amount, base_amount, end_date, project, account_currency, item.cost_center, item.name)
|
||||
|
||||
if getdate(end_date) < getdate(posting_date) and not last_gl_entry:
|
||||
_book_deferred_revenue_or_expense(item)
|
||||
|
||||
|
||||
for item in doc.get('items'):
|
||||
if item.get(enable_check):
|
||||
_book_deferred_revenue_or_expense(item)
|
||||
|
||||
def make_gl_entries(doc, credit_account, debit_account, against,
|
||||
amount, base_amount, posting_date, project, account_currency, cost_center, voucher_detail_no):
|
||||
# GL Entry for crediting the amount in the deferred expense
|
||||
from erpnext.accounts.general_ledger import make_gl_entries
|
||||
|
||||
gl_entries = []
|
||||
gl_entries.append(
|
||||
doc.get_gl_dict({
|
||||
"account": credit_account,
|
||||
"against": against,
|
||||
"credit": base_amount,
|
||||
"credit_in_account_currency": amount,
|
||||
"cost_center": cost_center,
|
||||
"voucher_detail_no": voucher_detail_no,
|
||||
'posting_date': posting_date,
|
||||
'project': project
|
||||
}, account_currency)
|
||||
)
|
||||
# GL Entry to debit the amount from the expense
|
||||
gl_entries.append(
|
||||
doc.get_gl_dict({
|
||||
"account": debit_account,
|
||||
"against": against,
|
||||
"debit": base_amount,
|
||||
"debit_in_account_currency": amount,
|
||||
"cost_center": cost_center,
|
||||
"voucher_detail_no": voucher_detail_no,
|
||||
'posting_date': posting_date,
|
||||
'project': project
|
||||
}, account_currency)
|
||||
)
|
||||
|
||||
if gl_entries:
|
||||
make_gl_entries(gl_entries, cancel=(doc.docstatus == 2), merge_entries=True)
|
||||
try:
|
||||
make_gl_entries(gl_entries, cancel=(doc.docstatus == 2), merge_entries=True)
|
||||
frappe.db.commit()
|
||||
except:
|
||||
frappe.db.rollback()
|
||||
title = _("Error while processing deferred accounting for {0}").format(doc.name)
|
||||
traceback = frappe.get_traceback()
|
||||
frappe.log_error(message=traceback , title=title)
|
||||
sendmail_to_system_managers(title, traceback)
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 1,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 1,
|
||||
"allow_rename": 0,
|
||||
@@ -14,6 +15,7 @@
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -45,6 +47,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -75,6 +78,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -107,6 +111,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -138,6 +143,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -170,6 +176,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -203,6 +210,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -234,6 +242,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -265,6 +274,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -298,6 +308,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -330,6 +341,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -360,6 +372,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -393,6 +406,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -427,6 +441,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -460,6 +475,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -494,6 +510,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -525,6 +542,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -555,6 +573,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -585,6 +604,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -612,6 +632,39 @@
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:(doc.report_type == 'Profit and Loss' && !doc.is_group)",
|
||||
"fieldname": "include_in_gross",
|
||||
"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": "Include in gross",
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
@@ -625,7 +678,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-09-05 09:47:04.287841",
|
||||
"modified": "2019-03-04 14:42:07.208893",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Account",
|
||||
@@ -734,5 +787,6 @@
|
||||
"show_name_in_global_search": 1,
|
||||
"sort_order": "ASC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
||||
@@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.utils import cint, cstr
|
||||
from frappe import throw, _
|
||||
from frappe.utils.nestedset import NestedSet
|
||||
from frappe.utils.nestedset import NestedSet, get_ancestors_of, get_descendants_of
|
||||
|
||||
class RootNotEditable(frappe.ValidationError): pass
|
||||
class BalanceMismatchError(frappe.ValidationError): pass
|
||||
@@ -41,6 +41,7 @@ class Account(NestedSet):
|
||||
self.validate_frozen_accounts_modifier()
|
||||
self.validate_balance_must_be_debit_or_credit()
|
||||
self.validate_account_currency()
|
||||
self.validate_root_company_and_sync_account_to_children()
|
||||
|
||||
def validate_parent(self):
|
||||
"""Fetch Parent Details and validate parent account"""
|
||||
@@ -90,6 +91,38 @@ class Account(NestedSet):
|
||||
if not self.parent_account and not self.is_group:
|
||||
frappe.throw(_("Root Account must be a group"))
|
||||
|
||||
def validate_root_company_and_sync_account_to_children(self):
|
||||
# ignore validation while creating new compnay or while syncing to child companies
|
||||
if frappe.local.flags.ignore_root_company_validation or self.flags.ignore_root_company_validation:
|
||||
return
|
||||
|
||||
ancestors = get_root_company(self.company)
|
||||
if ancestors:
|
||||
if frappe.get_value("Company", self.company, "allow_account_creation_against_child_company"):
|
||||
return
|
||||
frappe.throw(_("Please add the account to root level Company - %s" % ancestors[0]))
|
||||
else:
|
||||
descendants = get_descendants_of('Company', self.company)
|
||||
if not descendants: return
|
||||
|
||||
acc_name_map = {}
|
||||
acc_name = frappe.db.get_value('Account', self.parent_account, "account_name")
|
||||
for d in frappe.db.get_values('Account',
|
||||
{"company": ["in", descendants], "account_name": acc_name},
|
||||
["company", "name"], as_dict=True):
|
||||
acc_name_map[d["company"]] = d["name"]
|
||||
|
||||
if not acc_name_map: return
|
||||
|
||||
for company in descendants:
|
||||
doc = frappe.copy_doc(self)
|
||||
doc.flags.ignore_root_company_validation = True
|
||||
doc.update({"company": company, "account_currency": None,
|
||||
"parent": acc_name_map[company], "parent_account": acc_name_map[company]})
|
||||
doc.save()
|
||||
frappe.msgprint(_("Account {0} is added in the child company {1}")
|
||||
.format(doc.name, company))
|
||||
|
||||
def validate_group_or_ledger(self):
|
||||
if self.get("__islocal"):
|
||||
return
|
||||
@@ -250,3 +283,9 @@ def merge_account(old, new, is_group, root_type, company):
|
||||
frappe.rename_doc("Account", old, new, merge=1, ignore_permissions=1)
|
||||
|
||||
return new
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_root_company(company):
|
||||
# return the topmost company in the hierarchy
|
||||
ancestors = get_ancestors_of('Company', company, "lft asc")
|
||||
return [ancestors[0]] if ancestors else []
|
||||
|
||||
@@ -4,13 +4,42 @@ frappe.treeview_settings["Account"] = {
|
||||
breadcrumbs: "Accounts",
|
||||
title: __("Chart Of Accounts"),
|
||||
get_tree_root: false,
|
||||
filters: [{
|
||||
fieldname: "company",
|
||||
fieldtype:"Select",
|
||||
options: erpnext.utils.get_tree_options("company"),
|
||||
label: __("Company"),
|
||||
default: erpnext.utils.get_tree_default("company")
|
||||
}],
|
||||
filters: [
|
||||
{
|
||||
fieldname: "company",
|
||||
fieldtype:"Select",
|
||||
options: erpnext.utils.get_tree_options("company"),
|
||||
label: __("Company"),
|
||||
default: erpnext.utils.get_tree_default("company"),
|
||||
on_change: function() {
|
||||
var me = frappe.treeview_settings['Account'].treeview;
|
||||
var company = me.page.fields_dict.company.get_value();
|
||||
frappe.call({
|
||||
method: "erpnext.accounts.doctype.account.account.get_root_company",
|
||||
args: {
|
||||
company: company,
|
||||
},
|
||||
callback: function(r) {
|
||||
if(r.message) {
|
||||
let root_company = r.message.length ? r.message[0] : "";
|
||||
me.page.fields_dict.root_company.set_value(root_company);
|
||||
|
||||
frappe.db.get_value("Company", {"name": company}, "allow_account_creation_against_child_company", (r) => {
|
||||
frappe.flags.ignore_root_company_validation = r.allow_account_creation_against_child_company;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
fieldname: "root_company",
|
||||
fieldtype:"Data",
|
||||
label: __("Root Company"),
|
||||
hidden: true,
|
||||
disable_onchange: true
|
||||
}
|
||||
],
|
||||
root_label: "Accounts",
|
||||
get_tree_nodes: 'erpnext.accounts.utils.get_children',
|
||||
add_tree_node: 'erpnext.accounts.utils.add_ac',
|
||||
@@ -42,8 +71,8 @@ frappe.treeview_settings["Account"] = {
|
||||
],
|
||||
ignore_fields:["parent_account"],
|
||||
onload: function(treeview) {
|
||||
frappe.treeview_settings['Account'].page = {};
|
||||
$.extend(frappe.treeview_settings['Account'].page, treeview.page);
|
||||
frappe.treeview_settings['Account'].treeview = {};
|
||||
$.extend(frappe.treeview_settings['Account'].treeview, treeview);
|
||||
function get_company() {
|
||||
return treeview.page.fields_dict.company.get_value();
|
||||
}
|
||||
@@ -78,6 +107,18 @@ frappe.treeview_settings["Account"] = {
|
||||
}
|
||||
|
||||
},
|
||||
post_render: function(treeview) {
|
||||
frappe.treeview_settings['Account'].treeview["tree"] = treeview.tree;
|
||||
treeview.page.set_primary_action(__("New"), function() {
|
||||
let root_company = treeview.page.fields_dict.root_company.get_value();
|
||||
|
||||
if(root_company) {
|
||||
frappe.throw(__("Please add the account to root level Company - ") + root_company);
|
||||
} else {
|
||||
treeview.new_node();
|
||||
}
|
||||
}, "octicon octicon-plus");
|
||||
},
|
||||
onrender: function(node) {
|
||||
if(frappe.boot.user.can_read.indexOf("GL Entry") !== -1){
|
||||
var dr_or_cr = node.data.balance < 0 ? "Cr" : "Dr";
|
||||
@@ -93,6 +134,20 @@ frappe.treeview_settings["Account"] = {
|
||||
}
|
||||
},
|
||||
toolbar: [
|
||||
{
|
||||
label:__("Add Child"),
|
||||
condition: function(node) {
|
||||
return frappe.boot.user.can_create.indexOf("Account") !== -1
|
||||
&& (!frappe.treeview_settings['Account'].treeview.page.fields_dict.root_company.get_value()
|
||||
|| frappe.flags.ignore_root_company_validation)
|
||||
&& node.expandable && !node.hide_add;
|
||||
},
|
||||
click: function() {
|
||||
var me = frappe.treeview_settings['Account'].treeview;
|
||||
me.new_node();
|
||||
},
|
||||
btnClass: "hidden-xs"
|
||||
},
|
||||
{
|
||||
condition: function(node) {
|
||||
return !node.root && frappe.boot.user.can_read.indexOf("GL Entry") !== -1
|
||||
@@ -103,7 +158,7 @@ frappe.treeview_settings["Account"] = {
|
||||
"account": node.label,
|
||||
"from_date": frappe.sys_defaults.year_start_date,
|
||||
"to_date": frappe.sys_defaults.year_end_date,
|
||||
"company": frappe.treeview_settings['Account'].page.fields_dict.company.get_value()
|
||||
"company": frappe.treeview_settings['Account'].treeview.page.fields_dict.company.get_value()
|
||||
};
|
||||
frappe.set_route("query-report", "General Ledger");
|
||||
},
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
import frappe, os, json
|
||||
|
||||
@@ -97,6 +97,19 @@ class TestAccount(unittest.TestCase):
|
||||
self.assertRaises(frappe.ValidationError, merge_account, "Capital Stock - _TC",\
|
||||
"Softwares - _TC", doc.is_group, doc.root_type, doc.company)
|
||||
|
||||
def test_account_sync(self):
|
||||
del frappe.local.flags["ignore_root_company_validation"]
|
||||
acc = frappe.new_doc("Account")
|
||||
acc.account_name = "Test Sync Account"
|
||||
acc.parent_account = "Temporary Accounts - _TC3"
|
||||
acc.company = "_Test Company 3"
|
||||
acc.insert()
|
||||
|
||||
acc_tc_4 = frappe.db.get_value('Account', {'account_name': "Test Sync Account", "company": "_Test Company 4"})
|
||||
acc_tc_5 = frappe.db.get_value('Account', {'account_name': "Test Sync Account", "company": "_Test Company 5"})
|
||||
self.assertEqual(acc_tc_4, "Test Sync Account - _TC4")
|
||||
self.assertEqual(acc_tc_5, "Test Sync Account - _TC5")
|
||||
|
||||
def _make_test_records(verbose):
|
||||
from frappe.test_runner import make_test_objects
|
||||
|
||||
@@ -131,7 +144,7 @@ def _make_test_records(verbose):
|
||||
|
||||
# related to Account Inventory Integration
|
||||
["_Test Account Stock In Hand", "Current Assets", 0, None, None],
|
||||
|
||||
|
||||
# fixed asset depreciation
|
||||
["_Test Fixed Asset", "Current Assets", 0, "Fixed Asset", None],
|
||||
["_Test Accumulated Depreciations", "Current Assets", 0, None, None],
|
||||
@@ -168,13 +181,17 @@ def get_inventory_account(company, warehouse=None):
|
||||
return account
|
||||
|
||||
def create_account(**kwargs):
|
||||
account = frappe.get_doc(dict(
|
||||
doctype = "Account",
|
||||
account_name = kwargs.get('account_name'),
|
||||
account_type = kwargs.get('account_type'),
|
||||
parent_account = kwargs.get('parent_account'),
|
||||
company = kwargs.get('company')
|
||||
))
|
||||
|
||||
account.save()
|
||||
return account.name
|
||||
account = frappe.db.get_value("Account", filters={"account_name": kwargs.get("account_name"), "company": kwargs.get("company")})
|
||||
if account:
|
||||
return account
|
||||
else:
|
||||
account = frappe.get_doc(dict(
|
||||
doctype = "Account",
|
||||
account_name = kwargs.get('account_name'),
|
||||
account_type = kwargs.get('account_type'),
|
||||
parent_account = kwargs.get('parent_account'),
|
||||
company = kwargs.get('company')
|
||||
))
|
||||
|
||||
account.save()
|
||||
return account.name
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
@@ -15,6 +16,7 @@
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -47,6 +49,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -78,6 +81,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -110,6 +114,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -140,6 +145,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -172,6 +178,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -203,6 +210,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -234,6 +242,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -266,6 +275,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -298,6 +308,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -329,6 +340,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -360,6 +372,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -391,6 +404,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -421,6 +435,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -452,6 +467,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -483,6 +499,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -515,6 +532,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -548,6 +566,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -579,6 +598,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -622,7 +642,7 @@
|
||||
"issingle": 1,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-05-14 15:58:27.638576",
|
||||
"modified": "2019-01-07 16:52:03.869199",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Accounts Settings",
|
||||
@@ -692,5 +712,6 @@
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_order": "ASC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
from __future__ import unicode_literals
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 1,
|
||||
@@ -290,7 +291,7 @@
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "IBAN",
|
||||
"length": 25,
|
||||
"length": 30,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
@@ -669,7 +670,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-07-20 13:55:36.996465",
|
||||
"modified": "2019-03-05 17:56:05.103238",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Bank Account",
|
||||
|
||||
@@ -31,3 +31,13 @@ def make_bank_account(doctype, docname):
|
||||
doc.is_default = 1
|
||||
|
||||
return doc
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_party_bank_account(party_type, party):
|
||||
return frappe.db.get_value(party_type,
|
||||
party, 'default_bank_account')
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_bank_account_details(bank_account):
|
||||
return frappe.db.get_value("Bank Account",
|
||||
bank_account, ['account', 'bank', 'bank_account_no'], as_dict=1)
|
||||
|
||||
@@ -23,35 +23,36 @@ class BankReconciliation(Document):
|
||||
|
||||
|
||||
journal_entries = frappe.db.sql("""
|
||||
select
|
||||
"Journal Entry" as payment_document, t1.name as payment_entry,
|
||||
t1.cheque_no as cheque_number, t1.cheque_date,
|
||||
t2.debit_in_account_currency as debit, t2.credit_in_account_currency as credit,
|
||||
t1.posting_date, t2.against_account, t1.clearance_date, t2.account_currency
|
||||
select
|
||||
"Journal Entry" as payment_document, t1.name as payment_entry,
|
||||
t1.cheque_no as cheque_number, t1.cheque_date,
|
||||
sum(t2.debit_in_account_currency) as debit, sum(t2.credit_in_account_currency) as credit,
|
||||
t1.posting_date, t2.against_account, t1.clearance_date, t2.account_currency
|
||||
from
|
||||
`tabJournal Entry` t1, `tabJournal Entry Account` t2
|
||||
where
|
||||
t2.parent = t1.name and t2.account = %s and t1.docstatus=1
|
||||
and t1.posting_date >= %s and t1.posting_date <= %s
|
||||
and t1.posting_date >= %s and t1.posting_date <= %s
|
||||
and ifnull(t1.is_opening, 'No') = 'No' {0}
|
||||
group by t2.account, t1.name
|
||||
order by t1.posting_date ASC, t1.name DESC
|
||||
""".format(condition), (self.bank_account, self.from_date, self.to_date), as_dict=1)
|
||||
|
||||
payment_entries = frappe.db.sql("""
|
||||
select
|
||||
"Payment Entry" as payment_document, name as payment_entry,
|
||||
reference_no as cheque_number, reference_date as cheque_date,
|
||||
if(paid_from=%(account)s, paid_amount, "") as credit,
|
||||
if(paid_from=%(account)s, "", received_amount) as debit,
|
||||
select
|
||||
"Payment Entry" as payment_document, name as payment_entry,
|
||||
reference_no as cheque_number, reference_date as cheque_date,
|
||||
if(paid_from=%(account)s, paid_amount, 0) as credit,
|
||||
if(paid_from=%(account)s, 0, received_amount) as debit,
|
||||
posting_date, ifnull(party,if(paid_from=%(account)s,paid_to,paid_from)) as against_account, clearance_date,
|
||||
if(paid_to=%(account)s, paid_to_account_currency, paid_from_account_currency) as account_currency
|
||||
from `tabPayment Entry`
|
||||
where
|
||||
(paid_from=%(account)s or paid_to=%(account)s) and docstatus=1
|
||||
and posting_date >= %(from)s and posting_date <= %(to)s {0}
|
||||
order by
|
||||
order by
|
||||
posting_date ASC, name DESC
|
||||
""".format(condition),
|
||||
""".format(condition),
|
||||
{"account":self.bank_account, "from":self.from_date, "to":self.to_date}, as_dict=1)
|
||||
|
||||
pos_entries = []
|
||||
@@ -78,8 +79,12 @@ class BankReconciliation(Document):
|
||||
|
||||
for d in entries:
|
||||
row = self.append('payment_entries', {})
|
||||
amount = d.debit if d.debit else d.credit
|
||||
d.amount = fmt_money(amount, 2, d.account_currency) + " " + (_("Dr") if d.debit else _("Cr"))
|
||||
|
||||
amount = flt(d.get('debit', 0)) - flt(d.get('credit', 0))
|
||||
|
||||
formatted_amount = fmt_money(abs(amount), 2, d.account_currency)
|
||||
d.amount = formatted_amount + " " + (_("Dr") if amount > 0 else _("Cr"))
|
||||
|
||||
d.pop("credit")
|
||||
d.pop("debit")
|
||||
d.pop("account_currency")
|
||||
@@ -102,10 +107,10 @@ class BankReconciliation(Document):
|
||||
d.clearance_date = None
|
||||
|
||||
frappe.db.set_value(d.payment_document, d.payment_entry, "clearance_date", d.clearance_date)
|
||||
frappe.db.sql("""update `tab{0}` set clearance_date = %s, modified = %s
|
||||
where name=%s""".format(d.payment_document),
|
||||
frappe.db.sql("""update `tab{0}` set clearance_date = %s, modified = %s
|
||||
where name=%s""".format(d.payment_document),
|
||||
(d.clearance_date, nowdate(), d.payment_entry))
|
||||
|
||||
|
||||
clearance_date_updated = True
|
||||
|
||||
if clearance_date_updated:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
@@ -12,6 +13,7 @@
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -39,10 +41,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -71,11 +75,13 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0,
|
||||
"width": "50"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -103,11 +109,13 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0,
|
||||
"width": "15"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -136,10 +144,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -165,11 +175,13 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0,
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -197,10 +209,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -228,10 +242,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -259,10 +275,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -290,6 +308,7 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
@@ -304,7 +323,7 @@
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2017-06-23 12:07:50.883515",
|
||||
"modified": "2019-01-07 16:52:07.174687",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Bank Reconciliation Detail",
|
||||
@@ -316,5 +335,6 @@
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_order": "ASC",
|
||||
"track_changes": 0,
|
||||
"track_seen": 0
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 1,
|
||||
"allow_rename": 0,
|
||||
@@ -19,6 +20,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "Cost Center",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "budget_against",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
@@ -52,6 +54,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@@ -86,6 +89,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.budget_against == 'Cost Center'",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "cost_center",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@@ -120,6 +124,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.budget_against == 'Project'",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "project",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@@ -153,6 +158,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "fiscal_year",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@@ -186,6 +192,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "column_break_3",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@@ -218,6 +225,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:in_list([\"Stop\", \"Warn\"], doc.action_if_accumulated_monthly_budget_exceeded_on_po || doc.action_if_accumulated_monthly_budget_exceeded_on_mr || doc.action_if_accumulated_monthly_budget_exceeded_on_actual)",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "monthly_distribution",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@@ -251,6 +259,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "amended_from",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@@ -283,6 +292,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "section_break_6",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@@ -315,6 +325,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "applicable_on_material_request",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
@@ -343,12 +354,13 @@
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "Stop",
|
||||
"depends_on": "eval:doc.applicable_on_material_request == 1",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "action_if_annual_budget_exceeded_on_mr",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
@@ -378,12 +390,13 @@
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "Warn",
|
||||
"depends_on": "eval:doc.applicable_on_material_request == 1",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "action_if_accumulated_monthly_budget_exceeded_on_mr",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
@@ -417,6 +430,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "column_break_13",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@@ -448,6 +462,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "applicable_on_purchase_order",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
@@ -476,12 +491,13 @@
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "Stop",
|
||||
"depends_on": "eval:doc.applicable_on_purchase_order == 1",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "action_if_annual_budget_exceeded_on_po",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
@@ -511,12 +527,13 @@
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "Warn",
|
||||
"depends_on": "eval:doc.applicable_on_purchase_order == 1",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "action_if_accumulated_monthly_budget_exceeded_on_po",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
@@ -550,6 +567,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "section_break_16",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@@ -581,6 +599,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "applicable_on_booking_actual_expenses",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
@@ -609,12 +628,13 @@
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "Stop",
|
||||
"depends_on": "eval:doc.applicable_on_booking_actual_expenses == 1",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "action_if_annual_budget_exceeded",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
@@ -644,12 +664,13 @@
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "Warn",
|
||||
"depends_on": "eval:doc.applicable_on_booking_actual_expenses == 1",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "action_if_accumulated_monthly_budget_exceeded",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
@@ -683,6 +704,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "section_break_21",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
@@ -715,6 +737,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "accounts",
|
||||
"fieldtype": "Table",
|
||||
"hidden": 0,
|
||||
@@ -735,7 +758,7 @@
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
@@ -752,7 +775,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-09-12 11:02:41.825923",
|
||||
"modified": "2019-03-22 12:06:02.323099",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Budget",
|
||||
@@ -785,7 +808,7 @@
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0,
|
||||
"track_changes": 1,
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
DEFAULT_MAPPERS = [
|
||||
{
|
||||
'doctype': 'Cash Flow Mapper',
|
||||
|
||||
@@ -1,403 +1,434 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"autoname": "naming_series:",
|
||||
"beta": 0,
|
||||
"creation": "2018-06-18 16:51:49.994750",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "Cashier-closing-",
|
||||
"fieldname": "naming_series",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Series",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Cashier-closing-\n",
|
||||
"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,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "user",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "User",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "User",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "Today",
|
||||
"fieldname": "date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"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,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "from_time",
|
||||
"fieldtype": "Time",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "From Time",
|
||||
"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": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "",
|
||||
"fieldname": "time",
|
||||
"fieldtype": "Time",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "To Time",
|
||||
"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": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "0.00",
|
||||
"fieldname": "expense",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Expense",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "2",
|
||||
"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,
|
||||
"default": "0.00",
|
||||
"fieldname": "custody",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Custody",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "2",
|
||||
"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,
|
||||
"default": "0.00",
|
||||
"fieldname": "outstanding_amount",
|
||||
"fieldtype": "Float",
|
||||
"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": "Outstanding Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "2",
|
||||
"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,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "0.0",
|
||||
"fieldname": "payments",
|
||||
"fieldtype": "Table",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Payments",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Cashier Closing Payments",
|
||||
"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,
|
||||
"fieldname": "net_amount",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Net Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"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,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "amended_from",
|
||||
"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": "Amended From",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"options": "Cashier Closing",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"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
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"is_submittable": 1,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-09-03 10:59:54.500567",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Cashier Closing",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"amend": 0,
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 0,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
}
|
||||
"allow_copy": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"autoname": "naming_series:",
|
||||
"beta": 0,
|
||||
"creation": "2018-06-18 16:51:49.994750",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "POS-CLO-",
|
||||
"fieldname": "naming_series",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Series",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "POS-CLO-",
|
||||
"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,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "user",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "User",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "User",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "Today",
|
||||
"fieldname": "date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"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,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "from_time",
|
||||
"fieldtype": "Time",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "From Time",
|
||||
"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": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "",
|
||||
"fieldname": "time",
|
||||
"fieldtype": "Time",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "To Time",
|
||||
"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": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "0.00",
|
||||
"fieldname": "expense",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Expense",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "2",
|
||||
"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,
|
||||
"default": "0.00",
|
||||
"fieldname": "custody",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Custody",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "2",
|
||||
"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,
|
||||
"default": "0.00",
|
||||
"fieldname": "returns",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Returns",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "2",
|
||||
"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,
|
||||
"default": "0.00",
|
||||
"fieldname": "outstanding_amount",
|
||||
"fieldtype": "Float",
|
||||
"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": "Outstanding Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "2",
|
||||
"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,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "0.0",
|
||||
"fieldname": "payments",
|
||||
"fieldtype": "Table",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Payments",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Cashier Closing Payments",
|
||||
"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,
|
||||
"fieldname": "net_amount",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Net Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"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,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "amended_from",
|
||||
"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": "Amended From",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"options": "Cashier Closing",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"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
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"is_submittable": 1,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2019-03-14 09:14:26.727129",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Cashier Closing",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"amend": 0,
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 0,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
}
|
||||
@@ -29,8 +29,8 @@ class CashierClosing(Document):
|
||||
for i in self.payments:
|
||||
total += flt(i.amount)
|
||||
|
||||
self.net_amount = total + self.outstanding_amount + self.expense - self.custody
|
||||
self.net_amount = total + self.outstanding_amount + self.expense - self.custody + self.returns
|
||||
|
||||
def validate_time(self):
|
||||
if self.from_time >= self.time:
|
||||
frappe.throw(_("From Time Should Be Less Than To Time"))
|
||||
frappe.throw(_("From Time Should Be Less Than To Time"))
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
@@ -14,6 +15,7 @@
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -41,10 +43,12 @@
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -63,7 +67,7 @@
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "2",
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
@@ -72,6 +76,7 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
@@ -85,7 +90,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-09-02 14:45:36.303520",
|
||||
"modified": "2019-02-19 08:34:20.268037",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Cashier Closing Payments",
|
||||
@@ -99,5 +104,6 @@
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
||||
@@ -46,7 +46,7 @@ frappe.ui.form.on('Cost Center', {
|
||||
doctype_name: frm.doc.doctype,
|
||||
name: frm.doc.name,
|
||||
field_name: d.fields[0].fieldname,
|
||||
field_value: data.cost_center_number,
|
||||
number_value: data.cost_center_number,
|
||||
company: frm.doc.company
|
||||
},
|
||||
callback: function(r) {
|
||||
|
||||
@@ -39,6 +39,8 @@ frappe.ui.form.on('Exchange Rate Revaluation', {
|
||||
});
|
||||
frm.events.get_total_gain_loss(frm);
|
||||
refresh_field("accounts");
|
||||
} else {
|
||||
frappe.msgprint(__("No records found"));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -67,17 +67,19 @@ class ExchangeRateRevaluation(Document):
|
||||
and account_currency != %s
|
||||
order by name""",(self.company, company_currency))
|
||||
|
||||
account_details = frappe.db.sql("""
|
||||
select
|
||||
account, party_type, party, account_currency,
|
||||
sum(debit_in_account_currency) - sum(credit_in_account_currency) as balance_in_account_currency,
|
||||
sum(debit) - sum(credit) as balance
|
||||
from `tabGL Entry`
|
||||
where account in (%s)
|
||||
group by account, party_type, party
|
||||
having sum(debit) != sum(credit)
|
||||
order by account
|
||||
""" % ', '.join(['%s']*len(accounts)), tuple(accounts), as_dict=1)
|
||||
account_details = []
|
||||
if accounts:
|
||||
account_details = frappe.db.sql("""
|
||||
select
|
||||
account, party_type, party, account_currency,
|
||||
sum(debit_in_account_currency) - sum(credit_in_account_currency) as balance_in_account_currency,
|
||||
sum(debit) - sum(credit) as balance
|
||||
from `tabGL Entry`
|
||||
where account in (%s)
|
||||
group by account, party_type, party
|
||||
having sum(debit) != sum(credit)
|
||||
order by account
|
||||
""" % ', '.join(['%s']*len(accounts)), tuple(accounts), as_dict=1)
|
||||
|
||||
return account_details
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
@@ -14,6 +15,7 @@
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -46,6 +48,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -78,6 +81,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -110,6 +114,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -140,6 +145,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -172,6 +178,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -203,6 +210,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -234,6 +242,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -265,6 +274,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -296,6 +306,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -326,6 +337,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -357,6 +369,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -388,6 +401,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -428,7 +442,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-05-05 17:03:03.512559",
|
||||
"modified": "2019-01-07 16:52:07.327930",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Exchange Rate Revaluation Account",
|
||||
@@ -442,5 +456,6 @@
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
||||
@@ -9,6 +9,8 @@ from dateutil.relativedelta import relativedelta
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
class FiscalYearIncorrectDate(frappe.ValidationError): pass
|
||||
|
||||
class FiscalYear(Document):
|
||||
def set_as_default(self):
|
||||
frappe.db.set_value("Global Defaults", None, "current_fiscal_year", self.name)
|
||||
@@ -35,11 +37,14 @@ class FiscalYear(Document):
|
||||
|
||||
def validate_dates(self):
|
||||
if getdate(self.year_start_date) > getdate(self.year_end_date):
|
||||
frappe.throw(_("Fiscal Year Start Date should not be greater than Fiscal Year End Date"))
|
||||
frappe.throw(_("Fiscal Year Start Date should be one year earlier than Fiscal Year End Date"),
|
||||
FiscalYearIncorrectDate)
|
||||
|
||||
if (getdate(self.year_end_date) - getdate(self.year_start_date)).days > 366:
|
||||
date = getdate(self.year_start_date) + relativedelta(years=1) - relativedelta(days=1)
|
||||
self.year_end_date = date.strftime("%Y-%m-%d")
|
||||
date = getdate(self.year_start_date) + relativedelta(years=1) - relativedelta(days=1)
|
||||
|
||||
if getdate(self.year_end_date) != date:
|
||||
frappe.throw(_("Fiscal Year End Date should be one year after Fiscal Year Start Date"),
|
||||
FiscalYearIncorrectDate)
|
||||
|
||||
def on_update(self):
|
||||
check_duplicate_fiscal_year(self)
|
||||
|
||||
@@ -5,6 +5,8 @@ from __future__ import unicode_literals
|
||||
|
||||
import frappe, unittest
|
||||
|
||||
from erpnext.accounts.doctype.fiscal_year.fiscal_year import FiscalYearIncorrectDate
|
||||
|
||||
test_records = frappe.get_test_records('Fiscal Year')
|
||||
test_ignore = ["Company"]
|
||||
|
||||
@@ -12,12 +14,12 @@ class TestFiscalYear(unittest.TestCase):
|
||||
def test_extra_year(self):
|
||||
if frappe.db.exists("Fiscal Year", "_Test Fiscal Year 2000"):
|
||||
frappe.delete_doc("Fiscal Year", "_Test Fiscal Year 2000")
|
||||
|
||||
fy = frappe.get_doc({
|
||||
"doctype": "Fiscal Year",
|
||||
"year": "_Test Fiscal Year 2000",
|
||||
"year_end_date": "2002-12-31",
|
||||
"year_start_date": "2000-04-01"
|
||||
})
|
||||
fy.insert()
|
||||
self.assertEqual(fy.year_end_date, '2001-03-31')
|
||||
|
||||
self.assertRaises(FiscalYearIncorrectDate, fy.insert)
|
||||
|
||||
@@ -18,15 +18,14 @@ class GLEntry(Document):
|
||||
self.flags.ignore_submit_comment = True
|
||||
self.check_mandatory()
|
||||
self.validate_and_set_fiscal_year()
|
||||
self.pl_must_have_cost_center()
|
||||
self.validate_cost_center()
|
||||
|
||||
if not self.flags.from_repost:
|
||||
self.pl_must_have_cost_center()
|
||||
self.check_pl_account()
|
||||
self.validate_cost_center()
|
||||
self.validate_party()
|
||||
self.validate_currency()
|
||||
|
||||
|
||||
def on_update_with_args(self, adv_adj, update_outstanding = 'Yes', from_repost=False):
|
||||
if not from_repost:
|
||||
self.validate_account_details(adv_adj)
|
||||
@@ -75,7 +74,8 @@ class GLEntry(Document):
|
||||
|
||||
def check_pl_account(self):
|
||||
if self.is_opening=='Yes' and \
|
||||
frappe.db.get_value("Account", self.account, "report_type")=="Profit and Loss":
|
||||
frappe.db.get_value("Account", self.account, "report_type")=="Profit and Loss" and \
|
||||
self.voucher_type not in ['Purchase Invoice', 'Sales Invoice']:
|
||||
frappe.throw(_("{0} {1}: 'Profit and Loss' type account {2} not allowed in Opening Entry")
|
||||
.format(self.voucher_type, self.voucher_no, self.account))
|
||||
|
||||
|
||||
@@ -205,6 +205,13 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
|
||||
};
|
||||
}
|
||||
|
||||
// payroll entry
|
||||
if(jvd.reference_type==="Payroll Entry") {
|
||||
return {
|
||||
query: "erpnext.hr.doctype.payroll_entry.payroll_entry.get_payroll_entries_for_jv",
|
||||
};
|
||||
}
|
||||
|
||||
var out = {
|
||||
filters: [
|
||||
[jvd.reference_type, "docstatus", "=", 1]
|
||||
@@ -227,10 +234,18 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
|
||||
|
||||
out.filters.push([jvd.reference_type, "per_billed", "<", 100]);
|
||||
}
|
||||
|
||||
|
||||
if(jvd.party_type && jvd.party) {
|
||||
out.filters.push([jvd.reference_type,
|
||||
(jvd.reference_type.indexOf("Sales")===0 ? "customer" : "supplier"), "=", jvd.party]);
|
||||
var party_field = "";
|
||||
if(jvd.reference_type.indexOf("Sales")===0) {
|
||||
var party_field = "customer";
|
||||
} else if (jvd.reference_type.indexOf("Purchase")===0) {
|
||||
var party_field = "supplier";
|
||||
}
|
||||
|
||||
if (party_field) {
|
||||
out.filters.push([jvd.reference_type, party_field, "=", jvd.party]);
|
||||
}
|
||||
}
|
||||
|
||||
return out;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -52,6 +52,7 @@ class JournalEntry(AccountsController):
|
||||
self.update_loan()
|
||||
self.update_inter_company_jv()
|
||||
|
||||
|
||||
def get_title(self):
|
||||
return self.pay_to_recd_from or self.accounts[0].account
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
@@ -398,7 +399,7 @@
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "6",
|
||||
"precision": "9",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
@@ -911,7 +912,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-08-19 04:08:44.742510",
|
||||
"modified": "2019-02-18 19:00:53.662788",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Journal Entry Account",
|
||||
|
||||
@@ -7,6 +7,7 @@ import frappe
|
||||
import unittest
|
||||
from frappe.utils import today, cint, flt, getdate
|
||||
from erpnext.accounts.doctype.loyalty_program.loyalty_program import get_loyalty_program_details_with_points
|
||||
from erpnext.accounts.party import get_dashboard_info
|
||||
|
||||
class TestLoyaltyProgram(unittest.TestCase):
|
||||
@classmethod
|
||||
@@ -144,6 +145,13 @@ class TestLoyaltyProgram(unittest.TestCase):
|
||||
frappe.get_doc('Sales Invoice', d.name).cancel()
|
||||
frappe.delete_doc('Sales Invoice', d.name)
|
||||
|
||||
def test_loyalty_points_for_dashboard(self):
|
||||
doc = frappe.get_doc('Customer', 'Test Loyalty Customer')
|
||||
company_wise_info = get_dashboard_info("Customer", doc.name, doc.loyalty_program)
|
||||
|
||||
for d in company_wise_info:
|
||||
self.assertTrue(d.loyalty_points)
|
||||
|
||||
def get_points_earned(self):
|
||||
def get_returned_amount():
|
||||
returned_amount = frappe.db.sql("""
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
|
||||
# See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
@@ -284,7 +284,12 @@ frappe.ui.form.on('Payment Entry', {
|
||||
() => frm.events.get_outstanding_documents(frm),
|
||||
() => frm.events.hide_unhide_fields(frm),
|
||||
() => frm.events.set_dynamic_labels(frm),
|
||||
() => { frm.set_party_account_based_on_party = false; }
|
||||
() => {
|
||||
frm.set_party_account_based_on_party = false;
|
||||
if (r.message.bank_account) {
|
||||
frm.set_value("bank_account", r.message.bank_account);
|
||||
}
|
||||
}
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -833,6 +838,25 @@ frappe.ui.form.on('Payment Entry', {
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
bank_account: function(frm) {
|
||||
const field = frm.doc.payment_type == "Pay" ? "paid_from":"paid_to";
|
||||
if (frm.doc.bank_account && in_list(['Pay', 'Receive'], frm.doc.payment_type)) {
|
||||
frappe.call({
|
||||
method: "erpnext.accounts.doctype.bank_account.bank_account.get_bank_account_details",
|
||||
args: {
|
||||
bank_account: frm.doc.bank_account
|
||||
},
|
||||
callback: function(r) {
|
||||
if (r.message) {
|
||||
frm.set_value(field, r.message.account);
|
||||
frm.set_value('bank', r.message.bank);
|
||||
frm.set_value('bank_account_no', r.message.bank_account_no);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 1,
|
||||
"allow_rename": 0,
|
||||
@@ -379,24 +380,24 @@
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "party",
|
||||
"fieldname": "contact_person",
|
||||
"fieldtype": "Link",
|
||||
"depends_on": "eval:in_list([\"Receive\", \"Pay\"], doc.payment_type) && doc.party_type",
|
||||
"description": "",
|
||||
"fieldname": "party_name",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Contact",
|
||||
"label": "Party Name",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Contact",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
@@ -444,24 +445,24 @@
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 1,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:in_list([\"Receive\", \"Pay\"], doc.payment_type) && doc.party_type",
|
||||
"description": "",
|
||||
"fieldname": "party_name",
|
||||
"fieldtype": "Data",
|
||||
"depends_on": "party",
|
||||
"fieldname": "bank_account",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 1,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Party Name",
|
||||
"label": "Bank Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Bank Account",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
@@ -509,6 +510,40 @@
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "party",
|
||||
"fieldname": "contact_person",
|
||||
"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": "Contact",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Contact",
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
@@ -1867,6 +1902,72 @@
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_from": "bank_account.bank",
|
||||
"fieldname": "bank",
|
||||
"fieldtype": "Read Only",
|
||||
"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": "Bank",
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_from": "bank_account.bank_account_no",
|
||||
"fieldname": "bank_account_no",
|
||||
"fieldtype": "Read Only",
|
||||
"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": "Bank Account No",
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
@@ -2040,7 +2141,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-09-25 14:38:48.312629",
|
||||
"modified": "2019-01-15 15:58:40.742601",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Entry",
|
||||
|
||||
@@ -6,12 +6,13 @@ from __future__ import unicode_literals
|
||||
import frappe, erpnext, json
|
||||
from frappe import _, scrub, ValidationError
|
||||
from frappe.utils import flt, comma_or, nowdate, getdate
|
||||
from erpnext.accounts.utils import get_outstanding_invoices, get_account_currency, get_balance_on
|
||||
from erpnext.accounts.utils import get_outstanding_invoices, get_account_currency, get_balance_on, get_allow_cost_center_in_entry_of_bs_account
|
||||
from erpnext.accounts.party import get_party_account
|
||||
from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account
|
||||
from erpnext.setup.utils import get_exchange_rate
|
||||
from erpnext.accounts.general_ledger import make_gl_entries
|
||||
from erpnext.hr.doctype.expense_claim.expense_claim import update_reimbursed_amount
|
||||
from erpnext.accounts.doctype.bank_account.bank_account import get_party_bank_account, get_bank_account_details
|
||||
from erpnext.controllers.accounts_controller import AccountsController, get_supplier_block_status
|
||||
|
||||
from six import string_types, iteritems
|
||||
@@ -69,6 +70,7 @@ class PaymentEntry(AccountsController):
|
||||
self.update_advance_paid()
|
||||
self.update_expense_claim()
|
||||
|
||||
|
||||
def on_cancel(self):
|
||||
self.setup_party_account_field()
|
||||
self.make_gl_entries(cancel=1)
|
||||
@@ -88,6 +90,16 @@ class PaymentEntry(AccountsController):
|
||||
.format(d.idx, d.reference_doctype, d.reference_name))
|
||||
reference_names.append((d.reference_doctype, d.reference_name))
|
||||
|
||||
def set_bank_account_data(self):
|
||||
if self.bank_account:
|
||||
bank_data = get_bank_account_details(self.bank_account)
|
||||
|
||||
field = "paid_from" if self.payment_type == "Pay" else "paid_to"
|
||||
|
||||
self.bank = bank_data.bank
|
||||
self.bank_account_no = bank_data.bank_account_no
|
||||
self.set(field, bank_data.account)
|
||||
|
||||
def validate_allocated_amount(self):
|
||||
for d in self.get("references"):
|
||||
if (flt(d.allocated_amount))> 0:
|
||||
@@ -160,7 +172,7 @@ class PaymentEntry(AccountsController):
|
||||
if not frappe.db.exists(self.party_type, self.party):
|
||||
frappe.throw(_("Invalid {0}: {1}").format(self.party_type, self.party))
|
||||
|
||||
if self.party_account:
|
||||
if self.party_account and self.party_type in ("Customer", "Supplier"):
|
||||
self.validate_account_type(self.party_account,
|
||||
[erpnext.get_party_account_type(self.party_type)])
|
||||
|
||||
@@ -553,8 +565,8 @@ def get_outstanding_reference_documents(args):
|
||||
.format(frappe.db.escape(args["voucher_type"]), frappe.db.escape(args["voucher_no"]))
|
||||
|
||||
# Add cost center condition
|
||||
if args.get("cost_center"):
|
||||
condition += " and cost_center='%s'" % args.get("cost_center")
|
||||
if args.get("cost_center") and get_allow_cost_center_in_entry_of_bs_account():
|
||||
condition += " and cost_center='%s'" % args.get("cost_center")
|
||||
|
||||
outstanding_invoices = get_outstanding_invoices(args.get("party_type"), args.get("party"),
|
||||
args.get("party_account"), condition=condition)
|
||||
@@ -670,6 +682,7 @@ def get_negative_outstanding_invoices(party_type, party, party_account, party_ac
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_party_details(company, party_type, party, date, cost_center=None):
|
||||
bank_account = ''
|
||||
if not frappe.db.exists(party_type, party):
|
||||
frappe.throw(_("Invalid {0}: {1}").format(party_type, party))
|
||||
|
||||
@@ -677,16 +690,19 @@ def get_party_details(company, party_type, party, date, cost_center=None):
|
||||
|
||||
account_currency = get_account_currency(party_account)
|
||||
account_balance = get_balance_on(party_account, date, cost_center=cost_center)
|
||||
_party_name = "title" if party_type == "Student" else party_type.lower() + "_name"
|
||||
_party_name = "title" if party_type in ("Student", "Shareholder") else party_type.lower() + "_name"
|
||||
party_name = frappe.db.get_value(party_type, party, _party_name)
|
||||
party_balance = get_balance_on(party_type=party_type, party=party, cost_center=cost_center)
|
||||
if party_type in ["Customer", "Supplier"]:
|
||||
bank_account = get_party_bank_account(party_type, party)
|
||||
|
||||
return {
|
||||
"party_account": party_account,
|
||||
"party_name": party_name,
|
||||
"party_account_currency": account_currency,
|
||||
"party_balance": party_balance,
|
||||
"account_balance": account_balance
|
||||
"account_balance": account_balance,
|
||||
"bank_account": bank_account
|
||||
}
|
||||
|
||||
|
||||
@@ -890,6 +906,11 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
|
||||
pe.allocate_payment_amount = 1
|
||||
pe.letter_head = doc.get("letter_head")
|
||||
|
||||
if pe.party_type in ["Customer", "Supplier"]:
|
||||
bank_account = get_party_bank_account(pe.party_type, pe.party)
|
||||
pe.set("bank_account", bank_account)
|
||||
pe.set_bank_account_data()
|
||||
|
||||
# only Purchase Invoice can be blocked individually
|
||||
if doc.doctype == "Purchase Invoice" and doc.invoice_is_blocked():
|
||||
frappe.msgprint(_('{0} is on hold till {1}'.format(doc.name, doc.release_date)))
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"beta": 0,
|
||||
@@ -11,16 +13,21 @@
|
||||
"editable_grid": 1,
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "account",
|
||||
"fieldtype": "Link",
|
||||
"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": "Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -30,23 +37,30 @@
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "cost_center",
|
||||
"fieldtype": "Link",
|
||||
"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": "Cost Center",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -56,23 +70,30 @@
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "amount",
|
||||
"fieldtype": "Currency",
|
||||
"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": "Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -81,24 +102,26 @@
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-02-21 03:28:03.420683",
|
||||
"modified": "2019-01-07 16:52:07.040146",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Entry Deduction",
|
||||
@@ -108,7 +131,10 @@
|
||||
"quick_entry": 1,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_seen": 0
|
||||
"track_changes": 0,
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
@@ -14,6 +15,7 @@
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -41,10 +43,12 @@
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -72,10 +76,12 @@
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -102,10 +108,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -133,10 +141,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -162,10 +172,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -192,10 +204,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -222,10 +236,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -252,10 +268,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -283,6 +301,7 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
@@ -296,7 +315,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-10-16 17:37:01.192312",
|
||||
"modified": "2019-01-07 16:52:06.884796",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Entry Reference",
|
||||
@@ -310,5 +329,6 @@
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
}
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
|
||||
@@ -1,23 +1,34 @@
|
||||
{
|
||||
"allow_copy": 1,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"beta": 0,
|
||||
"creation": "2014-07-09 12:04:51.681583",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 0,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "company",
|
||||
"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": "Company",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -26,22 +37,30 @@
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "party_type",
|
||||
"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": "Party Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -50,23 +69,31 @@
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "",
|
||||
"fieldname": "party",
|
||||
"fieldtype": "Dynamic 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": "Party",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -75,22 +102,30 @@
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "receivable_payable_account",
|
||||
"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": "Receivable / Payable Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -100,22 +135,30 @@
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "bank_cash_account",
|
||||
"fieldtype": "Link",
|
||||
"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": "Bank / Cash Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -124,22 +167,30 @@
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "col_break1",
|
||||
"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,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -147,22 +198,30 @@
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "from_date",
|
||||
"fieldtype": "Date",
|
||||
"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": "From Invoice Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -170,22 +229,30 @@
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "to_date",
|
||||
"fieldtype": "Date",
|
||||
"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": "To Invoice Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -193,22 +260,30 @@
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "minimum_amount",
|
||||
"fieldtype": "Currency",
|
||||
"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": "Minimum Invoice Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -216,22 +291,30 @@
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "maximum_amount",
|
||||
"fieldtype": "Currency",
|
||||
"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": "Maximum Invoice Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -239,22 +322,63 @@
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "System will fetch all the entries if limit value is zero.",
|
||||
"fieldname": "limit",
|
||||
"fieldtype": "Int",
|
||||
"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": "Limit",
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "get_unreconciled_entries",
|
||||
"fieldtype": "Button",
|
||||
"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": "Get Unreconciled Entries",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -262,22 +386,30 @@
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "sec_break1",
|
||||
"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": "Unreconciled Payment Details",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -285,22 +417,30 @@
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "payments",
|
||||
"fieldtype": "Table",
|
||||
"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": "Payments",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -309,22 +449,30 @@
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "reconcile",
|
||||
"fieldtype": "Button",
|
||||
"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": "Reconcile",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -332,22 +480,30 @@
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "sec_break2",
|
||||
"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": "Invoice/Journal Entry Details",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -355,22 +511,30 @@
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "invoices",
|
||||
"fieldtype": "Table",
|
||||
"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": "Invoices",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -379,25 +543,28 @@
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 1,
|
||||
"icon": "fa fa-resize-horizontal",
|
||||
"icon": "icon-resize-horizontal",
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
|
||||
"is_submittable": 0,
|
||||
"issingle": 1,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2016-01-04 02:26:58.807921",
|
||||
"modified": "2019-01-15 17:42:21.135214",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Reconciliation",
|
||||
@@ -406,7 +573,6 @@
|
||||
"permissions": [
|
||||
{
|
||||
"amend": 0,
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
@@ -426,7 +592,6 @@
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
@@ -445,8 +610,13 @@
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 0,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC"
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
||||
@@ -25,7 +25,7 @@ class PaymentReconciliation(Document):
|
||||
def get_payment_entries(self):
|
||||
order_doctype = "Sales Order" if self.party_type=="Customer" else "Purchase Order"
|
||||
payment_entries = get_advance_payment_entries(self.party_type, self.party,
|
||||
self.receivable_payable_account, order_doctype, against_all_orders=True)
|
||||
self.receivable_payable_account, order_doctype, against_all_orders=True, limit=self.limit)
|
||||
|
||||
return payment_entries
|
||||
|
||||
@@ -36,6 +36,8 @@ class PaymentReconciliation(Document):
|
||||
bank_account_condition = "t2.against_account like %(bank_cash_account)s" \
|
||||
if self.bank_cash_account else "1=1"
|
||||
|
||||
limit_cond = "limit %s" % (self.limit or 1000)
|
||||
|
||||
journal_entries = frappe.db.sql("""
|
||||
select
|
||||
"Journal Entry" as reference_type, t1.name as reference_name,
|
||||
@@ -55,10 +57,11 @@ class PaymentReconciliation(Document):
|
||||
THEN 1=1
|
||||
ELSE {bank_account_condition}
|
||||
END)
|
||||
order by t1.posting_date
|
||||
order by t1.posting_date {limit_cond}
|
||||
""".format(**{
|
||||
"dr_or_cr": dr_or_cr,
|
||||
"bank_account_condition": bank_account_condition,
|
||||
"limit_cond": limit_cond
|
||||
}), {
|
||||
"party_type": self.party_type,
|
||||
"party": self.party,
|
||||
@@ -80,7 +83,7 @@ class PaymentReconciliation(Document):
|
||||
condition = self.check_condition()
|
||||
|
||||
non_reconciled_invoices = get_outstanding_invoices(self.party_type, self.party,
|
||||
self.receivable_payable_account, condition=condition)
|
||||
self.receivable_payable_account, condition=condition, limit=self.limit)
|
||||
|
||||
self.add_invoice_entries(non_reconciled_invoices)
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"beta": 0,
|
||||
@@ -11,6 +13,8 @@
|
||||
"editable_grid": 1,
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -21,6 +25,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Reference Type",
|
||||
@@ -36,9 +41,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -49,6 +57,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Reference Name",
|
||||
@@ -65,9 +74,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -78,6 +90,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Posting Date",
|
||||
@@ -92,9 +105,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -105,6 +121,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Is Advance",
|
||||
@@ -119,9 +136,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -132,6 +152,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Reference Row",
|
||||
@@ -146,9 +167,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -159,6 +183,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "",
|
||||
@@ -173,9 +198,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -186,6 +214,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Invoice Number",
|
||||
@@ -201,9 +230,12 @@
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -214,6 +246,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Amount",
|
||||
@@ -228,9 +261,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -241,6 +277,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Allocated amount",
|
||||
@@ -256,9 +293,12 @@
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -269,6 +309,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "",
|
||||
@@ -283,9 +324,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -296,6 +340,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Remark",
|
||||
@@ -310,21 +355,22 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2017-01-30 01:04:22.557237",
|
||||
"modified": "2019-01-07 16:52:07.567027",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Reconciliation Payment",
|
||||
@@ -334,8 +380,10 @@
|
||||
"quick_entry": 1,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 0,
|
||||
"track_seen": 0
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
||||
@@ -54,7 +54,7 @@ frappe.ui.form.on("Payment Request", "is_a_subscription", function(frm) {
|
||||
frm.toggle_reqd("payment_gateway_account", frm.doc.is_a_subscription);
|
||||
frm.toggle_reqd("subscription_plans", frm.doc.is_a_subscription);
|
||||
|
||||
if (frm.doc.is_a_subscription) {
|
||||
if (frm.doc.is_a_subscription && frm.doc.reference_doctype && frm.doc.reference_name) {
|
||||
frappe.call({
|
||||
method: "erpnext.accounts.doctype.payment_request.payment_request.get_subscription_details",
|
||||
args: {"reference_doctype": frm.doc.reference_doctype, "reference_name": frm.doc.reference_name},
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
@@ -425,7 +426,7 @@
|
||||
"no_copy": 0,
|
||||
"options": "currency",
|
||||
"permlevel": 0,
|
||||
"precision": "2",
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
@@ -1501,7 +1502,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-09-06 14:44:43.563367",
|
||||
"modified": "2019-02-18 18:52:34.203239",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Request",
|
||||
|
||||
@@ -214,9 +214,10 @@ class PaymentRequest(Document):
|
||||
|
||||
def check_if_payment_entry_exists(self):
|
||||
if self.status == "Paid":
|
||||
payment_entry = frappe.db.sql_list("""select parent from `tabPayment Entry Reference`
|
||||
where reference_name=%s""", self.reference_name)
|
||||
if payment_entry:
|
||||
if frappe.get_all("Payment Entry Reference",
|
||||
filters={"reference_name": self.reference_name, "docstatus": ["<", 2]},
|
||||
fields=["parent"],
|
||||
limit=1):
|
||||
frappe.throw(_("Payment Entry already exists"), title=_('Error'))
|
||||
|
||||
def make_communication_entry(self):
|
||||
|
||||
@@ -8,5 +8,6 @@ frappe.ui.form.on('Payment Terms Template', {
|
||||
frm.add_fetch("payment_term", "due_date_based_on", "due_date_based_on");
|
||||
frm.add_fetch("payment_term", "credit_days", "credit_days");
|
||||
frm.add_fetch("payment_term", "credit_months", "credit_months");
|
||||
frm.add_fetch("payment_term", "mode_of_payment", "mode_of_payment");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -70,12 +70,14 @@ class PeriodClosingVoucher(AccountsController):
|
||||
net_pl_balance += flt(acc.balance_in_company_currency)
|
||||
|
||||
if net_pl_balance:
|
||||
cost_center = frappe.db.get_value("Company", self.company, "cost_center")
|
||||
gl_entries.append(self.get_gl_dict({
|
||||
"account": self.closing_account_head,
|
||||
"debit_in_account_currency": abs(net_pl_balance) if net_pl_balance > 0 else 0,
|
||||
"debit": abs(net_pl_balance) if net_pl_balance > 0 else 0,
|
||||
"credit_in_account_currency": abs(net_pl_balance) if net_pl_balance < 0 else 0,
|
||||
"credit": abs(net_pl_balance) if net_pl_balance < 0 else 0
|
||||
"credit": abs(net_pl_balance) if net_pl_balance < 0 else 0,
|
||||
"cost_center": cost_center
|
||||
}))
|
||||
|
||||
from erpnext.accounts.general_ledger import make_gl_entries
|
||||
|
||||
@@ -72,6 +72,7 @@ class TestPeriodClosingVoucher(unittest.TestCase):
|
||||
"company": "_Test Company",
|
||||
"fiscal_year": get_fiscal_year(today(), company="_Test Company")[0],
|
||||
"posting_date": today(),
|
||||
"cost_center": "_Test Cost Center - _TC",
|
||||
"remarks": "test"
|
||||
})
|
||||
pcv.insert()
|
||||
|
||||
@@ -33,15 +33,37 @@ frappe.ui.form.on('POS Profile', {
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query("account_for_change_amount", function() {
|
||||
return {
|
||||
filters: {
|
||||
account_type: ['in', ["Cash", "Bank"]]
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query("print_format", function() {
|
||||
return { filters: { doc_type: "Sales Invoice", print_format_type: "Js"} };
|
||||
});
|
||||
|
||||
frappe.db.get_value('POS Settings', {name: 'POS Settings'}, 'use_pos_in_offline_mode', (r) => {
|
||||
is_offline = r && cint(r.use_pos_in_offline_mode)
|
||||
frappe.db.get_value('POS Settings', 'POS Settings', 'use_pos_in_offline_mode', (r) => {
|
||||
const is_offline = r && cint(r.use_pos_in_offline_mode)
|
||||
frm.toggle_display('offline_pos_section', is_offline);
|
||||
frm.toggle_display('print_format_for_online', !is_offline);
|
||||
});
|
||||
|
||||
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
|
||||
}
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
@@ -49,11 +71,11 @@ frappe.ui.form.on('POS Profile', {
|
||||
frm.trigger("toggle_display_account_head");
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
company: function(frm) {
|
||||
frm.trigger("toggle_display_account_head");
|
||||
},
|
||||
|
||||
|
||||
toggle_display_account_head: function(frm) {
|
||||
frm.toggle_display('expense_account',
|
||||
erpnext.is_perpetual_inventory_enabled(frm.doc.company));
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -127,25 +127,26 @@ def pos_profile_query(doctype, txt, searchfield, start, page_len, filters):
|
||||
'txt': '%%%s%%' % txt
|
||||
}
|
||||
|
||||
pos_profile = frappe.db.sql("""select pf.name, pf.pos_profile_name
|
||||
pos_profile = frappe.db.sql("""select pf.name
|
||||
from
|
||||
`tabPOS Profile` pf, `tabPOS Profile User` pfu
|
||||
where
|
||||
pfu.parent = pf.name and pfu.user = %(user)s and pf.company = %(company)s
|
||||
and (pf.name like %(txt)s or pf.pos_profile_name like %(txt)s)
|
||||
and (pf.name like %(txt)s)
|
||||
and pf.disabled = 0 limit %(start)s, %(page_len)s""", args)
|
||||
|
||||
if not pos_profile:
|
||||
del args['user']
|
||||
|
||||
pos_profile = frappe.db.sql("""select pf.name, pf.pos_profile_name
|
||||
pos_profile = frappe.db.sql("""select pf.name
|
||||
from
|
||||
`tabPOS Profile` pf left join `tabPOS Profile User` pfu
|
||||
on
|
||||
pf.name = pfu.parent
|
||||
where
|
||||
ifnull(pfu.user, '') = '' and pf.company = %(company)s and
|
||||
(pf.name like %(txt)s or pf.pos_profile_name like %(txt)s)
|
||||
ifnull(pfu.user, '') = ''
|
||||
and pf.company = %(company)s
|
||||
and pf.name like %(txt)s
|
||||
and pf.disabled = 0""", args)
|
||||
|
||||
return pos_profile
|
||||
|
||||
@@ -40,7 +40,6 @@ def make_pos_profile():
|
||||
"expense_account": "_Test Account Cost for Goods Sold - _TC",
|
||||
"income_account": "Sales - _TC",
|
||||
"name": "_Test POS Profile",
|
||||
"pos_profile_name": "_Test POS Profile",
|
||||
"naming_series": "_T-POS Profile-",
|
||||
"selling_price_list": "_Test Price List",
|
||||
"territory": "_Test Territory",
|
||||
|
||||
@@ -196,8 +196,9 @@ def get_pricing_rule_for_item(args):
|
||||
pricing_rule_rate = 0.0
|
||||
if pricing_rule.currency == args.currency:
|
||||
pricing_rule_rate = pricing_rule.rate
|
||||
|
||||
item_details.update({
|
||||
"price_list_rate": pricing_rule_rate,
|
||||
"price_list_rate": pricing_rule_rate * args.get("conversion_factor"),
|
||||
"discount_percentage": 0.0
|
||||
})
|
||||
else:
|
||||
|
||||
@@ -21,8 +21,6 @@ class TestPricingRule(unittest.TestCase):
|
||||
from erpnext.stock.get_item_details import get_item_details
|
||||
from frappe import MandatoryError
|
||||
|
||||
|
||||
|
||||
test_record = {
|
||||
"doctype": "Pricing Rule",
|
||||
"title": "_Test Pricing Rule",
|
||||
@@ -93,7 +91,7 @@ class TestPricingRule(unittest.TestCase):
|
||||
|
||||
args.item_code = "_Test Item 2"
|
||||
details = get_item_details(args)
|
||||
self.assertEqual(details.get("discount_percentage"), 15)
|
||||
self.assertEquals(details.get("discount_percentage"), 15)
|
||||
|
||||
def test_pricing_rule_for_margin(self):
|
||||
from erpnext.stock.get_item_details import get_item_details
|
||||
@@ -137,8 +135,8 @@ class TestPricingRule(unittest.TestCase):
|
||||
"name": None
|
||||
})
|
||||
details = get_item_details(args)
|
||||
self.assertEqual(details.get("margin_type"), "Percentage")
|
||||
self.assertEqual(details.get("margin_rate_or_amount"), 10)
|
||||
self.assertEquals(details.get("margin_type"), "Percentage")
|
||||
self.assertEquals(details.get("margin_rate_or_amount"), 10)
|
||||
|
||||
def test_pricing_rule_for_variants(self):
|
||||
from erpnext.stock.get_item_details import get_item_details
|
||||
@@ -253,6 +251,7 @@ class TestPricingRule(unittest.TestCase):
|
||||
self.assertEqual(so.items[0].rate, 100)
|
||||
|
||||
def test_pricing_rule_with_margin_and_discount(self):
|
||||
frappe.delete_doc_if_exists('Pricing Rule', '_Test Pricing Rule')
|
||||
make_pricing_rule(selling=1, margin_type="Percentage", margin_rate_or_amount=10, discount_percentage=10)
|
||||
si = create_sales_invoice(do_not_save=True)
|
||||
si.items[0].price_list_rate = 1000
|
||||
@@ -260,12 +259,11 @@ class TestPricingRule(unittest.TestCase):
|
||||
si.insert(ignore_permissions=True)
|
||||
|
||||
item = si.items[0]
|
||||
self.assertEqual(item.margin_rate_or_amount, 10)
|
||||
self.assertEqual(item.rate_with_margin, 1100)
|
||||
self.assertEquals(item.margin_rate_or_amount, 10)
|
||||
self.assertEquals(item.rate_with_margin, 1100)
|
||||
self.assertEqual(item.discount_percentage, 10)
|
||||
self.assertEqual(item.discount_amount, 110)
|
||||
self.assertEqual(item.rate, 990)
|
||||
|
||||
self.assertEquals(item.discount_amount, 110)
|
||||
self.assertEquals(item.rate, 990)
|
||||
|
||||
def make_pricing_rule(**args):
|
||||
args = frappe._dict(args)
|
||||
@@ -295,4 +293,4 @@ def make_pricing_rule(**args):
|
||||
|
||||
applicable_for = doc.applicable_for.replace(' ', '_').lower()
|
||||
if args.get(applicable_for):
|
||||
doc.db_set(applicable_for, args.get(applicable_for))
|
||||
doc.db_set(applicable_for, args.get(applicable_for))
|
||||
|
||||
@@ -9,9 +9,12 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
||||
this.setup_posting_date_time_check();
|
||||
this._super(doc);
|
||||
|
||||
// formatter for material request item
|
||||
this.frm.set_indicator_formatter('item_code',
|
||||
function(doc) { return (doc.qty<=doc.received_qty) ? "green" : "orange" })
|
||||
// formatter for purchase invoice item
|
||||
if(this.frm.doc.update_stock) {
|
||||
this.frm.set_indicator_formatter('item_code', function(doc) {
|
||||
return (doc.qty<=doc.received_qty) ? "green" : "orange";
|
||||
});
|
||||
}
|
||||
},
|
||||
onload: function() {
|
||||
this._super();
|
||||
@@ -507,6 +510,15 @@ frappe.ui.form.on("Purchase Invoice", {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
frm.set_query("cost_center", function() {
|
||||
return {
|
||||
filters: {
|
||||
company: frm.doc.company,
|
||||
is_group: 0
|
||||
}
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
onload: function(frm) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 1,
|
||||
"allow_rename": 0,
|
||||
@@ -1754,37 +1754,37 @@
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "scan_barcode",
|
||||
"fieldtype": "Data",
|
||||
"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": "Scan Barcode",
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "scan_barcode",
|
||||
"fieldtype": "Data",
|
||||
"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": "Scan Barcode",
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 1,
|
||||
"allow_in_quick_entry": 0,
|
||||
@@ -4726,7 +4726,7 @@
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2018-11-13 19:55:58.018816",
|
||||
"modified": "2019-01-07 16:51:59.800081",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Purchase Invoice",
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe, erpnext
|
||||
from frappe.utils import cint, cstr, formatdate, flt, getdate, nowdate
|
||||
from frappe import _, throw
|
||||
import frappe.defaults
|
||||
|
||||
from erpnext.assets.doctype.asset_category.asset_category import get_asset_category_account
|
||||
from erpnext.controllers.buying_controller import BuyingController
|
||||
from erpnext.accounts.party import get_party_account, get_due_date
|
||||
from erpnext.accounts.utils import get_account_currency, get_fiscal_year
|
||||
@@ -16,7 +18,7 @@ from erpnext.accounts.general_ledger import make_gl_entries, merge_similar_entri
|
||||
from erpnext.accounts.doctype.gl_entry.gl_entry import update_outstanding_amt
|
||||
from erpnext.buying.utils import check_for_closed_status
|
||||
from erpnext.accounts.general_ledger import get_round_off_account_and_cost_center
|
||||
from erpnext.assets.doctype.asset.asset import get_asset_account
|
||||
from erpnext.assets.doctype.asset.asset import get_asset_account, is_cwip_accounting_disabled
|
||||
from frappe.model.mapper import get_mapped_doc
|
||||
from six import iteritems
|
||||
from erpnext.accounts.doctype.sales_invoice.sales_invoice import validate_inter_company_party, update_linked_invoice,\
|
||||
@@ -45,6 +47,7 @@ class PurchaseInvoice(BuyingController):
|
||||
}]
|
||||
|
||||
def onload(self):
|
||||
super(PurchaseInvoice, self).onload()
|
||||
supplier_tds = frappe.db.get_value("Supplier", self.supplier, "tax_withholding_category")
|
||||
self.set_onload("supplier_tds", supplier_tds)
|
||||
|
||||
@@ -52,6 +55,7 @@ class PurchaseInvoice(BuyingController):
|
||||
if not self.on_hold:
|
||||
self.release_date = ''
|
||||
|
||||
|
||||
def invoice_is_blocked(self):
|
||||
return self.on_hold and (not self.release_date or self.release_date > getdate(nowdate()))
|
||||
|
||||
@@ -206,11 +210,15 @@ class PurchaseInvoice(BuyingController):
|
||||
stock_not_billed_account = self.get_company_default("stock_received_but_not_billed")
|
||||
stock_items = self.get_stock_items()
|
||||
|
||||
asset_items = [d.is_fixed_asset for d in self.items if d.is_fixed_asset]
|
||||
if len(asset_items) > 0:
|
||||
asset_received_but_not_billed = self.get_company_default("asset_received_but_not_billed")
|
||||
|
||||
if self.update_stock:
|
||||
self.validate_item_code()
|
||||
self.validate_warehouse()
|
||||
if auto_accounting_for_stock:
|
||||
warehouse_account = get_warehouse_account_map()
|
||||
warehouse_account = get_warehouse_account_map(self.company)
|
||||
|
||||
for item in self.get("items"):
|
||||
# in case of auto inventory accounting,
|
||||
@@ -226,7 +234,15 @@ class PurchaseInvoice(BuyingController):
|
||||
item.expense_account = warehouse_account[item.warehouse]["account"]
|
||||
else:
|
||||
item.expense_account = stock_not_billed_account
|
||||
|
||||
elif item.is_fixed_asset and is_cwip_accounting_disabled():
|
||||
if not item.asset:
|
||||
frappe.throw(_("Row {0}: asset is required for item {1}")
|
||||
.format(item.idx, item.item_code))
|
||||
|
||||
item.expense_account = get_asset_category_account(item.asset, 'fixed_asset_account',
|
||||
company = self.company)
|
||||
elif item.is_fixed_asset and item.pr_detail:
|
||||
item.expense_account = asset_received_but_not_billed
|
||||
elif not item.expense_account and for_validate:
|
||||
throw(_("Expense account is mandatory for item {0}").format(item.item_code or item.item_name))
|
||||
|
||||
@@ -353,21 +369,27 @@ class PurchaseInvoice(BuyingController):
|
||||
if repost_future_gle and cint(self.update_stock) and self.auto_accounting_for_stock:
|
||||
from erpnext.controllers.stock_controller import update_gl_entries_after
|
||||
items, warehouses = self.get_items_and_warehouses()
|
||||
update_gl_entries_after(self.posting_date, self.posting_time, warehouses, items)
|
||||
update_gl_entries_after(self.posting_date, self.posting_time,
|
||||
warehouses, items, company = self.company)
|
||||
|
||||
elif self.docstatus == 2 and cint(self.update_stock) and self.auto_accounting_for_stock:
|
||||
delete_gl_entries(voucher_type=self.doctype, voucher_no=self.name)
|
||||
|
||||
def get_gl_entries(self, warehouse_account=None):
|
||||
self.auto_accounting_for_stock = erpnext.is_perpetual_inventory_enabled(self.company)
|
||||
self.stock_received_but_not_billed = self.get_company_default("stock_received_but_not_billed")
|
||||
if self.auto_accounting_for_stock:
|
||||
self.stock_received_but_not_billed = self.get_company_default("stock_received_but_not_billed")
|
||||
else:
|
||||
self.stock_received_but_not_billed = None
|
||||
self.expenses_included_in_valuation = self.get_company_default("expenses_included_in_valuation")
|
||||
self.negative_expense_to_be_booked = 0.0
|
||||
gl_entries = []
|
||||
|
||||
self.make_supplier_gl_entry(gl_entries)
|
||||
self.make_item_gl_entries(gl_entries)
|
||||
self.get_asset_gl_entry(gl_entries)
|
||||
if not is_cwip_accounting_disabled():
|
||||
self.get_asset_gl_entry(gl_entries)
|
||||
|
||||
self.make_tax_gl_entries(gl_entries)
|
||||
|
||||
gl_entries = merge_similar_entries(gl_entries)
|
||||
@@ -379,7 +401,7 @@ class PurchaseInvoice(BuyingController):
|
||||
return gl_entries
|
||||
|
||||
def make_supplier_gl_entry(self, gl_entries):
|
||||
# Checked both rounding_adjustment and rounded_total
|
||||
# Checked both rounding_adjustment and rounded_total
|
||||
# because rounded_total had value even before introcution of posting GLE based on rounded total
|
||||
grand_total = self.rounded_total if (self.rounding_adjustment and self.rounded_total) else self.grand_total
|
||||
|
||||
@@ -407,7 +429,7 @@ class PurchaseInvoice(BuyingController):
|
||||
stock_items = self.get_stock_items()
|
||||
expenses_included_in_valuation = self.get_company_default("expenses_included_in_valuation")
|
||||
if self.update_stock and self.auto_accounting_for_stock:
|
||||
warehouse_account = get_warehouse_account_map()
|
||||
warehouse_account = get_warehouse_account_map(self.company)
|
||||
|
||||
voucher_wise_stock_value = {}
|
||||
if self.update_stock:
|
||||
@@ -459,7 +481,7 @@ class PurchaseInvoice(BuyingController):
|
||||
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
||||
"credit": flt(item.rm_supp_cost)
|
||||
}, warehouse_account[self.supplier_warehouse]["account_currency"]))
|
||||
elif not item.is_fixed_asset:
|
||||
elif not item.is_fixed_asset or (item.is_fixed_asset and is_cwip_accounting_disabled()):
|
||||
gl_entries.append(
|
||||
self.get_gl_dict({
|
||||
"account": item.expense_account if not item.enable_deferred_expense else item.deferred_expense_account,
|
||||
@@ -504,7 +526,7 @@ class PurchaseInvoice(BuyingController):
|
||||
base_asset_amount = flt(item.base_net_amount + item.item_tax_amount)
|
||||
|
||||
if (not item.expense_account or frappe.db.get_value('Account',
|
||||
item.expense_account, 'account_type') != 'Asset Received But Not Billed'):
|
||||
item.expense_account, 'account_type') not in ['Asset Received But Not Billed', 'Fixed Asset']):
|
||||
arbnb_account = self.get_company_default("asset_received_but_not_billed")
|
||||
item.expense_account = arbnb_account
|
||||
|
||||
@@ -830,6 +852,10 @@ class PurchaseInvoice(BuyingController):
|
||||
return
|
||||
|
||||
tax_withholding_details = get_party_tax_withholding_details(self)
|
||||
|
||||
if not tax_withholding_details:
|
||||
return
|
||||
|
||||
accounts = []
|
||||
for d in self.taxes:
|
||||
if d.account_head == tax_withholding_details.get("account_head"):
|
||||
@@ -839,6 +865,12 @@ class PurchaseInvoice(BuyingController):
|
||||
if not accounts or tax_withholding_details.get("account_head") not in accounts:
|
||||
self.append("taxes", tax_withholding_details)
|
||||
|
||||
to_remove = [d for d in self.taxes
|
||||
if not d.tax_amount and d.account_head == tax_withholding_details.get("account_head")]
|
||||
|
||||
for d in to_remove:
|
||||
self.remove(d)
|
||||
|
||||
# calculate totals again after applying TDS
|
||||
self.calculate_taxes_and_totals()
|
||||
|
||||
@@ -859,7 +891,8 @@ def make_stock_entry(source_name, target_doc=None):
|
||||
"Purchase Invoice Item": {
|
||||
"doctype": "Stock Entry Detail",
|
||||
"field_map": {
|
||||
"stock_qty": "transfer_qty"
|
||||
"stock_qty": "transfer_qty",
|
||||
"batch_no": "batch_no"
|
||||
},
|
||||
}
|
||||
}, target_doc)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,6 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import json
|
||||
|
||||
@@ -55,6 +54,7 @@ def get_pos_data():
|
||||
'barcode_data': get_barcode_data(items_list),
|
||||
'tax_data': get_item_tax_data(),
|
||||
'price_list_data': get_price_list_data(doc.selling_price_list),
|
||||
'customer_wise_price_list': get_customer_wise_price_list(),
|
||||
'bin_data': get_bin_data(pos_profile),
|
||||
'pricing_rules': get_pricing_rule_data(doc),
|
||||
'print_template': print_template,
|
||||
@@ -250,10 +250,12 @@ def get_serial_no_data(pos_profile, company):
|
||||
|
||||
cond = "1=1"
|
||||
if pos_profile.get('update_stock') and pos_profile.get('warehouse'):
|
||||
cond = "warehouse = '{0}'".format(pos_profile.get('warehouse'))
|
||||
cond = "warehouse = %(warehouse)s"
|
||||
|
||||
serial_nos = frappe.db.sql("""select name, warehouse, item_code from `tabSerial No` where {0}
|
||||
and company = %(company)s """.format(cond), {'company': company}, as_dict=1)
|
||||
serial_nos = frappe.db.sql("""select name, warehouse, item_code
|
||||
from `tabSerial No` where {0} and company = %(company)s """.format(cond),{
|
||||
'company': company, 'warehouse': frappe.db.escape(pos_profile.get('warehouse'))
|
||||
}, as_dict=1)
|
||||
|
||||
itemwise_serial_no = {}
|
||||
for sn in serial_nos:
|
||||
@@ -326,15 +328,32 @@ def get_price_list_data(selling_price_list):
|
||||
|
||||
return itemwise_price_list
|
||||
|
||||
def get_customer_wise_price_list():
|
||||
customer_wise_price = {}
|
||||
customer_price_list_mapping = frappe._dict(frappe.get_all('Customer',fields = ['default_price_list', 'name'], as_list=1))
|
||||
|
||||
price_lists = frappe.db.sql(""" Select ifnull(price_list_rate, 0) as price_list_rate,
|
||||
item_code, price_list from `tabItem Price` """, as_dict=1)
|
||||
|
||||
for item in price_lists:
|
||||
if item.price_list and customer_price_list_mapping.get(item.price_list):
|
||||
|
||||
customer_wise_price.setdefault(customer_price_list_mapping.get(item.price_list),{}).setdefault(
|
||||
item.item_code, item.price_list_rate
|
||||
)
|
||||
|
||||
return customer_wise_price
|
||||
|
||||
def get_bin_data(pos_profile):
|
||||
itemwise_bin_data = {}
|
||||
cond = "1=1"
|
||||
if pos_profile.get('warehouse'):
|
||||
cond = "warehouse = '{0}'".format(pos_profile.get('warehouse'))
|
||||
cond = "warehouse = %(warehouse)s"
|
||||
|
||||
bin_data = frappe.db.sql(""" select item_code, warehouse, actual_qty from `tabBin`
|
||||
where actual_qty > 0 and {cond}""".format(cond=cond), as_dict=1)
|
||||
where actual_qty > 0 and {cond}""".format(cond=cond), {
|
||||
'warehouse': frappe.db.escape(pos_profile.get('warehouse'))
|
||||
}, as_dict=1)
|
||||
|
||||
for bins in bin_data:
|
||||
if bins.item_code not in itemwise_bin_data:
|
||||
|
||||
3
erpnext/accounts/doctype/sales_invoice/regional/italy.js
Normal file
3
erpnext/accounts/doctype/sales_invoice/regional/italy.js
Normal file
@@ -0,0 +1,3 @@
|
||||
{% include "erpnext/regional/italy/sales_invoice.js" %}
|
||||
|
||||
erpnext.setup_e_invoice_button('Sales Invoice')
|
||||
@@ -201,7 +201,8 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
get_query: function() {
|
||||
var filters = {
|
||||
docstatus: 1,
|
||||
company: me.frm.doc.company
|
||||
company: me.frm.doc.company,
|
||||
is_return: 0
|
||||
};
|
||||
if(me.frm.doc.customer) filters["customer"] = me.frm.doc.customer;
|
||||
return {
|
||||
@@ -217,6 +218,9 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
this.get_terms();
|
||||
},
|
||||
customer: function() {
|
||||
if (this.frm.doc.is_pos){
|
||||
var pos_profile = this.frm.doc.pos_profile;
|
||||
}
|
||||
var me = this;
|
||||
if(this.frm.updating_party_details) return;
|
||||
erpnext.utils.get_party_details(this.frm,
|
||||
@@ -226,6 +230,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
party_type: "Customer",
|
||||
account: this.frm.doc.debit_to,
|
||||
price_list: this.frm.doc.selling_price_list,
|
||||
pos_profile: pos_profile
|
||||
}, function() {
|
||||
me.apply_pricing_rule();
|
||||
});
|
||||
@@ -313,6 +318,10 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
erpnext.setup_serial_no();
|
||||
},
|
||||
|
||||
packed_items_on_form_rendered: function(doc, grid_row) {
|
||||
erpnext.setup_serial_no();
|
||||
},
|
||||
|
||||
make_sales_return: function() {
|
||||
frappe.model.open_mapped_doc({
|
||||
method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_sales_return",
|
||||
@@ -547,6 +556,23 @@ frappe.ui.form.on('Sales Invoice', {
|
||||
frm.add_fetch('payment_term', 'invoice_portion', 'invoice_portion');
|
||||
frm.add_fetch('payment_term', 'description', 'description');
|
||||
|
||||
frm.set_query("account_for_change_amount", function() {
|
||||
return {
|
||||
filters: {
|
||||
account_type: ['in', ["Cash", "Bank"]]
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query("cost_center", function() {
|
||||
return {
|
||||
filters: {
|
||||
company: frm.doc.company,
|
||||
is_group: 0
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
frm.custom_make_buttons = {
|
||||
'Delivery Note': 'Delivery',
|
||||
'Sales Invoice': 'Sales Return',
|
||||
@@ -585,7 +611,7 @@ frappe.ui.form.on('Sales Invoice', {
|
||||
|
||||
frm.set_query('company_address', function(doc) {
|
||||
if(!doc.company) {
|
||||
frappe.throw(_('Please set Company'));
|
||||
frappe.throw(__('Please set Company'));
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -1625,7 +1625,7 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "update_stock",
|
||||
"fieldname": "set_warehouse",
|
||||
"fieldname": "set_warehouse",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
@@ -1718,37 +1718,37 @@
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "scan_barcode",
|
||||
"fieldtype": "Data",
|
||||
"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": "Scan Barcode",
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "scan_barcode",
|
||||
"fieldtype": "Data",
|
||||
"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": "Scan Barcode",
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 1,
|
||||
"allow_in_quick_entry": 0,
|
||||
@@ -1966,7 +1966,7 @@
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "2",
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
@@ -5644,7 +5644,7 @@
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2018-11-12 20:01:21.289303",
|
||||
"modified": "2019-02-18 18:56:51.265257",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Sales Invoice",
|
||||
|
||||
@@ -131,7 +131,7 @@ class SalesInvoice(SellingController):
|
||||
#validate amount in mode of payments for returned invoices for pos must be negative
|
||||
if self.is_pos and self.is_return:
|
||||
self.verify_payment_amount_is_negative()
|
||||
|
||||
|
||||
if self.redeem_loyalty_points and self.loyalty_program and self.loyalty_points:
|
||||
validate_loyalty_points(self, self.loyalty_points)
|
||||
|
||||
@@ -205,6 +205,7 @@ class SalesInvoice(SellingController):
|
||||
def before_cancel(self):
|
||||
self.update_time_sheet(None)
|
||||
|
||||
|
||||
def on_cancel(self):
|
||||
self.check_close_sales_order("sales_order")
|
||||
|
||||
@@ -324,7 +325,8 @@ class SalesInvoice(SellingController):
|
||||
return {
|
||||
"print_format": print_format,
|
||||
"allow_edit_rate": pos.get("allow_user_to_edit_rate"),
|
||||
"allow_edit_discount": pos.get("allow_user_to_edit_discount")
|
||||
"allow_edit_discount": pos.get("allow_user_to_edit_discount"),
|
||||
"campaign": pos.get("campaign")
|
||||
}
|
||||
|
||||
def update_time_sheet(self, sales_invoice):
|
||||
@@ -397,11 +399,16 @@ class SalesInvoice(SellingController):
|
||||
self.account_for_change_amount = pos.get('account_for_change_amount')
|
||||
|
||||
for fieldname in ('territory', 'naming_series', 'currency', 'taxes_and_charges', 'letter_head', 'tc_name',
|
||||
'selling_price_list', 'company', 'select_print_heading', 'cash_bank_account',
|
||||
'write_off_account', 'write_off_cost_center', 'apply_discount_on'):
|
||||
'company', 'select_print_heading', 'cash_bank_account', 'company_address',
|
||||
'write_off_account', 'write_off_cost_center', 'apply_discount_on', 'cost_center'):
|
||||
if (not for_validate) or (for_validate and not self.get(fieldname)):
|
||||
self.set(fieldname, pos.get(fieldname))
|
||||
|
||||
customer_price_list = frappe.get_value("Customer", self.customer, 'default_price_list')
|
||||
|
||||
if not customer_price_list:
|
||||
self.set('selling_price_list', pos.get('selling_price_list'))
|
||||
|
||||
if not for_validate:
|
||||
self.update_stock = cint(pos.get("update_stock"))
|
||||
|
||||
@@ -517,8 +524,8 @@ class SalesInvoice(SellingController):
|
||||
|
||||
def validate_pos(self):
|
||||
if self.is_return:
|
||||
if flt(self.paid_amount) + flt(self.write_off_amount) - flt(self.grand_total) < \
|
||||
1/(10**(self.precision("grand_total") + 1)):
|
||||
if flt(self.paid_amount) + flt(self.write_off_amount) - flt(self.grand_total) > \
|
||||
1.0/(10.0**(self.precision("grand_total") + 1.0)):
|
||||
frappe.throw(_("Paid amount + Write Off Amount can not be greater than Grand Total"))
|
||||
|
||||
def validate_item_code(self):
|
||||
@@ -683,7 +690,8 @@ class SalesInvoice(SellingController):
|
||||
if repost_future_gle and cint(self.update_stock) \
|
||||
and cint(auto_accounting_for_stock):
|
||||
items, warehouses = self.get_items_and_warehouses()
|
||||
update_gl_entries_after(self.posting_date, self.posting_time, warehouses, items)
|
||||
update_gl_entries_after(self.posting_date, self.posting_time,
|
||||
warehouses, items, company = self.company)
|
||||
elif self.docstatus == 2 and cint(self.update_stock) \
|
||||
and cint(auto_accounting_for_stock):
|
||||
from erpnext.accounts.general_ledger import delete_gl_entries
|
||||
@@ -713,7 +721,7 @@ class SalesInvoice(SellingController):
|
||||
return gl_entries
|
||||
|
||||
def make_customer_gl_entry(self, gl_entries):
|
||||
# Checked both rounding_adjustment and rounded_total
|
||||
# Checked both rounding_adjustment and rounded_total
|
||||
# because rounded_total had value even before introcution of posting GLE based on rounded total
|
||||
grand_total = self.rounded_total if (self.rounding_adjustment and self.rounded_total) else self.grand_total
|
||||
if grand_total:
|
||||
@@ -1006,9 +1014,10 @@ class SalesInvoice(SellingController):
|
||||
for serial_no in item.serial_no.split("\n"):
|
||||
sales_invoice = frappe.db.get_value("Serial No", serial_no, "sales_invoice")
|
||||
if sales_invoice and self.name != sales_invoice:
|
||||
frappe.throw(_("Serial Number: {0} is already referenced in Sales Invoice: {1}".format(
|
||||
serial_no, sales_invoice
|
||||
)))
|
||||
sales_invoice_company = frappe.db.get_value("Sales Invoice", sales_invoice, "company")
|
||||
if sales_invoice_company == self.company:
|
||||
frappe.throw(_("Serial Number: {0} is already referenced in Sales Invoice: {1}"
|
||||
.format(serial_no, sales_invoice)))
|
||||
|
||||
def update_project(self):
|
||||
if self.project:
|
||||
@@ -1026,7 +1035,7 @@ class SalesInvoice(SellingController):
|
||||
def verify_payment_amount_is_negative(self):
|
||||
for entry in self.payments:
|
||||
if entry.amount > 0:
|
||||
frappe.throw(_("Row #{0} (Payment Table): Amount must be negative").format(entry.idx))
|
||||
frappe.throw(_("Row #{0} (Payment Table): Amount must be negative").format(entry.idx))
|
||||
|
||||
# collection of the loyalty points, create the ledger entry for that.
|
||||
def make_loyalty_point_entry(self):
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
@@ -14,8 +14,9 @@ from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_per
|
||||
from erpnext.exceptions import InvalidAccountCurrency, InvalidCurrency
|
||||
from erpnext.stock.doctype.serial_no.serial_no import SerialNoWarehouseError
|
||||
from frappe.model.naming import make_autoname
|
||||
from erpnext.accounts.doctype.account.test_account import get_inventory_account
|
||||
from erpnext.accounts.doctype.account.test_account import get_inventory_account, create_account
|
||||
from erpnext.controllers.taxes_and_totals import get_itemised_tax_breakup_data
|
||||
from erpnext.stock.doctype.item.test_item import create_item
|
||||
from six import iteritems
|
||||
class TestSalesInvoice(unittest.TestCase):
|
||||
def make(self):
|
||||
@@ -375,7 +376,7 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
si.insert()
|
||||
|
||||
self.assertEqual(si.net_total, 4600)
|
||||
|
||||
|
||||
self.assertEqual(si.get("taxes")[0].tax_amount, 874.0)
|
||||
self.assertEqual(si.get("taxes")[0].total, 5474.0)
|
||||
|
||||
@@ -405,12 +406,12 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
|
||||
self.assertEqual(si.total, 975)
|
||||
self.assertEqual(si.net_total, 900)
|
||||
|
||||
|
||||
self.assertEqual(si.get("taxes")[0].tax_amount, 216.0)
|
||||
self.assertEqual(si.get("taxes")[0].total, 1116.0)
|
||||
|
||||
self.assertEqual(si.grand_total, 1116.0)
|
||||
|
||||
|
||||
def test_inclusive_rate_validations(self):
|
||||
si = frappe.copy_doc(test_records[2])
|
||||
for i, tax in enumerate(si.get("taxes")):
|
||||
@@ -552,7 +553,7 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
self.assertEqual(si.grand_total, 1215.90)
|
||||
self.assertEqual(si.rounding_adjustment, 0.01)
|
||||
self.assertEqual(si.base_rounding_adjustment, 0.50)
|
||||
|
||||
|
||||
|
||||
def test_outstanding(self):
|
||||
w = self.make()
|
||||
@@ -763,6 +764,20 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
|
||||
frappe.db.sql("delete from `tabPOS Profile`")
|
||||
|
||||
def test_pos_si_without_payment(self):
|
||||
set_perpetual_inventory()
|
||||
make_pos_profile()
|
||||
|
||||
pos = copy.deepcopy(test_records[1])
|
||||
pos["is_pos"] = 1
|
||||
pos["update_stock"] = 1
|
||||
|
||||
si = frappe.copy_doc(pos)
|
||||
si.insert()
|
||||
|
||||
# Check that the invoice cannot be submitted without payments
|
||||
self.assertRaises(frappe.ValidationError, si.submit)
|
||||
|
||||
def test_sales_invoice_gl_entry_with_perpetual_inventory_no_item_code(self):
|
||||
set_perpetual_inventory()
|
||||
|
||||
@@ -923,7 +938,7 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
self.assertRaises(SerialNoWarehouseError, si.submit)
|
||||
|
||||
def test_serial_numbers_against_delivery_note(self):
|
||||
"""
|
||||
"""
|
||||
check if the sales invoice item serial numbers and the delivery note items
|
||||
serial numbers are same
|
||||
"""
|
||||
@@ -1238,7 +1253,7 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
|
||||
def test_item_wise_tax_breakup_india(self):
|
||||
frappe.flags.country = "India"
|
||||
|
||||
|
||||
si = self.create_si_to_test_tax_breakup()
|
||||
itemised_tax, itemised_taxable_amount = get_itemised_tax_breakup_data(si)
|
||||
|
||||
@@ -1256,12 +1271,12 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
|
||||
self.assertEqual(itemised_tax, expected_itemised_tax)
|
||||
self.assertEqual(itemised_taxable_amount, expected_itemised_taxable_amount)
|
||||
|
||||
|
||||
frappe.flags.country = None
|
||||
|
||||
def test_item_wise_tax_breakup_outside_india(self):
|
||||
frappe.flags.country = "United States"
|
||||
|
||||
|
||||
si = self.create_si_to_test_tax_breakup()
|
||||
|
||||
itemised_tax, itemised_taxable_amount = get_itemised_tax_breakup_data(si)
|
||||
@@ -1287,7 +1302,7 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
|
||||
self.assertEqual(itemised_tax, expected_itemised_tax)
|
||||
self.assertEqual(itemised_taxable_amount, expected_itemised_taxable_amount)
|
||||
|
||||
|
||||
frappe.flags.country = None
|
||||
|
||||
def create_si_to_test_tax_breakup(self):
|
||||
@@ -1375,7 +1390,7 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
shipping_rule = create_shipping_rule(shipping_rule_type = "Selling", shipping_rule_name = "Shipping Rule - Sales Invoice Test")
|
||||
|
||||
si = frappe.copy_doc(test_records[2])
|
||||
|
||||
|
||||
si.shipping_rule = shipping_rule.name
|
||||
si.insert()
|
||||
|
||||
@@ -1392,14 +1407,14 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
"cost_center": shipping_rule.cost_center,
|
||||
"tax_amount": shipping_amount,
|
||||
"description": shipping_rule.name
|
||||
}
|
||||
}
|
||||
si.append("taxes", shipping_charge)
|
||||
si.save()
|
||||
|
||||
self.assertEqual(si.net_total, 1250)
|
||||
|
||||
self.assertEqual(si.total_taxes_and_charges, 577.05)
|
||||
self.assertEqual(si.grand_total, 1827.05)
|
||||
self.assertEqual(si.grand_total, 1827.05)
|
||||
|
||||
def test_create_invoice_without_terms(self):
|
||||
si = create_sales_invoice(do_not_save=1)
|
||||
@@ -1496,10 +1511,60 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
|
||||
for gle in gl_entries:
|
||||
self.assertEqual(expected_values[gle.account]["cost_center"], gle.cost_center)
|
||||
|
||||
|
||||
accounts_settings.allow_cost_center_in_entry_of_bs_account = 0
|
||||
accounts_settings.save()
|
||||
|
||||
def test_deferred_revenue(self):
|
||||
deferred_account = create_account(account_name="Deferred Revenue",
|
||||
parent_account="Current Liabilities - _TC", company="_Test Company")
|
||||
|
||||
item = create_item("_Test Item for Deferred Accounting")
|
||||
item.enable_deferred_revenue = 1
|
||||
item.deferred_revenue_account = deferred_account
|
||||
item.no_of_months = 12
|
||||
item.save()
|
||||
|
||||
si = create_sales_invoice(item=item.name, posting_date="2019-01-10", do_not_submit=True)
|
||||
si.items[0].enable_deferred_revenue = 1
|
||||
si.items[0].service_start_date = "2019-01-10"
|
||||
si.items[0].service_end_date = "2019-03-15"
|
||||
si.items[0].deferred_revenue_account = deferred_account
|
||||
si.save()
|
||||
si.submit()
|
||||
|
||||
from erpnext.accounts.deferred_revenue import convert_deferred_revenue_to_income
|
||||
convert_deferred_revenue_to_income(start_date="2019-01-01", end_date="2019-01-31")
|
||||
|
||||
expected_gle = [
|
||||
[deferred_account, 33.85, 0.0, "2019-01-31"],
|
||||
["Sales - _TC", 0.0, 33.85, "2019-01-31"]
|
||||
]
|
||||
|
||||
self.check_gl_entries(si.name, expected_gle, "2019-01-10")
|
||||
|
||||
convert_deferred_revenue_to_income(start_date="2019-01-01", end_date="2019-03-31")
|
||||
|
||||
expected_gle = [
|
||||
[deferred_account, 43.08, 0.0, "2019-02-28"],
|
||||
["Sales - _TC", 0.0, 43.08, "2019-02-28"],
|
||||
[deferred_account, 23.07, 0.0, "2019-03-15"],
|
||||
["Sales - _TC", 0.0, 23.07, "2019-03-15"]
|
||||
]
|
||||
|
||||
self.check_gl_entries(si.name, expected_gle, "2019-01-31")
|
||||
|
||||
def check_gl_entries(self, voucher_no, expected_gle, posting_date):
|
||||
gl_entries = frappe.db.sql("""select account, debit, credit, posting_date
|
||||
from `tabGL Entry`
|
||||
where voucher_type='Sales Invoice' and voucher_no=%s and posting_date > %s
|
||||
order by posting_date asc, account asc""", (voucher_no, posting_date), as_dict=1)
|
||||
|
||||
for i, gle in enumerate(gl_entries):
|
||||
self.assertEqual(expected_gle[i][0], gle.account)
|
||||
self.assertEqual(expected_gle[i][1], gle.debit)
|
||||
self.assertEqual(expected_gle[i][2], gle.credit)
|
||||
self.assertEqual(getdate(expected_gle[i][3]), gle.posting_date)
|
||||
|
||||
def create_sales_invoice(**args):
|
||||
si = frappe.new_doc("Sales Invoice")
|
||||
@@ -1524,9 +1589,9 @@ def create_sales_invoice(**args):
|
||||
"warehouse": args.warehouse or "_Test Warehouse - _TC",
|
||||
"qty": args.qty or 1,
|
||||
"rate": args.rate or 100,
|
||||
"income_account": "Sales - _TC",
|
||||
"expense_account": "Cost of Goods Sold - _TC",
|
||||
"cost_center": "_Test Cost Center - _TC",
|
||||
"income_account": args.income_account or "Sales - _TC",
|
||||
"expense_account": args.expense_account or "Cost of Goods Sold - _TC",
|
||||
"cost_center": args.cost_center or "_Test Cost Center - _TC",
|
||||
"serial_no": args.serial_no
|
||||
})
|
||||
|
||||
@@ -1597,4 +1662,4 @@ def get_outstanding_amount(against_voucher_type, against_voucher, account, party
|
||||
if against_voucher_type == 'Purchase Invoice':
|
||||
bal = bal * -1
|
||||
|
||||
return bal
|
||||
return bal
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
@@ -15,6 +16,7 @@
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -45,6 +47,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
@@ -78,6 +81,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -107,6 +111,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -139,6 +144,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -169,6 +175,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 1,
|
||||
@@ -200,6 +207,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -234,6 +242,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -264,6 +273,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -296,6 +306,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -327,6 +338,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -357,6 +369,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
@@ -389,6 +402,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -420,6 +434,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -449,6 +464,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -481,6 +497,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -512,6 +529,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -543,6 +561,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -573,6 +592,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -606,6 +626,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -639,6 +660,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 1,
|
||||
@@ -670,6 +692,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -703,6 +726,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -735,6 +759,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -754,7 +779,7 @@
|
||||
"no_copy": 0,
|
||||
"options": "currency",
|
||||
"permlevel": 0,
|
||||
"precision": "2",
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
@@ -768,6 +793,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -798,6 +824,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -832,6 +859,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -860,10 +888,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -883,7 +913,7 @@
|
||||
"no_copy": 0,
|
||||
"options": "Company:company:default_currency",
|
||||
"permlevel": 0,
|
||||
"precision": "2",
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
@@ -897,6 +927,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -926,6 +957,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
@@ -959,6 +991,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -992,6 +1025,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1021,6 +1055,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1054,6 +1089,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1087,6 +1123,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1118,6 +1155,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1148,6 +1186,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1180,6 +1219,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1212,6 +1252,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1242,6 +1283,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1274,6 +1316,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1306,6 +1349,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 1,
|
||||
@@ -1338,6 +1382,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1369,6 +1414,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 1,
|
||||
@@ -1399,6 +1445,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1434,6 +1481,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1466,6 +1514,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1495,6 +1544,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1531,6 +1581,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 1,
|
||||
@@ -1562,46 +1613,14 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "enable_deferred_revenue",
|
||||
"fieldname": "deferred_revenue_account",
|
||||
"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": "Deferred Revenue Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Account",
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "enable_deferred_revenue",
|
||||
"fieldname": "service_stop_date",
|
||||
"fieldtype": "Date",
|
||||
"depends_on": "enable_deferred_revenue",
|
||||
"fieldname": "deferred_revenue_account",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
@@ -1609,7 +1628,41 @@
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Service Stop Date",
|
||||
"label": "Deferred Revenue Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Account",
|
||||
"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,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "enable_deferred_revenue",
|
||||
"fieldname": "service_stop_date",
|
||||
"fieldtype": "Date",
|
||||
"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": "Service Stop Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -1627,13 +1680,14 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "0",
|
||||
"fieldname": "enable_deferred_revenue",
|
||||
"fieldtype": "Check",
|
||||
"default": "0",
|
||||
"fieldname": "enable_deferred_revenue",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
@@ -1641,7 +1695,7 @@
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Enable Deferred Revenue",
|
||||
"label": "Enable Deferred Revenue",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -1659,6 +1713,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1689,6 +1744,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1721,6 +1777,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1753,6 +1810,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 1,
|
||||
@@ -1784,6 +1842,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1816,6 +1875,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1847,6 +1907,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1877,6 +1938,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1909,6 +1971,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 1,
|
||||
@@ -1941,6 +2004,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -1974,6 +2038,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2006,6 +2071,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2039,6 +2105,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2070,6 +2137,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2099,6 +2167,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2130,6 +2199,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2162,6 +2232,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2196,6 +2267,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2228,6 +2300,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2260,6 +2333,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2293,6 +2367,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2325,6 +2400,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 1,
|
||||
@@ -2356,6 +2432,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2389,6 +2466,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2421,6 +2499,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2451,6 +2530,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2484,6 +2564,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2516,6 +2597,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2548,6 +2630,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2579,6 +2662,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2611,6 +2695,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2641,6 +2726,7 @@
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -2680,7 +2766,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-08-29 15:22:58.455304",
|
||||
"modified": "2019-02-18 18:59:52.223628",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Sales Invoice Item",
|
||||
@@ -2693,6 +2779,6 @@
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 0,
|
||||
"track_seen": 0,
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
@@ -13,11 +14,13 @@
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:parent.doctype == 'POS Profile'",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "default",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
@@ -40,15 +43,17 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "mode_of_payment",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@@ -72,17 +77,19 @@
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "0.0",
|
||||
"default": "0",
|
||||
"depends_on": "eval:parent.doctype == 'Sales Invoice'",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "amount",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
@@ -97,7 +104,7 @@
|
||||
"no_copy": 0,
|
||||
"options": "currency",
|
||||
"permlevel": 0,
|
||||
"precision": "2",
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
@@ -106,15 +113,17 @@
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "column_break_3",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
@@ -136,15 +145,17 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "account",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@@ -168,16 +179,18 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_from": "mode_of_payment.type",
|
||||
"fetch_from": "mode_of_payment.type",
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "type",
|
||||
"fieldtype": "Read Only",
|
||||
"hidden": 0,
|
||||
@@ -201,15 +214,17 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "base_amount",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
@@ -233,15 +248,17 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fetch_if_empty": 0,
|
||||
"fieldname": "clearance_date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
@@ -264,7 +281,7 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
@@ -278,7 +295,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-05-16 22:42:52.033991",
|
||||
"modified": "2019-03-06 15:58:37.839241",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Sales Invoice Payment",
|
||||
@@ -292,5 +309,6 @@
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 0,
|
||||
"track_seen": 0
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"beta": 0,
|
||||
@@ -12,6 +14,8 @@
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -39,9 +43,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -68,9 +75,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -88,7 +98,7 @@
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "2",
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
@@ -97,9 +107,12 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
@@ -126,20 +139,21 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-02-17 16:47:04.413420",
|
||||
"modified": "2019-02-18 18:50:44.770361",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Sales Invoice Timesheet",
|
||||
@@ -153,5 +167,6 @@
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
||||
@@ -189,7 +189,7 @@ class ShareTransfer(Document):
|
||||
if (shareholder == 'from_shareholder') else self.to_folio_no;
|
||||
doc.save()
|
||||
else:
|
||||
if doc.folio_no != (self.from_folio_no if (shareholder == 'from_shareholder') else self.to_folio_no):
|
||||
if doc.folio_no and doc.folio_no != (self.from_folio_no if (shareholder == 'from_shareholder') else self.to_folio_no):
|
||||
frappe.throw(_('The folio numbers are not matching'))
|
||||
|
||||
def autoname_folio(self, shareholder, is_company=False):
|
||||
|
||||
@@ -79,7 +79,8 @@ class TestShareTransfer(unittest.TestCase):
|
||||
}
|
||||
]
|
||||
for d in share_transfers:
|
||||
frappe.get_doc(d).submit()
|
||||
st = frappe.get_doc(d)
|
||||
st.submit()
|
||||
|
||||
def test_invalid_share_transfer(self):
|
||||
doc = frappe.get_doc({
|
||||
|
||||
@@ -24,6 +24,7 @@ def get_party_tax_withholding_details(ref_doc):
|
||||
.format(tax_withholding_category, ref_doc.company))
|
||||
tds_amount = get_tds_amount(ref_doc, tax_details, fy)
|
||||
tax_row = get_tax_row(tax_details, tds_amount)
|
||||
|
||||
return tax_row
|
||||
|
||||
def get_tax_withholding_details(tax_withholding_category, fiscal_year, company):
|
||||
@@ -62,46 +63,64 @@ def get_tax_row(tax_details, tds_amount):
|
||||
def get_tds_amount(ref_doc, tax_details, fiscal_year_details):
|
||||
fiscal_year, year_start_date, year_end_date = fiscal_year_details
|
||||
tds_amount = 0
|
||||
tds_deducted = 0
|
||||
|
||||
def _get_tds():
|
||||
tds_amount = 0
|
||||
if not tax_details.threshold or ref_doc.net_total >= tax_details.threshold:
|
||||
tds_amount = ref_doc.net_total * tax_details.rate / 100
|
||||
return tds_amount
|
||||
def _get_tds(amount):
|
||||
if amount <= 0:
|
||||
return 0
|
||||
|
||||
if tax_details.cumulative_threshold:
|
||||
entries = frappe.db.sql("""
|
||||
return amount * tax_details.rate / 100
|
||||
|
||||
entries = frappe.db.sql("""
|
||||
select voucher_no, credit
|
||||
from `tabGL Entry`
|
||||
where party=%s and fiscal_year=%s and credit > 0
|
||||
""", (ref_doc.supplier, fiscal_year), as_dict=1)
|
||||
|
||||
supplier_credit_amount = flt(sum([d.credit for d in entries]))
|
||||
vouchers = [d.voucher_no for d in entries]
|
||||
advance_vouchers = get_advance_vouchers(ref_doc.supplier, fiscal_year)
|
||||
|
||||
vouchers = [d.voucher_no for d in entries]
|
||||
vouchers += get_advance_vouchers(ref_doc.supplier, fiscal_year)
|
||||
tds_vouchers = vouchers + advance_vouchers
|
||||
|
||||
tds_deducted = 0
|
||||
if vouchers:
|
||||
tds_deducted = flt(frappe.db.sql("""
|
||||
select sum(credit)
|
||||
from `tabGL Entry`
|
||||
where account=%s and fiscal_year=%s and credit > 0
|
||||
and voucher_no in ({0})
|
||||
""".format(', '.join(["'%s'" % d for d in vouchers])),
|
||||
(tax_details.account_head, fiscal_year))[0][0])
|
||||
if tds_vouchers:
|
||||
tds_deducted = frappe.db.sql("""
|
||||
SELECT sum(credit) FROM `tabGL Entry`
|
||||
WHERE
|
||||
account=%s and fiscal_year=%s and credit > 0
|
||||
and voucher_no in ({0})""". format(','.join(['%s'] * len(tds_vouchers))),
|
||||
((tax_details.account_head, fiscal_year) + tuple(tds_vouchers)))
|
||||
|
||||
tds_deducted = tds_deducted[0][0] if tds_deducted and tds_deducted[0][0] else 0
|
||||
|
||||
if tds_deducted:
|
||||
tds_amount = _get_tds(ref_doc.net_total)
|
||||
else:
|
||||
supplier_credit_amount = frappe.get_all('Purchase Invoice Item',
|
||||
fields = ['sum(net_amount)'],
|
||||
filters = {'parent': ('in', vouchers), 'docstatus': 1}, as_list=1)
|
||||
|
||||
supplier_credit_amount = (supplier_credit_amount[0][0]
|
||||
if supplier_credit_amount and supplier_credit_amount[0][0] else 0)
|
||||
|
||||
jv_supplier_credit_amt = frappe.get_all('Journal Entry Account',
|
||||
fields = ['sum(credit_in_account_currency)'],
|
||||
filters = {
|
||||
'parent': ('in', vouchers), 'docstatus': 1,
|
||||
'party': ref_doc.supplier,
|
||||
'reference_type': ('not in', ['Purchase Invoice'])
|
||||
}, as_list=1)
|
||||
|
||||
supplier_credit_amount += (jv_supplier_credit_amt[0][0]
|
||||
if jv_supplier_credit_amt and jv_supplier_credit_amt[0][0] else 0)
|
||||
|
||||
supplier_credit_amount += ref_doc.net_total
|
||||
|
||||
debit_note_amount = get_debit_note_amount(ref_doc.supplier, year_start_date, year_end_date)
|
||||
supplier_credit_amount -= debit_note_amount
|
||||
|
||||
total_invoiced_amount = supplier_credit_amount + tds_deducted \
|
||||
+ flt(ref_doc.net_total) - debit_note_amount
|
||||
if total_invoiced_amount >= tax_details.cumulative_threshold:
|
||||
total_applicable_tds = total_invoiced_amount * tax_details.rate / 100
|
||||
tds_amount = min(total_applicable_tds - tds_deducted, ref_doc.net_total)
|
||||
else:
|
||||
tds_amount = _get_tds()
|
||||
else:
|
||||
tds_amount = _get_tds()
|
||||
if ((tax_details.get('threshold', 0) and supplier_credit_amount >= tax_details.threshold)
|
||||
or (tax_details.get('cumulative_threshold', 0) and supplier_credit_amount >= tax_details.cumulative_threshold)):
|
||||
tds_amount = _get_tds(supplier_credit_amount)
|
||||
|
||||
return tds_amount
|
||||
|
||||
@@ -114,7 +133,7 @@ def get_advance_vouchers(supplier, fiscal_year=None, company=None, from_date=Non
|
||||
select distinct voucher_no
|
||||
from `tabGL Entry`
|
||||
where party=%s and %s and debit > 0
|
||||
""", (supplier, condition))
|
||||
""", (supplier, condition)) or []
|
||||
|
||||
def get_debit_note_amount(supplier, year_start_date, year_end_date, company=None):
|
||||
condition = ""
|
||||
@@ -126,4 +145,4 @@ def get_debit_note_amount(supplier, year_start_date, year_end_date, company=None
|
||||
from `tabPurchase Invoice`
|
||||
where supplier=%s %s and is_return=1 and docstatus=1
|
||||
and posting_date between %s and %s
|
||||
""", (supplier, condition, year_start_date, year_end_date)))
|
||||
""", (supplier, condition, year_start_date, year_end_date)))
|
||||
@@ -6,6 +6,7 @@ from __future__ import unicode_literals
|
||||
import frappe
|
||||
import unittest
|
||||
from frappe.utils import today
|
||||
from erpnext.accounts.utils import get_fiscal_year
|
||||
|
||||
test_dependencies = ["Supplier Group"]
|
||||
|
||||
@@ -14,65 +15,105 @@ class TestTaxWithholdingCategory(unittest.TestCase):
|
||||
def setUpClass(self):
|
||||
# create relevant supplier, etc
|
||||
create_records()
|
||||
create_tax_with_holding_category()
|
||||
|
||||
def test_single_threshold_tds(self):
|
||||
frappe.db.set_value("Supplier", "Test TDS Supplier", "tax_withholding_category", "TDS - 194D - Individual")
|
||||
pi = create_purchase_invoice()
|
||||
def test_cumulative_threshold_tds(self):
|
||||
frappe.db.set_value("Supplier", "Test TDS Supplier", "tax_withholding_category", "Cumulative Threshold TDS")
|
||||
invoices = []
|
||||
|
||||
# create invoices for lower than single threshold tax rate
|
||||
for _ in xrange(2):
|
||||
pi = create_purchase_invoice(supplier = "Test TDS Supplier")
|
||||
pi.submit()
|
||||
invoices.append(pi)
|
||||
|
||||
# create another invoice whose total when added to previously created invoice,
|
||||
# surpasses cumulative threshhold
|
||||
pi = create_purchase_invoice(supplier = "Test TDS Supplier")
|
||||
pi.submit()
|
||||
|
||||
self.assertEqual(pi.taxes_and_charges_deducted, 800)
|
||||
self.assertEqual(pi.grand_total, 15200)
|
||||
# assert equal tax deduction on total invoice amount uptil now
|
||||
self.assertEqual(pi.taxes_and_charges_deducted, 3000)
|
||||
self.assertEqual(pi.grand_total, 7000)
|
||||
invoices.append(pi)
|
||||
|
||||
# TDS is already deducted, so from onward system will deduct the TDS on every invoice
|
||||
pi = create_purchase_invoice(supplier = "Test TDS Supplier", rate=5000)
|
||||
pi.submit()
|
||||
|
||||
# assert equal tax deduction on total invoice amount uptil now
|
||||
self.assertEqual(pi.taxes_and_charges_deducted, 500)
|
||||
invoices.append(pi)
|
||||
|
||||
#delete invoices to avoid clashing
|
||||
for d in invoices:
|
||||
d.cancel()
|
||||
frappe.delete_doc("Purchase Invoice", d.name)
|
||||
|
||||
def test_single_threshold_tds(self):
|
||||
invoices = []
|
||||
frappe.db.set_value("Supplier", "Test TDS Supplier1", "tax_withholding_category", "Single Threshold TDS")
|
||||
pi = create_purchase_invoice(supplier = "Test TDS Supplier1", rate = 20000)
|
||||
pi.submit()
|
||||
invoices.append(pi)
|
||||
|
||||
self.assertEqual(pi.taxes_and_charges_deducted, 2000)
|
||||
self.assertEqual(pi.grand_total, 18000)
|
||||
|
||||
# check gl entry for the purchase invoice
|
||||
gl_entries = frappe.db.get_all('GL Entry', filters={'voucher_no': pi.name}, fields=["*"])
|
||||
self.assertEqual(len(gl_entries), 3)
|
||||
for d in gl_entries:
|
||||
if d.account == pi.credit_to:
|
||||
self.assertEqual(d.credit, 15200)
|
||||
self.assertEqual(d.credit, 18000)
|
||||
elif d.account == pi.items[0].get("expense_account"):
|
||||
self.assertEqual(d.debit, 16000)
|
||||
self.assertEqual(d.debit, 20000)
|
||||
elif d.account == pi.taxes[0].get("account_head"):
|
||||
self.assertEqual(d.credit, 800)
|
||||
self.assertEqual(d.credit, 2000)
|
||||
else:
|
||||
raise ValueError("Account head does not match.")
|
||||
|
||||
# delete purchase invoice to avoid it interefering in other tests
|
||||
pi.cancel()
|
||||
frappe.delete_doc('Purchase Invoice', pi.name)
|
||||
|
||||
def test_cumulative_threshold_tds(self):
|
||||
frappe.db.set_value("Supplier", "Test TDS Supplier", "tax_withholding_category", "TDS - 194C - Individual")
|
||||
invoices = []
|
||||
|
||||
# create invoices for lower than single threshold tax rate
|
||||
for _ in xrange(6):
|
||||
pi = create_purchase_invoice()
|
||||
pi.submit()
|
||||
invoices.append(pi)
|
||||
|
||||
# create another invoice whose total when added to previously created invoice,
|
||||
# surpasses cumulative threshhold
|
||||
pi = create_purchase_invoice()
|
||||
pi = create_purchase_invoice(supplier = "Test TDS Supplier1")
|
||||
pi.submit()
|
||||
|
||||
# assert equal tax deduction on total invoice amount uptil now
|
||||
self.assertEqual(pi.taxes_and_charges_deducted, 1120)
|
||||
self.assertEqual(pi.grand_total, 14880)
|
||||
invoices.append(pi)
|
||||
|
||||
# TDS amount is 1000 because in previous invoices it's already deducted
|
||||
self.assertEqual(pi.taxes_and_charges_deducted, 1000)
|
||||
|
||||
# delete invoices to avoid clashing
|
||||
for d in invoices:
|
||||
d.cancel()
|
||||
frappe.delete_doc("Purchase Invoice", d.name)
|
||||
|
||||
def create_purchase_invoice(qty=1):
|
||||
def test_single_threshold_tds_with_previous_vouchers(self):
|
||||
invoices = []
|
||||
frappe.db.set_value("Supplier", "Test TDS Supplier2", "tax_withholding_category", "Single Threshold TDS")
|
||||
pi = create_purchase_invoice(supplier="Test TDS Supplier2")
|
||||
pi.submit()
|
||||
invoices.append(pi)
|
||||
|
||||
pi = create_purchase_invoice(supplier="Test TDS Supplier2")
|
||||
pi.submit()
|
||||
invoices.append(pi)
|
||||
|
||||
self.assertEqual(pi.taxes_and_charges_deducted, 2000)
|
||||
self.assertEqual(pi.grand_total, 8000)
|
||||
|
||||
# delete invoices to avoid clashing
|
||||
for d in invoices:
|
||||
d.cancel()
|
||||
frappe.delete_doc("Purchase Invoice", d.name)
|
||||
|
||||
def create_purchase_invoice(**args):
|
||||
# return sales invoice doc object
|
||||
item = frappe.get_doc('Item', {'item_name': 'TDS Item'})
|
||||
|
||||
args = frappe._dict(args)
|
||||
pi = frappe.get_doc({
|
||||
"doctype": "Purchase Invoice",
|
||||
"posting_date": today(),
|
||||
"apply_tds": 1,
|
||||
"supplier": frappe.get_doc('Supplier', {"supplier_name": "Test TDS Supplier"}).name,
|
||||
"supplier": args.supplier,
|
||||
"company": '_Test Company',
|
||||
"taxes_and_charges": "",
|
||||
"currency": "INR",
|
||||
@@ -81,8 +122,8 @@ def create_purchase_invoice(qty=1):
|
||||
"items": [{
|
||||
'doctype': 'Purchase Invoice Item',
|
||||
'item_code': item.name,
|
||||
'qty': qty,
|
||||
'rate': 16000,
|
||||
'qty': args.qty or 1,
|
||||
'rate': args.rate or 10000,
|
||||
'cost_center': 'Main - _TC',
|
||||
'expense_account': 'Stock Received But Not Billed - _TC'
|
||||
}]
|
||||
@@ -92,20 +133,73 @@ def create_purchase_invoice(qty=1):
|
||||
return pi
|
||||
|
||||
def create_records():
|
||||
# create a new supplier
|
||||
frappe.get_doc({
|
||||
"supplier_group": "_Test Supplier Group",
|
||||
"supplier_name": "Test TDS Supplier",
|
||||
"doctype": "Supplier",
|
||||
"tax_withholding_category": "TDS - 194D - Individual"
|
||||
}).insert()
|
||||
# create a new suppliers
|
||||
for name in ['Test TDS Supplier', 'Test TDS Supplier1', 'Test TDS Supplier2']:
|
||||
if frappe.db.exists('Supplier', name):
|
||||
continue
|
||||
|
||||
frappe.get_doc({
|
||||
"supplier_group": "_Test Supplier Group",
|
||||
"supplier_name": name,
|
||||
"doctype": "Supplier",
|
||||
}).insert()
|
||||
|
||||
# create an item
|
||||
frappe.get_doc({
|
||||
"doctype": "Item",
|
||||
"item_code": "TDS Item",
|
||||
"item_name": "TDS Item",
|
||||
"item_group": "All Item Groups",
|
||||
"company": "_Test Company",
|
||||
"is_stock_item": 0,
|
||||
}).insert()
|
||||
if not frappe.db.exists('Item', "TDS Item"):
|
||||
frappe.get_doc({
|
||||
"doctype": "Item",
|
||||
"item_code": "TDS Item",
|
||||
"item_name": "TDS Item",
|
||||
"item_group": "All Item Groups",
|
||||
"is_stock_item": 0,
|
||||
}).insert()
|
||||
|
||||
# create an account
|
||||
if not frappe.db.exists("Account", "TDS - _TC"):
|
||||
frappe.get_doc({
|
||||
'doctype': 'Account',
|
||||
'company': '_Test Company',
|
||||
'account_name': 'TDS',
|
||||
'parent_account': 'Tax Assets - _TC',
|
||||
'report_type': 'Balance Sheet',
|
||||
'root_type': 'Asset'
|
||||
}).insert()
|
||||
|
||||
def create_tax_with_holding_category():
|
||||
fiscal_year = get_fiscal_year(today(), company="_Test Company")[0]
|
||||
|
||||
# Cummulative thresold
|
||||
if not frappe.db.exists("Tax Withholding Category", "Cumulative Threshold TDS"):
|
||||
frappe.get_doc({
|
||||
"doctype": "Tax Withholding Category",
|
||||
"name": "Cumulative Threshold TDS",
|
||||
"category_name": "10% TDS",
|
||||
"rates": [{
|
||||
'fiscal_year': fiscal_year,
|
||||
'tax_withholding_rate': 10,
|
||||
'single_threshold': 0,
|
||||
'cumulative_threshold': 30000.00
|
||||
}],
|
||||
"accounts": [{
|
||||
'company': '_Test Company',
|
||||
'account': 'TDS - _TC'
|
||||
}]
|
||||
}).insert()
|
||||
|
||||
# Single thresold
|
||||
if not frappe.db.exists("Tax Withholding Category", "Single Threshold TDS"):
|
||||
frappe.get_doc({
|
||||
"doctype": "Tax Withholding Category",
|
||||
"name": "Single Threshold TDS",
|
||||
"category_name": "10% TDS",
|
||||
"rates": [{
|
||||
'fiscal_year': fiscal_year,
|
||||
'tax_withholding_rate': 10,
|
||||
'single_threshold': 20000.00,
|
||||
'cumulative_threshold': 0
|
||||
}],
|
||||
"accounts": [{
|
||||
'company': '_Test Company',
|
||||
'account': 'TDS - _TC'
|
||||
}]
|
||||
}).insert()
|
||||
@@ -125,7 +125,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
|
||||
this.page.add_menu_item(__("Cashier Closing"), function () {
|
||||
frappe.set_route('List', 'Cashier Closing');
|
||||
});
|
||||
});
|
||||
|
||||
this.page.add_menu_item(__("POS Profile"), function () {
|
||||
frappe.set_route('List', 'POS Profile');
|
||||
@@ -313,6 +313,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
this.contacts = r.message.contacts;
|
||||
this.address = r.message.address || {};
|
||||
this.price_list_data = r.message.price_list_data;
|
||||
this.customer_wise_price_list = r.message.customer_wise_price_list
|
||||
this.bin_data = r.message.bin_data;
|
||||
this.pricing_rules = r.message.pricing_rules;
|
||||
this.print_template = r.message.print_template;
|
||||
@@ -332,6 +333,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
var me = this;
|
||||
this.frm = {}
|
||||
this.load_data(true);
|
||||
this.frm.doc.offline_pos_name = '';
|
||||
this.setup();
|
||||
this.set_default_customer()
|
||||
},
|
||||
@@ -344,7 +346,6 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
|
||||
if (load_doc) {
|
||||
this.frm.doc = JSON.parse(localStorage.getItem('doc'));
|
||||
this.frm.doc.offline_pos_name = null;
|
||||
}
|
||||
|
||||
$.each(this.meta, function (i, data) {
|
||||
@@ -602,7 +603,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
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.remove_zero_qty_items_from_cart()
|
||||
this.update_paid_amount_status(false)
|
||||
},
|
||||
|
||||
@@ -640,7 +641,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
me.list_customers_btn.toggleClass("view_customer");
|
||||
me.pos_bill.show();
|
||||
me.list_customers_btn.show();
|
||||
me.frm.doc.offline_pos_name = $(this).parents().attr('invoice-name')
|
||||
me.frm.doc.offline_pos_name = $(this).parents().attr('invoice-name');
|
||||
me.edit_record();
|
||||
})
|
||||
|
||||
@@ -798,6 +799,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
if (item.action) {
|
||||
$(this).val("");
|
||||
}
|
||||
me.make_item_list(item.customer_name);
|
||||
});
|
||||
},
|
||||
|
||||
@@ -982,7 +984,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
}
|
||||
|
||||
if(!this.customer_doc.fields_dict.customer_pos_id.value) {
|
||||
this.customer_doc.set_value("customer_pos_id", $.now())
|
||||
this.customer_doc.set_value("customer_pos_id", frappe.datetime.now_datetime())
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1037,7 +1039,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
this.numeric_keypad.show();
|
||||
},
|
||||
|
||||
make_item_list: function () {
|
||||
make_item_list: function (customer) {
|
||||
var me = this;
|
||||
if (!this.price_list) {
|
||||
frappe.msgprint(__("Price List not found or disabled"));
|
||||
@@ -1051,10 +1053,17 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
|
||||
if (this.items.length > 0) {
|
||||
$.each(this.items, function(index, obj) {
|
||||
let customer_price_list = me.customer_wise_price_list[customer];
|
||||
let item_price
|
||||
if (customer && customer_price_list && customer_price_list[obj.name]) {
|
||||
item_price = format_currency(customer_price_list[obj.name], me.frm.doc.currency);
|
||||
} else {
|
||||
item_price = format_currency(me.price_list_data[obj.name], me.frm.doc.currency);
|
||||
}
|
||||
if(index < me.page_len) {
|
||||
$(frappe.render_template("pos_item", {
|
||||
item_code: obj.name,
|
||||
item_price: format_currency(me.price_list_data[obj.name], me.frm.doc.currency),
|
||||
item_price: item_price,
|
||||
item_name: obj.name === obj.item_name ? "" : obj.item_name,
|
||||
item_image: obj.image,
|
||||
item_stock: __('Stock Qty') + ": " + me.get_actual_qty(obj),
|
||||
@@ -1137,7 +1146,6 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
apply_category: function() {
|
||||
var me = this;
|
||||
category = this.selected_item_group || "All Item Groups";
|
||||
|
||||
if(category == 'All Item Groups') {
|
||||
return this.item_data
|
||||
} else {
|
||||
@@ -1168,20 +1176,27 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
$(this.wrapper).on("change", ".pos-item-qty", function () {
|
||||
var item_code = $(this).parents(".pos-selected-item-action").attr("data-item-code");
|
||||
var qty = $(this).val();
|
||||
me.update_qty(item_code, qty)
|
||||
me.update_value()
|
||||
me.update_qty(item_code, qty);
|
||||
me.update_value();
|
||||
})
|
||||
|
||||
$(this.wrapper).on("focusout", ".pos-item-qty", function () {
|
||||
var item_code = $(this).parents(".pos-selected-item-action").attr("data-item-code");
|
||||
var qty = $(this).val();
|
||||
me.update_qty(item_code, qty, true);
|
||||
me.update_value();
|
||||
})
|
||||
|
||||
$(this.wrapper).find("[data-action='increase-qty']").on("click", function () {
|
||||
var item_code = $(this).parents(".pos-bill-item").attr("data-item-code");
|
||||
var qty = flt($(this).parents(".pos-bill-item").find('.pos-item-qty').val()) + 1;
|
||||
me.update_qty(item_code, qty)
|
||||
me.update_qty(item_code, qty);
|
||||
})
|
||||
|
||||
$(this.wrapper).find("[data-action='decrease-qty']").on("click", function () {
|
||||
var item_code = $(this).parents(".pos-bill-item").attr("data-item-code");
|
||||
var qty = flt($(this).parents(".pos-bill-item").find('.pos-item-qty').val()) - 1;
|
||||
me.update_qty(item_code, qty)
|
||||
me.update_qty(item_code, qty);
|
||||
})
|
||||
|
||||
$(this.wrapper).on("change", ".pos-item-disc", function () {
|
||||
@@ -1220,11 +1235,11 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
me.bind_delete_event()
|
||||
},
|
||||
|
||||
update_qty: function (item_code, qty) {
|
||||
update_qty: function (item_code, qty, remove_zero_qty_items) {
|
||||
var me = this;
|
||||
this.items = this.get_items(item_code);
|
||||
this.validate_serial_no()
|
||||
this.set_item_details(item_code, "qty", qty);
|
||||
this.set_item_details(item_code, "qty", qty, remove_zero_qty_items);
|
||||
},
|
||||
|
||||
update_discount: function(item_code, discount) {
|
||||
@@ -1285,7 +1300,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
})
|
||||
},
|
||||
|
||||
set_item_details: function (item_code, field, value) {
|
||||
set_item_details: function (item_code, field, value, remove_zero_qty_items) {
|
||||
var me = this;
|
||||
if (value < 0) {
|
||||
frappe.throw(__("Enter value must be positive"));
|
||||
@@ -1300,7 +1315,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
|
||||
d[field] = flt(value);
|
||||
d.amount = flt(d.rate) * flt(d.qty);
|
||||
if (d.qty == 0) {
|
||||
if (d.qty == 0 && remove_zero_qty_items) {
|
||||
me.remove_item.push(d.idx)
|
||||
}
|
||||
|
||||
@@ -1310,10 +1325,14 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
}
|
||||
});
|
||||
|
||||
if (field == 'qty') {
|
||||
this.remove_zero_qty_items_from_cart();
|
||||
}
|
||||
|
||||
this.update_paid_amount_status(false)
|
||||
},
|
||||
|
||||
remove_zero_qty_item: function () {
|
||||
remove_zero_qty_items_from_cart: function () {
|
||||
var me = this;
|
||||
var idx = 0;
|
||||
this.items = []
|
||||
@@ -1418,8 +1437,20 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
this.child.income_account = this.pos_profile_data['income_account'] || this.items[0].income_account;
|
||||
this.child.warehouse = (this.item_serial_no[this.child.item_code]
|
||||
? this.item_serial_no[this.child.item_code][1] : (this.pos_profile_data['warehouse'] || this.items[0].default_warehouse));
|
||||
this.child.price_list_rate = flt(this.price_list_data[this.child.item_code] * this.child.conversion_factor, 9) / flt(this.frm.doc.conversion_rate, 9);
|
||||
this.child.rate = flt(this.price_list_data[this.child.item_code] * this.child.conversion_factor, 9) / flt(this.frm.doc.conversion_rate, 9);
|
||||
|
||||
customer = this.frm.doc.customer;
|
||||
let rate;
|
||||
|
||||
customer_price_list = this.customer_wise_price_list[customer]
|
||||
if (customer_price_list && customer_price_list[this.child.item_code]){
|
||||
rate = flt(this.customer_wise_price_list[customer][this.child.item_code] * this.child.conversion_factor, 9) / flt(this.frm.doc.conversion_rate, 9);
|
||||
}
|
||||
else{
|
||||
rate = flt(this.price_list_data[this.child.item_code] * this.child.conversion_factor, 9) / flt(this.frm.doc.conversion_rate, 9);
|
||||
}
|
||||
|
||||
this.child.price_list_rate = rate;
|
||||
this.child.rate = rate;
|
||||
this.child.actual_qty = me.get_actual_qty(this.items[0]);
|
||||
this.child.amount = flt(this.child.qty) * flt(this.child.rate);
|
||||
this.child.batch_no = this.item_batch_no[this.child.item_code];
|
||||
@@ -1655,10 +1686,18 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
|
||||
create_invoice: function () {
|
||||
var me = this;
|
||||
var existing_pos_list = [];
|
||||
var invoice_data = {};
|
||||
this.si_docs = this.get_doc_from_localstorage();
|
||||
|
||||
if (this.frm.doc.offline_pos_name) {
|
||||
if(this.si_docs) {
|
||||
this.si_docs.forEach((row) => {
|
||||
existing_pos_list.push(Object.keys(row));
|
||||
});
|
||||
}
|
||||
|
||||
if (this.frm.doc.offline_pos_name
|
||||
&& in_list(existing_pos_list, this.frm.doc.offline_pos_name)) {
|
||||
this.update_invoice()
|
||||
//to retrieve and set the default payment
|
||||
invoice_data[this.frm.doc.offline_pos_name] = this.frm.doc;
|
||||
@@ -1667,8 +1706,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
|
||||
this.frm.doc.paid_amount = this.frm.doc.net_total
|
||||
this.frm.doc.outstanding_amount = 0
|
||||
} else {
|
||||
this.frm.doc.offline_pos_name = $.now();
|
||||
} else if(!this.frm.doc.offline_pos_name) {
|
||||
this.frm.doc.offline_pos_name = frappe.datetime.now_datetime();
|
||||
this.frm.doc.posting_date = frappe.datetime.get_today();
|
||||
this.frm.doc.posting_time = frappe.datetime.now_time();
|
||||
this.frm.doc.pos_total_qty = this.frm.doc.qty_total;
|
||||
@@ -1827,10 +1866,25 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
||||
validate: function () {
|
||||
var me = this;
|
||||
this.customer_validate();
|
||||
this.validate_zero_qty_items();
|
||||
this.item_validate();
|
||||
this.validate_mode_of_payments();
|
||||
},
|
||||
|
||||
validate_zero_qty_items: function() {
|
||||
this.remove_item = [];
|
||||
|
||||
this.frm.doc.items.forEach(d => {
|
||||
if (d.qty == 0) {
|
||||
this.remove_item.push(d.idx);
|
||||
}
|
||||
});
|
||||
|
||||
if(this.remove_item) {
|
||||
this.remove_zero_qty_items_from_cart();
|
||||
}
|
||||
},
|
||||
|
||||
item_validate: function () {
|
||||
if (this.frm.doc.items.length == 0) {
|
||||
frappe.throw(__("Select items to save the invoice"))
|
||||
|
||||
@@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
||||
|
||||
import frappe, erpnext
|
||||
from frappe import _, msgprint, scrub
|
||||
from frappe.defaults import get_user_permissions
|
||||
from frappe.core.doctype.user_permission.user_permission import get_permitted_documents
|
||||
from frappe.model.utils import get_fetch_values
|
||||
from frappe.utils import (add_days, getdate, formatdate, date_diff,
|
||||
add_years, get_timestamp, nowdate, flt, add_months, get_last_day)
|
||||
@@ -14,7 +14,7 @@ from frappe.contacts.doctype.address.address import (get_address_display,
|
||||
from frappe.contacts.doctype.contact.contact import get_contact_details, get_default_contact
|
||||
from erpnext.exceptions import PartyFrozen, PartyDisabled, InvalidAccountCurrency
|
||||
from erpnext.accounts.utils import get_fiscal_year
|
||||
from erpnext import get_default_currency, get_company_currency
|
||||
from erpnext import get_company_currency
|
||||
|
||||
from six import iteritems
|
||||
|
||||
@@ -22,18 +22,20 @@ class DuplicatePartyAccountError(frappe.ValidationError): pass
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_party_details(party=None, account=None, party_type="Customer", company=None, posting_date=None,
|
||||
bill_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False, fetch_payment_terms_template=True, party_address=None, shipping_address=None):
|
||||
bill_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False, fetch_payment_terms_template=True,
|
||||
party_address=None, shipping_address=None, pos_profile=None):
|
||||
|
||||
if not party:
|
||||
return {}
|
||||
if not frappe.db.exists(party_type, party):
|
||||
frappe.throw(_("{0}: {1} does not exists").format(party_type, party))
|
||||
return _get_party_details(party, account, party_type,
|
||||
company, posting_date, bill_date, price_list, currency, doctype, ignore_permissions, fetch_payment_terms_template, party_address, shipping_address)
|
||||
company, posting_date, bill_date, price_list, currency, doctype, ignore_permissions,
|
||||
fetch_payment_terms_template, party_address, shipping_address, pos_profile)
|
||||
|
||||
def _get_party_details(party=None, account=None, party_type="Customer", company=None, posting_date=None,
|
||||
bill_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False,
|
||||
fetch_payment_terms_template=True, party_address=None, shipping_address=None):
|
||||
fetch_payment_terms_template=True, party_address=None, shipping_address=None, pos_profile=None):
|
||||
|
||||
out = frappe._dict(set_account_and_due_date(party, account, party_type, company, posting_date, bill_date, doctype))
|
||||
party = out[party_type.lower()]
|
||||
@@ -49,7 +51,7 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
|
||||
set_address_details(out, party, party_type, doctype, company, party_address, shipping_address)
|
||||
set_contact_details(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, pos_profile)
|
||||
|
||||
out["taxes_and_charges"] = set_taxes(party.name, party_type, posting_date, company, out.customer_group, out.supplier_type)
|
||||
|
||||
@@ -72,7 +74,7 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
|
||||
|
||||
return out
|
||||
|
||||
def set_address_details(out, party, party_type, doctype=None, company=None, party_address=None, shipping_address=None):
|
||||
def set_address_details(out, party, party_type, doctype=None, company=None, party_address=None, shipping_address=None):
|
||||
billing_address_field = "customer_address" if party_type == "Lead" \
|
||||
else party_type.lower() + "_address"
|
||||
out[billing_address_field] = party_address or get_default_address(party_type, party.name)
|
||||
@@ -149,15 +151,20 @@ def get_default_price_list(party):
|
||||
|
||||
return None
|
||||
|
||||
def set_price_list(out, party, party_type, given_price_list):
|
||||
def set_price_list(out, party, party_type, given_price_list, pos=None):
|
||||
# price list
|
||||
price_list = filter(None, get_user_permissions()
|
||||
.get("Price List", {})
|
||||
.get("docs", []))
|
||||
price_list = list(price_list)
|
||||
price_list = get_permitted_documents('Price List')
|
||||
|
||||
if price_list:
|
||||
price_list = price_list[0]
|
||||
elif pos and party_type == 'Customer':
|
||||
customer_price_list = frappe.get_value('Customer', party.name, 'default_price_list')
|
||||
|
||||
if customer_price_list:
|
||||
price_list = customer_price_list
|
||||
else:
|
||||
pos_price_list = frappe.get_value('POS Profile', pos, 'selling_price_list')
|
||||
price_list = pos_price_list or given_price_list
|
||||
else:
|
||||
price_list = get_default_price_list(party) or given_price_list
|
||||
|
||||
@@ -335,7 +342,7 @@ def get_due_date_from_template(template_name, posting_date, bill_date):
|
||||
|
||||
def validate_due_date(posting_date, due_date, party_type, party, company=None, bill_date=None, template_name=None):
|
||||
if getdate(due_date) < getdate(posting_date):
|
||||
frappe.throw(_("Due Date cannot be before Posting Date"))
|
||||
frappe.throw(_("Due Date cannot be before Posting / Supplier Invoice Date"))
|
||||
else:
|
||||
if not template_name: return
|
||||
|
||||
@@ -457,40 +464,86 @@ def get_timeline_data(doctype, name):
|
||||
|
||||
return out
|
||||
|
||||
def get_dashboard_info(party_type, party):
|
||||
def get_dashboard_info(party_type, party, loyalty_program=None):
|
||||
current_fiscal_year = get_fiscal_year(nowdate(), as_dict=True)
|
||||
company = frappe.db.get_default("company") or frappe.get_all("Company")[0].name
|
||||
party_account_currency = get_party_account_currency(party_type, party, company)
|
||||
company_default_currency = get_default_currency() \
|
||||
or frappe.get_cached_value('Company', company, 'default_currency')
|
||||
|
||||
if party_account_currency==company_default_currency:
|
||||
total_field = "base_grand_total"
|
||||
else:
|
||||
total_field = "grand_total"
|
||||
|
||||
doctype = "Sales Invoice" if party_type=="Customer" else "Purchase Invoice"
|
||||
|
||||
billing_this_year = frappe.db.sql("""
|
||||
select sum({0})
|
||||
from `tab{1}`
|
||||
where {2}=%s and docstatus=1 and posting_date between %s and %s
|
||||
""".format(total_field, doctype, party_type.lower()),
|
||||
(party, current_fiscal_year.year_start_date, current_fiscal_year.year_end_date))
|
||||
companies = frappe.get_all(doctype, filters={
|
||||
'docstatus': 1,
|
||||
party_type.lower(): party
|
||||
}, distinct=1, fields=['company'])
|
||||
|
||||
total_unpaid = frappe.db.sql("""
|
||||
select sum(debit_in_account_currency) - sum(credit_in_account_currency)
|
||||
company_wise_info = []
|
||||
|
||||
company_wise_grand_total = frappe.get_all(doctype,
|
||||
filters={
|
||||
'docstatus': 1,
|
||||
party_type.lower(): party,
|
||||
'posting_date': ('between', [current_fiscal_year.year_start_date, current_fiscal_year.year_end_date])
|
||||
},
|
||||
group_by="company",
|
||||
fields=["company", "sum(grand_total) as grand_total", "sum(base_grand_total) as base_grand_total"]
|
||||
)
|
||||
|
||||
loyalty_point_details = []
|
||||
|
||||
if party_type == "Customer":
|
||||
loyalty_point_details = frappe._dict(frappe.get_all("Loyalty Point Entry",
|
||||
filters={
|
||||
'customer': party,
|
||||
'expiry_date': ('>=', getdate()),
|
||||
},
|
||||
group_by="company",
|
||||
fields=["company", "sum(loyalty_points) as loyalty_points"],
|
||||
as_list =1
|
||||
))
|
||||
|
||||
company_wise_billing_this_year = frappe._dict()
|
||||
|
||||
for d in company_wise_grand_total:
|
||||
company_wise_billing_this_year.setdefault(
|
||||
d.company,{
|
||||
"grand_total": d.grand_total,
|
||||
"base_grand_total": d.base_grand_total
|
||||
})
|
||||
|
||||
|
||||
company_wise_total_unpaid = frappe._dict(frappe.db.sql("""
|
||||
select company, sum(debit_in_account_currency) - sum(credit_in_account_currency)
|
||||
from `tabGL Entry`
|
||||
where party_type = %s and party=%s""", (party_type, party))
|
||||
where party_type = %s and party=%s
|
||||
group by company""", (party_type, party)))
|
||||
|
||||
info = {}
|
||||
info["billing_this_year"] = flt(billing_this_year[0][0]) if billing_this_year else 0
|
||||
info["currency"] = party_account_currency
|
||||
info["total_unpaid"] = flt(total_unpaid[0][0]) if total_unpaid else 0
|
||||
if party_type == "Supplier":
|
||||
info["total_unpaid"] = -1 * info["total_unpaid"]
|
||||
for d in companies:
|
||||
company_default_currency = frappe.db.get_value("Company", d.company, 'default_currency')
|
||||
party_account_currency = get_party_account_currency(party_type, party, d.company)
|
||||
|
||||
return info
|
||||
if party_account_currency==company_default_currency:
|
||||
billing_this_year = flt(company_wise_billing_this_year.get(d.company,{}).get("base_grand_total"))
|
||||
else:
|
||||
billing_this_year = flt(company_wise_billing_this_year.get(d.company,{}).get("grand_total"))
|
||||
|
||||
total_unpaid = flt(company_wise_total_unpaid.get(d.company))
|
||||
|
||||
if loyalty_point_details:
|
||||
loyalty_points = loyalty_point_details.get(d.company)
|
||||
|
||||
info = {}
|
||||
info["billing_this_year"] = flt(billing_this_year) if billing_this_year else 0
|
||||
info["currency"] = party_account_currency
|
||||
info["total_unpaid"] = flt(total_unpaid) if total_unpaid else 0
|
||||
info["company"] = d.company
|
||||
|
||||
if party_type == "Customer" and loyalty_point_details:
|
||||
info["loyalty_points"] = loyalty_points
|
||||
|
||||
if party_type == "Supplier":
|
||||
info["total_unpaid"] = -1 * info["total_unpaid"]
|
||||
|
||||
company_wise_info.append(info)
|
||||
|
||||
return company_wise_info
|
||||
|
||||
def get_party_shipping_address(doctype, name):
|
||||
"""
|
||||
@@ -510,7 +563,7 @@ def get_party_shipping_address(doctype, name):
|
||||
'dl.link_doctype=%s '
|
||||
'and dl.link_name=%s '
|
||||
'and dl.parenttype="Address" '
|
||||
'and '
|
||||
'and ifnull(ta.disabled, 0) = 0 and'
|
||||
'(ta.address_type="Shipping" or ta.is_shipping_address=1) '
|
||||
'order by ta.is_shipping_address desc, ta.address_type desc limit 1',
|
||||
(doctype, name)
|
||||
@@ -519,3 +572,18 @@ def get_party_shipping_address(doctype, name):
|
||||
return out[0][0]
|
||||
else:
|
||||
return ''
|
||||
|
||||
def get_partywise_advanced_payment_amount(party_type, posting_date = None):
|
||||
cond = "1=1"
|
||||
if posting_date:
|
||||
cond = "posting_date <= '{0}'".format(posting_date)
|
||||
|
||||
data = frappe.db.sql(""" SELECT party, sum({0}) as amount
|
||||
FROM `tabGL Entry`
|
||||
WHERE
|
||||
party_type = %s and against_voucher is null
|
||||
and {1} GROUP BY party"""
|
||||
.format(("credit") if party_type == "Customer" else "debit", cond) , party_type)
|
||||
|
||||
if data:
|
||||
return frappe._dict(data)
|
||||
@@ -0,0 +1,82 @@
|
||||
{%- from "templates/print_formats/standard_macros.html" import add_header -%}
|
||||
<style>
|
||||
.table-bordered td.top-bottom {border-top: none !important;border-bottom: none !important;}
|
||||
.table-bordered td.right{border-right: none !important;}
|
||||
.table-bordered td.left{border-left: none !important;}
|
||||
|
||||
|
||||
</style>
|
||||
<div class="page-break">
|
||||
{%- if not doc.get("print_heading") and not doc.get("select_print_heading")
|
||||
and doc.set("select_print_heading", _("Payment Entry")) -%}{%- endif -%}
|
||||
{{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
|
||||
<div class="row margin-bottom">
|
||||
<div class="col-sm-6">
|
||||
<table>
|
||||
<tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<table>
|
||||
<tr><td><strong>Date: </strong></td><td>{{ frappe.utils.formatdate(doc.creation) }}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="margin-top">
|
||||
<table class="table table-bordered table-condensed">
|
||||
<tr>
|
||||
<th>Account</th>
|
||||
<th>Party Type</th>
|
||||
<th>Party</th>
|
||||
<th>Amount</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="top-bottom" colspan="5"><strong>Credit</strong></td>
|
||||
</tr>
|
||||
{% set total_credit = 0 -%}
|
||||
{% for entries in doc.gl_entries %}
|
||||
{% if entries.debit == 0.0 %}
|
||||
<tr>
|
||||
<td class="right top-bottom">{{ entries.account }}</td>
|
||||
<td class="right left top-bottom">{{ entries.party_type }}</td>
|
||||
<td class="right left top-bottom">{{ entries.party }}</td>
|
||||
<td class="left top-bottom">{{ entries.credit }}</td>
|
||||
{% set total_credit = total_credit + entries.credit -%}
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="top-bottom" colspan="4"><strong> Narration </strong><br>{{ entries.remarks }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right" colspan="3"><strong>Total (credit) </strong></td>
|
||||
<td class="left" >{{total_credit}}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<tr>
|
||||
<td class="top-bottom" colspan="4"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="top-bottom" colspan="5"><strong>Debit</strong></td>
|
||||
</tr>
|
||||
{% set total_debit = 0 -%}
|
||||
{% for entries in doc.gl_entries %}
|
||||
{% if entries.credit == 0.0 %}
|
||||
<tr>
|
||||
<td class="right top-bottom">{{ entries.account }}</td>
|
||||
<td class="right left top-bottom">{{ entries.party_type }}</td>
|
||||
<td class="right left top-bottom">{{ entries.party }}</td>
|
||||
{% set total_debit = total_debit + entries.debit -%}
|
||||
<td class="left top-bottom">{{ entries.debit }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="top-bottom"colspan="4"><strong> Narration </strong><br>{{ entries.remarks }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right" colspan="3" ><strong>Total (debit) </strong></td>
|
||||
<td class="left" >{{total_debit}}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</table>
|
||||
<div>
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"align_labels_right": 0,
|
||||
"creation": "2019-02-15 11:49:08.608619",
|
||||
"custom_format": 0,
|
||||
"default_print_language": "en",
|
||||
"disabled": 0,
|
||||
"doc_type": "Payment Entry",
|
||||
"docstatus": 0,
|
||||
"doctype": "Print Format",
|
||||
"font": "Default",
|
||||
"idx": 0,
|
||||
"line_breaks": 0,
|
||||
"modified": "2019-02-15 11:49:08.608619",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Bank and Cash Payment Voucher",
|
||||
"owner": "Administrator",
|
||||
"print_format_builder": 0,
|
||||
"print_format_type": "Server",
|
||||
"show_section_headings": 0,
|
||||
"standard": "Yes"
|
||||
}
|
||||
@@ -7,10 +7,10 @@
|
||||
"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{% if doc.docstatus == 0 %}\n\t\t<b>{{ doc.status + \" \"+ (doc.select_print_heading or _(\"Invoice\")) }}</b><br>\n\t{% else %}\n\t\t<b>{{ doc.select_print_heading or _(\"Invoice\") }}</b><br>\n\t{% endif %}\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{% if doc.flags.show_inclusive_tax_in_print %}\n\t\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t\t{{ _(\"Total Excl. Tax\") }}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ doc.get_formatted(\"net_total\", doc) }}\n\t\t\t\t</td>\n\t\t\t{% else %}\n\t\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t\t{{ _(\"Total\") }}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ doc.get_formatted(\"total\", doc) }}\n\t\t\t\t</td>\n\t\t\t{% endif %}\n\t\t</tr>\n\t\t{%- for row in doc.taxes -%}\n\t\t {%- if not row.included_in_print_rate or doc.flags.show_inclusive_tax_in_print -%}\n\t\t\t<tr>\n\t\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t\t{{ row.description }}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ row.get_formatted(\"tax_amount\", doc) }}\n\t\t\t\t</td>\n\t\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\t{%- if doc.rounded_total -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ _(\"Rounded Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"rounded_total\") }}\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>{{ _(\"Paid Amount\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"paid_amount\") }}\n\t\t\t</td>\n\t\t</tr>\n\t{%- if doc.change_amount -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ _(\"Change Amount\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"change_amount\") }}\n\t\t\t</td>\n\t\t</tr>\n\t{%- endif -%}\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>",
|
||||
"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{% if doc.docstatus == 0 %}\n\t\t<b>{{ doc.status + \" \"+ (doc.select_print_heading or _(\"Invoice\")) }}</b><br>\n\t{% else %}\n\t\t<b>{{ doc.select_print_heading or _(\"Invoice\") }}</b><br>\n\t{% endif %}\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{% if doc.flags.show_inclusive_tax_in_print %}\n\t\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t\t{{ _(\"Total Excl. Tax\") }}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ doc.get_formatted(\"net_total\", doc) }}\n\t\t\t\t</td>\n\t\t\t{% else %}\n\t\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t\t{{ _(\"Total\") }}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ doc.get_formatted(\"total\", doc) }}\n\t\t\t\t</td>\n\t\t\t{% endif %}\n\t\t</tr>\n\t\t{%- for row in doc.taxes -%}\n\t\t {%- if (not row.included_in_print_rate or doc.flags.show_inclusive_tax_in_print) and row.tax_amount != 0 -%}\n\t\t\t<tr>\n\t\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t\t{{ row.description }}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ row.get_formatted(\"tax_amount\", doc) }}\n\t\t\t\t</td>\n\t\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\t{%- if doc.rounded_total -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ _(\"Rounded Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"rounded_total\") }}\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>{{ _(\"Paid Amount\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"paid_amount\") }}\n\t\t\t</td>\n\t\t</tr>\n\t{%- if doc.change_amount -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ _(\"Change Amount\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"change_amount\") }}\n\t\t\t</td>\n\t\t</tr>\n\t{%- endif -%}\n\t</tbody>\n</table>\n<p>{{ doc.terms or \"\" }}</p>\n<p class=\"text-center\">{{ _(\"Thank you, please visit again.\") }}</p>",
|
||||
"idx": 0,
|
||||
"line_breaks": 0,
|
||||
"modified": "2018-03-20 14:24:08.167930",
|
||||
"modified": "2019-01-24 17:09:27.190929",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "GST POS Invoice",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,76 @@
|
||||
{%- from "templates/print_formats/standard_macros.html" import add_header -%}
|
||||
<style>
|
||||
.table-bordered td.top-bottom {border-top: none !important;border-bottom: none !important;}
|
||||
.table-bordered td.right{border-right: none !important;}
|
||||
.table-bordered td.left{border-left: none !important;}
|
||||
|
||||
|
||||
</style>
|
||||
<div class="page-break">
|
||||
{%- if not doc.get("print_heading") and not doc.get("select_print_heading")
|
||||
and doc.set("select_print_heading", _("Journal Entry")) -%}{%- endif -%}
|
||||
{{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
|
||||
<div class="row margin-bottom">
|
||||
<div class="col-sm-6">
|
||||
<table>
|
||||
<tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<table>
|
||||
<tr><td><strong>Date: </strong></td><td>{{ frappe.utils.formatdate(doc.creation) }}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="margin-top">
|
||||
<table class="table table-bordered table-condensed">
|
||||
<tr>
|
||||
<th>Account</th>
|
||||
<th>Party Type</th>
|
||||
<th>Party</th>
|
||||
<th>Amount</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="top-bottom" colspan="5"><strong>Credit</strong></td>
|
||||
</tr>
|
||||
{% set total_credit = 0 -%}
|
||||
{% for entries in doc.gl_entries %}
|
||||
{% if entries.debit == 0.0 %}
|
||||
<tr>
|
||||
<td class="right top-bottom">{{ entries.account }}</td>
|
||||
<td class="right left top-bottom">{{ entries.party_type }}</td>
|
||||
<td class="right left top-bottom">{{ entries.party }}</td>
|
||||
<td class="left top-bottom">{{ entries.credit }}</td>
|
||||
{% set total_credit = total_credit + entries.credit -%}
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right" colspan="3"><strong>Total (credit) </strong></td>
|
||||
<td class="left" >{{total_credit}}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<tr>
|
||||
<td class="top-bottom" colspan="4"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="top-bottom" colspan="5"><strong>Debit</strong></td>
|
||||
</tr>
|
||||
{% set total_debit = 0 -%}
|
||||
{% for entries in doc.gl_entries %}
|
||||
{% if entries.credit == 0.0 %}
|
||||
<tr>
|
||||
<td class="right top-bottom">{{ entries.account }}</td>
|
||||
<td class="right left top-bottom">{{ entries.party_type }}</td>
|
||||
<td class="right left top-bottom">{{ entries.party }}</td>
|
||||
{% set total_debit = total_debit + entries.debit -%}
|
||||
<td class="left top-bottom">{{ entries.debit }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="right" colspan="3" ><strong>Total (debit) </strong></td>
|
||||
<td class="left" >{{total_debit}}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</table>
|
||||
<div>
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"align_labels_right": 0,
|
||||
"creation": "2019-02-15 14:13:05.721784",
|
||||
"custom_format": 0,
|
||||
"default_print_language": "en",
|
||||
"disabled": 0,
|
||||
"doc_type": "Journal Entry",
|
||||
"docstatus": 0,
|
||||
"doctype": "Print Format",
|
||||
"font": "Default",
|
||||
"idx": 0,
|
||||
"line_breaks": 0,
|
||||
"modified": "2019-02-15 14:13:05.721784",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Journal Auditing Voucher",
|
||||
"owner": "Administrator",
|
||||
"print_format_builder": 0,
|
||||
"print_format_type": "Server",
|
||||
"show_section_headings": 0,
|
||||
"standard": "Yes"
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
{%- from "templates/print_formats/standard_macros.html" import add_header -%}
|
||||
<div class="page-break">
|
||||
{%- if not doc.get("print_heading") and not doc.get("select_print_heading")
|
||||
and doc.set("select_print_heading", _("Purchase Invoice")) -%}{%- endif -%}
|
||||
{{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
|
||||
<div class="row margin-bottom">
|
||||
<div class="col-sm-6">
|
||||
<table>
|
||||
<tr><td><strong>Supplier Name: </strong></td><td>{{ doc.supplier }}</td></tr>
|
||||
<tr><td><strong>Due Date: </strong></td><td>{{ frappe.utils.formatdate(doc.due_date) }}</td></tr>
|
||||
<tr><td><strong>Address: </strong></td><td>{{doc.address_display}}</td></tr>
|
||||
<tr><td><strong>Contact: </strong></td><td>{{doc.contact_display}}</td></tr>
|
||||
<tr><td><strong>Mobile no: </strong> </td><td>{{doc.contact_mobile}}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<table>
|
||||
<tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
|
||||
<tr><td><strong>Date: </strong></td><td>{{ frappe.utils.formatdate(doc.creation) }}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="margin-top margin-bottom">
|
||||
<table class="table table-bordered table-condensed">
|
||||
<tr>
|
||||
<th>SL</th>
|
||||
<th>Item Code</th>
|
||||
<th>Item Name</th>
|
||||
<th>UOM</th>
|
||||
<th>Received Qty.</th>
|
||||
<th>Rejected Qty</th>
|
||||
<th>Qty</th>
|
||||
<th>Basic Rate</th>
|
||||
<th>Amount</th>
|
||||
</tr>
|
||||
{% for item in doc.items %}
|
||||
<tr>
|
||||
<td>{{ loop.index }}</td>
|
||||
<td>{{ item.item_code }}</td>
|
||||
<td>{{ item.item_name }}</td>
|
||||
<td>{{ item.uom }}</td>
|
||||
<td>{{ item.received_qty }}</td>
|
||||
<td>{{ item.rejected_qty }}</td>
|
||||
<td>{{ item.qty}}</td>
|
||||
<td>{{ item.rate }}</td>
|
||||
<td>{{ item.amount }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
<div class="row margin-bottom">
|
||||
<div class="col-sm-6">
|
||||
<table>
|
||||
<tr><td><strong>Total Quantity: </strong></td><td>{{ doc.total_qty }}</td></tr>
|
||||
<tr><td><strong>Total: </strong></td><td>{{doc.total}}</td></tr>
|
||||
<tr><td><strong>Net Weight: </strong></td><td>{{ doc.total_net_weight }}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<table>
|
||||
<tr><td><strong>Tax and Charges: </strong></td><td>{{doc.taxes_and_charges}}</td></tr>
|
||||
{% for tax in doc.taxes %}
|
||||
<tr><td><strong>{{ tax.account_head }}: </strong></td><td>{{ tax.tax_amount_after_discount_amount }}</td></tr>
|
||||
{% endfor %}
|
||||
<tr><td><strong> Taxes and Charges Added: </strong></td><td>{{ doc.taxes_and_charges_added }}</td></tr>
|
||||
<tr><td><strong> Taxes and Charges Deducted: </strong></td><td>{{ doc.taxes_and_charges_deducted }}</td></tr>
|
||||
<tr><td><strong> Total Taxes and Charges: </strong></td><td>{{ doc.total_taxes_and_charges }}</td></tr>
|
||||
<tr><td><strong> Net Payable: </strong></td><td>{{ doc.grand_total }}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="margin-top">
|
||||
<table class='table table-bordered table-condensed'>
|
||||
<tr>
|
||||
<th>SL</th>
|
||||
<th>Account</th>
|
||||
<th>Party Type</th>
|
||||
<th>Party</th>
|
||||
<th>Credit Amount</th>
|
||||
<th>Debit Amount</th>
|
||||
</tr>
|
||||
{% for entries in doc.gl_entries %}
|
||||
<tr>
|
||||
<td>{{ loop.index }}</td>
|
||||
<td>{{ entries.account }}</td>
|
||||
<td>{{ entries.party_type }}</td>
|
||||
<td>{{ entries.party }}</td>
|
||||
<td>{{ entries.credit }}</td>
|
||||
<td>{{ entries.debit }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr>
|
||||
<td colspan="4"><strong>Total</strong></td>
|
||||
<td>{{ doc.grand_total|flt }}</td>
|
||||
<td>{{ doc.grand_total|flt }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"align_labels_right": 0,
|
||||
"creation": "2019-02-14 14:42:35.151611",
|
||||
"custom_format": 0,
|
||||
"default_print_language": "en",
|
||||
"disabled": 0,
|
||||
"doc_type": "Purchase Invoice",
|
||||
"docstatus": 0,
|
||||
"doctype": "Print Format",
|
||||
"font": "Default",
|
||||
"idx": 0,
|
||||
"line_breaks": 0,
|
||||
"modified": "2019-02-14 14:42:35.151611",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Purchase Auditing Voucher",
|
||||
"owner": "Administrator",
|
||||
"print_format_builder": 0,
|
||||
"print_format_type": "Server",
|
||||
"show_section_headings": 0,
|
||||
"standard": "Yes"
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
{%- from "templates/print_formats/standard_macros.html" import add_header -%}
|
||||
<div class="page-break">
|
||||
{%- if not doc.get("print_heading") and not doc.get("select_print_heading")
|
||||
and doc.set("select_print_heading", _("Sales Invoice")) -%}{%- endif -%}
|
||||
{{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
|
||||
<div class="row margin-bottom">
|
||||
<div class="col-sm-6">
|
||||
<table>
|
||||
<tr><td><strong>Customer Name: </strong></td><td>{{ doc.customer }}</td></tr>
|
||||
<tr><td><strong>Due Date: </strong></td><td>{{ frappe.utils.formatdate(doc.due_date) }}</td></tr>
|
||||
<tr><td><strong>Address: </strong></td><td>{{doc.address_display}}</td></tr>
|
||||
<tr><td><strong>Contact: </strong></td><td>{{doc.contact_display}}</td></tr>
|
||||
<tr><td><strong>Mobile no: </strong> </td><td>{{doc.contact_mobile}}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<table>
|
||||
<tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
|
||||
<tr><td><strong>Date: </strong></td><td>{{ frappe.utils.formatdate(doc.creation) }}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="margin-top margin-bottom">
|
||||
<table class="table table-bordered table-condensed">
|
||||
<tr>
|
||||
<th>SL</th>
|
||||
<th>Item Code</th>
|
||||
<th>Item Name</th>
|
||||
<th>UOM</th>
|
||||
<th>Quantity</th>
|
||||
<th>Basic Rate</th>
|
||||
<th>Amount</th>
|
||||
</tr>
|
||||
{% for item in doc.items %}
|
||||
<tr>
|
||||
<td>{{ loop.index }}</td>
|
||||
<td>{{ item.item_code }}</td>
|
||||
<td>{{ item.item_name }}</td>
|
||||
<td>{{ item.uom }}</td>
|
||||
<td>{{ item.qty}}</td>
|
||||
<td>{{ item.rate }}</td>
|
||||
<td>{{ item.amount }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
<div class="row margin-bottom">
|
||||
<div class="col-sm-6">
|
||||
<table>
|
||||
<tr><td><strong>Total Quantity: </strong></td><td>{{ doc.total_qty }}</td></tr>
|
||||
<tr><td><strong>Total: </strong></td><td>{{doc.total}}</td></tr>
|
||||
<tr><td><strong>Net Weight: </strong></td><td>{{ doc.total_net_weight }}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<table>
|
||||
<tr><td><strong>Tax and Charges: </strong></td><td>{{doc.taxes_and_charges}}</td></tr>
|
||||
{% for tax in doc.taxes %}
|
||||
<tr><td><strong>{{ tax.account_head }}: </strong></td><td>{{ tax.tax_amount_after_discount_amount }}</td></tr>
|
||||
{% endfor %}
|
||||
<tr><td><strong> Total Taxes and Charges: </strong></td><td>{{ doc.total_taxes_and_charges }}</td></tr>
|
||||
<tr><td><strong> Net Payable: </strong></td><td>{{ doc.grand_total }}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="margin-top">
|
||||
<table class='table table-bordered table-condensed'>
|
||||
<tr>
|
||||
<th>SL</th>
|
||||
<th>Account</th>
|
||||
<th>Party Type</th>
|
||||
<th>Party</th>
|
||||
<th>Credit Amount</th>
|
||||
<th>Debit Amount</th>
|
||||
</tr>
|
||||
{% for entries in doc.gl_entries %}
|
||||
<tr>
|
||||
<td>{{ loop.index }}</td>
|
||||
<td>{{ entries.account }}</td>
|
||||
<td>{{ entries.party_type }}</td>
|
||||
<td>{{ entries.party }}</td>
|
||||
<td>{{ entries.credit }}</td>
|
||||
<td>{{ entries.debit }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr>
|
||||
<td colspan="4"><strong>Total</strong></td>
|
||||
<td>{{ doc.grand_total|flt }}</td>
|
||||
<td>{{ doc.grand_total|flt }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"align_labels_right": 0,
|
||||
"creation": "2019-02-15 15:02:51.454754",
|
||||
"custom_format": 0,
|
||||
"default_print_language": "en",
|
||||
"disabled": 0,
|
||||
"doc_type": "Sales Invoice",
|
||||
"docstatus": 0,
|
||||
"doctype": "Print Format",
|
||||
"font": "Default",
|
||||
"idx": 0,
|
||||
"line_breaks": 0,
|
||||
"modified": "2019-02-15 15:02:51.454754",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Sales Auditing Voucher",
|
||||
"owner": "Administrator",
|
||||
"print_format_builder": 0,
|
||||
"print_format_type": "Server",
|
||||
"show_section_headings": 0,
|
||||
"standard": "Yes"
|
||||
}
|
||||
@@ -10,36 +10,6 @@ frappe.query_reports["Accounts Payable"] = {
|
||||
"options": "Company",
|
||||
"default": frappe.defaults.get_user_default("Company")
|
||||
},
|
||||
{
|
||||
"fieldname":"finance_book",
|
||||
"label": __("Finance Book"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Finance Book"
|
||||
},
|
||||
{
|
||||
"fieldname":"supplier",
|
||||
"label": __("Supplier"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Supplier",
|
||||
on_change: () => {
|
||||
var supplier = frappe.query_report.get_filter_value('supplier');
|
||||
frappe.db.get_value('Supplier', supplier, "tax_id", function(value) {
|
||||
frappe.query_report.set_filter_value('tax_id', value["tax_id"]);
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
"fieldname":"supplier_group",
|
||||
"label": __("Supplier Group"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Supplier Group"
|
||||
},
|
||||
{
|
||||
"fieldname":"report_date",
|
||||
"label": __("As on Date"),
|
||||
"fieldtype": "Date",
|
||||
"default": frappe.datetime.get_today()
|
||||
},
|
||||
{
|
||||
"fieldname":"ageing_based_on",
|
||||
"label": __("Ageing Based On"),
|
||||
@@ -48,7 +18,10 @@ frappe.query_reports["Accounts Payable"] = {
|
||||
"default": "Posting Date"
|
||||
},
|
||||
{
|
||||
"fieldtype": "Break",
|
||||
"fieldname":"report_date",
|
||||
"label": __("As on Date"),
|
||||
"fieldtype": "Date",
|
||||
"default": frappe.datetime.get_today()
|
||||
},
|
||||
{
|
||||
"fieldname":"range1",
|
||||
@@ -71,6 +44,34 @@ frappe.query_reports["Accounts Payable"] = {
|
||||
"default": "90",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname":"finance_book",
|
||||
"label": __("Finance Book"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Finance Book"
|
||||
},
|
||||
{
|
||||
"fieldname":"supplier",
|
||||
"label": __("Supplier"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Supplier",
|
||||
on_change: () => {
|
||||
var supplier = frappe.query_report.get_filter_value('supplier');
|
||||
if (supplier) {
|
||||
frappe.db.get_value('Supplier', supplier, "tax_id", function(value) {
|
||||
frappe.query_report.set_filter_value('tax_id', value["tax_id"]);
|
||||
});
|
||||
} else {
|
||||
frappe.query_report.set_filter_value('tax_id', "");
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"fieldname":"supplier_group",
|
||||
"label": __("Supplier Group"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Supplier Group"
|
||||
},
|
||||
{
|
||||
"fieldname":"tax_id",
|
||||
"label": __("Tax Id"),
|
||||
|
||||
@@ -10,24 +10,6 @@ frappe.query_reports["Accounts Payable Summary"] = {
|
||||
"options": "Company",
|
||||
"default": frappe.defaults.get_user_default("Company")
|
||||
},
|
||||
{
|
||||
"fieldname":"supplier",
|
||||
"label": __("Supplier"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Supplier"
|
||||
},
|
||||
{
|
||||
"fieldname":"supplier_group",
|
||||
"label": __("Supplier Group"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Supplier Group"
|
||||
},
|
||||
{
|
||||
"fieldname":"report_date",
|
||||
"label": __("Date"),
|
||||
"fieldtype": "Date",
|
||||
"default": frappe.datetime.get_today()
|
||||
},
|
||||
{
|
||||
"fieldname":"ageing_based_on",
|
||||
"label": __("Ageing Based On"),
|
||||
@@ -36,7 +18,10 @@ frappe.query_reports["Accounts Payable Summary"] = {
|
||||
"default": "Posting Date"
|
||||
},
|
||||
{
|
||||
"fieldtype": "Break",
|
||||
"fieldname":"report_date",
|
||||
"label": __("Date"),
|
||||
"fieldtype": "Date",
|
||||
"default": frappe.datetime.get_today()
|
||||
},
|
||||
{
|
||||
"fieldname":"range1",
|
||||
@@ -58,6 +43,24 @@ frappe.query_reports["Accounts Payable Summary"] = {
|
||||
"fieldtype": "Int",
|
||||
"default": "90",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname":"finance_book",
|
||||
"label": __("Finance Book"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Finance Book"
|
||||
},
|
||||
{
|
||||
"fieldname":"supplier",
|
||||
"label": __("Supplier"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Supplier"
|
||||
},
|
||||
{
|
||||
"fieldname":"supplier_group",
|
||||
"label": __("Supplier Group"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Supplier Group"
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
@@ -1,24 +1,14 @@
|
||||
{% if(filters.show_pdc_in_print) { %}
|
||||
<style>
|
||||
@media screen {
|
||||
.print-format {
|
||||
padding: 4mm;
|
||||
font-size: 8.0pt !important;
|
||||
font-family: Tahoma, sans-serif;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
{% } %}
|
||||
<style>
|
||||
.print-format {
|
||||
padding: 4mm;
|
||||
font-size: 8.0pt !important;
|
||||
font-family: Tahoma, sans-serif;
|
||||
}
|
||||
.print-format {
|
||||
padding: 4mm;
|
||||
font-size: 8.0pt !important;
|
||||
}
|
||||
.print-format td {
|
||||
vertical-align:middle !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<h2 class="text-center">{%= __(report.report_name) %}</h2>
|
||||
<h2 class="text-center" style="margin-top:0">{%= __(report.report_name) %}</h2>
|
||||
<h4 class="text-center">
|
||||
{% if (filters.customer_name) { %}
|
||||
{%= filters.customer_name %}
|
||||
@@ -36,7 +26,20 @@
|
||||
{%= __("Until") %}
|
||||
{%= frappe.datetime.str_to_user(filters.report_date) %}
|
||||
</h5>
|
||||
<hr>
|
||||
|
||||
<div class="clearfix">
|
||||
<div class="pull-left">
|
||||
{% if(filters.payment_terms) { %}
|
||||
<strong>{%= __("Payment Terms") %}:</strong> {%= filters.payment_terms %}
|
||||
{% } %}
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
{% if(filters.credit_limit) { %}
|
||||
<strong>{%= __("Credit Limit") %}:</strong> {%= format_currency(filters.credit_limit) %}
|
||||
{% } %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if(filters.show_pdc_in_print) { %}
|
||||
{% var balance_row = data.slice(-1).pop();
|
||||
var range1 = report.columns[11].label;
|
||||
@@ -104,17 +107,21 @@
|
||||
<thead>
|
||||
<tr>
|
||||
{% if(report.report_name === "Accounts Receivable" || report.report_name === "Accounts Payable") { %}
|
||||
<th style="width: 18%">{%= __("Date") %}</th>
|
||||
<th style="width: 17%">{%= __("Reference") %}</th>
|
||||
<th style="width: 7%">{%= __("Date") %}</th>
|
||||
<th style="width: 7%">{%= __("Age (Days)") %}</th>
|
||||
<th style="width: 13%">{%= __("Reference") %}</th>
|
||||
{% if(report.report_name === "Accounts Receivable") { %}
|
||||
<th style="width: 10%">{%= __("Sales Person") %}</th>
|
||||
{% } %}
|
||||
{% if(!filters.show_pdc_in_print) { %}
|
||||
<th style="width: 20%">{%= (filters.customer || filters.supplier) ? __("Remarks"): __("Party") %}</th>
|
||||
{% } %}
|
||||
<th style="width: 10%">{%= __("Invoiced Amount") %}</th>
|
||||
<th style="width: 10%; text-align: right">{%= __("Invoiced Amount") %}</th>
|
||||
{% if(!filters.show_pdc_in_print) { %}
|
||||
<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%; text-align: right">{%= __("Paid Amount") %}</th>
|
||||
<th style="width: 10%; text-align: right">{%= report.report_name === "Accounts Receivable" ? __('Credit Note') : __('Debit Note') %}</th>
|
||||
{% } %}
|
||||
<th style="width: 15%">{%= __("Outstanding Amount") %}</th>
|
||||
<th style="width: 15%; text-align: right">{%= __("Outstanding Amount") %}</th>
|
||||
{% if(filters.show_pdc_in_print) { %}
|
||||
{% if(report.report_name === "Accounts Receivable") { %}
|
||||
<th style="width: 10%">{%= __("Customer LPO No.") %}</th>
|
||||
@@ -139,6 +146,7 @@
|
||||
{% if(report.report_name === "Accounts Receivable" || report.report_name === "Accounts Payable") { %}
|
||||
{% if(data[i][__("Customer")] || data[i][__("Supplier")]) { %}
|
||||
<td>{%= frappe.datetime.str_to_user(data[i]["posting_date"]) %}</td>
|
||||
<td style="text-align: right">{%= data[i][__("Age (Days)")] %}</td>
|
||||
<td>
|
||||
{% if(!filters.show_pdc_in_print) { %}
|
||||
{%= data[i]["voucher_type"] %}
|
||||
@@ -146,6 +154,11 @@
|
||||
{% } %}
|
||||
{%= data[i]["voucher_no"] %}
|
||||
</td>
|
||||
|
||||
{% if(report.report_name === "Accounts Receivable") { %}
|
||||
<td>{%= data[i]["sales_person"] %}</td>
|
||||
{% } %}
|
||||
|
||||
{% if(!filters.show_pdc_in_print) { %}
|
||||
<td>
|
||||
{% if(!(filters.customer || filters.supplier)) { %}
|
||||
@@ -156,10 +169,15 @@
|
||||
<br> {%= data[i][__("Supplier Name")] %}
|
||||
{% } %}
|
||||
{% } %}
|
||||
<br>{%= __("Remarks") %}:
|
||||
{%= data[i][__("Remarks")] %}
|
||||
<div>
|
||||
{% if data[i][__("Remarks")] %}
|
||||
{%= __("Remarks") %}:
|
||||
{%= data[i][__("Remarks")] %}
|
||||
{% } %}
|
||||
</div>
|
||||
</td>
|
||||
{% } %}
|
||||
|
||||
<td style="text-align: right">
|
||||
{%= format_currency(data[i]["invoiced_amount"], data[i]["currency"]) %}</td>
|
||||
|
||||
@@ -187,14 +205,18 @@
|
||||
{% if(!filters.show_pdc_in_print) { %}
|
||||
<td></td>
|
||||
{% } %}
|
||||
<td><b>{%= __("Total") %}</b></td>
|
||||
{% if(report.report_name === "Accounts Receivable") { %}
|
||||
<td></td>
|
||||
{% } %}
|
||||
<td></td>
|
||||
<td style="text-align: right"><b>{%= __("Total") %}</b></td>
|
||||
<td style="text-align: right">
|
||||
{%= format_currency(data[i]["invoiced_amount"], data[i]["currency"] ) %}</td>
|
||||
|
||||
{% if(!filters.show_pdc_in_print) { %}
|
||||
<td style="text-align: right">
|
||||
{%= format_currency(data[i]["paid_amount"], data[i]["currency"]) %}</td>
|
||||
<td style="text-align: right">{%= report.report_name === "Accounts Receivable" ? format_currency(data[i]["credit_note"], data[i]["currency"]) : format_currency(data[i]["Debit Note"], data[i]["currency"]) %} </td>
|
||||
<td style="text-align: right">{%= report.report_name === "Accounts Receivable" ? format_currency(data[i]["credit_note"], data[i]["currency"]) : format_currency(data[i]["debit_note"], data[i]["currency"]) %} </td>
|
||||
{% } %}
|
||||
<td style="text-align: right">
|
||||
{%= format_currency(data[i]["outstanding_amount"], data[i]["currency"]) %}</td>
|
||||
|
||||
@@ -10,6 +10,40 @@ frappe.query_reports["Accounts Receivable"] = {
|
||||
"options": "Company",
|
||||
"default": frappe.defaults.get_user_default("Company")
|
||||
},
|
||||
{
|
||||
"fieldname":"ageing_based_on",
|
||||
"label": __("Ageing Based On"),
|
||||
"fieldtype": "Select",
|
||||
"options": 'Posting Date\nDue Date',
|
||||
"default": "Posting Date"
|
||||
},
|
||||
{
|
||||
"fieldname":"report_date",
|
||||
"label": __("As on Date"),
|
||||
"fieldtype": "Date",
|
||||
"default": frappe.datetime.get_today()
|
||||
},
|
||||
{
|
||||
"fieldname":"range1",
|
||||
"label": __("Ageing Range 1"),
|
||||
"fieldtype": "Int",
|
||||
"default": "30",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname":"range2",
|
||||
"label": __("Ageing Range 2"),
|
||||
"fieldtype": "Int",
|
||||
"default": "60",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname":"range3",
|
||||
"label": __("Ageing Range 3"),
|
||||
"fieldtype": "Int",
|
||||
"default": "90",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname":"finance_book",
|
||||
"label": __("Finance Book"),
|
||||
@@ -23,10 +57,19 @@ frappe.query_reports["Accounts Receivable"] = {
|
||||
"options": "Customer",
|
||||
on_change: () => {
|
||||
var customer = frappe.query_report.get_filter_value('customer');
|
||||
frappe.db.get_value('Customer', customer, ["tax_id", "customer_name"], function(value) {
|
||||
frappe.query_report.set_filter_value('tax_id', value["tax_id"]);
|
||||
frappe.query_report.set_filter_value('customer_name', value["customer_name"]);
|
||||
});
|
||||
if (customer) {
|
||||
frappe.db.get_value('Customer', customer, ["tax_id", "customer_name", "credit_limit", "payment_terms"], function(value) {
|
||||
frappe.query_report.set_filter_value('tax_id', value["tax_id"]);
|
||||
frappe.query_report.set_filter_value('customer_name', value["customer_name"]);
|
||||
frappe.query_report.set_filter_value('credit_limit', value["credit_limit"]);
|
||||
frappe.query_report.set_filter_value('payment_terms', value["payment_terms"]);
|
||||
});
|
||||
} else {
|
||||
frappe.query_report.set_filter_value('tax_id', "");
|
||||
frappe.query_report.set_filter_value('customer_name', "");
|
||||
frappe.query_report.set_filter_value('credit_limit', "");
|
||||
frappe.query_report.set_filter_value('payment_terms', "");
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -59,48 +102,16 @@ frappe.query_reports["Accounts Receivable"] = {
|
||||
"fieldtype": "Link",
|
||||
"options": "Sales Person"
|
||||
},
|
||||
{
|
||||
"fieldtype": "Break",
|
||||
},
|
||||
{
|
||||
"fieldname":"report_date",
|
||||
"label": __("As on Date"),
|
||||
"fieldtype": "Date",
|
||||
"default": frappe.datetime.get_today()
|
||||
},
|
||||
{
|
||||
"fieldname":"ageing_based_on",
|
||||
"label": __("Ageing Based On"),
|
||||
"fieldtype": "Select",
|
||||
"options": 'Posting Date\nDue Date',
|
||||
"default": "Posting Date"
|
||||
},
|
||||
{
|
||||
"fieldname":"range1",
|
||||
"label": __("Ageing Range 1"),
|
||||
"fieldtype": "Int",
|
||||
"default": "30",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname":"range2",
|
||||
"label": __("Ageing Range 2"),
|
||||
"fieldtype": "Int",
|
||||
"default": "60",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname":"range3",
|
||||
"label": __("Ageing Range 3"),
|
||||
"fieldtype": "Int",
|
||||
"default": "90",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname":"show_pdc_in_print",
|
||||
"label": __("Show PDC in Print"),
|
||||
"fieldtype": "Check",
|
||||
},
|
||||
{
|
||||
"fieldname":"based_on_payment_terms",
|
||||
"label": __("Based On Payment Terms"),
|
||||
"fieldtype": "Check",
|
||||
},
|
||||
{
|
||||
"fieldname":"tax_id",
|
||||
"label": __("Tax Id"),
|
||||
@@ -112,6 +123,18 @@ frappe.query_reports["Accounts Receivable"] = {
|
||||
"label": __("Customer Name"),
|
||||
"fieldtype": "Data",
|
||||
"hidden": 1
|
||||
},
|
||||
{
|
||||
"fieldname":"payment_terms",
|
||||
"label": __("Payment Tems"),
|
||||
"fieldtype": "Data",
|
||||
"hidden": 1
|
||||
},
|
||||
{
|
||||
"fieldname":"credit_limit",
|
||||
"label": __("Credit Limit"),
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 1
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe, erpnext
|
||||
from frappe import _, scrub
|
||||
from frappe.utils import getdate, nowdate, flt, cint
|
||||
from frappe.utils import getdate, nowdate, flt, cint, formatdate, cstr
|
||||
|
||||
class ReceivablePayableReport(object):
|
||||
def __init__(self, filters=None):
|
||||
@@ -32,6 +32,15 @@ class ReceivablePayableReport(object):
|
||||
|
||||
columns += [_(args.get("party_type")) + ":Link/" + args.get("party_type") + ":200"]
|
||||
|
||||
if args.get("party_type") == 'Customer':
|
||||
columns.append({
|
||||
"label": _("Customer Contact"),
|
||||
"fieldtype": "Link",
|
||||
"fieldname": "contact",
|
||||
"options":"Contact",
|
||||
"width": 100
|
||||
})
|
||||
|
||||
if party_naming_by == "Naming Series":
|
||||
columns += [args.get("party_type") + " Name::110"]
|
||||
|
||||
@@ -57,6 +66,21 @@ class ReceivablePayableReport(object):
|
||||
|
||||
credit_or_debit_note = "Credit Note" if args.get("party_type") == "Customer" else "Debit Note"
|
||||
|
||||
if self.filters.based_on_payment_terms:
|
||||
columns.append({
|
||||
"label": "Payment Term",
|
||||
"fieldname": "payment_term",
|
||||
"fieldtype": "Data",
|
||||
"width": 120
|
||||
})
|
||||
columns.append({
|
||||
"label": "Invoice Grand Total",
|
||||
"fieldname": "invoice_grand_total",
|
||||
"fieldtype": "Currency",
|
||||
"options": "currency",
|
||||
"width": 120
|
||||
})
|
||||
|
||||
for label in ("Invoiced Amount", "Paid Amount", credit_or_debit_note, "Outstanding Amount"):
|
||||
columns.append({
|
||||
"label": label,
|
||||
@@ -97,12 +121,6 @@ class ReceivablePayableReport(object):
|
||||
"options": "Currency",
|
||||
"width": 100
|
||||
},
|
||||
{
|
||||
"fieldname": "pdc/lc_date",
|
||||
"label": _("PDC/LC Date"),
|
||||
"fieldtype": "Date",
|
||||
"width": 110
|
||||
},
|
||||
{
|
||||
"fieldname": "pdc/lc_ref",
|
||||
"label": _("PDC/LC Ref"),
|
||||
@@ -113,29 +131,34 @@ class ReceivablePayableReport(object):
|
||||
"fieldname": "pdc/lc_amount",
|
||||
"label": _("PDC/LC Amount"),
|
||||
"fieldtype": "Currency",
|
||||
"options": "Currency",
|
||||
"options": "currency",
|
||||
"width": 130
|
||||
},
|
||||
{
|
||||
"fieldname": "remaining_balance",
|
||||
"label": _("Remaining Balance"),
|
||||
"fieldtype": "Currency",
|
||||
"options": "Currency",
|
||||
"options": "currency",
|
||||
"width": 130
|
||||
}]
|
||||
|
||||
if args.get('party_type') == 'Customer':
|
||||
columns.append({
|
||||
"label": _("Customer LPO"),
|
||||
"fieldtype": "Data",
|
||||
"fieldname": "po_no",
|
||||
"width": 100,
|
||||
})
|
||||
columns += [_("Delivery Note") + ":Data:100"]
|
||||
if args.get("party_type") == "Customer":
|
||||
columns += [
|
||||
{
|
||||
"label": _("Customer LPO"),
|
||||
"fieldtype": "Data",
|
||||
"fieldname": "po_no",
|
||||
"width": 100,
|
||||
},
|
||||
_("Delivery Note") + ":Data:100",
|
||||
_("Territory") + ":Link/Territory:80",
|
||||
_("Customer Group") + ":Link/Customer Group:120"
|
||||
_("Customer Group") + ":Link/Customer Group:120",
|
||||
{
|
||||
"label": _("Sales Person"),
|
||||
"fieldtype": "Data",
|
||||
"fieldname": "sales_person",
|
||||
"width": 120,
|
||||
}
|
||||
]
|
||||
if args.get("party_type") == "Supplier":
|
||||
columns += [_("Supplier Group") + ":Link/Supplier Group:80"]
|
||||
@@ -146,107 +169,206 @@ class ReceivablePayableReport(object):
|
||||
|
||||
def get_data(self, party_naming_by, args):
|
||||
from erpnext.accounts.utils import get_currency_precision
|
||||
currency_precision = get_currency_precision() or 2
|
||||
dr_or_cr = "debit" if args.get("party_type") == "Customer" else "credit"
|
||||
self.currency_precision = get_currency_precision() or 2
|
||||
self.dr_or_cr = "debit" if args.get("party_type") == "Customer" else "credit"
|
||||
|
||||
future_vouchers = self.get_entries_after(self.filters.report_date, args.get("party_type"))
|
||||
|
||||
if not self.filters.get("company"):
|
||||
self.filters["company"] = frappe.db.get_single_value('Global Defaults', 'default_company')
|
||||
|
||||
company_currency = frappe.get_cached_value('Company', self.filters.get("company"), "default_currency")
|
||||
self.company_currency = frappe.get_cached_value('Company', self.filters.get("company"), "default_currency")
|
||||
|
||||
return_entries = self.get_return_entries(args.get("party_type"))
|
||||
|
||||
data = []
|
||||
pdc_details = get_pdc_details(args.get("party_type"), self.filters.report_date)
|
||||
self.pdc_details = get_pdc_details(args.get("party_type"), self.filters.report_date)
|
||||
gl_entries_data = self.get_entries_till(self.filters.report_date, args.get("party_type"))
|
||||
|
||||
if gl_entries_data:
|
||||
voucher_nos = [d.voucher_no for d in gl_entries_data] or []
|
||||
dn_details = get_dn_details(args.get("party_type"), voucher_nos)
|
||||
voucher_details = get_voucher_details(args.get("party_type"), voucher_nos, dn_details)
|
||||
self.voucher_details = get_voucher_details(args.get("party_type"), voucher_nos, dn_details)
|
||||
|
||||
if self.filters.based_on_payment_terms and gl_entries_data:
|
||||
self.payment_term_map = self.get_payment_term_detail(voucher_nos)
|
||||
|
||||
for gle in gl_entries_data:
|
||||
if self.is_receivable_or_payable(gle, dr_or_cr, future_vouchers):
|
||||
outstanding_amount, credit_note_amount = self.get_outstanding_amount(gle,
|
||||
self.filters.report_date, dr_or_cr, return_entries, currency_precision)
|
||||
if abs(outstanding_amount) > 0.1/10**currency_precision:
|
||||
row = [gle.posting_date, gle.party]
|
||||
if self.is_receivable_or_payable(gle, self.dr_or_cr, future_vouchers):
|
||||
outstanding_amount, credit_note_amount, payment_amount = self.get_outstanding_amount(
|
||||
gle,self.filters.report_date, self.dr_or_cr, return_entries)
|
||||
|
||||
# customer / supplier name
|
||||
if party_naming_by == "Naming Series":
|
||||
row += [self.get_party_name(gle.party_type, gle.party)]
|
||||
temp_outstanding_amt = outstanding_amount
|
||||
temp_credit_note_amt = credit_note_amount
|
||||
|
||||
# get due date
|
||||
due_date = voucher_details.get(gle.voucher_no, {}).get("due_date", "")
|
||||
bill_date = voucher_details.get(gle.voucher_no, {}).get("bill_date", "")
|
||||
if abs(outstanding_amount) > 0.1/10**self.currency_precision:
|
||||
if self.filters.based_on_payment_terms and self.payment_term_map.get(gle.voucher_no):
|
||||
for d in self.payment_term_map.get(gle.voucher_no):
|
||||
# Allocate payment amount based on payment terms(FIFO order)
|
||||
payment_amount, d.payment_amount = self.allocate_based_on_fifo(payment_amount, d.payment_term_amount)
|
||||
|
||||
row += [gle.voucher_type, gle.voucher_no, due_date]
|
||||
term_outstanding_amount = d.payment_term_amount - d.payment_amount
|
||||
|
||||
# get supplier bill details
|
||||
if args.get("party_type") == "Supplier":
|
||||
row += [
|
||||
voucher_details.get(gle.voucher_no, {}).get("bill_no", ""),
|
||||
voucher_details.get(gle.voucher_no, {}).get("bill_date", "")
|
||||
]
|
||||
# Allocate credit note based on payment terms(FIFO order)
|
||||
credit_note_amount, d.credit_note_amount = self.allocate_based_on_fifo(credit_note_amount, term_outstanding_amount)
|
||||
|
||||
# invoiced and paid amounts
|
||||
invoiced_amount = gle.get(dr_or_cr) if (gle.get(dr_or_cr) > 0) else 0
|
||||
paid_amt = invoiced_amount - outstanding_amount - credit_note_amount
|
||||
row += [invoiced_amount, paid_amt, credit_note_amount, outstanding_amount]
|
||||
term_outstanding_amount -= d.credit_note_amount
|
||||
|
||||
row_outstanding = term_outstanding_amount
|
||||
# Allocate PDC based on payment terms(FIFO order)
|
||||
d.pdc_details, d.pdc_amount = self.allocate_pdc_amount_in_fifo(gle, row_outstanding)
|
||||
|
||||
if term_outstanding_amount > 0:
|
||||
row = self.prepare_row(party_naming_by, args, gle, term_outstanding_amount,
|
||||
d.credit_note_amount, d.due_date, d.payment_amount , d.payment_term_amount,
|
||||
d.description, d.pdc_amount, d.pdc_details)
|
||||
data.append(row)
|
||||
|
||||
if credit_note_amount:
|
||||
row = self.prepare_row_without_payment_terms(party_naming_by, args, gle, temp_outstanding_amt,
|
||||
temp_credit_note_amt)
|
||||
data.append(row)
|
||||
|
||||
# ageing data
|
||||
if self.filters.ageing_based_on == "Due Date":
|
||||
entry_date = due_date
|
||||
elif self.filters.ageing_based_on == "Supplier Invoice Date":
|
||||
entry_date = bill_date
|
||||
else:
|
||||
entry_date = gle.posting_date
|
||||
|
||||
row += get_ageing_data(cint(self.filters.range1), cint(self.filters.range2),
|
||||
cint(self.filters.range3), self.age_as_on, entry_date, outstanding_amount)
|
||||
|
||||
|
||||
# issue 6371-Ageing buckets should not have amounts if due date is not reached
|
||||
if self.filters.ageing_based_on == "Due Date" \
|
||||
and getdate(due_date) > getdate(self.filters.report_date):
|
||||
row[-1]=row[-2]=row[-3]=row[-4]=0
|
||||
|
||||
if self.filters.ageing_based_on == "Supplier Invoice Date" \
|
||||
and getdate(bill_date) > getdate(self.filters.report_date):
|
||||
|
||||
row[-1]=row[-2]=row[-3]=row[-4]=0
|
||||
|
||||
if self.filters.get(scrub(args.get("party_type"))):
|
||||
row.append(gle.account_currency)
|
||||
else:
|
||||
row.append(company_currency)
|
||||
|
||||
pdc = pdc_details.get((gle.voucher_no, gle.party), {})
|
||||
|
||||
remaining_balance = outstanding_amount - flt(pdc.get("pdc_amount"))
|
||||
row += [pdc.get("pdc_date"), pdc.get("pdc_ref"),
|
||||
flt(pdc.get("pdc_amount")), remaining_balance]
|
||||
|
||||
if args.get('party_type') == 'Customer':
|
||||
# customer LPO
|
||||
row += [voucher_details.get(gle.voucher_no, {}).get("po_no")]
|
||||
|
||||
# Delivery Note
|
||||
row += [voucher_details.get(gle.voucher_no, {}).get("delivery_note")]
|
||||
|
||||
# customer territory / supplier group
|
||||
if args.get("party_type") == "Customer":
|
||||
row += [self.get_territory(gle.party), self.get_customer_group(gle.party)]
|
||||
if args.get("party_type") == "Supplier":
|
||||
row += [self.get_supplier_group(gle.party)]
|
||||
|
||||
row.append(gle.remarks)
|
||||
data.append(row)
|
||||
|
||||
row = self.prepare_row_without_payment_terms(party_naming_by, args, gle, outstanding_amount,
|
||||
credit_note_amount)
|
||||
data.append(row)
|
||||
return data
|
||||
|
||||
def allocate_pdc_amount_in_fifo(self, gle, row_outstanding):
|
||||
pdc_list = self.pdc_details.get((gle.voucher_no, gle.party), [])
|
||||
|
||||
pdc_details = []
|
||||
pdc_amount = 0
|
||||
for pdc in pdc_list:
|
||||
if row_outstanding <= pdc.pdc_amount:
|
||||
pdc_amount += row_outstanding
|
||||
pdc.pdc_amount -= row_outstanding
|
||||
if row_outstanding and pdc.pdc_ref and pdc.pdc_date:
|
||||
pdc_details.append(cstr(pdc.pdc_ref) + "/" + formatdate(pdc.pdc_date))
|
||||
row_outstanding = 0
|
||||
|
||||
else:
|
||||
pdc_amount = pdc.pdc_amount
|
||||
if pdc.pdc_amount and pdc.pdc_ref and pdc.pdc_date:
|
||||
pdc_details.append(cstr(pdc.pdc_ref) + "/" + formatdate(pdc.pdc_date))
|
||||
pdc.pdc_amount = 0
|
||||
row_outstanding -= pdc_amount
|
||||
|
||||
return pdc_details, pdc_amount
|
||||
|
||||
def prepare_row_without_payment_terms(self, party_naming_by, args, gle, outstanding_amount, credit_note_amount):
|
||||
pdc_list = self.pdc_details.get((gle.voucher_no, gle.party), [])
|
||||
pdc_amount = 0
|
||||
pdc_details = []
|
||||
for d in pdc_list:
|
||||
pdc_amount += flt(d.pdc_amount)
|
||||
if pdc_amount and d.pdc_ref and d.pdc_date:
|
||||
pdc_details.append(cstr(d.pdc_ref) + "/" + formatdate(d.pdc_date))
|
||||
|
||||
row = self.prepare_row(party_naming_by, args, gle, outstanding_amount,
|
||||
credit_note_amount, pdc_amount=pdc_amount, pdc_details=pdc_details)
|
||||
|
||||
return row
|
||||
|
||||
|
||||
def allocate_based_on_fifo(self, total_amount, row_amount):
|
||||
allocated_amount = 0
|
||||
if row_amount <= total_amount:
|
||||
allocated_amount = row_amount
|
||||
total_amount -= row_amount
|
||||
else:
|
||||
allocated_amount = total_amount
|
||||
total_amount = 0
|
||||
|
||||
return total_amount, allocated_amount
|
||||
|
||||
def prepare_row(self, party_naming_by, args, gle, outstanding_amount, credit_note_amount,
|
||||
due_date=None, paid_amt=None, payment_term_amount=None, payment_term=None, pdc_amount=None, pdc_details=None):
|
||||
row = [gle.posting_date, gle.party]
|
||||
|
||||
# customer / supplier name
|
||||
if party_naming_by == "Naming Series":
|
||||
row += [self.get_party_name(gle.party_type, gle.party)]
|
||||
|
||||
if args.get("party_type") == 'Customer':
|
||||
row += [self.get_customer_contact(gle.party_type, gle.party)]
|
||||
|
||||
# get due date
|
||||
if not due_date:
|
||||
due_date = self.voucher_details.get(gle.voucher_no, {}).get("due_date", "")
|
||||
bill_date = self.voucher_details.get(gle.voucher_no, {}).get("bill_date", "")
|
||||
|
||||
row += [gle.voucher_type, gle.voucher_no, due_date]
|
||||
|
||||
# get supplier bill details
|
||||
if args.get("party_type") == "Supplier":
|
||||
row += [
|
||||
self.voucher_details.get(gle.voucher_no, {}).get("bill_no", ""),
|
||||
self.voucher_details.get(gle.voucher_no, {}).get("bill_date", "")
|
||||
]
|
||||
|
||||
# invoiced and paid amounts
|
||||
invoiced_amount = gle.get(self.dr_or_cr) if (gle.get(self.dr_or_cr) > 0) else 0
|
||||
|
||||
if self.filters.based_on_payment_terms:
|
||||
row+=[payment_term, invoiced_amount]
|
||||
if payment_term_amount:
|
||||
invoiced_amount = payment_term_amount
|
||||
|
||||
if not payment_term_amount:
|
||||
paid_amt = invoiced_amount - outstanding_amount - credit_note_amount
|
||||
row += [invoiced_amount, paid_amt, credit_note_amount, outstanding_amount]
|
||||
|
||||
# ageing data
|
||||
if self.filters.ageing_based_on == "Due Date":
|
||||
entry_date = due_date
|
||||
elif self.filters.ageing_based_on == "Supplier Invoice Date":
|
||||
entry_date = bill_date
|
||||
else:
|
||||
entry_date = gle.posting_date
|
||||
|
||||
row += get_ageing_data(cint(self.filters.range1), cint(self.filters.range2),
|
||||
cint(self.filters.range3), self.age_as_on, entry_date, outstanding_amount)
|
||||
|
||||
|
||||
# issue 6371-Ageing buckets should not have amounts if due date is not reached
|
||||
if self.filters.ageing_based_on == "Due Date" \
|
||||
and getdate(due_date) > getdate(self.filters.report_date):
|
||||
row[-1]=row[-2]=row[-3]=row[-4]=0
|
||||
|
||||
if self.filters.ageing_based_on == "Supplier Invoice Date" \
|
||||
and getdate(bill_date) > getdate(self.filters.report_date):
|
||||
|
||||
row[-1]=row[-2]=row[-3]=row[-4]=0
|
||||
|
||||
if self.filters.get(scrub(args.get("party_type"))):
|
||||
row.append(gle.account_currency)
|
||||
else:
|
||||
row.append(self.company_currency)
|
||||
|
||||
remaining_balance = outstanding_amount - flt(pdc_amount)
|
||||
pdc_details = ", ".join(pdc_details)
|
||||
row += [pdc_details, pdc_amount, remaining_balance]
|
||||
|
||||
if args.get('party_type') == 'Customer':
|
||||
# customer LPO
|
||||
row += [self.voucher_details.get(gle.voucher_no, {}).get("po_no")]
|
||||
|
||||
# Delivery Note
|
||||
row += [self.voucher_details.get(gle.voucher_no, {}).get("delivery_note")]
|
||||
|
||||
# customer territory / supplier group
|
||||
if args.get("party_type") == "Customer":
|
||||
row += [self.get_territory(gle.party), self.get_customer_group(gle.party),
|
||||
self.voucher_details.get(gle.voucher_no, {}).get("sales_person")]
|
||||
if args.get("party_type") == "Supplier":
|
||||
row += [self.get_supplier_group(gle.party)]
|
||||
|
||||
row.append(gle.remarks)
|
||||
|
||||
return row
|
||||
|
||||
def get_entries_after(self, report_date, party_type):
|
||||
# returns a distinct list
|
||||
return list(set([(e.voucher_type, e.voucher_no) for e in self.get_gl_entries(party_type, report_date, for_future=True)]))
|
||||
@@ -274,29 +396,32 @@ class ReceivablePayableReport(object):
|
||||
doctype = "Sales Invoice" if party_type=="Customer" else "Purchase Invoice"
|
||||
return [d.name for d in frappe.get_all(doctype, filters={"is_return": 1, "docstatus": 1})]
|
||||
|
||||
def get_outstanding_amount(self, gle, report_date, dr_or_cr, return_entries, currency_precision):
|
||||
def get_outstanding_amount(self, gle, report_date, dr_or_cr, return_entries):
|
||||
payment_amount, credit_note_amount = 0.0, 0.0
|
||||
reverse_dr_or_cr = "credit" if dr_or_cr=="debit" else "debit"
|
||||
|
||||
for e in self.get_gl_entries_for(gle.party, gle.party_type, gle.voucher_type, gle.voucher_no):
|
||||
if getdate(e.posting_date) <= report_date and e.name!=gle.name:
|
||||
amount = flt(e.get(reverse_dr_or_cr), currency_precision) - flt(e.get(dr_or_cr), currency_precision)
|
||||
amount = flt(e.get(reverse_dr_or_cr), self.currency_precision) - flt(e.get(dr_or_cr), self.currency_precision)
|
||||
if e.voucher_no not in return_entries:
|
||||
payment_amount += amount
|
||||
else:
|
||||
credit_note_amount += amount
|
||||
|
||||
outstanding_amount = (flt((flt(gle.get(dr_or_cr), currency_precision)
|
||||
- flt(gle.get(reverse_dr_or_cr), currency_precision)
|
||||
- payment_amount - credit_note_amount), currency_precision))
|
||||
outstanding_amount = (flt((flt(gle.get(dr_or_cr), self.currency_precision)
|
||||
- flt(gle.get(reverse_dr_or_cr), self.currency_precision)
|
||||
- payment_amount - credit_note_amount), self.currency_precision))
|
||||
|
||||
credit_note_amount = flt(credit_note_amount, currency_precision)
|
||||
credit_note_amount = flt(credit_note_amount, self.currency_precision)
|
||||
|
||||
return outstanding_amount, credit_note_amount
|
||||
return outstanding_amount, credit_note_amount, payment_amount
|
||||
|
||||
def get_party_name(self, party_type, party_name):
|
||||
return self.get_party_map(party_type).get(party_name, {}).get("customer_name" if party_type == "Customer" else "supplier_name") or ""
|
||||
|
||||
def get_customer_contact(self, party_type, party_name):
|
||||
return self.get_party_map(party_type).get(party_name, {}).get("customer_primary_contact")
|
||||
|
||||
def get_territory(self, party_name):
|
||||
return self.get_party_map("Customer").get(party_name, {}).get("territory") or ""
|
||||
|
||||
@@ -309,7 +434,7 @@ class ReceivablePayableReport(object):
|
||||
def get_party_map(self, party_type):
|
||||
if not hasattr(self, "party_map"):
|
||||
if party_type == "Customer":
|
||||
select_fields = "name, customer_name, territory, customer_group"
|
||||
select_fields = "name, customer_name, territory, customer_group, customer_primary_contact"
|
||||
elif party_type == "Supplier":
|
||||
select_fields = "name, supplier_name, supplier_group"
|
||||
|
||||
@@ -370,6 +495,7 @@ class ReceivablePayableReport(object):
|
||||
values.append(self.filters.get(party_type_field))
|
||||
|
||||
if party_type_field=="customer":
|
||||
account_type = "Receivable"
|
||||
if self.filters.get("customer_group"):
|
||||
lft, rgt = frappe.db.get_value("Customer Group",
|
||||
self.filters.get("customer_group"), ["lft", "rgt"])
|
||||
@@ -377,7 +503,7 @@ class ReceivablePayableReport(object):
|
||||
conditions.append("""party in (select name from tabCustomer
|
||||
where exists(select name from `tabCustomer Group` where lft >= {0} and rgt <= {1}
|
||||
and name=tabCustomer.customer_group))""".format(lft, rgt))
|
||||
|
||||
|
||||
if self.filters.get("territory"):
|
||||
lft, rgt = frappe.db.get_value("Territory",
|
||||
self.filters.get("territory"), ["lft", "rgt"])
|
||||
@@ -395,16 +521,27 @@ class ReceivablePayableReport(object):
|
||||
values.append(self.filters.get("sales_partner"))
|
||||
|
||||
if self.filters.get("sales_person"):
|
||||
conditions.append("""party in (select parent
|
||||
from `tabSales Team` where sales_person=%s and parenttype = 'Customer')""")
|
||||
values.append(self.filters.get("sales_person"))
|
||||
lft, rgt = frappe.db.get_value("Sales Person",
|
||||
self.filters.get("sales_person"), ["lft", "rgt"])
|
||||
|
||||
if party_type_field=="supplier":
|
||||
conditions.append("""exists(select name from `tabSales Team` steam where
|
||||
steam.sales_person in (select name from `tabSales Person` where lft >= {0} and rgt <= {1})
|
||||
and ((steam.parent = voucher_no and steam.parenttype = voucher_type)
|
||||
or (steam.parent = against_voucher and steam.parenttype = against_voucher_type)
|
||||
or (steam.parent = party and steam.parenttype = 'Customer')))""".format(lft, rgt))
|
||||
|
||||
elif party_type_field=="supplier":
|
||||
account_type = "Payable"
|
||||
if self.filters.get("supplier_group"):
|
||||
conditions.append("""party in (select name from tabSupplier
|
||||
where supplier_group=%s)""")
|
||||
values.append(self.filters.get("supplier_group"))
|
||||
|
||||
|
||||
accounts = [d.name for d in frappe.get_all("Account",
|
||||
filters={"account_type": account_type, "company": self.filters.company})]
|
||||
conditions.append("account in (%s)" % ','.join(['%s'] *len(accounts)))
|
||||
values += accounts
|
||||
|
||||
return " and ".join(conditions), values
|
||||
|
||||
def get_gl_entries_for(self, party, party_type, against_voucher_type, against_voucher):
|
||||
@@ -421,6 +558,31 @@ class ReceivablePayableReport(object):
|
||||
.get(against_voucher_type, {})\
|
||||
.get(against_voucher, [])
|
||||
|
||||
def get_payment_term_detail(self, voucher_nos):
|
||||
payment_term_map = frappe._dict()
|
||||
payment_terms_details = frappe.db.sql(""" select si.name,
|
||||
party_account_currency, currency, si.conversion_rate,
|
||||
ps.due_date, ps.payment_amount, ps.description
|
||||
from `tabSales Invoice` si, `tabPayment Schedule` ps
|
||||
where si.name = ps.parent and
|
||||
si.docstatus = 1 and si.company = '%s' and
|
||||
si.name in (%s) order by ps.due_date
|
||||
""" % (frappe.db.escape(self.filters.company), ','.join(['%s'] *len(voucher_nos))),
|
||||
(tuple(voucher_nos)), as_dict = 1)
|
||||
|
||||
for d in payment_terms_details:
|
||||
if self.filters.get("customer") and d.currency == d.party_account_currency:
|
||||
payment_term_amount = d.payment_amount
|
||||
else:
|
||||
payment_term_amount = flt(flt(d.payment_amount) * flt(d.conversion_rate), self.currency_precision)
|
||||
|
||||
payment_term_map.setdefault(d.name, []).append(frappe._dict({
|
||||
"due_date": d.due_date,
|
||||
"payment_term_amount": payment_term_amount,
|
||||
"description": d.description
|
||||
}))
|
||||
return payment_term_map
|
||||
|
||||
def get_chart_data(self, columns, data):
|
||||
ageing_columns = columns[self.ageing_col_idx_start : self.ageing_col_idx_start+4]
|
||||
|
||||
@@ -468,12 +630,11 @@ def get_ageing_data(first_range, second_range, third_range, age_as_on, entry_dat
|
||||
|
||||
def get_pdc_details(party_type, report_date):
|
||||
pdc_details = frappe._dict()
|
||||
|
||||
for pdc in frappe.db.sql("""
|
||||
pdc_via_pe = frappe.db.sql("""
|
||||
select
|
||||
pref.reference_name as invoice_no, pent.party, pent.party_type,
|
||||
max(pent.posting_date) as pdc_date, sum(ifnull(pref.allocated_amount,0)) as pdc_amount,
|
||||
GROUP_CONCAT(pent.reference_no SEPARATOR ', ') as pdc_ref
|
||||
pent.posting_date as pdc_date, ifnull(pref.allocated_amount,0) as pdc_amount,
|
||||
pent.reference_no as pdc_ref
|
||||
from
|
||||
`tabPayment Entry` as pent inner join `tabPayment Entry Reference` as pref
|
||||
on
|
||||
@@ -481,19 +642,22 @@ def get_pdc_details(party_type, report_date):
|
||||
where
|
||||
pent.docstatus < 2 and pent.posting_date > %s
|
||||
and pent.party_type = %s
|
||||
group by pent.party, pref.reference_name""", (report_date, party_type), as_dict=1):
|
||||
pdc_details.setdefault((pdc.invoice_no, pdc.party), pdc)
|
||||
""", (report_date, party_type), as_dict=1)
|
||||
|
||||
for pdc in pdc_via_pe:
|
||||
pdc_details.setdefault((pdc.invoice_no, pdc.party), []).append(pdc)
|
||||
|
||||
if scrub(party_type):
|
||||
amount_field = ("jea.debit_in_account_currency"
|
||||
if party_type == 'Supplier' else "jea.credit_in_account_currency")
|
||||
else:
|
||||
amount_field = "jea.debit + jea.credit"
|
||||
|
||||
for pdc in frappe.db.sql("""
|
||||
pdc_via_je = frappe.db.sql("""
|
||||
select
|
||||
jea.reference_name as invoice_no, jea.party, jea.party_type,
|
||||
max(je.posting_date) as pdc_date, sum(ifnull({0},0)) as pdc_amount,
|
||||
GROUP_CONCAT(je.cheque_no SEPARATOR ', ') as pdc_ref
|
||||
je.posting_date as pdc_date, ifnull({0},0) as pdc_amount,
|
||||
je.cheque_no as pdc_ref
|
||||
from
|
||||
`tabJournal Entry` as je inner join `tabJournal Entry Account` as jea
|
||||
on
|
||||
@@ -501,16 +665,10 @@ def get_pdc_details(party_type, report_date):
|
||||
where
|
||||
je.docstatus < 2 and je.posting_date > %s
|
||||
and jea.party_type = %s
|
||||
group by jea.party, jea.reference_name""".format(amount_field), (report_date, party_type), as_dict=1):
|
||||
if (pdc.invoice_no, pdc.party) in pdc_details:
|
||||
key = (pdc.invoice_no, pdc.party)
|
||||
pdc_details[key]["pdc_amount"] += pdc.pdc_amount
|
||||
if pdc.pdc_ref:
|
||||
pdc_details[key]["pdc_ref"] += ", " + pdc.pdc_ref
|
||||
if pdc.pdc_date:
|
||||
pdc_details[key]["pdc_date"] = max(pdc_details[key]["pdc_date"], pdc.pdc_date)
|
||||
else:
|
||||
pdc_details.setdefault((pdc.invoice_no, pdc.party), pdc)
|
||||
""".format(amount_field), (report_date, party_type), as_dict=1)
|
||||
|
||||
for pdc in pdc_via_je:
|
||||
pdc_details.setdefault((pdc.invoice_no, pdc.party), []).append(pdc)
|
||||
|
||||
return pdc_details
|
||||
|
||||
@@ -550,8 +708,12 @@ def get_voucher_details(party_type, voucher_nos, dn_details):
|
||||
voucher_details = frappe._dict()
|
||||
|
||||
if party_type == "Customer":
|
||||
for si in frappe.db.sql("""select name, due_date, po_no
|
||||
from `tabSales Invoice` where docstatus=1 and name in (%s)
|
||||
for si in frappe.db.sql("""
|
||||
select inv.name, inv.due_date, inv.po_no, GROUP_CONCAT(steam.sales_person SEPARATOR ', ') as sales_person
|
||||
from `tabSales Invoice` inv
|
||||
left join `tabSales Team` steam on steam.parent = inv.name and steam.parenttype = 'Sales Invoice'
|
||||
where inv.docstatus=1 and inv.name in (%s)
|
||||
group by inv.name
|
||||
""" %(','.join(['%s'] *len(voucher_nos))), (tuple(voucher_nos)), as_dict=1):
|
||||
si['delivery_note'] = dn_details.get(si.name)
|
||||
voucher_details.setdefault(si.name, si)
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
import frappe.defaults
|
||||
import unittest
|
||||
from frappe.utils import today, getdate, add_days
|
||||
from erpnext.accounts.report.accounts_receivable.accounts_receivable import execute
|
||||
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
|
||||
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
|
||||
|
||||
class TestAccountsReceivable(unittest.TestCase):
|
||||
def test_accounts_receivable(self):
|
||||
frappe.db.sql("delete from `tabSales Invoice` where company='_Test Company 2'")
|
||||
frappe.db.sql("delete from `tabGL Entry` where company='_Test Company 2'")
|
||||
|
||||
filters = {
|
||||
'company': '_Test Company 2',
|
||||
'based_on_payment_terms': 1
|
||||
}
|
||||
|
||||
name = make_sales_invoice()
|
||||
report = execute(filters)
|
||||
|
||||
expected_data = [[100,30], [100,50], [100,20]]
|
||||
|
||||
self.assertEqual(expected_data[0], report[1][0][7:9])
|
||||
self.assertEqual(expected_data[1], report[1][1][7:9])
|
||||
self.assertEqual(expected_data[2], report[1][2][7:9])
|
||||
|
||||
make_payment(name)
|
||||
report = execute(filters)
|
||||
|
||||
expected_data_after_payment = [[100,50], [100,20]]
|
||||
|
||||
self.assertEqual(expected_data_after_payment[0], report[1][0][7:9])
|
||||
self.assertEqual(expected_data_after_payment[1], report[1][1][7:9])
|
||||
|
||||
make_credit_note(name)
|
||||
report = execute(filters)
|
||||
|
||||
expected_data_after_credit_note = [[100,100,30,100,-30]]
|
||||
|
||||
self.assertEqual(expected_data_after_credit_note[0], report[1][0][7:12])
|
||||
|
||||
|
||||
def make_sales_invoice():
|
||||
frappe.set_user("Administrator")
|
||||
|
||||
si = create_sales_invoice(company="_Test Company 2",
|
||||
customer = '_Test Customer 2',
|
||||
currency = 'EUR',
|
||||
warehouse = 'Finished Goods - _TC2',
|
||||
debit_to = 'Debtors - _TC2',
|
||||
income_account = 'Sales - _TC2',
|
||||
expense_account = 'Cost of Goods Sold - _TC2',
|
||||
cost_center = '_Test Company 2 - _TC2',
|
||||
do_not_save=1)
|
||||
|
||||
si.append('payment_schedule', dict(due_date=getdate(add_days(today(), 30)), invoice_portion=30.00, payment_amount=30))
|
||||
si.append('payment_schedule', dict(due_date=getdate(add_days(today(), 60)), invoice_portion=50.00, payment_amount=50))
|
||||
si.append('payment_schedule', dict(due_date=getdate(add_days(today(), 90)), invoice_portion=20.00, payment_amount=20))
|
||||
|
||||
si.submit()
|
||||
|
||||
return si.name
|
||||
|
||||
def make_payment(docname):
|
||||
pe = get_payment_entry("Sales Invoice", docname, bank_account="Cash - _TC2", party_amount=30)
|
||||
pe.paid_from = "Debtors - _TC2"
|
||||
pe.insert()
|
||||
pe.submit()
|
||||
|
||||
|
||||
def make_credit_note(docname):
|
||||
create_sales_invoice(company="_Test Company 2",
|
||||
customer = '_Test Customer 2',
|
||||
currency = 'EUR',
|
||||
qty = -1,
|
||||
warehouse = 'Finished Goods - _TC2',
|
||||
debit_to = 'Debtors - _TC2',
|
||||
income_account = 'Sales - _TC2',
|
||||
expense_account = 'Cost of Goods Sold - _TC2',
|
||||
cost_center = '_Test Company 2 - _TC2',
|
||||
is_return = 1,
|
||||
return_against = docname)
|
||||
|
||||
@@ -11,25 +11,11 @@ frappe.query_reports["Accounts Receivable Summary"] = {
|
||||
"default": frappe.defaults.get_user_default("Company")
|
||||
},
|
||||
{
|
||||
"fieldname":"customer",
|
||||
"label": __("Customer"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Customer"
|
||||
},
|
||||
{
|
||||
"fieldname":"customer_group",
|
||||
"label": __("Customer Group"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Customer Group"
|
||||
},
|
||||
{
|
||||
"fieldname":"payment_terms_template",
|
||||
"label": __("Payment Terms Template"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Payment Terms Template"
|
||||
},
|
||||
{
|
||||
"fieldtype": "Break",
|
||||
"fieldname":"ageing_based_on",
|
||||
"label": __("Ageing Based On"),
|
||||
"fieldtype": "Select",
|
||||
"options": 'Posting Date\nDue Date',
|
||||
"default": "Posting Date"
|
||||
},
|
||||
{
|
||||
"fieldname":"report_date",
|
||||
@@ -37,13 +23,6 @@ frappe.query_reports["Accounts Receivable Summary"] = {
|
||||
"fieldtype": "Date",
|
||||
"default": frappe.datetime.get_today()
|
||||
},
|
||||
{
|
||||
"fieldname":"ageing_based_on",
|
||||
"label": __("Ageing Based On"),
|
||||
"fieldtype": "Select",
|
||||
"options": 'Posting Date\nDue Date',
|
||||
"default": "Posting Date"
|
||||
},
|
||||
{
|
||||
"fieldname":"range1",
|
||||
"label": __("Ageing Range 1"),
|
||||
@@ -64,6 +43,48 @@ frappe.query_reports["Accounts Receivable Summary"] = {
|
||||
"fieldtype": "Int",
|
||||
"default": "90",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname":"finance_book",
|
||||
"label": __("Finance Book"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Finance Book"
|
||||
},
|
||||
{
|
||||
"fieldname":"customer",
|
||||
"label": __("Customer"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Customer"
|
||||
},
|
||||
{
|
||||
"fieldname":"customer_group",
|
||||
"label": __("Customer Group"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Customer Group"
|
||||
},
|
||||
{
|
||||
"fieldname":"payment_terms_template",
|
||||
"label": __("Payment Terms Template"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Payment Terms Template"
|
||||
},
|
||||
{
|
||||
"fieldname":"territory",
|
||||
"label": __("Territory"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Territory"
|
||||
},
|
||||
{
|
||||
"fieldname":"sales_partner",
|
||||
"label": __("Sales Partner"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Sales Partner"
|
||||
},
|
||||
{
|
||||
"fieldname":"sales_person",
|
||||
"label": __("Sales Person"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Sales Person"
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _, scrub
|
||||
from frappe.utils import flt
|
||||
from erpnext.accounts.party import get_partywise_advanced_payment_amount
|
||||
from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport
|
||||
|
||||
from six import iteritems
|
||||
@@ -22,8 +23,14 @@ class AccountsReceivableSummary(ReceivablePayableReport):
|
||||
columns += [ args.get("party_type") + " Name::140"]
|
||||
|
||||
credit_debit_label = "Credit Note Amt" if args.get('party_type') == 'Customer' else "Debit Note Amt"
|
||||
|
||||
|
||||
columns += [{
|
||||
"label": _("Advance Amount"),
|
||||
"fieldname": "advance_amount",
|
||||
"fieldtype": "Currency",
|
||||
"options": "currency",
|
||||
"width": 100
|
||||
},{
|
||||
"label": _("Total Invoiced Amt"),
|
||||
"fieldname": "total_invoiced_amt",
|
||||
"fieldtype": "Currency",
|
||||
@@ -97,6 +104,12 @@ class AccountsReceivableSummary(ReceivablePayableReport):
|
||||
"fieldtype": "Link",
|
||||
"options": "Customer Group",
|
||||
"width": 80
|
||||
},
|
||||
{
|
||||
"label": _("Sales Person"),
|
||||
"fieldtype": "Data",
|
||||
"fieldname": "sales_person",
|
||||
"width": 120,
|
||||
}]
|
||||
|
||||
if args.get("party_type") == "Supplier":
|
||||
@@ -107,7 +120,7 @@ class AccountsReceivableSummary(ReceivablePayableReport):
|
||||
"options": "Supplier Group",
|
||||
"width": 80
|
||||
}]
|
||||
|
||||
|
||||
columns.append({
|
||||
"fieldname": "currency",
|
||||
"label": _("Currency"),
|
||||
@@ -123,22 +136,30 @@ class AccountsReceivableSummary(ReceivablePayableReport):
|
||||
|
||||
partywise_total = self.get_partywise_total(party_naming_by, args)
|
||||
|
||||
partywise_advance_amount = get_partywise_advanced_payment_amount(args.get("party_type"),
|
||||
self.filters.get("report_date")) or {}
|
||||
for party, party_dict in iteritems(partywise_total):
|
||||
row = [party]
|
||||
|
||||
if party_naming_by == "Naming Series":
|
||||
row += [self.get_party_name(args.get("party_type"), party)]
|
||||
|
||||
row += [partywise_advance_amount.get(party, 0)]
|
||||
|
||||
paid_amt = 0
|
||||
if party_dict.paid_amt > 0:
|
||||
paid_amt = flt(party_dict.paid_amt - partywise_advance_amount.get(party, 0))
|
||||
|
||||
row += [
|
||||
party_dict.invoiced_amt, party_dict.paid_amt, party_dict.credit_amt, party_dict.outstanding_amt,
|
||||
party_dict.invoiced_amt, paid_amt, party_dict.credit_amt, party_dict.outstanding_amt,
|
||||
party_dict.range1, party_dict.range2, party_dict.range3, party_dict.range4,
|
||||
]
|
||||
|
||||
if args.get("party_type") == "Customer":
|
||||
row += [self.get_territory(party), self.get_customer_group(party)]
|
||||
row += [self.get_territory(party), self.get_customer_group(party), ", ".join(set(party_dict.sales_person))]
|
||||
if args.get("party_type") == "Supplier":
|
||||
row += [self.get_supplier_group(party)]
|
||||
|
||||
|
||||
row.append(party_dict.currency)
|
||||
data.append(row)
|
||||
|
||||
@@ -156,15 +177,19 @@ class AccountsReceivableSummary(ReceivablePayableReport):
|
||||
"range1": 0,
|
||||
"range2": 0,
|
||||
"range3": 0,
|
||||
"range4": 0
|
||||
"range4": 0,
|
||||
"sales_person": []
|
||||
})
|
||||
)
|
||||
for k in list(party_total[d.party]):
|
||||
if k != "currency":
|
||||
if k not in ["currency", "sales_person"]:
|
||||
party_total[d.party][k] += flt(d.get(k, 0))
|
||||
|
||||
|
||||
party_total[d.party].currency = d.currency
|
||||
|
||||
if d.sales_person:
|
||||
party_total[d.party].sales_person.append(d.sales_person)
|
||||
|
||||
return party_total
|
||||
|
||||
def get_voucherwise_data(self, party_naming_by, args):
|
||||
@@ -175,18 +200,22 @@ class AccountsReceivableSummary(ReceivablePayableReport):
|
||||
if party_naming_by == "Naming Series":
|
||||
cols += ["party_name"]
|
||||
|
||||
if args.get("party_type") == 'Customer':
|
||||
cols += ["contact"]
|
||||
|
||||
cols += ["voucher_type", "voucher_no", "due_date"]
|
||||
|
||||
if args.get("party_type") == "Supplier":
|
||||
cols += ["bill_no", "bill_date"]
|
||||
|
||||
cols += ["invoiced_amt", "paid_amt", "credit_amt",
|
||||
"outstanding_amt", "age", "range1", "range2", "range3", "range4", "currency"]
|
||||
"outstanding_amt", "age", "range1", "range2", "range3", "range4", "currency", "pdc/lc_date", "pdc/lc_ref",
|
||||
"pdc/lc_amount"]
|
||||
|
||||
if args.get("party_type") == "Supplier":
|
||||
cols += ["supplier_group", "remarks"]
|
||||
if args.get("party_type") == "Customer":
|
||||
cols += ["territory", "customer_group", "remarks"]
|
||||
cols += ["po_no", "do_no", "territory", "customer_group", "sales_person", "remarks"]
|
||||
|
||||
return self.make_data_dict(cols, voucherwise_data)
|
||||
|
||||
|
||||
@@ -35,16 +35,22 @@ def get_conditions(filters):
|
||||
|
||||
def get_entries(filters):
|
||||
conditions = get_conditions(filters)
|
||||
journal_entries = frappe.db.sql("""select "Journal Entry", jv.name, jv.posting_date,
|
||||
jv.cheque_no, jv.clearance_date, jvd.against_account, (jvd.debit - jvd.credit)
|
||||
from `tabJournal Entry Account` jvd, `tabJournal Entry` jv
|
||||
where jvd.parent = jv.name and jv.docstatus=1 and jvd.account = %(account)s {0}
|
||||
order by posting_date DESC, jv.name DESC""".format(conditions), filters, as_list=1)
|
||||
journal_entries = frappe.db.sql("""SELECT
|
||||
"Journal Entry", jv.name, jv.posting_date, jv.cheque_no,
|
||||
jv.clearance_date, jvd.against_account, jvd.debit - jvd.credit
|
||||
FROM
|
||||
`tabJournal Entry Account` jvd, `tabJournal Entry` jv
|
||||
WHERE
|
||||
jvd.parent = jv.name and jv.docstatus=1 and jvd.account = %(account)s {0}
|
||||
order by posting_date DESC, jv.name DESC""".format(conditions), filters, as_list=1)
|
||||
|
||||
payment_entries = frappe.db.sql("""select "Payment Entry", name, posting_date,
|
||||
reference_no, clearance_date, party, if(paid_from=%(account)s, paid_amount, received_amount)
|
||||
from `tabPayment Entry`
|
||||
where docstatus=1 and (paid_from = %(account)s or paid_to = %(account)s) {0}
|
||||
order by posting_date DESC, name DESC""".format(conditions), filters, as_list=1)
|
||||
payment_entries = frappe.db.sql("""SELECT
|
||||
"Payment Entry", name, posting_date, reference_no, clearance_date, party,
|
||||
if(paid_from=%(account)s, paid_amount * -1, received_amount)
|
||||
FROM
|
||||
`tabPayment Entry`
|
||||
WHERE
|
||||
docstatus=1 and (paid_from = %(account)s or paid_to = %(account)s) {0}
|
||||
order by posting_date DESC, name DESC""".format(conditions), filters, as_list=1)
|
||||
|
||||
return sorted(journal_entries + payment_entries, key=lambda k: k[2] or getdate(nowdate()))
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user