Compare commits
1090 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5650bf9ba5 | ||
|
|
9afb53203f | ||
|
|
825e053e66 | ||
|
|
3e519770de | ||
|
|
e42fb32f6f | ||
|
|
00bec1c272 | ||
|
|
68ae9f3f88 | ||
|
|
8f3cc81302 | ||
|
|
9e9d242a24 | ||
|
|
287fe81329 | ||
|
|
24053478a1 | ||
|
|
f382373cf4 | ||
|
|
61f4a8e757 | ||
|
|
eef55185fc | ||
|
|
8691e0777b | ||
|
|
2de3bf7a0f | ||
|
|
2e6f12b850 | ||
|
|
ba41242f1f | ||
|
|
0633df5872 | ||
|
|
f4f774d1df | ||
|
|
695327a513 | ||
|
|
019501e4a0 | ||
|
|
2704162f5a | ||
|
|
117be7ddd5 | ||
|
|
f59920500c | ||
|
|
8a01980757 | ||
|
|
5123a8519b | ||
|
|
d7de3c606b | ||
|
|
dc981dc546 | ||
|
|
ed019123e2 | ||
|
|
4d1cf53466 | ||
|
|
e2431fd5e9 | ||
|
|
d12a4f5e8c | ||
|
|
ad65be8250 | ||
|
|
ae30026005 | ||
|
|
54c4240d9c | ||
|
|
79683d0871 | ||
|
|
a6d1876958 | ||
|
|
346928f2bc | ||
|
|
310d238d17 | ||
|
|
5e25731188 | ||
|
|
83ca262e38 | ||
|
|
8a2e6f427b | ||
|
|
8371c1c4cd | ||
|
|
361e7f6ddc | ||
|
|
798fd3484f | ||
|
|
22cedeb006 | ||
|
|
e3c117e32c | ||
|
|
68a8b0c2a9 | ||
|
|
307543f968 | ||
|
|
6681b0d2aa | ||
|
|
54d9c9eaf4 | ||
|
|
9b11d9b45d | ||
|
|
cca55ddc33 | ||
|
|
1c68509426 | ||
|
|
1e05077b1f | ||
|
|
b81244342f | ||
|
|
8e92250798 | ||
|
|
d20ec25c92 | ||
|
|
25bcb14c1d | ||
|
|
f6149f1507 | ||
|
|
2f3585f949 | ||
|
|
ed8ad9cfee | ||
|
|
3a2727c9eb | ||
|
|
16d92e7270 | ||
|
|
8c7eb444ef | ||
|
|
9a0efc7710 | ||
|
|
3ddfce4f17 | ||
|
|
a236f4e586 | ||
|
|
0b62c6ebd4 | ||
|
|
40ca4c3bbb | ||
|
|
c454dc7af5 | ||
|
|
994cef5ee3 | ||
|
|
185762aeeb | ||
|
|
1b32d913a2 | ||
|
|
64f29f819a | ||
|
|
2efe05c1ce | ||
|
|
17c675547d | ||
|
|
a220e96867 | ||
|
|
e471b02172 | ||
|
|
19f90e984e | ||
|
|
b5608f9b14 | ||
|
|
5adce495aa | ||
|
|
66272a168d | ||
|
|
2192c244c0 | ||
|
|
141c244ece | ||
|
|
a57b020620 | ||
|
|
d1fda1ff2b | ||
|
|
b9d0e7622a | ||
|
|
2f9703c20e | ||
|
|
46b6d4ea47 | ||
|
|
417145bec5 | ||
|
|
1ff1368280 | ||
|
|
768a888bf2 | ||
|
|
8037a0e3d5 | ||
|
|
0b665ac791 | ||
|
|
87ad6d074a | ||
|
|
95108ac80b | ||
|
|
9b9777be3f | ||
|
|
075b299673 | ||
|
|
e0271a8331 | ||
|
|
3fc3305251 | ||
|
|
236f7aac7f | ||
|
|
29ee263093 | ||
|
|
4782e8b751 | ||
|
|
b58979fd3e | ||
|
|
9365641777 | ||
|
|
5e9d72d57b | ||
|
|
0d230afd22 | ||
|
|
a906b3f11c | ||
|
|
aa6f00c403 | ||
|
|
d681c88d79 | ||
|
|
fc11fce990 | ||
|
|
faf51d91b6 | ||
|
|
08a42e00ae | ||
|
|
549a2827e5 | ||
|
|
9264313f0e | ||
|
|
8013d1813a | ||
|
|
ffc807cd57 | ||
|
|
ba6559c2e9 | ||
|
|
7eea52d4e9 | ||
|
|
93a990f006 | ||
|
|
2861955632 | ||
|
|
099163b16d | ||
|
|
0d114b4c31 | ||
|
|
fcf34dc570 | ||
|
|
6f038bc1f3 | ||
|
|
9300013acc | ||
|
|
8d8cba7faa | ||
|
|
2d132e32aa | ||
|
|
2e47654f43 | ||
|
|
9bfa0ab7eb | ||
|
|
17ddd8f389 | ||
|
|
c469f2c954 | ||
|
|
731efe3a95 | ||
|
|
2c892c7e7f | ||
|
|
e6b5843a1f | ||
|
|
31334328ed | ||
|
|
0d6db6c42c | ||
|
|
ed0422a8d9 | ||
|
|
d991c8666c | ||
|
|
85d1c07519 | ||
|
|
04ab7dfd2f | ||
|
|
eae30e5642 | ||
|
|
065302298f | ||
|
|
9f84a99158 | ||
|
|
b15d999147 | ||
|
|
4b0381c820 | ||
|
|
f0b4562a95 | ||
|
|
cc8b2b2fdb | ||
|
|
67a3e65f08 | ||
|
|
dc89916aa9 | ||
|
|
9d9cb8b7b1 | ||
|
|
e7c0188732 | ||
|
|
34b1dba9aa | ||
|
|
c040015bb5 | ||
|
|
b66edd19ca | ||
|
|
b596deb57d | ||
|
|
79fddcfac1 | ||
|
|
3d5bdeb90d | ||
|
|
d07c041125 | ||
|
|
e64b75153a | ||
|
|
b207a0542a | ||
|
|
620bde7144 | ||
|
|
a8b2cdf65a | ||
|
|
896fd1aca7 | ||
|
|
e503f68ec7 | ||
|
|
a86bb69adf | ||
|
|
80b3cf22eb | ||
|
|
3b5b081ac4 | ||
|
|
d00218ece3 | ||
|
|
93c15383b8 | ||
|
|
3c2be33adf | ||
|
|
4be52d8a20 | ||
|
|
6bd791742f | ||
|
|
90d82be966 | ||
|
|
eb6fa5b70c | ||
|
|
1f6bd0ad37 | ||
|
|
c4894a5287 | ||
|
|
a9bef56a94 | ||
|
|
f90a3295c4 | ||
|
|
a24f8dbb8f | ||
|
|
37d8f643cc | ||
|
|
400c6f5aef | ||
|
|
07e6bdd4f2 | ||
|
|
b87c174898 | ||
|
|
99752e58ec | ||
|
|
5ac740b3cb | ||
|
|
3528d08178 | ||
|
|
f912317fae | ||
|
|
e2fef16d78 | ||
|
|
41bf1ba7b3 | ||
|
|
3d1434afe7 | ||
|
|
0dd00eb418 | ||
|
|
64e9c4abf4 | ||
|
|
82e6bc45e4 | ||
|
|
a5ddeb44e7 | ||
|
|
35b12e2ea6 | ||
|
|
de98ff6bb9 | ||
|
|
afa93c624b | ||
|
|
8519b4bfe4 | ||
|
|
79731360ed | ||
|
|
fede6d8fbe | ||
|
|
b9bbb3c3db | ||
|
|
11812db5e8 | ||
|
|
193c8919b9 | ||
|
|
d1f6cc88f2 | ||
|
|
dac525433c | ||
|
|
e313c09fd7 | ||
|
|
49a3d6d8f6 | ||
|
|
580682d6a2 | ||
|
|
6c3eb36c35 | ||
|
|
da749f716b | ||
|
|
2cf5ca28f6 | ||
|
|
95db9f9e09 | ||
|
|
621dcc3c84 | ||
|
|
010d9cd796 | ||
|
|
77b2fef41e | ||
|
|
d20f8585ae | ||
|
|
d7908f8e3a | ||
|
|
77c970549b | ||
|
|
5ecbaa408b | ||
|
|
46e108b34e | ||
|
|
fe5c95e360 | ||
|
|
0329c0ffab | ||
|
|
5b60ef2dce | ||
|
|
8bf58367b8 | ||
|
|
3e43f275a0 | ||
|
|
70c3f79d12 | ||
|
|
9c8159be8f | ||
|
|
68fb20b811 | ||
|
|
a4f838b6b4 | ||
|
|
fc9ed4da24 | ||
|
|
ea617da277 | ||
|
|
6eb202ef3a | ||
|
|
3938c61996 | ||
|
|
f74b02140c | ||
|
|
b719dc53fc | ||
|
|
00b04ed61e | ||
|
|
bf2a7efca4 | ||
|
|
214ea8f2c8 | ||
|
|
a844040781 | ||
|
|
b8f5148a44 | ||
|
|
9ba1be60b7 | ||
|
|
2aafdd622b | ||
|
|
b6b97f25d0 | ||
|
|
4a8a62a202 | ||
|
|
d25e314ccb | ||
|
|
f44f04e33a | ||
|
|
b40efe34e3 | ||
|
|
691a34c924 | ||
|
|
db068ac6c4 | ||
|
|
c7dc838306 | ||
|
|
5168286ea0 | ||
|
|
8373b8e50d | ||
|
|
33f2b659e4 | ||
|
|
8de911b5b4 | ||
|
|
d162eb367c | ||
|
|
0af93a782d | ||
|
|
46bccb55c5 | ||
|
|
422ef584fa | ||
|
|
b132428184 | ||
|
|
a90ff97782 | ||
|
|
1775a3db38 | ||
|
|
57f35a25a1 | ||
|
|
3011006ff2 | ||
|
|
1e7f739c84 | ||
|
|
7fbc1c2161 | ||
|
|
67e3e32dd6 | ||
|
|
076e9d6af8 | ||
|
|
c6b52a321e | ||
|
|
730ad5a507 | ||
|
|
43583d6497 | ||
|
|
a07c43fd68 | ||
|
|
0a33d4ffc5 | ||
|
|
6ee91ec9c6 | ||
|
|
e1acb766ac | ||
|
|
71f4fbf467 | ||
|
|
b69d311268 | ||
|
|
6514e051be | ||
|
|
4d6d456a0d | ||
|
|
414c0ab3bb | ||
|
|
024896d806 | ||
|
|
2b9c95a940 | ||
|
|
7cf1a1d84b | ||
|
|
6f7457a1b0 | ||
|
|
75177c0e35 | ||
|
|
d79f239001 | ||
|
|
c26ae0036d | ||
|
|
f494626ce4 | ||
|
|
27efc91db0 | ||
|
|
ad2dc2c747 | ||
|
|
f340e19ea7 | ||
|
|
56f650f342 | ||
|
|
c1a5b348b5 | ||
|
|
1157ee365b | ||
|
|
ee7b4f2882 | ||
|
|
505ed25f10 | ||
|
|
1ba71a0b3a | ||
|
|
79bce2a71d | ||
|
|
4f3da42b75 | ||
|
|
131866a11a | ||
|
|
82c258948d | ||
|
|
e259a9b068 | ||
|
|
f54b1047b8 | ||
|
|
3d731df7e3 | ||
|
|
f86d73fdc8 | ||
|
|
f6dee248ee | ||
|
|
6d4a52562b | ||
|
|
6b53792aea | ||
|
|
faedf8274c | ||
|
|
6a053a989e | ||
|
|
0d47d51407 | ||
|
|
468726320c | ||
|
|
11fa7a9311 | ||
|
|
2922660b34 | ||
|
|
27e86201fc | ||
|
|
cc034a8983 | ||
|
|
0216f6e6eb | ||
|
|
26ed675240 | ||
|
|
4f4d0a8369 | ||
|
|
df65d21225 | ||
|
|
86cb0cc010 | ||
|
|
7f42e90832 | ||
|
|
0afbee9441 | ||
|
|
1ed8bc4c36 | ||
|
|
b2a8482cc5 | ||
|
|
fb4b8d926f | ||
|
|
ae205f878a | ||
|
|
d0d22ff203 | ||
|
|
6923397ef6 | ||
|
|
c5204f56e2 | ||
|
|
132193309c | ||
|
|
d402829d17 | ||
|
|
fd9b2467d6 | ||
|
|
3e22a11a16 | ||
|
|
124cf14429 | ||
|
|
0169341917 | ||
|
|
87fa59a710 | ||
|
|
1fe1518398 | ||
|
|
6068aecc2e | ||
|
|
07c9f35779 | ||
|
|
45510109b6 | ||
|
|
017f5005e0 | ||
|
|
339d9c954a | ||
|
|
1312fe31a9 | ||
|
|
adcb3c62fa | ||
|
|
3b5a412a9c | ||
|
|
56a7974b58 | ||
|
|
86ab6a93b4 | ||
|
|
1f261a8695 | ||
|
|
b5097ec161 | ||
|
|
f0c7ba4b1f | ||
|
|
e30f83a8af | ||
|
|
e7e82fe477 | ||
|
|
83aa5ee3df | ||
|
|
db206f2d10 | ||
|
|
868bb26e24 | ||
|
|
37a57813fa | ||
|
|
aea1c2a1e3 | ||
|
|
ffd1f112e6 | ||
|
|
733855a4c3 | ||
|
|
d22bb682a5 | ||
|
|
f73a44aa8d | ||
|
|
1fde71b3c0 | ||
|
|
02fb5880fe | ||
|
|
a64f53801b | ||
|
|
631fab012f | ||
|
|
d41836b386 | ||
|
|
52daaca885 | ||
|
|
89d494fbf5 | ||
|
|
27c4fdc2df | ||
|
|
804c4fc4a7 | ||
|
|
842d4fcf53 | ||
|
|
02198ec8b0 | ||
|
|
b9cdb05934 | ||
|
|
33fb6ae323 | ||
|
|
40f5d1845f | ||
|
|
f967206523 | ||
|
|
d05a8737f9 | ||
|
|
1af471a16f | ||
|
|
f822b875ba | ||
|
|
229764b7bf | ||
|
|
961bdc3743 | ||
|
|
cbe035b08a | ||
|
|
44bc6ab242 | ||
|
|
0e4b924f59 | ||
|
|
c03f275e7a | ||
|
|
f5a9c8ecf2 | ||
|
|
9f4317e9b8 | ||
|
|
1a735f2f5a | ||
|
|
0bb434af3f | ||
|
|
b3ffd6b282 | ||
|
|
439a39bbbb | ||
|
|
fe876c0805 | ||
|
|
e68f32cf19 | ||
|
|
5a980ac87a | ||
|
|
0697d62603 | ||
|
|
611a70a12a | ||
|
|
8411be7720 | ||
|
|
8981ecf170 | ||
|
|
e7485150a1 | ||
|
|
312498060f | ||
|
|
d59f8b32cd | ||
|
|
ff2d5d8ad9 | ||
|
|
a07c3193cf | ||
|
|
feb45727e5 | ||
|
|
9e6e718ee1 | ||
|
|
a31ffbc745 | ||
|
|
f8aa6ed46b | ||
|
|
91c6ffde86 | ||
|
|
78a650062c | ||
|
|
57a47a83a0 | ||
|
|
a0fb3e5128 | ||
|
|
42bc399f2a | ||
|
|
bc10ea897d | ||
|
|
17cf220cbc | ||
|
|
cfb0adff98 | ||
|
|
834d616c60 | ||
|
|
c99f85d84c | ||
|
|
1cc7024cb4 | ||
|
|
7067ff026a | ||
|
|
e7900b24a0 | ||
|
|
e95b6e75ac | ||
|
|
b3134d34fa | ||
|
|
258c8199fb | ||
|
|
4e71337f3d | ||
|
|
18b7364a81 | ||
|
|
093eba2336 | ||
|
|
db2aefa3a6 | ||
|
|
f8b19e07cf | ||
|
|
639eebdae5 | ||
|
|
e6254b96c4 | ||
|
|
2c2ce8c557 | ||
|
|
8312f1cd64 | ||
|
|
6bbf141d57 | ||
|
|
38c7ad2c69 | ||
|
|
491d2ad140 | ||
|
|
365ed5dea9 | ||
|
|
fd37395995 | ||
|
|
0ded707397 | ||
|
|
62d7ba0afd | ||
|
|
cda28ceeec | ||
|
|
409062b8a4 | ||
|
|
631ecad985 | ||
|
|
3ddc26060a | ||
|
|
c02745c826 | ||
|
|
a13adc0e6b | ||
|
|
b9741b6ed5 | ||
|
|
d39b012981 | ||
|
|
b99a38d6ae | ||
|
|
a2afc4e11c | ||
|
|
e76685d925 | ||
|
|
c642f76a4d | ||
|
|
e0d661f433 | ||
|
|
79c5ee0a65 | ||
|
|
afd0d086a7 | ||
|
|
704b6a3e1f | ||
|
|
2087e574aa | ||
|
|
c238016aff | ||
|
|
6981870a40 | ||
|
|
7e15afbf45 | ||
|
|
4766562ff0 | ||
|
|
08c1e86b1c | ||
|
|
72c7e73ce0 | ||
|
|
7553e72014 | ||
|
|
c95ebdb4e4 | ||
|
|
f800892ec3 | ||
|
|
94c30d81b1 | ||
|
|
697150f339 | ||
|
|
a8d02bfd4a | ||
|
|
d77fac113f | ||
|
|
da73e1b806 | ||
|
|
26b79f108a | ||
|
|
b983f26b98 | ||
|
|
8ad26c7d26 | ||
|
|
c15b5db030 | ||
|
|
e4903b77b6 | ||
|
|
15944b9ecf | ||
|
|
2bcacec5c6 | ||
|
|
ff5bd680c2 | ||
|
|
d9afd7e4aa | ||
|
|
d3d2daab4b | ||
|
|
9f0d64b679 | ||
|
|
230df2c9d3 | ||
|
|
53259fb91f | ||
|
|
868ef7738f | ||
|
|
23e5d40374 | ||
|
|
c4587d2945 | ||
|
|
cea7d32b31 | ||
|
|
509543752c | ||
|
|
5278da8901 | ||
|
|
8ec1b565f5 | ||
|
|
89f7767b51 | ||
|
|
4c27ec5618 | ||
|
|
52a5cb9ae3 | ||
|
|
60db08fd7f | ||
|
|
951e31667b | ||
|
|
97b3be6f9d | ||
|
|
90b42c4fa2 | ||
|
|
1d45a4312e | ||
|
|
ddb9f0bf78 | ||
|
|
d6e409ea92 | ||
|
|
fe61c314b7 | ||
|
|
089c5caea5 | ||
|
|
7a61f12572 | ||
|
|
05ce7ec7bb | ||
|
|
b249a6e6f7 | ||
|
|
5079c9ef47 | ||
|
|
10ec553859 | ||
|
|
633698affc | ||
|
|
1965949c67 | ||
|
|
6af7140763 | ||
|
|
a8fa10d2a9 | ||
|
|
79dd816359 | ||
|
|
08847bd06a | ||
|
|
1e3a0b4632 | ||
|
|
753c8dedde | ||
|
|
2d8047837c | ||
|
|
1bdb6a57f2 | ||
|
|
f2803ac427 | ||
|
|
47aba953e2 | ||
|
|
f869a679ae | ||
|
|
8c9bc8edbb | ||
|
|
293158db6e | ||
|
|
0142fdc0d7 | ||
|
|
49523d7f80 | ||
|
|
42f55cf4b1 | ||
|
|
6e1a2b16a5 | ||
|
|
d5442b5544 | ||
|
|
7056ce54d7 | ||
|
|
16a4b58676 | ||
|
|
391eca18c7 | ||
|
|
6fd8cca135 | ||
|
|
6cbe02400a | ||
|
|
6a85752ead | ||
|
|
e17519accb | ||
|
|
de7d7ba7d9 | ||
|
|
0d66579e83 | ||
|
|
aa968cd12e | ||
|
|
af6e41b637 | ||
|
|
cd837ecbac | ||
|
|
5422329b84 | ||
|
|
8bb69ff8bf | ||
|
|
e49d901907 | ||
|
|
afd8df8a20 | ||
|
|
78ef086b00 | ||
|
|
6ffd77660b | ||
|
|
3cdb65f782 | ||
|
|
b44ae54813 | ||
|
|
589f4656ad | ||
|
|
9f4cb0c097 | ||
|
|
f8cff128b3 | ||
|
|
66b373033a | ||
|
|
e6a5d5dc64 | ||
|
|
da098222d7 | ||
|
|
fd3ec066ce | ||
|
|
98f9427ba1 | ||
|
|
97ab1d2eb3 | ||
|
|
568dac3aad | ||
|
|
f73d459c80 | ||
|
|
02d987ed13 | ||
|
|
83ba5c1319 | ||
|
|
64e222697c | ||
|
|
e285258374 | ||
|
|
a6eb1434b3 | ||
|
|
0c5375d0fa | ||
|
|
90818080b1 | ||
|
|
e1e25a0c9d | ||
|
|
a020e4eba4 | ||
|
|
6af7dd4e1b | ||
|
|
801fa80b39 | ||
|
|
9e5b3dad29 | ||
|
|
4b9d2f2733 | ||
|
|
1b204c8e4e | ||
|
|
23e174c270 | ||
|
|
e7b87ad071 | ||
|
|
de45b0eddc | ||
|
|
1b59b624c3 | ||
|
|
a7d6b68bc0 | ||
|
|
c70a4d2037 | ||
|
|
d13d198dc8 | ||
|
|
6dd461fec4 | ||
|
|
92c52f4623 | ||
|
|
ea1cb68fe7 | ||
|
|
d5d0b36973 | ||
|
|
7677b56f7c | ||
|
|
b280398626 | ||
|
|
99c6c79834 | ||
|
|
507e6fa46e | ||
|
|
fa2023d3da | ||
|
|
3437a9a123 | ||
|
|
86415f394d | ||
|
|
835a615af8 | ||
|
|
11f159193e | ||
|
|
2f7697d1bd | ||
|
|
d9068497cb | ||
|
|
b8624efe3a | ||
|
|
afef62c887 | ||
|
|
e827104a52 | ||
|
|
6a2e138021 | ||
|
|
e5cb3e34fe | ||
|
|
7118b5a2bd | ||
|
|
2307f57f19 | ||
|
|
ff41c82c2b | ||
|
|
349ed568ed | ||
|
|
ca56ad0bfc | ||
|
|
462e89e452 | ||
|
|
0e94b4bec4 | ||
|
|
60fe77cc90 | ||
|
|
dee36e10ae | ||
|
|
aad8257e20 | ||
|
|
ecdcac1fdf | ||
|
|
993358d5d7 | ||
|
|
bab6c9c006 | ||
|
|
79cd59303a | ||
|
|
d8812020aa | ||
|
|
2ecfd9be5d | ||
|
|
7877b0ec1b | ||
|
|
99dfa3060a | ||
|
|
779c581a92 | ||
|
|
89b6c47b2e | ||
|
|
ec07d18222 | ||
|
|
a388352171 | ||
|
|
1ab8554d15 | ||
|
|
b2fdc131e8 | ||
|
|
c1bf70dc75 | ||
|
|
34ab136b46 | ||
|
|
750a067688 | ||
|
|
049a88cc40 | ||
|
|
1cd5e583ba | ||
|
|
cc2c7649a8 | ||
|
|
bdd470a6d1 | ||
|
|
2f09dc0e62 | ||
|
|
29dfb9479b | ||
|
|
67a13972fb | ||
|
|
5a69f24dfe | ||
|
|
b41b10976f | ||
|
|
edaa43d9b8 | ||
|
|
630882787a | ||
|
|
fc41bb6afd | ||
|
|
f9fdbe2853 | ||
|
|
cf99dc0e77 | ||
|
|
e6aa3b435a | ||
|
|
eee23eaf5c | ||
|
|
d487bf77e1 | ||
|
|
2b5fa7647a | ||
|
|
e27a0d25bc | ||
|
|
fafa3748f1 | ||
|
|
d262eb1a1c | ||
|
|
6ff0caa87a | ||
|
|
efd5eadfea | ||
|
|
57e97c06e6 | ||
|
|
6f93cd5bd0 | ||
|
|
533d22e88b | ||
|
|
b3489548a9 | ||
|
|
ccd2e00331 | ||
|
|
05dca985e6 | ||
|
|
1df0b9bfed | ||
|
|
298acd3d1a | ||
|
|
70fd8546ce | ||
|
|
555279b6e6 | ||
|
|
ddcb514b65 | ||
|
|
401ac7a5e5 | ||
|
|
0a6aaf4257 | ||
|
|
9c0bf73d25 | ||
|
|
842ad55235 | ||
|
|
4f3b0aa249 | ||
|
|
02c02bc572 | ||
|
|
ea8fab52c6 | ||
|
|
92b6ceec41 | ||
|
|
2160638f36 | ||
|
|
c28598ae8b | ||
|
|
3ade874f9e | ||
|
|
05dec9a880 | ||
|
|
8200485baa | ||
|
|
c874a82559 | ||
|
|
5f5457085e | ||
|
|
50862039dc | ||
|
|
ade06f940c | ||
|
|
259489572d | ||
|
|
101aaed643 | ||
|
|
20d2d7548a | ||
|
|
28945438f2 | ||
|
|
36d04fda37 | ||
|
|
b4a2c2f047 | ||
|
|
943124275d | ||
|
|
ac65e956e8 | ||
|
|
e92a740b53 | ||
|
|
acb5e9a11b | ||
|
|
9ca3f2847a | ||
|
|
6ede4a3809 | ||
|
|
ed94aa4798 | ||
|
|
f37d329cf5 | ||
|
|
3f10c7f4fc | ||
|
|
6575a0a7e2 | ||
|
|
a3d0bea375 | ||
|
|
3e2ecc3423 | ||
|
|
6b9902627d | ||
|
|
c62362f064 | ||
|
|
a0314f19ca | ||
|
|
4aabe61197 | ||
|
|
10eb123b49 | ||
|
|
69060a8177 | ||
|
|
749516c22d | ||
|
|
3714626dd0 | ||
|
|
98595dff0b | ||
|
|
b499fe91fa | ||
|
|
c13dbd408f | ||
|
|
929c3890a4 | ||
|
|
0e995adc44 | ||
|
|
f01c1c2a9d | ||
|
|
3dc96cf71e | ||
|
|
e67e2e6fee | ||
|
|
38f808cfae | ||
|
|
ea092a7b24 | ||
|
|
587dd90182 | ||
|
|
99ce531beb | ||
|
|
d408553b93 | ||
|
|
ebfb7ff027 | ||
|
|
879a2d84dc | ||
|
|
477c88450f | ||
|
|
9071bcbfa8 | ||
|
|
7ec4b717ed | ||
|
|
d9a265fab1 | ||
|
|
1947aca2a8 | ||
|
|
ba96ce7dd5 | ||
|
|
fd1767d2ea | ||
|
|
4500f7b4d6 | ||
|
|
455824235a | ||
|
|
ab1ee1e6fc | ||
|
|
dbd95936ea | ||
|
|
80ca65c166 | ||
|
|
fbaa6197f9 | ||
|
|
364f48aad2 | ||
|
|
87037bdd56 | ||
|
|
d893efd0a9 | ||
|
|
3b40098738 | ||
|
|
b327429db7 | ||
|
|
0bdffa8130 | ||
|
|
16ce3623bc | ||
|
|
51b1d6de48 | ||
|
|
7fa039f15c | ||
|
|
83f4780f74 | ||
|
|
8271b4c564 | ||
|
|
cbc49e2989 | ||
|
|
531b49f6c7 | ||
|
|
2dfb90a922 | ||
|
|
92c9ad8c72 | ||
|
|
bf667a6540 | ||
|
|
ce4a0b20ab | ||
|
|
68fd31ca0e | ||
|
|
b77eaf7053 | ||
|
|
ecc44e506b | ||
|
|
6d0da98a78 | ||
|
|
4db5dd3cc2 | ||
|
|
7ff5682193 | ||
|
|
f36ff488c0 | ||
|
|
245c2e885a | ||
|
|
e239d4dfe9 | ||
|
|
098bd34f00 | ||
|
|
063e86a1bf | ||
|
|
b5eaf324b3 | ||
|
|
73bf1bc4b0 | ||
|
|
5f0027a2d0 | ||
|
|
fd82f4b0d4 | ||
|
|
710dc5392f | ||
|
|
83cc7c9382 | ||
|
|
149c033c8f | ||
|
|
173fe24ef4 | ||
|
|
7326217ab5 | ||
|
|
6c85ad9726 | ||
|
|
8c3fb43d8a | ||
|
|
3dd85a0e9e | ||
|
|
e877ecfb7b | ||
|
|
425d7adcdd | ||
|
|
0350db6a4e | ||
|
|
1e86546e2c | ||
|
|
6396c90956 | ||
|
|
47fbc7efa5 | ||
|
|
8b62626cec | ||
|
|
355b4110c9 | ||
|
|
cb19f52985 | ||
|
|
3899d74f15 | ||
|
|
57e4ab70be | ||
|
|
d288909310 | ||
|
|
ce116417e1 | ||
|
|
67eff49516 | ||
|
|
34354237fd | ||
|
|
1f1f56225c | ||
|
|
4333ce0fd8 | ||
|
|
8452e60204 | ||
|
|
15c5ae0918 | ||
|
|
679cc23abb | ||
|
|
c948a4fc92 | ||
|
|
ab65f6d8b1 | ||
|
|
d825409226 | ||
|
|
d471ad2c45 | ||
|
|
01eefafad5 | ||
|
|
397e508fc0 | ||
|
|
2a660fb695 | ||
|
|
1f9d1bb877 | ||
|
|
16d40cf0a3 | ||
|
|
349d520ae2 | ||
|
|
b736aafb8b | ||
|
|
a1d3d84415 | ||
|
|
c1cc7b68c4 | ||
|
|
e09407571c | ||
|
|
4c952f48f8 | ||
|
|
bd1a628c55 | ||
|
|
93c001455f | ||
|
|
548cf183ea | ||
|
|
153156e31a | ||
|
|
a0b967f2cd | ||
|
|
f356e539bb | ||
|
|
84b827efcd | ||
|
|
e14e042f2f | ||
|
|
bfcacbf2ca | ||
|
|
188f9da160 | ||
|
|
78966fe03b | ||
|
|
a3a977d02a | ||
|
|
03dc695c77 | ||
|
|
c81621d3ce | ||
|
|
00d3cd6d64 | ||
|
|
818af75575 | ||
|
|
d69fd1b8c0 | ||
|
|
683d98fd54 | ||
|
|
35e4d8b152 | ||
|
|
60908f4a08 | ||
|
|
26fdb113a8 | ||
|
|
45c14ed41c | ||
|
|
eb80fdef82 | ||
|
|
e2f4b35b11 | ||
|
|
6b3670848e | ||
|
|
56cc542eb7 | ||
|
|
a0c41b70c4 | ||
|
|
461e9c1e09 | ||
|
|
2b97cee32c | ||
|
|
c0888637cc | ||
|
|
8f55d6bf3a | ||
|
|
d14a6c058a | ||
|
|
982be9f11b | ||
|
|
7385b73449 | ||
|
|
dd839055e3 | ||
|
|
b70767b08e | ||
|
|
aff2b9479d | ||
|
|
a987b35b72 | ||
|
|
f8676b2058 | ||
|
|
5597f6a830 | ||
|
|
653303180a | ||
|
|
1c91dc4589 | ||
|
|
d9e216878f | ||
|
|
9e294ee454 | ||
|
|
2ad62c2892 | ||
|
|
f58cad6b13 | ||
|
|
592104ef68 | ||
|
|
7c7b3c0ab4 | ||
|
|
0681c77f6a | ||
|
|
2dab8809e7 | ||
|
|
9eb830ac4f | ||
|
|
bf01958b85 | ||
|
|
2f2b6df781 | ||
|
|
b064cf39c2 | ||
|
|
03f82240fa | ||
|
|
9375d1dfeb | ||
|
|
241e478dc0 | ||
|
|
ffd80a6061 | ||
|
|
6695830f3f | ||
|
|
d9b4c52046 | ||
|
|
f80c2b9606 | ||
|
|
8d39fd9790 | ||
|
|
120461efef | ||
|
|
2bbf784fd8 | ||
|
|
71a730a36f | ||
|
|
b89be1e193 | ||
|
|
38bd62d82d | ||
|
|
4ad121e1a4 | ||
|
|
820abd3ba4 | ||
|
|
47bdf8b659 | ||
|
|
685f89f2b7 | ||
|
|
95439db53f | ||
|
|
c0bfb0ba56 | ||
|
|
b92087cb2d | ||
|
|
448acf6f46 | ||
|
|
5d69900f66 | ||
|
|
3d26ddd790 | ||
|
|
e7cb911634 | ||
|
|
26ac85be5b | ||
|
|
ca7c5275c0 | ||
|
|
fd7f3240b4 | ||
|
|
b166caa9fb | ||
|
|
7a3d418aa5 | ||
|
|
af077dc616 | ||
|
|
b251cd4ccb | ||
|
|
74c56aff90 | ||
|
|
45cad45420 | ||
|
|
90350dfb86 | ||
|
|
e43a94de4b | ||
|
|
9698f1b923 | ||
|
|
29458836e4 | ||
|
|
1a92d54dcb | ||
|
|
b6114e672f | ||
|
|
4bd42146ba | ||
|
|
ba2a76cfb7 | ||
|
|
8f0c060578 | ||
|
|
17cd36b7d5 | ||
|
|
90de12fea3 | ||
|
|
007c87ea63 | ||
|
|
02b6fe0fcb | ||
|
|
4440ac037f | ||
|
|
d56627f2b7 | ||
|
|
ac81440a81 | ||
|
|
7933eb685c | ||
|
|
8afe267813 | ||
|
|
5dfffe7586 | ||
|
|
2f3ae914a6 | ||
|
|
1cd7e54822 | ||
|
|
056276c60e | ||
|
|
7182de7684 | ||
|
|
2f02101d7d | ||
|
|
595cfb9f17 | ||
|
|
0287d31c0f | ||
|
|
ffa5ffe607 | ||
|
|
c0eab41ec5 | ||
|
|
3d491f90cc | ||
|
|
2a9e0f6fd8 | ||
|
|
9e08ccdf39 | ||
|
|
1612fa1253 | ||
|
|
20aba32318 | ||
|
|
c4aceaad7f | ||
|
|
5dd988207f | ||
|
|
4a15fa4c86 | ||
|
|
d40e661ebd | ||
|
|
51d45d8bce | ||
|
|
b8350353ea | ||
|
|
4180a37773 | ||
|
|
a7f616564e | ||
|
|
b083591164 | ||
|
|
01baceb74e | ||
|
|
43e07aed2c | ||
|
|
9215581345 | ||
|
|
2b41f9d548 | ||
|
|
5a30467ae5 | ||
|
|
a56224c03a | ||
|
|
233ecfdd9c | ||
|
|
577cfd559f | ||
|
|
5c87455918 | ||
|
|
06ed74dc7c | ||
|
|
ec793b4846 | ||
|
|
6e9d2a3c1f | ||
|
|
a2fae844b6 | ||
|
|
21544ca978 | ||
|
|
2bb9093b9a | ||
|
|
f0c41b5709 | ||
|
|
23b836dcdb | ||
|
|
297ae85c31 | ||
|
|
1839fcca11 | ||
|
|
d1eb237909 | ||
|
|
a9b9edd9bc | ||
|
|
07b524ee50 | ||
|
|
802b4359b5 | ||
|
|
6f48d4be1c | ||
|
|
138c2f6b29 | ||
|
|
81130e848e | ||
|
|
f65e8de5a5 | ||
|
|
34e34ed1e8 | ||
|
|
8b133ac087 | ||
|
|
6734c4ad5c | ||
|
|
91621639e8 | ||
|
|
a3e7c38734 | ||
|
|
7b4bdffea2 | ||
|
|
59a67c3586 | ||
|
|
efc9372f46 | ||
|
|
107099aac9 | ||
|
|
d08c248642 | ||
|
|
35cefb1275 | ||
|
|
8281b36a26 | ||
|
|
f45851c245 | ||
|
|
0dab40f4a1 | ||
|
|
96562e3eb7 | ||
|
|
202bcc09d5 | ||
|
|
3051a3dd97 | ||
|
|
b7cc393eb8 | ||
|
|
f4832cf2b9 | ||
|
|
7c161cfff2 | ||
|
|
0e8361d1de | ||
|
|
1d88c65be4 | ||
|
|
ab42fc006f | ||
|
|
c657cceffc | ||
|
|
1ecf613c3c | ||
|
|
ceea71bcfc | ||
|
|
b0e329b803 | ||
|
|
506120936a | ||
|
|
7fc18f359c | ||
|
|
92254d3930 | ||
|
|
5a383e5cdd | ||
|
|
06966e8e1d | ||
|
|
5594050104 | ||
|
|
cdbacf5398 | ||
|
|
6bbed0297b | ||
|
|
4601fdd98d | ||
|
|
9784d27317 | ||
|
|
ce5f942678 | ||
|
|
3cae3a5190 | ||
|
|
edb99f8750 | ||
|
|
4de4b56c60 | ||
|
|
585448b225 | ||
|
|
985cb8226d | ||
|
|
e97d40806f | ||
|
|
257ecf71ac | ||
|
|
5105b1e789 | ||
|
|
dc0a277085 | ||
|
|
fa2feae314 | ||
|
|
494a4d9ba1 | ||
|
|
7b29dc7208 | ||
|
|
9646be1d5d | ||
|
|
a8326de4d0 | ||
|
|
2097ccfaea | ||
|
|
5c82e9ef8b | ||
|
|
f483582957 | ||
|
|
ae25e0da88 | ||
|
|
f327a58b7f | ||
|
|
3d98d23e22 | ||
|
|
11bde0ba14 | ||
|
|
2469f247df | ||
|
|
392806c0d4 | ||
|
|
986927ca98 | ||
|
|
465da8ce09 | ||
|
|
bef185c404 | ||
|
|
340c9d327a | ||
|
|
0152516ba4 | ||
|
|
94c4d7014d | ||
|
|
249bc6167f | ||
|
|
aa9b8603b9 | ||
|
|
fe7a5b305f | ||
|
|
8c9c9cfc5f | ||
|
|
5cb1b6bf3f | ||
|
|
3bcf9b5e70 | ||
|
|
a6be7c71ed | ||
|
|
89c8b4d6ae | ||
|
|
e5f5017973 | ||
|
|
174c3478a1 | ||
|
|
512b85e040 | ||
|
|
e60c2c7b7a | ||
|
|
9007815ddc | ||
|
|
22239ac610 | ||
|
|
88817b40df | ||
|
|
4573029a5e | ||
|
|
0631d516ce | ||
|
|
c2690425e3 | ||
|
|
488ad54bbc | ||
|
|
0d49cdf024 | ||
|
|
df4b9ab630 | ||
|
|
7b2177a544 | ||
|
|
94f42ea145 | ||
|
|
9a7cb6ce92 | ||
|
|
61a190dd69 | ||
|
|
bcf63a2a8f | ||
|
|
ba95fc4fa0 | ||
|
|
c2d66bdfb2 | ||
|
|
aa2d949f61 | ||
|
|
1e1e28b0ae | ||
|
|
06c6628481 | ||
|
|
0177c02c0f | ||
|
|
a83de5eac1 | ||
|
|
914ae77a22 | ||
|
|
5bb85e7a95 | ||
|
|
e549984a42 | ||
|
|
3385bd4921 | ||
|
|
0822e41f96 | ||
|
|
1c00b1fb21 | ||
|
|
0632ee3da9 | ||
|
|
c6bd7ade2f | ||
|
|
58ed0c6efa | ||
|
|
00e65cb70b | ||
|
|
d567e57f82 | ||
|
|
c30ae28422 | ||
|
|
0766d3e67e | ||
|
|
e7939fd87b | ||
|
|
2b8aafb08d | ||
|
|
34e820d02d | ||
|
|
17d05b4fd7 | ||
|
|
89af62a680 | ||
|
|
8979e1c7a5 | ||
|
|
f573d43b90 | ||
|
|
f944fb9e46 | ||
|
|
688f2284af | ||
|
|
a320b1a494 | ||
|
|
e80208e6e5 | ||
|
|
6fc6670a25 |
40
.github/CONTRIBUTING.md
vendored
40
.github/CONTRIBUTING.md
vendored
@@ -1,52 +1,58 @@
|
||||
##General Overview
|
||||
## General Overview
|
||||
|
||||
We have three branches where all the work happens:
|
||||
There are three branches where all the work happens:
|
||||
|
||||
* **master** - This is the stable branch based on which we do releases. This branch is for production.
|
||||
* **develop** - This is an unstable branch for development purposes, it has bleeding edge features and fixes, but it's not recommended for production. Bug fixes and new features go here.
|
||||
* **hotfix** - This is a branch dedicated to hotfixes on the master branch. Urgent bug fixes go here.
|
||||
* **master** - This is the production / stable branch for releases.
|
||||
* **develop** - This is bleeding edge with features and fixes. Non critical bug fixes and new features go here. All updates to master also get pushed to develop.
|
||||
* **hotfix** - Urgent bug fixes go here. This is merged into master for releases.
|
||||
|
||||
## Release Cycles
|
||||
|
||||
Once we deem the develop branch to be stable, we merge it into the master and do a major release. The hotfix branch is solely for making urgent bug fixes on the current master branch, which we then merge into master.
|
||||
|
||||
We almost never push directly to master.
|
||||
Usually, hotfix / develop is pushed to master roughly every week.
|
||||
|
||||
If we are close to a major release, then all bugfixes get pushed to hotfix and a release is done every week or as necessary.
|
||||
|
||||
***
|
||||
|
||||
|
||||
##Workflow
|
||||
## Contributing
|
||||
|
||||
Contributing to ERPNext is not very different from the usual Pull Request workflow on GitHub.
|
||||
|
||||
###Prerequisites :
|
||||
### Prerequisites :
|
||||
|
||||
* You need to know [Git and Github basics](https://try.github.io/levels/1/challenges/1)
|
||||
* You need to have a Fork of the [ERPNext repo](https://github.com/frappe/erpnext) in your personal Github account
|
||||
* You need to add a [remote](#glossary) for your Forked repository. `git remote add origin [your-erpnext-repo-url]`
|
||||
|
||||
|
||||
###The Process:
|
||||
### The Process:
|
||||
|
||||
1. Make sure you're in the right branch. **develop** for adding features / fixing issues and **hotfix** for urgent bug fixes
|
||||
2. Make your changes
|
||||
3. Create and checkout a new branch for the changes you've made. `git checkout -b [branch-name]`
|
||||
4. Add and commit your changes `git commit -am "[commit-message]"
|
||||
5. If you have been working on sometime for a long time, you should [rebase](#glossary) your branch with our develop branch. `git pull upstream develop --rebase` where `upstream` is the remote name of our repo
|
||||
5. If you have been working on sometime for a long time, you should [rebase](#glossary) your branch with main develop branch. `git pull upstream develop --rebase` where `upstream` is the remote name of our repo
|
||||
6. Now, push your changes to your fork. `git push origin [branch-name]`
|
||||
If you rebased your commits, you will have to [force push](http://vignette2.wikia.nocookie.net/starwars/images/e/ea/Yodapush.png/revision/latest?cb=20130205190454) `git push origin [branch-name] --force`
|
||||
7. You should now be able to see your pushed branch on Github, now create a pull request against the branch that you want to merge to.
|
||||
8. Wait for us to review it
|
||||
|
||||
###Common Problems:
|
||||
### Your Pull Request Should have
|
||||
|
||||
1. Clear explanation of the use case
|
||||
1. Screenshots / Screecast GIF
|
||||
1. Test Cases (if applicable)
|
||||
1. Update to documentation
|
||||
|
||||
### Common Problems:
|
||||
|
||||
* During rebase you might face _merge conflicts_. A merge conflict occurs when you have made changes to the same file that someone else has, in the commits you're pulling. You need to resolve these conflicts by picking which code you want to keep, yours or theirs. You can use `git mergetool` for help.
|
||||
* Sometimes you don't have a local branch to which you want to make changes to. In that case you first run `git fetch` followed by `git checkout --track -b upstream/[branch-name]`
|
||||
|
||||
|
||||
###Good practices:
|
||||
### Good practices:
|
||||
|
||||
* You should rebase your branch with the branch you plan to make a Pull Request to as often as you can.
|
||||
* You should rebase your branch with the branch you plan to make a Pull Request (PR) to as often as you can.
|
||||
* Your commit messages should be precise and explain exactly what the commit does. Same goes for the Pull Request title.
|
||||
* When making a PR make sure that all your code is committed properly by checking the diffs.
|
||||
* If you're working on different things at the same time, make sure you make separate branches for each.
|
||||
@@ -55,7 +61,7 @@ If you rebased your commits, you will have to [force push](http://vignette2.wiki
|
||||
* Tabs, not spaces.
|
||||
|
||||
|
||||
###Glossary
|
||||
### Glossary
|
||||
|
||||
* remote - A remote is a connection to a Github repo. You should have two remotes, one that points to your repo and one to ours.
|
||||
* rebase - When you rebase a branch, you pull commits from your remote branch and move your commits on top of it. This allows you to update your branch with the latest changes without losing your changes.
|
||||
|
||||
@@ -38,6 +38,14 @@ The ERPNext code is licensed as GNU General Public License (v3) and the Document
|
||||
|
||||
---
|
||||
|
||||
## Contributing
|
||||
|
||||
1. [Pull Request Requirements](https://github.com/frappe/erpnext/wiki/Pull-Request-Guidelines)
|
||||
1. [Translations](https://translate.erpnext.com)
|
||||
1. [Chart of Accounts](https://charts.erpnext.com)
|
||||
|
||||
---
|
||||
|
||||
## Logo and Trademark
|
||||
|
||||
The brand name ERPNext and the logo are trademarks of Frappe Technologies Pvt. Ltd.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
__version__ = '7.2.1'
|
||||
__version__ = '8.0.14'
|
||||
|
||||
def get_default_company(user=None):
|
||||
'''Get default company for user'''
|
||||
@@ -24,3 +24,26 @@ def get_default_currency():
|
||||
company = get_default_company()
|
||||
if company:
|
||||
return frappe.db.get_value('Company', company, 'default_currency')
|
||||
|
||||
def get_company_currency(company):
|
||||
'''Returns the default company currency'''
|
||||
if not frappe.flags.company_currency:
|
||||
frappe.flags.company_currency = {}
|
||||
if not company in frappe.flags.company_currency:
|
||||
frappe.flags.company_currency[company] = frappe.db.get_value('Company', company, 'default_currency')
|
||||
return frappe.flags.company_currency[company]
|
||||
|
||||
def set_perpetual_inventory(enable=1):
|
||||
accounts_settings = frappe.get_doc("Accounts Settings")
|
||||
accounts_settings.auto_accounting_for_stock = enable
|
||||
accounts_settings.save()
|
||||
|
||||
def encode_company_abbr(name, company):
|
||||
'''Returns name encoded with company abbreviation'''
|
||||
company_abbr = frappe.db.get_value("Company", company, "abbr")
|
||||
parts = name.rsplit(" - ", 1)
|
||||
|
||||
if parts[-1].lower() != company_abbr.lower():
|
||||
parts.append(company_abbr)
|
||||
|
||||
return " - ".join([parts[0], company_abbr])
|
||||
|
||||
@@ -22,6 +22,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": "",
|
||||
@@ -50,6 +51,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -76,7 +78,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Account Name",
|
||||
@@ -107,6 +110,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 Group",
|
||||
@@ -134,7 +138,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Company",
|
||||
@@ -165,6 +170,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Root Type",
|
||||
@@ -193,6 +199,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Report Type",
|
||||
@@ -222,6 +229,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": "Currency",
|
||||
@@ -251,6 +259,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -278,6 +287,7 @@
|
||||
"ignore_user_permissions": 1,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Parent Account",
|
||||
@@ -308,7 +318,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Account Type",
|
||||
@@ -340,6 +351,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": "Rate",
|
||||
@@ -370,6 +382,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": "Frozen",
|
||||
@@ -400,6 +413,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": "Warehouse",
|
||||
@@ -428,6 +442,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": "Balance must be",
|
||||
@@ -456,6 +471,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": "Lft",
|
||||
@@ -483,6 +499,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": "Rgt",
|
||||
@@ -510,6 +527,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": "Old Parent",
|
||||
@@ -538,7 +556,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-12-15 14:43:50.121671",
|
||||
"modified": "2017-02-17 16:22:49.249075",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Account",
|
||||
@@ -554,7 +572,6 @@
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 1,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -575,7 +592,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -596,7 +612,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -617,7 +632,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -638,7 +652,6 @@
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 1,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -654,6 +667,8 @@
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"search_fields": "",
|
||||
"show_name_in_global_search": 1,
|
||||
"sort_order": "ASC",
|
||||
"track_changes": 0,
|
||||
"track_seen": 0
|
||||
}
|
||||
@@ -3,11 +3,12 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.utils import cstr, cint
|
||||
from frappe.utils import cint, fmt_money
|
||||
from frappe import throw, _
|
||||
from frappe.model.document import Document
|
||||
|
||||
class RootNotEditable(frappe.ValidationError): pass
|
||||
class BalanceMismatchError(frappe.ValidationError): pass
|
||||
|
||||
class Account(Document):
|
||||
nsm_parent_field = 'parent_account'
|
||||
@@ -162,23 +163,38 @@ class Account(Document):
|
||||
throw(_("Report Type is mandatory"))
|
||||
|
||||
def validate_warehouse_account(self):
|
||||
'''If perpetual inventory is set, and warehouse is linked,
|
||||
the account balance and stock balance as of now must always match.
|
||||
'''
|
||||
from erpnext.accounts.utils import get_balance_on
|
||||
from erpnext.stock.utils import get_stock_value_on
|
||||
if not cint(frappe.defaults.get_global_default("auto_accounting_for_stock")):
|
||||
return
|
||||
|
||||
if self.account_type == "Stock" and not cint(self.is_group):
|
||||
if not self.warehouse:
|
||||
throw(_("Warehouse is mandatory"))
|
||||
|
||||
old_warehouse = cstr(frappe.db.get_value("Account", self.name, "warehouse"))
|
||||
if old_warehouse != cstr(self.warehouse):
|
||||
if old_warehouse and frappe.db.exists("Warehouse", old_warehouse):
|
||||
self.validate_warehouse(old_warehouse)
|
||||
if self.warehouse:
|
||||
self.validate_warehouse(self.warehouse)
|
||||
|
||||
|
||||
if self.account_type == "Stock":
|
||||
if self.is_group == 0 and not self.warehouse:
|
||||
frappe.throw(_("Warehouse is mandatory for non group Accounts of type Stock"))
|
||||
|
||||
if self.warehouse:
|
||||
# company must be same
|
||||
if frappe.get_value('Warehouse', self.warehouse, 'company') != self.company:
|
||||
frappe.throw(_("Warehouse company must be same as Account company"))
|
||||
|
||||
# balance must be same
|
||||
stock_balance = get_stock_value_on(self.warehouse)
|
||||
if self.is_new():
|
||||
account_balance = 0.0
|
||||
else:
|
||||
account_balance = get_balance_on(self.name)
|
||||
|
||||
if account_balance != stock_balance:
|
||||
frappe.throw(_('Account balance ({0}) and stock value ({1}) must be same')\
|
||||
.format(fmt_money(account_balance, self.account_currency),
|
||||
fmt_money(stock_balance, self.account_currency)))
|
||||
|
||||
elif self.warehouse:
|
||||
self.warehouse = None
|
||||
|
||||
|
||||
def validate_warehouse(self, warehouse):
|
||||
lft, rgt = frappe.db.get_value("Warehouse", warehouse, ["lft", "rgt"])
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ def get_charts_for_country(country):
|
||||
|
||||
def get_account_tree_from_existing_company(existing_company):
|
||||
all_accounts = frappe.get_all('Account',
|
||||
filters={'company': existing_company},
|
||||
filters={'company': existing_company, "warehouse": ""},
|
||||
fields = ["name", "account_name", "parent_account", "account_type",
|
||||
"is_group", "root_type", "tax_rate"],
|
||||
order_by="lft, rgt")
|
||||
@@ -126,7 +126,6 @@ def get_account_tree_from_existing_company(existing_company):
|
||||
|
||||
# fill in tree starting with root accounts (those with no parent)
|
||||
build_account_tree(account_tree, None, all_accounts)
|
||||
|
||||
return account_tree
|
||||
|
||||
def build_account_tree(tree, parent, all_accounts):
|
||||
|
||||
@@ -88,10 +88,7 @@
|
||||
"Items Delivered to Customs on temprary Base": {}
|
||||
},
|
||||
"Stock in Hand": {
|
||||
"All Warehouses": {
|
||||
"account_type": "Stock",
|
||||
"is_group": 1
|
||||
},
|
||||
"is_group": 1,
|
||||
"account_type": "Stock"
|
||||
}
|
||||
},
|
||||
@@ -341,9 +338,7 @@
|
||||
"Post Dated Cheques Paid": {
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"Staff Payable": {
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"Staff Payable": {},
|
||||
"Suppliers Price Protection": {
|
||||
"account_type": "Payable"
|
||||
},
|
||||
|
||||
@@ -136,7 +136,8 @@
|
||||
"Accounts Payable": {
|
||||
"Creditors": {
|
||||
"account_type": "Payable"
|
||||
}
|
||||
},
|
||||
"Payroll Payable": {}
|
||||
},
|
||||
"Stock Liabilities": {
|
||||
"Stock Received But Not Billed": {
|
||||
|
||||
@@ -40,10 +40,7 @@
|
||||
"Rental Deposits": {}
|
||||
},
|
||||
"Stock Assets": {
|
||||
"All Warehouses": {
|
||||
"account_type": "Stock",
|
||||
"is_group": 1
|
||||
},
|
||||
"is_group": 1,
|
||||
"account_type": "Stock"
|
||||
},
|
||||
"Tax Assets": {
|
||||
@@ -265,7 +262,8 @@
|
||||
"Accounts Payable": {
|
||||
"Creditors": {
|
||||
"account_type": "Payable"
|
||||
}
|
||||
},
|
||||
"Payroll Payable": {}
|
||||
},
|
||||
"Duties and Taxes": {
|
||||
"Deferred Tax Liabilities-Current": {},
|
||||
|
||||
@@ -142,7 +142,8 @@
|
||||
"Accounts Payable": {
|
||||
"Creditors":{
|
||||
"account_type": "Payable"
|
||||
}
|
||||
},
|
||||
"Payroll Payable": {}
|
||||
},
|
||||
"Duties and Taxes": {
|
||||
"account_type": "Tax",
|
||||
|
||||
@@ -107,7 +107,7 @@ def get():
|
||||
_("Office Maintenance Expenses"): {},
|
||||
_("Office Rent"): {},
|
||||
_("Postal Expenses"): {},
|
||||
_("Print and Stationary"): {},
|
||||
_("Print and Stationery"): {},
|
||||
_("Round Off"): {
|
||||
"account_type": "Round Off"
|
||||
},
|
||||
@@ -137,7 +137,8 @@ def get():
|
||||
_("Accounts Payable"): {
|
||||
_("Creditors"): {
|
||||
"account_type": "Payable"
|
||||
}
|
||||
},
|
||||
_("Payroll Payable"): {},
|
||||
},
|
||||
_("Stock Liabilities"): {
|
||||
_("Stock Received But Not Billed"): {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"beta": 0,
|
||||
@@ -25,7 +26,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Make Accounting Entry For Every Stock Movement",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -33,6 +36,7 @@
|
||||
"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,
|
||||
@@ -51,7 +55,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Accounts Frozen Upto",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -59,6 +65,7 @@
|
||||
"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,
|
||||
@@ -77,7 +84,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Role Allowed to Set Frozen Accounts & Edit Frozen Entries",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -86,6 +95,7 @@
|
||||
"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,
|
||||
@@ -103,7 +113,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -111,6 +123,7 @@
|
||||
"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,
|
||||
@@ -129,7 +142,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Credit Controller",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -138,6 +153,7 @@
|
||||
"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,
|
||||
@@ -155,7 +171,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Check Supplier Invoice Number Uniqueness",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -164,6 +182,7 @@
|
||||
"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,
|
||||
@@ -181,7 +200,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Make Payment via Journal Entry",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -190,6 +211,7 @@
|
||||
"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,
|
||||
@@ -208,7 +230,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Unlink Payment on Cancellation of Invoice",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -217,6 +241,37 @@
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "1",
|
||||
"fieldname": "book_asset_depreciation_entry_automatically",
|
||||
"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": "Book Asset Depreciation Entry Automatically",
|
||||
"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,
|
||||
@@ -224,18 +279,18 @@
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"icon": "fa fa-cog",
|
||||
"icon": "icon-cog",
|
||||
"idx": 1,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 1,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-10-20 16:12:38.595075",
|
||||
"modified": "2017-04-18 13:35:59.166250",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Accounts Settings",
|
||||
@@ -251,7 +306,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -266,6 +320,8 @@
|
||||
"quick_entry": 1,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_order": "ASC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
}
|
||||
@@ -22,6 +22,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": "Asset Name",
|
||||
@@ -50,6 +51,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Item Code",
|
||||
@@ -68,6 +70,36 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "item_name",
|
||||
"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": "Item Name",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "item_code.item_name",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -79,6 +111,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Asset Category",
|
||||
@@ -109,6 +142,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Status",
|
||||
@@ -138,6 +172,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": "Image",
|
||||
@@ -166,6 +201,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -193,6 +229,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": "Company",
|
||||
@@ -222,6 +259,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Warehouse",
|
||||
@@ -251,6 +289,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 Existing Asset",
|
||||
@@ -279,6 +318,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": "Purchase Date",
|
||||
@@ -307,6 +347,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": "Supplier",
|
||||
@@ -336,6 +377,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": "Purchase Invoice",
|
||||
@@ -365,6 +407,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": "Disposal Date",
|
||||
@@ -393,6 +436,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": "Journal Entry for Scrap",
|
||||
@@ -422,6 +466,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -449,6 +494,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": "Gross Purchase Amount",
|
||||
@@ -479,6 +525,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": "Expected Value After Useful Life",
|
||||
@@ -509,6 +556,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": "Opening Accumulated Depreciation",
|
||||
@@ -538,6 +586,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": "Value After Depreciation",
|
||||
@@ -567,6 +616,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -596,6 +646,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": "Depreciation Method",
|
||||
@@ -625,6 +676,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": "Total Number of Depreciations",
|
||||
@@ -654,6 +706,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": "Number of Depreciations Booked",
|
||||
@@ -682,6 +735,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": "Frequency of Depreciation (Months)",
|
||||
@@ -711,6 +765,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": "Next Depreciation Date",
|
||||
@@ -739,6 +794,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": "Depreciation Schedule",
|
||||
@@ -767,6 +823,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": "Depreciation Schedules",
|
||||
@@ -796,6 +853,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": "Amended From",
|
||||
@@ -825,7 +883,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-11-18 15:59:19.774500",
|
||||
"modified": "2017-02-17 16:26:19.111939",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Asset",
|
||||
@@ -842,7 +900,6 @@
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 1,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -857,7 +914,9 @@
|
||||
"quick_entry": 0,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 1,
|
||||
"show_name_in_global_search": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 0,
|
||||
"track_seen": 0
|
||||
}
|
||||
@@ -32,7 +32,7 @@ class Asset(Document):
|
||||
self.set_status()
|
||||
|
||||
def validate_item(self):
|
||||
item = frappe.db.get_value("Item", self.item_code,
|
||||
item = frappe.db.get_value("Item", self.item_code,
|
||||
["is_fixed_asset", "is_stock_item", "disabled"], as_dict=1)
|
||||
if not item:
|
||||
frappe.throw(_("Item {0} does not exist").format(self.item_code))
|
||||
@@ -42,7 +42,7 @@ class Asset(Document):
|
||||
frappe.throw(_("Item {0} must be a Fixed Asset Item").format(self.item_code))
|
||||
elif item.is_stock_item:
|
||||
frappe.throw(_("Item {0} must be a non-stock item").format(self.item_code))
|
||||
|
||||
|
||||
def set_missing_values(self):
|
||||
if self.item_code:
|
||||
item_details = get_item_details(self.item_code)
|
||||
@@ -50,7 +50,7 @@ class Asset(Document):
|
||||
if not self.get(field):
|
||||
self.set(field, value)
|
||||
|
||||
self.value_after_depreciation = (flt(self.gross_purchase_amount) -
|
||||
self.value_after_depreciation = (flt(self.gross_purchase_amount) -
|
||||
flt(self.opening_accumulated_depreciation))
|
||||
|
||||
def validate_asset_values(self):
|
||||
@@ -59,7 +59,7 @@ class Asset(Document):
|
||||
|
||||
if not flt(self.gross_purchase_amount):
|
||||
frappe.throw(_("Gross Purchase Amount is mandatory"), frappe.MandatoryError)
|
||||
|
||||
|
||||
if not self.is_existing_asset:
|
||||
self.opening_accumulated_depreciation = 0
|
||||
self.number_of_depreciations_booked = 0
|
||||
@@ -70,30 +70,33 @@ class Asset(Document):
|
||||
if flt(self.opening_accumulated_depreciation) > depreciable_amount:
|
||||
frappe.throw(_("Opening Accumulated Depreciation must be less than equal to {0}")
|
||||
.format(depreciable_amount))
|
||||
|
||||
|
||||
if self.opening_accumulated_depreciation:
|
||||
if not self.number_of_depreciations_booked:
|
||||
frappe.throw(_("Please set Number of Depreciations Booked"))
|
||||
else:
|
||||
self.number_of_depreciations_booked = 0
|
||||
|
||||
|
||||
if cint(self.number_of_depreciations_booked) > cint(self.total_number_of_depreciations):
|
||||
frappe.throw(_("Number of Depreciations Booked cannot be greater than Total Number of Depreciations"))
|
||||
|
||||
|
||||
if self.next_depreciation_date and getdate(self.next_depreciation_date) < getdate(nowdate()):
|
||||
frappe.msgprint(_("Next Depreciation Date is entered as past date"))
|
||||
|
||||
if (flt(self.value_after_depreciation) > flt(self.expected_value_after_useful_life)
|
||||
frappe.msgprint(_("Next Depreciation Date is entered as past date"), title=_('Warning'), indicator='red')
|
||||
|
||||
if self.next_depreciation_date and getdate(self.next_depreciation_date) < getdate(self.purchase_date):
|
||||
frappe.throw(_("Next Depreciation Date cannot be before Purchase Date"))
|
||||
|
||||
if (flt(self.value_after_depreciation) > flt(self.expected_value_after_useful_life)
|
||||
and not self.next_depreciation_date):
|
||||
frappe.throw(_("Please set Next Depreciation Date"))
|
||||
|
||||
def make_depreciation_schedule(self):
|
||||
if self.depreciation_method != 'Manual':
|
||||
self.schedules = []
|
||||
|
||||
|
||||
if not self.get("schedules") and self.next_depreciation_date:
|
||||
value_after_depreciation = flt(self.value_after_depreciation)
|
||||
|
||||
|
||||
number_of_pending_depreciations = cint(self.total_number_of_depreciations) - \
|
||||
cint(self.number_of_depreciations_booked)
|
||||
if number_of_pending_depreciations:
|
||||
@@ -108,17 +111,17 @@ class Asset(Document):
|
||||
"schedule_date": schedule_date,
|
||||
"depreciation_amount": depreciation_amount
|
||||
})
|
||||
|
||||
|
||||
def set_accumulated_depreciation(self):
|
||||
accumulated_depreciation = flt(self.opening_accumulated_depreciation)
|
||||
for d in self.get("schedules"):
|
||||
accumulated_depreciation += flt(d.depreciation_amount)
|
||||
d.accumulated_depreciation_amount = accumulated_depreciation
|
||||
accumulated_depreciation += flt(d.depreciation_amount, d.precision("depreciation_amount"))
|
||||
d.accumulated_depreciation_amount = flt(accumulated_depreciation, d.precision("accumulated_depreciation_amount"))
|
||||
|
||||
def get_depreciation_amount(self, depreciable_value):
|
||||
if self.depreciation_method in ("Straight Line", "Manual"):
|
||||
depreciation_amount = (flt(self.value_after_depreciation) -
|
||||
flt(self.expected_value_after_useful_life)) / (cint(self.total_number_of_depreciations) -
|
||||
flt(self.expected_value_after_useful_life)) / (cint(self.total_number_of_depreciations) -
|
||||
cint(self.number_of_depreciations_booked))
|
||||
else:
|
||||
factor = 200.0 / self.total_number_of_depreciations
|
||||
@@ -129,14 +132,14 @@ class Asset(Document):
|
||||
depreciation_amount = flt(depreciable_value) - flt(self.expected_value_after_useful_life)
|
||||
|
||||
return depreciation_amount
|
||||
|
||||
|
||||
def validate_expected_value_after_useful_life(self):
|
||||
accumulated_depreciation_after_full_schedule = \
|
||||
max([d.accumulated_depreciation_amount for d in self.get("schedules")])
|
||||
|
||||
asset_value_after_full_schedule = (flt(self.gross_purchase_amount) -
|
||||
|
||||
asset_value_after_full_schedule = (flt(self.gross_purchase_amount) -
|
||||
flt(accumulated_depreciation_after_full_schedule))
|
||||
|
||||
|
||||
if self.expected_value_after_useful_life < asset_value_after_full_schedule:
|
||||
frappe.throw(_("Expected value after useful life must be greater than or equal to {0}")
|
||||
.format(asset_value_after_full_schedule))
|
||||
@@ -153,8 +156,8 @@ class Asset(Document):
|
||||
if d.journal_entry:
|
||||
frappe.get_doc("Journal Entry", d.journal_entry).cancel()
|
||||
d.db_set("journal_entry", None)
|
||||
|
||||
self.db_set("value_after_depreciation",
|
||||
|
||||
self.db_set("value_after_depreciation",
|
||||
(flt(self.gross_purchase_amount) - flt(self.opening_accumulated_depreciation)))
|
||||
|
||||
def set_status(self, status=None):
|
||||
@@ -185,6 +188,7 @@ def make_purchase_invoice(asset, item_code, gross_purchase_amount, company, post
|
||||
pi = frappe.new_doc("Purchase Invoice")
|
||||
pi.company = company
|
||||
pi.currency = frappe.db.get_value("Company", company, "default_currency")
|
||||
pi.set_posting_time = 1
|
||||
pi.posting_date = posting_date
|
||||
pi.append("items", {
|
||||
"item_code": item_code,
|
||||
@@ -197,7 +201,7 @@ def make_purchase_invoice(asset, item_code, gross_purchase_amount, company, post
|
||||
})
|
||||
pi.set_missing_values()
|
||||
return pi
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def make_sales_invoice(asset, item_code, company):
|
||||
si = frappe.new_doc("Sales Invoice")
|
||||
@@ -214,7 +218,7 @@ def make_sales_invoice(asset, item_code, company):
|
||||
})
|
||||
si.set_missing_values()
|
||||
return si
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def transfer_asset(args):
|
||||
import json
|
||||
@@ -223,23 +227,23 @@ def transfer_asset(args):
|
||||
movement_entry.update(args)
|
||||
movement_entry.insert()
|
||||
movement_entry.submit()
|
||||
|
||||
|
||||
frappe.db.commit()
|
||||
|
||||
|
||||
frappe.msgprint(_("Asset Movement record {0} created").format("<a href='#Form/Asset Movement/{0}'>{0}</a>".format(movement_entry.name)))
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_item_details(item_code):
|
||||
asset_category = frappe.db.get_value("Item", item_code, "asset_category")
|
||||
|
||||
|
||||
if not asset_category:
|
||||
frappe.throw(_("Please enter Asset Category in Item {0}").format(item_code))
|
||||
|
||||
ret = frappe.db.get_value("Asset Category", asset_category,
|
||||
|
||||
ret = frappe.db.get_value("Asset Category", asset_category,
|
||||
["depreciation_method", "total_number_of_depreciations", "frequency_of_depreciation"], as_dict=1)
|
||||
|
||||
|
||||
ret.update({
|
||||
"asset_category": asset_category
|
||||
})
|
||||
|
||||
return ret
|
||||
|
||||
return ret
|
||||
|
||||
3
erpnext/accounts/doctype/asset/asset_list.js
Normal file
3
erpnext/accounts/doctype/asset/asset_list.js
Normal file
@@ -0,0 +1,3 @@
|
||||
frappe.listview_settings['Asset'] = {
|
||||
add_fields: ['image']
|
||||
}
|
||||
@@ -8,6 +8,10 @@ from frappe import _
|
||||
from frappe.utils import flt, today, getdate
|
||||
|
||||
def post_depreciation_entries(date=None):
|
||||
# Return if automatic booking of asset depreciation is disabled
|
||||
if not frappe.db.get_value("Accounts Settings", None, "book_asset_depreciation_entry_automatically"):
|
||||
return
|
||||
|
||||
if not date:
|
||||
date = today()
|
||||
for asset in get_depreciable_assets(date):
|
||||
|
||||
@@ -166,6 +166,23 @@ class TestAsset(unittest.TestCase):
|
||||
|
||||
self.assertEqual(gle, expected_gle)
|
||||
self.assertEqual(asset.get("value_after_depreciation"), 70000)
|
||||
|
||||
def test_depreciation_entry_cancellation(self):
|
||||
asset = frappe.get_doc("Asset", "Macbook Pro 1")
|
||||
asset.submit()
|
||||
post_depreciation_entries(date="2021-01-01")
|
||||
|
||||
asset.load_from_db()
|
||||
|
||||
# cancel depreciation entry
|
||||
depr_entry = asset.get("schedules")[0].journal_entry
|
||||
self.assertTrue(depr_entry)
|
||||
frappe.get_doc("Journal Entry", depr_entry).cancel()
|
||||
|
||||
asset.load_from_db()
|
||||
depr_entry = asset.get("schedules")[0].journal_entry
|
||||
self.assertFalse(depr_entry)
|
||||
|
||||
|
||||
def test_scrap_asset(self):
|
||||
asset = frappe.get_doc("Asset", "Macbook Pro 1")
|
||||
@@ -297,4 +314,7 @@ def set_depreciation_settings_in_company():
|
||||
company.depreciation_expense_account = "_Test Depreciations - _TC"
|
||||
company.disposal_account = "_Test Gain/Loss on Asset Disposal - _TC"
|
||||
company.depreciation_cost_center = "_Test Cost Center - _TC"
|
||||
company.save()
|
||||
company.save()
|
||||
|
||||
# Enable booking asset depreciation entry automatically
|
||||
frappe.db.set_value("Accounts Settings", None, "book_asset_depreciation_entry_automatically", 1)
|
||||
@@ -23,6 +23,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": "Asset Category Name",
|
||||
@@ -52,6 +53,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Depreciation Method",
|
||||
@@ -81,6 +83,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -108,6 +111,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": "Total Number of Depreciations",
|
||||
@@ -136,6 +140,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": "Frequency of Depreciation (Months)",
|
||||
@@ -164,6 +169,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": "Accounts",
|
||||
@@ -192,6 +198,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": "Accounts",
|
||||
@@ -221,7 +228,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-11-07 05:49:42.600981",
|
||||
"modified": "2017-02-17 16:09:52.955332",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Asset Category",
|
||||
@@ -238,7 +245,6 @@
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 1,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -259,7 +265,6 @@
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 1,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -274,7 +279,9 @@
|
||||
"quick_entry": 0,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 0,
|
||||
"track_seen": 0
|
||||
}
|
||||
@@ -22,6 +22,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Asset",
|
||||
@@ -51,6 +52,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": "Transaction Date",
|
||||
@@ -79,6 +81,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Company",
|
||||
@@ -108,6 +111,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -135,6 +139,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Source Warehouse",
|
||||
@@ -164,6 +169,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Target Warehouse",
|
||||
@@ -193,6 +199,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": "Amended From",
|
||||
@@ -221,7 +228,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-11-07 05:49:47.558549",
|
||||
"modified": "2017-02-17 16:09:32.069344",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Asset Movement",
|
||||
@@ -238,7 +245,6 @@
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -259,7 +265,6 @@
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -280,7 +285,6 @@
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -295,7 +299,9 @@
|
||||
"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
|
||||
}
|
||||
@@ -74,6 +74,9 @@ class BankReconciliation(Document):
|
||||
clearance_date_updated = False
|
||||
for d in self.get('payment_entries'):
|
||||
if d.clearance_date:
|
||||
if not d.payment_document:
|
||||
frappe.throw(_("Row #{0}: Payment document is required to complete the trasaction"))
|
||||
|
||||
if d.cheque_date and getdate(d.clearance_date) < getdate(d.cheque_date):
|
||||
frappe.throw(_("Row #{0}: Clearance date {1} cannot be before Cheque Date {2}")
|
||||
.format(d.idx, d.clearance_date, d.cheque_date))
|
||||
|
||||
@@ -43,9 +43,18 @@ frappe.ui.form.on('Budget', {
|
||||
},
|
||||
|
||||
budget_against: function(frm) {
|
||||
frm.trigger("set_null_value")
|
||||
frm.trigger("toggle_reqd_fields")
|
||||
},
|
||||
|
||||
set_null_value: function(frm) {
|
||||
if(frm.doc.budget_against == 'Cost Center') {
|
||||
frm.set_value('project', null)
|
||||
} else {
|
||||
frm.set_value('cost_center', null)
|
||||
}
|
||||
},
|
||||
|
||||
toggle_reqd_fields: function(frm) {
|
||||
frm.toggle_reqd("cost_center", frm.doc.budget_against=="Cost Center");
|
||||
frm.toggle_reqd("project", frm.doc.budget_against=="Project");
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Budget Against",
|
||||
@@ -51,6 +52,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Company",
|
||||
@@ -81,6 +83,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Cost Center",
|
||||
@@ -111,6 +114,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Project",
|
||||
@@ -140,6 +144,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Fiscal Year",
|
||||
@@ -169,6 +174,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -197,6 +203,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": "Action if Annual Budget Exceeded",
|
||||
@@ -228,6 +235,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": "Action if Accumulated Monthly Budget Exceeded",
|
||||
@@ -258,6 +266,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": "Monthly Distribution",
|
||||
@@ -287,6 +296,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": "Amended From",
|
||||
@@ -315,6 +325,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -342,6 +353,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": "Budget Accounts",
|
||||
@@ -371,7 +383,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-12-15 14:45:31.079107",
|
||||
"modified": "2017-02-17 16:25:32.342055",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Budget",
|
||||
@@ -388,7 +400,6 @@
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 1,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -403,7 +414,9 @@
|
||||
"quick_entry": 0,
|
||||
"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
|
||||
}
|
||||
@@ -22,6 +22,7 @@ class Budget(Document):
|
||||
frappe.throw(_("{0} is mandatory").format(self.budget_against))
|
||||
self.validate_duplicate()
|
||||
self.validate_accounts()
|
||||
self.set_null_value()
|
||||
|
||||
def validate_duplicate(self):
|
||||
budget_against_field = frappe.scrub(self.budget_against)
|
||||
@@ -54,25 +55,31 @@ class Budget(Document):
|
||||
else:
|
||||
account_list.append(d.account)
|
||||
|
||||
def set_null_value(self):
|
||||
if self.budget_against == 'Cost Center':
|
||||
self.project = None
|
||||
else:
|
||||
self.cost_center = None
|
||||
|
||||
def validate_expense_against_budget(args):
|
||||
args = frappe._dict(args)
|
||||
if not args.cost_center and not args.project:
|
||||
return
|
||||
for budget_against in [args.project, args.cost_center]:
|
||||
if budget_against \
|
||||
for budget_against in ['project', 'cost_center']:
|
||||
if args.get(budget_against) \
|
||||
and frappe.db.get_value("Account", {"name": args.account, "root_type": "Expense"}):
|
||||
|
||||
if args.project:
|
||||
condition = "and exists(select name from `tabProject` where name=b.project)"
|
||||
if args.project and budget_against == 'project':
|
||||
condition = "and b.project='%s'" % frappe.db.escape(args.project)
|
||||
args.budget_against_field = "Project"
|
||||
|
||||
elif args.cost_center:
|
||||
elif args.cost_center and budget_against == 'cost_center':
|
||||
cc_lft, cc_rgt = frappe.db.get_value("Cost Center", args.cost_center, ["lft", "rgt"])
|
||||
condition = """and exists(select name from `tabCost Center`
|
||||
where lft<=%s and rgt>=%s and name=b.cost_center)""" % (cc_lft, cc_rgt)
|
||||
args.budget_against_field = "Cost Center"
|
||||
|
||||
args.budget_against = budget_against
|
||||
|
||||
args.budget_against = args.get(budget_against)
|
||||
|
||||
budget_records = frappe.db.sql("""
|
||||
select
|
||||
@@ -88,12 +95,13 @@ def validate_expense_against_budget(args):
|
||||
""".format(condition=condition,
|
||||
budget_against_field=frappe.scrub(args.get("budget_against_field"))),
|
||||
(args.fiscal_year, args.account), as_dict=True)
|
||||
|
||||
validate_budget_records(args, budget_records)
|
||||
|
||||
if budget_records:
|
||||
validate_budget_records(args, budget_records)
|
||||
|
||||
def validate_budget_records(args, budget_records):
|
||||
for budget in budget_records:
|
||||
if budget.budget_amount:
|
||||
if flt(budget.budget_amount):
|
||||
yearly_action = budget.action_if_annual_budget_exceeded
|
||||
monthly_action = budget.action_if_accumulated_monthly_budget_exceeded
|
||||
|
||||
|
||||
@@ -9,11 +9,13 @@
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "account",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@@ -30,6 +32,7 @@
|
||||
"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,
|
||||
@@ -40,6 +43,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "budget_amount",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
@@ -50,11 +54,13 @@
|
||||
"label": "Budget Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company:company:default_currency",
|
||||
"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,
|
||||
@@ -72,7 +78,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-07-11 03:27:58.705376",
|
||||
"modified": "2017-01-02 17:02:53.339420",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Budget Account",
|
||||
|
||||
@@ -35,7 +35,7 @@ def create_or_update_cheque_print_format(template_name):
|
||||
</span>
|
||||
<span style="top:%(date_dist_from_top_edge)s cm; left:%(date_dist_from_left_edge)scm;
|
||||
position: absolute;">
|
||||
{{doc.reference_date or '' }}
|
||||
{{ frappe.utils.formatdate(doc.reference_date) or '' }}
|
||||
</span>
|
||||
<span style="top:%(acc_no_dist_from_top_edge)scm;left:%(acc_no_dist_from_left_edge)scm;
|
||||
position: absolute;">
|
||||
|
||||
@@ -23,6 +23,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": "",
|
||||
@@ -50,6 +51,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": "Cost Center Name",
|
||||
@@ -79,6 +81,7 @@
|
||||
"ignore_user_permissions": 1,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Parent Cost Center",
|
||||
@@ -109,6 +112,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Company",
|
||||
@@ -139,6 +143,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -167,6 +172,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 Group",
|
||||
@@ -194,7 +200,8 @@
|
||||
"hidden": 1,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "lft",
|
||||
@@ -223,7 +230,8 @@
|
||||
"hidden": 1,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "rgt",
|
||||
@@ -253,6 +261,7 @@
|
||||
"ignore_user_permissions": 1,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "old_parent",
|
||||
@@ -278,14 +287,14 @@
|
||||
"icon": "fa fa-money",
|
||||
"idx": 1,
|
||||
"image_view": 0,
|
||||
"in_create": 1,
|
||||
"in_create": 0,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2016-11-07 05:20:40.282432",
|
||||
"modified": "2017-02-17 16:22:27.129572",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Cost Center",
|
||||
@@ -301,7 +310,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -322,7 +330,6 @@
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 0,
|
||||
"read": 1,
|
||||
@@ -343,7 +350,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -364,7 +370,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 0,
|
||||
"read": 1,
|
||||
@@ -385,7 +390,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 0,
|
||||
"read": 1,
|
||||
@@ -401,6 +405,8 @@
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"search_fields": "parent_cost_center, is_group",
|
||||
"show_name_in_global_search": 1,
|
||||
"sort_order": "ASC",
|
||||
"track_changes": 0,
|
||||
"track_seen": 0
|
||||
}
|
||||
@@ -3,24 +3,30 @@
|
||||
"allow_import": 1,
|
||||
"allow_rename": 0,
|
||||
"autoname": "field:year",
|
||||
"beta": 0,
|
||||
"creation": "2013-01-22 16:50:25",
|
||||
"custom": 0,
|
||||
"description": "**Fiscal Year** represents a Financial Year. All accounting entries and other major transactions are tracked against **Fiscal Year**.",
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "Setup",
|
||||
"editable_grid": 0,
|
||||
"fields": [
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "For e.g. 2012, 2012-13",
|
||||
"fieldname": "year",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Year Name",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -28,7 +34,9 @@
|
||||
"oldfieldtype": "Data",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
@@ -39,19 +47,25 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "disabled",
|
||||
"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": "Disabled",
|
||||
"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,
|
||||
@@ -62,12 +76,16 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "year_start_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": "Year Start Date",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -75,7 +93,9 @@
|
||||
"oldfieldtype": "Date",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
@@ -86,18 +106,24 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "year_end_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": "Year End Date",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"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,
|
||||
@@ -108,12 +134,16 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "companies",
|
||||
"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": "Companies",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -121,7 +151,9 @@
|
||||
"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,
|
||||
@@ -133,13 +165,14 @@
|
||||
"hide_toolbar": 0,
|
||||
"icon": "fa fa-calendar",
|
||||
"idx": 1,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:47.289982",
|
||||
"modified": "2017-02-17 16:22:08.431278",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Fiscal Year",
|
||||
@@ -266,8 +299,12 @@
|
||||
"write": 0
|
||||
}
|
||||
],
|
||||
"quick_entry": 0,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 1,
|
||||
"sort_field": "name",
|
||||
"sort_order": "DESC"
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 0,
|
||||
"track_seen": 0
|
||||
}
|
||||
@@ -43,11 +43,13 @@ class FiscalYear(Document):
|
||||
|
||||
def on_update(self):
|
||||
check_duplicate_fiscal_year(self)
|
||||
frappe.cache().delete_value("fiscal_years")
|
||||
|
||||
def on_trash(self):
|
||||
global_defaults = frappe.get_doc("Global Defaults")
|
||||
if global_defaults.current_fiscal_year == self.name:
|
||||
frappe.throw(_("You cannot delete Fiscal Year {0}. Fiscal Year {0} is set as default in Global Settings").format(self.name))
|
||||
frappe.cache().delete_value("fiscal_years")
|
||||
|
||||
def validate_overlap(self):
|
||||
existing_fiscal_years = frappe.db.sql("""select name from `tabFiscal Year`
|
||||
|
||||
@@ -2,13 +2,12 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
import frappe, erpnext
|
||||
from frappe import _
|
||||
from frappe.utils import flt, fmt_money, getdate, formatdate
|
||||
from frappe.model.document import Document
|
||||
from erpnext.accounts.party import validate_party_gle_currency, validate_party_frozen_disabled
|
||||
from erpnext.accounts.utils import get_account_currency
|
||||
from erpnext.setup.doctype.company.company import get_company_currency
|
||||
from erpnext.accounts.utils import get_fiscal_year
|
||||
from erpnext.exceptions import InvalidAccountCurrency
|
||||
|
||||
@@ -18,22 +17,27 @@ class GLEntry(Document):
|
||||
def validate(self):
|
||||
self.flags.ignore_submit_comment = True
|
||||
self.check_mandatory()
|
||||
self.pl_must_have_cost_center()
|
||||
self.check_pl_account()
|
||||
self.validate_cost_center()
|
||||
self.validate_party()
|
||||
self.validate_currency()
|
||||
self.validate_and_set_fiscal_year()
|
||||
|
||||
def on_update_with_args(self, adv_adj, update_outstanding = 'Yes'):
|
||||
self.validate_account_details(adv_adj)
|
||||
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)
|
||||
check_freezing_date(self.posting_date, adv_adj)
|
||||
|
||||
validate_frozen_account(self.account, adv_adj)
|
||||
check_freezing_date(self.posting_date, adv_adj)
|
||||
validate_balance_type(self.account, adv_adj)
|
||||
|
||||
# Update outstanding amt on against voucher
|
||||
if self.against_voucher_type in ['Journal Entry', 'Sales Invoice', 'Purchase Invoice'] \
|
||||
and self.against_voucher and update_outstanding == 'Yes':
|
||||
and self.against_voucher and update_outstanding == 'Yes' and not from_repost:
|
||||
update_outstanding_amt(self.account, self.party_type, self.party, self.against_voucher_type,
|
||||
self.against_voucher)
|
||||
|
||||
@@ -51,7 +55,7 @@ class GLEntry(Document):
|
||||
elif account_type == "Payable":
|
||||
frappe.throw(_("{0} {1}: Supplier is required against Payable account {2}")
|
||||
.format(self.voucher_type, self.voucher_no, self.account))
|
||||
|
||||
|
||||
# Zero value transaction is not allowed
|
||||
if not (flt(self.debit) or flt(self.credit)):
|
||||
frappe.throw(_("{0} {1}: Either debit or credit amount is required for {2}")
|
||||
@@ -111,7 +115,7 @@ class GLEntry(Document):
|
||||
validate_party_frozen_disabled(self.party_type, self.party)
|
||||
|
||||
def validate_currency(self):
|
||||
company_currency = get_company_currency(self.company)
|
||||
company_currency = erpnext.get_company_currency(self.company)
|
||||
account_currency = get_account_currency(self.account)
|
||||
|
||||
if not self.account_currency:
|
||||
@@ -119,7 +123,7 @@ class GLEntry(Document):
|
||||
|
||||
if account_currency != self.account_currency:
|
||||
frappe.throw(_("{0} {1}: Accounting Entry for {2} can only be made in currency: {3}")
|
||||
.format(self.voucher_type, self.voucher_no, self.account,
|
||||
.format(self.voucher_type, self.voucher_no, self.account,
|
||||
(account_currency or company_currency)), InvalidAccountCurrency)
|
||||
|
||||
if self.party_type and self.party:
|
||||
|
||||
@@ -38,7 +38,7 @@ frappe.ui.form.on("Journal Entry", {
|
||||
},
|
||||
|
||||
posting_date: function(frm) {
|
||||
if(!frm.doc.multi_currency) return;
|
||||
if(!frm.doc.multi_currency || !frm.doc.posting_date) return;
|
||||
|
||||
$.each(frm.doc.accounts || [], function(i, row) {
|
||||
erpnext.journal_entry.set_exchange_rate(frm, row.doctype, row.name);
|
||||
@@ -86,9 +86,9 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
|
||||
};
|
||||
});
|
||||
|
||||
me.frm.set_query("party_type", "accounts", function(doc, cdt, cdn) {
|
||||
return {
|
||||
filters: {"name": ["in", ["Customer", "Supplier"]]}
|
||||
me.frm.set_query("party_type", "accounts", function() {
|
||||
return{
|
||||
query: "erpnext.setup.doctype.party_type.party_type.get_party_type"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 1,
|
||||
"allow_rename": 0,
|
||||
"autoname": "naming_series:",
|
||||
@@ -22,6 +23,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": "",
|
||||
@@ -51,6 +53,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": "Title",
|
||||
@@ -79,7 +82,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Entry Type",
|
||||
@@ -110,6 +114,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": "Series",
|
||||
@@ -140,6 +145,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -167,7 +173,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Posting Date",
|
||||
@@ -196,7 +203,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Company",
|
||||
@@ -227,6 +235,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": "",
|
||||
@@ -256,6 +265,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": "Accounting Entries",
|
||||
@@ -286,6 +296,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -312,7 +323,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Reference Number",
|
||||
@@ -342,6 +354,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 Date",
|
||||
@@ -370,7 +383,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "User Remark",
|
||||
@@ -400,6 +414,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -425,7 +440,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Total Debit",
|
||||
@@ -455,7 +471,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Total Credit",
|
||||
@@ -487,6 +504,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": "Difference (Dr - Cr)",
|
||||
@@ -518,6 +536,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": "Make Difference Entry",
|
||||
@@ -546,6 +565,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": "Multi Currency",
|
||||
@@ -574,6 +594,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": "Total Amount Currency",
|
||||
@@ -603,6 +624,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": "Total Amount",
|
||||
@@ -631,6 +653,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": "Total Amount in Words",
|
||||
@@ -658,6 +681,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",
|
||||
@@ -685,7 +709,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Clearance Date",
|
||||
@@ -716,6 +741,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Remark",
|
||||
@@ -745,6 +771,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -771,6 +798,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": "Bill No",
|
||||
@@ -800,6 +828,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": "Bill Date",
|
||||
@@ -829,6 +858,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": "Due Date",
|
||||
@@ -859,6 +889,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": "Write Off",
|
||||
@@ -889,6 +920,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": "Write Off Based On",
|
||||
@@ -918,6 +950,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": "Get Outstanding Invoices",
|
||||
@@ -946,6 +979,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -974,6 +1008,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": "Write Off Amount",
|
||||
@@ -1002,6 +1037,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": "Printing Settings",
|
||||
@@ -1030,6 +1066,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": "Pay To / Recd From",
|
||||
@@ -1057,6 +1094,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -1084,6 +1122,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": "Letter Head",
|
||||
@@ -1112,6 +1151,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": "Print Heading",
|
||||
@@ -1142,6 +1182,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": "More Information",
|
||||
@@ -1171,6 +1212,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -1200,7 +1242,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Is Opening",
|
||||
@@ -1232,6 +1275,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": "Stock Entry",
|
||||
@@ -1261,6 +1305,7 @@
|
||||
"ignore_user_permissions": 1,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Amended From",
|
||||
@@ -1281,19 +1326,19 @@
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"icon": "fa fa-file-text",
|
||||
"idx": 176,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 1,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2016-11-07 05:53:46.738161",
|
||||
"modified": "2017-04-10 12:07:44.599804",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Journal Entry",
|
||||
@@ -1309,7 +1354,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -1330,7 +1374,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -1351,7 +1394,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -1367,8 +1409,10 @@
|
||||
"read_only": 0,
|
||||
"read_only_onload": 1,
|
||||
"search_fields": "voucher_type,posting_date, due_date, cheque_no",
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"title_field": "title",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
}
|
||||
@@ -2,13 +2,14 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe, json
|
||||
import frappe, erpnext, json
|
||||
from frappe.utils import cstr, flt, fmt_money, formatdate
|
||||
from frappe import msgprint, _, scrub
|
||||
from erpnext.controllers.accounts_controller import AccountsController
|
||||
from erpnext.accounts.utils import get_balance_on, get_account_currency
|
||||
from erpnext.setup.utils import get_company_currency
|
||||
from erpnext.accounts.party import get_party_account
|
||||
from erpnext.hr.doctype.expense_claim.expense_claim import update_reimbursed_amount
|
||||
from erpnext.hr.doctype.employee_loan.employee_loan import update_disbursement_status
|
||||
|
||||
class JournalEntry(AccountsController):
|
||||
def __init__(self, arg1, arg2=None):
|
||||
@@ -37,19 +38,15 @@ class JournalEntry(AccountsController):
|
||||
self.validate_credit_debit_note()
|
||||
self.validate_empty_accounts_table()
|
||||
self.set_account_and_party_balance()
|
||||
self.clear_zero_debit_credit_row()
|
||||
if not self.title:
|
||||
self.title = self.get_title()
|
||||
|
||||
def clear_zero_debit_credit_row(self):
|
||||
self.accounts = [account for account in self.accounts
|
||||
if not (account.debit_in_account_currency==0.0 and account.credit_in_account_currency==0.0)]
|
||||
|
||||
def on_submit(self):
|
||||
self.check_credit_limit()
|
||||
self.make_gl_entries()
|
||||
self.update_advance_paid()
|
||||
self.update_expense_claim()
|
||||
self.update_employee_loan()
|
||||
|
||||
def get_title(self):
|
||||
return self.pay_to_recd_from or self.accounts[0].account
|
||||
@@ -73,7 +70,9 @@ class JournalEntry(AccountsController):
|
||||
self.make_gl_entries(1)
|
||||
self.update_advance_paid()
|
||||
self.update_expense_claim()
|
||||
self.update_employee_loan()
|
||||
self.unlink_advance_entry_reference()
|
||||
self.unlink_asset_reference()
|
||||
|
||||
def unlink_advance_entry_reference(self):
|
||||
for d in self.get("accounts"):
|
||||
@@ -83,6 +82,18 @@ class JournalEntry(AccountsController):
|
||||
d.reference_type = ''
|
||||
d.reference_name = ''
|
||||
d.db_update()
|
||||
|
||||
def unlink_asset_reference(self):
|
||||
for d in self.get("accounts"):
|
||||
if d.reference_type=="Asset" and d.reference_name:
|
||||
asset = frappe.get_doc("Asset", d.reference_name)
|
||||
for s in asset.get("schedules"):
|
||||
if s.journal_entry == self.name:
|
||||
s.db_set("journal_entry", None)
|
||||
asset.value_after_depreciation += s.depreciation_amount
|
||||
|
||||
asset.db_set("value_after_depreciation", asset.value_after_depreciation)
|
||||
asset.set_status()
|
||||
|
||||
def validate_party(self):
|
||||
for d in self.get("accounts"):
|
||||
@@ -326,10 +337,12 @@ class JournalEntry(AccountsController):
|
||||
if d.account_currency == self.company_currency:
|
||||
d.exchange_rate = 1
|
||||
elif not d.exchange_rate or d.exchange_rate == 1 or \
|
||||
(d.reference_type in ("Sales Invoice", "Purchase Invoice") and d.reference_name and d.posting_date):
|
||||
(d.reference_type in ("Sales Invoice", "Purchase Invoice")
|
||||
and d.reference_name and self.posting_date):
|
||||
|
||||
# Modified to include the posting date for which to retreive the exchange rate
|
||||
d.exchange_rate = get_exchange_rate(self.posting_date, d.account, d.account_currency, self.company,
|
||||
d.reference_type, d.reference_name, d.debit, d.credit, d.exchange_rate)
|
||||
d.exchange_rate = get_exchange_rate(self.posting_date, d.account, d.account_currency,
|
||||
self.company, d.reference_type, d.reference_name, d.debit, d.credit, d.exchange_rate)
|
||||
|
||||
if not d.exchange_rate:
|
||||
frappe.throw(_("Row {0}: Exchange Rate is mandatory").format(d.idx))
|
||||
@@ -373,7 +386,7 @@ class JournalEntry(AccountsController):
|
||||
bank_amount = party_amount = total_amount = 0.0
|
||||
currency = bank_account_currency = party_account_currency = pay_to_recd_from= None
|
||||
for d in self.get('accounts'):
|
||||
if d.party_type and d.party:
|
||||
if d.party_type in ['Customer', 'Supplier'] and d.party:
|
||||
if not pay_to_recd_from:
|
||||
pay_to_recd_from = frappe.db.get_value(d.party_type, d.party,
|
||||
"customer_name" if d.party_type=="Customer" else "supplier_name")
|
||||
@@ -434,7 +447,7 @@ class JournalEntry(AccountsController):
|
||||
if not self.get('accounts'):
|
||||
msgprint(_("'Entries' cannot be empty"), raise_exception=True)
|
||||
else:
|
||||
flag, self.total_debit, self.total_credit = 0, 0, 0
|
||||
self.total_debit, self.total_credit = 0, 0
|
||||
diff = flt(self.difference, self.precision("difference"))
|
||||
|
||||
# If any row without amount, set the diff on that row
|
||||
@@ -501,11 +514,15 @@ class JournalEntry(AccountsController):
|
||||
|
||||
def update_expense_claim(self):
|
||||
for d in self.accounts:
|
||||
if d.reference_type=="Expense Claim":
|
||||
amt = frappe.db.sql("""select sum(debit) as amt from `tabJournal Entry Account`
|
||||
where reference_type = "Expense Claim" and
|
||||
reference_name = %s and docstatus = 1""", d.reference_name ,as_dict=1)[0].amt
|
||||
frappe.db.set_value("Expense Claim", d.reference_name , "total_amount_reimbursed", amt)
|
||||
if d.reference_type=="Expense Claim" and d.party:
|
||||
doc = frappe.get_doc("Expense Claim", d.reference_name)
|
||||
update_reimbursed_amount(doc)
|
||||
|
||||
def update_employee_loan(self):
|
||||
for d in self.accounts:
|
||||
if d.reference_type=="Employee Loan" and flt(d.debit) > 0:
|
||||
doc = frappe.get_doc("Employee Loan", d.reference_name)
|
||||
update_disbursement_status(doc)
|
||||
|
||||
def validate_expense_claim(self):
|
||||
for d in self.accounts:
|
||||
@@ -564,7 +581,7 @@ def get_default_bank_cash_account(company, account_type=None, mode_of_payment=No
|
||||
if account:
|
||||
account_details = frappe.db.get_value("Account", account,
|
||||
["account_currency", "account_type"], as_dict=1)
|
||||
|
||||
|
||||
return frappe._dict({
|
||||
"account": account,
|
||||
"balance": get_balance_on(account),
|
||||
@@ -649,9 +666,10 @@ def get_payment_entry(ref_doc, args):
|
||||
cost_center = frappe.db.get_value("Company", ref_doc.company, "cost_center")
|
||||
exchange_rate = 1
|
||||
if args.get("party_account"):
|
||||
# Modified to include the posting date for which the exchange rate is required.
|
||||
# Modified to include the posting date for which the exchange rate is required.
|
||||
# Assumed to be the posting date in the reference document
|
||||
exchange_rate = get_exchange_rate(ref_doc.posting_date, args.get("party_account"), args.get("party_account_currency"),
|
||||
exchange_rate = get_exchange_rate(ref_doc.get("posting_date") or ref_doc.get("transaction_date"),
|
||||
args.get("party_account"), args.get("party_account_currency"),
|
||||
ref_doc.company, ref_doc.doctype, ref_doc.name)
|
||||
|
||||
je = frappe.new_doc("Journal Entry")
|
||||
@@ -684,9 +702,10 @@ def get_payment_entry(ref_doc, args):
|
||||
bank_account = get_default_bank_cash_account(ref_doc.company, "Bank", account=args.get("bank_account"))
|
||||
if bank_account:
|
||||
bank_row.update(bank_account)
|
||||
# Modified to include the posting date for which the exchange rate is required.
|
||||
# Modified to include the posting date for which the exchange rate is required.
|
||||
# Assumed to be the posting date of the reference date
|
||||
bank_row.exchange_rate = get_exchange_rate(ref_doc.posting_date, bank_account["account"],
|
||||
bank_row.exchange_rate = get_exchange_rate(ref_doc.get("posting_date")
|
||||
or ref_doc.get("transaction_date"), bank_account["account"],
|
||||
bank_account["account_currency"], ref_doc.company)
|
||||
|
||||
bank_row.cost_center = cost_center
|
||||
@@ -711,8 +730,14 @@ def get_payment_entry(ref_doc, args):
|
||||
@frappe.whitelist()
|
||||
def get_opening_accounts(company):
|
||||
"""get all balance sheet accounts for opening entry"""
|
||||
accounts = frappe.db.sql_list("""select name from tabAccount
|
||||
where is_group=0 and report_type='Balance Sheet' and company=%s""", company)
|
||||
accounts = frappe.db.sql_list("""select
|
||||
name from tabAccount
|
||||
where
|
||||
is_group=0 and
|
||||
report_type='Balance Sheet' and
|
||||
ifnull(warehouse, '') = '' and
|
||||
company=%s
|
||||
order by name asc""", company)
|
||||
|
||||
return [{"account": a, "balance": get_balance_on(a)} for a in accounts]
|
||||
|
||||
@@ -733,7 +758,7 @@ def get_outstanding(args):
|
||||
if isinstance(args, basestring):
|
||||
args = json.loads(args)
|
||||
|
||||
company_currency = get_company_currency(args.get("company"))
|
||||
company_currency = erpnext.get_company_currency(args.get("company"))
|
||||
|
||||
if args.get("doctype") == "Journal Entry":
|
||||
condition = " and party=%(party)s" if args.get("party") else ""
|
||||
@@ -792,7 +817,7 @@ def get_account_balance_and_party_type(account, date, company, debit=None, credi
|
||||
if not frappe.has_permission("Account"):
|
||||
frappe.msgprint(_("No Permission"), raise_exception=1)
|
||||
|
||||
company_currency = get_company_currency(company)
|
||||
company_currency = erpnext.get_company_currency(company)
|
||||
account_details = frappe.db.get_value("Account", account, ["account_type", "account_currency"], as_dict=1)
|
||||
|
||||
if not account_details:
|
||||
@@ -810,8 +835,8 @@ def get_account_balance_and_party_type(account, date, company, debit=None, credi
|
||||
"party_type": party_type,
|
||||
"account_type": account_details.account_type,
|
||||
"account_currency": account_details.account_currency or company_currency,
|
||||
|
||||
# The date used to retreive the exchange rate here is the date passed in
|
||||
|
||||
# The date used to retreive the exchange rate here is the date passed in
|
||||
# as an argument to this function. It is assumed to be the date on which the balance is sought
|
||||
"exchange_rate": get_exchange_rate(date, account, account_details.account_currency,
|
||||
company, debit=debit, credit=credit, exchange_rate=exchange_rate)
|
||||
@@ -825,7 +850,7 @@ def get_account_balance_and_party_type(account, date, company, debit=None, credi
|
||||
|
||||
# Added posting_date as one of the parameters of get_exchange_rate
|
||||
@frappe.whitelist()
|
||||
def get_exchange_rate(posting_date, account, account_currency=None, company=None,
|
||||
def get_exchange_rate(posting_date, account=None, account_currency=None, company=None,
|
||||
reference_type=None, reference_name=None, debit=None, credit=None, exchange_rate=None):
|
||||
from erpnext.setup.utils import get_exchange_rate
|
||||
account_details = frappe.db.get_value("Account", account,
|
||||
@@ -840,7 +865,7 @@ def get_exchange_rate(posting_date, account, account_currency=None, company=None
|
||||
if not account_currency:
|
||||
account_currency = account_details.account_currency
|
||||
|
||||
company_currency = get_company_currency(company)
|
||||
company_currency = erpnext.get_company_currency(company)
|
||||
|
||||
if account_currency != company_currency:
|
||||
if reference_type in ("Sales Invoice", "Purchase Invoice") and reference_name:
|
||||
@@ -851,7 +876,7 @@ def get_exchange_rate(posting_date, account, account_currency=None, company=None
|
||||
(account_details.root_type == "Liability" and debit)):
|
||||
exchange_rate = get_average_exchange_rate(account)
|
||||
|
||||
# The date used to retreive the exchange rate here is the date passed
|
||||
# The date used to retreive the exchange rate here is the date passed
|
||||
# in as an argument to this function.
|
||||
if not exchange_rate and account_currency and posting_date:
|
||||
exchange_rate = get_exchange_rate(account_currency, company_currency, posting_date)
|
||||
|
||||
@@ -171,20 +171,6 @@ class TestJournalEntry(unittest.TestCase):
|
||||
})
|
||||
|
||||
jv.submit()
|
||||
|
||||
def test_clear_blank_rows(self):
|
||||
je = make_journal_entry("_Test Bank - _TC", "_Test Account Stock Expenses - _TC", 100, save=False)
|
||||
je.append("accounts", {
|
||||
"account": "_Test Cash - _TC",
|
||||
"debit_in_account_currency": 0,
|
||||
"credit_in_account_currency": 0,
|
||||
"exchange_rate": 1
|
||||
})
|
||||
|
||||
self.assertEqual(len(je.get("accounts")), 3)
|
||||
je.save()
|
||||
self.assertEqual(len(je.get("accounts")), 2)
|
||||
|
||||
|
||||
def make_journal_entry(account1, account2, amount, cost_center=None, posting_date=None, exchange_rate=1, save=True, submit=False, project=None):
|
||||
if not cost_center:
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "Document",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
@@ -20,8 +22,10 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -33,6 +37,7 @@
|
||||
"print_hide_if_no_value": 0,
|
||||
"print_width": "250px",
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 1,
|
||||
@@ -51,7 +56,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Account Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -60,6 +67,7 @@
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
@@ -77,7 +85,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Account Balance",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -88,6 +98,7 @@
|
||||
"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,
|
||||
@@ -106,8 +117,10 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Cost Center",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -119,6 +132,7 @@
|
||||
"print_hide_if_no_value": 0,
|
||||
"print_width": "180px",
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
@@ -137,13 +151,16 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
@@ -161,7 +178,9 @@
|
||||
"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,
|
||||
@@ -170,6 +189,7 @@
|
||||
"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,
|
||||
@@ -187,7 +207,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Party",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -196,6 +218,7 @@
|
||||
"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,
|
||||
@@ -213,7 +236,9 @@
|
||||
"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 Balance",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -223,6 +248,7 @@
|
||||
"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,
|
||||
@@ -242,7 +268,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Currency",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -251,6 +279,7 @@
|
||||
"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,
|
||||
@@ -268,7 +297,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Account Currency",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -278,6 +309,7 @@
|
||||
"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,
|
||||
@@ -295,7 +327,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -303,6 +337,7 @@
|
||||
"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,
|
||||
@@ -320,7 +355,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Exchange Rate",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -329,6 +366,7 @@
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
@@ -346,7 +384,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -354,6 +394,7 @@
|
||||
"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,
|
||||
@@ -371,7 +412,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Debit",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -381,6 +424,7 @@
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 1,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
@@ -398,7 +442,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Debit in Company Currency",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -410,6 +456,7 @@
|
||||
"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,
|
||||
@@ -427,13 +474,16 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
@@ -451,7 +501,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Credit",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -461,6 +513,7 @@
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 1,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
@@ -478,7 +531,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Credit in Company Currency",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -490,6 +545,7 @@
|
||||
"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,
|
||||
@@ -507,7 +563,9 @@
|
||||
"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",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -515,6 +573,7 @@
|
||||
"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,
|
||||
@@ -532,16 +591,19 @@
|
||||
"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",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "\nSales Invoice\nPurchase Invoice\nJournal Entry\nSales Order\nPurchase Order\nExpense Claim\nAsset",
|
||||
"options": "\nSales Invoice\nPurchase Invoice\nJournal Entry\nSales Order\nPurchase Order\nExpense Claim\nAsset\nEmployee Loan",
|
||||
"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,
|
||||
@@ -559,7 +621,9 @@
|
||||
"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",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -569,6 +633,7 @@
|
||||
"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,
|
||||
@@ -586,7 +651,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Project",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -596,6 +663,7 @@
|
||||
"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,
|
||||
@@ -613,13 +681,16 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
@@ -637,7 +708,9 @@
|
||||
"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",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -648,6 +721,7 @@
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
@@ -665,7 +739,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Against Account",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -675,6 +751,7 @@
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
@@ -692,7 +769,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-08-26 01:54:32.267927",
|
||||
"modified": "2017-03-02 05:02:10.102039",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Journal Entry Account",
|
||||
@@ -701,6 +778,8 @@
|
||||
"quick_entry": 0,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
}
|
||||
@@ -23,6 +23,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": "Mode of Payment",
|
||||
@@ -52,6 +53,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Type",
|
||||
@@ -81,6 +83,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": "Accounts",
|
||||
@@ -111,7 +114,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-11-07 05:54:39.560399",
|
||||
"modified": "2017-02-17 16:31:34.207683",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Mode of Payment",
|
||||
@@ -127,7 +130,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -148,7 +150,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 0,
|
||||
"read": 1,
|
||||
@@ -163,6 +164,8 @@
|
||||
"quick_entry": 1,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 1,
|
||||
"sort_order": "ASC",
|
||||
"track_changes": 0,
|
||||
"track_seen": 0
|
||||
}
|
||||
@@ -11,9 +11,8 @@ frappe.ui.form.on('Payment Entry', {
|
||||
},
|
||||
|
||||
setup: function(frm) {
|
||||
var party_account_type = frm.doc.party_type=="Customer" ? "Receivable" : "Payable";
|
||||
|
||||
frm.set_query("paid_from", function() {
|
||||
var party_account_type = frm.doc.party_type=="Customer" ? "Receivable" : "Payable";
|
||||
var account_types = in_list(["Pay", "Internal Transfer"], frm.doc.payment_type) ?
|
||||
["Bank", "Cash"] : party_account_type;
|
||||
|
||||
@@ -26,7 +25,16 @@ frappe.ui.form.on('Payment Entry', {
|
||||
}
|
||||
});
|
||||
|
||||
frm.set_query("party_type", function() {
|
||||
return{
|
||||
"filters": {
|
||||
"name": ["in",["Customer","Supplier"]],
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
frm.set_query("paid_to", function() {
|
||||
var party_account_type = frm.doc.party_type=="Customer" ? "Receivable" : "Payable";
|
||||
var account_types = in_list(["Receive", "Internal Transfer"], frm.doc.payment_type) ?
|
||||
["Bank", "Cash"] : party_account_type;
|
||||
|
||||
@@ -79,8 +87,13 @@ frappe.ui.form.on('Payment Entry', {
|
||||
frm.events.show_general_ledger(frm);
|
||||
},
|
||||
|
||||
company: function(frm) {
|
||||
frm.events.hide_unhide_fields(frm);
|
||||
frm.events.set_dynamic_labels(frm);
|
||||
},
|
||||
|
||||
hide_unhide_fields: function(frm) {
|
||||
var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
|
||||
var company_currency = frm.doc.company? frappe.get_doc(":Company", frm.doc.company).default_currency: "";
|
||||
|
||||
frm.toggle_display("source_exchange_rate",
|
||||
(frm.doc.paid_amount && frm.doc.paid_from_account_currency != company_currency));
|
||||
@@ -118,7 +131,7 @@ frappe.ui.form.on('Payment Entry', {
|
||||
},
|
||||
|
||||
set_dynamic_labels: function(frm) {
|
||||
var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
|
||||
var company_currency = frm.doc.company? frappe.get_doc(":Company", frm.doc.company).default_currency: "";
|
||||
|
||||
frm.set_currency_labels(["base_paid_amount", "base_received_amount", "base_total_allocated_amount",
|
||||
"difference_amount"], company_currency);
|
||||
@@ -131,6 +144,10 @@ frappe.ui.form.on('Payment Entry', {
|
||||
|
||||
frm.set_currency_labels(["total_allocated_amount", "unallocated_amount"], party_account_currency);
|
||||
|
||||
var currency_field = (frm.doc.payment_type=="Receive") ? "paid_from_account_currency" : "paid_to_account_currency"
|
||||
frm.set_df_property("total_allocated_amount", "options", currency_field);
|
||||
frm.set_df_property("unallocated_amount", "options", currency_field);
|
||||
|
||||
frm.set_currency_labels(["total_amount", "outstanding_amount", "allocated_amount"],
|
||||
party_account_currency, "references");
|
||||
|
||||
@@ -741,4 +758,4 @@ frappe.ui.form.on('Payment Entry Deduction', {
|
||||
deductions_remove: function(frm) {
|
||||
frm.events.set_difference_amount(frm);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 1,
|
||||
"allow_rename": 0,
|
||||
"autoname": "naming_series:",
|
||||
@@ -22,6 +23,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": "Type of Payment",
|
||||
@@ -50,6 +52,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": "Series",
|
||||
@@ -79,6 +82,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Payment Type",
|
||||
@@ -97,95 +101,6 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:in_list([\"Receive\", \"Pay\"], doc.payment_type)",
|
||||
"fieldname": "party_type",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Party Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Customer\nSupplier",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:in_list([\"Receive\", \"Pay\"], doc.payment_type) && doc.party_type",
|
||||
"fieldname": "party",
|
||||
"fieldtype": "Dynamic Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Party",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "party_type",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "",
|
||||
"fieldname": "party_name",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Party Name",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -197,6 +112,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -225,6 +141,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",
|
||||
@@ -253,6 +170,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": "Company",
|
||||
@@ -282,6 +200,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": "Mode of Payment",
|
||||
@@ -300,6 +219,158 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:in_list([\"Receive\", \"Pay\"], doc.payment_type)",
|
||||
"fieldname": "party_section",
|
||||
"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": "Payment From / To",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "",
|
||||
"depends_on": "eval:in_list([\"Receive\", \"Pay\"], doc.payment_type) && doc.docstatus==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": 1,
|
||||
"label": "Party Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "DocType",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:in_list([\"Receive\", \"Pay\"], doc.payment_type) && doc.party_type",
|
||||
"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": 1,
|
||||
"label": "Party",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "party_type",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break_11",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"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",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Party Name",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -311,6 +382,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": "Accounts",
|
||||
@@ -340,6 +412,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": "Party Balance",
|
||||
@@ -369,6 +442,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Account Paid From",
|
||||
@@ -399,6 +473,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": "Account Currency",
|
||||
@@ -429,6 +504,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": "Account Balance",
|
||||
@@ -458,6 +534,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -486,6 +563,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Account Paid To",
|
||||
@@ -516,6 +594,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": "Account Currency",
|
||||
@@ -546,6 +625,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": "Account Balance",
|
||||
@@ -577,6 +657,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": "Amount",
|
||||
@@ -606,6 +687,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": "Paid Amount",
|
||||
@@ -636,6 +718,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": "Exchange Rate",
|
||||
@@ -665,6 +748,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": "Paid Amount (Company Currency)",
|
||||
@@ -694,6 +778,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -722,6 +807,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": "Received Amount",
|
||||
@@ -752,6 +838,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": "Exchange Rate",
|
||||
@@ -781,6 +868,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": "Received Amount (Company Currency)",
|
||||
@@ -812,6 +900,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",
|
||||
@@ -842,6 +931,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": "Allocate Payment Amount",
|
||||
@@ -871,6 +961,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": "Payment References",
|
||||
@@ -901,6 +992,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": "Writeoff",
|
||||
@@ -930,6 +1022,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": "Total Allocated Amount",
|
||||
@@ -959,6 +1052,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": "Total Allocated Amount (Company Currency)",
|
||||
@@ -988,6 +1082,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": "Set Exchange Gain / Loss",
|
||||
@@ -1016,6 +1111,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -1044,6 +1140,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": "Unallocated Amount",
|
||||
@@ -1073,6 +1170,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": "Difference Amount (Company Currency)",
|
||||
@@ -1103,6 +1201,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": "Write Off Difference Amount",
|
||||
@@ -1133,6 +1232,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": "Deductions or Loss",
|
||||
@@ -1161,6 +1261,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": "Payment Deductions or Loss",
|
||||
@@ -1190,6 +1291,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": "Transaction ID",
|
||||
@@ -1219,6 +1321,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": "Cheque/Reference No",
|
||||
@@ -1247,6 +1350,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -1275,6 +1379,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": "Cheque/Reference Date",
|
||||
@@ -1304,6 +1409,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": "Clearance Date",
|
||||
@@ -1334,6 +1440,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": "More Information",
|
||||
@@ -1363,6 +1470,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": "Project",
|
||||
@@ -1392,6 +1500,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": "Remarks",
|
||||
@@ -1420,6 +1529,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -1447,6 +1557,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": "Letter Head",
|
||||
@@ -1476,6 +1587,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": "Print Heading",
|
||||
@@ -1505,6 +1617,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": "Amended From",
|
||||
@@ -1533,6 +1646,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": "Title",
|
||||
@@ -1551,17 +1665,17 @@
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 1,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-11-07 05:33:40.371480",
|
||||
"modified": "2017-04-10 12:06:22.176045",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Entry",
|
||||
@@ -1578,7 +1692,6 @@
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 1,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -1599,7 +1712,6 @@
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 1,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -1614,8 +1726,10 @@
|
||||
"quick_entry": 0,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"title_field": "title",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
}
|
||||
@@ -684,6 +684,7 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
|
||||
pe.paid_amount = paid_amount
|
||||
pe.received_amount = received_amount
|
||||
pe.allocate_payment_amount = 1
|
||||
pe.letter_head = doc.get("letter_head")
|
||||
|
||||
pe.append("references", {
|
||||
"reference_doctype": dt,
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
@@ -21,7 +22,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -49,7 +52,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Name",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -77,7 +82,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Due Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -104,7 +111,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -130,7 +139,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Total Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -157,7 +168,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Outstanding",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -184,7 +197,9 @@
|
||||
"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",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -211,7 +226,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Exchange Rate",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -238,7 +255,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-11-14 12:28:51.822341",
|
||||
"modified": "2017-02-17 16:47:17.156256",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Entry Reference",
|
||||
@@ -248,7 +265,9 @@
|
||||
"quick_entry": 1,
|
||||
"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
|
||||
}
|
||||
@@ -6,12 +6,10 @@ frappe.provide("erpnext.accounts");
|
||||
erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.extend({
|
||||
onload: function() {
|
||||
var me = this
|
||||
this.frm.set_query('party_type', function() {
|
||||
return {
|
||||
filters: {
|
||||
"name": ["in", ["Customer", "Supplier"]]
|
||||
}
|
||||
};
|
||||
this.frm.set_query("party_type", function() {
|
||||
return{
|
||||
query: "erpnext.setup.doctype.party_type.party_type.get_party_type"
|
||||
}
|
||||
});
|
||||
|
||||
this.frm.set_query('receivable_payable_account', function() {
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Reference Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -30,6 +31,7 @@
|
||||
"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,
|
||||
@@ -48,7 +50,8 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Reference_name",
|
||||
"in_standard_filter": 0,
|
||||
"label": "Reference Name",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "reference_type",
|
||||
@@ -57,6 +60,7 @@
|
||||
"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,
|
||||
@@ -75,6 +79,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Posting Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -82,6 +87,7 @@
|
||||
"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,
|
||||
@@ -100,6 +106,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Is Advance",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -107,6 +114,7 @@
|
||||
"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,
|
||||
@@ -125,6 +133,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Reference Row",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -132,6 +141,7 @@
|
||||
"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,
|
||||
@@ -150,6 +160,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -157,6 +168,7 @@
|
||||
"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,
|
||||
@@ -175,6 +187,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Invoice Number",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -183,6 +196,7 @@
|
||||
"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,
|
||||
@@ -201,6 +215,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -208,6 +223,7 @@
|
||||
"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,
|
||||
@@ -226,6 +242,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Allocated amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -234,6 +251,7 @@
|
||||
"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,
|
||||
@@ -252,6 +270,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -259,6 +278,7 @@
|
||||
"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,
|
||||
@@ -277,6 +297,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Remark",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -284,6 +305,7 @@
|
||||
"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,
|
||||
@@ -302,7 +324,7 @@
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2016-08-26 02:08:35.879133",
|
||||
"modified": "2017-01-30 01:04:22.557237",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Reconciliation Payment",
|
||||
@@ -314,5 +336,6 @@
|
||||
"read_only_onload": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 0,
|
||||
"track_seen": 0
|
||||
}
|
||||
@@ -23,6 +23,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": "Series",
|
||||
@@ -52,6 +53,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": "Recipient Message And Payment Details",
|
||||
@@ -81,6 +83,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": "Print Format",
|
||||
@@ -110,6 +113,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "To",
|
||||
@@ -138,6 +142,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Subject",
|
||||
@@ -166,6 +171,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -193,6 +199,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": "Payment Gateway Account",
|
||||
@@ -222,6 +229,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": "Transaction Currency",
|
||||
@@ -252,6 +260,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": "Amount",
|
||||
@@ -282,6 +291,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Status",
|
||||
@@ -312,6 +322,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": "Make Sales Invoice",
|
||||
@@ -340,6 +351,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -362,11 +374,12 @@
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "message",
|
||||
"fieldtype": "Small Text",
|
||||
"fieldtype": "Text",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Message",
|
||||
@@ -395,12 +408,13 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Message Examples",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "<pre><h5>Message Example</h5>\n\n<p> Thank You for being a part of {{ doc.company }}! We hope you are enjoying the service.</p>\n\n<p> Please find enclosed the E Bill statement. The outstanding amount is {{ doc.grand_total }}.</p>\n\n<p> We don't want you to be spending time running around in order to pay for your Bill.<br>After all, life is beautiful and the time you have in hand should be spent to enjoy it!<br>So here are our little ways to help you get more time for life! </p>\n\n<a href=\"{{ payment_url }}\"> click here to pay </a>\n\n</pre>\n",
|
||||
"options": "<pre><h5>Message Example</h5>\n\n<p>Dear {{ doc.contact_person }},</p>\n\n<p>Requesting payment for {{ doc.doctype }}, {{ doc.name }} for {{ doc.grand_total }}.</p>\n\n<a href=\"{{ payment_url }}\"> click here to pay </a>\n\n</pre>\n",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
@@ -424,6 +438,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": "Mute Email",
|
||||
@@ -452,6 +467,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": "payment_url",
|
||||
@@ -481,6 +497,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": "Payment Gateway Details",
|
||||
@@ -509,6 +526,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": "Payment Gateway",
|
||||
@@ -538,6 +556,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": "Payment Account",
|
||||
@@ -567,6 +586,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 Details",
|
||||
@@ -595,6 +615,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Reference Doctype",
|
||||
@@ -624,6 +645,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Reference Name",
|
||||
@@ -653,6 +675,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": "Amended From",
|
||||
@@ -675,13 +698,13 @@
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 1,
|
||||
"in_create": 0,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 1,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-12-15 14:46:19.662816",
|
||||
"modified": "2017-02-23 05:03:37.464863",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Request",
|
||||
@@ -698,7 +721,6 @@
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -719,7 +741,6 @@
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -734,7 +755,9 @@
|
||||
"quick_entry": 0,
|
||||
"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
|
||||
}
|
||||
@@ -10,7 +10,7 @@ from frappe.utils import flt, nowdate, get_url
|
||||
from erpnext.accounts.party import get_party_account
|
||||
from erpnext.accounts.utils import get_account_currency
|
||||
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry, get_company_defaults
|
||||
from frappe.integration_broker.doctype.integration_service.integration_service import get_integration_controller
|
||||
from frappe.integrations.utils import get_payment_gateway_controller
|
||||
|
||||
class PaymentRequest(Document):
|
||||
def validate(self):
|
||||
@@ -26,7 +26,7 @@ class PaymentRequest(Document):
|
||||
ref_doc = frappe.get_doc(self.reference_doctype, self.reference_name)
|
||||
if self.payment_account and ref_doc.currency != frappe.db.get_value("Account", self.payment_account, "account_currency"):
|
||||
frappe.throw(_("Transaction currency must be same as Payment Gateway currency"))
|
||||
|
||||
|
||||
def on_submit(self):
|
||||
send_mail = True
|
||||
self.make_communication_entry()
|
||||
@@ -54,22 +54,22 @@ class PaymentRequest(Document):
|
||||
def set_payment_request_url(self):
|
||||
if self.payment_account:
|
||||
self.payment_url = self.get_payment_url()
|
||||
|
||||
|
||||
if self.payment_url:
|
||||
self.db_set('payment_url', self.payment_url)
|
||||
|
||||
|
||||
if self.payment_url or not self.payment_gateway_account:
|
||||
self.db_set('status', 'Initiated')
|
||||
|
||||
|
||||
def get_payment_url(self):
|
||||
data = frappe.db.get_value(self.reference_doctype, self.reference_name,
|
||||
["company", "customer_name"], as_dict=1)
|
||||
|
||||
controller = get_integration_controller(self.payment_gateway)
|
||||
|
||||
controller = get_payment_gateway_controller(self.payment_gateway)
|
||||
controller.validate_transaction_currency(self.currency)
|
||||
|
||||
|
||||
return controller.get_payment_url(**{
|
||||
"amount": self.grand_total,
|
||||
"amount": flt(self.grand_total, self.precision("grand_total")),
|
||||
"title": data.company,
|
||||
"description": self.subject,
|
||||
"reference_doctype": "Payment Request",
|
||||
@@ -83,7 +83,7 @@ class PaymentRequest(Document):
|
||||
def set_as_paid(self):
|
||||
if frappe.session.user == "Guest":
|
||||
frappe.set_user("Administrator")
|
||||
|
||||
|
||||
payment_entry = self.create_payment_entry()
|
||||
self.make_invoice()
|
||||
|
||||
@@ -157,7 +157,7 @@ class PaymentRequest(Document):
|
||||
|
||||
def set_as_cancelled(self):
|
||||
self.db_set("status", "Cancelled")
|
||||
|
||||
|
||||
def check_if_payment_entry_exists(self):
|
||||
if self.status == "Paid":
|
||||
payment_entry = frappe.db.sql_list("""select parent from `tabPayment Entry Reference`
|
||||
@@ -179,11 +179,11 @@ class PaymentRequest(Document):
|
||||
|
||||
def get_payment_success_url(self):
|
||||
return self.payment_success_url
|
||||
|
||||
|
||||
def on_payment_authorized(self, status=None):
|
||||
if not status:
|
||||
return
|
||||
|
||||
|
||||
shopping_cart_settings = frappe.get_doc("Shopping Cart Settings")
|
||||
|
||||
if status in ["Authorized", "Completed"]:
|
||||
@@ -203,9 +203,9 @@ class PaymentRequest(Document):
|
||||
}).get(success_url, "me")
|
||||
else:
|
||||
redirect_to = get_url("/orders/{0}".format(self.reference_name))
|
||||
|
||||
|
||||
return redirect_to
|
||||
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def make_payment_request(**args):
|
||||
"""Make payment request"""
|
||||
@@ -234,7 +234,7 @@ def make_payment_request(**args):
|
||||
"grand_total": grand_total,
|
||||
"email_to": args.recipient_id or "",
|
||||
"subject": "Payment Request for %s"%args.dn,
|
||||
"message": gateway_account.get("message") or get_dummy_message(args.use_dummy_message),
|
||||
"message": gateway_account.get("message") or get_dummy_message(ref_doc),
|
||||
"reference_doctype": args.dt,
|
||||
"reference_name": args.dn
|
||||
})
|
||||
@@ -319,19 +319,24 @@ def make_status_as_paid(doc, method):
|
||||
payment_request_name = frappe.db.get_value("Payment Request",
|
||||
{"reference_doctype": ref.reference_doctype, "reference_name": ref.reference_name,
|
||||
"docstatus": 1})
|
||||
|
||||
|
||||
if payment_request_name:
|
||||
doc = frappe.get_doc("Payment Request", payment_request_name)
|
||||
if doc.status != "Paid":
|
||||
doc.db_set('status', 'Paid')
|
||||
frappe.db.commit()
|
||||
|
||||
def get_dummy_message(use_dummy_message=True):
|
||||
return """
|
||||
<p> Hope you are enjoying a service. Please consider bank details for payment </p>
|
||||
<p> Bank Details <p><br>
|
||||
<p> Bank Name : National Bank </p>
|
||||
<p> Account Number : 123456789000872 </p>
|
||||
<p> IFSC code : NB000001 </p>
|
||||
<p> Account Name : Wind Power LLC </p>
|
||||
"""
|
||||
def get_dummy_message(doc):
|
||||
return frappe.render_template("""{% if doc.contact_person -%}
|
||||
<p>Dear {{ doc.contact_person }},</p>
|
||||
{%- else %}<p>Hello,</p>{% endif %}
|
||||
|
||||
<p>{{ _("Requesting payment against {0} {1} for amount {2}").format(doc.doctype,
|
||||
doc.name, doc.get_formatted("grand_total")) }}</p>
|
||||
|
||||
<a href="{{ payment_url }}">{{ _("Make Payment") }}</a>
|
||||
|
||||
<p>{{ _("If you have any questions, please get back to us.") }}</p>
|
||||
|
||||
<p>{{ _("Thank you for your business!") }}</p>
|
||||
""", dict(doc=doc, payment_url = '{{ payment_url }}'))
|
||||
|
||||
@@ -35,9 +35,9 @@ class PeriodClosingVoucher(AccountsController):
|
||||
def validate_posting_date(self):
|
||||
from erpnext.accounts.utils import get_fiscal_year, validate_fiscal_year
|
||||
|
||||
validate_fiscal_year(self.posting_date, self.fiscal_year, label=_("Posting Date"), doc=self)
|
||||
validate_fiscal_year(self.posting_date, self.fiscal_year, self.company, label=_("Posting Date"), doc=self)
|
||||
|
||||
self.year_start_date = get_fiscal_year(self.posting_date, self.fiscal_year)[1]
|
||||
self.year_start_date = get_fiscal_year(self.posting_date, self.fiscal_year, company=self.company)[1]
|
||||
|
||||
pce = frappe.db.sql("""select name from `tabPeriod Closing Voucher`
|
||||
where posting_date > %s and fiscal_year = %s and docstatus = 1""",
|
||||
|
||||
@@ -11,7 +11,7 @@ from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journ
|
||||
|
||||
class TestPeriodClosingVoucher(unittest.TestCase):
|
||||
def test_closing_entry(self):
|
||||
year_start_date = get_fiscal_year(today())[1]
|
||||
year_start_date = get_fiscal_year(today(), company="_Test Company")[1]
|
||||
|
||||
make_journal_entry("_Test Bank - _TC", "Sales - _TC", 400,
|
||||
"_Test Cost Center - _TC", posting_date=now(), submit=True)
|
||||
@@ -70,7 +70,7 @@ class TestPeriodClosingVoucher(unittest.TestCase):
|
||||
"doctype": "Period Closing Voucher",
|
||||
"closing_account_head": "_Test Account Reserves and Surplus - _TC",
|
||||
"company": "_Test Company",
|
||||
"fiscal_year": get_fiscal_year(today())[0],
|
||||
"fiscal_year": get_fiscal_year(today(), company="_Test Company")[0],
|
||||
"posting_date": today(),
|
||||
"remarks": "test"
|
||||
})
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"autoname": "hash",
|
||||
@@ -21,8 +22,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Applicable for User",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -51,6 +53,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": "Series",
|
||||
@@ -83,6 +86,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": "Update Stock",
|
||||
@@ -111,6 +115,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": "Warehouse",
|
||||
@@ -141,6 +146,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": "Campaign",
|
||||
@@ -159,34 +165,6 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "ignore_pricing_rule",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Ignore Pricing Rule",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -198,6 +176,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -225,6 +204,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": "Customer",
|
||||
@@ -255,8 +235,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Company",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -274,6 +255,36 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "country",
|
||||
"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": "Country",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "company.country",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -285,6 +296,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": "Currency",
|
||||
@@ -304,6 +316,35 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "ignore_pricing_rule",
|
||||
"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": "Ignore Pricing Rule",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -315,6 +356,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": "Allow Delete",
|
||||
@@ -332,6 +374,35 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "allow_user_to_edit_rate",
|
||||
"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": "Allow user to edit Rate",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -343,6 +414,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -370,6 +442,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": "Sales Invoice Payment",
|
||||
@@ -399,6 +472,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -426,6 +500,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": "Item Groups",
|
||||
@@ -455,6 +530,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -482,6 +558,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": "Customer Groups",
|
||||
@@ -511,6 +588,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -539,6 +617,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": "Print Format",
|
||||
@@ -568,6 +647,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": "Letter Head",
|
||||
@@ -598,6 +678,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": "Print Heading",
|
||||
@@ -628,6 +709,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": "Terms and Conditions",
|
||||
@@ -658,6 +740,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -686,6 +769,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": "Territory",
|
||||
@@ -716,6 +800,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": "Price List",
|
||||
@@ -746,6 +831,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": "Apply Discount",
|
||||
@@ -776,6 +862,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": "Apply Discount On",
|
||||
@@ -805,6 +892,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -833,6 +921,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": "Write Off Account",
|
||||
@@ -862,6 +951,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": "Write Off Cost Center",
|
||||
@@ -891,6 +981,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": "Account for Change Amount",
|
||||
@@ -920,6 +1011,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": "Taxes and Charges",
|
||||
@@ -950,6 +1042,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -977,6 +1070,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": "Income Account",
|
||||
@@ -1008,6 +1102,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": "Expense Account",
|
||||
@@ -1036,6 +1131,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": "Cost Center",
|
||||
@@ -1056,19 +1152,19 @@
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"icon": "icon-cog",
|
||||
"idx": 1,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-12-12 17:02:22.323006",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2017-03-10 16:53:56.390210",
|
||||
"modified_by": "rohit@erpnext.com",
|
||||
"module": "Accounts",
|
||||
"name": "POS Profile",
|
||||
"owner": "Administrator",
|
||||
@@ -1083,7 +1179,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -1104,7 +1199,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -1119,8 +1213,10 @@
|
||||
"quick_entry": 0,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"title_field": "user",
|
||||
"track_changes": 0,
|
||||
"track_seen": 0
|
||||
}
|
||||
@@ -91,8 +91,8 @@ cur_frm.cscript.buying = function() {
|
||||
}
|
||||
|
||||
//Dynamically change the description based on type of margin
|
||||
cur_frm.cscript.type = function(doc){
|
||||
cur_frm.set_df_property('rate', 'description', doc.type=='Percentage'?'In Percentage %':'In Amount')
|
||||
cur_frm.cscript.margin_type = function(doc){
|
||||
cur_frm.set_df_property('margin_rate_or_amount', 'description', doc.margin_type=='Percentage'?'In Percentage %':'In Amount')
|
||||
}
|
||||
|
||||
frappe.ui.form.on('Pricing Rule', 'price_or_discount', function(frm){
|
||||
@@ -112,4 +112,4 @@ frappe.ui.form.on('Pricing Rule', {
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -22,6 +22,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": "",
|
||||
@@ -49,6 +50,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": "Title",
|
||||
@@ -78,6 +80,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Apply On",
|
||||
@@ -107,6 +110,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Item Code",
|
||||
@@ -136,6 +140,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": "Brand",
|
||||
@@ -165,6 +170,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": "Item Group",
|
||||
@@ -193,6 +199,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -221,6 +228,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": "Priority",
|
||||
@@ -249,6 +257,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": "Disable",
|
||||
@@ -276,6 +285,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -303,6 +313,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": "Selling",
|
||||
@@ -330,6 +341,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": "Buying",
|
||||
@@ -357,6 +369,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -385,6 +398,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": "Applicable For",
|
||||
@@ -414,6 +428,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": "Customer",
|
||||
@@ -443,6 +458,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": "Customer Group",
|
||||
@@ -472,6 +488,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": "Territory",
|
||||
@@ -501,6 +518,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": "Sales Partner",
|
||||
@@ -530,6 +548,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": "Campaign",
|
||||
@@ -559,6 +578,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": "Supplier",
|
||||
@@ -588,6 +608,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": "Supplier Type",
|
||||
@@ -616,6 +637,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -643,6 +665,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": "Min Qty",
|
||||
@@ -670,6 +693,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -697,6 +721,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": "Max Qty",
|
||||
@@ -724,6 +749,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -752,6 +778,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": "Valid From",
|
||||
@@ -779,6 +806,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": "Valid Upto",
|
||||
@@ -806,6 +834,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -832,6 +861,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": "Company",
|
||||
@@ -861,6 +891,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": "Margin",
|
||||
@@ -890,6 +921,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": "Margin Type",
|
||||
@@ -919,6 +951,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -948,6 +981,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": "Margin Rate or Amount",
|
||||
@@ -976,6 +1010,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": "",
|
||||
@@ -1004,6 +1039,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": "Price or Discount",
|
||||
@@ -1032,6 +1068,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -1059,6 +1096,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": "Price",
|
||||
@@ -1087,6 +1125,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": "Discount on Price List Rate (%)",
|
||||
@@ -1115,6 +1154,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": "For Price List",
|
||||
@@ -1143,6 +1183,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": "",
|
||||
@@ -1171,6 +1212,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": "Pricing Rule Help",
|
||||
@@ -1199,7 +1241,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-11-07 05:19:31.478456",
|
||||
"modified": "2017-02-17 16:21:28.446208",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Pricing Rule",
|
||||
@@ -1215,7 +1257,6 @@
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 1,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 0,
|
||||
"read": 1,
|
||||
@@ -1236,7 +1277,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 0,
|
||||
"read": 1,
|
||||
@@ -1257,7 +1297,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 0,
|
||||
"read": 1,
|
||||
@@ -1278,7 +1317,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 0,
|
||||
"read": 1,
|
||||
@@ -1299,7 +1337,6 @@
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 1,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 0,
|
||||
"read": 1,
|
||||
@@ -1314,8 +1351,10 @@
|
||||
"quick_entry": 0,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"title_field": "",
|
||||
"track_changes": 0,
|
||||
"track_seen": 0
|
||||
}
|
||||
@@ -23,6 +23,8 @@ class PricingRule(Document):
|
||||
self.validate_price_or_discount()
|
||||
self.validate_max_discount()
|
||||
|
||||
if not self.margin_type: self.margin_rate_or_amount = 0.0
|
||||
|
||||
def validate_mandatory(self):
|
||||
for field in ["apply_on", "applicable_for"]:
|
||||
tocheck = frappe.scrub(self.get(field) or "")
|
||||
@@ -109,22 +111,27 @@ def apply_pricing_rule(args):
|
||||
|
||||
item_list = args.get("items")
|
||||
args.pop("items")
|
||||
|
||||
set_serial_nos_based_on_fifo = frappe.db.get_single_value("Stock Settings",
|
||||
"automatically_set_serial_nos_based_on_fifo")
|
||||
|
||||
for item in item_list:
|
||||
args_copy = copy.deepcopy(args)
|
||||
args_copy.update(item)
|
||||
out.append(get_pricing_rule_for_item(args_copy))
|
||||
out.append(get_serial_no_for_item(args_copy))
|
||||
if set_serial_nos_based_on_fifo and not args.get('is_return'):
|
||||
out.append(get_serial_no_for_item(args_copy))
|
||||
return out
|
||||
|
||||
def get_serial_no_for_item(args):
|
||||
from erpnext.stock.get_item_details import get_serial_no
|
||||
|
||||
item_details = frappe._dict({
|
||||
"doctype": args.doctype,
|
||||
"name": args.name,
|
||||
"serial_no": args.serial_no
|
||||
})
|
||||
if args.get("parenttype") in ("Sales Invoice", "Delivery Note"):
|
||||
if args.get("parenttype") in ("Sales Invoice", "Delivery Note") and args.stock_qty > 0:
|
||||
item_details.serial_no = get_serial_no(args)
|
||||
return item_details
|
||||
|
||||
@@ -138,7 +145,7 @@ def get_pricing_rule_for_item(args):
|
||||
})
|
||||
|
||||
if args.ignore_pricing_rule or not args.item_code:
|
||||
if frappe.db.exists(args.doctype, args.name) and args.get("pricing_rule"):
|
||||
if args.get("pricing_rule"):
|
||||
item_details = remove_pricing_rule(args, item_details)
|
||||
return item_details
|
||||
|
||||
@@ -173,7 +180,7 @@ def get_pricing_rule_for_item(args):
|
||||
item_details.margin_rate_or_amount = pricing_rule.margin_rate_or_amount
|
||||
if pricing_rule.price_or_discount == "Price":
|
||||
item_details.update({
|
||||
"price_list_rate": pricing_rule.price/flt(args.conversion_rate) \
|
||||
"price_list_rate": (pricing_rule.price/flt(args.conversion_rate)) * args.conversion_factor or 1.0 \
|
||||
if args.conversion_rate else 0.0,
|
||||
"discount_percentage": 0.0
|
||||
})
|
||||
|
||||
@@ -2,13 +2,16 @@
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
frappe.provide("erpnext.accounts");
|
||||
{% include 'erpnext/buying/doctype/purchase_common/purchase_common.js' %};
|
||||
|
||||
{% include 'erpnext/public/js/controllers/buying.js' %};
|
||||
|
||||
erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
||||
setup: function(doc) {
|
||||
this.setup_posting_date_time_check();
|
||||
this._super(doc);
|
||||
},
|
||||
onload: function() {
|
||||
this._super();
|
||||
|
||||
|
||||
if(!this.frm.doc.__islocal) {
|
||||
// show credit_to in print format
|
||||
if(!this.frm.doc.supplier && this.frm.doc.credit_to) {
|
||||
@@ -32,7 +35,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
||||
if(doc.update_stock==1 && doc.docstatus==1) {
|
||||
this.show_stock_ledger();
|
||||
}
|
||||
|
||||
|
||||
if(!doc.is_return && doc.docstatus==1) {
|
||||
if(doc.outstanding_amount != 0) {
|
||||
this.frm.add_custom_button(__('Payment'), this.make_payment_entry, __("Make"));
|
||||
@@ -40,7 +43,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
||||
}
|
||||
|
||||
if(doc.outstanding_amount >= 0 || Math.abs(flt(doc.outstanding_amount)) < flt(doc.grand_total)) {
|
||||
cur_frm.add_custom_button(doc.update_stock ? __('Purchase Return') : __('Debit Note'),
|
||||
cur_frm.add_custom_button(__('Return / Debit Note'),
|
||||
this.make_debit_note, __("Make"));
|
||||
}
|
||||
}
|
||||
@@ -205,6 +208,7 @@ function hide_fields(doc) {
|
||||
|
||||
cur_frm.cscript.update_stock = function(doc, dt, dn) {
|
||||
hide_fields(doc, dt, dn);
|
||||
this.frm.fields_dict.items.grid.toggle_reqd("item_code", doc.update_stock? true: false)
|
||||
}
|
||||
|
||||
cur_frm.fields_dict.cash_bank_account.get_query = function(doc) {
|
||||
@@ -218,18 +222,6 @@ cur_frm.fields_dict.cash_bank_account.get_query = function(doc) {
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.fields_dict['supplier_address'].get_query = function(doc, cdt, cdn) {
|
||||
return{
|
||||
filters:{'supplier': doc.supplier}
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) {
|
||||
return{
|
||||
filters:{'supplier': doc.supplier}
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.fields_dict['items'].grid.get_field("item_code").get_query = function(doc, cdt, cdn) {
|
||||
return {
|
||||
query: "erpnext.controllers.queries.item_query",
|
||||
@@ -336,6 +328,12 @@ cur_frm.cscript.select_print_heading = function(doc,cdt,cdn){
|
||||
}
|
||||
|
||||
frappe.ui.form.on("Purchase Invoice", {
|
||||
setup: function(frm) {
|
||||
frm.custom_make_buttons = {
|
||||
'Purchase Invoice': 'Debit Note',
|
||||
'Payment Entry': 'Payment'
|
||||
}
|
||||
},
|
||||
onload: function(frm) {
|
||||
$.each(["warehouse", "rejected_warehouse"], function(i, field) {
|
||||
frm.set_query(field, "items", function() {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,10 +2,9 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
import frappe, erpnext
|
||||
from frappe.utils import cint, formatdate, flt, getdate
|
||||
from frappe import _, throw
|
||||
from erpnext.setup.utils import get_company_currency
|
||||
import frappe.defaults
|
||||
|
||||
from erpnext.controllers.buying_controller import BuyingController
|
||||
@@ -15,6 +14,7 @@ from erpnext.stock.doctype.purchase_receipt.purchase_receipt import update_bille
|
||||
from erpnext.controllers.stock_controller import get_warehouse_account
|
||||
from erpnext.accounts.general_ledger import make_gl_entries, merge_similar_entries, delete_gl_entries
|
||||
from erpnext.accounts.doctype.gl_entry.gl_entry import update_outstanding_amt
|
||||
from erpnext.buying.utils import check_for_closed_status
|
||||
|
||||
form_grid_templates = {
|
||||
"items": "templates/form_grid/item_grid.html"
|
||||
@@ -40,6 +40,7 @@ class PurchaseInvoice(BuyingController):
|
||||
if not self.is_opening:
|
||||
self.is_opening = 'No'
|
||||
|
||||
self.validate_posting_time()
|
||||
super(PurchaseInvoice, self).validate()
|
||||
|
||||
if not self.is_return:
|
||||
@@ -92,7 +93,7 @@ class PurchaseInvoice(BuyingController):
|
||||
super(PurchaseInvoice, self).set_missing_values(for_validate)
|
||||
|
||||
def check_conversion_rate(self):
|
||||
default_currency = get_company_currency(self.company)
|
||||
default_currency = erpnext.get_company_currency(self.company)
|
||||
if not default_currency:
|
||||
throw(_('Please enter default currency in Company Master'))
|
||||
if (self.currency == default_currency and flt(self.conversion_rate) != 1.00) or not self.conversion_rate or (self.currency != default_currency and flt(self.conversion_rate) == 1.00):
|
||||
@@ -112,12 +113,11 @@ class PurchaseInvoice(BuyingController):
|
||||
|
||||
def check_for_closed_status(self):
|
||||
check_list = []
|
||||
pc_obj = frappe.get_doc('Purchase Common')
|
||||
|
||||
for d in self.get('items'):
|
||||
if d.purchase_order and not d.purchase_order in check_list and not d.purchase_receipt:
|
||||
check_list.append(d.purchase_order)
|
||||
pc_obj.check_for_closed_status('Purchase Order', d.purchase_order)
|
||||
check_for_closed_status('Purchase Order', d.purchase_order)
|
||||
|
||||
def validate_with_previous_doc(self):
|
||||
super(PurchaseInvoice, self).validate_with_previous_doc({
|
||||
@@ -156,6 +156,12 @@ class PurchaseInvoice(BuyingController):
|
||||
|
||||
super(PurchaseInvoice, self).validate_warehouse()
|
||||
|
||||
|
||||
def validate_item_code(self):
|
||||
for d in self.get('items'):
|
||||
if not d.item_code:
|
||||
frappe.msgprint(_("Item Code required at Row No {0}").format(d.idx), raise_exception=True)
|
||||
|
||||
def set_expense_account(self, for_validate=False):
|
||||
auto_accounting_for_stock = cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))
|
||||
|
||||
@@ -164,6 +170,7 @@ class PurchaseInvoice(BuyingController):
|
||||
stock_items = self.get_stock_items()
|
||||
|
||||
if self.update_stock:
|
||||
self.validate_item_code()
|
||||
self.validate_warehouse()
|
||||
warehouse_account = get_warehouse_account()
|
||||
|
||||
@@ -302,12 +309,12 @@ class PurchaseInvoice(BuyingController):
|
||||
asset.flags.ignore_validate_update_after_submit = True
|
||||
asset.save()
|
||||
|
||||
def make_gl_entries(self, repost_future_gle=True):
|
||||
def make_gl_entries(self, gl_entries=None, repost_future_gle=True, from_repost=False):
|
||||
if not self.grand_total:
|
||||
return
|
||||
|
||||
gl_entries = self.get_gl_entries()
|
||||
|
||||
if not gl_entries:
|
||||
gl_entries = self.get_gl_entries()
|
||||
|
||||
if gl_entries:
|
||||
update_outstanding = "No" if (cint(self.is_paid) or self.write_off_account) else "Yes"
|
||||
|
||||
@@ -344,7 +351,7 @@ class PurchaseInvoice(BuyingController):
|
||||
|
||||
self.make_payment_gl_entries(gl_entries)
|
||||
self.make_write_off_gl_entry(gl_entries)
|
||||
|
||||
|
||||
return gl_entries
|
||||
|
||||
def make_supplier_gl_entry(self, gl_entries):
|
||||
@@ -621,10 +628,12 @@ class PurchaseInvoice(BuyingController):
|
||||
pi = frappe.db.sql('''select name from `tabPurchase Invoice`
|
||||
where
|
||||
bill_no = %(bill_no)s
|
||||
and supplier = %(supplier)s
|
||||
and name != %(name)s
|
||||
and docstatus < 2
|
||||
and posting_date between %(year_start_date)s and %(year_end_date)s''', {
|
||||
"bill_no": self.bill_no,
|
||||
"supplier": self.supplier,
|
||||
"name": self.name,
|
||||
"year_start_date": fiscal_year.year_start_date,
|
||||
"year_end_date": fiscal_year.year_end_date
|
||||
|
||||
@@ -19,6 +19,7 @@ test_ignore = ["Serial No"]
|
||||
class TestPurchaseInvoice(unittest.TestCase):
|
||||
def setUp(self):
|
||||
unlink_payment_on_cancel_of_invoice()
|
||||
frappe.db.set_value("Buying Settings", None, "allow_multiple_items", 1)
|
||||
|
||||
def tearDown(self):
|
||||
unlink_payment_on_cancel_of_invoice(0)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"autoname": "hash",
|
||||
@@ -21,7 +22,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Item",
|
||||
@@ -52,6 +54,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -78,6 +81,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Item Name",
|
||||
@@ -107,6 +111,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": "Description",
|
||||
@@ -135,6 +140,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": "Description",
|
||||
@@ -166,6 +172,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": "Image",
|
||||
@@ -194,6 +201,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": "Image View",
|
||||
@@ -223,6 +231,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": "Quantity and Rate",
|
||||
@@ -250,6 +259,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": "Received Qty",
|
||||
@@ -278,6 +288,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": "Qty",
|
||||
@@ -307,6 +318,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": "Rejected Qty",
|
||||
@@ -324,6 +336,36 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "stock_uom",
|
||||
"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": "Stock UOM",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "UOM",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"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
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -335,6 +377,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -361,6 +404,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": "UOM",
|
||||
@@ -389,6 +433,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": "Conversion Factor",
|
||||
@@ -405,6 +450,35 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "stock_qty",
|
||||
"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": "Stock Qty",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"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
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -416,6 +490,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -442,6 +517,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": "Price List Rate",
|
||||
@@ -471,6 +547,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": "Discount on Price List Rate (%)",
|
||||
@@ -498,6 +575,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -524,6 +602,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": "Price List Rate (Company Currency)",
|
||||
@@ -552,6 +631,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -578,6 +658,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": "Rate ",
|
||||
@@ -608,6 +689,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",
|
||||
@@ -638,6 +720,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -664,6 +747,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": "Rate (Company Currency)",
|
||||
@@ -694,6 +778,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": "Amount (Company Currency)",
|
||||
@@ -724,6 +809,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": "Pricing Rule",
|
||||
@@ -752,6 +838,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -779,6 +866,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": "Net Rate",
|
||||
@@ -808,6 +896,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": "Net Amount",
|
||||
@@ -837,6 +926,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -864,6 +954,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": "Net Rate (Company Currency)",
|
||||
@@ -893,6 +984,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": "Net Amount (Company Currency)",
|
||||
@@ -922,6 +1014,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": "Warehouse",
|
||||
@@ -951,6 +1044,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": "Accepted Warehouse",
|
||||
@@ -980,6 +1074,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": "Rejected Warehouse",
|
||||
@@ -1010,6 +1105,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": "Quality Inspection",
|
||||
@@ -1039,6 +1135,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": "Batch No",
|
||||
@@ -1068,6 +1165,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": "",
|
||||
@@ -1096,6 +1194,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": "Serial No",
|
||||
@@ -1124,6 +1223,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": "Rejected Serial No",
|
||||
@@ -1152,6 +1252,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": "Accounting",
|
||||
@@ -1179,6 +1280,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": "Expense Head",
|
||||
@@ -1211,6 +1313,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -1236,7 +1339,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Project",
|
||||
@@ -1267,6 +1371,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": "Cost Center",
|
||||
@@ -1299,6 +1404,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",
|
||||
@@ -1315,6 +1421,35 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "allow_zero_valuation_rate",
|
||||
"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": "Allow Zero Valuation Rate",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -1326,6 +1461,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": "Brand",
|
||||
@@ -1355,7 +1491,8 @@
|
||||
"hidden": 1,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Item Group",
|
||||
@@ -1371,7 +1508,7 @@
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
@@ -1387,6 +1524,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": "Item Tax Rate",
|
||||
@@ -1416,6 +1554,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": "Item Tax Amount",
|
||||
@@ -1445,7 +1584,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Purchase Order",
|
||||
@@ -1476,6 +1616,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": "BOM",
|
||||
@@ -1505,6 +1646,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -1531,6 +1673,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 Fixed Asset",
|
||||
@@ -1560,6 +1703,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": "Asset",
|
||||
@@ -1588,7 +1732,8 @@
|
||||
"hidden": 1,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Purchase Order Item",
|
||||
@@ -1617,7 +1762,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Purchase Receipt",
|
||||
@@ -1648,6 +1794,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": "Page Break",
|
||||
@@ -1674,7 +1821,8 @@
|
||||
"hidden": 1,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "PR Detail",
|
||||
@@ -1704,6 +1852,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": "Valuation Rate",
|
||||
@@ -1732,6 +1881,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": "Raw Materials Supplied Cost",
|
||||
@@ -1760,6 +1910,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": "Landed Cost Voucher Amount",
|
||||
@@ -1778,17 +1929,17 @@
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 1,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-11-16 16:04:52.465169",
|
||||
"modified": "2017-04-19 11:54:16.112134",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Purchase Invoice Item",
|
||||
@@ -1797,7 +1948,9 @@
|
||||
"quick_entry": 0,
|
||||
"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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ from __future__ import unicode_literals
|
||||
import frappe, json
|
||||
from frappe.utils import nowdate
|
||||
from erpnext.setup.utils import get_exchange_rate
|
||||
from frappe.core.doctype.communication.email import make
|
||||
from erpnext.stock.get_item_details import get_pos_profile
|
||||
from erpnext.accounts.party import get_party_account_currency
|
||||
from erpnext.controllers.accounts_controller import get_taxes_and_charges
|
||||
@@ -25,12 +26,15 @@ def get_pos_data():
|
||||
update_multi_mode_option(doc, pos_profile)
|
||||
default_print_format = pos_profile.get('print_format') or "Point of Sale"
|
||||
print_template = frappe.db.get_value('Print Format', default_print_format, 'html')
|
||||
customers = get_customers_list(pos_profile)
|
||||
|
||||
return {
|
||||
'doc': doc,
|
||||
'default_customer': pos_profile.get('customer'),
|
||||
'items': get_items_list(pos_profile),
|
||||
'customers': get_customers_list(pos_profile),
|
||||
'item_groups': get_item_groups(pos_profile),
|
||||
'customers': customers,
|
||||
'address': get_customers_address(customers),
|
||||
'serial_no_data': get_serial_no_data(pos_profile, doc.company),
|
||||
'batch_no_data': get_batch_no_data(),
|
||||
'tax_data': get_item_tax_data(),
|
||||
@@ -39,18 +43,28 @@ def get_pos_data():
|
||||
'pricing_rules': get_pricing_rule_data(doc),
|
||||
'print_template': print_template,
|
||||
'pos_profile': pos_profile,
|
||||
'meta': {
|
||||
'invoice': frappe.get_meta('Sales Invoice'),
|
||||
'items': frappe.get_meta('Sales Invoice Item'),
|
||||
'taxes': frappe.get_meta('Sales Taxes and Charges')
|
||||
}
|
||||
'meta': get_meta()
|
||||
}
|
||||
|
||||
def get_meta():
|
||||
doctype_meta = {
|
||||
'customer': frappe.get_meta('Customer'),
|
||||
'invoice': frappe.get_meta('Sales Invoice')
|
||||
}
|
||||
|
||||
for row in frappe.get_all('DocField', fields = ['fieldname', 'options'],
|
||||
filters = {'parent': 'Sales Invoice', 'fieldtype': 'Table'}):
|
||||
doctype_meta[row.fieldname] = frappe.get_meta(row.options)
|
||||
|
||||
return doctype_meta
|
||||
|
||||
def get_company_data(company):
|
||||
return frappe.get_all('Company', fields = ["*"], filters= {'name': company})[0]
|
||||
|
||||
def update_pos_profile_data(doc, pos_profile, company_data):
|
||||
doc.campaign = pos_profile.get('campaign')
|
||||
if pos_profile and not pos_profile.get('country'):
|
||||
pos_profile.country = company_data.country
|
||||
|
||||
doc.write_off_account = pos_profile.get('write_off_account') or \
|
||||
company_data.write_off_account
|
||||
@@ -62,10 +76,10 @@ def update_pos_profile_data(doc, pos_profile, company_data):
|
||||
|
||||
doc.currency = pos_profile.get('currency') or company_data.default_currency
|
||||
doc.conversion_rate = 1.0
|
||||
|
||||
|
||||
if doc.currency != company_data.default_currency:
|
||||
doc.conversion_rate = get_exchange_rate(doc.currency, company_data.default_currency, doc.posting_date)
|
||||
|
||||
|
||||
doc.selling_price_list = pos_profile.get('selling_price_list') or \
|
||||
frappe.db.get_value('Selling Settings', None, 'selling_price_list')
|
||||
doc.naming_series = pos_profile.get('naming_series') or 'SINV-'
|
||||
@@ -74,6 +88,7 @@ def update_pos_profile_data(doc, pos_profile, company_data):
|
||||
doc.apply_discount_on = pos_profile.get('apply_discount_on') if pos_profile.get('apply_discount') else ''
|
||||
doc.customer_group = pos_profile.get('customer_group') or get_root('Customer Group')
|
||||
doc.territory = pos_profile.get('territory') or get_root('Territory')
|
||||
doc.terms = frappe.db.get_value('Terms and Conditions', pos_profile.get('tc_name'), 'terms') or doc.terms or ''
|
||||
|
||||
def get_root(table):
|
||||
root = frappe.db.sql(""" select name from `tab%(table)s` having
|
||||
@@ -117,37 +132,68 @@ def get_items_list(pos_profile):
|
||||
if pos_profile.get('item_groups'):
|
||||
# Get items based on the item groups defined in the POS profile
|
||||
for d in pos_profile.get('item_groups'):
|
||||
item_groups.extend(get_child_nodes('Item Group', d.item_group))
|
||||
item_groups.extend([d.name for d in get_child_nodes('Item Group', d.item_group)])
|
||||
cond = "item_group in (%s)"%(', '.join(['%s']*len(item_groups)))
|
||||
|
||||
return frappe.db.sql("""
|
||||
select
|
||||
name, item_code, item_name, description, item_group, expense_account, has_batch_no,
|
||||
has_serial_no, expense_account, selling_cost_center, stock_uom, image,
|
||||
default_warehouse, is_stock_item, barcode
|
||||
default_warehouse, is_stock_item, barcode, brand
|
||||
from
|
||||
tabItem
|
||||
where
|
||||
disabled = 0 and has_variants = 0 and is_sales_item = 1 and {cond}
|
||||
""".format(cond=cond), tuple(item_groups), as_dict=1)
|
||||
|
||||
def get_item_groups(pos_profile):
|
||||
item_group_dict = {}
|
||||
if pos_profile.get('item_groups'):
|
||||
item_groups = []
|
||||
for d in pos_profile.get('item_groups'):
|
||||
item_groups.extend(get_child_nodes('Item Group', d.item_group))
|
||||
else:
|
||||
item_groups = frappe.db.sql("""Select name,
|
||||
lft, rgt from `tabItem Group` order by lft""", as_dict=1)
|
||||
|
||||
for data in item_groups:
|
||||
item_group_dict[data.name] = [data.lft, data.rgt]
|
||||
return item_group_dict
|
||||
|
||||
def get_customers_list(pos_profile):
|
||||
cond = "1=1"
|
||||
customer_groups = []
|
||||
if pos_profile.get('customer_groups'):
|
||||
# Get customers based on the customer groups defined in the POS profile
|
||||
for d in pos_profile.get('customer_groups'):
|
||||
customer_groups.extend(get_child_nodes('Customer Group', d.customer_group))
|
||||
customer_groups.extend([d.name for d in get_child_nodes('Customer Group', d.customer_group)])
|
||||
cond = "customer_group in (%s)"%(', '.join(['%s']*len(customer_groups)))
|
||||
|
||||
return frappe.db.sql(""" select name, customer_name, customer_group,
|
||||
territory from tabCustomer where disabled = 0
|
||||
and {cond}""".format(cond=cond), tuple(customer_groups), as_dict=1) or {}
|
||||
|
||||
def get_customers_address(customers):
|
||||
customer_address = {}
|
||||
if isinstance(customers, basestring):
|
||||
customers = [frappe._dict({'name': customers})]
|
||||
|
||||
for data in customers:
|
||||
address = frappe.db.sql(""" select name, address_line1, address_line2, city, state,
|
||||
email_id, phone, fax, pincode from `tabAddress` where is_primary_address =1 and name in
|
||||
(select parent from `tabDynamic Link` where link_doctype = 'Customer' and link_name = %s
|
||||
and parenttype = 'Address')""", data.name, as_dict=1)
|
||||
if address:
|
||||
address_data = address[0]
|
||||
address_data.update({'full_name': data.customer_name})
|
||||
customer_address[data.name] = address_data
|
||||
|
||||
return customer_address
|
||||
|
||||
def get_child_nodes(group_type, root):
|
||||
lft, rgt = frappe.db.get_value(group_type, root, ["lft", "rgt"])
|
||||
return frappe.db.sql_list(""" Select name from `tab{tab}` where
|
||||
lft >= {lft} and rgt <= {rgt}""".format(tab=group_type, lft=lft, rgt=rgt))
|
||||
return frappe.db.sql(""" Select name, lft, rgt from `tab{tab}` where
|
||||
lft >= {lft} and rgt <= {rgt} order by lft""".format(tab=group_type, lft=lft, rgt=rgt), as_dict=1)
|
||||
|
||||
def get_serial_no_data(pos_profile, company):
|
||||
# get itemwise serial no data
|
||||
@@ -238,12 +284,18 @@ def get_pricing_rule_data(doc):
|
||||
return pricing_rules
|
||||
|
||||
@frappe.whitelist()
|
||||
def make_invoice(doc_list):
|
||||
def make_invoice(doc_list={}, email_queue_list={}, customers_list={}):
|
||||
if isinstance(doc_list, basestring):
|
||||
doc_list = json.loads(doc_list)
|
||||
|
||||
name_list = []
|
||||
if isinstance(email_queue_list, basestring):
|
||||
email_queue_list = json.loads(email_queue_list)
|
||||
|
||||
if isinstance(customers_list, basestring):
|
||||
customers_list = json.loads(customers_list)
|
||||
|
||||
customers = make_customer_and_address(customers_list)
|
||||
name_list = []
|
||||
for docs in doc_list:
|
||||
for name, doc in docs.items():
|
||||
if not frappe.db.exists('Sales Invoice', {'offline_pos_name': name}):
|
||||
@@ -251,27 +303,82 @@ def make_invoice(doc_list):
|
||||
si_doc = frappe.new_doc('Sales Invoice')
|
||||
si_doc.offline_pos_name = name
|
||||
si_doc.update(doc)
|
||||
submit_invoice(si_doc, name)
|
||||
si_doc.due_date = doc.get('posting_date')
|
||||
submit_invoice(si_doc, name, doc)
|
||||
name_list.append(name)
|
||||
else:
|
||||
name_list.append(name)
|
||||
|
||||
return name_list
|
||||
email_queue = make_email_queue(email_queue_list)
|
||||
return {
|
||||
'invoice': name_list,
|
||||
'email_queue': email_queue,
|
||||
'customers': customers
|
||||
}
|
||||
|
||||
def validate_records(doc):
|
||||
validate_customer(doc)
|
||||
validate_item(doc)
|
||||
|
||||
def validate_customer(doc):
|
||||
if not frappe.db.exists('Customer', doc.get('customer')):
|
||||
customer_doc = frappe.new_doc('Customer')
|
||||
customer_doc.customer_name = doc.get('customer')
|
||||
customer_doc.customer_type = 'Company'
|
||||
customer_doc.customer_group = doc.get('customer_group')
|
||||
customer_doc.territory = doc.get('territory')
|
||||
customer_doc.save(ignore_permissions = True)
|
||||
frappe.db.commit()
|
||||
doc['customer'] = customer_doc.name
|
||||
def make_customer_and_address(customers):
|
||||
customer_list = []
|
||||
for name, data in customers.items():
|
||||
if not frappe.db.exists('Customer', name):
|
||||
name = add_customer(name)
|
||||
data = json.loads(data)
|
||||
make_address(data, name)
|
||||
customer_list.append(name)
|
||||
return customer_list
|
||||
|
||||
def add_customer(name):
|
||||
customer_doc = frappe.new_doc('Customer')
|
||||
customer_doc.customer_name = name
|
||||
customer_doc.customer_type = 'Company'
|
||||
customer_doc.customer_group = frappe.db.get_single_value('Selling Settings', 'customer_group')
|
||||
customer_doc.territory = frappe.db.get_single_value('Selling Settings', 'territory')
|
||||
customer_doc.flags.ignore_mandatory = True
|
||||
customer_doc.save(ignore_permissions = True)
|
||||
frappe.db.commit()
|
||||
return customer_doc.name
|
||||
|
||||
def make_address(args, customer):
|
||||
if not args.get('address_line1'): return
|
||||
|
||||
name = args.get('name')
|
||||
|
||||
if not name:
|
||||
data = get_customers_address(customer)
|
||||
name = data[customer].get('name') if data else None
|
||||
|
||||
if name:
|
||||
address = frappe.get_doc('Address', name)
|
||||
else:
|
||||
address = frappe.new_doc('Address')
|
||||
address.country = frappe.db.get_value('Company', args.get('company'), 'country')
|
||||
address.append('links',{
|
||||
'link_doctype': 'Customer',
|
||||
'link_name': customer
|
||||
})
|
||||
|
||||
address.is_primary_address = 1
|
||||
address.is_shipping_address = 1
|
||||
address.update(args)
|
||||
address.save(ignore_permissions = True)
|
||||
|
||||
def make_email_queue(email_queue):
|
||||
name_list = []
|
||||
for key, data in email_queue.items():
|
||||
name = frappe.db.get_value('Sales Invoice', {'offline_pos_name': key}, 'name')
|
||||
data = json.loads(data)
|
||||
sender = frappe.session.user
|
||||
print_format = "POS Invoice"
|
||||
attachments = [frappe.attach_print('Sales Invoice', name, print_format= print_format)]
|
||||
|
||||
make(subject = data.get('subject'), content = data.get('content'), recipients = data.get('recipients'),
|
||||
sender=sender,attachments = attachments, send_email=True,
|
||||
doctype='Sales Invoice', name=name)
|
||||
name_list.append(key)
|
||||
|
||||
return name_list
|
||||
|
||||
def validate_item(doc):
|
||||
for item in doc.get('items'):
|
||||
@@ -287,7 +394,8 @@ def validate_item(doc):
|
||||
item_doc.save(ignore_permissions=True)
|
||||
frappe.db.commit()
|
||||
|
||||
def submit_invoice(si_doc, name):
|
||||
|
||||
def submit_invoice(si_doc, name, doc):
|
||||
try:
|
||||
si_doc.insert()
|
||||
si_doc.submit()
|
||||
@@ -301,4 +409,5 @@ def save_invoice(e, si_doc, name):
|
||||
if not frappe.db.exists('Sales Invoice', {'offline_pos_name': name}):
|
||||
si_doc.docstatus = 0
|
||||
si_doc.flags.ignore_mandatory = True
|
||||
si_doc.due_date = si_doc.posting_date
|
||||
si_doc.insert()
|
||||
|
||||
@@ -6,8 +6,14 @@ cur_frm.pformat.print_heading = 'Invoice';
|
||||
|
||||
{% include 'erpnext/selling/sales_common.js' %};
|
||||
|
||||
cur_frm.add_fetch('customer', 'tax_id', 'tax_id');
|
||||
|
||||
frappe.provide("erpnext.accounts");
|
||||
erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.extend({
|
||||
setup: function(doc) {
|
||||
this.setup_posting_date_time_check();
|
||||
this._super(doc);
|
||||
},
|
||||
onload: function() {
|
||||
var me = this;
|
||||
this._super();
|
||||
@@ -51,7 +57,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
})
|
||||
|
||||
if(doc.outstanding_amount >= 0 || Math.abs(flt(doc.outstanding_amount)) < flt(doc.grand_total)) {
|
||||
cur_frm.add_custom_button(doc.update_stock ? __('Sales Return') : __('Credit Note'),
|
||||
cur_frm.add_custom_button(__('Return / Credit Note'),
|
||||
this.make_sales_return, __("Make"));
|
||||
cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
|
||||
}
|
||||
@@ -270,6 +276,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
});
|
||||
}
|
||||
}
|
||||
else this.frm.trigger("refresh")
|
||||
},
|
||||
|
||||
amount: function(){
|
||||
@@ -320,6 +327,7 @@ cur_frm.cscript.hide_fields = function(doc) {
|
||||
|
||||
cur_frm.cscript.update_stock = function(doc, dt, dn) {
|
||||
cur_frm.cscript.hide_fields(doc, dt, dn);
|
||||
this.frm.fields_dict.items.grid.toggle_reqd("item_code", doc.update_stock? true: false)
|
||||
}
|
||||
|
||||
cur_frm.cscript['Make Delivery Note'] = function() {
|
||||
@@ -468,6 +476,12 @@ cur_frm.set_query("asset", "items", function(doc, cdt, cdn) {
|
||||
|
||||
frappe.ui.form.on('Sales Invoice', {
|
||||
setup: function(frm){
|
||||
frm.custom_make_buttons = {
|
||||
'Delivery Note': 'Delivery',
|
||||
'Sales Invoice': 'Sales Return',
|
||||
'Payment Request': 'Payment Request',
|
||||
'Payment': 'Payment Entry'
|
||||
},
|
||||
frm.fields_dict["timesheets"].grid.get_field("time_sheet").get_query = function(doc, cdt, cdn){
|
||||
return{
|
||||
query: "erpnext.projects.doctype.timesheet.timesheet.get_timesheet",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -532,10 +532,12 @@ class SalesInvoice(SellingController):
|
||||
if d.delivery_note and frappe.db.get_value("Delivery Note", d.delivery_note, "docstatus") != 1:
|
||||
throw(_("Delivery Note {0} is not submitted").format(d.delivery_note))
|
||||
|
||||
def make_gl_entries(self, repost_future_gle=True):
|
||||
def make_gl_entries(self, gl_entries=None, repost_future_gle=True, from_repost=False):
|
||||
if not self.grand_total:
|
||||
return
|
||||
gl_entries = self.get_gl_entries()
|
||||
|
||||
if not gl_entries:
|
||||
gl_entries = self.get_gl_entries()
|
||||
|
||||
if gl_entries:
|
||||
from erpnext.accounts.general_ledger import make_gl_entries
|
||||
@@ -651,32 +653,34 @@ class SalesInvoice(SellingController):
|
||||
def make_pos_gl_entries(self, gl_entries):
|
||||
if cint(self.is_pos):
|
||||
for payment_mode in self.payments:
|
||||
# POS, make payment entries
|
||||
gl_entries.append(
|
||||
self.get_gl_dict({
|
||||
"account": self.debit_to,
|
||||
"party_type": "Customer",
|
||||
"party": self.customer,
|
||||
"against": payment_mode.account,
|
||||
"credit": payment_mode.base_amount,
|
||||
"credit_in_account_currency": payment_mode.base_amount \
|
||||
if self.party_account_currency==self.company_currency \
|
||||
else payment_mode.amount,
|
||||
"against_voucher": self.return_against if cint(self.is_return) else self.name,
|
||||
"against_voucher_type": self.doctype,
|
||||
}, self.party_account_currency)
|
||||
)
|
||||
if payment_mode.amount:
|
||||
# POS, make payment entries
|
||||
gl_entries.append(
|
||||
self.get_gl_dict({
|
||||
"account": self.debit_to,
|
||||
"party_type": "Customer",
|
||||
"party": self.customer,
|
||||
"against": payment_mode.account,
|
||||
"credit": payment_mode.base_amount,
|
||||
"credit_in_account_currency": payment_mode.base_amount \
|
||||
if self.party_account_currency==self.company_currency \
|
||||
else payment_mode.amount,
|
||||
"against_voucher": self.return_against if cint(self.is_return) else self.name,
|
||||
"against_voucher_type": self.doctype,
|
||||
}, self.party_account_currency)
|
||||
)
|
||||
|
||||
payment_mode_account_currency = get_account_currency(payment_mode.account)
|
||||
gl_entries.append(
|
||||
self.get_gl_dict({
|
||||
"account": payment_mode.account,
|
||||
"against": self.customer,
|
||||
"debit": payment_mode.base_amount,
|
||||
"debit_in_account_currency": payment_mode.base_amount \
|
||||
if payment_mode_account_currency==self.company_currency else payment_mode.amount
|
||||
}, payment_mode_account_currency)
|
||||
)
|
||||
payment_mode_account_currency = get_account_currency(payment_mode.account)
|
||||
gl_entries.append(
|
||||
self.get_gl_dict({
|
||||
"account": payment_mode.account,
|
||||
"against": self.customer,
|
||||
"debit": payment_mode.base_amount,
|
||||
"debit_in_account_currency": payment_mode.base_amount \
|
||||
if payment_mode_account_currency==self.company_currency \
|
||||
else payment_mode.amount
|
||||
}, payment_mode_account_currency)
|
||||
)
|
||||
|
||||
def make_gle_for_change_amount(self, gl_entries):
|
||||
if cint(self.is_pos) and self.change_amount:
|
||||
@@ -786,11 +790,11 @@ def make_delivery_note(source_name, target_doc=None):
|
||||
target.run_method("calculate_taxes_and_totals")
|
||||
|
||||
def update_item(source_doc, target_doc, source_parent):
|
||||
target_doc.base_amount = (flt(source_doc.qty) - flt(source_doc.delivered_qty)) * \
|
||||
flt(source_doc.base_rate)
|
||||
target_doc.amount = (flt(source_doc.qty) - flt(source_doc.delivered_qty)) * \
|
||||
flt(source_doc.rate)
|
||||
target_doc.qty = flt(source_doc.qty) - flt(source_doc.delivered_qty)
|
||||
target_doc.stock_qty = target_doc.qty * flt(source_doc.conversion_factor)
|
||||
|
||||
target_doc.base_amount = target_doc.qty * flt(source_doc.base_rate)
|
||||
target_doc.amount = target_doc.qty * flt(source_doc.rate)
|
||||
|
||||
doclist = get_mapped_doc("Sales Invoice", source_name, {
|
||||
"Sales Invoice": {
|
||||
|
||||
@@ -20,7 +20,10 @@
|
||||
"item_name": "138-CMS Shoe",
|
||||
"parentfield": "items",
|
||||
"qty": 1.0,
|
||||
"rate": 500.0
|
||||
"rate": 500.0,
|
||||
"uom": "_Test UOM",
|
||||
"conversion_factor": 1,
|
||||
"stock_uom": "_Test UOM"
|
||||
}
|
||||
],
|
||||
"base_grand_total": 561.8,
|
||||
@@ -89,7 +92,10 @@
|
||||
"item_name": "_Test Item",
|
||||
"parentfield": "items",
|
||||
"price_list_rate": 500.0,
|
||||
"qty": 1.0
|
||||
"qty": 1.0,
|
||||
"uom": "_Test UOM",
|
||||
"conversion_factor": 1,
|
||||
"stock_uom": "_Test UOM"
|
||||
}
|
||||
],
|
||||
"base_grand_total": 630.0,
|
||||
@@ -141,7 +147,9 @@
|
||||
"price_list_rate": 50,
|
||||
"qty": 10,
|
||||
"rate": 50,
|
||||
"stock_uom": "_Test UOM"
|
||||
"uom": "_Test UOM 1",
|
||||
"conversion_factor": 1,
|
||||
"stock_uom": "_Test UOM 1"
|
||||
},
|
||||
{
|
||||
"cost_center": "_Test Cost Center - _TC",
|
||||
@@ -153,6 +161,8 @@
|
||||
"parentfield": "items",
|
||||
"price_list_rate": 150,
|
||||
"qty": 5,
|
||||
"uom": "_Test UOM",
|
||||
"conversion_factor": 1,
|
||||
"rate": 150,
|
||||
"stock_uom": "_Test UOM"
|
||||
}
|
||||
@@ -263,7 +273,10 @@
|
||||
"parentfield": "items",
|
||||
"price_list_rate": 62.5,
|
||||
"qty": 10,
|
||||
"stock_uom": "_Test UOM"
|
||||
"uom": "_Test UOM 1",
|
||||
"conversion_factor": 1,
|
||||
"stock_uom": "_Test UOM 1"
|
||||
|
||||
},
|
||||
{
|
||||
"cost_center": "_Test Cost Center - _TC",
|
||||
@@ -275,6 +288,8 @@
|
||||
"parentfield": "items",
|
||||
"price_list_rate": 190.66,
|
||||
"qty": 5,
|
||||
"uom": "_Test UOM",
|
||||
"conversion_factor": 1,
|
||||
"stock_uom": "_Test UOM"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -4,7 +4,7 @@ from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest, copy
|
||||
from frappe.utils import nowdate, add_days, flt, nowdate
|
||||
from frappe.utils import nowdate, add_days, flt
|
||||
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry, get_qty_after_transaction
|
||||
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import unlink_payment_on_cancel_of_invoice
|
||||
from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile
|
||||
@@ -162,11 +162,50 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
self.assertEquals(si.base_grand_total, 1628)
|
||||
self.assertEquals(si.grand_total, 32.56)
|
||||
|
||||
def test_sales_invoice_with_discount_and_inclusive_tax(self):
|
||||
si = create_sales_invoice(qty=100, rate=50, do_not_save=True)
|
||||
si.append("taxes", {
|
||||
"charge_type": "On Net Total",
|
||||
"account_head": "_Test Account Service Tax - _TC",
|
||||
"cost_center": "_Test Cost Center - _TC",
|
||||
"description": "Service Tax",
|
||||
"rate": 14,
|
||||
'included_in_print_rate': 1
|
||||
})
|
||||
si.insert()
|
||||
|
||||
# with inclusive tax
|
||||
self.assertEquals(si.net_total, 4385.96)
|
||||
self.assertEquals(si.grand_total, 5000)
|
||||
|
||||
si.reload()
|
||||
|
||||
# additional discount
|
||||
si.discount_amount = 100
|
||||
si.apply_discount_on = 'Net Total'
|
||||
|
||||
si.save()
|
||||
|
||||
# with inclusive tax and additional discount
|
||||
self.assertEquals(si.net_total, 4285.96)
|
||||
self.assertEquals(si.grand_total, 4885.99)
|
||||
|
||||
si.reload()
|
||||
|
||||
# additional discount on grand total
|
||||
si.discount_amount = 100
|
||||
si.apply_discount_on = 'Grand Total'
|
||||
|
||||
si.save()
|
||||
|
||||
# with inclusive tax and additional discount
|
||||
self.assertEquals(si.net_total, 4298.24)
|
||||
self.assertEquals(si.grand_total, 4900.00)
|
||||
|
||||
def test_sales_invoice_discount_amount(self):
|
||||
si = frappe.copy_doc(test_records[3])
|
||||
si.discount_amount = 104.95
|
||||
si.append("taxes", {
|
||||
"doctype": "Sales Taxes and Charges",
|
||||
"charge_type": "On Previous Row Amount",
|
||||
"account_head": "_Test Account Service Tax - _TC",
|
||||
"cost_center": "_Test Cost Center - _TC",
|
||||
@@ -519,7 +558,7 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
{'mode_of_payment': 'Cash', 'account': 'Cash - _TC', 'amount': 330}]
|
||||
|
||||
invoice_data = [{'09052016142': pos}]
|
||||
si = make_invoice(invoice_data)
|
||||
si = make_invoice(invoice_data).get('invoice')
|
||||
self.assertEquals(si[0], '09052016142')
|
||||
|
||||
sales_invoice = frappe.get_all('Sales Invoice', fields =["*"], filters = {'offline_pos_name': '09052016142', 'docstatus': 1})
|
||||
@@ -917,51 +956,13 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
|
||||
def test_create_so_with_margin(self):
|
||||
si = create_sales_invoice(item_code="_Test Item", qty=1, do_not_submit=True)
|
||||
price_list_rate = si.items[0].price_list_rate
|
||||
price_list_rate = 100
|
||||
si.items[0].price_list_rate = price_list_rate
|
||||
si.items[0].margin_type = 'Percentage'
|
||||
si.items[0].margin_rate_or_amount = 25
|
||||
si.insert()
|
||||
self.assertEqual(si.get("items")[0].rate, flt((price_list_rate*25)/100 + price_list_rate))
|
||||
|
||||
self.assertNotEquals(si.get("items")[0].rate, flt((price_list_rate*25)/100 + price_list_rate))
|
||||
si.items[0].margin_rate_or_amount = 25
|
||||
si.submit()
|
||||
|
||||
self.assertNotEquals(si.get("items")[0].rate, flt((price_list_rate*25)/100 + price_list_rate))
|
||||
|
||||
def test_party_status(self):
|
||||
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
|
||||
from frappe.utils import random_string
|
||||
|
||||
customer_name = 'test customer for status'
|
||||
|
||||
if frappe.db.exists('Customer', customer_name):
|
||||
customer = frappe.get_doc('Customer', customer_name)
|
||||
customer.db_set('status', 'Active')
|
||||
else:
|
||||
customer = frappe.get_doc({
|
||||
'doctype': 'Customer',
|
||||
'customer_name': customer_name,
|
||||
'customer_group': 'Commercial',
|
||||
'customer_type': 'Individual',
|
||||
'territory': 'Rest of the World'
|
||||
}).insert()
|
||||
|
||||
self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Active')
|
||||
|
||||
invoice = create_sales_invoice(customer="test customer for status",
|
||||
debit_to="_Test Receivable - _TC",
|
||||
currency="USD", conversion_rate=50)
|
||||
|
||||
self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Open')
|
||||
|
||||
pe = get_payment_entry(invoice.doctype, invoice.name)
|
||||
pe.reference_no = random_string(10)
|
||||
pe.reference_date = invoice.posting_date
|
||||
pe.insert()
|
||||
pe.submit()
|
||||
|
||||
self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Active')
|
||||
|
||||
def test_outstanding_amount_after_advance_jv_cancelation(self):
|
||||
from erpnext.accounts.doctype.journal_entry.test_journal_entry \
|
||||
import test_records as jv_test_records
|
||||
@@ -986,15 +987,15 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
|
||||
#check outstanding after advance allocation
|
||||
self.assertEqual(flt(si.outstanding_amount), flt(si.grand_total - si.total_advance, si.precision("outstanding_amount")))
|
||||
|
||||
|
||||
#added to avoid Document has been modified exception
|
||||
jv = frappe.get_doc("Journal Entry", jv.name)
|
||||
jv.cancel()
|
||||
|
||||
|
||||
si.load_from_db()
|
||||
#check outstanding after advance cancellation
|
||||
self.assertEqual(flt(si.outstanding_amount), flt(si.grand_total + si.total_advance, si.precision("outstanding_amount")))
|
||||
|
||||
|
||||
def test_outstanding_amount_after_advance_payment_entry_cancelation(self):
|
||||
pe = frappe.get_doc({
|
||||
"doctype": "Payment Entry",
|
||||
@@ -1015,7 +1016,7 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
})
|
||||
pe.insert()
|
||||
pe.submit()
|
||||
|
||||
|
||||
si = frappe.copy_doc(test_records[0])
|
||||
si.is_pos = 0
|
||||
si.append("advances", {
|
||||
@@ -1028,23 +1029,44 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
})
|
||||
si.insert()
|
||||
si.submit()
|
||||
|
||||
|
||||
si.load_from_db()
|
||||
|
||||
#check outstanding after advance allocation
|
||||
self.assertEqual(flt(si.outstanding_amount), flt(si.grand_total - si.total_advance, si.precision("outstanding_amount")))
|
||||
|
||||
|
||||
#added to avoid Document has been modified exception
|
||||
pe = frappe.get_doc("Payment Entry", pe.name)
|
||||
pe.cancel()
|
||||
|
||||
|
||||
si.load_from_db()
|
||||
#check outstanding after advance cancellation
|
||||
self.assertEqual(flt(si.outstanding_amount), flt(si.grand_total + si.total_advance, si.precision("outstanding_amount")))
|
||||
|
||||
def test_multiple_uom_in_selling(self):
|
||||
si = frappe.copy_doc(test_records[1])
|
||||
|
||||
si.items[0].uom = "_Test UOM 1"
|
||||
si.items[0].conversion_factor = None
|
||||
si.items[0].price_list_rate = None
|
||||
si.save()
|
||||
|
||||
expected_values = {
|
||||
"keys": ["price_list_rate", "stock_uom", "uom", "conversion_factor", "rate", "amount",
|
||||
"base_price_list_rate", "base_rate", "base_amount"],
|
||||
"_Test Item": [1000, "_Test UOM", "_Test UOM 1", 10.0, 1000, 1000, 1000, 1000, 1000]
|
||||
}
|
||||
|
||||
# check if the conversion_factor and price_list_rate is calculated according to uom
|
||||
for d in si.get("items"):
|
||||
for i, k in enumerate(expected_values["keys"]):
|
||||
self.assertEquals(d.get(k), expected_values[d.item_code][i])
|
||||
|
||||
def create_sales_invoice(**args):
|
||||
si = frappe.new_doc("Sales Invoice")
|
||||
args = frappe._dict(args)
|
||||
if args.posting_date:
|
||||
si.set_posting_time = 1
|
||||
si.posting_date = args.posting_date or nowdate()
|
||||
|
||||
si.company = args.company or "_Test Company"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"autoname": "hash",
|
||||
@@ -22,6 +23,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": "Barcode",
|
||||
@@ -48,7 +50,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Item",
|
||||
@@ -79,6 +82,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -105,6 +109,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Item Name",
|
||||
@@ -134,6 +139,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": "Customer's Item Code",
|
||||
@@ -161,6 +167,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": "Edit Description",
|
||||
@@ -189,6 +196,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": "Description",
|
||||
@@ -220,6 +228,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -247,6 +256,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": "Image View",
|
||||
@@ -276,6 +286,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": "Image",
|
||||
@@ -304,6 +315,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": "",
|
||||
@@ -331,6 +343,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": "Quantity",
|
||||
@@ -349,6 +362,178 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "stock_uom",
|
||||
"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": "Stock UOM",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "UOM",
|
||||
"permlevel": 0,
|
||||
"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_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "col_break2",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "uom",
|
||||
"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": "UOM",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "UOM",
|
||||
"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_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "conversion_factor",
|
||||
"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": "UOM Conversion Factor",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"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,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "stock_qty",
|
||||
"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": "Qty as per Stock UOM",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"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
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "section_break_17",
|
||||
"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,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -360,6 +545,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": "Price List Rate",
|
||||
@@ -379,60 +565,6 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "col_break2",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "stock_uom",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "UOM",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "UOM",
|
||||
"permlevel": 0,
|
||||
"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_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -444,6 +576,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": "Price List Rate (Company Currency)",
|
||||
@@ -474,6 +607,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": "Discount and Margin",
|
||||
@@ -503,6 +637,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": "Discount on Price List Rate (%)",
|
||||
@@ -532,6 +667,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -560,6 +696,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": "Margin Type",
|
||||
@@ -590,6 +727,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": "Margin Rate or Amount",
|
||||
@@ -619,6 +757,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": "Total Margin",
|
||||
@@ -647,6 +786,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -673,6 +813,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": "Rate",
|
||||
@@ -703,6 +844,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",
|
||||
@@ -733,6 +875,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -759,6 +902,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": "Rate (Company Currency)",
|
||||
@@ -789,6 +933,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": "Amount (Company Currency)",
|
||||
@@ -819,6 +964,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": "Pricing Rule",
|
||||
@@ -847,6 +993,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -874,6 +1021,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": "Net Rate",
|
||||
@@ -903,6 +1051,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": "Net Amount",
|
||||
@@ -932,6 +1081,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -959,6 +1109,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": "Net Rate (Company Currency)",
|
||||
@@ -988,6 +1139,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": "Net Amount (Company Currency)",
|
||||
@@ -1018,6 +1170,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": "Drop Ship",
|
||||
@@ -1046,6 +1199,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": "Delivered By Supplier",
|
||||
@@ -1074,6 +1228,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": "Accounting Details",
|
||||
@@ -1100,7 +1255,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Income Account",
|
||||
@@ -1132,7 +1288,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Expense Account",
|
||||
@@ -1162,6 +1319,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -1188,7 +1346,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Cost Center",
|
||||
@@ -1216,12 +1375,14 @@
|
||||
"collapsible": 1,
|
||||
"collapsible_depends_on": "eval:doc.serial_no || doc.batch_no",
|
||||
"columns": 0,
|
||||
"depends_on": "eval: parent.update_stock",
|
||||
"fieldname": "warehouse_and_reference",
|
||||
"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": "Stock Details",
|
||||
@@ -1249,6 +1410,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": "Warehouse",
|
||||
@@ -1279,6 +1441,7 @@
|
||||
"ignore_user_permissions": 1,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Customer Warehouse (Optional)",
|
||||
@@ -1309,6 +1472,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": "Quality Inspection",
|
||||
@@ -1338,6 +1502,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": "Batch No",
|
||||
@@ -1366,6 +1531,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -1381,6 +1547,35 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "allow_zero_valuation_rate",
|
||||
"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": "Allow Zero Valuation Rate",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -1391,7 +1586,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Serial No",
|
||||
@@ -1421,7 +1617,8 @@
|
||||
"hidden": 1,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Item Group",
|
||||
@@ -1451,7 +1648,8 @@
|
||||
"hidden": 1,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Brand Name",
|
||||
@@ -1481,6 +1679,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": "Item Tax Rate",
|
||||
@@ -1510,6 +1709,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": "Available Batch Qty at Warehouse",
|
||||
@@ -1540,6 +1740,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": "Available Qty at Warehouse",
|
||||
@@ -1569,6 +1770,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": "References",
|
||||
@@ -1596,7 +1798,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Sales Order",
|
||||
@@ -1626,7 +1829,8 @@
|
||||
"hidden": 1,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Sales Order Item",
|
||||
@@ -1656,6 +1860,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -1682,7 +1887,8 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Delivery Note",
|
||||
@@ -1712,7 +1918,8 @@
|
||||
"hidden": 1,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Delivery Note Item",
|
||||
@@ -1742,6 +1949,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": "Delivered Qty",
|
||||
@@ -1771,6 +1979,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 Fixed Asset",
|
||||
@@ -1799,6 +2008,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": "Asset",
|
||||
@@ -1828,6 +2038,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -1855,6 +2066,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": "Page Break",
|
||||
@@ -1872,17 +2084,17 @@
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 1,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-11-16 16:04:02.438952",
|
||||
"modified": "2017-04-19 11:53:26.682964",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Sales Invoice Item",
|
||||
@@ -1891,7 +2103,9 @@
|
||||
"quick_entry": 0,
|
||||
"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
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
@@ -21,7 +22,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 1,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Time Sheet",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -31,6 +34,7 @@
|
||||
"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,
|
||||
@@ -48,7 +52,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Billing Hours",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -57,6 +63,7 @@
|
||||
"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,
|
||||
@@ -74,7 +81,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Billing Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
@@ -83,6 +92,7 @@
|
||||
"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,
|
||||
@@ -100,7 +110,9 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Timesheet Detail",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@@ -109,6 +121,7 @@
|
||||
"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,
|
||||
@@ -126,7 +139,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-09-09 14:01:04.095775",
|
||||
"modified": "2017-02-17 16:47:04.413420",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Sales Invoice Timesheet",
|
||||
@@ -136,7 +149,9 @@
|
||||
"quick_entry": 1,
|
||||
"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
|
||||
}
|
||||
@@ -4,11 +4,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
import frappe, erpnext
|
||||
from frappe import _, msgprint, throw
|
||||
from frappe.utils import flt, fmt_money
|
||||
from frappe.model.document import Document
|
||||
from erpnext.setup.utils import get_company_currency
|
||||
|
||||
class OverlappingConditionError(frappe.ValidationError): pass
|
||||
class FromGreaterThanToError(frappe.ValidationError): pass
|
||||
@@ -77,7 +76,7 @@ class ShippingRule(Document):
|
||||
overlaps.append([d1, d2])
|
||||
|
||||
if overlaps:
|
||||
company_currency = get_company_currency(self.company)
|
||||
company_currency = erpnext.get_company_currency(self.company)
|
||||
msgprint(_("Overlapping conditions found between:"))
|
||||
messages = []
|
||||
for d1, d2 in overlaps:
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Tax Type",
|
||||
@@ -52,6 +53,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": "Use for Shopping Cart",
|
||||
@@ -80,6 +82,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -108,6 +111,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": "Sales Tax Template",
|
||||
@@ -138,6 +142,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": "Purchase Tax Template",
|
||||
@@ -167,6 +172,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": "Filters",
|
||||
@@ -196,6 +202,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": "Customer",
|
||||
@@ -226,6 +233,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": "Supplier",
|
||||
@@ -255,6 +263,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": "Billing City",
|
||||
@@ -283,6 +292,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": "Billing County",
|
||||
@@ -311,6 +321,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": "Billing State",
|
||||
@@ -339,6 +350,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": "Billing Country",
|
||||
@@ -368,6 +380,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -396,6 +409,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": "Customer Group",
|
||||
@@ -426,6 +440,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": "Supplier Type",
|
||||
@@ -455,6 +470,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": "Shipping City",
|
||||
@@ -483,6 +499,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": "Shipping County",
|
||||
@@ -511,6 +528,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": "Shipping State",
|
||||
@@ -539,6 +557,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": "Shipping Country",
|
||||
@@ -568,6 +587,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": "Validity",
|
||||
@@ -596,6 +616,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": "From Date",
|
||||
@@ -624,6 +645,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -651,6 +673,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": "To Date",
|
||||
@@ -679,6 +702,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -707,6 +731,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": "Priority",
|
||||
@@ -735,6 +760,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
@@ -762,6 +788,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": "Company",
|
||||
@@ -791,7 +818,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-12-13 15:56:28.704122",
|
||||
"modified": "2017-02-17 16:22:42.501765",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Tax Rule",
|
||||
@@ -808,7 +835,6 @@
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@@ -823,7 +849,9 @@
|
||||
"quick_entry": 0,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 0,
|
||||
"track_seen": 0
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import cstr, cint
|
||||
from frappe.geo.doctype.address.address import get_default_address
|
||||
|
||||
class IncorrectCustomerGroup(frappe.ValidationError): pass
|
||||
class IncorrectSupplierType(frappe.ValidationError): pass
|
||||
@@ -96,27 +97,31 @@ class TaxRule(Document):
|
||||
@frappe.whitelist()
|
||||
def get_party_details(party, party_type, args=None):
|
||||
out = {}
|
||||
billing_address, shipping_address = None, None
|
||||
if args:
|
||||
billing_filters= {"name": args.get("billing_address")}
|
||||
shipping_filters= {"name": args.get("shipping_address")}
|
||||
if args.get('billing_address'):
|
||||
billing_address = frappe.get_doc('Address', args.get('billing_address'))
|
||||
if args.get('shipping_address'):
|
||||
shipping_address = frappe.get_doc('Address', args.get('shipping_address'))
|
||||
else:
|
||||
billing_filters= {party_type: party, "is_primary_address": 1}
|
||||
shipping_filters= {party_type:party, "is_shipping_address": 1}
|
||||
|
||||
billing_address= frappe.get_all("Address", fields=["city", "county", "state", "country"], filters= billing_filters)
|
||||
shipping_address= frappe.get_all("Address", fields=["city", "county", "state", "country"], filters= shipping_filters)
|
||||
billing_address_name = get_default_address(party_type, party)
|
||||
shipping_address_name = get_default_address(party_type, party, 'is_shipping_address')
|
||||
if billing_address_name:
|
||||
billing_address = frappe.get_doc('Address', billing_address_name)
|
||||
if shipping_address_name:
|
||||
shipping_address = frappe.get_doc('Address', shipping_address_name)
|
||||
|
||||
if billing_address:
|
||||
out["billing_city"]= billing_address[0].city
|
||||
out["billing_county"]= billing_address[0].county
|
||||
out["billing_state"]= billing_address[0].state
|
||||
out["billing_country"]= billing_address[0].country
|
||||
out["billing_city"]= billing_address.city
|
||||
out["billing_county"]= billing_address.county
|
||||
out["billing_state"]= billing_address.state
|
||||
out["billing_country"]= billing_address.country
|
||||
|
||||
if shipping_address:
|
||||
out["shipping_city"]= shipping_address[0].city
|
||||
out["shipping_county"]= shipping_address[0].county
|
||||
out["shipping_state"]= shipping_address[0].state
|
||||
out["shipping_country"]= shipping_address[0].country
|
||||
out["shipping_city"]= shipping_address.city
|
||||
out["shipping_county"]= shipping_address.county
|
||||
out["shipping_state"]= shipping_address.state
|
||||
out["shipping_country"]= shipping_address.country
|
||||
|
||||
return out
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ from erpnext.accounts.doctype.budget.budget import validate_expense_against_budg
|
||||
|
||||
class StockAccountInvalidTransaction(frappe.ValidationError): pass
|
||||
|
||||
def make_gl_entries(gl_map, cancel=False, adv_adj=False, merge_entries=True, update_outstanding='Yes'):
|
||||
def make_gl_entries(gl_map, cancel=False, adv_adj=False, merge_entries=True, update_outstanding='Yes', from_repost=False):
|
||||
if gl_map:
|
||||
if not cancel:
|
||||
gl_map = process_gl_map(gl_map, merge_entries)
|
||||
if gl_map and len(gl_map) > 1:
|
||||
save_entries(gl_map, adv_adj, update_outstanding)
|
||||
save_entries(gl_map, adv_adj, update_outstanding, from_repost)
|
||||
else:
|
||||
frappe.throw(_("Incorrect number of General Ledger Entries found. You might have selected a wrong Account in the transaction."))
|
||||
else:
|
||||
@@ -78,21 +78,26 @@ def check_if_in_list(gle, gl_map):
|
||||
and cstr(e.get('project')) == cstr(gle.get('project')):
|
||||
return e
|
||||
|
||||
def save_entries(gl_map, adv_adj, update_outstanding):
|
||||
validate_account_for_auto_accounting_for_stock(gl_map)
|
||||
def save_entries(gl_map, adv_adj, update_outstanding, from_repost=False):
|
||||
if not from_repost:
|
||||
validate_account_for_auto_accounting_for_stock(gl_map)
|
||||
|
||||
round_off_debit_credit(gl_map)
|
||||
|
||||
for entry in gl_map:
|
||||
make_entry(entry, adv_adj, update_outstanding)
|
||||
make_entry(entry, adv_adj, update_outstanding, from_repost)
|
||||
|
||||
# check against budget
|
||||
validate_expense_against_budget(entry)
|
||||
if not from_repost:
|
||||
validate_expense_against_budget(entry)
|
||||
|
||||
def make_entry(args, adv_adj, update_outstanding):
|
||||
def make_entry(args, adv_adj, update_outstanding, from_repost=False):
|
||||
args.update({"doctype": "GL Entry"})
|
||||
gle = frappe.get_doc(args)
|
||||
gle.flags.ignore_permissions = 1
|
||||
gle.flags.from_repost = from_repost
|
||||
gle.insert()
|
||||
gle.run_method("on_update_with_args", adv_adj, update_outstanding)
|
||||
gle.run_method("on_update_with_args", adv_adj, update_outstanding, from_repost)
|
||||
gle.submit()
|
||||
|
||||
def validate_account_for_auto_accounting_for_stock(gl_map):
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -7,9 +7,9 @@ import frappe
|
||||
import datetime
|
||||
from frappe import _, msgprint, scrub
|
||||
from frappe.defaults import get_user_permissions
|
||||
from frappe.utils import add_days, getdate, formatdate, get_first_day, date_diff, add_years
|
||||
from erpnext.utilities.doctype.address.address import get_address_display
|
||||
from erpnext.utilities.doctype.contact.contact import get_contact_details
|
||||
from frappe.utils import add_days, getdate, formatdate, get_first_day, date_diff, add_years, get_timestamp
|
||||
from frappe.geo.doctype.address.address import get_address_display, get_default_address
|
||||
from frappe.email.doctype.contact.contact import get_contact_details, get_default_contact
|
||||
from erpnext.exceptions import PartyFrozen, InvalidCurrency, PartyDisabled, InvalidAccountCurrency
|
||||
|
||||
class DuplicatePartyAccountError(frappe.ValidationError): pass
|
||||
@@ -60,21 +60,18 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
|
||||
def set_address_details(out, party, party_type):
|
||||
billing_address_field = "customer_address" if party_type == "Lead" \
|
||||
else party_type.lower() + "_address"
|
||||
out[billing_address_field] = frappe.db.get_value("Address",
|
||||
{party_type.lower(): party.name, "is_primary_address":1}, "name")
|
||||
out[billing_address_field] = get_default_address(party_type, party.name)
|
||||
|
||||
# address display
|
||||
out.address_display = get_address_display(out[billing_address_field])
|
||||
|
||||
# shipping address
|
||||
if party_type in ["Customer", "Lead"]:
|
||||
out.shipping_address_name = frappe.db.get_value("Address",
|
||||
{party_type.lower(): party.name, "is_shipping_address":1}, "name")
|
||||
out.shipping_address_name = get_default_address(party_type, party.name, 'is_shipping_address')
|
||||
out.shipping_address = get_address_display(out["shipping_address_name"])
|
||||
|
||||
def set_contact_details(out, party, party_type):
|
||||
out.contact_person = frappe.db.get_value("Contact",
|
||||
{party_type.lower(): party.name, "is_primary_contact":1}, "name")
|
||||
out.contact_person = get_default_contact(party_type, party.name)
|
||||
|
||||
if not out.contact_person:
|
||||
out.update({
|
||||
@@ -154,13 +151,6 @@ def set_account_and_due_date(party, account, party_type, company, posting_date,
|
||||
}
|
||||
return out
|
||||
|
||||
def get_company_currency():
|
||||
company_currency = frappe._dict()
|
||||
for d in frappe.get_all("Company", fields=["name", "default_currency"]):
|
||||
company_currency.setdefault(d.name, d.default_currency)
|
||||
|
||||
return company_currency
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_party_account(party_type, party, company):
|
||||
"""Returns the account for the given `party`.
|
||||
@@ -174,17 +164,17 @@ def get_party_account(party_type, party, company):
|
||||
account = frappe.db.get_value("Party Account",
|
||||
{"parenttype": party_type, "parent": party, "company": company}, "account")
|
||||
|
||||
if not account:
|
||||
if not account and party_type in ['Customer', 'Supplier']:
|
||||
party_group_doctype = "Customer Group" if party_type=="Customer" else "Supplier Type"
|
||||
group = frappe.db.get_value(party_type, party, scrub(party_group_doctype))
|
||||
account = frappe.db.get_value("Party Account",
|
||||
{"parenttype": party_group_doctype, "parent": group, "company": company}, "account")
|
||||
|
||||
if not account:
|
||||
if not account and party_type in ['Customer', 'Supplier']:
|
||||
default_account_name = "default_receivable_account" \
|
||||
if party_type=="Customer" else "default_payable_account"
|
||||
account = frappe.db.get_value("Company", company, default_account_name)
|
||||
|
||||
|
||||
existing_gle_currency = get_party_gle_currency(party_type, party, company)
|
||||
if existing_gle_currency:
|
||||
if account:
|
||||
@@ -211,7 +201,7 @@ def get_party_gle_currency(party_type, party, company):
|
||||
|
||||
return frappe.local_cache("party_gle_currency", (party_type, party, company), generator,
|
||||
regenerate_if_none=True)
|
||||
|
||||
|
||||
def get_party_gle_account(party_type, party, company):
|
||||
def generator():
|
||||
existing_gle_account = frappe.db.sql("""select account from `tabGL Entry`
|
||||
@@ -252,7 +242,7 @@ def validate_party_accounts(doc):
|
||||
if existing_gle_currency and party_account_currency != existing_gle_currency:
|
||||
frappe.throw(_("Accounting entries have already been made in currency {0} for company {1}. Please select a receivable or payable account with currency {0}.").format(existing_gle_currency, account.company))
|
||||
|
||||
if doc.default_currency and party_account_currency and company_default_currency:
|
||||
if doc.get("default_currency") and party_account_currency and company_default_currency:
|
||||
if doc.default_currency != party_account_currency and doc.default_currency != company_default_currency:
|
||||
frappe.throw(_("Billing currency must be equal to either default comapany's currency or party account currency"))
|
||||
|
||||
@@ -340,19 +330,33 @@ def set_taxes(party, party_type, posting_date, company, customer_group=None, sup
|
||||
|
||||
def validate_party_frozen_disabled(party_type, party_name):
|
||||
if party_type and party_name:
|
||||
party = frappe.db.get_value(party_type, party_name, ["is_frozen", "disabled"], as_dict=True)
|
||||
if party.disabled:
|
||||
frappe.throw(_("{0} {1} is disabled").format(party_type, party_name), PartyDisabled)
|
||||
elif party.is_frozen:
|
||||
frozen_accounts_modifier = frappe.db.get_value( 'Accounts Settings', None,'frozen_accounts_modifier')
|
||||
if not frozen_accounts_modifier in frappe.get_roles():
|
||||
frappe.throw(_("{0} {1} is frozen").format(party_type, party_name), PartyFrozen)
|
||||
if party_type in ("Customer", "Supplier"):
|
||||
party = frappe.db.get_value(party_type, party_name, ["is_frozen", "disabled"], as_dict=True)
|
||||
if party.disabled:
|
||||
frappe.throw(_("{0} {1} is disabled").format(party_type, party_name), PartyDisabled)
|
||||
elif party.get("is_frozen"):
|
||||
frozen_accounts_modifier = frappe.db.get_value( 'Accounts Settings', None,'frozen_accounts_modifier')
|
||||
if not frozen_accounts_modifier in frappe.get_roles():
|
||||
frappe.throw(_("{0} {1} is frozen").format(party_type, party_name), PartyFrozen)
|
||||
|
||||
elif party_type == "Employee":
|
||||
if frappe.db.get_value("Employee", party_name, "status") == "Left":
|
||||
frappe.msgprint(_("{0} {1} is not active").format(party_type, party_name), alert=True)
|
||||
|
||||
def get_timeline_data(doctype, name):
|
||||
'''returns timeline data for the past one year'''
|
||||
from frappe.desk.form.load import get_communication_data
|
||||
|
||||
out = {}
|
||||
data = get_communication_data(doctype, name,
|
||||
fields = 'unix_timestamp(date(creation)), count(name)',
|
||||
fields = 'date(creation), count(name)',
|
||||
after = add_years(None, -1).strftime('%Y-%m-%d'),
|
||||
group_by='group by date(creation)', as_dict=False)
|
||||
return dict(data)
|
||||
|
||||
timeline_items = dict(data)
|
||||
|
||||
for date, count in timeline_items.iteritems():
|
||||
timestamp = get_timestamp(date)
|
||||
out.update({ timestamp: count })
|
||||
|
||||
return out
|
||||
@@ -1,81 +0,0 @@
|
||||
# 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
|
||||
|
||||
from frappe.utils import evaluate_filters
|
||||
from frappe.desk.notifications import get_filters_for
|
||||
|
||||
# NOTE: if you change this also update triggers in erpnext/hooks.py
|
||||
status_depends_on = {
|
||||
'Customer': ('Opportunity', 'Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice', 'Project', 'Issue'),
|
||||
'Supplier': ('Supplier Quotation', 'Purchase Order', 'Purchase Receipt', 'Purchase Invoice')
|
||||
}
|
||||
|
||||
default_status = {
|
||||
'Customer': 'Active',
|
||||
'Supplier': None
|
||||
}
|
||||
|
||||
def notify_status(doc, method=None):
|
||||
'''Notify status to customer, supplier'''
|
||||
|
||||
party_type = None
|
||||
for key, doctypes in status_depends_on.iteritems():
|
||||
if doc.doctype in doctypes:
|
||||
party_type = key
|
||||
break
|
||||
|
||||
if not party_type:
|
||||
return
|
||||
|
||||
name = doc.get(party_type.lower())
|
||||
if not name:
|
||||
return
|
||||
|
||||
party = frappe.get_doc(party_type, name)
|
||||
filters = get_filters_for(doc.doctype)
|
||||
party.flags.ignore_mandatory = True
|
||||
|
||||
status = None
|
||||
if filters:
|
||||
if evaluate_filters(doc, filters):
|
||||
# filters match, passed document is open
|
||||
status = 'Open'
|
||||
|
||||
if status=='Open':
|
||||
if party.status != 'Open':
|
||||
# party not open, make it open
|
||||
party.status = 'Open'
|
||||
party.save(ignore_permissions=True)
|
||||
|
||||
else:
|
||||
if party.status == 'Open':
|
||||
# may be open elsewhere, check
|
||||
# default status
|
||||
update_status(party)
|
||||
|
||||
party.update_modified()
|
||||
party.notify_update()
|
||||
|
||||
def get_party_status(doc):
|
||||
'''return party status based on open documents'''
|
||||
status = default_status[doc.doctype]
|
||||
for doctype in status_depends_on[doc.doctype]:
|
||||
filters = get_filters_for(doctype)
|
||||
filters[doc.doctype.lower()] = doc.name
|
||||
if filters:
|
||||
open_count = frappe.get_all(doctype, fields='name', filters=filters, limit_page_length=1)
|
||||
if len(open_count) > 0:
|
||||
status = 'Open'
|
||||
break
|
||||
|
||||
return status
|
||||
|
||||
def update_status(doc):
|
||||
'''Set status as open if there is any open notification'''
|
||||
status = get_party_status(doc)
|
||||
if doc.status != status:
|
||||
doc.db_set('status', status)
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"align_labels_left": 0,
|
||||
"creation": "2016-05-05 17:16:18.564460",
|
||||
"custom_format": 1,
|
||||
"disabled": 0,
|
||||
@@ -6,13 +7,16 @@
|
||||
"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{{ company }}<br>\n\t{{ __(\"POS No : \") }}{{offline_pos_name}}<br>\n</p>\n<p>\n\t<b>{{ __(\"Date\") }}:</b> {{ dateutil.global_date_format(posting_date) }}<br>\n</p>\n\n<hr>\n<table class=\"table table-condensed cart no-border\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"50%\">{{ __(\"Item\") }}</b></th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Qty\") }}</th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{% for item in items %}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_name }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ format_number(item.qty, precision(\"difference\")) }}<br>@ {{ format_currency(item.rate, currency) }}</td>\n\t\t\t<td class=\"text-right\">{{ format_currency(item.amount, currency) }}</td>\n\t\t</tr>\n\t\t{% endfor %}\n\t</tbody>\n</table>\n\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ __(\"Net Total\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% for row in taxes %}\n\t\t{% if not row.included_in_print_rate %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ row.description }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(row.tax_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t{% endfor %}\n\t\t{% if discount_amount %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t{{ __(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(discount_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(grand_total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n\n<hr>\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{{ company }}<br>\n\t{{ __(\"POS No : \") }} {{ offline_pos_name }}<br>\n</p>\n<p>\n\t<b>{{ __(\"Date\") }}:</b> {{ dateutil.global_date_format(posting_date) }}<br>\n</p>\n\n<hr>\n<table class=\"table table-condensed cart no-border\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"50%\">{{ __(\"Item\") }}</b></th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Qty\") }}</th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{% for item in items %}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_name }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ format_number(item.qty, null,precision(\"difference\")) }}<br>@ {{ format_currency(item.rate, currency) }}</td>\n\t\t\t<td class=\"text-right\">{{ format_currency(item.amount, currency) }}</td>\n\t\t</tr>\n\t\t{% endfor %}\n\t</tbody>\n</table>\n\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ __(\"Net Total\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% for row in taxes %}\n\t\t{% if not row.included_in_print_rate %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ row.description }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(row.tax_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t{% endfor %}\n\t\t{% if discount_amount %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t{{ __(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(discount_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(grand_total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Paid Amount\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(paid_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n\n<hr>\n<p>{{ terms }}</p>\n<p class=\"text-center\">{{ __(\"Thank you, please visit again.\") }}</p>",
|
||||
"idx": 0,
|
||||
"modified": "2016-09-05 08:28:42.308782",
|
||||
"line_breaks": 0,
|
||||
"modified": "2017-04-19 13:28:05.129504",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Point of Sale",
|
||||
"owner": "Administrator",
|
||||
"print_format_builder": 0,
|
||||
"print_format_type": "Js",
|
||||
"show_section_headings": 0,
|
||||
"standard": "Yes"
|
||||
}
|
||||
@@ -53,5 +53,11 @@ frappe.query_reports["Accounts Payable"] = {
|
||||
"default": "90",
|
||||
"reqd": 1
|
||||
}
|
||||
]
|
||||
],
|
||||
onload: function(report) {
|
||||
report.page.add_inner_button(__("Accounts Payable Summary"), function() {
|
||||
var filters = report.get_values();
|
||||
frappe.set_route('query-report', 'Accounts Payable Summary', {company: filters.company});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,32 @@
|
||||
{
|
||||
"add_total_row": 1,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2013-04-22 16:16:03",
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 1,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2015-07-24 01:08:20.996267",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Accounts Payable",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Purchase Invoice",
|
||||
"report_name": "Accounts Payable",
|
||||
"report_type": "Script Report"
|
||||
}
|
||||
"add_total_row": 1,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2013-04-22 16:16:03",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 3,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2017-02-24 20:09:46.150861",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Accounts Payable",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Purchase Invoice",
|
||||
"report_name": "Accounts Payable",
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts User"
|
||||
},
|
||||
{
|
||||
"role": "Purchase User"
|
||||
},
|
||||
{
|
||||
"role": "Accounts Manager"
|
||||
},
|
||||
{
|
||||
"role": "Auditor"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -53,5 +53,12 @@ frappe.query_reports["Accounts Payable Summary"] = {
|
||||
"default": "90",
|
||||
"reqd": 1
|
||||
}
|
||||
]
|
||||
],
|
||||
|
||||
onload: function(report) {
|
||||
report.page.add_inner_button(__("Accounts Payable"), function() {
|
||||
var filters = report.get_values();
|
||||
frappe.set_route('query-report', 'Accounts Payable', {company: filters.company});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,28 @@
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 2,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2014-11-04 12:09:59.672379",
|
||||
"modified": "2017-02-24 20:11:35.655834",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Accounts Payable Summary",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Purchase Invoice",
|
||||
"report_name": "Accounts Payable Summary",
|
||||
"report_type": "Script Report"
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts User"
|
||||
},
|
||||
{
|
||||
"role": "Purchase User"
|
||||
},
|
||||
{
|
||||
"role": "Accounts Manager"
|
||||
},
|
||||
{
|
||||
"role": "Auditor"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -53,5 +53,12 @@ frappe.query_reports["Accounts Receivable"] = {
|
||||
"default": "90",
|
||||
"reqd": 1
|
||||
}
|
||||
]
|
||||
],
|
||||
|
||||
onload: function(report) {
|
||||
report.page.add_inner_button(__("Accounts Receivable Summary"), function() {
|
||||
var filters = report.get_values();
|
||||
frappe.set_route('query-report', 'Accounts Receivable Summary', {company: filters.company});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,16 +2,25 @@
|
||||
"add_total_row": 1,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2013-04-16 11:31:13",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 1,
|
||||
"idx": 3,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2014-06-03 07:18:16.907658",
|
||||
"modified": "2017-03-06 05:52:06.235584",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Accounts Receivable",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Sales Invoice",
|
||||
"report_name": "Accounts Receivable",
|
||||
"report_type": "Script Report"
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts Manager"
|
||||
},
|
||||
{
|
||||
"role": "Accounts User"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -53,5 +53,12 @@ frappe.query_reports["Accounts Receivable Summary"] = {
|
||||
"default": "90",
|
||||
"reqd": 1
|
||||
}
|
||||
]
|
||||
],
|
||||
|
||||
onload: function(report) {
|
||||
report.page.add_inner_button(__("Accounts Receivable"), function() {
|
||||
var filters = report.get_values();
|
||||
frappe.set_route('query-report', 'Accounts Receivable', {company: filters.company});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,22 @@
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 2,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2014-12-01 16:14:40.213259",
|
||||
"modified": "2017-03-06 05:52:23.751082",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Accounts Receivable Summary",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Sales Invoice",
|
||||
"report_name": "Accounts Receivable Summary",
|
||||
"report_type": "Script Report"
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts Manager"
|
||||
},
|
||||
{
|
||||
"role": "Accounts User"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -5,14 +5,19 @@
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"idx": 2,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2016-04-08 14:49:58.133098",
|
||||
"modified": "2017-02-24 20:08:26.084484",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Asset Depreciation Ledger",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Asset",
|
||||
"report_name": "Asset Depreciation Ledger",
|
||||
"report_type": "Script Report"
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts User"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -5,14 +5,19 @@
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"idx": 2,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2016-04-08 14:56:37.235981",
|
||||
"modified": "2017-02-24 20:08:18.660476",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Asset Depreciations and Balances",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Asset",
|
||||
"report_name": "Asset Depreciations and Balances",
|
||||
"report_type": "Script Report"
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts User"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,15 +1,29 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2014-07-14 05:24:20.385279",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 2,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2014-07-14 05:24:20.385279",
|
||||
"modified": "2017-02-24 20:12:47.161127",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Balance Sheet",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "GL Entry",
|
||||
"report_name": "Balance Sheet",
|
||||
"report_type": "Script Report"
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts User"
|
||||
},
|
||||
{
|
||||
"role": "Accounts Manager"
|
||||
},
|
||||
{
|
||||
"role": "Auditor"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -8,7 +8,7 @@ from frappe.utils import flt, cint
|
||||
from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, get_data)
|
||||
|
||||
def execute(filters=None):
|
||||
period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year, filters.periodicity)
|
||||
period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year, filters.periodicity, filters.company)
|
||||
|
||||
asset = get_data(filters.company, "Asset", "Debit", period_list, only_current_fiscal_year=False)
|
||||
liability = get_data(filters.company, "Liability", "Credit", period_list, only_current_fiscal_year=False)
|
||||
@@ -26,7 +26,7 @@ def execute(filters=None):
|
||||
if opening_balance and round(opening_balance,2) !=0:
|
||||
unclosed ={
|
||||
"account_name": "'" + _("Unclosed Fiscal Years Profit / Loss (Credit)") + "'",
|
||||
"account": None,
|
||||
"account": "'" + _("Unclosed Fiscal Years Profit / Loss (Credit)") + "'",
|
||||
"warn_if_negative": True,
|
||||
"currency": frappe.db.get_value("Company", filters.company, "default_currency")
|
||||
}
|
||||
@@ -57,7 +57,7 @@ def get_provisional_profit_loss(asset, liability, equity, period_list, company):
|
||||
currency = frappe.db.get_value("Company", company, "default_currency")
|
||||
total_row = {
|
||||
"account_name": "'" + _("Total (Credit)") + "'",
|
||||
"account": None,
|
||||
"account": "'" + _("Total (Credit)") + "'",
|
||||
"warn_if_negative": True,
|
||||
"currency": currency
|
||||
}
|
||||
@@ -85,7 +85,7 @@ def get_provisional_profit_loss(asset, liability, equity, period_list, company):
|
||||
if has_value:
|
||||
provisional_profit_loss.update({
|
||||
"account_name": "'" + _("Provisional Profit / Loss (Credit)") + "'",
|
||||
"account": None,
|
||||
"account": "'" + _("Provisional Profit / Loss (Credit)") + "'",
|
||||
"warn_if_negative": True,
|
||||
"currency": currency
|
||||
})
|
||||
|
||||
@@ -1,16 +1,29 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2013-05-01 12:13:25",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 1,
|
||||
"idx": 3,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2014-06-03 07:18:16.921522",
|
||||
"modified": "2017-02-24 20:19:26.257552",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Bank Clearance Summary",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Journal Entry",
|
||||
"report_name": "Bank Clearance Summary",
|
||||
"report_type": "Script Report"
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts User"
|
||||
},
|
||||
{
|
||||
"role": "Accounts Manager"
|
||||
},
|
||||
{
|
||||
"role": "Auditor"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,16 +2,28 @@
|
||||
"add_total_row": 0,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2013-04-30 18:30:21",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 1,
|
||||
"idx": 3,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2014-06-03 07:18:16.926502",
|
||||
"modified": "2017-02-24 20:19:19.231541",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Bank Reconciliation Statement",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Journal Entry",
|
||||
"report_name": "Bank Reconciliation Statement",
|
||||
"report_type": "Script Report"
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts User"
|
||||
},
|
||||
{
|
||||
"role": "Accounts Manager"
|
||||
},
|
||||
{
|
||||
"role": "Auditor"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,16 +1,35 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2013-06-18 12:56:36",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 1,
|
||||
"idx": 3,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2014-06-03 07:18:16.971175",
|
||||
"modified": "2017-02-24 20:19:06.964033",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Budget Variance Report",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Cost Center",
|
||||
"report_name": "Budget Variance Report",
|
||||
"report_type": "Script Report"
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts Manager"
|
||||
},
|
||||
{
|
||||
"role": "Auditor"
|
||||
},
|
||||
{
|
||||
"role": "Accounts User"
|
||||
},
|
||||
{
|
||||
"role": "Sales User"
|
||||
},
|
||||
{
|
||||
"role": "Purchase User"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -5,14 +5,25 @@
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"idx": 2,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2015-12-12 10:22:45.383203",
|
||||
"modified": "2017-02-24 20:09:19.748690",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Cash Flow",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "GL Entry",
|
||||
"report_name": "Cash Flow",
|
||||
"report_type": "Script Report"
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts User"
|
||||
},
|
||||
{
|
||||
"role": "Accounts Manager"
|
||||
},
|
||||
{
|
||||
"role": "Auditor"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -10,7 +10,8 @@ from erpnext.accounts.utils import get_fiscal_year
|
||||
|
||||
|
||||
def execute(filters=None):
|
||||
period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year, filters.periodicity)
|
||||
period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year,
|
||||
filters.periodicity, filters.company)
|
||||
|
||||
operation_accounts = {
|
||||
"section_name": "Operations",
|
||||
@@ -103,7 +104,7 @@ def get_account_type_based_data(company, account_type, period_list, accumulated_
|
||||
data = {}
|
||||
total = 0
|
||||
for period in period_list:
|
||||
start_date = get_start_date(period, accumulated_values)
|
||||
start_date = get_start_date(period, accumulated_values, company)
|
||||
gl_sum = frappe.db.sql_list("""
|
||||
select sum(credit) - sum(debit)
|
||||
from `tabGL Entry`
|
||||
@@ -126,10 +127,10 @@ def get_account_type_based_data(company, account_type, period_list, accumulated_
|
||||
data["total"] = total
|
||||
return data
|
||||
|
||||
def get_start_date(period, accumulated_values):
|
||||
def get_start_date(period, accumulated_values, company):
|
||||
start_date = period["year_start_date"]
|
||||
if accumulated_values:
|
||||
start_date = get_fiscal_year(period.to_date)[1]
|
||||
start_date = get_fiscal_year(period.to_date, company=company)[1]
|
||||
|
||||
return start_date
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.query_reports["Delivered Items To Be Billed"] = {
|
||||
"filters": [
|
||||
|
||||
]
|
||||
}
|
||||
@@ -5,9 +5,9 @@
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 1,
|
||||
"idx": 3,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2016-08-18 14:29:50.680329",
|
||||
"modified": "2017-02-24 20:20:20.613388",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Delivered Items To Be Billed",
|
||||
@@ -15,5 +15,13 @@
|
||||
"query": "select\n `tabDelivery Note`.`name` as \"Delivery Note:Link/Delivery Note:120\",\n\t`tabDelivery Note`.`customer` as \"Customer:Link/Customer:120\",\n\t`tabDelivery Note`.`customer_name` as \"Customer Name::150\",\n\t`tabDelivery Note`.`posting_date` as \"Date:Date\",\n\t`tabDelivery Note`.`project` as \"Project\",\n\t`tabDelivery Note Item`.`item_code` as \"Item:Link/Item:120\",\n\t(`tabDelivery Note Item`.`base_amount` - `tabDelivery Note Item`.`billed_amt`*ifnull(`tabDelivery Note`.conversion_rate, 1)) as \"Pending Amount:Currency:110\",\n\t`tabDelivery Note Item`.`item_name` as \"Item Name::150\",\n\t`tabDelivery Note Item`.`description` as \"Description::200\",\n\t`tabDelivery Note`.`company` as \"Company:Link/Company:\"\nfrom `tabDelivery Note`, `tabDelivery Note Item`\nwhere \n `tabDelivery Note`.name = `tabDelivery Note Item`.parent \n and `tabDelivery Note`.docstatus = 1 \n and `tabDelivery Note`.`status` not in (\"Stopped\", \"Closed\") \n and `tabDelivery Note Item`.amount > 0\n and `tabDelivery Note Item`.billed_amt < `tabDelivery Note Item`.amount\norder by `tabDelivery Note`.`name` desc",
|
||||
"ref_doctype": "Sales Invoice",
|
||||
"report_name": "Delivered Items To Be Billed",
|
||||
"report_type": "Query Report"
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts Manager"
|
||||
},
|
||||
{
|
||||
"role": "Accounts User"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from erpnext.accounts.report.non_billed_report import get_ordered_to_be_billed_data
|
||||
|
||||
def execute(filters=None):
|
||||
columns = get_column()
|
||||
args = get_args()
|
||||
data = get_ordered_to_be_billed_data(args)
|
||||
return columns, data
|
||||
|
||||
def get_column():
|
||||
return [
|
||||
_("Delivery Note") + ":Link/Delivery Note:120", _("Date") + ":Date:100",
|
||||
_("Suplier") + ":Link/Customer:120", _("Customer Name") + "::120",
|
||||
_("Project") + ":Link/Project:120", _("Item Code") + ":Link/Item:120",
|
||||
_("Amount") + ":Currency:100", _("Billed Amount") + ":Currency:100", _("Pending Amount") + ":Currency:100",
|
||||
_("Item Name") + "::120", _("Description") + "::120", _("Company") + ":Link/Company:120",
|
||||
]
|
||||
|
||||
def get_args():
|
||||
return {'doctype': 'Delivery Note', 'party': 'customer',
|
||||
'date': 'posting_date', 'order': 'name', 'order_by': 'desc'}
|
||||
@@ -3,12 +3,10 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
import math
|
||||
from frappe import _
|
||||
from frappe.utils import (flt, getdate, get_first_day, get_last_day, date_diff,
|
||||
add_months, add_days, formatdate, cint)
|
||||
from frappe.utils import flt, getdate, get_first_day, add_months, add_days, formatdate
|
||||
|
||||
def get_period_list(from_fiscal_year, to_fiscal_year, periodicity):
|
||||
def get_period_list(from_fiscal_year, to_fiscal_year, periodicity, company):
|
||||
"""Get a list of dict {"from_date": from_date, "to_date": to_date, "key": key, "label": label}
|
||||
Periodicity can be (Yearly, Quarterly, Monthly)"""
|
||||
|
||||
@@ -50,7 +48,7 @@ def get_period_list(from_fiscal_year, to_fiscal_year, periodicity):
|
||||
# if a fiscal year ends before a 12 month period
|
||||
period.to_date = year_end_date
|
||||
|
||||
period.to_date_fiscal_year = get_date_fiscal_year(period.to_date)
|
||||
period.to_date_fiscal_year = get_date_fiscal_year(period.to_date, company)
|
||||
|
||||
period_list.append(period)
|
||||
|
||||
@@ -141,16 +139,15 @@ def calculate_values(accounts_by_name, gl_entries_by_account, period_list, accum
|
||||
|
||||
if entry.posting_date <= period.to_date:
|
||||
if (accumulated_values or entry.posting_date >= period.from_date) and \
|
||||
(entry.fiscal_year == period.to_date_fiscal_year or not ignore_accumulated_values_for_fy):
|
||||
(not ignore_accumulated_values_for_fy or entry.fiscal_year == period.to_date_fiscal_year):
|
||||
d[period.key] = d.get(period.key, 0.0) + flt(entry.debit) - flt(entry.credit)
|
||||
|
||||
if entry.posting_date < period_list[0].year_start_date:
|
||||
d["opening_balance"] = d.get("opening_balance", 0.0) + flt(entry.debit) - flt(entry.credit)
|
||||
|
||||
def get_date_fiscal_year(date):
|
||||
def get_date_fiscal_year(date, company):
|
||||
from erpnext.accounts.utils import get_fiscal_year
|
||||
|
||||
return get_fiscal_year(date)[0]
|
||||
return get_fiscal_year(date, company=company)[0]
|
||||
|
||||
def accumulate_values_into_parents(accounts, accounts_by_name, period_list, accumulated_values):
|
||||
"""accumulate children's values in parent accounts"""
|
||||
@@ -219,7 +216,7 @@ def filter_out_zero_value_rows(data, parent_children_map, show_zero_values=False
|
||||
def add_total_row(out, root_type, balance_must_be, period_list, company_currency):
|
||||
total_row = {
|
||||
"account_name": "'" + _("Total {0} ({1})").format(root_type, balance_must_be) + "'",
|
||||
"account": None,
|
||||
"account": "'" + _("Total {0} ({1})").format(root_type, balance_must_be) + "'",
|
||||
"currency": company_currency
|
||||
}
|
||||
|
||||
|
||||
@@ -47,14 +47,20 @@ frappe.query_reports["General Ledger"] = {
|
||||
"label": __("Voucher No"),
|
||||
"fieldtype": "Data",
|
||||
},
|
||||
{
|
||||
"fieldname":"project",
|
||||
"label": __("Project"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Project"
|
||||
},
|
||||
{
|
||||
"fieldtype": "Break",
|
||||
},
|
||||
{
|
||||
"fieldname":"party_type",
|
||||
"label": __("Party Type"),
|
||||
"fieldtype": "Select",
|
||||
"options": ["", "Customer", "Supplier"],
|
||||
"fieldtype": "Link",
|
||||
"options": "Party Type",
|
||||
"default": ""
|
||||
},
|
||||
{
|
||||
@@ -80,13 +86,6 @@ frappe.query_reports["General Ledger"] = {
|
||||
"fieldname":"group_by_account",
|
||||
"label": __("Group by Account"),
|
||||
"fieldtype": "Check",
|
||||
},
|
||||
{
|
||||
"fieldname":"letter_head",
|
||||
"label": __("Letter Head"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Letter Head",
|
||||
"default": frappe.defaults.get_default("letter_head"),
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,16 +1,29 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2013-12-06 13:22:23",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 1,
|
||||
"idx": 3,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2014-06-03 07:18:17.072046",
|
||||
"modified": "2017-02-24 20:17:51.995451",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "General Ledger",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "GL Entry",
|
||||
"report_name": "General Ledger",
|
||||
"report_type": "Script Report"
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts User"
|
||||
},
|
||||
{
|
||||
"role": "Accounts Manager"
|
||||
},
|
||||
{
|
||||
"role": "Auditor"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -66,7 +66,8 @@ def set_account_currency(filters):
|
||||
if gle_currency:
|
||||
account_currency = gle_currency
|
||||
else:
|
||||
account_currency = frappe.db.get_value(filters.party_type, filters.party, "default_currency")
|
||||
account_currency = None if filters.party_type == "Employee" else \
|
||||
frappe.db.get_value(filters.party_type, filters.party, "default_currency")
|
||||
|
||||
filters["account_currency"] = account_currency or filters.company_currency
|
||||
|
||||
@@ -149,6 +150,9 @@ def get_conditions(filters):
|
||||
if not (filters.get("account") or filters.get("party") or filters.get("group_by_account")):
|
||||
conditions.append("posting_date >=%(from_date)s")
|
||||
|
||||
if filters.get("project"):
|
||||
conditions.append("project=%(project)s")
|
||||
|
||||
from frappe.desk.reportview import build_match_conditions
|
||||
match_conditions = build_match_conditions("GL Entry")
|
||||
if match_conditions: conditions.append(match_conditions)
|
||||
|
||||
@@ -1,16 +1,26 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2013-02-25 17:03:34",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 1,
|
||||
"idx": 3,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2014-09-18 19:00:50.263854",
|
||||
"modified": "2017-02-24 20:12:22.464240",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Gross Profit",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Sales Invoice",
|
||||
"report_name": "Gross Profit",
|
||||
"report_type": "Script Report"
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts Manager"
|
||||
},
|
||||
{
|
||||
"role": "Accounts User"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -4,12 +4,15 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _, scrub
|
||||
from erpnext.stock.utils import get_incoming_rate
|
||||
from erpnext.controllers.queries import get_match_cond
|
||||
from erpnext.stock.stock_ledger import get_valuation_rate
|
||||
from frappe.utils import flt
|
||||
|
||||
|
||||
def execute(filters=None):
|
||||
if not filters: filters = frappe._dict()
|
||||
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
|
||||
filters.currency = frappe.db.get_value("Company", filters.company, "default_currency")
|
||||
|
||||
gross_profit_data = GrossProfitGenerator(filters)
|
||||
|
||||
@@ -47,7 +50,7 @@ def execute(filters=None):
|
||||
for col in group_wise_columns.get(scrub(filters.group_by)):
|
||||
row.append(src.get(col))
|
||||
|
||||
row.append(company_currency)
|
||||
row.append(filters.currency)
|
||||
data.append(row)
|
||||
|
||||
return columns, data
|
||||
@@ -208,21 +211,25 @@ class GrossProfitGenerator(object):
|
||||
flt(my_sle[i+1].stock_value) or 0.0
|
||||
return previous_stock_value - flt(sle.stock_value)
|
||||
else:
|
||||
return flt(row.qty) * self.get_average_buying_rate(item_code)
|
||||
|
||||
return flt(row.qty) * self.get_average_buying_rate(row, item_code)
|
||||
|
||||
return 0.0
|
||||
|
||||
def get_average_buying_rate(self, item_code):
|
||||
def get_average_buying_rate(self, row, item_code):
|
||||
if not item_code in self.average_buying_rate:
|
||||
if item_code in self.non_stock_items:
|
||||
self.average_buying_rate[item_code] = flt(frappe.db.sql("""select sum(base_net_amount) / sum(qty * conversion_factor)
|
||||
self.average_buying_rate[item_code] = flt(frappe.db.sql("""
|
||||
select sum(base_net_amount) / sum(qty * conversion_factor)
|
||||
from `tabPurchase Invoice Item`
|
||||
where item_code = %s and docstatus=1""", item_code)[0][0])
|
||||
else:
|
||||
self.average_buying_rate[item_code] = flt(frappe.db.sql("""select avg(valuation_rate)
|
||||
from `tabStock Ledger Entry`
|
||||
where item_code = %s and qty_after_transaction > 0""", item_code)[0][0])
|
||||
average_buying_rate = get_incoming_rate(row)
|
||||
if not average_buying_rate:
|
||||
average_buying_rate = get_valuation_rate(item_code, row.warehouse,
|
||||
row.parenttype, row.parent, allow_zero_rate=True,
|
||||
currency=self.filters.currency)
|
||||
|
||||
self.average_buying_rate[item_code] = flt(average_buying_rate)
|
||||
|
||||
return self.average_buying_rate[item_code]
|
||||
|
||||
@@ -232,7 +239,7 @@ class GrossProfitGenerator(object):
|
||||
select (a.base_rate / a.conversion_factor)
|
||||
from `tabPurchase Invoice Item` a
|
||||
where a.item_code = %s and a.docstatus=1
|
||||
and modified <= %s
|
||||
and modified <= %s
|
||||
order by a.modified desc limit 1""", (item_code,self.filters.to_date))
|
||||
else:
|
||||
last_purchase_rate = frappe.db.sql("""
|
||||
@@ -251,20 +258,31 @@ class GrossProfitGenerator(object):
|
||||
if self.filters.to_date:
|
||||
conditions += " and posting_date <= %(to_date)s"
|
||||
|
||||
self.si_list = frappe.db.sql("""select item.parenttype, item.parent,
|
||||
si.posting_date, si.posting_time, si.project, si.update_stock,
|
||||
si.customer, si.customer_group, si.territory,
|
||||
item.item_code, item.item_name, item.description, item.warehouse,
|
||||
item.item_group, item.brand, item.dn_detail, item.delivery_note,
|
||||
item.qty, item.base_net_rate, item.base_net_amount, item.name as "item_row",
|
||||
sales.sales_person, sales.allocated_amount, sales.incentives
|
||||
from `tabSales Invoice` si
|
||||
inner join `tabSales Invoice Item` item on item.parent = si.name
|
||||
left join `tabSales Team` sales on sales.parent = si.name
|
||||
if self.filters.group_by=="Sales Person":
|
||||
sales_person_cols = ", sales.sales_person, sales.allocated_amount, sales.incentives"
|
||||
sales_team_table = "left join `tabSales Team` sales on sales.parent = `tabSales Invoice`.name"
|
||||
else:
|
||||
sales_person_cols = ""
|
||||
sales_team_table = ""
|
||||
|
||||
self.si_list = frappe.db.sql("""select `tabSales Invoice Item`.parenttype, `tabSales Invoice Item`.parent,
|
||||
`tabSales Invoice`.posting_date, `tabSales Invoice`.posting_time, `tabSales Invoice`.project, `tabSales Invoice`.update_stock,
|
||||
`tabSales Invoice`.customer, `tabSales Invoice`.customer_group, `tabSales Invoice`.territory,
|
||||
`tabSales Invoice Item`.item_code, `tabSales Invoice Item`.item_name, `tabSales Invoice Item`.description,
|
||||
`tabSales Invoice Item`.warehouse, `tabSales Invoice Item`.item_group, `tabSales Invoice Item`.brand,
|
||||
`tabSales Invoice Item`.dn_detail, `tabSales Invoice Item`.delivery_note, `tabSales Invoice Item`.stock_qty as qty,
|
||||
`tabSales Invoice Item`.base_net_rate, `tabSales Invoice Item`.base_net_amount, `tabSales Invoice Item`.name as "item_row"
|
||||
{sales_person_cols}
|
||||
from
|
||||
`tabSales Invoice`
|
||||
inner join `tabSales Invoice Item` on `tabSales Invoice Item`.parent = `tabSales Invoice`.name
|
||||
{sales_team_table}
|
||||
where
|
||||
si.docstatus = 1 and si.is_return != 1 %s
|
||||
`tabSales Invoice`.docstatus = 1 and `tabSales Invoice`.is_return != 1 {conditions} {match_cond}
|
||||
order by
|
||||
si.posting_date desc, si.posting_time desc""" % (conditions,), self.filters, as_dict=1)
|
||||
`tabSales Invoice`.posting_date desc, `tabSales Invoice`.posting_time desc"""
|
||||
.format(conditions=conditions, sales_person_cols=sales_person_cols,
|
||||
sales_team_table=sales_team_table, match_cond = get_match_cond('Sales Invoice')), self.filters, as_dict=1)
|
||||
|
||||
def load_stock_ledger_entries(self):
|
||||
res = frappe.db.sql("""select item_code, voucher_type, voucher_no,
|
||||
|
||||
@@ -2,16 +2,31 @@
|
||||
"add_total_row": 1,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2013-06-05 15:37:30",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 1,
|
||||
"idx": 3,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2014-06-03 07:18:17.113416",
|
||||
"modified": "2017-02-24 20:17:31.238117",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Item-wise Purchase Register",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Purchase Invoice",
|
||||
"report_name": "Item-wise Purchase Register",
|
||||
"report_type": "Script Report"
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts User"
|
||||
},
|
||||
{
|
||||
"role": "Purchase User"
|
||||
},
|
||||
{
|
||||
"role": "Auditor"
|
||||
},
|
||||
{
|
||||
"role": "Accounts Manager"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,16 +2,25 @@
|
||||
"add_total_row": 1,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2013-05-13 17:50:55",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 1,
|
||||
"idx": 3,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2014-06-03 07:18:17.123848",
|
||||
"modified": "2017-02-24 20:17:17.638545",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Item-wise Sales Register",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Sales Invoice",
|
||||
"report_name": "Item-wise Sales Register",
|
||||
"report_type": "Script Report"
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts Manager"
|
||||
},
|
||||
{
|
||||
"role": "Accounts User"
|
||||
}
|
||||
]
|
||||
}
|
||||
38
erpnext/accounts/report/non_billed_report.py
Normal file
38
erpnext/accounts/report/non_billed_report.py
Normal file
@@ -0,0 +1,38 @@
|
||||
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from erpnext import get_default_currency
|
||||
from frappe.model.meta import get_field_precision
|
||||
|
||||
def get_ordered_to_be_billed_data(args):
|
||||
doctype, party = args.get('doctype'), args.get('party')
|
||||
child_tab = doctype + " Item"
|
||||
precision = get_field_precision(frappe.get_meta(child_tab).get_field("billed_amt"),
|
||||
currency=get_default_currency()) or 2
|
||||
|
||||
project_field = get_project_field(doctype, party)
|
||||
|
||||
return frappe.db.sql("""
|
||||
Select
|
||||
`{parent_tab}`.name, `{parent_tab}`.{date_field}, `{parent_tab}`.{party}, `{parent_tab}`.{party}_name,
|
||||
{project_field}, `{child_tab}`.item_code, `{child_tab}`.base_amount,
|
||||
(`{child_tab}`.billed_amt * ifnull(`{parent_tab}`.conversion_rate, 1)),
|
||||
(`{child_tab}`.base_amount - (`{child_tab}`.billed_amt * ifnull(`{parent_tab}`.conversion_rate, 1))),
|
||||
`{child_tab}`.item_name, `{child_tab}`.description, `{parent_tab}`.company
|
||||
from
|
||||
`{parent_tab}`, `{child_tab}`
|
||||
where
|
||||
`{parent_tab}`.name = `{child_tab}`.parent and `{parent_tab}`.docstatus = 1 and `{parent_tab}`.status != 'Closed'
|
||||
and `{child_tab}`.amount > 0 and round(`{child_tab}`.billed_amt *
|
||||
ifnull(`{parent_tab}`.conversion_rate, 1), {precision}) < `{child_tab}`.base_amount
|
||||
order by
|
||||
`{parent_tab}`.{order} {order_by}
|
||||
""".format(parent_tab = 'tab' + doctype, child_tab = 'tab' + child_tab, precision= precision, party = party,
|
||||
date_field = args.get('date'), project_field = project_field, order= args.get('order'), order_by = args.get('order_by')))
|
||||
|
||||
def get_project_field(doctype, party):
|
||||
if party == "supplier": doctype = doctype + ' Item'
|
||||
return "`tab%s`.project"%(doctype)
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.query_reports["Ordered Items To Be Billed"] = {
|
||||
"filters": [
|
||||
|
||||
]
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user