Compare commits
1506 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d4cc7e71f | ||
|
|
fba61abd2a | ||
|
|
94bfe8ea0d | ||
|
|
31619f0a83 | ||
|
|
34037e0d88 | ||
|
|
647102fc94 | ||
|
|
a533b33fc6 | ||
|
|
bd7f48cfd4 | ||
|
|
82cef59fb3 | ||
|
|
cc6ce5beac | ||
|
|
15d7224335 | ||
|
|
1f51e71827 | ||
|
|
539a826b37 | ||
|
|
0ec9b90113 | ||
|
|
49b275ad1d | ||
|
|
7957f0ecea | ||
|
|
3c55d89f7f | ||
|
|
d5fda57297 | ||
|
|
a85a1ff145 | ||
|
|
afb8ec9cb6 | ||
|
|
8b92de26f0 | ||
|
|
fcd4f2b86b | ||
|
|
1277a61dad | ||
|
|
767d5e48e7 | ||
|
|
ed11e93b25 | ||
|
|
1d702bf112 | ||
|
|
43cdf792f9 | ||
|
|
687888133b | ||
|
|
e0825aaea9 | ||
|
|
0a76b8b29a | ||
|
|
0277dbc6b6 | ||
|
|
93a69e9485 | ||
|
|
6e33d91443 | ||
|
|
07364f5ece | ||
|
|
1890c794d7 | ||
|
|
71a9be8add | ||
|
|
fd131a4210 | ||
|
|
1a943151d7 | ||
|
|
c761f1b0a1 | ||
|
|
e970ddcee9 | ||
|
|
51db2ba22a | ||
|
|
cbc18ffdbf | ||
|
|
5b7d0a960e | ||
|
|
172efb1e87 | ||
|
|
95760a7db6 | ||
|
|
9c24bec654 | ||
|
|
7c0a58ac3f | ||
|
|
77e4f6b774 | ||
|
|
5bedd649df | ||
|
|
7207d21962 | ||
|
|
c118fc9343 | ||
|
|
bad13369d4 | ||
|
|
bf225c11b4 | ||
|
|
694edbc89a | ||
|
|
6406f8bda0 | ||
|
|
2901e14c59 | ||
|
|
5204eeedf7 | ||
|
|
ee8f88d641 | ||
|
|
b2206d1155 | ||
|
|
c54e25b5c7 | ||
|
|
6e36a48521 | ||
|
|
eca2e42ecb | ||
|
|
d7f7d5c9db | ||
|
|
37b0f7ca47 | ||
|
|
f4d5a66162 | ||
|
|
a84186c209 | ||
|
|
eb4c299bdb | ||
|
|
5b1b2fb858 | ||
|
|
eba9ca4d66 | ||
|
|
01de945388 | ||
|
|
79872bf62c | ||
|
|
c8ac3b042b | ||
|
|
f76853a8d9 | ||
|
|
323dc96c99 | ||
|
|
2563f404d2 | ||
|
|
29b565fdf5 | ||
|
|
2ea5c6913d | ||
|
|
5dcb40bc96 | ||
|
|
c07489a096 | ||
|
|
39e2c2bb09 | ||
|
|
e1a1c8ac31 | ||
|
|
28a6578ba2 | ||
|
|
932cf08aee | ||
|
|
47c2aa179b | ||
|
|
f7e9a9d786 | ||
|
|
04230cb656 | ||
|
|
54abf025b7 | ||
|
|
39ac535bdb | ||
|
|
dd74b5d44f | ||
|
|
afe85bdd04 | ||
|
|
e4b44a86a6 | ||
|
|
a1ccab81a0 | ||
|
|
cf3b318f7d | ||
|
|
568054ab96 | ||
|
|
0d207706c1 | ||
|
|
3d5a6af1ae | ||
|
|
79a994e895 | ||
|
|
20cdaadcd4 | ||
|
|
a2eccf08a1 | ||
|
|
6f62ecab73 | ||
|
|
463f71c6eb | ||
|
|
cea6b09d44 | ||
|
|
b4be679639 | ||
|
|
c51ef85dd8 | ||
|
|
3fc4e7c53f | ||
|
|
1d21274d65 | ||
|
|
ccddc48ced | ||
|
|
c9b7824573 | ||
|
|
e50c5321df | ||
|
|
c690b24a7d | ||
|
|
9a24abe5e9 | ||
|
|
c5d41eb22a | ||
|
|
47fd5e0ff0 | ||
|
|
bb7e499cbd | ||
|
|
cb66d3a8c9 | ||
|
|
43a62ad0f0 | ||
|
|
e6b52bbb43 | ||
|
|
6811e73b53 | ||
|
|
5cd9193a2b | ||
|
|
a613ea8abf | ||
|
|
d737390b80 | ||
|
|
20bf7375f4 | ||
|
|
fb0b24af78 | ||
|
|
002fa6c1d9 | ||
|
|
dbbc3eb8a6 | ||
|
|
c2c9124af8 | ||
|
|
5b19aeecb4 | ||
|
|
dd2f0330a6 | ||
|
|
61673aafd4 | ||
|
|
d4507ac6a0 | ||
|
|
7c8dc38f15 | ||
|
|
aa8745378a | ||
|
|
2b986d3b02 | ||
|
|
3fb5340188 | ||
|
|
05aa3b391e | ||
|
|
e095eeb084 | ||
|
|
7633aca7c1 | ||
|
|
6f9afffd8a | ||
|
|
7425af6968 | ||
|
|
de15a26cab | ||
|
|
5ac22ce6a1 | ||
|
|
20105d8a0d | ||
|
|
6d8688f8b4 | ||
|
|
9824e22ce1 | ||
|
|
34d2822483 | ||
|
|
787e59c37e | ||
|
|
77532cc8db | ||
|
|
c978b9c36a | ||
|
|
31608a82f8 | ||
|
|
4f0bfcd287 | ||
|
|
54673f8d1d | ||
|
|
4da17348fd | ||
|
|
aee26219ed | ||
|
|
8b63b1221f | ||
|
|
6bf3c7453b | ||
|
|
681c9dde84 | ||
|
|
34fb5cf0e2 | ||
|
|
0e2f9ee44c | ||
|
|
0bcd9efa88 | ||
|
|
b46069d44b | ||
|
|
329e7783bc | ||
|
|
2e3d2b8426 | ||
|
|
66eaf7e1c3 | ||
|
|
23ee568564 | ||
|
|
ad42d2f67a | ||
|
|
1bf440b03a | ||
|
|
9bf2df9303 | ||
|
|
986f6a71ec | ||
|
|
26cb8baef0 | ||
|
|
975dcc2bf3 | ||
|
|
1bc6a73878 | ||
|
|
f7caad8ecb | ||
|
|
27e8ae0ff9 | ||
|
|
a88912a2f5 | ||
|
|
10d634b016 | ||
|
|
e23e99f4bd | ||
|
|
075b9626cf | ||
|
|
025a407e13 | ||
|
|
cbebb4b8ba | ||
|
|
3ade883fd9 | ||
|
|
403ad48364 | ||
|
|
69f9975748 | ||
|
|
df2783dbb0 | ||
|
|
a940b6d149 | ||
|
|
0a0c78729f | ||
|
|
276d3e60bd | ||
|
|
c22e525a14 | ||
|
|
2ffea6ba94 | ||
|
|
6fc408e974 | ||
|
|
ed0723c6fe | ||
|
|
766f6a43d5 | ||
|
|
1664668b0e | ||
|
|
3ba22676bf | ||
|
|
db7a56b453 | ||
|
|
cb98d9ec5f | ||
|
|
b109ee96de | ||
|
|
eba7aa496c | ||
|
|
108bc78693 | ||
|
|
c85112b093 | ||
|
|
4a3140102c | ||
|
|
6ef1fb6b39 | ||
|
|
de6b30c7ac | ||
|
|
1c32d05601 | ||
|
|
659bc1aca4 | ||
|
|
226a101119 | ||
|
|
5dfd1d48fa | ||
|
|
c9af48af35 | ||
|
|
d8ac0f3df7 | ||
|
|
af2bf7541f | ||
|
|
d070d56f72 | ||
|
|
cc5632a99c | ||
|
|
7be0b47778 | ||
|
|
5facb60bbe | ||
|
|
56b5387dbd | ||
|
|
9743d688d0 | ||
|
|
1d5f8d4436 | ||
|
|
063a88f057 | ||
|
|
6cb8662bec | ||
|
|
74dfabbe21 | ||
|
|
4096603656 | ||
|
|
574415b59b | ||
|
|
0eee6bbf7e | ||
|
|
ed72a28e41 | ||
|
|
4e0908d055 | ||
|
|
3c2ffde95b | ||
|
|
2c021dcdcd | ||
|
|
1ee5ae1e25 | ||
|
|
0aadb9e213 | ||
|
|
a0693983cc | ||
|
|
6b71ef5843 | ||
|
|
602683fdc0 | ||
|
|
1eea26fc5c | ||
|
|
c040075bd4 | ||
|
|
a2afb16f6b | ||
|
|
bdab0eea0f | ||
|
|
ba5d6b5004 | ||
|
|
5b13b99441 | ||
|
|
a3e87c7af1 | ||
|
|
31e2a709d5 | ||
|
|
e083cde3d7 | ||
|
|
09fc4a456e | ||
|
|
4774c41958 | ||
|
|
03e7e581d8 | ||
|
|
e88ffe032e | ||
|
|
ea8bc8ecb0 | ||
|
|
a40c6282a1 | ||
|
|
570d1783f9 | ||
|
|
2076203fc1 | ||
|
|
d7b7f74ac9 | ||
|
|
d27308d1cd | ||
|
|
06a82d4e1f | ||
|
|
f9eff57531 | ||
|
|
e64fbd6d3c | ||
|
|
88e709e1f0 | ||
|
|
988a1ab419 | ||
|
|
13bf123b24 | ||
|
|
22b956d33c | ||
|
|
10be112e85 | ||
|
|
bb256e41d7 | ||
|
|
d35d74346d | ||
|
|
969d48a554 | ||
|
|
d8b15ebaf7 | ||
|
|
b55dd5b284 | ||
|
|
5760b79747 | ||
|
|
eb961370ff | ||
|
|
cb08d576f6 | ||
|
|
9f40a252fc | ||
|
|
aee8b5bcad | ||
|
|
f7980927a1 | ||
|
|
c1e1026486 | ||
|
|
7ae53657f9 | ||
|
|
a6a71216a8 | ||
|
|
51008f2abc | ||
|
|
c1e5cbb55d | ||
|
|
f41da5cfab | ||
|
|
2d0ef63e72 | ||
|
|
884d4cbc48 | ||
|
|
9602c394dd | ||
|
|
51ff2658cb | ||
|
|
dd1c3ba164 | ||
|
|
6b068e1367 | ||
|
|
b9dcf7f857 | ||
|
|
9ebbec5d9a | ||
|
|
bb9f59a051 | ||
|
|
f8de94b7c6 | ||
|
|
6626e32719 | ||
|
|
d55bdcf921 | ||
|
|
40a79de34d | ||
|
|
82a1561120 | ||
|
|
3505de037e | ||
|
|
d548ef8158 | ||
|
|
3ad37363ed | ||
|
|
d46abb49f3 | ||
|
|
c57517b201 | ||
|
|
8efeea9c59 | ||
|
|
bf9e8cfbcc | ||
|
|
096fc88200 | ||
|
|
d5dedb1808 | ||
|
|
e50f80302a | ||
|
|
9d44ac88f2 | ||
|
|
892a782e59 | ||
|
|
b166bcf50b | ||
|
|
0e2d1bd4ed | ||
|
|
f080003415 | ||
|
|
96e7c5a3bd | ||
|
|
4bad150cf0 | ||
|
|
76568f0e8e | ||
|
|
49febea6f5 | ||
|
|
a59e1792b5 | ||
|
|
28d6987455 | ||
|
|
56e19f3a8b | ||
|
|
b6b56453e1 | ||
|
|
d55d0c06e3 | ||
|
|
8681a95010 | ||
|
|
1f63747916 | ||
|
|
332ec15dd7 | ||
|
|
6f8dafbb5e | ||
|
|
d4073d50b2 | ||
|
|
88bcee78a7 | ||
|
|
cc2796e676 | ||
|
|
dbaf6b569b | ||
|
|
d37cef7f60 | ||
|
|
01293bb3a3 | ||
|
|
55ad42cfd0 | ||
|
|
381cec7b87 | ||
|
|
4c87497b7c | ||
|
|
9fdf2a8bfe | ||
|
|
f773f1f539 | ||
|
|
7b8a224dd0 | ||
|
|
e1482f1acc | ||
|
|
c98d244af0 | ||
|
|
ee19fc0c7f | ||
|
|
ee2129ce1c | ||
|
|
beed9ae4f8 | ||
|
|
50ddf921be | ||
|
|
3769d87240 | ||
|
|
15050e326c | ||
|
|
0f809426d2 | ||
|
|
adab5d308c | ||
|
|
824122c42a | ||
|
|
afda26e4f3 | ||
|
|
d6d354b5c3 | ||
|
|
7d310bd182 | ||
|
|
8b33a6cdc0 | ||
|
|
1abe550e65 | ||
|
|
5605f8f20e | ||
|
|
a1580f2781 | ||
|
|
dfdededcf0 | ||
|
|
5aa744893d | ||
|
|
55cca49371 | ||
|
|
5e173c7106 | ||
|
|
cf3da35d67 | ||
|
|
a17ddcfe89 | ||
|
|
088826f6f0 | ||
|
|
f89eaa96d1 | ||
|
|
e526cfe7ec | ||
|
|
21c189184d | ||
|
|
2aaebdbe11 | ||
|
|
cda3174a57 | ||
|
|
91eeb76f7b | ||
|
|
df18c29fb7 | ||
|
|
7aebb39003 | ||
|
|
91bb25d0c9 | ||
|
|
b89d7eb558 | ||
|
|
ba004aab83 | ||
|
|
4c3762989b | ||
|
|
225b907a03 | ||
|
|
b543861cbe | ||
|
|
fc6595b92b | ||
|
|
d11df3645b | ||
|
|
ea4c83dcb3 | ||
|
|
3d05635d7a | ||
|
|
90b0db2d18 | ||
|
|
91a71d4f2c | ||
|
|
36ab7f01b4 | ||
|
|
130dd2da61 | ||
|
|
6d15d36639 | ||
|
|
4395d0bc4d | ||
|
|
6e4e2152af | ||
|
|
fc5d5d1600 | ||
|
|
180d7e9ceb | ||
|
|
7be281e712 | ||
|
|
9d5f4f729e | ||
|
|
b68087d690 | ||
|
|
a970e72819 | ||
|
|
4d0c5a51c9 | ||
|
|
41e1eb6af7 | ||
|
|
1761004bd5 | ||
|
|
c8fc5a2048 | ||
|
|
9b639b82cf | ||
|
|
314fa2bdad | ||
|
|
bff501c401 | ||
|
|
89d64f5b12 | ||
|
|
670269f85c | ||
|
|
38a15ab4fc | ||
|
|
8dfb35bb79 | ||
|
|
20e97c9dbc | ||
|
|
909f6da868 | ||
|
|
0ffc350f57 | ||
|
|
fea9357741 | ||
|
|
2fbc3b7259 | ||
|
|
f99923dc08 | ||
|
|
d5781b5de8 | ||
|
|
81adb7dec9 | ||
|
|
46d4ba904a | ||
|
|
8c48c36be6 | ||
|
|
f52b3090a9 | ||
|
|
e8703298ed | ||
|
|
98eba6b9ba | ||
|
|
34dc5bc812 | ||
|
|
ba9b85c1a6 | ||
|
|
4eefd2218a | ||
|
|
d58d56f4d4 | ||
|
|
1d7d055d16 | ||
|
|
2e7dca8693 | ||
|
|
746e21f283 | ||
|
|
60eed43269 | ||
|
|
b2b7d91010 | ||
|
|
1641f0815e | ||
|
|
e3f4b6ce6f | ||
|
|
7a6ec814b9 | ||
|
|
4325a8c82f | ||
|
|
6bff33b949 | ||
|
|
99c244c834 | ||
|
|
838db977fe | ||
|
|
837b656c45 | ||
|
|
7641a957eb | ||
|
|
f8a383b339 | ||
|
|
d144bfe2ca | ||
|
|
b5edc6676e | ||
|
|
f72a1eb782 | ||
|
|
a574979ebc | ||
|
|
49b3c0c064 | ||
|
|
d32a43c39f | ||
|
|
3162f31fd8 | ||
|
|
952c336f70 | ||
|
|
2f6a29b060 | ||
|
|
55e467dc20 | ||
|
|
df5aa98d00 | ||
|
|
ffa18f4dc8 | ||
|
|
cea952c1c4 | ||
|
|
92a3aa9fad | ||
|
|
3b7f626c0b | ||
|
|
8d71597c03 | ||
|
|
786779fd5c | ||
|
|
0c30c9cccb | ||
|
|
6479f0e82a | ||
|
|
f8da1ff59f | ||
|
|
043ab0c47e | ||
|
|
6e982264db | ||
|
|
ed9f8de78c | ||
|
|
80f1fc4fcb | ||
|
|
c26b090c72 | ||
|
|
a637010af1 | ||
|
|
108c1f8783 | ||
|
|
cfb0b3d371 | ||
|
|
e1a3b369e8 | ||
|
|
f0f54d53f4 | ||
|
|
fdf61e40f3 | ||
|
|
9a12221d72 | ||
|
|
6bea8c7bc2 | ||
|
|
7bfba0fb0e | ||
|
|
15597d7f60 | ||
|
|
19fb4f231d | ||
|
|
fc70f4c9e8 | ||
|
|
b0fc040dcc | ||
|
|
26018adff4 | ||
|
|
73933c1195 | ||
|
|
1d3d0ed595 | ||
|
|
9d80e47d27 | ||
|
|
f2fc91b73e | ||
|
|
b77eb6d383 | ||
|
|
6ced0da90b | ||
|
|
6aaec8e874 | ||
|
|
e4ba4d0efd | ||
|
|
acef1eaa9d | ||
|
|
75960296c9 | ||
|
|
924b9c1763 | ||
|
|
92f2771ae2 | ||
|
|
88a2580ec5 | ||
|
|
95a2e2f5e4 | ||
|
|
90f44ba6ac | ||
|
|
b32d97f071 | ||
|
|
8cb9cfdb81 | ||
|
|
44420e4df7 | ||
|
|
55bd4f7d06 | ||
|
|
1d1e03b792 | ||
|
|
bb4fcd9438 | ||
|
|
b61345c040 | ||
|
|
1827c3bc5f | ||
|
|
e65df29aed | ||
|
|
c9588f5aa3 | ||
|
|
6a2a290194 | ||
|
|
8c95b5492c | ||
|
|
3cf31eaefe | ||
|
|
0349c8e96d | ||
|
|
666b63aa5e | ||
|
|
16fca942bb | ||
|
|
bf5f7425bb | ||
|
|
a165451b84 | ||
|
|
5f7ac05af3 | ||
|
|
afc9afa01f | ||
|
|
fe032bfb6f | ||
|
|
71f5792f02 | ||
|
|
0c70bd4b10 | ||
|
|
f8ee7e12ef | ||
|
|
f8a93b6cb1 | ||
|
|
612ec6c289 | ||
|
|
2fe811695c | ||
|
|
3cedb81670 | ||
|
|
393afdaa1f | ||
|
|
80b1ff7744 | ||
|
|
0689d27072 | ||
|
|
e44372ca6b | ||
|
|
a94073d37d | ||
|
|
5d9a9473d3 | ||
|
|
6854d66cdc | ||
|
|
29675f8bbd | ||
|
|
2ffb4a7a8d | ||
|
|
692e465829 | ||
|
|
eaed755e0f | ||
|
|
f32d3716b8 | ||
|
|
e493a9252b | ||
|
|
e005662cf0 | ||
|
|
e83697c21c | ||
|
|
c3c654c672 | ||
|
|
c6a445fa8e | ||
|
|
6ebf5b0bbb | ||
|
|
668ea8a161 | ||
|
|
49c58975d9 | ||
|
|
3d9ef3202e | ||
|
|
4dd13fd81e | ||
|
|
edc5a79fbf | ||
|
|
a3bb3cded0 | ||
|
|
c8e88f5bba | ||
|
|
c4ffa9ceb0 | ||
|
|
b8834c3c1c | ||
|
|
c384bc8045 | ||
|
|
9d0e4c841b | ||
|
|
3097e73e5a | ||
|
|
eec101dffb | ||
|
|
40e5b0589a | ||
|
|
ee343c8c77 | ||
|
|
079ac113fb | ||
|
|
285ec76130 | ||
|
|
e1eb761807 | ||
|
|
ae8974b627 | ||
|
|
ea18cc464a | ||
|
|
064da78734 | ||
|
|
c87dc4771c | ||
|
|
c5aede5b4c | ||
|
|
d8785dde0c | ||
|
|
669e4df639 | ||
|
|
e7894fab39 | ||
|
|
f8be4394dc | ||
|
|
384f620c9d | ||
|
|
ba0ae97fdf | ||
|
|
a95a189592 | ||
|
|
5ede3a8a6f | ||
|
|
49e8628627 | ||
|
|
05521ee102 | ||
|
|
11e9c18b51 | ||
|
|
5fcb3d7775 | ||
|
|
84226006dd | ||
|
|
4fc998d0f9 | ||
|
|
938b9b2097 | ||
|
|
61c2d88781 | ||
|
|
fdba12d355 | ||
|
|
8e1014565e | ||
|
|
040c565a44 | ||
|
|
54f7616cf8 | ||
|
|
b27f2dc012 | ||
|
|
7bf3d908ba | ||
|
|
17caf1f6e5 | ||
|
|
b1c5f385bf | ||
|
|
457cfb7b60 | ||
|
|
46e0166d1f | ||
|
|
0b55567b44 | ||
|
|
f3ca6d0ac3 | ||
|
|
06ff0e42d9 | ||
|
|
1727bdb2b8 | ||
|
|
80300b321d | ||
|
|
5c8c606b50 | ||
|
|
7b8e9a39e7 | ||
|
|
054d63c94e | ||
|
|
4deb7aaea2 | ||
|
|
f146046845 | ||
|
|
f8942dd060 | ||
|
|
ee1f66bc86 | ||
|
|
ae77cb4959 | ||
|
|
6ba0f7bf75 | ||
|
|
3e2ebe5972 | ||
|
|
5f2f82de56 | ||
|
|
9d0d426ed6 | ||
|
|
d7ea4ec2b6 | ||
|
|
4d35ef149f | ||
|
|
34fe511260 | ||
|
|
03a3d5089c | ||
|
|
8af11201d9 | ||
|
|
cd35d45628 | ||
|
|
dd09f67e75 | ||
|
|
a51c4403a5 | ||
|
|
5656c6e969 | ||
|
|
635528e186 | ||
|
|
49e39f0cde | ||
|
|
e9784d1280 | ||
|
|
82e3e08650 | ||
|
|
721de2629e | ||
|
|
19d627c51f | ||
|
|
a1d129f836 | ||
|
|
79f52a54ef | ||
|
|
92091ce22d | ||
|
|
019196894c | ||
|
|
fbce19b2c6 | ||
|
|
84a9b6c816 | ||
|
|
aeb0934da0 | ||
|
|
347a580883 | ||
|
|
2891c5ebca | ||
|
|
fc1bb3ee1d | ||
|
|
bd194a9fb7 | ||
|
|
4bd999cbc5 | ||
|
|
bb154ad6c9 | ||
|
|
f7d133f4a0 | ||
|
|
b79151ccac | ||
|
|
5b509ca194 | ||
|
|
38aa8982f8 | ||
|
|
c46504dfdf | ||
|
|
279fc35cb2 | ||
|
|
4887292513 | ||
|
|
a056a7e390 | ||
|
|
d82fec317e | ||
|
|
2545651a77 | ||
|
|
43029c2754 | ||
|
|
3adcca8238 | ||
|
|
a76f957345 | ||
|
|
6935ae7f60 | ||
|
|
72e3741b44 | ||
|
|
609568d6d5 | ||
|
|
576c76f71c | ||
|
|
a952fef53d | ||
|
|
5dc46b6096 | ||
|
|
463bd7b742 | ||
|
|
e5cb6ab319 | ||
|
|
eeb280e06d | ||
|
|
2799039eec | ||
|
|
84f47e54af | ||
|
|
3cd67c9e9b | ||
|
|
6b3d94a5df | ||
|
|
218cc5d1f2 | ||
|
|
f53407b76e | ||
|
|
92988591fc | ||
|
|
9b69827d2c | ||
|
|
4136b3170a | ||
|
|
f3459158c6 | ||
|
|
a82056f424 | ||
|
|
a440125ef2 | ||
|
|
3e8aec4d64 | ||
|
|
97a27f3d46 | ||
|
|
0eb0f59194 | ||
|
|
fce8780c08 | ||
|
|
48d45869ab | ||
|
|
349360b3a1 | ||
|
|
5e646cd8ad | ||
|
|
8bcd104cec | ||
|
|
5e91280912 | ||
|
|
5fec1751a7 | ||
|
|
91802f914c | ||
|
|
f779df2737 | ||
|
|
fad1363756 | ||
|
|
b041b905d0 | ||
|
|
ed4e85bf97 | ||
|
|
1a8e484542 | ||
|
|
8794bb9c5f | ||
|
|
1cd13ce2d5 | ||
|
|
c1bdc108c8 | ||
|
|
6549710eaa | ||
|
|
4634194009 | ||
|
|
14006ad8c8 | ||
|
|
89a7730406 | ||
|
|
c2e913e0ca | ||
|
|
afbf3296d4 | ||
|
|
75963505dc | ||
|
|
9ec61cf150 | ||
|
|
699feb0384 | ||
|
|
da00bacb55 | ||
|
|
8ca8b14720 | ||
|
|
64b47ade3b | ||
|
|
423791a1cd | ||
|
|
9b09fea692 | ||
|
|
098cb65a54 | ||
|
|
2cf2f48c02 | ||
|
|
85febb969e | ||
|
|
952e19a9bb | ||
|
|
451ad3fe93 | ||
|
|
cec0728bba | ||
|
|
44838ea239 | ||
|
|
3c29d6faa2 | ||
|
|
5c4fdfce44 | ||
|
|
19bed183b0 | ||
|
|
53523539f4 | ||
|
|
a5488e43ad | ||
|
|
f8a2587cf4 | ||
|
|
337972eada | ||
|
|
e5944e8866 | ||
|
|
ee17a60872 | ||
|
|
35ad87bb14 | ||
|
|
421bef2db4 | ||
|
|
0048d29799 | ||
|
|
5029670657 | ||
|
|
d40ec15f1c | ||
|
|
9873c4029b | ||
|
|
78b4ae02cb | ||
|
|
9fa9b34930 | ||
|
|
61b6918e73 | ||
|
|
755d14b004 | ||
|
|
2d3670b6a4 | ||
|
|
8ff1c7b3e0 | ||
|
|
8df03c6e30 | ||
|
|
cab2fc6e73 | ||
|
|
a5b9008088 | ||
|
|
0a5ccb008a | ||
|
|
83b8d33e78 | ||
|
|
9c2a20a67b | ||
|
|
a7465f8fd6 | ||
|
|
49b476b9e5 | ||
|
|
7f7f77f4d7 | ||
|
|
356c552b41 | ||
|
|
1ccbd82b35 | ||
|
|
e606678b8f | ||
|
|
45db6156c7 | ||
|
|
9d3da40351 | ||
|
|
3f51a8aed4 | ||
|
|
e7d09edc0d | ||
|
|
94c7fa0141 | ||
|
|
abe9abc90b | ||
|
|
dbb25b67a5 | ||
|
|
d4e8e05749 | ||
|
|
02d28f1422 | ||
|
|
a97265c8af | ||
|
|
0480ad45f6 | ||
|
|
c8ea02d745 | ||
|
|
028f246cae | ||
|
|
f683bbee59 | ||
|
|
e01309f07e | ||
|
|
d7786190e6 | ||
|
|
5bce109e8e | ||
|
|
a2531995f9 | ||
|
|
98ccde84fb | ||
|
|
a12840f803 | ||
|
|
3e2f36034f | ||
|
|
d8c6213828 | ||
|
|
dd56b5f4ac | ||
|
|
8444febbda | ||
|
|
b26c3f2263 | ||
|
|
03791fceee | ||
|
|
542782e400 | ||
|
|
8bdf8e675f | ||
|
|
2da81732eb | ||
|
|
e1f46be230 | ||
|
|
81b8627250 | ||
|
|
79586775b2 | ||
|
|
8ee5498fe0 | ||
|
|
e8ab320028 | ||
|
|
c80796cdd5 | ||
|
|
fde03453e4 | ||
|
|
826e18a29f | ||
|
|
bdd1ee2185 | ||
|
|
660f479ec8 | ||
|
|
fa557f494b | ||
|
|
695d09f9cd | ||
|
|
66c9940d73 | ||
|
|
204af3ce90 | ||
|
|
4a9f6ba520 | ||
|
|
83f9f93015 | ||
|
|
53804c5bed | ||
|
|
d3d4fe45c6 | ||
|
|
fae4f0269b | ||
|
|
fc4eca5cc7 | ||
|
|
a1a712b0c6 | ||
|
|
2164595933 | ||
|
|
8eaf5eee74 | ||
|
|
09e5306825 | ||
|
|
9cca3494c0 | ||
|
|
360b057b0a | ||
|
|
56ae9481a0 | ||
|
|
12425e22a6 | ||
|
|
da80a649fc | ||
|
|
13ec41abb2 | ||
|
|
b3051ab84d | ||
|
|
533aba02c5 | ||
|
|
a5cf8a86c1 | ||
|
|
c819fd4ee8 | ||
|
|
2af44ffd06 | ||
|
|
cff91abd8d | ||
|
|
5d39a9594d | ||
|
|
b1caeba0b4 | ||
|
|
7290c79fdf | ||
|
|
547e916b00 | ||
|
|
e4c0388b68 | ||
|
|
783e63a8e6 | ||
|
|
f6891975d5 | ||
|
|
45a8f9d006 | ||
|
|
1b0c797817 | ||
|
|
c119cbcb50 | ||
|
|
d595534431 | ||
|
|
5de53eb0eb | ||
|
|
5ccaf6f9d7 | ||
|
|
29fe53f63c | ||
|
|
49fe7af6de | ||
|
|
a68a3b5cc1 | ||
|
|
3931a35e27 | ||
|
|
56595ecda0 | ||
|
|
466ff3d31b | ||
|
|
61c6552434 | ||
|
|
4ad0963ee8 | ||
|
|
aa99fe2c4e | ||
|
|
d56ec92682 | ||
|
|
90852d334f | ||
|
|
694373d022 | ||
|
|
40d49ccf98 | ||
|
|
4372ac559a | ||
|
|
01478b3fc1 | ||
|
|
41c8cf645a | ||
|
|
70ed6ede5c | ||
|
|
7af5c4aefc | ||
|
|
01ca354d52 | ||
|
|
a974ab3dc5 | ||
|
|
cc24d28ddc | ||
|
|
441b2c7657 | ||
|
|
51d07dfca2 | ||
|
|
5e6757f197 | ||
|
|
6a8ff42a5a | ||
|
|
06db236aa0 | ||
|
|
733680bc3f | ||
|
|
14a0441b4b | ||
|
|
a311e706b0 | ||
|
|
e6a16c29df | ||
|
|
92bb480fc3 | ||
|
|
7dc0da18b5 | ||
|
|
c8a2b94200 | ||
|
|
203d4088fa | ||
|
|
5eefff13a1 | ||
|
|
9421e9873a | ||
|
|
5e4c8a52ee | ||
|
|
41f62f7250 | ||
|
|
4f39fd243e | ||
|
|
c43a11a313 | ||
|
|
1bffb42809 | ||
|
|
4660f820da | ||
|
|
1a19c05ef0 | ||
|
|
d53e780fb8 | ||
|
|
0f5d97a156 | ||
|
|
2f273674e9 | ||
|
|
734a40ad62 | ||
|
|
9547b774f7 | ||
|
|
e1f8b1d695 | ||
|
|
7be2e985b0 | ||
|
|
3b6287d849 | ||
|
|
ab7021ce64 | ||
|
|
ca4c663e07 | ||
|
|
275b3eec0d | ||
|
|
acaef538c2 | ||
|
|
041b062014 | ||
|
|
39e603a154 | ||
|
|
a4eeb919e6 | ||
|
|
c4d9554a05 | ||
|
|
2e1c8f27c4 | ||
|
|
4c7a32e446 | ||
|
|
2c069a418a | ||
|
|
ba2596a7e0 | ||
|
|
f7911687a0 | ||
|
|
ceb82324ad | ||
|
|
5dd1aa9f31 | ||
|
|
80ada3eddd | ||
|
|
8df5900f98 | ||
|
|
f58a3726a7 | ||
|
|
1c77506e80 | ||
|
|
f1f556c0ac | ||
|
|
4a1b9ac793 | ||
|
|
20abc2d0e8 | ||
|
|
4f9fe9c856 | ||
|
|
4496cc1e80 | ||
|
|
29cca2352c | ||
|
|
d793fc9446 | ||
|
|
84f44ad5eb | ||
|
|
5b73dea9f6 | ||
|
|
cd90478c6d | ||
|
|
c4edcf1532 | ||
|
|
70885f63a5 | ||
|
|
48b1633ff5 | ||
|
|
4140fa59c5 | ||
|
|
afacc3d779 | ||
|
|
87b0bec2cf | ||
|
|
29f9f6c147 | ||
|
|
37d9d6fdea | ||
|
|
0cc177f73c | ||
|
|
8c4e043747 | ||
|
|
3617942ff7 | ||
|
|
ddc295b4b3 | ||
|
|
621f4cd7c9 | ||
|
|
4750b1fdb7 | ||
|
|
e7bb6544f5 | ||
|
|
72e348daf5 | ||
|
|
6c173e9730 | ||
|
|
0547a7668e | ||
|
|
ec1695dbe3 | ||
|
|
7909102edd | ||
|
|
3f10e0ba2d | ||
|
|
9f7de868ef | ||
|
|
d6c5235d58 | ||
|
|
32e55e174d | ||
|
|
8d968ceb94 | ||
|
|
47e82d1a49 | ||
|
|
563c243ec6 | ||
|
|
7781763efa | ||
|
|
711e675987 | ||
|
|
5b03a75970 | ||
|
|
f4c3819134 | ||
|
|
b8591da62c | ||
|
|
a5f0a7ce06 | ||
|
|
9785cd35dc | ||
|
|
e38a53443a | ||
|
|
70f57eb7f0 | ||
|
|
2d70887aaf | ||
|
|
15b22c9d7d | ||
|
|
4b12740e8d | ||
|
|
f942d97a18 | ||
|
|
5cf7a0bf72 | ||
|
|
49abb18928 | ||
|
|
7c016d2ee2 | ||
|
|
666fbaff8c | ||
|
|
6674d1dc2b | ||
|
|
5225a9752b | ||
|
|
0fd67b23f4 | ||
|
|
b82bdd6f1f | ||
|
|
131bec67bc | ||
|
|
ebae726237 | ||
|
|
3314f1cba7 | ||
|
|
a4870118ea | ||
|
|
03b3d66b90 | ||
|
|
5c968abcef | ||
|
|
699d9be4b7 | ||
|
|
ad5cf9b22e | ||
|
|
cdb63fd52a | ||
|
|
bf07cba6a8 | ||
|
|
ff1ab26088 | ||
|
|
5c3469a01e | ||
|
|
625592e997 | ||
|
|
7221805587 | ||
|
|
a0961bc0cf | ||
|
|
cf3cf2ca1f | ||
|
|
17e9b9444d | ||
|
|
c4f4c09e42 | ||
|
|
fe1e5884b8 | ||
|
|
072c540ae3 | ||
|
|
3012f0d39a | ||
|
|
c6d91b8fb2 | ||
|
|
019111b05c | ||
|
|
ddad05dab3 | ||
|
|
9e425863a1 | ||
|
|
bde324a90f | ||
|
|
b133240298 | ||
|
|
56c605f36e | ||
|
|
8c56adf42b | ||
|
|
690023538e | ||
|
|
19ce11aa9c | ||
|
|
f649013079 | ||
|
|
120ea62acc | ||
|
|
602e8253be | ||
|
|
06df19b56a | ||
|
|
0f72750fc8 | ||
|
|
5f0b93ed71 | ||
|
|
5284b22c53 | ||
|
|
343c1a5cbd | ||
|
|
6daa5746f8 | ||
|
|
7763bb5c15 | ||
|
|
b65c69f9eb | ||
|
|
2e292060c5 | ||
|
|
a4bf02de6c | ||
|
|
3bcf82c7a6 | ||
|
|
55222a5b82 | ||
|
|
2c85efe31a | ||
|
|
20628f5bd8 | ||
|
|
caf122f015 | ||
|
|
b73f3da02c | ||
|
|
f0607b45c5 | ||
|
|
b45ca3ada0 | ||
|
|
11e8728715 | ||
|
|
edc8ab03b5 | ||
|
|
27c266b081 | ||
|
|
c7fc11a812 | ||
|
|
d962d1c96f | ||
|
|
11f8a0033a | ||
|
|
da79740cdf | ||
|
|
2cf1699937 | ||
|
|
1a3413875f | ||
|
|
3667da1053 | ||
|
|
a5ac1f024e | ||
|
|
d9e57978b8 | ||
|
|
fee95f1135 | ||
|
|
e8f4790d0a | ||
|
|
e1feab1d70 | ||
|
|
6826ca19b1 | ||
|
|
de46fd62d8 | ||
|
|
c7c2d17823 | ||
|
|
6f7cd47ac6 | ||
|
|
11fc0723c9 | ||
|
|
94e90bddaa | ||
|
|
43ce642649 | ||
|
|
a975fea3ac | ||
|
|
8e2d76bd63 | ||
|
|
34af16140e | ||
|
|
b3a68c3f40 | ||
|
|
9f2fd009b0 | ||
|
|
3858d12f1d | ||
|
|
adc93b797a | ||
|
|
b6de519571 | ||
|
|
58c4646199 | ||
|
|
4fbf01fd9d | ||
|
|
1ed82834ce | ||
|
|
cd87e76d88 | ||
|
|
834b3e6f83 | ||
|
|
95d025f9aa | ||
|
|
90c6d7bb47 | ||
|
|
59ba9e3d56 | ||
|
|
c1531e7008 | ||
|
|
511421b6a3 | ||
|
|
26c54bb4fb | ||
|
|
2c93d67463 | ||
|
|
d4b05fbd51 | ||
|
|
d65a03d437 | ||
|
|
fd288d4211 | ||
|
|
f774f75c63 | ||
|
|
e34a1b5fa2 | ||
|
|
5f6546c8a5 | ||
|
|
ca5b593e38 | ||
|
|
cea5479f4d | ||
|
|
6303f84d45 | ||
|
|
5dd00a7e89 | ||
|
|
87c0e9f03a | ||
|
|
d40d1e9a59 | ||
|
|
e19abfbe70 | ||
|
|
3fc1c44334 | ||
|
|
bb347f5afa | ||
|
|
938b530ebf | ||
|
|
28962f26d4 | ||
|
|
0b5489ca88 | ||
|
|
adebf31041 | ||
|
|
7fbab12c5d | ||
|
|
11cc43a5a6 | ||
|
|
61fb7ee5b8 | ||
|
|
37b4d75e4a | ||
|
|
f71ecbba2c | ||
|
|
c5c6c0669f | ||
|
|
fe85b2ea17 | ||
|
|
1c1eb7018c | ||
|
|
8df5b5e3a1 | ||
|
|
39982a5f02 | ||
|
|
8f228dd7f9 | ||
|
|
739aa4d51a | ||
|
|
f9ef0e4e15 | ||
|
|
fc51ec7f58 | ||
|
|
7ba4d02444 | ||
|
|
87b5fcb3b5 | ||
|
|
7489d29813 | ||
|
|
268d300030 | ||
|
|
7f77002015 | ||
|
|
b28573ab03 | ||
|
|
c756ff67b0 | ||
|
|
4e72ef1421 | ||
|
|
6b173f3a67 | ||
|
|
bbcce8cca0 | ||
|
|
c438c1dec7 | ||
|
|
fcfced624a | ||
|
|
64949bfc4b | ||
|
|
438c4fb279 | ||
|
|
ae4c8a6a48 | ||
|
|
0d7213122a | ||
|
|
4268b0092a | ||
|
|
64e31e9a4e | ||
|
|
0a0c267edb | ||
|
|
1a8d4b6ea7 | ||
|
|
97426776bd | ||
|
|
60e7f01fd4 | ||
|
|
169089bdde | ||
|
|
c14f80838b | ||
|
|
a5007db902 | ||
|
|
0d58501229 | ||
|
|
7c654cd1bb | ||
|
|
54fc260a42 | ||
|
|
7a39d51366 | ||
|
|
79c94426f7 | ||
|
|
c3ced9a0b5 | ||
|
|
c825575940 | ||
|
|
afd3209017 | ||
|
|
c541b87bb9 | ||
|
|
b42f3e34ef | ||
|
|
6a7edd32aa | ||
|
|
fc307970aa | ||
|
|
b9e7cb02f4 | ||
|
|
a20a419cb8 | ||
|
|
d805bd7daf | ||
|
|
ac53f2dbb1 | ||
|
|
20a7d820ab | ||
|
|
d48c2394e8 | ||
|
|
58101e9e6c | ||
|
|
666131d2fe | ||
|
|
118f043335 | ||
|
|
b4a51ec80b | ||
|
|
6197860643 | ||
|
|
95fbfa4928 | ||
|
|
b7f0a4961e | ||
|
|
9c044eefff | ||
|
|
5951692db0 | ||
|
|
bd4814fbb7 | ||
|
|
7d23e4286e | ||
|
|
15ea751f3c | ||
|
|
c40148e0da | ||
|
|
a9dda232b2 | ||
|
|
1f25c45ad7 | ||
|
|
12ffd914ee | ||
|
|
b1d8979a59 | ||
|
|
ec2d0030b7 | ||
|
|
55d0506155 | ||
|
|
5e9b52c273 | ||
|
|
00b4663e12 | ||
|
|
e54a4004ec | ||
|
|
d0b086ca54 | ||
|
|
8d1191ac8f | ||
|
|
a938b81e1c | ||
|
|
7cd0ba70d9 | ||
|
|
66340f9894 | ||
|
|
41f7f7442b | ||
|
|
126fb31f9a | ||
|
|
a8a91cca16 | ||
|
|
381385d19a | ||
|
|
aba8fdd18d | ||
|
|
915778fb69 | ||
|
|
bacc679df5 | ||
|
|
b0388d971a | ||
|
|
61c9ea938d | ||
|
|
6956eee790 | ||
|
|
2e65aadb1e | ||
|
|
653cffec1e | ||
|
|
cc8f1afa56 | ||
|
|
2f702dcb32 | ||
|
|
f857d81f35 | ||
|
|
6d64fe378d | ||
|
|
b0ab93f779 | ||
|
|
df1c1a573f | ||
|
|
a1f2aec918 | ||
|
|
d8930a776d | ||
|
|
8a8ef85174 | ||
|
|
edba048c14 | ||
|
|
b705798ccb | ||
|
|
5e0b0b4b97 | ||
|
|
a4efbf0db7 | ||
|
|
e930f0f74e | ||
|
|
99543f72d8 | ||
|
|
1a9646739a | ||
|
|
bd65cb8817 | ||
|
|
98b287565a | ||
|
|
c6dbe70256 | ||
|
|
556536615e | ||
|
|
8bd96f1c08 | ||
|
|
5b7e9a1c94 | ||
|
|
c306b21415 | ||
|
|
c39cef363c | ||
|
|
baefec4498 | ||
|
|
02a56b4e1a | ||
|
|
9a6df0341f | ||
|
|
5a90e3b2e9 | ||
|
|
7dab3c1f85 | ||
|
|
f9a974385a | ||
|
|
20a653e829 | ||
|
|
a2c668cb77 | ||
|
|
d0b0a80be3 | ||
|
|
532b9e8bfb | ||
|
|
32e48bb568 | ||
|
|
21e09a2bd8 | ||
|
|
1aa6e98136 | ||
|
|
023c036afa | ||
|
|
8372c44262 | ||
|
|
6d69ca6bac | ||
|
|
283b55f88c | ||
|
|
4757d0634a | ||
|
|
dc8ce7f7e9 | ||
|
|
d02375e89d | ||
|
|
a90a0528aa | ||
|
|
350f9592d3 | ||
|
|
43e50de6ef | ||
|
|
a530f410e3 | ||
|
|
bdfb070ed6 | ||
|
|
caa9fc033f | ||
|
|
15bf4e5599 | ||
|
|
6d490e530a | ||
|
|
9b363fe5f1 | ||
|
|
3c5df9f64c | ||
|
|
fd53991dfa | ||
|
|
c794ca53fb | ||
|
|
fa0adafa82 | ||
|
|
99f4b43641 | ||
|
|
fdeab29e94 | ||
|
|
31755b485f | ||
|
|
3f3696d1eb | ||
|
|
e1a478779c | ||
|
|
6c6f3789d0 | ||
|
|
044c43a5cb | ||
|
|
9ce9c052e4 | ||
|
|
83e68bb837 | ||
|
|
415df04834 | ||
|
|
6d2d6862d6 | ||
|
|
13a65d52dd | ||
|
|
6485d4a749 | ||
|
|
2e63c80523 | ||
|
|
23bd21778e | ||
|
|
a3f490890d | ||
|
|
8e3ea32d6d | ||
|
|
c4a1a943ef | ||
|
|
abc0b64b68 | ||
|
|
00818bfa90 | ||
|
|
b9bfe6117e | ||
|
|
7a9f46d9d1 | ||
|
|
a10b52c6e6 | ||
|
|
5033e7b431 | ||
|
|
e6791ee78e | ||
|
|
b84ba868e6 | ||
|
|
1c501b6aac | ||
|
|
9a2a6d8fcb | ||
|
|
0b59d1c78b | ||
|
|
0fbf10797c | ||
|
|
58344cbb81 | ||
|
|
c6e2c8f79e | ||
|
|
b64b461d53 | ||
|
|
0b93bdcf40 | ||
|
|
e3910d02a5 | ||
|
|
0af146cea6 | ||
|
|
683f756d0f | ||
|
|
d905204e49 | ||
|
|
d8bc40d7f0 | ||
|
|
54059b77a0 | ||
|
|
f9f0e2591f | ||
|
|
5810bf70c7 | ||
|
|
97d8db775e | ||
|
|
fbe08ec7d0 | ||
|
|
0045c305ac | ||
|
|
5dd0fb6e2a | ||
|
|
e99fff8d08 | ||
|
|
b61fed9106 | ||
|
|
398c83afa5 | ||
|
|
c346484ca4 | ||
|
|
70b7f7f036 | ||
|
|
31c51ef914 | ||
|
|
be464696cc | ||
|
|
191b2970e9 | ||
|
|
c50f033722 | ||
|
|
e1e1414894 | ||
|
|
d1441245fb | ||
|
|
87da662703 | ||
|
|
99ba924303 | ||
|
|
066ff9599a | ||
|
|
33ebaf479d | ||
|
|
3a573d1a6d | ||
|
|
7f66983309 | ||
|
|
2c867fdd73 | ||
|
|
95dfc2730b | ||
|
|
558646c6b8 | ||
|
|
ea0d98891f | ||
|
|
1b4c5ad1e1 | ||
|
|
2678135f5e | ||
|
|
25ef4ff373 | ||
|
|
c85a37fe00 | ||
|
|
3c3d69f905 | ||
|
|
aed8da40ae | ||
|
|
3bc43682f1 | ||
|
|
725816e616 | ||
|
|
7c0eadb451 | ||
|
|
d4357e80d7 | ||
|
|
c0f88e4caf | ||
|
|
73286dd9f5 | ||
|
|
1f259ba73d | ||
|
|
7b2b0cd73c | ||
|
|
2c749db2a9 | ||
|
|
17c633d00f | ||
|
|
4ee5b75687 | ||
|
|
a4fad72a65 | ||
|
|
e65ac00f36 | ||
|
|
75bd0f7cfe | ||
|
|
4d20f3029b | ||
|
|
c35b35abca | ||
|
|
17dc249841 | ||
|
|
12af47918d | ||
|
|
84ca0197e4 | ||
|
|
3395e7a2e4 | ||
|
|
25956d6282 | ||
|
|
ba2133cba2 | ||
|
|
28e3d63280 | ||
|
|
414660313a | ||
|
|
c52a601e87 | ||
|
|
7a869b0dca | ||
|
|
6f64a78ecf | ||
|
|
608bbc7850 | ||
|
|
639826e888 | ||
|
|
16b2c51988 | ||
|
|
76e9ba1e76 | ||
|
|
9dad86c189 | ||
|
|
5302b46955 | ||
|
|
afd14f6f0e | ||
|
|
05584d6d8b | ||
|
|
aa015902d5 | ||
|
|
2873f2e7de | ||
|
|
64fd970a8a | ||
|
|
b4e9c1da64 | ||
|
|
1d093a4039 | ||
|
|
fe9717cb9c | ||
|
|
d665a07621 | ||
|
|
2a1ba886f1 | ||
|
|
55f1ea05da | ||
|
|
2e7f9d2b8f | ||
|
|
3a519f269d | ||
|
|
4c0d0793a3 | ||
|
|
d3b8a74508 | ||
|
|
77760db89c | ||
|
|
1d23ebb51d | ||
|
|
ba5b0e8458 | ||
|
|
14a908bdec | ||
|
|
9f436a7c71 | ||
|
|
746fd90625 | ||
|
|
f861856ed9 | ||
|
|
f94f153078 | ||
|
|
c9bacedbfe | ||
|
|
c0cee82727 | ||
|
|
4c53931363 | ||
|
|
53f7e6281c | ||
|
|
9f235b891f | ||
|
|
c4d4c7feb0 | ||
|
|
ee6862b277 | ||
|
|
53f77ad5e8 | ||
|
|
fb73151da6 | ||
|
|
6e322d0a02 | ||
|
|
73e73795f1 | ||
|
|
80d2a55342 | ||
|
|
9cbf6b1b22 | ||
|
|
41dd2c458b | ||
|
|
71ebad5668 | ||
|
|
b4c0e94e99 | ||
|
|
73f1dc4edf | ||
|
|
174299124f | ||
|
|
c27748b2b3 | ||
|
|
626ba1bb81 | ||
|
|
591f047974 | ||
|
|
38e4c6f2af | ||
|
|
58e9590850 | ||
|
|
03afb45e34 | ||
|
|
d91382dbf3 | ||
|
|
e07958bbda | ||
|
|
b445be3552 | ||
|
|
c865f229fb | ||
|
|
ec5deb6e48 | ||
|
|
486bf2e113 | ||
|
|
f49b085625 | ||
|
|
adcaf75bb0 | ||
|
|
4f4fc45ae6 | ||
|
|
079d0b7108 | ||
|
|
86125b2b9f | ||
|
|
22d0d586ab | ||
|
|
eb62aed8c7 | ||
|
|
60f1739ca5 | ||
|
|
5f349a67c9 | ||
|
|
fd294eb981 | ||
|
|
d256055a8c | ||
|
|
cefa106a06 | ||
|
|
67ecfcf52c | ||
|
|
b7e46c4ed9 | ||
|
|
bc5ecfff06 | ||
|
|
8fa4845d00 | ||
|
|
d4882653c3 | ||
|
|
9a4d165ba2 | ||
|
|
a7099eaa8d | ||
|
|
4b72d05793 | ||
|
|
a30f3ea1f9 | ||
|
|
3b6a8af0da | ||
|
|
4fa69780a8 | ||
|
|
2dc619ae1f | ||
|
|
fc9031924e | ||
|
|
e14124198d | ||
|
|
51e980dd2c | ||
|
|
95781919fb | ||
|
|
c03cba9d17 | ||
|
|
72cd206286 | ||
|
|
9801745090 | ||
|
|
7866c6e6db | ||
|
|
5812fdb574 | ||
|
|
4c502bcd26 | ||
|
|
714948c867 | ||
|
|
8f3b360f83 | ||
|
|
314086d6c0 | ||
|
|
bcd655a985 | ||
|
|
b0dbdc1439 | ||
|
|
37b0bf257d | ||
|
|
c5a25f44e1 | ||
|
|
8dafa376ab | ||
|
|
74eb8e34da | ||
|
|
5c66fb7631 | ||
|
|
be3b3b2107 | ||
|
|
9ab09fd1d6 | ||
|
|
8a7bdd5a92 | ||
|
|
1d753c92b1 | ||
|
|
54ecc8ebba | ||
|
|
f4edaef481 | ||
|
|
ebbd163903 | ||
|
|
8954b24b22 | ||
|
|
ae92fc7f35 | ||
|
|
0bc3ca02f3 | ||
|
|
d10ba853e6 | ||
|
|
5bcf8315de | ||
|
|
789a798e36 | ||
|
|
ee1169dac7 | ||
|
|
fbef1fdf3a | ||
|
|
4358e1cd46 | ||
|
|
7a287a9153 | ||
|
|
5a49ded5d9 | ||
|
|
71f23acc2b | ||
|
|
1a1f790150 | ||
|
|
3c54e9779b | ||
|
|
db48b7d764 | ||
|
|
83c0899c83 | ||
|
|
e5047ec90a | ||
|
|
d9ab725be4 | ||
|
|
7afaeb0820 | ||
|
|
da2d8b958d | ||
|
|
ba48f82e03 | ||
|
|
8e7e128e81 | ||
|
|
0353569e8b | ||
|
|
665e2f5418 | ||
|
|
dace2b6796 | ||
|
|
712b02593a | ||
|
|
d2a60fd727 | ||
|
|
f924e08b93 | ||
|
|
5c623dae4d | ||
|
|
e2c3d40b57 | ||
|
|
673887455f | ||
|
|
63199e486b | ||
|
|
bf7294cf5c | ||
|
|
8aa06a809a | ||
|
|
72d2d682ae | ||
|
|
21f6ea6f7e | ||
|
|
185f488c51 | ||
|
|
f3006972d5 | ||
|
|
dccc6bc11d | ||
|
|
15d2c89939 | ||
|
|
ca4c8a2a46 | ||
|
|
c320fe541d | ||
|
|
f40a87511e | ||
|
|
4945b94950 | ||
|
|
cb96b61449 | ||
|
|
248c867a2c | ||
|
|
da98ab6f3c | ||
|
|
cd0989e051 | ||
|
|
b20baf894f | ||
|
|
d3cf4f1264 | ||
|
|
2dbe2b63b2 | ||
|
|
edba8f5582 | ||
|
|
89b8d11f9c | ||
|
|
19a33994da | ||
|
|
89349d3ae3 | ||
|
|
f6a31a568a | ||
|
|
4bcbcd29f7 | ||
|
|
740a11263f | ||
|
|
142859f36e | ||
|
|
6534ad082d | ||
|
|
6361ae3495 | ||
|
|
7f75dbf061 | ||
|
|
199d8a44fc | ||
|
|
72b1128467 | ||
|
|
d6cb55ad1a | ||
|
|
c76e34d7de | ||
|
|
33b10faf94 | ||
|
|
d970b001a4 | ||
|
|
d767fb6134 | ||
|
|
6239923340 | ||
|
|
e5a31462fe | ||
|
|
6f39300d43 | ||
|
|
0ca587e018 | ||
|
|
8ffe12ebe4 | ||
|
|
8579af371c | ||
|
|
b5ff9421e1 | ||
|
|
ba8ec17f0b | ||
|
|
44bd3b2601 | ||
|
|
9d40eca428 | ||
|
|
1b6c00e2c7 | ||
|
|
52efde31e7 | ||
|
|
f723032fd7 | ||
|
|
3297c43bdf | ||
|
|
aea250bc5a | ||
|
|
d37d4dfdec | ||
|
|
0ea68b33ed | ||
|
|
7f96c20f5b | ||
|
|
e75d947867 | ||
|
|
bba0a5d38f | ||
|
|
953e97536a | ||
|
|
e74d7ca33e | ||
|
|
8f2b8afcb7 | ||
|
|
b3f12c3109 | ||
|
|
f66e6aacd4 | ||
|
|
e9b445c853 |
@@ -6,7 +6,7 @@
|
||||
|
||||
Includes: Accounting, Inventory, CRM, Sales, Purchase, Projects, HRMS. Requires MariaDB.
|
||||
|
||||
ERPNext is built on the [Frappe](https://github.com/frappe/frappe) Framework, a full-stack web app framework in Python & Javascript.
|
||||
ERPNext is built on the [Frappe](https://github.com/frappe/frappe) Framework, a full-stack web app framework in Python & JavaScript.
|
||||
|
||||
- [User Guide](https://manual.erpnext.com)
|
||||
- [Getting Help](http://erpnext.org/getting-help.html)
|
||||
@@ -63,7 +63,7 @@ Your project neither promotes nor is associated with entities that currently fai
|
||||
|
||||
Use of the ERPNext name and logo is additionally allowed in the following situations:
|
||||
|
||||
All other ERPNext-related businesses or projects can use the ERPNext name and logo to refer to and explain their services, but they cannot use them as part of a product, project, service, domain, or company name and they cannot use them in any way that suggests an affiliation with or endorsement by the ERPNext or WebNotes or the ERPNext open source project. For example, a consulting company can describe its business as “123 Web Services, offering ERPNext consulting for small businesses,” but cannot call its business “The ERPNext Consulting Company.”
|
||||
All other ERPNext-related businesses or projects can use the ERPNext name and logo to refer to and explain their services, but they cannot use them as part of a product, project, service, domain, or company name and they cannot use them in any way that suggests an affiliation with or endorsement by ERPNext or Frappe Technologies or the ERPNext open source project. For example, a consulting company can describe its business as “123 Web Services, offering ERPNext consulting for small businesses,” but cannot call its business “The ERPNext Consulting Company.”
|
||||
|
||||
Similarly, it’s OK to use the ERPNext logo as part of a page that describes your products or services, but it is not OK to use it as part of your company or product logo or branding itself. Under no circumstances is it permitted to use ERPNext as part of a top-level domain name.
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
from __future__ import unicode_literals
|
||||
__version__ = '6.3.0'
|
||||
__version__ = '6.20.0'
|
||||
|
||||
@@ -48,13 +48,13 @@ cur_frm.cscript.account_type = function(doc, cdt, cdn) {
|
||||
|
||||
cur_frm.cscript.add_toolbar_buttons = function(doc) {
|
||||
cur_frm.add_custom_button(__('Chart of Accounts'),
|
||||
function() { frappe.set_route("Accounts Browser", "Account"); }, 'icon-sitemap')
|
||||
function() { frappe.set_route("Accounts Browser", "Account"); }, __("View"))
|
||||
|
||||
if (doc.is_group == 1) {
|
||||
cur_frm.add_custom_button(__('Convert to non-Group'),
|
||||
cur_frm.add_custom_button(__('Group to Non-Group'),
|
||||
function() { cur_frm.cscript.convert_to_ledger(); }, 'icon-retweet', 'btn-default');
|
||||
} else if (cint(doc.is_group) == 0) {
|
||||
cur_frm.add_custom_button(__('View Ledger'), function() {
|
||||
cur_frm.add_custom_button(__('Ledger'), function() {
|
||||
frappe.route_options = {
|
||||
"account": doc.name,
|
||||
"from_date": sys_defaults.year_start_date,
|
||||
@@ -62,9 +62,9 @@ cur_frm.cscript.add_toolbar_buttons = function(doc) {
|
||||
"company": doc.company
|
||||
};
|
||||
frappe.set_route("query-report", "General Ledger");
|
||||
}, "icon-table");
|
||||
}, __("View"));
|
||||
|
||||
cur_frm.add_custom_button(__('Convert to Group'),
|
||||
cur_frm.add_custom_button(__('Group to Group'),
|
||||
function() { cur_frm.cscript.convert_to_group(); }, 'icon-retweet', 'btn-default')
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,8 +23,11 @@ class Account(Document):
|
||||
frappe.db.get_value("Company", self.company, "abbr")
|
||||
|
||||
def validate(self):
|
||||
if frappe.local.flags.allow_unverified_charts:
|
||||
return
|
||||
self.validate_parent()
|
||||
self.validate_root_details()
|
||||
self.validate_group_or_ledger()
|
||||
self.set_root_and_report_type()
|
||||
self.validate_mandatory()
|
||||
self.validate_warehouse_account()
|
||||
@@ -50,27 +53,48 @@ class Account(Document):
|
||||
def set_root_and_report_type(self):
|
||||
if self.parent_account:
|
||||
par = frappe.db.get_value("Account", self.parent_account, ["report_type", "root_type"], as_dict=1)
|
||||
|
||||
|
||||
if par.report_type:
|
||||
self.report_type = par.report_type
|
||||
if par.root_type:
|
||||
self.root_type = par.root_type
|
||||
|
||||
|
||||
if self.is_group:
|
||||
db_value = frappe.db.get_value("Account", self.name, ["report_type", "root_type"], as_dict=1)
|
||||
if db_value:
|
||||
if self.report_type != db_value.report_type:
|
||||
frappe.db.sql("update `tabAccount` set report_type=%s where lft > %s and rgt < %s",
|
||||
frappe.db.sql("update `tabAccount` set report_type=%s where lft > %s and rgt < %s",
|
||||
(self.report_type, self.lft, self.rgt))
|
||||
if self.root_type != db_value.root_type:
|
||||
frappe.db.sql("update `tabAccount` set root_type=%s where lft > %s and rgt < %s",
|
||||
frappe.db.sql("update `tabAccount` set root_type=%s where lft > %s and rgt < %s",
|
||||
(self.root_type, self.lft, self.rgt))
|
||||
|
||||
if self.root_type and not self.report_type:
|
||||
self.report_type = "Balance Sheet" \
|
||||
if self.root_type in ("Asset", "Liability", "Equity") else "Profit and Loss"
|
||||
|
||||
def validate_root_details(self):
|
||||
# does not exists parent
|
||||
if frappe.db.exists("Account", self.name):
|
||||
if not frappe.db.get_value("Account", self.name, "parent_account"):
|
||||
throw(_("Root cannot be edited."), RootNotEditable)
|
||||
|
||||
if not self.parent_account and not self.is_group:
|
||||
frappe.throw(_("Root Account must be a group"))
|
||||
|
||||
def validate_group_or_ledger(self):
|
||||
if self.get("__islocal"):
|
||||
return
|
||||
|
||||
existing_is_group = frappe.db.get_value("Account", self.name, "is_group")
|
||||
if self.is_group != existing_is_group:
|
||||
if self.check_gle_exists():
|
||||
throw(_("Account with existing transaction cannot be converted to ledger"))
|
||||
elif self.is_group:
|
||||
if self.account_type:
|
||||
throw(_("Cannot covert to Group because Account Type is selected."))
|
||||
elif self.check_if_child_exists():
|
||||
throw(_("Account with child nodes cannot be set as ledger"))
|
||||
|
||||
def validate_frozen_accounts_modifier(self):
|
||||
old_value = frappe.db.get_value("Account", self.name, "freeze_account")
|
||||
@@ -89,11 +113,11 @@ class Account(Document):
|
||||
frappe.throw(_("Account balance already in Debit, you are not allowed to set 'Balance Must Be' as 'Credit'"))
|
||||
elif account_balance < 0 and self.balance_must_be == "Debit":
|
||||
frappe.throw(_("Account balance already in Credit, you are not allowed to set 'Balance Must Be' as 'Debit'"))
|
||||
|
||||
|
||||
def validate_account_currency(self):
|
||||
if not self.account_currency:
|
||||
self.account_currency = frappe.db.get_value("Company", self.company, "default_currency")
|
||||
|
||||
|
||||
elif self.account_currency != frappe.db.get_value("Account", self.name, "account_currency"):
|
||||
if frappe.db.get_value("GL Entry", {"account": self.name}):
|
||||
frappe.throw(_("Currency can not be changed after making entries using some other currency"))
|
||||
@@ -127,11 +151,11 @@ class Account(Document):
|
||||
and docstatus != 2""", self.name)
|
||||
|
||||
def validate_mandatory(self):
|
||||
if not self.report_type:
|
||||
throw(_("Report Type is mandatory"))
|
||||
|
||||
if not self.root_type:
|
||||
throw(_("Root Type is mandatory"))
|
||||
|
||||
if not self.report_type:
|
||||
throw(_("Report Type is mandatory"))
|
||||
|
||||
def validate_warehouse_account(self):
|
||||
if not cint(frappe.defaults.get_global_default("auto_accounting_for_stock")):
|
||||
@@ -147,6 +171,8 @@ class Account(Document):
|
||||
self.validate_warehouse(old_warehouse)
|
||||
if self.warehouse:
|
||||
self.validate_warehouse(self.warehouse)
|
||||
elif self.warehouse:
|
||||
self.warehouse = None
|
||||
|
||||
def validate_warehouse(self, warehouse):
|
||||
if frappe.db.get_value("Stock Ledger Entry", {"warehouse": warehouse}):
|
||||
@@ -190,6 +216,10 @@ class Account(Document):
|
||||
|
||||
if val != [self.is_group, self.root_type, self.company]:
|
||||
throw(_("""Merging is only possible if following properties are same in both records. Is Group, Root Type, Company"""))
|
||||
|
||||
if self.is_group and frappe.db.get_value("Account", new, "parent_account") == old:
|
||||
frappe.db.set_value("Account", new, "parent_account",
|
||||
frappe.db.get_value("Account", old, "parent_account"))
|
||||
|
||||
return new_account
|
||||
|
||||
@@ -207,3 +237,16 @@ def get_parent_account(doctype, txt, searchfield, start, page_len, filters):
|
||||
and %s like %s order by name limit %s, %s""" %
|
||||
("%s", searchfield, "%s", "%s", "%s"),
|
||||
(filters["company"], "%%%s%%" % txt, start, page_len), as_list=1)
|
||||
|
||||
def get_account_currency(account):
|
||||
"""Helper function to get account currency"""
|
||||
if not account:
|
||||
return
|
||||
def generator():
|
||||
account_currency, company = frappe.db.get_value("Account", account, ["account_currency", "company"])
|
||||
if not account_currency:
|
||||
account_currency = frappe.db.get_value("Company", company, "default_currency")
|
||||
|
||||
return account_currency
|
||||
|
||||
return frappe.local_cache("account_currency", account, generator)
|
||||
|
||||
@@ -8,7 +8,7 @@ from unidecode import unidecode
|
||||
|
||||
def create_charts(chart_name, company):
|
||||
chart = get_chart(chart_name)
|
||||
|
||||
|
||||
if chart:
|
||||
accounts = []
|
||||
|
||||
@@ -40,9 +40,9 @@ def create_charts(chart_name, company):
|
||||
"account_currency": frappe.db.get_value("Company", company, "default_currency")
|
||||
})
|
||||
|
||||
if root_account:
|
||||
if root_account or frappe.local.flags.allow_unverified_charts:
|
||||
account.flags.ignore_mandatory = True
|
||||
|
||||
|
||||
account.insert()
|
||||
|
||||
accounts.append(account_name_in_db)
|
||||
@@ -67,13 +67,17 @@ def get_chart(chart_name):
|
||||
from erpnext.accounts.doctype.account.chart_of_accounts.verified import standard_chart_of_accounts
|
||||
return standard_chart_of_accounts.get()
|
||||
else:
|
||||
path = os.path.join(os.path.dirname(__file__), "verified")
|
||||
for fname in os.listdir(path):
|
||||
if fname.endswith(".json"):
|
||||
with open(os.path.join(path, fname), "r") as f:
|
||||
chart = f.read()
|
||||
if chart and json.loads(chart).get("name") == chart_name:
|
||||
return json.loads(chart).get("tree")
|
||||
folders = ("verified",)
|
||||
if frappe.local.flags.allow_unverified_charts:
|
||||
folders = ("verified", "unverified")
|
||||
for folder in folders:
|
||||
path = os.path.join(os.path.dirname(__file__), folder)
|
||||
for fname in os.listdir(path):
|
||||
if fname.endswith(".json"):
|
||||
with open(os.path.join(path, fname), "r") as f:
|
||||
chart = f.read()
|
||||
if chart and json.loads(chart).get("name") == chart_name:
|
||||
return json.loads(chart).get("tree")
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_charts_for_country(country):
|
||||
@@ -82,24 +86,22 @@ def get_charts_for_country(country):
|
||||
def _get_chart_name(content):
|
||||
if content:
|
||||
content = json.loads(content)
|
||||
if content and content.get("is_active", "No") == "Yes" and content.get("disabled", "No") == "No":
|
||||
if content and content.get("disabled", "No") == "No":
|
||||
charts.append(content["name"])
|
||||
|
||||
country_code = frappe.db.get_value("Country", country, "code")
|
||||
if country_code:
|
||||
path = os.path.join(os.path.dirname(__file__), "verified")
|
||||
for fname in os.listdir(path):
|
||||
if fname.startswith(country_code) and fname.endswith(".json"):
|
||||
with open(os.path.join(path, fname), "r") as f:
|
||||
_get_chart_name(f.read())
|
||||
folders = ("verified",)
|
||||
if frappe.local.flags.allow_unverified_charts:
|
||||
folders = ("verified", "unverified")
|
||||
|
||||
# countries_use_OHADA_system = ["Benin", "Burkina Faso", "Cameroon", "Central African Republic", "Comoros",
|
||||
# "Congo", "Ivory Coast", "Gabon", "Guinea", "Guinea Bissau", "Equatorial Guinea", "Mali", "Niger",
|
||||
# "Replica of Democratic Congo", "Senegal", "Chad", "Togo"]
|
||||
#
|
||||
# if country in countries_use_OHADA_system:
|
||||
# with open(os.path.join(os.path.dirname(__file__), "syscohada_syscohada_chart_template.json"), "r") as f:
|
||||
# _get_chart_name(f.read())
|
||||
for folder in folders:
|
||||
path = os.path.join(os.path.dirname(__file__), folder)
|
||||
|
||||
for fname in os.listdir(path):
|
||||
if fname.startswith(country_code) and fname.endswith(".json"):
|
||||
with open(os.path.join(path, fname), "r") as f:
|
||||
_get_chart_name(f.read())
|
||||
|
||||
if len(charts) != 1:
|
||||
charts.append("Standard")
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "at",
|
||||
"name": "Austria - Chart of Accounts",
|
||||
"is_active": "Yes",
|
||||
"tree": {
|
||||
"Summe Abschreibungen und Aufwendungen": {
|
||||
"7010 bis 7080 Abschreibungen auf das Anlageverm\u00f6gen (ausgenommen Finanzanlagen)": {},
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "be",
|
||||
"name": "Belgian PCMN",
|
||||
"disabled": "Yes",
|
||||
"tree": {
|
||||
"CLASSE 1": {
|
||||
"BENEFICE (PERTE) REPORTE(E)": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "br",
|
||||
"name": "Planilha de Contas Brasileira",
|
||||
"is_active": "No",
|
||||
"tree": {
|
||||
"ATIVO": {
|
||||
"CIRCULANTE": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "ca",
|
||||
"name": "Chart of Accounts for english-speaking provinces",
|
||||
"is_active": "Yes",
|
||||
"tree": {
|
||||
"ASSETS": {
|
||||
"CURRENT ASSETS": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "ca",
|
||||
"name": "Plan comptable pour les provinces francophones",
|
||||
"is_active": "Yes",
|
||||
"tree": {
|
||||
"ACTIF": {
|
||||
"ACTIFS COURANTS": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "ch",
|
||||
"name": "Plan comptable STERCHI",
|
||||
"is_active": "Yes",
|
||||
"disabled": "Yes",
|
||||
"tree": {
|
||||
"Actif": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "co",
|
||||
"name": "Unique Account Chart - PUC",
|
||||
"is_active": "Yes",
|
||||
"tree": {
|
||||
"ACTIVO": {
|
||||
"DEUDORES": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "cr",
|
||||
"name": "Costa Rica - Company 0",
|
||||
"is_active": "Yes",
|
||||
"tree": {
|
||||
"0-Activo": {
|
||||
"0-Activo circulante": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "cr",
|
||||
"name": "Costa Rica - Company 1",
|
||||
"is_active": "Yes",
|
||||
"tree": {
|
||||
"xActivo": {
|
||||
"root_type": "Asset",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"country_code": "de",
|
||||
"name": "Deutscher Kontenplan SKR04",
|
||||
"is_active": "Yes",
|
||||
"disabled": "Yes",
|
||||
"tree": {
|
||||
"Bilanz - Aktiva": {
|
||||
"Anlageverm\u00f6gen": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "de",
|
||||
"name": "Deutscher Kontenplan SKR03",
|
||||
"is_active": "No",
|
||||
"disabled": "Yes",
|
||||
"tree": {
|
||||
"Aktiva": {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"country_code": "es",
|
||||
"name": "PGCE com\u00fan",
|
||||
"disabled": "Yes",
|
||||
"tree": {
|
||||
"Acreedores y deudores por operaciones comerciales": {
|
||||
"Acreedores varios": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "et",
|
||||
"name": "Ethiopia Tax and Account Chart Template",
|
||||
"is_active": "Yes",
|
||||
"tree": {
|
||||
"ASSETS": {
|
||||
"Cash and Cash Equivalents": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "gt",
|
||||
"name": "Plantilla de cuentas de Guatemala (sencilla)",
|
||||
"is_active": "Yes",
|
||||
"tree": {
|
||||
"Activo": {
|
||||
"Activo Corriente": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "hn",
|
||||
"name": "Plantilla de cuentas de Honduras (sencilla)",
|
||||
"is_active": "Yes",
|
||||
"tree": {
|
||||
"Activo": {
|
||||
"Activo Corriente": {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"country_code": "lu",
|
||||
"name": "PCMN Luxembourg",
|
||||
"disabled": "Yes",
|
||||
"tree": {
|
||||
"TOTAL CLASSES 1 A 5": {
|
||||
"CLASSE 1 - COMPTES DE CAPITAUX, DE PROVISIONS ET DE DETTES FINANCIERES": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "pa",
|
||||
"name": "Plan de Cuentas",
|
||||
"is_active": "Yes",
|
||||
"tree": {
|
||||
"ACTIVOS": {
|
||||
"Activo Fijo": {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"country_code": "ro",
|
||||
"name": "Romania - Chart of Accounts",
|
||||
"disabled": "Yes",
|
||||
"tree": {
|
||||
"CONTURI FINANCIARE": {
|
||||
"CONTURI DE BILANT": {
|
||||
|
||||
@@ -1,223 +0,0 @@
|
||||
{
|
||||
"country_code": "sg",
|
||||
"name": "Singapore Chart of Accounts",
|
||||
"is_active": "Yes",
|
||||
"tree": {
|
||||
"Assets": {
|
||||
"Cash and cash equivalents": {
|
||||
"Cash on hand": {
|
||||
"account_type": "Cash"
|
||||
},
|
||||
"Client trust account": {
|
||||
"account_type": "Cash"
|
||||
},
|
||||
"Current": {
|
||||
"account_type": "Bank"
|
||||
},
|
||||
"Money market": {
|
||||
"account_type": "Cash"
|
||||
},
|
||||
"Rents held in trust": {
|
||||
"account_type": "Cash"
|
||||
},
|
||||
"Savings": {
|
||||
"account_type": "Cash"
|
||||
},
|
||||
"account_type": "Cash"
|
||||
},
|
||||
"Current assets": {
|
||||
"Allowance for bad debts": {},
|
||||
"Development costs": {},
|
||||
"Employee cash advances": {},
|
||||
"Inventory": {},
|
||||
"Investments - other": {},
|
||||
"Loans to officers": {},
|
||||
"Loans to others": {},
|
||||
"Loans to shareholders": {},
|
||||
"Other Current Assets": {},
|
||||
"Prepaid expenses": {},
|
||||
"Retainage": {},
|
||||
"Undeposited funds": {}
|
||||
},
|
||||
"Non-current assets": {
|
||||
"Accumulated amortization of non-current assets": {},
|
||||
"Available-for-sale financial assets": {},
|
||||
"Deferred tax": {},
|
||||
"Goodwill": {},
|
||||
"Intangible Assets": {},
|
||||
"Investments": {},
|
||||
"Lease Buyout": {},
|
||||
"Licences": {},
|
||||
"Organisational costs": {},
|
||||
"Other intangible assets": {},
|
||||
"Other non-current assets": {},
|
||||
"Prepayments and accrued income": {},
|
||||
"Security Deposits": {}
|
||||
},
|
||||
"Property, plant and equipment": {
|
||||
"Accumulated amortisation": {},
|
||||
"Accumulated depletion": {},
|
||||
"Accumulated depreciation": {},
|
||||
"Buildings": {},
|
||||
"Depletable assets": {},
|
||||
"Furniture and fixtures": {},
|
||||
"Leasehold improvements": {},
|
||||
"Machinery and equipment": {},
|
||||
"Other Assets": {},
|
||||
"Vehicles": {}
|
||||
},
|
||||
"Purchase Tax Receivable": {
|
||||
"Purchase Tax Account 0% EP": {},
|
||||
"Purchase Tax Account 0% ME": {},
|
||||
"Purchase Tax Account 0% NR": {},
|
||||
"Purchase Tax Account 0% OP": {},
|
||||
"Purchase Tax Account 0% ZP": {},
|
||||
"Purchase Tax Account 7% BL": {},
|
||||
"Purchase Tax Account 7% IM": {},
|
||||
"Purchase Tax Account 7% TX-E33": {},
|
||||
"Purchase Tax Account 7% TX-N33": {},
|
||||
"Purchase Tax Account 7% TX-RE": {},
|
||||
"Purchase Tax Account 7% TX7": {},
|
||||
"Purchase Tax Account MES": {}
|
||||
},
|
||||
"Trade and other receivable": {
|
||||
"Other Receivable Account": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"Trade Receivable Account": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"root_type": "Asset"
|
||||
},
|
||||
"Liabilities": {
|
||||
"Current liabilities": {
|
||||
"Client Trust Accounts - Liabilities": {},
|
||||
"Current Tax Liability": {},
|
||||
"Current portion of employee benefits obligations": {},
|
||||
"Current portion of obligations under finance leases": {},
|
||||
"GST Payable": {},
|
||||
"Insurance Payable": {},
|
||||
"Interest payables": {},
|
||||
"Line of Credit": {},
|
||||
"Loan Payable": {},
|
||||
"Payroll Clearing": {},
|
||||
"Payroll liabilities": {},
|
||||
"Prepaid Expenses Payable": {},
|
||||
"Provision for warranty obligations": {},
|
||||
"Rents in trust - Liability": {},
|
||||
"Short term borrowings": {}
|
||||
},
|
||||
"Equity": {
|
||||
"Accumulated Adjustment": {},
|
||||
"Opening Balance Equity": {},
|
||||
"Ordinary shares": {},
|
||||
"Owner's Equity": {},
|
||||
"Paid-in capital or surplus": {},
|
||||
"Partner's Equity": {},
|
||||
"Preferred shares": {},
|
||||
"Retained Earnings": {},
|
||||
"Share capital": {},
|
||||
"Treasury Shares": {}
|
||||
},
|
||||
"Non-current liabilities": {
|
||||
"Accruals and Deferred Income": {},
|
||||
"Bank loans": {},
|
||||
"Long term borrowings": {},
|
||||
"Long term employee benefit obligations": {},
|
||||
"Notes Payable": {},
|
||||
"Obligations under finance leases": {},
|
||||
"Other non-current liabilities": {},
|
||||
"Shareholder Notes Payable": {}
|
||||
},
|
||||
"Sale Tax Payables": {
|
||||
" Sales Tax Account 0% ES33": {},
|
||||
"Sales Tax Account 0% ESN33": {},
|
||||
"Sales Tax Account 0% OS": {},
|
||||
"Sales Tax Account 0% ZR": {},
|
||||
"Sales Tax Account 7% DS": {},
|
||||
"Sales Tax Account 7% SR": {}
|
||||
},
|
||||
"Trade and other payables": {
|
||||
"Other Payable Account": {
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"Trade Payable Account": {
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"root_type": "Liability"
|
||||
},
|
||||
"Cost of sales": {
|
||||
"Cost of Good Sold": {
|
||||
"Cost of Labour - COS": {},
|
||||
"Equipment rental - COS": {},
|
||||
"Freight and delivery - COS": {},
|
||||
"Other costs of sales - COS": {},
|
||||
"Supplies and materials - COS": {}
|
||||
},
|
||||
"root_type": "Expense"
|
||||
},
|
||||
"Income": {
|
||||
"Other revenue": {
|
||||
"Dividend revenue": {},
|
||||
"Gain/loss on sale of fixed assets or investments": {},
|
||||
"Interest earned": {},
|
||||
"Other investment revenue": {},
|
||||
"Other miscellaneous revenue": {},
|
||||
"Tax-exempt interest": {}
|
||||
},
|
||||
"Revenue": {
|
||||
"Discounts/refunds given": {},
|
||||
"Non-profit revenue": {},
|
||||
"Other primary revenue": {},
|
||||
"Sales of product revenue": {},
|
||||
"Service/fee revenue": {},
|
||||
"Unapplied cash payment income": {}
|
||||
},
|
||||
"root_type": "Income"
|
||||
},
|
||||
"Indirect Expenses": {
|
||||
"Expenses": {
|
||||
"Administrative expenses": {},
|
||||
"Advertising/promotional": {},
|
||||
"Auto": {},
|
||||
"Bad debts": {},
|
||||
"Bank charges": {},
|
||||
"Charitable contributions": {},
|
||||
"Cost of labour": {},
|
||||
"Distribution costs": {},
|
||||
"Dues and subscriptions": {},
|
||||
"Entertainment": {},
|
||||
"Equipment rental": {},
|
||||
"Finance costs": {},
|
||||
"Insurance": {},
|
||||
"Interest paid": {},
|
||||
"Legal and professional fees": {},
|
||||
"Meals and entertainment": {},
|
||||
"Other miscellaneous service cost": {},
|
||||
"Payroll expenses": {},
|
||||
"Promotional meals": {},
|
||||
"Rent or lease of buildings": {},
|
||||
"Repair and maintenance": {},
|
||||
"Shipping, freight, and delivery": {},
|
||||
"Supplies": {},
|
||||
"Taxes paid": {},
|
||||
"Travel": {},
|
||||
"Travel meals": {},
|
||||
"Unapplied cash bill payment expense": {},
|
||||
"Utilities": {}
|
||||
},
|
||||
"Other Expenses": {
|
||||
"Amortisation": {},
|
||||
"Depreciation": {},
|
||||
"Exchange Gain or Loss": {},
|
||||
"Other Expense": {},
|
||||
"Penalties and settlements": {}
|
||||
},
|
||||
"root_type": "Expense"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"country_code": "si",
|
||||
"name": "Kontni na\u010drt za gospodarske dru\u017ebe",
|
||||
"disabled": "Yes",
|
||||
"tree": {
|
||||
"DOLGORO\u010cNA SREDSTVA": {
|
||||
"DANA DOLGORO\u010cNA POSOJILA IN TERJATVE ZA NEVPLA\u010cANI VPOKLICANI KAPITAL": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "th",
|
||||
"name": "Thailand Chart of Accounts",
|
||||
"is_active": "Yes",
|
||||
"tree": {
|
||||
"Assets": {
|
||||
"Account Receivable": {},
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "uy",
|
||||
"name": "Plan de Cuentas",
|
||||
"is_active": "Yes",
|
||||
"tree": {
|
||||
"ACTIVO": {
|
||||
"ACTIVO CORRIENTE": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "ae",
|
||||
"name": "U.A.E Chart of Accounts",
|
||||
"is_active": "Yes",
|
||||
"tree": {
|
||||
"Assets": {
|
||||
"Current Assets": {
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"country_code": "gt",
|
||||
"name": "Cuentas de Guatemala",
|
||||
"tree": {
|
||||
"Activos": {
|
||||
"Activo Corriente": {
|
||||
"Caja y Bancos": {},
|
||||
"Cuentas por Cobrar": {},
|
||||
"Impuestos por Cobrar": {
|
||||
"IVA por Cobrar": {},
|
||||
"Retenciones de IVA recibidas": {}
|
||||
},
|
||||
"Inventario": {
|
||||
"is_group": 1,
|
||||
"account_type": "Stock"
|
||||
}
|
||||
},
|
||||
"No Corriente": {
|
||||
"Activos Fijos": {},
|
||||
"Cargos Diferidos": {}
|
||||
},
|
||||
"root_type": "Asset"
|
||||
},
|
||||
"Pasivos": {
|
||||
"Pasivo Corriente": {
|
||||
"Proveedores": {
|
||||
"Inventario Recibido pero No Cobrado": {
|
||||
"account_type": "Stock Received But Not Billed"
|
||||
}
|
||||
},
|
||||
"Impuestos por Pagar": {},
|
||||
"Sueldos por Liquidar": {},
|
||||
"Prestaciones": {},
|
||||
"Cuentas por Pagar": {},
|
||||
"Otras Cuentas por Pagar": {},
|
||||
"Acreedores": {}
|
||||
},
|
||||
"Pasivo No Corriente": {
|
||||
"Provisión para Indemnizaciones": {},
|
||||
"Acreedores": {}
|
||||
},
|
||||
"root_type": "Liability"
|
||||
},
|
||||
"Patrimonio": {
|
||||
"Capital": {},
|
||||
"Utilidades Retenidas": {},
|
||||
"Resultados del Ejercicio": {},
|
||||
"root_type": "Asset"
|
||||
},
|
||||
"Costos": {
|
||||
"Costo de Ventas": {},
|
||||
"Costos Incluidos en la Valuación": {
|
||||
"account_type": "Expenses Included In Valuation"
|
||||
},
|
||||
"Stock Adjustment": {
|
||||
"account_type": "Stock Adjustment"
|
||||
},
|
||||
"root_type": "Expense"
|
||||
},
|
||||
"Gastos": {
|
||||
"Gastos de Personal": {},
|
||||
"Honorarios Profesionales": {},
|
||||
"Servicios Básicos": {},
|
||||
"Alquileres": {},
|
||||
"Seguros": {},
|
||||
"Mantenimiento": {},
|
||||
"Depreciaciones": {},
|
||||
"Gastos Diversos": {},
|
||||
"root_type": "Expense"
|
||||
},
|
||||
"Ingresos": {
|
||||
"Productos": {},
|
||||
"Servicios": {},
|
||||
"root_type": "Income"
|
||||
},
|
||||
"Otros Gastos y Productos Financieros": {
|
||||
"Otros Ingresos": {
|
||||
"Otros Gastos y Productos Financieros": {
|
||||
"Intereses": {},
|
||||
"Otros Gastos Financieros": {}
|
||||
}
|
||||
},
|
||||
"Otros Gastos": {
|
||||
"Otros Gastos y Productos Financieros": {
|
||||
"Intereses": {},
|
||||
"Otros Gastos Financieros": {}
|
||||
}
|
||||
},
|
||||
"root_type": "Expense"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "in",
|
||||
"name": "Chart of Accounts - India",
|
||||
"is_active": "Yes",
|
||||
"tree": {
|
||||
"Application of Funds (Assets)": {
|
||||
"Current Assets": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "ni",
|
||||
"name": "Catalogo de Cuentas Nicaragua",
|
||||
"is_active": "Yes",
|
||||
"tree": {
|
||||
"Activo": {
|
||||
"Activo Corriente": {
|
||||
|
||||
@@ -0,0 +1,273 @@
|
||||
{
|
||||
"country_code": "sg",
|
||||
"name": "Singapore Default Chart of Accounts",
|
||||
"tree": {
|
||||
"Assets": {
|
||||
"Current assets": {
|
||||
"Accounts Receivable": {
|
||||
"Credit Cards": {
|
||||
"AMEX Receivable": {},
|
||||
"CUP Receivale": {},
|
||||
"MC Receivable": {},
|
||||
"NETS Receivable": {},
|
||||
"VISA Receivable": {}
|
||||
},
|
||||
"Debtors": {
|
||||
"account_type": "Receivable"
|
||||
}
|
||||
},
|
||||
"Bank Accounts": {
|
||||
"Paypal Account": {
|
||||
"account_type": "Bank"
|
||||
},
|
||||
"account_type": "Bank"
|
||||
},
|
||||
"Cash in Hand": {
|
||||
"Cash in Transit": {
|
||||
"account_type": "Cash"
|
||||
},
|
||||
"Petty Cash": {
|
||||
"account_type": "Cash"
|
||||
}
|
||||
},
|
||||
"Loans and Advances-Assets": {
|
||||
"Prepayments": {}
|
||||
},
|
||||
"Securities and Deposits": {
|
||||
"Bank Guarantees": {},
|
||||
"Bank Deposits": {},
|
||||
"Rental Deposits": {}
|
||||
},
|
||||
"Stock Assets": {
|
||||
"account_type": "Stock",
|
||||
"is_group": 1
|
||||
},
|
||||
"Tax Assets": {
|
||||
"GST-Input": {}
|
||||
}
|
||||
},
|
||||
"Non-current assets": {
|
||||
"Fixed Assets": {
|
||||
"Accumulated Depreciation": {
|
||||
"AccDep-Equipment-ICT": {},
|
||||
"AccDep-Furniture and Fixtures": {},
|
||||
"AccDep-Equipment-Office": {},
|
||||
"AccDep-Motor Vehicle": {},
|
||||
"AccDep-Plant and Machinery": {}
|
||||
},
|
||||
"Equipment-ICT": {},
|
||||
"Furniture and Fixtures": {},
|
||||
"Equipment-Office": {},
|
||||
"Motor Vehicle": {},
|
||||
"Plant and Machinery": {}
|
||||
},
|
||||
"Non-Fixed Assets": {
|
||||
"Goodwill": {},
|
||||
"Investments": {
|
||||
"Investments-Associated Company": {},
|
||||
"Investments-Subsidiary": {}
|
||||
}
|
||||
},
|
||||
"Shares": {
|
||||
"Shares-Quoted": {},
|
||||
"Shares-Unquoted": {}
|
||||
}
|
||||
},
|
||||
"Temporary Accunts": {
|
||||
"Temporary Opening": {
|
||||
"account_type": "Temporary"
|
||||
}
|
||||
},
|
||||
"root_type": "Asset"
|
||||
},
|
||||
"Liabilities": {
|
||||
"Current liabilities": {
|
||||
"Accounts Payable": {
|
||||
"Creditors":{
|
||||
"account_type": "Payable"
|
||||
}
|
||||
},
|
||||
"Duties and Taxes": {
|
||||
"account_type": "Tax",
|
||||
"Deferred Tax Liabilities-Current": {},
|
||||
"GST-Output": {},
|
||||
"Income Tax Payable": {}
|
||||
},
|
||||
"Loans-Current": {
|
||||
"Amount Owing to Directors": {},
|
||||
"Bank Overdaft Account": {},
|
||||
"Secured Loans": {},
|
||||
"Unsecured Loans": {}
|
||||
},
|
||||
"Provision and Accruals": {
|
||||
"Accruals": {
|
||||
"Accr-CPF": {},
|
||||
"Accr-Sundry": {},
|
||||
"Accr-Withholding Tax": {}
|
||||
},
|
||||
"Provisions": {
|
||||
"Prov-Audit Fee": {},
|
||||
"Prov-Others": {},
|
||||
"Prov-Tax Fee": {},
|
||||
"Prov-Bonus": {
|
||||
"Prov-Bonus-Executive": {},
|
||||
"Prov-Bonus-Non Executive": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Sponsorship Funds": {},
|
||||
"Stock Liabilities": {
|
||||
"Stock Received But Not Billed": {
|
||||
"account_type": "Stock Received But Not Billed"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Non-current liabilities": {
|
||||
"Deferred Tax Liabilities": {},
|
||||
"Loans-Non Current": {}
|
||||
},
|
||||
"Capital Account": {
|
||||
"Reserves and Surplus": {},
|
||||
"Shareholder Funds": {}
|
||||
},
|
||||
"root_type": "Liability"
|
||||
},
|
||||
"Equity": {
|
||||
"Share Capital": {},
|
||||
"Current Year Earnings": {},
|
||||
"Proposed Dividends": {},
|
||||
"Retained Earnings": {},
|
||||
"root_type": "Equity"
|
||||
},
|
||||
"Income": {
|
||||
"Direct Income": {
|
||||
"Management Income": {},
|
||||
"Sales Income": {}
|
||||
},
|
||||
"Indirect Income": {
|
||||
"Government Grants": {},
|
||||
"Interest Income": {
|
||||
"Current Account Interest Earned": {},
|
||||
"Fixed Deposit Interest Earned": {}
|
||||
},
|
||||
"Other Income": {},
|
||||
"Service Charges": {}
|
||||
},
|
||||
"root_type": "Income"
|
||||
},
|
||||
"Expenses": {
|
||||
"Expenses-Administrative": {
|
||||
"Audit Fees": {},
|
||||
"Bank charges and interest": {},
|
||||
"Currency Exchange Differences": {},
|
||||
"Insurance": {},
|
||||
"Interest on Loan": {},
|
||||
"Legal and Professional Fees": {},
|
||||
"Loss on Disposal of FA": {},
|
||||
"Postal and Courier Charges": {},
|
||||
"Printing and Stationery": {},
|
||||
"Secretarial Fees": {},
|
||||
"Tax Agent Fees": {}
|
||||
},
|
||||
"Expenses-Direct": {
|
||||
"Cost of Goods Sold": {
|
||||
"account_type": "Cost of Goods Sold"
|
||||
},
|
||||
"Cost of Sales": {},
|
||||
"Expenses Included in Valuation": {
|
||||
"account_type": "Expenses Included In Valuation"
|
||||
},
|
||||
"Stock Adjustment": {
|
||||
"account_type": "Stock Adjustment"
|
||||
}
|
||||
},
|
||||
"Expenses-Marketing": {
|
||||
"Advertising and Promotion": {},
|
||||
"Graphic Design Fees": {},
|
||||
"Internet Marketing": {}
|
||||
},
|
||||
"Expenses-Operating": {
|
||||
"Cleaning Costs": {},
|
||||
"Commission Charges": {
|
||||
"Comm-Credit Card": {},
|
||||
"Comm-NETS": {},
|
||||
"Comm-Paypal": {}
|
||||
},
|
||||
"Communication Costs": {
|
||||
"Internet Connection": {},
|
||||
"Telephone Costs": {}
|
||||
},
|
||||
"Entertainment Expenses": {},
|
||||
"General Expenses": {},
|
||||
"Licence Fees": {},
|
||||
"Rental Costs": {
|
||||
"Rental-Premises": {},
|
||||
"Rental-Equipment": {},
|
||||
"Rental-Storage": {}
|
||||
},
|
||||
"Repairs and Maintenance": {
|
||||
"R&M-ICT": {},
|
||||
"R&M-Building": {},
|
||||
"R&M-Fixtures & Furniture": {},
|
||||
"R&M-Office": {},
|
||||
"R&M-Plant & Machinery": {}
|
||||
},
|
||||
"Service Fees": {},
|
||||
"Subscription Fees": {
|
||||
"Publication Subscriptions": {},
|
||||
"TV Subscriptions": {}
|
||||
},
|
||||
"Travel Expenses": {},
|
||||
"Utilities": {
|
||||
"Utility-Electricity": {},
|
||||
"Utility-Gas": {},
|
||||
"Utility-Refuse Removal": {},
|
||||
"Utility-Water": {}
|
||||
}
|
||||
},
|
||||
"Expenses-Other": {
|
||||
"Bad Debts Written Off": {},
|
||||
"Depreciation": {
|
||||
"Dep-ICT Equipment": {},
|
||||
"Dep-Fixtures & Furniture": {},
|
||||
"Dep-Motor Vehicle": {},
|
||||
"Dep-Office Equipment": {},
|
||||
"Dep-Plant & Machinery": {},
|
||||
"Dep-Renovation": {}
|
||||
},
|
||||
"Donations": {},
|
||||
"Round Off": {},
|
||||
"Tax Expenses": {
|
||||
"Tax Expenses": {}
|
||||
}
|
||||
},
|
||||
"Expenses-Staff": {
|
||||
"Bonuses": {
|
||||
"Bonus-Executive": {},
|
||||
"Bonus-Non Executive": {},
|
||||
"Bonus-Performance": {}
|
||||
},
|
||||
"CPF": {},
|
||||
"Directors Fees": {},
|
||||
"FWL": {},
|
||||
"Incentives": {},
|
||||
"Medical Expenses": {},
|
||||
"Salaries": {
|
||||
"Casual Labour": {},
|
||||
"Salary-Executive": {},
|
||||
"Salary-Non Executive-Full Time": {},
|
||||
"Salary-Non Executive-Part Time": {}
|
||||
},
|
||||
"SDF": {},
|
||||
"Security Expenses": {},
|
||||
"Staff Advertising": {},
|
||||
"Staff Commission Paid": {},
|
||||
"Staff Meals": {},
|
||||
"Staff Training": {},
|
||||
"Staff Transport": {},
|
||||
"Staff Welfare": {}
|
||||
},
|
||||
"root_type": "Expense"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,343 @@
|
||||
{
|
||||
"country_code": "sg",
|
||||
"name": "Singapore F&B Chart of Accounts",
|
||||
"tree": {
|
||||
"Assets": {
|
||||
"Current assets": {
|
||||
"Accounts Receivable": {
|
||||
"Credit Cards": {
|
||||
"AMEX Receivable": {},
|
||||
"CUP Receivale": {},
|
||||
"MC Receivable": {},
|
||||
"NETS Receivable": {},
|
||||
"VISA Receivable": {}
|
||||
},
|
||||
"Debtors": {
|
||||
"account_type": "Receivable"
|
||||
}
|
||||
},
|
||||
"Bank Accounts": {
|
||||
"Paypal Account": {
|
||||
"account_type": "Bank"
|
||||
},
|
||||
"account_type": "Bank"
|
||||
},
|
||||
"Cash in Hand": {
|
||||
"Cash in Transit": {
|
||||
"account_type": "Cash"
|
||||
},
|
||||
"Petty Cash": {
|
||||
"account_type": "Cash"
|
||||
}
|
||||
},
|
||||
"Loans and Advances-Assets": {
|
||||
"Prepayments": {}
|
||||
},
|
||||
"Securities and Deposits": {
|
||||
"Bank Guarantees": {},
|
||||
"Bank Deposits": {},
|
||||
"Rental Deposits": {}
|
||||
},
|
||||
"Stock Assets": {
|
||||
"account_type": "Stock",
|
||||
"is_group": 1
|
||||
},
|
||||
"Tax Assets": {
|
||||
"GST-Input": {}
|
||||
}
|
||||
},
|
||||
"Non-current assets": {
|
||||
"Fixed Assets": {
|
||||
"Accumulated Depreciation": {
|
||||
"AccDep-Equipment-AV": {},
|
||||
"AccDep-Equipment-Bar": {},
|
||||
"AccDep-Equipment-ICT": {},
|
||||
"AccDep-Equipment-Electrical": {},
|
||||
"AccDep-Furniture and Fixtures": {},
|
||||
"AccDep-Equipment-Kitchen": {},
|
||||
"AccDep-Equipment-Lighting": {},
|
||||
"AccDep-Equipment-Office": {},
|
||||
"AccDep-Motor Vehicle": {},
|
||||
"AccDep-Plant and Machinery": {},
|
||||
"AccDep-Renovation": {}
|
||||
},
|
||||
"Equipment-AV": {},
|
||||
"Equipment-Bar": {},
|
||||
"Equipment-ICT": {},
|
||||
"Equipment-Electrical": {},
|
||||
"Furniture and Fixtures": {},
|
||||
"Equipment-Kitchen": {},
|
||||
"Equipment-Lighting": {},
|
||||
"Equipment-Office": {},
|
||||
"Motor Vehicle": {},
|
||||
"Plant and Machinery": {},
|
||||
"Renovation": {}
|
||||
},
|
||||
"Non-Fixed Assets": {
|
||||
"Goodwill": {},
|
||||
"Investments": {
|
||||
"Investments-Associated Company": {},
|
||||
"Investments-Subsidiary": {}
|
||||
}
|
||||
},
|
||||
"Shares": {
|
||||
"Shares-Quoted": {},
|
||||
"Shares-Unquoted": {}
|
||||
}
|
||||
},
|
||||
"Temporary Accunts": {
|
||||
"Temporary Opening": {
|
||||
"account_type": "Temporary"
|
||||
}
|
||||
},
|
||||
"root_type": "Asset"
|
||||
},
|
||||
"Liabilities": {
|
||||
"Current liabilities": {
|
||||
"Accounts Payable": {
|
||||
"Creditors":{
|
||||
"account_type": "Payable"
|
||||
}
|
||||
},
|
||||
"Duties and Taxes": {
|
||||
"account_type": "Tax",
|
||||
"Deferred Tax Liabilities-Current": {},
|
||||
"GST-Output": {},
|
||||
"Income Tax Payable": {}
|
||||
},
|
||||
"Loans-Current": {
|
||||
"Amount Owing to Directors": {},
|
||||
"Bank Overdaft Account": {},
|
||||
"Secured Loans": {},
|
||||
"Unsecured Loans": {}
|
||||
},
|
||||
"Provision and Accruals": {
|
||||
"Accruals": {
|
||||
"Accr-CPF": {},
|
||||
"Accr-Incentives": {},
|
||||
"Accr-OCR Employee Card": {},
|
||||
"Accr-Paypal Credit": {},
|
||||
"Accr-Sundry": {},
|
||||
"Accr-Tips": {},
|
||||
"Accr-Withholding Tax": {}
|
||||
},
|
||||
"Provisions": {
|
||||
"Prov-Audit Fee": {},
|
||||
"Prov-Others": {},
|
||||
"Prov-Tax Fee": {},
|
||||
"Prov-Bonus": {
|
||||
"Prov-Bonus-Executive": {},
|
||||
"Prov-Bonus-Non Executive": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Sponsorship Funds": {},
|
||||
"Stock Liabilities": {
|
||||
"Stock Received But Not Billed": {
|
||||
"account_type": "Stock Received But Not Billed"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Non-current liabilities": {
|
||||
"Deferred Tax Liabilities": {},
|
||||
"Loans-Non Current": {}
|
||||
},
|
||||
"Capital Account": {
|
||||
"Reserves and Surplus": {},
|
||||
"Shareholder Funds": {}
|
||||
},
|
||||
"root_type": "Liability"
|
||||
},
|
||||
"Equity": {
|
||||
"Share Capital": {},
|
||||
"Current Year Earnings": {},
|
||||
"Proposed Dividends": {},
|
||||
"Retained Earnings": {},
|
||||
"root_type": "Equity"
|
||||
},
|
||||
"Income": {
|
||||
"Direct Income": {
|
||||
"Management Income": {},
|
||||
"Sales Income": {
|
||||
"Sales-Food": {},
|
||||
"Sales-Beverage": {},
|
||||
"Sales-Events and Functions": {},
|
||||
"Sales-Merchandise": {},
|
||||
"Sales-Pool Tables": {},
|
||||
"Sales-Tobacco": {},
|
||||
"Sales-Rental": {}
|
||||
}
|
||||
},
|
||||
"Indirect Income": {
|
||||
"Government Grants": {},
|
||||
"Interest Income": {
|
||||
"Current Account Interest Earned": {},
|
||||
"Fixed Deposit Interest Earned": {}
|
||||
},
|
||||
"Other Income": {},
|
||||
"Service Charges": {}
|
||||
},
|
||||
"root_type": "Income"
|
||||
},
|
||||
"Expenses": {
|
||||
"Expenses-Administrative": {
|
||||
"Admin Management Fees": {},
|
||||
"Audit Fees": {},
|
||||
"Auto": {},
|
||||
"Bank charges and interest": {},
|
||||
"Currency Exchange Differences": {},
|
||||
"Insurance": {},
|
||||
"Interest on Loan": {},
|
||||
"Legal and Professional Fees": {},
|
||||
"Loss on Disposal of FA": {},
|
||||
"Postal and Courier Charges": {},
|
||||
"Printing and Stationery": {},
|
||||
"Secretarial Fees": {},
|
||||
"Tax Agent Fees": {}
|
||||
},
|
||||
"Expenses-Direct": {
|
||||
"Cost of Goods Sold": {
|
||||
"account_type": "Cost of Goods Sold"
|
||||
},
|
||||
"Cost of Sales": {
|
||||
"COS-Food": {},
|
||||
"COS-Beverage": {},
|
||||
"COS-Tobacco": {},
|
||||
"COS-Events and Functions": {},
|
||||
"COS-Merchandise": {}
|
||||
},
|
||||
"Expenses Included in Valuation": {
|
||||
"account_type": "Expenses Included In Valuation"
|
||||
},
|
||||
"Stock Adjustment": {
|
||||
"account_type": "Stock Adjustment"
|
||||
}
|
||||
},
|
||||
"Expenses-Marketing": {
|
||||
"Advertising and Promotion": {},
|
||||
"Graphic Design Fees": {},
|
||||
"Internet Marketing": {
|
||||
"Marketing-Social Media": {},
|
||||
"Marketing-Website": {}
|
||||
}
|
||||
},
|
||||
"Expenses-Operating": {
|
||||
"Cleaning Costs": {
|
||||
"Cleaning-Kitchen": {},
|
||||
"Cleaning-Laundry": {},
|
||||
"Cleaning-Outlet": {}
|
||||
},
|
||||
"Commission Charges": {
|
||||
"Comm-Credit Card": {},
|
||||
"Comm-NETS": {},
|
||||
"Comm-Paypal": {}
|
||||
},
|
||||
"Communication Costs": {
|
||||
"Internet Connection": {},
|
||||
"Telephone Costs": {}
|
||||
},
|
||||
"Disposals": {
|
||||
"Disposals-Food": {},
|
||||
"Disposals-Beverage": {},
|
||||
"Disposals-Merchandise": {},
|
||||
"Disposals-Others": {}
|
||||
},
|
||||
"Entertainment Expenses": {
|
||||
"DJ Costs": {},
|
||||
"Live Band Costs": {},
|
||||
"Recorded Music Costs": {}
|
||||
},
|
||||
"FoC Accounts": {
|
||||
"FoC-ENT": {},
|
||||
"FoC-OC": {}
|
||||
},
|
||||
"General Expenses": {},
|
||||
"Landscaping Costs": {},
|
||||
"Licence Fees": {},
|
||||
"Operational Supplies": {
|
||||
"Supplies-Bar": {},
|
||||
"Supplies-Guest": {},
|
||||
"Supplies-Kitchen": {},
|
||||
"Supplies-Restaurant": {},
|
||||
"Supplies-Stewarding": {}
|
||||
},
|
||||
"Rental Costs": {
|
||||
"Rental-Premises": {},
|
||||
"Rental-Equipment": {},
|
||||
"Rental-Storage": {}
|
||||
},
|
||||
"Repairs and Maintenance": {
|
||||
"R&M-ICT": {},
|
||||
"R&M-AV": {},
|
||||
"R&M-Building": {},
|
||||
"R&M-Electrical & Lighting": {},
|
||||
"R&M-Fixtures & Furniture": {},
|
||||
"R&M-Kitchen & Bar": {},
|
||||
"R&M-Office": {},
|
||||
"R&M-Plant & Machinery": {}
|
||||
},
|
||||
"Service Fees": {},
|
||||
"Subscription Fees": {
|
||||
"Publication Subscriptions": {},
|
||||
"TV Subscriptions": {}
|
||||
},
|
||||
"Travel Expenses": {},
|
||||
"Utilities": {
|
||||
"Utility-Electricity": {},
|
||||
"Utility-Gas": {},
|
||||
"Utility-Refuse Removal": {},
|
||||
"Utility-Water": {}
|
||||
}
|
||||
},
|
||||
"Expenses-Other": {
|
||||
"Bad Debts Written Off": {},
|
||||
"Depreciation": {
|
||||
"Dep-AV Equipment": {},
|
||||
"Dep-Bar Equipment": {},
|
||||
"Dep-ICT Equipment": {},
|
||||
"Dep-Electrical Equipment": {},
|
||||
"Dep-Fixtures & Furniture": {},
|
||||
"Dep-Kitchen Equipment": {},
|
||||
"Dep-Lighting Equipment": {},
|
||||
"Dep-Motor Vehicle": {},
|
||||
"Dep-Office Equipment": {},
|
||||
"Dep-Plant & Machinery": {},
|
||||
"Dep-Renovation": {}
|
||||
},
|
||||
"Donations": {},
|
||||
"Round Off": {},
|
||||
"Tax Expenses": {
|
||||
"Tax Expenses": {}
|
||||
}
|
||||
},
|
||||
"Expenses-Staff": {
|
||||
"Bonuses": {
|
||||
"Bonus-Executive": {},
|
||||
"Bonus-Non Executive": {},
|
||||
"Bonus-Performance": {}
|
||||
},
|
||||
"CPF": {},
|
||||
"Directors Fees": {},
|
||||
"FWL": {},
|
||||
"Incentives": {},
|
||||
"Medical Expenses": {},
|
||||
"Salaries": {
|
||||
"Casual Labour": {},
|
||||
"Salary-Executive": {},
|
||||
"Salary-Non Executive-Full Time": {},
|
||||
"Salary-Non Executive-Part Time": {}
|
||||
},
|
||||
"SDF": {},
|
||||
"Security Expenses": {},
|
||||
"Staff Advertising": {},
|
||||
"Staff Commission Paid": {},
|
||||
"Staff Meals": {},
|
||||
"Staff Training": {},
|
||||
"Staff Transport": {},
|
||||
"Staff Uniforms": {},
|
||||
"Staff Welfare": {}
|
||||
},
|
||||
"root_type": "Expense"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,9 +21,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Make Accounting Entry For Every Stock Movement",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -43,9 +45,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Accounts Frozen Upto",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -65,10 +69,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Role Allowed to Set Frozen Accounts & Edit Frozen Entries",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Role",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -88,10 +94,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Credit Controller",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Role",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -110,10 +118,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Check Supplier Invoice Number Uniqueness",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -131,7 +141,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 1,
|
||||
"istable": 0,
|
||||
"modified": "2015-07-14 00:51:48.095525",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-12-24 21:42:01.274459",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Accounts Settings",
|
||||
|
||||
@@ -2,10 +2,29 @@
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
frappe.ui.form.on("Bank Reconciliation", {
|
||||
setup: function(frm) {
|
||||
frm.get_docfield("journal_entries").allow_bulk_edit = 1;
|
||||
frm.add_fetch("bank_account", "account_currency", "account_currency");
|
||||
},
|
||||
|
||||
onload: function(frm) {
|
||||
frm.set_query("bank_account", function() {
|
||||
return {
|
||||
"filters": {
|
||||
"account_type": "Bank",
|
||||
"is_group": 0
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_value("from_date", frappe.datetime.month_start());
|
||||
frm.set_value("to_date", frappe.datetime.month_end());
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
frm.disable_save();
|
||||
},
|
||||
|
||||
|
||||
update_clearance_date: function(frm) {
|
||||
return frappe.call({
|
||||
method: "update_details",
|
||||
@@ -22,19 +41,3 @@ frappe.ui.form.on("Bank Reconciliation", {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
cur_frm.add_fetch("bank_account", "company", "company");
|
||||
|
||||
cur_frm.set_query("bank_account", function() {
|
||||
return {
|
||||
"filters": {
|
||||
"account_type": "Bank",
|
||||
"is_group": 0
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
cur_frm.set_value("from_date", frappe.datetime.month_start());
|
||||
cur_frm.set_value("to_date", frappe.datetime.month_end());
|
||||
}
|
||||
@@ -19,10 +19,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Bank Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Account",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -34,17 +36,19 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "company",
|
||||
"fieldname": "account_currency",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 1,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Company",
|
||||
"in_list_view": 0,
|
||||
"label": "Account Currency",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company",
|
||||
"options": "Currency",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -63,9 +67,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "From Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -84,9 +90,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "To Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -105,9 +113,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Include Reconciled Entries",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -126,10 +136,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Get Relevant Entries",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -148,10 +160,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Journal Entries",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Bank Reconciliation Detail",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -170,10 +184,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Update Clearance Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -192,10 +208,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Total Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company:company:default_currency",
|
||||
"options": "account_currency",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -213,7 +231,9 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 1,
|
||||
"istable": 0,
|
||||
"modified": "2015-02-05 05:11:34.776660",
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2015-11-30 12:44:45.105451",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Bank Reconciliation",
|
||||
@@ -241,5 +261,6 @@
|
||||
}
|
||||
],
|
||||
"read_only": 1,
|
||||
"read_only_onload": 0
|
||||
"read_only_onload": 0,
|
||||
"version": 0
|
||||
}
|
||||
@@ -15,19 +15,18 @@ class BankReconciliation(Document):
|
||||
|
||||
condition = ""
|
||||
if not self.include_reconciled_entries:
|
||||
condition = "and ifnull(clearance_date, '') in ('', '0000-00-00')"
|
||||
condition = "and (clearance_date is null or clearance_date='0000-00-00')"
|
||||
|
||||
|
||||
dl = frappe.db.sql("""select t1.name, t1.cheque_no, t1.cheque_date, t2.debit,
|
||||
t2.credit, t1.posting_date, t2.against_account, t1.clearance_date,
|
||||
t2.reference_type, t2.reference_name
|
||||
dl = frappe.db.sql("""select t1.name, t1.cheque_no, t1.cheque_date, t2.debit_in_account_currency,
|
||||
t2.credit_in_account_currency, t1.posting_date, t2.against_account, t1.clearance_date
|
||||
from
|
||||
`tabJournal Entry` t1, `tabJournal Entry Account` t2
|
||||
where
|
||||
t2.parent = t1.name and t2.account = %s
|
||||
and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1
|
||||
and ifnull(t1.is_opening, 'No') = 'No' %s
|
||||
order by t1.posting_date""" %
|
||||
order by t1.posting_date DESC, t1.name DESC""" %
|
||||
('%s', '%s', '%s', condition), (self.bank_account, self.from_date, self.to_date), as_dict=1)
|
||||
|
||||
self.set('journal_entries', [])
|
||||
@@ -39,11 +38,11 @@ class BankReconciliation(Document):
|
||||
nl.voucher_id = d.name
|
||||
nl.cheque_number = d.cheque_no
|
||||
nl.cheque_date = d.cheque_date
|
||||
nl.debit = d.debit
|
||||
nl.credit = d.credit
|
||||
nl.debit = d.debit_in_account_currency
|
||||
nl.credit = d.credit_in_account_currency
|
||||
nl.against_account = d.against_account
|
||||
nl.clearance_date = d.clearance_date
|
||||
self.total_amount += flt(d.debit) - flt(d.credit)
|
||||
self.total_amount += flt(d.debit_in_account_currency) - flt(d.credit_in_account_currency)
|
||||
|
||||
def update_details(self):
|
||||
vouchers = []
|
||||
@@ -52,6 +51,7 @@ class BankReconciliation(Document):
|
||||
if d.cheque_date and getdate(d.clearance_date) < getdate(d.cheque_date):
|
||||
frappe.throw(_("Clearance date cannot be before check date in row {0}").format(d.idx))
|
||||
|
||||
if d.clearance_date or self.include_reconciled_entries:
|
||||
frappe.db.set_value("Journal Entry", d.voucher_id, "clearance_date", d.clearance_date)
|
||||
frappe.db.sql("""update `tabJournal Entry` set clearance_date = %s, modified = %s
|
||||
where name=%s""", (d.clearance_date, nowdate(), d.voucher_id))
|
||||
|
||||
@@ -16,43 +16,23 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Voucher ID",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "voucher_id",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Journal Entry",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "clearance_date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Clearance Date",
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "clearance_date",
|
||||
"oldfieldtype": "Date",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
"unique": 0,
|
||||
"width": "50"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
@@ -65,11 +45,115 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Against Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "against_account",
|
||||
"oldfieldtype": "Data",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0,
|
||||
"width": "15"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "debit",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Debit",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "debit",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "account_currency",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "credit",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Credit",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "credit",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "account_currency",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "column_break_5",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0,
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "posting_date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Posting Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "posting_date",
|
||||
"oldfieldtype": "Date",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -88,128 +172,13 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Cheque Number",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "cheque_number",
|
||||
"oldfieldtype": "Data",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "debit",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Debit",
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "debit",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "Company:company:default_currency",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "credit",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Credit",
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "credit",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "Company:company:default_currency",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "reference_type",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Reference Type",
|
||||
"no_copy": 0,
|
||||
"options": "DocType",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "reference_name",
|
||||
"fieldtype": "Dynamic Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Reference Name",
|
||||
"no_copy": 0,
|
||||
"options": "reference_type",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "posting_date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Posting Date",
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "posting_date",
|
||||
"oldfieldtype": "Date",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -226,19 +195,69 @@
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Cheque Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "cheque_date",
|
||||
"oldfieldtype": "Date",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "clearance_date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Clearance Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "clearance_date",
|
||||
"oldfieldtype": "Date",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "data_10",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"hide_heading": 0,
|
||||
@@ -249,12 +268,15 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"modified": "2015-08-10 16:59:43.974705",
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2016-01-19 12:06:17.568428",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Bank Reconciliation Detail",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0
|
||||
}
|
||||
"read_only_onload": 0,
|
||||
"version": 0
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "account",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -43,6 +44,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Budget Allocated",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "budget_allocated",
|
||||
"oldfieldtype": "Currency",
|
||||
@@ -67,6 +69,7 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Fiscal Year",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "fiscal_year",
|
||||
"oldfieldtype": "Select",
|
||||
@@ -89,7 +92,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"modified": "2015-02-19 01:06:59.471417",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:43.050558",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Budget Detail",
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -41,6 +42,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Series",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "C-FORM-",
|
||||
"permlevel": 0,
|
||||
@@ -63,6 +65,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "C-Form No",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -84,6 +87,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Received Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -105,6 +109,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Customer",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Customer",
|
||||
"permlevel": 0,
|
||||
@@ -126,6 +131,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -149,6 +155,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Company",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company",
|
||||
"permlevel": 0,
|
||||
@@ -171,6 +178,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Fiscal Year",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Fiscal Year",
|
||||
"permlevel": 0,
|
||||
@@ -193,6 +201,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Quarter",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "\nI\nII\nIII\nIV",
|
||||
"permlevel": 0,
|
||||
@@ -215,6 +224,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Total Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company:company:default_currency",
|
||||
"permlevel": 0,
|
||||
@@ -237,6 +247,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "State",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -257,6 +268,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -278,6 +290,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Invoices",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "C-Form Invoice Detail",
|
||||
"permlevel": 0,
|
||||
@@ -300,6 +313,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Total Invoiced Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company:company:default_currency",
|
||||
"permlevel": 0,
|
||||
@@ -322,6 +336,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Amended From",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"options": "C-Form",
|
||||
"permlevel": 0,
|
||||
@@ -344,7 +359,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 3,
|
||||
"modified": "2015-09-07 15:51:26",
|
||||
"modified": "2015-11-16 06:29:43.143528",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "C-Form",
|
||||
|
||||
12
erpnext/accounts/doctype/c_form/test_c_form.py
Normal file
12
erpnext/accounts/doctype/c_form/test_c_form.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
# test_records = frappe.get_test_records('C-Form')
|
||||
|
||||
class TestCForm(unittest.TestCase):
|
||||
pass
|
||||
@@ -18,6 +18,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Invoice No",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Sales Invoice",
|
||||
"permlevel": 0,
|
||||
@@ -42,6 +43,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Invoice Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -66,6 +68,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Territory",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Territory",
|
||||
"permlevel": 0,
|
||||
@@ -90,6 +93,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Net Total",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company:company:default_currency",
|
||||
"permlevel": 0,
|
||||
@@ -114,6 +118,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Grand Total",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company:company:default_currency",
|
||||
"permlevel": 0,
|
||||
@@ -136,7 +141,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"modified": "2015-01-01 14:29:58.597428",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:43.221484",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "C-Form Invoice Detail",
|
||||
|
||||
@@ -17,8 +17,7 @@ erpnext.accounts.CostCenterController = frappe.ui.form.Controller.extend({
|
||||
return {
|
||||
filters:[
|
||||
['Account', 'company', '=', me.frm.doc.company],
|
||||
['Account', 'root_type', '=', 'Expense'],
|
||||
['Account', 'is_group', '=', '0'],
|
||||
['Account', 'is_group', '=', '0']
|
||||
]
|
||||
}
|
||||
});
|
||||
@@ -52,7 +51,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
cur_frm.set_intro(intro_txt);
|
||||
|
||||
cur_frm.add_custom_button(__('Chart of Cost Centers'),
|
||||
function() { frappe.set_route("Accounts Browser", "Cost Center"); }, 'icon-sitemap')
|
||||
function() { frappe.set_route("Accounts Browser", "Cost Center"); }, __("View"))
|
||||
}
|
||||
|
||||
cur_frm.cscript.parent_cost_center = function(doc, cdt, cdn) {
|
||||
@@ -63,12 +62,12 @@ cur_frm.cscript.parent_cost_center = function(doc, cdt, cdn) {
|
||||
|
||||
cur_frm.cscript.hide_unhide_group_ledger = function(doc) {
|
||||
if (doc.is_group == 1) {
|
||||
cur_frm.add_custom_button(__('Convert to non-Group'),
|
||||
function() { cur_frm.cscript.convert_to_ledger(); }, 'icon-retweet',
|
||||
cur_frm.add_custom_button(__('Convert to Non-Group'),
|
||||
function() { cur_frm.cscript.convert_to_ledger(); }, "icon-retweet",
|
||||
"btn-default")
|
||||
} else if (doc.is_group == 0) {
|
||||
cur_frm.add_custom_button(__('Convert to Group'),
|
||||
function() { cur_frm.cscript.convert_to_group(); }, 'icon-retweet',
|
||||
function() { cur_frm.cscript.convert_to_group(); }, "icon-retweet",
|
||||
"btn-default")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -42,6 +43,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Cost Center Name",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "cost_center_name",
|
||||
"oldfieldtype": "Data",
|
||||
@@ -65,6 +67,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Parent Cost Center",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "parent_cost_center",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -89,6 +92,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Company",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "company_name",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -112,6 +116,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -135,6 +140,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Is Group",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
@@ -158,6 +164,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Budget",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -180,6 +187,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Distribution Id",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "distribution_id",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -205,6 +213,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Budgets",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "budget_details",
|
||||
"oldfieldtype": "Table",
|
||||
@@ -229,6 +238,7 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "lft",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "lft",
|
||||
"oldfieldtype": "Int",
|
||||
@@ -252,6 +262,7 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "rgt",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "rgt",
|
||||
"oldfieldtype": "Int",
|
||||
@@ -275,6 +286,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "old_parent",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "old_parent",
|
||||
"oldfieldtype": "Data",
|
||||
@@ -298,7 +310,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"modified": "2015-09-14 02:55:55.020690",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:43.870712",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Cost Center",
|
||||
|
||||
@@ -32,13 +32,13 @@ class CostCenter(NestedSet):
|
||||
for d in self.get('budgets'):
|
||||
if d.account:
|
||||
account_details = frappe.db.get_value("Account", d.account,
|
||||
["is_group", "company", "root_type"], as_dict=1)
|
||||
["is_group", "company", "report_type"], as_dict=1)
|
||||
if account_details.is_group:
|
||||
frappe.throw(_("Budget cannot be assigned against Group Account {0}").format(d.account))
|
||||
elif account_details.company != self.company:
|
||||
frappe.throw(_("Account {0} does not belongs to company {1}").format(d.account, self.company))
|
||||
elif account_details.root_type != "Expense":
|
||||
frappe.throw(_("Budget cannot be assigned against {0}, as it's not an Expense account")
|
||||
elif account_details.report_type != "Profit and Loss":
|
||||
frappe.throw(_("Budget cannot be assigned against {0}, as it's not an Income or Expense account")
|
||||
.format(d.account))
|
||||
|
||||
if [d.account, d.fiscal_year] in check_acc_list:
|
||||
|
||||
@@ -14,7 +14,7 @@ $.extend(cur_frm.cscript, {
|
||||
this.frm.toggle_enable('year_end_date', doc.__islocal)
|
||||
|
||||
if (!doc.__islocal && (doc.name != sys_defaults.fiscal_year)) {
|
||||
this.frm.add_custom_button(__("Set as Default"),
|
||||
this.frm.add_custom_button(__("Default"),
|
||||
this.frm.cscript.set_as_default, "icon-star");
|
||||
this.frm.set_intro(__("To set this Fiscal Year as Default, click on 'Set as Default'"));
|
||||
} else {
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Year Name",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "year",
|
||||
"oldfieldtype": "Data",
|
||||
@@ -45,6 +46,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Disabled",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
@@ -67,6 +69,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Year Start Date",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "year_start_date",
|
||||
"oldfieldtype": "Date",
|
||||
@@ -90,6 +93,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Year End Date",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -111,6 +115,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Companies",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Fiscal Year Company",
|
||||
"permlevel": 0,
|
||||
@@ -133,7 +138,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"modified": "2015-09-14 02:55:56.280252",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:47.289982",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Fiscal Year",
|
||||
|
||||
@@ -20,14 +20,15 @@ class FiscalYear(Document):
|
||||
msgprint(_("{0} is now the default Fiscal Year. Please refresh your browser for the change to take effect.").format(self.name))
|
||||
|
||||
def validate(self):
|
||||
year_start_end_dates = frappe.db.sql("""select year_start_date, year_end_date
|
||||
from `tabFiscal Year` where name=%s""", (self.name))
|
||||
|
||||
self.validate_dates()
|
||||
|
||||
if year_start_end_dates:
|
||||
if getdate(self.year_start_date) != year_start_end_dates[0][0] or getdate(self.year_end_date) != year_start_end_dates[0][1]:
|
||||
frappe.throw(_("Cannot change Fiscal Year Start Date and Fiscal Year End Date once the Fiscal Year is saved."))
|
||||
if not self.is_new():
|
||||
year_start_end_dates = frappe.db.sql("""select year_start_date, year_end_date
|
||||
from `tabFiscal Year` where name=%s""", (self.name))
|
||||
|
||||
if year_start_end_dates:
|
||||
if getdate(self.year_start_date) != year_start_end_dates[0][0] or getdate(self.year_end_date) != year_start_end_dates[0][1]:
|
||||
frappe.throw(_("Cannot change Fiscal Year Start Date and Fiscal Year End Date once the Fiscal Year is saved."))
|
||||
|
||||
def validate_dates(self):
|
||||
if getdate(self.year_start_date) > getdate(self.year_end_date):
|
||||
@@ -63,6 +64,6 @@ def auto_create_fiscal_year():
|
||||
end_year = cstr(new_fy.year_end_date.year)
|
||||
new_fy.year = start_year if start_year==end_year else (start_year + "-" + end_year)
|
||||
|
||||
new_fy.insert()
|
||||
new_fy.insert(ignore_permissions=True)
|
||||
except frappe.NameError:
|
||||
pass
|
||||
|
||||
@@ -1,32 +1,38 @@
|
||||
[
|
||||
{
|
||||
"doctype": "Fiscal Year",
|
||||
"year": "_Test Fiscal Year 2012",
|
||||
"year_end_date": "2012-12-31",
|
||||
"doctype": "Fiscal Year",
|
||||
"year": "_Test Fiscal Year 2012",
|
||||
"year_end_date": "2012-12-31",
|
||||
"year_start_date": "2012-01-01"
|
||||
},
|
||||
},
|
||||
{
|
||||
"doctype": "Fiscal Year",
|
||||
"year": "_Test Fiscal Year 2013",
|
||||
"year_end_date": "2013-12-31",
|
||||
"doctype": "Fiscal Year",
|
||||
"year": "_Test Fiscal Year 2013",
|
||||
"year_end_date": "2013-12-31",
|
||||
"year_start_date": "2013-01-01"
|
||||
},
|
||||
},
|
||||
{
|
||||
"doctype": "Fiscal Year",
|
||||
"year": "_Test Fiscal Year 2014",
|
||||
"year_end_date": "2014-12-31",
|
||||
"doctype": "Fiscal Year",
|
||||
"year": "_Test Fiscal Year 2014",
|
||||
"year_end_date": "2014-12-31",
|
||||
"year_start_date": "2014-01-01"
|
||||
},
|
||||
},
|
||||
{
|
||||
"doctype": "Fiscal Year",
|
||||
"year": "_Test Fiscal Year 2015",
|
||||
"year_end_date": "2015-12-31",
|
||||
"doctype": "Fiscal Year",
|
||||
"year": "_Test Fiscal Year 2015",
|
||||
"year_end_date": "2015-12-31",
|
||||
"year_start_date": "2015-01-01"
|
||||
},
|
||||
},
|
||||
{
|
||||
"doctype": "Fiscal Year",
|
||||
"year": "_Test Fiscal Year 2016",
|
||||
"year_end_date": "2016-12-31",
|
||||
"doctype": "Fiscal Year",
|
||||
"year": "_Test Fiscal Year 2016",
|
||||
"year_end_date": "2016-12-31",
|
||||
"year_start_date": "2016-01-01"
|
||||
},
|
||||
{
|
||||
"doctype": "Fiscal Year",
|
||||
"year": "_Test Fiscal Year 2017",
|
||||
"year_end_date": "2017-12-31",
|
||||
"year_start_date": "2017-01-01"
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Company",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company",
|
||||
"permlevel": 0,
|
||||
@@ -39,7 +40,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"modified": "2015-09-14 02:55:56.368682",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:47.344839",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Fiscal Year Company",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,15 +3,15 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
from frappe.utils import flt, fmt_money, getdate, formatdate
|
||||
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.exceptions import InvalidAccountCurrency
|
||||
|
||||
class CustomerFrozen(frappe.ValidationError): pass
|
||||
class InvalidCurrency(frappe.ValidationError): pass
|
||||
class InvalidAccountCurrency(frappe.ValidationError): pass
|
||||
exclude_from_linked_with = True
|
||||
|
||||
class GLEntry(Document):
|
||||
def validate(self):
|
||||
@@ -96,36 +96,27 @@ class GLEntry(Document):
|
||||
frappe.throw(_("Cost Center {0} does not belong to Company {1}").format(self.cost_center, self.company))
|
||||
|
||||
def validate_party(self):
|
||||
if self.party_type and self.party:
|
||||
frozen_accounts_modifier = frappe.db.get_value( 'Accounts Settings', None,'frozen_accounts_modifier')
|
||||
if not frozen_accounts_modifier in frappe.get_roles():
|
||||
if frappe.db.get_value(self.party_type, self.party, "is_frozen"):
|
||||
frappe.throw("{0} {1} is frozen".format(self.party_type, self.party), CustomerFrozen)
|
||||
|
||||
validate_party_frozen_disabled(self.party_type, self.party)
|
||||
|
||||
def validate_currency(self):
|
||||
company_currency = frappe.db.get_value("Company", self.company, "default_currency")
|
||||
account_currency = frappe.db.get_value("Account", self.account, "account_currency") or company_currency
|
||||
company_currency = get_company_currency(self.company)
|
||||
account_currency = get_account_currency(self.account)
|
||||
|
||||
if not self.account_currency:
|
||||
self.account_currency = company_currency
|
||||
|
||||
if account_currency != self.account_currency:
|
||||
frappe.throw(_("Accounting Entry for {0} can only be made in currency: {1}")
|
||||
.format(self.account, (account_currency or company_currency)), InvalidAccountCurrency)
|
||||
|
||||
|
||||
if self.party_type and self.party:
|
||||
party_account_currency = frappe.db.get_value(self.party_type, self.party, "party_account_currency") \
|
||||
or company_currency
|
||||
|
||||
if party_account_currency != self.account_currency:
|
||||
frappe.throw(_("Accounting Entry for {0}: {1} can only be made in currency: {2}")
|
||||
.format(self.party_type, self.party, party_account_currency), InvalidAccountCurrency)
|
||||
if self.party_type and self.party:
|
||||
validate_party_gle_currency(self.party_type, self.party, self.company, self.account_currency)
|
||||
|
||||
def validate_balance_type(account, adv_adj=False):
|
||||
if not adv_adj and account:
|
||||
balance_must_be = frappe.db.get_value("Account", account, "balance_must_be")
|
||||
if balance_must_be:
|
||||
balance = frappe.db.sql("""select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
|
||||
balance = frappe.db.sql("""select sum(debit) - sum(credit)
|
||||
from `tabGL Entry` where account = %s""", account)[0][0]
|
||||
|
||||
if (balance_must_be=="Debit" and flt(balance) < 0) or \
|
||||
@@ -147,26 +138,26 @@ def check_freezing_date(posting_date, adv_adj=False):
|
||||
|
||||
def update_outstanding_amt(account, party_type, party, against_voucher_type, against_voucher, on_cancel=False):
|
||||
if party_type and party:
|
||||
party_condition = " and ifnull(party_type, '')='{0}' and ifnull(party, '')='{1}'"\
|
||||
party_condition = " and party_type='{0}' and party='{1}'"\
|
||||
.format(frappe.db.escape(party_type), frappe.db.escape(party))
|
||||
else:
|
||||
party_condition = ""
|
||||
|
||||
# get final outstanding amt
|
||||
bal = flt(frappe.db.sql("""
|
||||
select sum(ifnull(debit_in_account_currency, 0)) - sum(ifnull(credit_in_account_currency, 0))
|
||||
select sum(debit_in_account_currency) - sum(credit_in_account_currency)
|
||||
from `tabGL Entry`
|
||||
where against_voucher_type=%s and against_voucher=%s
|
||||
and account = %s {0}""".format(party_condition),
|
||||
(against_voucher_type, against_voucher, account))[0][0] or 0.0)
|
||||
|
||||
|
||||
if against_voucher_type == 'Purchase Invoice':
|
||||
bal = -bal
|
||||
elif against_voucher_type == "Journal Entry":
|
||||
against_voucher_amount = flt(frappe.db.sql("""
|
||||
select sum(ifnull(debit_in_account_currency, 0)) - sum(ifnull(credit_in_account_currency, 0))
|
||||
select sum(debit_in_account_currency) - sum(credit_in_account_currency)
|
||||
from `tabGL Entry` where voucher_type = 'Journal Entry' and voucher_no = %s
|
||||
and account = %s and ifnull(against_voucher, '') = '' {0}"""
|
||||
and account = %s and (against_voucher is null or against_voucher='') {0}"""
|
||||
.format(party_condition), (against_voucher, account))[0][0])
|
||||
|
||||
if not against_voucher_amount:
|
||||
|
||||
@@ -9,17 +9,17 @@ class TestGLEntry(unittest.TestCase):
|
||||
def test_round_off_entry(self):
|
||||
frappe.db.set_value("Company", "_Test Company", "round_off_account", "_Test Write Off - _TC")
|
||||
frappe.db.set_value("Company", "_Test Company", "round_off_cost_center", "_Test Cost Center - _TC")
|
||||
|
||||
jv = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
|
||||
|
||||
jv = make_journal_entry("_Test Account Cost for Goods Sold - _TC",
|
||||
"_Test Bank - _TC", 100, "_Test Cost Center - _TC", submit=False)
|
||||
|
||||
|
||||
jv.get("accounts")[0].debit = 100.01
|
||||
jv.flags.ignore_validate = True
|
||||
jv.submit()
|
||||
|
||||
|
||||
round_off_entry = frappe.db.sql("""select name from `tabGL Entry`
|
||||
where voucher_type='Journal Entry' and voucher_no = %s
|
||||
where voucher_type='Journal Entry' and voucher_no = %s
|
||||
and account='_Test Write Off - _TC' and cost_center='_Test Cost Center - _TC'
|
||||
and ifnull(debit, 0) = 0 and ifnull(credit, 0) = '.01'""", jv.name)
|
||||
|
||||
self.assertTrue(round_off_entry)
|
||||
and debit = 0 and credit = '.01'""", jv.name)
|
||||
|
||||
self.assertTrue(round_off_entry)
|
||||
|
||||
@@ -8,10 +8,10 @@ frappe.require("assets/erpnext/js/utils.js");
|
||||
frappe.ui.form.on("Journal Entry", {
|
||||
refresh: function(frm) {
|
||||
erpnext.toggle_naming_series();
|
||||
cur_frm.cscript.voucher_type(frm.doc);
|
||||
frm.cscript.voucher_type(frm.doc);
|
||||
|
||||
if(frm.doc.docstatus==1) {
|
||||
cur_frm.add_custom_button(__('View Ledger'), function() {
|
||||
frm.add_custom_button(__('Ledger'), function() {
|
||||
frappe.route_options = {
|
||||
"voucher_no": frm.doc.name,
|
||||
"from_date": frm.doc.posting_date,
|
||||
@@ -22,34 +22,22 @@ frappe.ui.form.on("Journal Entry", {
|
||||
frappe.set_route("query-report", "General Ledger");
|
||||
}, "icon-table");
|
||||
}
|
||||
|
||||
|
||||
if (frm.doc.__islocal) {
|
||||
frm.add_custom_button(__('Quick Entry'), function() {
|
||||
return erpnext.journal_entry.quick_entry(frm);
|
||||
});
|
||||
}
|
||||
|
||||
// hide /unhide fields based on currency
|
||||
erpnext.journal_entry.toggle_fields_based_on_currency(frm);
|
||||
},
|
||||
|
||||
|
||||
multi_currency: function(frm) {
|
||||
erpnext.journal_entry.toggle_fields_based_on_currency(frm);
|
||||
}
|
||||
})
|
||||
|
||||
erpnext.journal_entry.toggle_fields_based_on_currency = function(frm) {
|
||||
var fields = ["currency_section", "account_currency", "exchange_rate", "debit", "credit"];
|
||||
|
||||
var grid = frm.get_field("accounts").grid;
|
||||
if(grid) grid.set_column_disp(fields, frm.doc.multi_currency);
|
||||
|
||||
// dynamic label
|
||||
var field_label_map = {
|
||||
"debit_in_account_currency": "Debit",
|
||||
"credit_in_account_currency": "Credit"
|
||||
};
|
||||
|
||||
$.each(field_label_map, function (fieldname, label) {
|
||||
var df = frappe.meta.get_docfield("Journal Entry Account", fieldname, frm.doc.name);
|
||||
df.label = frm.doc.multi_currency ? (label + " in Account Currency") : label;
|
||||
})
|
||||
}
|
||||
|
||||
erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
|
||||
onload: function() {
|
||||
this.load_defaults();
|
||||
@@ -69,28 +57,19 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
|
||||
}
|
||||
);
|
||||
|
||||
if(!this.frm.doc.amended_from) this.frm.doc.posting_date = get_today();
|
||||
if(!this.frm.doc.amended_from) this.frm.doc.posting_date = this.frm.posting_date || get_today();
|
||||
}
|
||||
},
|
||||
|
||||
setup_queries: function() {
|
||||
var me = this;
|
||||
|
||||
|
||||
me.frm.set_query("account", "accounts", function(doc, cdt, cdn) {
|
||||
var filters = {
|
||||
company: me.frm.doc.company,
|
||||
is_group: 0
|
||||
};
|
||||
if(!doc.multi_currency) {
|
||||
$.extend(filters, {
|
||||
account_currency: frappe.get_doc(":Company", me.frm.doc.company).default_currency
|
||||
});
|
||||
}
|
||||
return { filters: filters };
|
||||
return erpnext.journal_entry.account_query(me.frm);
|
||||
});
|
||||
|
||||
|
||||
me.frm.set_query("cost_center", "accounts", function(doc, cdt, cdn) {
|
||||
return {
|
||||
return {
|
||||
filters: {
|
||||
company: me.frm.doc.company,
|
||||
is_group: 0
|
||||
@@ -132,22 +111,22 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
|
||||
|
||||
if(in_list(["Sales Invoice", "Purchase Invoice"], jvd.reference_type)) {
|
||||
out.filters.push([jvd.reference_type, "outstanding_amount", "!=", 0]);
|
||||
|
||||
|
||||
// account filter
|
||||
frappe.model.validate_missing(jvd, "account");
|
||||
|
||||
|
||||
party_account_field = jvd.reference_type==="Sales Invoice" ? "debit_to": "credit_to";
|
||||
out.filters.push([jvd.reference_type, party_account_field, "=", jvd.account]);
|
||||
} else {
|
||||
// party_type and party mandatory
|
||||
frappe.model.validate_missing(jvd, "party_type");
|
||||
frappe.model.validate_missing(jvd, "party");
|
||||
|
||||
|
||||
out.filters.push([jvd.reference_type, "per_billed", "<", 100]);
|
||||
}
|
||||
|
||||
|
||||
if(jvd.party_type && jvd.party) {
|
||||
out.filters.push([jvd.reference_type,
|
||||
out.filters.push([jvd.reference_type,
|
||||
(jvd.reference_type.indexOf("Sales")===0 ? "customer" : "supplier"), "=", jvd.party]);
|
||||
}
|
||||
|
||||
@@ -244,6 +223,7 @@ cur_frm.cscript.company = function(doc, cdt, cdn) {
|
||||
}
|
||||
|
||||
cur_frm.cscript.posting_date = function(doc, cdt, cdn){
|
||||
cur_frm.posting_date = cur_frm.doc.posting_date;
|
||||
erpnext.get_fiscal_year(doc.company, doc.posting_date);
|
||||
}
|
||||
|
||||
@@ -335,6 +315,7 @@ frappe.ui.form.on("Journal Entry Account", {
|
||||
party: function(frm, cdt, cdn) {
|
||||
var d = frappe.get_doc(cdt, cdn);
|
||||
if(!d.account && d.party_type && d.party) {
|
||||
if(!frm.doc.company) frappe.throw(__("Please select Company"));
|
||||
return frm.call({
|
||||
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_party_account_and_balance",
|
||||
child: d,
|
||||
@@ -346,17 +327,17 @@ frappe.ui.form.on("Journal Entry Account", {
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
account: function(frm, dt, dn) {
|
||||
var d = locals[dt][dn];
|
||||
if(d.account) {
|
||||
if(!frm.doc.company) frappe.throw(__("Please select Company first"));
|
||||
if(!frm.doc.posting_date) frappe.throw(__("Please select Posting Date first"));
|
||||
|
||||
|
||||
return frappe.call({
|
||||
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_account_balance_and_party_type",
|
||||
args: {
|
||||
account: d.account,
|
||||
account: d.account,
|
||||
date: frm.doc.posting_date,
|
||||
company: frm.doc.company,
|
||||
debit: flt(d.debit_in_account_currency),
|
||||
@@ -366,30 +347,38 @@ frappe.ui.form.on("Journal Entry Account", {
|
||||
callback: function(r) {
|
||||
if(r.message) {
|
||||
$.extend(d, r.message);
|
||||
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, dt, dn);
|
||||
refresh_field('accounts');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
debit_in_account_currency: function(frm, cdt, cdn) {
|
||||
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
|
||||
erpnext.journal_entry.set_exchange_rate(frm, cdt, cdn);
|
||||
},
|
||||
|
||||
|
||||
credit_in_account_currency: function(frm, cdt, cdn) {
|
||||
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
|
||||
erpnext.journal_entry.set_exchange_rate(frm, cdt, cdn);
|
||||
},
|
||||
|
||||
|
||||
debit: function(frm, dt, dn) {
|
||||
cur_frm.cscript.update_totals(frm.doc);
|
||||
},
|
||||
|
||||
|
||||
credit: function(frm, dt, dn) {
|
||||
cur_frm.cscript.update_totals(frm.doc);
|
||||
},
|
||||
|
||||
exchange_rate: function(frm, cdt, cdn) {
|
||||
var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
|
||||
var row = locals[cdt][cdn];
|
||||
|
||||
if(row.account_currency == company_currency || !frm.doc.multi_currency) {
|
||||
frappe.model.set_value(cdt, cdn, "exchange_rate", 1);
|
||||
}
|
||||
|
||||
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
|
||||
}
|
||||
})
|
||||
@@ -398,41 +387,137 @@ frappe.ui.form.on("Journal Entry Account", "accounts_remove", function(frm) {
|
||||
cur_frm.cscript.update_totals(frm.doc);
|
||||
});
|
||||
|
||||
erpnext.journal_entry.set_debit_credit_in_company_currency = function(frm, cdt, cdn) {
|
||||
erpnext.journal_entry.set_exchange_rate(frm, cdt, cdn);
|
||||
|
||||
var row = locals[cdt][cdn];
|
||||
|
||||
frappe.model.set_value(cdt, cdn, "debit",
|
||||
flt(flt(row.debit_in_account_currency)*row.exchange_rate), precision("debit", row));
|
||||
frappe.model.set_value(cdt, cdn, "credit",
|
||||
flt(flt(row.credit_in_account_currency)*row.exchange_rate), precision("credit", row));
|
||||
}
|
||||
$.extend(erpnext.journal_entry, {
|
||||
toggle_fields_based_on_currency: function(frm) {
|
||||
var fields = ["currency_section", "account_currency", "exchange_rate", "debit", "credit"];
|
||||
|
||||
erpnext.journal_entry.set_exchange_rate = function(frm, cdt, cdn) {
|
||||
var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
|
||||
var row = locals[cdt][cdn];
|
||||
|
||||
if(row.account_currency == company_currency || !frm.doc.multi_currency) {
|
||||
frappe.model.set_value(cdt, cdn, "exchange_rate", 1);
|
||||
} else if (!row.exchange_rate || row.account_type == "Bank") {
|
||||
frappe.call({
|
||||
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_exchange_rate",
|
||||
args: {
|
||||
account: row.account,
|
||||
account_currency: row.account_currency,
|
||||
company: frm.doc.company,
|
||||
reference_type: cstr(row.reference_type),
|
||||
reference_name: cstr(row.reference_name),
|
||||
debit: flt(row.debit_in_account_currency),
|
||||
credit: flt(row.credit_in_account_currency),
|
||||
exchange_rate: row.exchange_rate
|
||||
},
|
||||
callback: function(r) {
|
||||
if(r.message) {
|
||||
frappe.model.set_value(cdt, cdn, "exchange_rate", r.message);
|
||||
}
|
||||
}
|
||||
var grid = frm.get_field("accounts").grid;
|
||||
if(grid) grid.set_column_disp(fields, frm.doc.multi_currency);
|
||||
|
||||
// dynamic label
|
||||
var field_label_map = {
|
||||
"debit_in_account_currency": "Debit",
|
||||
"credit_in_account_currency": "Credit"
|
||||
};
|
||||
|
||||
$.each(field_label_map, function (fieldname, label) {
|
||||
var df = frappe.meta.get_docfield("Journal Entry Account", fieldname, frm.doc.name);
|
||||
df.label = frm.doc.multi_currency ? (label + " in Account Currency") : label;
|
||||
})
|
||||
},
|
||||
|
||||
set_debit_credit_in_company_currency: function(frm, cdt, cdn) {
|
||||
var row = locals[cdt][cdn];
|
||||
|
||||
frappe.model.set_value(cdt, cdn, "debit",
|
||||
flt(flt(row.debit_in_account_currency)*row.exchange_rate), precision("debit", row));
|
||||
|
||||
frappe.model.set_value(cdt, cdn, "credit",
|
||||
flt(flt(row.credit_in_account_currency)*row.exchange_rate), precision("credit", row));
|
||||
|
||||
cur_frm.cscript.update_totals(frm.doc);
|
||||
},
|
||||
|
||||
set_exchange_rate: function(frm, cdt, cdn) {
|
||||
var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
|
||||
var row = locals[cdt][cdn];
|
||||
|
||||
if(row.account_currency == company_currency || !frm.doc.multi_currency) {
|
||||
row.exchange_rate = 1;
|
||||
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
|
||||
} else if (!row.exchange_rate || row.exchange_rate == 1 || row.account_type == "Bank") {
|
||||
frappe.call({
|
||||
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_exchange_rate",
|
||||
args: {
|
||||
account: row.account,
|
||||
account_currency: row.account_currency,
|
||||
company: frm.doc.company,
|
||||
reference_type: cstr(row.reference_type),
|
||||
reference_name: cstr(row.reference_name),
|
||||
debit: flt(row.debit_in_account_currency),
|
||||
credit: flt(row.credit_in_account_currency),
|
||||
exchange_rate: row.exchange_rate
|
||||
},
|
||||
callback: function(r) {
|
||||
if(r.message) {
|
||||
row.exchange_rate = r.message;
|
||||
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
|
||||
}
|
||||
refresh_field("exchange_rate", cdn, "accounts");
|
||||
},
|
||||
|
||||
quick_entry: function(frm) {
|
||||
var naming_series_options = frm.fields_dict.naming_series.df.options;
|
||||
var naming_series_default = frm.fields_dict.naming_series.df.default || naming_series_options.split("\n")[0];
|
||||
|
||||
var dialog = new frappe.ui.Dialog({
|
||||
title: __("Quick Journal Entry"),
|
||||
fields: [
|
||||
{fieldtype: "Currency", fieldname: "debit", label: __("Amount"), reqd: 1},
|
||||
{fieldtype: "Link", fieldname: "debit_account", label: __("Debit Account"), reqd: 1,
|
||||
options: "Account",
|
||||
get_query: function() {
|
||||
return erpnext.journal_entry.account_query(frm);
|
||||
}
|
||||
},
|
||||
{fieldtype: "Link", fieldname: "credit_account", label: __("Credit Account"), reqd: 1,
|
||||
options: "Account",
|
||||
get_query: function() {
|
||||
return erpnext.journal_entry.account_query(frm);
|
||||
}
|
||||
},
|
||||
{fieldtype: "Date", fieldname: "posting_date", label: __("Date"), reqd: 1,
|
||||
default: frm.doc.posting_date},
|
||||
{fieldtype: "Select", fieldname: "naming_series", label: __("Series"), reqd: 1,
|
||||
options: naming_series_options, default: naming_series_default},
|
||||
]
|
||||
});
|
||||
|
||||
dialog.set_primary_action(__("Save"), function() {
|
||||
var btn = this;
|
||||
var values = dialog.get_values();
|
||||
|
||||
frm.set_value("posting_date", values.posting_date);
|
||||
frm.set_value("naming_series", values.naming_series);
|
||||
|
||||
// clear table is used because there might've been an error while adding child
|
||||
// and cleanup didn't happen
|
||||
frm.clear_table("accounts");
|
||||
|
||||
// using grid.add_new_row() to add a row in UI as well as locals
|
||||
// this is required because triggers try to refresh the grid
|
||||
|
||||
var debit_row = frm.fields_dict.accounts.grid.add_new_row();
|
||||
frappe.model.set_value(debit_row.doctype, debit_row.name, "account", values.debit_account);
|
||||
frappe.model.set_value(debit_row.doctype, debit_row.name, "debit_in_account_currency", values.debit);
|
||||
|
||||
var credit_row = frm.fields_dict.accounts.grid.add_new_row();
|
||||
frappe.model.set_value(credit_row.doctype, credit_row.name, "account", values.credit_account);
|
||||
frappe.model.set_value(credit_row.doctype, credit_row.name, "credit_in_account_currency", values.debit);
|
||||
|
||||
frm.save();
|
||||
|
||||
dialog.hide();
|
||||
});
|
||||
|
||||
dialog.show();
|
||||
},
|
||||
|
||||
account_query: function(frm) {
|
||||
var filters = {
|
||||
company: frm.doc.company,
|
||||
is_group: 0
|
||||
};
|
||||
if(!frm.doc.multi_currency) {
|
||||
$.extend(filters, {
|
||||
account_currency: frappe.get_doc(":Company", frm.doc.company).default_currency
|
||||
});
|
||||
}
|
||||
return { filters: filters };
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,13 +2,13 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
import frappe, 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
|
||||
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
|
||||
|
||||
class JournalEntry(AccountsController):
|
||||
def __init__(self, arg1, arg2=None):
|
||||
@@ -27,7 +27,8 @@ class JournalEntry(AccountsController):
|
||||
self.validate_cheque_info()
|
||||
self.validate_entries_for_advance()
|
||||
self.validate_multi_currency()
|
||||
self.validate_debit_and_credit()
|
||||
self.set_amounts_in_company_currency()
|
||||
self.validate_total_debit_and_credit()
|
||||
self.validate_against_jv()
|
||||
self.validate_reference_doc()
|
||||
self.set_against_account()
|
||||
@@ -37,7 +38,8 @@ class JournalEntry(AccountsController):
|
||||
self.validate_credit_debit_note()
|
||||
self.validate_empty_accounts_table()
|
||||
self.set_account_and_party_balance()
|
||||
self.set_title()
|
||||
if not self.title:
|
||||
self.title = self.get_title()
|
||||
|
||||
def on_submit(self):
|
||||
self.check_credit_limit()
|
||||
@@ -45,8 +47,8 @@ class JournalEntry(AccountsController):
|
||||
self.update_advance_paid()
|
||||
self.update_expense_claim()
|
||||
|
||||
def set_title(self):
|
||||
self.title = self.pay_to_recd_from or self.accounts[0].account
|
||||
def get_title(self):
|
||||
return self.pay_to_recd_from or self.accounts[0].account
|
||||
|
||||
def update_advance_paid(self):
|
||||
advance_paid = frappe._dict()
|
||||
@@ -103,6 +105,12 @@ class JournalEntry(AccountsController):
|
||||
elif d.reference_type in ("Sales Order", "Purchase Order") and d.is_advance != "Yes":
|
||||
frappe.throw(_("Row {0}: Payment against Sales/Purchase Order should always be marked as advance").format(d.idx))
|
||||
|
||||
if d.is_advance == "Yes":
|
||||
if d.party_type == 'Customer' and flt(d.debit) > 0:
|
||||
frappe.throw(_("Row {0}: Advance against Customer must be credit").format(d.idx))
|
||||
elif d.party_type == 'Supplier' and flt(d.credit) > 0:
|
||||
frappe.throw(_("Row {0}: Advance against Supplier must be debit").format(d.idx))
|
||||
|
||||
def validate_against_jv(self):
|
||||
for d in self.get('accounts'):
|
||||
if d.reference_type=="Journal Entry":
|
||||
@@ -119,7 +127,7 @@ class JournalEntry(AccountsController):
|
||||
|
||||
against_entries = frappe.db.sql("""select * from `tabJournal Entry Account`
|
||||
where account = %s and docstatus = 1 and parent = %s
|
||||
and ifnull(reference_type, '') in ("", "Sales Order", "Purchase Order")
|
||||
and (reference_type is null or reference_type in ("", "Sales Order", "Purchase Order"))
|
||||
""", (d.account, d.reference_name), as_dict=True)
|
||||
|
||||
if not against_entries:
|
||||
@@ -146,7 +154,7 @@ class JournalEntry(AccountsController):
|
||||
|
||||
self.reference_totals = {}
|
||||
self.reference_types = {}
|
||||
self.reference_parties = {}
|
||||
self.reference_accounts = {}
|
||||
|
||||
for d in self.get("accounts"):
|
||||
if not d.reference_type:
|
||||
@@ -169,12 +177,14 @@ class JournalEntry(AccountsController):
|
||||
self.reference_totals[d.reference_name] = 0.0
|
||||
self.reference_totals[d.reference_name] += flt(d.get(dr_or_cr))
|
||||
self.reference_types[d.reference_name] = d.reference_type
|
||||
if d.party_type and d.party:
|
||||
self.reference_parties[d.reference_name] = [d.party_type, d.party]
|
||||
self.reference_accounts[d.reference_name] = d.account
|
||||
|
||||
against_voucher = frappe.db.get_value(d.reference_type, d.reference_name,
|
||||
[scrub(dt) for dt in field_dict.get(d.reference_type)])
|
||||
|
||||
if not against_voucher:
|
||||
frappe.throw(_("Row {0}: Invalid reference {1}").format(d.idx, d.reference_name))
|
||||
|
||||
# check if party and account match
|
||||
if d.reference_type in ("Sales Invoice", "Purchase Invoice"):
|
||||
if (against_voucher[0] != d.party or against_voucher[1] != d.account):
|
||||
@@ -196,12 +206,10 @@ class JournalEntry(AccountsController):
|
||||
"""Validate totals, stopped and docstatus for orders"""
|
||||
for reference_name, total in self.reference_totals.iteritems():
|
||||
reference_type = self.reference_types[reference_name]
|
||||
party_type, party = self.reference_parties.get(reference_name)
|
||||
account = self.reference_accounts[reference_name]
|
||||
|
||||
if reference_type in ("Sales Order", "Purchase Order"):
|
||||
order = frappe.db.get_value(reference_type, reference_name,
|
||||
["docstatus", "per_billed", "status", "advance_paid",
|
||||
"base_grand_total", "grand_total", "currency"], as_dict=1)
|
||||
order = frappe.get_doc(reference_type, reference_name)
|
||||
|
||||
if order.docstatus != 1:
|
||||
frappe.throw(_("{0} {1} is not submitted").format(reference_type, reference_name))
|
||||
@@ -212,15 +220,19 @@ class JournalEntry(AccountsController):
|
||||
if cstr(order.status) == "Stopped":
|
||||
frappe.throw(_("{0} {1} is stopped").format(reference_type, reference_name))
|
||||
|
||||
party_account_currency = frappe.db.get_value(party_type, party, "party_account_currency")
|
||||
if party_account_currency == self.company_currency:
|
||||
account_currency = get_account_currency(account)
|
||||
if account_currency == self.company_currency:
|
||||
voucher_total = order.base_grand_total
|
||||
formatted_voucher_total = fmt_money(voucher_total, order.precision("base_grand_total"),
|
||||
currency=account_currency)
|
||||
else:
|
||||
voucher_total = order.grand_total
|
||||
formatted_voucher_total = fmt_money(voucher_total, order.precision("grand_total"),
|
||||
currency=account_currency)
|
||||
|
||||
if flt(voucher_total) < (flt(order.advance_paid) + total):
|
||||
frappe.throw(_("Advance paid against {0} {1} cannot be greater \
|
||||
than Grand Total {2}").format(reference_type, reference_name, voucher_total))
|
||||
than Grand Total {2}").format(reference_type, reference_name, formatted_voucher_total))
|
||||
|
||||
def validate_invoices(self):
|
||||
"""Validate totals and docstatus for invoices"""
|
||||
@@ -248,7 +260,13 @@ class JournalEntry(AccountsController):
|
||||
if flt(d.debit > 0): d.against_account = ", ".join(list(set(accounts_credited)))
|
||||
if flt(d.credit > 0): d.against_account = ", ".join(list(set(accounts_debited)))
|
||||
|
||||
def validate_debit_and_credit(self):
|
||||
def validate_total_debit_and_credit(self):
|
||||
self.set_total_debit_credit()
|
||||
if self.difference:
|
||||
frappe.throw(_("Total Debit must be equal to Total Credit. The difference is {0}")
|
||||
.format(self.difference))
|
||||
|
||||
def set_total_debit_credit(self):
|
||||
self.total_debit, self.total_credit, self.difference = 0, 0, 0
|
||||
for d in self.get("accounts"):
|
||||
if d.debit and d.credit:
|
||||
@@ -260,38 +278,39 @@ class JournalEntry(AccountsController):
|
||||
self.difference = flt(self.total_debit, self.precision("total_debit")) - \
|
||||
flt(self.total_credit, self.precision("total_credit"))
|
||||
|
||||
if self.difference:
|
||||
frappe.throw(_("Total Debit must be equal to Total Credit. The difference is {0}")
|
||||
.format(self.difference))
|
||||
|
||||
def validate_multi_currency(self):
|
||||
alternate_currency = []
|
||||
for d in self.get("accounts"):
|
||||
account = frappe.db.get_value("Account", d.account, ["account_currency", "account_type"], as_dict=1)
|
||||
d.account_currency = account.account_currency or self.company_currency
|
||||
d.account_type = account.account_type
|
||||
if account:
|
||||
d.account_currency = account.account_currency
|
||||
d.account_type = account.account_type
|
||||
|
||||
if d.account_currency!=self.company_currency and d.account_currency not in alternate_currency:
|
||||
if not d.account_currency:
|
||||
d.account_currency = self.company_currency
|
||||
|
||||
if d.account_currency != self.company_currency and d.account_currency not in alternate_currency:
|
||||
alternate_currency.append(d.account_currency)
|
||||
|
||||
if alternate_currency:
|
||||
if not self.multi_currency:
|
||||
frappe.throw(_("Please check Multi Currency option to allow accounts with other currency"))
|
||||
|
||||
if len(alternate_currency) > 1:
|
||||
frappe.throw(_("Only one alternate currency can be used in a single Journal Entry"))
|
||||
|
||||
self.set_exchange_rate()
|
||||
|
||||
def set_amounts_in_company_currency(self):
|
||||
for d in self.get("accounts"):
|
||||
d.debit = flt(flt(d.debit_in_account_currency)*flt(d.exchange_rate), d.precision("debit"))
|
||||
d.credit = flt(flt(d.credit_in_account_currency)*flt(d.exchange_rate), d.precision("credit"))
|
||||
d.debit_in_account_currency = flt(d.debit_in_account_currency, d.precision("debit_in_account_currency"))
|
||||
d.credit_in_account_currency = flt(d.credit_in_account_currency, d.precision("credit_in_account_currency"))
|
||||
|
||||
d.debit = flt(d.debit_in_account_currency * flt(d.exchange_rate), d.precision("debit"))
|
||||
d.credit = flt(d.credit_in_account_currency * flt(d.exchange_rate), d.precision("credit"))
|
||||
|
||||
def set_exchange_rate(self):
|
||||
for d in self.get("accounts"):
|
||||
if d.account_currency == self.company_currency:
|
||||
d.exchange_rate = 1
|
||||
elif not d.exchange_rate or d.account_type=="Bank" or \
|
||||
elif not d.exchange_rate or d.exchange_rate == 1 or \
|
||||
(d.reference_type in ("Sales Invoice", "Purchase Invoice") and d.reference_name):
|
||||
d.exchange_rate = get_exchange_rate(d.account, d.account_currency, self.company,
|
||||
d.reference_type, d.reference_name, d.debit, d.credit, d.exchange_rate)
|
||||
@@ -335,20 +354,28 @@ class JournalEntry(AccountsController):
|
||||
self.remark = ("\n").join(r) #User Remarks is not mandatory
|
||||
|
||||
def set_print_format_fields(self):
|
||||
total_amount = 0.0
|
||||
bank_account_currency = None
|
||||
self.pay_to_recd_from = None
|
||||
for d in self.get('accounts'):
|
||||
if d.party_type and d.party:
|
||||
if not self.pay_to_recd_from:
|
||||
self.pay_to_recd_from = frappe.db.get_value(d.party_type, d.party,
|
||||
"customer_name" if d.party_type=="Customer" else "supplier_name")
|
||||
|
||||
self.set_total_amount(d.debit or d.credit)
|
||||
elif frappe.db.get_value("Account", d.account, "account_type") in ["Bank", "Cash"]:
|
||||
self.set_total_amount(d.debit or d.credit)
|
||||
total_amount += (d.debit_in_account_currency or d.credit_in_account_currency)
|
||||
bank_account_currency = d.account_currency
|
||||
|
||||
def set_total_amount(self, amt):
|
||||
if not self.pay_to_recd_from:
|
||||
total_amount = 0
|
||||
|
||||
self.set_total_amount(total_amount, bank_account_currency)
|
||||
|
||||
def set_total_amount(self, amt, currency):
|
||||
self.total_amount = amt
|
||||
from frappe.utils import money_in_words
|
||||
self.total_amount_in_words = money_in_words(amt, self.company_currency)
|
||||
self.total_amount_in_words = money_in_words(amt, currency)
|
||||
|
||||
def make_gl_entries(self, cancel=0, adv_adj=0):
|
||||
from erpnext.accounts.general_ledger import make_gl_entries
|
||||
@@ -402,7 +429,7 @@ class JournalEntry(AccountsController):
|
||||
blank_row.debit_in_account_currency = abs(diff)
|
||||
blank_row.debit = abs(diff)
|
||||
|
||||
self.validate_debit_and_credit()
|
||||
self.validate_total_debit_and_credit()
|
||||
|
||||
def get_outstanding_invoices(self):
|
||||
self.set('accounts', [])
|
||||
@@ -430,7 +457,7 @@ class JournalEntry(AccountsController):
|
||||
elif self.write_off_based_on == 'Accounts Payable':
|
||||
jd2.credit = total
|
||||
|
||||
self.validate_debit_and_credit()
|
||||
self.validate_total_debit_and_credit()
|
||||
|
||||
|
||||
def get_values(self):
|
||||
@@ -490,7 +517,7 @@ class JournalEntry(AccountsController):
|
||||
d.party_balance = party_balance[(d.party_type, d.party)]
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_default_bank_cash_account(company, voucher_type, mode_of_payment=None):
|
||||
def get_default_bank_cash_account(company, voucher_type, mode_of_payment=None, account=None):
|
||||
from erpnext.accounts.doctype.sales_invoice.sales_invoice import get_bank_cash_account
|
||||
if mode_of_payment:
|
||||
account = get_bank_cash_account(mode_of_payment, company)
|
||||
@@ -498,17 +525,22 @@ def get_default_bank_cash_account(company, voucher_type, mode_of_payment=None):
|
||||
account.update({"balance": get_balance_on(account.get("account"))})
|
||||
return account
|
||||
|
||||
if voucher_type=="Bank Entry":
|
||||
account = frappe.db.get_value("Company", company, "default_bank_account")
|
||||
if not account:
|
||||
account = frappe.db.get_value("Account", {"company": company, "account_type": "Bank", "is_group": 0})
|
||||
elif voucher_type=="Cash Entry":
|
||||
account = frappe.db.get_value("Company", company, "default_cash_account")
|
||||
if not account:
|
||||
account = frappe.db.get_value("Account", {"company": company, "account_type": "Cash", "is_group": 0})
|
||||
if not account:
|
||||
if voucher_type=="Bank Entry":
|
||||
account = frappe.db.get_value("Company", company, "default_bank_account")
|
||||
if not account:
|
||||
account = frappe.db.get_value("Account",
|
||||
{"company": company, "account_type": "Bank", "is_group": 0})
|
||||
|
||||
elif voucher_type=="Cash Entry":
|
||||
account = frappe.db.get_value("Company", company, "default_cash_account")
|
||||
if not account:
|
||||
account = frappe.db.get_value("Account",
|
||||
{"company": company, "account_type": "Cash", "is_group": 0})
|
||||
|
||||
if account:
|
||||
account_details = frappe.db.get_value("Account", account, ["account_currency", "account_type"], as_dict=1)
|
||||
account_details = frappe.db.get_value("Account", account,
|
||||
["account_currency", "account_type"], as_dict=1)
|
||||
return {
|
||||
"account": account,
|
||||
"balance": get_balance_on(account),
|
||||
@@ -517,206 +549,131 @@ def get_default_bank_cash_account(company, voucher_type, mode_of_payment=None):
|
||||
}
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_payment_entry_from_sales_invoice(sales_invoice):
|
||||
"""Returns new Journal Entry document as dict for given Sales Invoice"""
|
||||
from erpnext.accounts.utils import get_balance_on
|
||||
si = frappe.get_doc("Sales Invoice", sales_invoice)
|
||||
def get_payment_entry_against_order(dt, dn, amount=None, journal_entry=False, bank_account=None):
|
||||
ref_doc = frappe.get_doc(dt, dn)
|
||||
|
||||
# exchange rate
|
||||
exchange_rate = get_exchange_rate(si.debit_to, si.party_account_currency, si.company,
|
||||
si.doctype, si.name)
|
||||
if flt(ref_doc.per_billed, 2) > 0:
|
||||
frappe.throw(_("Can only make payment against unbilled {0}").format(dt))
|
||||
|
||||
jv = get_payment_entry(si)
|
||||
jv.remark = 'Payment received against Sales Invoice {0}. {1}'.format(si.name, si.remarks)
|
||||
|
||||
# credit customer
|
||||
row1 = jv.get("accounts")[0]
|
||||
row1.account = si.debit_to
|
||||
row1.account_currency = si.party_account_currency
|
||||
row1.party_type = "Customer"
|
||||
row1.party = si.customer
|
||||
row1.balance = get_balance_on(si.debit_to)
|
||||
row1.party_balance = get_balance_on(party=si.customer, party_type="Customer")
|
||||
row1.credit_in_account_currency = si.outstanding_amount
|
||||
row1.reference_type = si.doctype
|
||||
row1.reference_name = si.name
|
||||
row1.exchange_rate = exchange_rate
|
||||
row1.account_type = "Receivable" if si.customer else ""
|
||||
|
||||
# debit bank
|
||||
row2 = jv.get("accounts")[1]
|
||||
if row2.account_currency == si.party_account_currency:
|
||||
row2.debit_in_account_currency = si.outstanding_amount
|
||||
if dt == "Sales Order":
|
||||
party_type = "Customer"
|
||||
amount_field_party = "credit_in_account_currency"
|
||||
amount_field_bank = "debit_in_account_currency"
|
||||
else:
|
||||
row2.debit_in_account_currency = si.outstanding_amount * exchange_rate
|
||||
party_type = "Supplier"
|
||||
amount_field_party = "debit_in_account_currency"
|
||||
amount_field_bank = "credit_in_account_currency"
|
||||
|
||||
# set multi currency check
|
||||
if row1.account_currency != si.company_currency or row2.account_currency != si.company_currency:
|
||||
jv.multi_currency = 1
|
||||
party_account = get_party_account(party_type, ref_doc.get(party_type.lower()), ref_doc.company)
|
||||
party_account_currency = get_account_currency(party_account)
|
||||
|
||||
return jv.as_dict()
|
||||
if not amount:
|
||||
if party_account_currency == ref_doc.company_currency:
|
||||
amount = flt(ref_doc.base_grand_total) - flt(ref_doc.advance_paid)
|
||||
else:
|
||||
amount = flt(ref_doc.grand_total) - flt(ref_doc.advance_paid)
|
||||
|
||||
return get_payment_entry(ref_doc, {
|
||||
"party_type": party_type,
|
||||
"party_account": party_account,
|
||||
"party_account_currency": party_account_currency,
|
||||
"amount_field_party": amount_field_party,
|
||||
"amount_field_bank": amount_field_bank,
|
||||
"amount": amount,
|
||||
"remarks": 'Advance Payment received against {0} {1}'.format(dt, dn),
|
||||
"is_advance": "Yes",
|
||||
"bank_account": bank_account,
|
||||
"journal_entry": journal_entry
|
||||
})
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_payment_entry_from_purchase_invoice(purchase_invoice):
|
||||
"""Returns new Journal Entry document as dict for given Purchase Invoice"""
|
||||
pi = frappe.get_doc("Purchase Invoice", purchase_invoice)
|
||||
|
||||
exchange_rate = get_exchange_rate(pi.credit_to, pi.party_account_currency, pi.company,
|
||||
pi.doctype, pi.name)
|
||||
|
||||
jv = get_payment_entry(pi)
|
||||
jv.remark = 'Payment against Purchase Invoice {0}. {1}'.format(pi.name, pi.remarks)
|
||||
jv.exchange_rate = exchange_rate
|
||||
|
||||
# credit supplier
|
||||
row1 = jv.get("accounts")[0]
|
||||
row1.account = pi.credit_to
|
||||
row1.account_currency = pi.party_account_currency
|
||||
row1.party_type = "Supplier"
|
||||
row1.party = pi.supplier
|
||||
row1.balance = get_balance_on(pi.credit_to)
|
||||
row1.party_balance = get_balance_on(party=pi.supplier, party_type="Supplier")
|
||||
row1.debit_in_account_currency = pi.outstanding_amount
|
||||
row1.reference_type = pi.doctype
|
||||
row1.reference_name = pi.name
|
||||
row1.exchange_rate = exchange_rate
|
||||
row1.account_type = "Payable" if pi.supplier else ""
|
||||
|
||||
# credit bank
|
||||
row2 = jv.get("accounts")[1]
|
||||
if row2.account_currency == pi.party_account_currency:
|
||||
row2.credit_in_account_currency = pi.outstanding_amount
|
||||
def get_payment_entry_against_invoice(dt, dn, amount=None, journal_entry=False, bank_account=None):
|
||||
ref_doc = frappe.get_doc(dt, dn)
|
||||
if dt == "Sales Invoice":
|
||||
party_type = "Customer"
|
||||
party_account = ref_doc.debit_to
|
||||
else:
|
||||
row2.credit_in_account_currency = pi.outstanding_amount * exchange_rate
|
||||
party_type = "Supplier"
|
||||
party_account = ref_doc.credit_to
|
||||
|
||||
# set multi currency check
|
||||
if row1.account_currency != pi.company_currency or row2.account_currency != pi.company_currency:
|
||||
jv.multi_currency = 1
|
||||
|
||||
return jv.as_dict()
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_payment_entry_from_sales_order(sales_order):
|
||||
"""Returns new Journal Entry document as dict for given Sales Order"""
|
||||
from erpnext.accounts.utils import get_balance_on
|
||||
from erpnext.accounts.party import get_party_account
|
||||
|
||||
so = frappe.get_doc("Sales Order", sales_order)
|
||||
|
||||
if flt(so.per_billed, 2) != 0.0:
|
||||
frappe.throw(_("Can only make payment against unbilled Sales Order"))
|
||||
|
||||
jv = get_payment_entry(so)
|
||||
jv.remark = 'Advance payment received against Sales Order {0}.'.format(so.name)
|
||||
|
||||
party_account = get_party_account(so.company, so.customer, "Customer")
|
||||
party_account_currency = frappe.db.get_value("Account", party_account, "account_currency")
|
||||
|
||||
exchange_rate = get_exchange_rate(party_account, party_account_currency, so.company)
|
||||
|
||||
if party_account_currency == so.company_currency:
|
||||
amount = flt(so.base_grand_total) - flt(so.advance_paid)
|
||||
if (dt=="Sales Invoice" and ref_doc.outstanding_amount > 0) \
|
||||
or (dt=="Purchase Invoice" and ref_doc.outstanding_amount < 0):
|
||||
amount_field_party = "credit_in_account_currency"
|
||||
amount_field_bank = "debit_in_account_currency"
|
||||
else:
|
||||
amount = flt(so.grand_total) - flt(so.advance_paid)
|
||||
amount_field_party = "debit_in_account_currency"
|
||||
amount_field_bank = "credit_in_account_currency"
|
||||
|
||||
# credit customer
|
||||
row1 = jv.get("accounts")[0]
|
||||
row1.account = party_account
|
||||
row1.account_currency = party_account_currency
|
||||
row1.party_type = "Customer"
|
||||
row1.party = so.customer
|
||||
row1.balance = get_balance_on(party_account)
|
||||
row1.party_balance = get_balance_on(party=so.customer, party_type="Customer")
|
||||
row1.credit_in_account_currency = amount
|
||||
row1.reference_type = so.doctype
|
||||
row1.reference_name = so.name
|
||||
row1.is_advance = "Yes"
|
||||
row1.exchange_rate = exchange_rate
|
||||
row1.account_type = "Receivable"
|
||||
return get_payment_entry(ref_doc, {
|
||||
"party_type": party_type,
|
||||
"party_account": party_account,
|
||||
"party_account_currency": ref_doc.party_account_currency,
|
||||
"amount_field_party": amount_field_party,
|
||||
"amount_field_bank": amount_field_bank,
|
||||
"amount": amount if amount else abs(ref_doc.outstanding_amount),
|
||||
"remarks": 'Payment received against {0} {1}. {2}'.format(dt, dn, ref_doc.remarks),
|
||||
"is_advance": "No",
|
||||
"bank_account": bank_account,
|
||||
"journal_entry": journal_entry
|
||||
})
|
||||
|
||||
# debit bank
|
||||
row2 = jv.get("accounts")[1]
|
||||
if row2.account_currency == party_account_currency:
|
||||
row2.debit_in_account_currency = amount
|
||||
else:
|
||||
row2.debit_in_account_currency = amount * exchange_rate
|
||||
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"):
|
||||
exchange_rate = get_exchange_rate(args.get("party_account"), args.get("party_account_currency"),
|
||||
ref_doc.company, ref_doc.doctype, ref_doc.name)
|
||||
|
||||
# set multi currency check
|
||||
if row1.account_currency != so.company_currency or row2.account_currency != so.company_currency:
|
||||
jv.multi_currency = 1
|
||||
je = frappe.new_doc("Journal Entry")
|
||||
je.update({
|
||||
"voucher_type": "Bank Entry",
|
||||
"company": ref_doc.company,
|
||||
"remark": args.get("remarks")
|
||||
})
|
||||
|
||||
return jv.as_dict()
|
||||
party_row = je.append("accounts", {
|
||||
"account": args.get("party_account"),
|
||||
"party_type": args.get("party_type"),
|
||||
"party": ref_doc.get(args.get("party_type").lower()),
|
||||
"cost_center": cost_center,
|
||||
"account_type": frappe.db.get_value("Account", args.get("party_account"), "account_type"),
|
||||
"account_currency": args.get("party_account_currency") or \
|
||||
get_account_currency(args.get("party_account")),
|
||||
"balance": get_balance_on(args.get("party_account")),
|
||||
"party_balance": get_balance_on(party=args.get("party"), party_type=args.get("party_type")),
|
||||
"exchange_rate": exchange_rate,
|
||||
args.get("amount_field_party"): args.get("amount"),
|
||||
"is_advance": args.get("is_advance"),
|
||||
"reference_type": ref_doc.doctype,
|
||||
"reference_name": ref_doc.name
|
||||
})
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_payment_entry_from_purchase_order(purchase_order):
|
||||
"""Returns new Journal Entry document as dict for given Sales Order"""
|
||||
from erpnext.accounts.utils import get_balance_on
|
||||
from erpnext.accounts.party import get_party_account
|
||||
po = frappe.get_doc("Purchase Order", purchase_order)
|
||||
|
||||
if flt(po.per_billed, 2) != 0.0:
|
||||
frappe.throw(_("Can only make payment against unbilled Sales Order"))
|
||||
|
||||
jv = get_payment_entry(po)
|
||||
jv.remark = 'Advance payment made against Purchase Order {0}.'.format(po.name)
|
||||
|
||||
party_account = get_party_account(po.company, po.supplier, "Supplier")
|
||||
party_account_currency = frappe.db.get_value("Account", party_account, "account_currency")
|
||||
|
||||
exchange_rate = get_exchange_rate(party_account, party_account_currency, po.company)
|
||||
|
||||
if party_account_currency == po.company_currency:
|
||||
amount = flt(po.base_grand_total) - flt(po.advance_paid)
|
||||
else:
|
||||
amount = flt(po.grand_total) - flt(po.advance_paid)
|
||||
|
||||
# credit customer
|
||||
row1 = jv.get("accounts")[0]
|
||||
row1.account = party_account
|
||||
row1.party_type = "Supplier"
|
||||
row1.party = po.supplier
|
||||
row1.balance = get_balance_on(party_account)
|
||||
row1.party_balance = get_balance_on(party=po.supplier, party_type="Supplier")
|
||||
row1.debit_in_account_currency = amount
|
||||
row1.reference_type = po.doctype
|
||||
row1.reference_name = po.name
|
||||
row1.is_advance = "Yes"
|
||||
row1.exchange_rate = exchange_rate
|
||||
row1.account_type = "Payable"
|
||||
|
||||
# debit bank
|
||||
row2 = jv.get("accounts")[1]
|
||||
if row2.account_currency == party_account_currency:
|
||||
row2.credit_in_account_currency = amount
|
||||
else:
|
||||
row2.credit_in_account_currency = amount * exchange_rate
|
||||
|
||||
# set multi currency check
|
||||
if row1.account_currency != po.company_currency or row2.account_currency != po.company_currency:
|
||||
jv.multi_currency = 1
|
||||
|
||||
return jv.as_dict()
|
||||
|
||||
def get_payment_entry(doc):
|
||||
bank_account = get_default_bank_cash_account(doc.company, "Bank Entry")
|
||||
|
||||
jv = frappe.new_doc('Journal Entry')
|
||||
jv.voucher_type = 'Bank Entry'
|
||||
jv.company = doc.company
|
||||
jv.fiscal_year = doc.fiscal_year
|
||||
|
||||
jv.append("accounts")
|
||||
d2 = jv.append("accounts")
|
||||
bank_row = je.append("accounts")
|
||||
|
||||
#make it bank_details
|
||||
bank_account = get_default_bank_cash_account(ref_doc.company, "Bank Entry", account=args.get("bank_account"))
|
||||
if bank_account:
|
||||
d2.account = bank_account["account"]
|
||||
d2.balance = bank_account["balance"]
|
||||
d2.account_currency = bank_account["account_currency"]
|
||||
d2.account_type = bank_account["account_type"]
|
||||
d2.exchange_rate = get_exchange_rate(bank_account["account"],
|
||||
bank_account["account_currency"], doc.company)
|
||||
bank_row.update(bank_account)
|
||||
bank_row.exchange_rate = get_exchange_rate(bank_account["account"],
|
||||
bank_account["account_currency"], ref_doc.company)
|
||||
|
||||
return jv
|
||||
bank_row.cost_center = cost_center
|
||||
|
||||
if bank_row.account_currency == args.get("party_account_currency"):
|
||||
bank_row.set(args.get("amount_field_bank"), args.get("amount"))
|
||||
else:
|
||||
bank_row.set(args.get("amount_field_bank"), args.get("amount") * exchange_rate)
|
||||
|
||||
# set multi currency check
|
||||
if party_row.account_currency != ref_doc.company_currency \
|
||||
or (bank_row.account_currency and bank_row.account_currency != ref_doc.company_currency):
|
||||
je.multi_currency = 1
|
||||
|
||||
je.set_amounts_in_company_currency()
|
||||
je.set_total_debit_credit()
|
||||
|
||||
return je if args.get("journal_entry") else je.as_dict()
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_opening_accounts(company):
|
||||
@@ -731,24 +688,27 @@ def get_against_jv(doctype, txt, searchfield, start, page_len, filters):
|
||||
return frappe.db.sql("""select jv.name, jv.posting_date, jv.user_remark
|
||||
from `tabJournal Entry` jv, `tabJournal Entry Account` jv_detail
|
||||
where jv_detail.parent = jv.name and jv_detail.account = %s and ifnull(jv_detail.party, '') = %s
|
||||
and ifnull(jv_detail.reference_type, '') = ''
|
||||
and jv.docstatus = 1 and jv.{0} like %s order by jv.name desc limit %s, %s""".format(searchfield),
|
||||
and (jv_detail.reference_type is null or jv_detail.reference_type = '')
|
||||
and jv.docstatus = 1 and jv.`{0}` like %s order by jv.name desc limit %s, %s""".format(frappe.db.escape(searchfield)),
|
||||
(filters.get("account"), cstr(filters.get("party")), "%{0}%".format(txt), start, page_len))
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_outstanding(args):
|
||||
if not frappe.has_permission("Account"):
|
||||
frappe.msgprint(_("No Permission"), raise_exception=1)
|
||||
args = eval(args)
|
||||
|
||||
if isinstance(args, basestring):
|
||||
args = json.loads(args)
|
||||
|
||||
company_currency = get_company_currency(args.get("company"))
|
||||
|
||||
if args.get("doctype") == "Journal Entry":
|
||||
condition = " and party=%(party)s" if args.get("party") else ""
|
||||
|
||||
against_jv_amount = frappe.db.sql("""
|
||||
select sum(ifnull(debit_in_account_currency, 0)) - sum(ifnull(credit_in_account_currency, 0))
|
||||
select sum(debit_in_account_currency) - sum(credit_in_account_currency)
|
||||
from `tabJournal Entry Account` where parent=%(docname)s and account=%(account)s {0}
|
||||
and ifnull(reference_type, '')=''""".format(condition), args)
|
||||
and (reference_type is null or reference_type = '')""".format(condition), args)
|
||||
|
||||
against_jv_amount = flt(against_jv_amount[0][0]) if against_jv_amount else 0
|
||||
amount_field = "credit_in_account_currency" if against_jv_amount > 0 else "debit_in_account_currency"
|
||||
@@ -778,8 +738,7 @@ def get_party_account_and_balance(company, party_type, party):
|
||||
if not frappe.has_permission("Account"):
|
||||
frappe.msgprint(_("No Permission"), raise_exception=1)
|
||||
|
||||
from erpnext.accounts.party import get_party_account
|
||||
account = get_party_account(company, party, party_type)
|
||||
account = get_party_account(party_type, party, company)
|
||||
|
||||
account_balance = get_balance_on(account=account)
|
||||
party_balance = get_balance_on(party_type=party_type, party=party)
|
||||
@@ -814,29 +773,48 @@ def get_account_balance_and_party_type(account, date, company, debit=None, credi
|
||||
"exchange_rate": get_exchange_rate(account, account_details.account_currency,
|
||||
company, debit=debit, credit=credit, exchange_rate=exchange_rate)
|
||||
}
|
||||
|
||||
# un-set party if not party type
|
||||
if not party_type:
|
||||
grid_values["party"] = ""
|
||||
|
||||
return grid_values
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_exchange_rate(account, account_currency, company,
|
||||
def get_exchange_rate(account, 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,
|
||||
["account_type", "root_type", "account_currency", "company"], as_dict=1)
|
||||
|
||||
if not account_details:
|
||||
frappe.throw(_("Please select correct account"))
|
||||
|
||||
if not company:
|
||||
company = account_details.company
|
||||
|
||||
if not account_currency:
|
||||
account_currency = account_details.account_currency
|
||||
|
||||
company_currency = get_company_currency(company)
|
||||
account_details = frappe.db.get_value("Account", account, ["account_type", "root_type"], as_dict=1)
|
||||
|
||||
if account_currency != company_currency:
|
||||
if reference_type in ("Sales Invoice", "Purchase Invoice") and reference_name:
|
||||
if reference_type and reference_name and frappe.get_meta(reference_type).get_field("conversion_rate"):
|
||||
exchange_rate = frappe.db.get_value(reference_type, reference_name, "conversion_rate")
|
||||
elif account_details.account_type == "Bank" and \
|
||||
|
||||
elif account_details and account_details.account_type == "Bank" and \
|
||||
((account_details.root_type == "Asset" and flt(credit) > 0) or
|
||||
(account_details.root_type == "Liability" and debit)):
|
||||
exchange_rate = get_average_exchange_rate(account)
|
||||
|
||||
if not exchange_rate:
|
||||
if not exchange_rate and account_currency:
|
||||
exchange_rate = get_exchange_rate(account_currency, company_currency)
|
||||
|
||||
else:
|
||||
exchange_rate = 1
|
||||
|
||||
return exchange_rate
|
||||
# don't return None or 0 as it is multipled with a value and that value could be lost
|
||||
return exchange_rate or 1
|
||||
|
||||
def get_average_exchange_rate(account):
|
||||
exchange_rate = 0
|
||||
|
||||
@@ -5,6 +5,7 @@ from __future__ import unicode_literals
|
||||
import unittest, frappe
|
||||
from frappe.utils import flt
|
||||
from erpnext.accounts.utils import get_actual_expense, BudgetError, get_fiscal_year
|
||||
from erpnext.exceptions import InvalidAccountCurrency
|
||||
|
||||
|
||||
class TestJournalEntry(unittest.TestCase):
|
||||
@@ -166,15 +167,15 @@ class TestJournalEntry(unittest.TestCase):
|
||||
existing_expense = self.get_actual_expense(posting_date)
|
||||
make_journal_entry("_Test Account Cost for Goods Sold - _TC",
|
||||
"_Test Bank - _TC", -existing_expense, "_Test Cost Center - _TC", submit=True)
|
||||
|
||||
|
||||
def test_multi_currency(self):
|
||||
jv = make_journal_entry("_Test Bank USD - _TC",
|
||||
"_Test Bank - _TC", 100, exchange_rate=50, save=False)
|
||||
|
||||
|
||||
jv.get("accounts")[1].credit_in_account_currency = 5000
|
||||
jv.submit()
|
||||
|
||||
gl_entries = frappe.db.sql("""select account, account_currency, debit, credit,
|
||||
|
||||
gl_entries = frappe.db.sql("""select account, account_currency, debit, credit,
|
||||
debit_in_account_currency, credit_in_account_currency
|
||||
from `tabGL Entry` where voucher_type='Journal Entry' and voucher_no=%s
|
||||
order by account asc""", jv.name, as_dict=1)
|
||||
@@ -197,12 +198,10 @@ class TestJournalEntry(unittest.TestCase):
|
||||
"credit_in_account_currency": 5000
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for field in ("account_currency", "debit", "debit_in_account_currency", "credit", "credit_in_account_currency"):
|
||||
for i, gle in enumerate(gl_entries):
|
||||
self.assertEquals(expected_values[gle.account][field], gle[field])
|
||||
|
||||
|
||||
|
||||
# cancel
|
||||
jv.cancel()
|
||||
@@ -212,6 +211,40 @@ class TestJournalEntry(unittest.TestCase):
|
||||
|
||||
self.assertFalse(gle)
|
||||
|
||||
def test_disallow_change_in_account_currency_for_a_party(self):
|
||||
# create jv in USD
|
||||
jv = make_journal_entry("_Test Bank USD - _TC",
|
||||
"_Test Receivable USD - _TC", 100, save=False)
|
||||
|
||||
jv.accounts[1].update({
|
||||
"party_type": "Customer",
|
||||
"party": "_Test Customer USD"
|
||||
})
|
||||
|
||||
jv.submit()
|
||||
|
||||
# create jv in USD, but account currency in INR
|
||||
jv = make_journal_entry("_Test Bank - _TC",
|
||||
"_Test Receivable - _TC", 100, save=False)
|
||||
|
||||
jv.accounts[1].update({
|
||||
"party_type": "Customer",
|
||||
"party": "_Test Customer USD"
|
||||
})
|
||||
|
||||
self.assertRaises(InvalidAccountCurrency, jv.submit)
|
||||
|
||||
# back in USD
|
||||
jv = make_journal_entry("_Test Bank USD - _TC",
|
||||
"_Test Receivable USD - _TC", 100, save=False)
|
||||
|
||||
jv.accounts[1].update({
|
||||
"party_type": "Customer",
|
||||
"party": "_Test Customer USD"
|
||||
})
|
||||
|
||||
jv.submit()
|
||||
|
||||
def make_journal_entry(account1, account2, amount, cost_center=None, exchange_rate=1, save=True, submit=False):
|
||||
jv = frappe.new_doc("Journal Entry")
|
||||
jv.posting_date = "2013-02-14"
|
||||
@@ -231,7 +264,7 @@ def make_journal_entry(account1, account2, amount, cost_center=None, exchange_ra
|
||||
"cost_center": cost_center,
|
||||
"credit_in_account_currency": amount if amount > 0 else 0,
|
||||
"debit_in_account_currency": abs(amount) if amount < 0 else 0,
|
||||
exchange_rate: exchange_rate
|
||||
"exchange_rate": exchange_rate
|
||||
}
|
||||
])
|
||||
if save or submit:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Mode of Payment",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "mode_of_payment",
|
||||
"oldfieldtype": "Data",
|
||||
@@ -43,6 +44,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Accounts",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Mode of Payment Account",
|
||||
"permlevel": 0,
|
||||
@@ -65,7 +67,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"modified": "2015-09-14 02:55:58.003800",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:50.335559",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Mode of Payment",
|
||||
|
||||
@@ -5,6 +5,24 @@ from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
from frappe.model.document import Document
|
||||
from frappe import _
|
||||
|
||||
class ModeofPayment(Document):
|
||||
pass
|
||||
def validate(self):
|
||||
self.validate_accounts()
|
||||
self.validate_repeating_companies()
|
||||
|
||||
def validate_repeating_companies(self):
|
||||
"""Error when Same Company is entered multiple times in accounts"""
|
||||
accounts_list = []
|
||||
for entry in self.accounts:
|
||||
accounts_list.append(entry.company)
|
||||
|
||||
if len(accounts_list)!= len(set(accounts_list)):
|
||||
frappe.throw(_("Same Company is entered more than once"))
|
||||
|
||||
def validate_accounts(self):
|
||||
for entry in self.accounts:
|
||||
"""Error when Company of Ledger account doesn't match with Company Selected"""
|
||||
if frappe.db.get_value("Account", entry.default_account, "company") != entry.company:
|
||||
frappe.throw(_("Account does not match with Company"))
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Company",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company",
|
||||
"permlevel": 0,
|
||||
@@ -43,6 +44,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Default Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Account",
|
||||
"permlevel": 0,
|
||||
@@ -63,7 +65,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"modified": "2015-01-06 17:26:57.053474",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:50.367895",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Mode of Payment Account",
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Distribution Name",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "distribution_id",
|
||||
"oldfieldtype": "Data",
|
||||
@@ -44,6 +45,7 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Fiscal Year",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "fiscal_year",
|
||||
"oldfieldtype": "Select",
|
||||
@@ -68,6 +70,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Monthly Distribution Percentages",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "budget_distribution_details",
|
||||
"oldfieldtype": "Table",
|
||||
@@ -91,7 +94,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"modified": "2015-02-05 05:11:41.429491",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:50.431735",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Monthly Distribution",
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Month",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "month",
|
||||
"oldfieldtype": "Data",
|
||||
@@ -42,6 +43,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Percentage Allocation",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "percentage_allocation",
|
||||
"oldfieldtype": "Currency",
|
||||
@@ -63,7 +65,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"modified": "2015-02-19 01:07:00.800015",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:50.468982",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Monthly Distribution Percentage",
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Company",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company",
|
||||
"permlevel": 0,
|
||||
@@ -41,6 +42,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -63,6 +65,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Account",
|
||||
"permlevel": 0,
|
||||
@@ -82,7 +85,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"modified": "2015-08-26 11:23:22.917738",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:51.450360",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Party Account",
|
||||
|
||||
118
erpnext/accounts/doctype/payment_gateway/payment_gateway.json
Normal file
118
erpnext/accounts/doctype/payment_gateway/payment_gateway.json
Normal file
@@ -0,0 +1,118 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"autoname": "field:gateway",
|
||||
"creation": "2015-12-15 22:26:45.221162",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"fields": [
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "gateway",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Gateway",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"in_create": 1,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-01-18 03:58:22.588834",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Gateway",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"amend": 0,
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Administrator",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 0,
|
||||
"create": 0,
|
||||
"delete": 0,
|
||||
"email": 0,
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 0,
|
||||
"read": 1,
|
||||
"report": 0,
|
||||
"role": "System Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 0,
|
||||
"submit": 0,
|
||||
"write": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 0,
|
||||
"create": 0,
|
||||
"delete": 0,
|
||||
"email": 0,
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 0,
|
||||
"read": 1,
|
||||
"report": 0,
|
||||
"role": "Accounts Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 0,
|
||||
"submit": 0,
|
||||
"write": 0
|
||||
}
|
||||
],
|
||||
"read_only": 1,
|
||||
"read_only_onload": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC"
|
||||
}
|
||||
10
erpnext/accounts/doctype/payment_gateway/payment_gateway.py
Normal file
10
erpnext/accounts/doctype/payment_gateway/payment_gateway.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class PaymentGateway(Document):
|
||||
pass
|
||||
@@ -0,0 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
# test_records = frappe.get_test_records('Payment Gateway')
|
||||
|
||||
class TestPaymentGateway(unittest.TestCase):
|
||||
pass
|
||||
@@ -0,0 +1,6 @@
|
||||
cur_frm.cscript.refresh = function(doc, dt, dn){
|
||||
if(!doc.__islocal){
|
||||
var df = frappe.meta.get_docfield(doc.doctype, "gateway", doc.name);
|
||||
df.read_only = 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"creation": "2015-12-23 21:31:52.699821",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"fields": [
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "gateway",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Payment Gateway",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Payment Gateway",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "is_default",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Is Default",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "column_break_4",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "payment_account",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Payment Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Account",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "currency",
|
||||
"fieldtype": "Read Only",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Currency",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "payment_account.account_currency",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "payment_request_message",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"default": "Please click on the link below to make your payment",
|
||||
"fieldname": "message",
|
||||
"fieldtype": "Text Editor",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Default Payment Request Message",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"default": "Click here to make a payment",
|
||||
"fieldname": "payment_url_message",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Payment URL Message",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "payment_success_url",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Payment Success URL",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"in_create": 0,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-01-18 03:53:50.534673",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Gateway Account",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"amend": 0,
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Administrator",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Accounts Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC"
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class PaymentGatewayAccount(Document):
|
||||
def autoname(self):
|
||||
self.name = self.gateway + " - " + self.currency
|
||||
|
||||
def validate(self):
|
||||
self.update_default_payment_gateway()
|
||||
self.set_as_default_if_not_set()
|
||||
|
||||
def update_default_payment_gateway(self):
|
||||
if self.is_default:
|
||||
frappe.db.sql("""update `tabPayment Gateway Account` set is_default = 0
|
||||
where is_default = 1 """)
|
||||
|
||||
def set_as_default_if_not_set(self):
|
||||
if not frappe.db.get_value("Payment Gateway Account", {"is_default": 1, "name": ("!=", self.name)}, "name"):
|
||||
self.is_default = 1
|
||||
@@ -0,0 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
# test_records = frappe.get_test_records('Payment Gateway Account')
|
||||
|
||||
class TestPaymentGatewayAccount(unittest.TestCase):
|
||||
pass
|
||||
@@ -47,6 +47,11 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext
|
||||
|
||||
refresh: function() {
|
||||
this.frm.disable_save();
|
||||
this.toggle_primary_action();
|
||||
},
|
||||
|
||||
onload_post_render: function() {
|
||||
this.toggle_primary_action();
|
||||
},
|
||||
|
||||
party: function() {
|
||||
@@ -74,21 +79,8 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext
|
||||
doc: me.frm.doc,
|
||||
method: 'get_unreconciled_entries',
|
||||
callback: function(r, rt) {
|
||||
var invoices = [];
|
||||
|
||||
$.each(me.frm.doc.invoices || [], function(i, row) {
|
||||
if (row.invoice_number && !inList(invoices, row.invoice_number))
|
||||
invoices.push(row.invoice_type + " | " + row.invoice_number);
|
||||
});
|
||||
|
||||
frappe.meta.get_docfield("Payment Reconciliation Payment", "invoice_number",
|
||||
me.frm.doc.name).options = invoices.join("\n");
|
||||
|
||||
$.each(me.frm.doc.payments || [], function(i, p) {
|
||||
if(!inList(invoices, cstr(p.invoice_number))) p.invoice_number = null;
|
||||
});
|
||||
|
||||
refresh_field("payments");
|
||||
me.set_invoice_options();
|
||||
me.toggle_primary_action();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -98,8 +90,44 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext
|
||||
var me = this;
|
||||
return this.frm.call({
|
||||
doc: me.frm.doc,
|
||||
method: 'reconcile'
|
||||
method: 'reconcile',
|
||||
callback: function(r, rt) {
|
||||
me.set_invoice_options();
|
||||
me.toggle_primary_action();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
set_invoice_options: function() {
|
||||
var invoices = [];
|
||||
|
||||
$.each(me.frm.doc.invoices || [], function(i, row) {
|
||||
if (row.invoice_number && !inList(invoices, row.invoice_number))
|
||||
invoices.push(row.invoice_type + " | " + row.invoice_number);
|
||||
});
|
||||
|
||||
frappe.meta.get_docfield("Payment Reconciliation Payment", "invoice_number",
|
||||
me.frm.doc.name).options = invoices.join("\n");
|
||||
|
||||
$.each(me.frm.doc.payments || [], function(i, p) {
|
||||
if(!inList(invoices, cstr(p.invoice_number))) p.invoice_number = null;
|
||||
});
|
||||
|
||||
refresh_field("payments");
|
||||
},
|
||||
|
||||
toggle_primary_action: function() {
|
||||
if ((this.frm.doc.payments || []).length) {
|
||||
this.frm.fields_dict.reconcile.$input
|
||||
&& this.frm.fields_dict.reconcile.$input.addClass("btn-primary");
|
||||
this.frm.fields_dict.get_unreconciled_entries.$input
|
||||
&& this.frm.fields_dict.get_unreconciled_entries.$input.removeClass("btn-primary");
|
||||
} else {
|
||||
this.frm.fields_dict.reconcile.$input
|
||||
&& this.frm.fields_dict.reconcile.$input.removeClass("btn-primary");
|
||||
this.frm.fields_dict.get_unreconciled_entries.$input
|
||||
&& this.frm.fields_dict.get_unreconciled_entries.$input.addClass("btn-primary");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -19,10 +19,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Company",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -41,10 +43,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Party Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "DocType",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -64,10 +68,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Party",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "party_type",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -86,11 +92,13 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Receivable / Payable Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Account",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -109,10 +117,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Bank / Cash Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Account",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -131,9 +141,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -151,10 +163,12 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "From Date",
|
||||
"label": "From Invoice Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -172,10 +186,12 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "To Date",
|
||||
"label": "To Invoice Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -193,10 +209,12 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Minimum Amount",
|
||||
"label": "Minimum Invoice Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -214,10 +232,12 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Maximum Amount",
|
||||
"label": "Maximum Invoice Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -236,9 +256,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Get Unreconciled Entries",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -257,9 +279,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Unreconciled Payment Details",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -278,10 +302,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Payments",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Payment Reconciliation Payment",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -300,9 +326,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Reconcile",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -321,9 +349,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Invoice/Journal Entry Details",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -342,10 +372,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Invoices",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Payment Reconciliation Invoice",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -357,12 +389,15 @@
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 1,
|
||||
"icon": "icon-resize-horizontal",
|
||||
"idx": 0,
|
||||
"in_create": 0,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 1,
|
||||
"istable": 0,
|
||||
"modified": "2015-09-21 03:41:24.672227",
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2016-01-04 02:26:58.807921",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Reconciliation",
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
from frappe.utils import flt
|
||||
|
||||
from frappe import msgprint, _
|
||||
|
||||
from frappe.model.document import Document
|
||||
from erpnext.accounts.utils import get_outstanding_invoices
|
||||
|
||||
class PaymentReconciliation(Document):
|
||||
def get_unreconciled_entries(self):
|
||||
@@ -17,9 +15,8 @@ class PaymentReconciliation(Document):
|
||||
|
||||
def get_jv_entries(self):
|
||||
self.check_mandatory_to_fetch()
|
||||
dr_or_cr = "credit" if self.party_type == "Customer" else "debit"
|
||||
|
||||
cond = self.check_condition(dr_or_cr)
|
||||
dr_or_cr = "credit_in_account_currency" if self.party_type == "Customer" \
|
||||
else "debit_in_account_currency"
|
||||
|
||||
bank_account_condition = "t2.against_account like %(bank_cash_account)s" \
|
||||
if self.bank_cash_account else "1=1"
|
||||
@@ -34,8 +31,7 @@ class PaymentReconciliation(Document):
|
||||
t1.name = t2.parent and t1.docstatus = 1 and t2.docstatus = 1
|
||||
and t2.party_type = %(party_type)s and t2.party = %(party)s
|
||||
and t2.account = %(account)s and {dr_or_cr} > 0
|
||||
and ifnull(t2.reference_type, '') in ('', 'Sales Order', 'Purchase Order')
|
||||
{cond}
|
||||
and (t2.reference_type is null or t2.reference_type in ('', 'Sales Order', 'Purchase Order'))
|
||||
and (CASE
|
||||
WHEN t1.voucher_type in ('Debit Note', 'Credit Note')
|
||||
THEN 1=1
|
||||
@@ -43,7 +39,6 @@ class PaymentReconciliation(Document):
|
||||
END)
|
||||
""".format(**{
|
||||
"dr_or_cr": dr_or_cr,
|
||||
"cond": cond,
|
||||
"bank_account_condition": bank_account_condition,
|
||||
}), {
|
||||
"party_type": self.party_type,
|
||||
@@ -67,63 +62,11 @@ class PaymentReconciliation(Document):
|
||||
|
||||
def get_invoice_entries(self):
|
||||
#Fetch JVs, Sales and Purchase Invoices for 'invoices' to reconcile against
|
||||
non_reconciled_invoices = []
|
||||
dr_or_cr = "debit" if self.party_type == "Customer" else "credit"
|
||||
cond = self.check_condition(dr_or_cr)
|
||||
|
||||
invoice_list = frappe.db.sql("""
|
||||
select
|
||||
voucher_no, voucher_type, posting_date,
|
||||
ifnull(sum({dr_or_cr}), 0) as invoice_amount
|
||||
from
|
||||
`tabGL Entry`
|
||||
where
|
||||
party_type = %(party_type)s and party = %(party)s
|
||||
and account = %(account)s and {dr_or_cr} > 0 {cond}
|
||||
and (CASE
|
||||
WHEN voucher_type = 'Journal Entry'
|
||||
THEN ifnull(against_voucher, '') = ''
|
||||
ELSE 1=1
|
||||
END)
|
||||
group by voucher_type, voucher_no
|
||||
""".format(**{
|
||||
"cond": cond,
|
||||
"dr_or_cr": dr_or_cr
|
||||
}), {
|
||||
"party_type": self.party_type,
|
||||
"party": self.party,
|
||||
"account": self.receivable_payable_account,
|
||||
}, as_dict=True)
|
||||
|
||||
for d in invoice_list:
|
||||
payment_amount = frappe.db.sql("""
|
||||
select
|
||||
ifnull(sum(ifnull({0}, 0)), 0)
|
||||
from
|
||||
`tabGL Entry`
|
||||
where
|
||||
party_type = %(party_type)s and party = %(party)s
|
||||
and account = %(account)s and {0} > 0
|
||||
and against_voucher_type = %(against_voucher_type)s
|
||||
and ifnull(against_voucher, '') = %(against_voucher)s
|
||||
""".format("credit" if self.party_type == "Customer" else "debit"), {
|
||||
"party_type": self.party_type,
|
||||
"party": self.party,
|
||||
"account": self.receivable_payable_account,
|
||||
"against_voucher_type": d.voucher_type,
|
||||
"against_voucher": d.voucher_no
|
||||
})
|
||||
condition = self.check_condition()
|
||||
|
||||
payment_amount = payment_amount[0][0] if payment_amount else 0
|
||||
|
||||
if d.invoice_amount - payment_amount > 0.005:
|
||||
non_reconciled_invoices.append({
|
||||
'voucher_no': d.voucher_no,
|
||||
'voucher_type': d.voucher_type,
|
||||
'posting_date': d.posting_date,
|
||||
'invoice_amount': flt(d.invoice_amount),
|
||||
'outstanding_amount': flt(d.invoice_amount - payment_amount, 2)
|
||||
})
|
||||
non_reconciled_invoices = get_outstanding_invoices(self.party_type, self.party,
|
||||
self.receivable_payable_account, condition=condition)
|
||||
|
||||
self.add_invoice_entries(non_reconciled_invoices)
|
||||
|
||||
@@ -141,12 +84,14 @@ class PaymentReconciliation(Document):
|
||||
|
||||
def reconcile(self, args):
|
||||
for e in self.get('payments'):
|
||||
if " | " in e.invoice_number:
|
||||
e.invoice_type = None
|
||||
if e.invoice_number and " | " in e.invoice_number:
|
||||
e.invoice_type, e.invoice_number = e.invoice_number.split(" | ")
|
||||
|
||||
self.get_invoice_entries()
|
||||
self.validate_invoice()
|
||||
dr_or_cr = "credit" if self.party_type == "Customer" else "debit"
|
||||
dr_or_cr = "credit_in_account_currency" if self.party_type == "Customer" \
|
||||
else "debit_in_account_currency"
|
||||
lst = []
|
||||
for e in self.get('payments'):
|
||||
if e.invoice_number and e.allocated_amount:
|
||||
@@ -208,13 +153,18 @@ class PaymentReconciliation(Document):
|
||||
if not invoices_to_reconcile:
|
||||
frappe.throw(_("Please select Allocated Amount, Invoice Type and Invoice Number in atleast one row"))
|
||||
|
||||
def check_condition(self, dr_or_cr):
|
||||
cond = self.from_date and " and posting_date >= '" + self.from_date + "'" or ""
|
||||
cond += self.to_date and " and posting_date <= '" + self.to_date + "'" or ""
|
||||
def check_condition(self):
|
||||
cond = " and posting_date >= '{0}'".format(frappe.db.escape(self.from_date)) if self.from_date else ""
|
||||
cond += " and posting_date <= '{0}'".format(frappe.db.escape(self.to_date)) if self.to_date else ""
|
||||
|
||||
if self.party_type == "Customer":
|
||||
dr_or_cr = "debit_in_account_currency"
|
||||
else:
|
||||
dr_or_cr = "credit_in_account_currency"
|
||||
|
||||
if self.minimum_amount:
|
||||
cond += " and {0} >= %s".format(dr_or_cr) % self.minimum_amount
|
||||
cond += " and `{0}` >= {1}".format(dr_or_cr, flt(self.minimum_amount))
|
||||
if self.maximum_amount:
|
||||
cond += " and {0} <= %s".format(dr_or_cr) % self.maximum_amount
|
||||
cond += " and `{0}` <= {1}".format(dr_or_cr, flt(self.maximum_amount))
|
||||
|
||||
return cond
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Invoice Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Sales Invoice\nPurchase Invoice\nJournal Entry",
|
||||
"permlevel": 0,
|
||||
@@ -41,6 +42,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Invoice Number",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "",
|
||||
"permlevel": 0,
|
||||
@@ -63,6 +65,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Invoice Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -83,7 +86,8 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Column Break",
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -105,6 +109,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -126,6 +131,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Outstanding Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -144,7 +150,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"modified": "2014-07-18 12:20:51.269974",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:51.516537",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Reconciliation Invoice",
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Journal Entry",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Journal Entry",
|
||||
"permlevel": 0,
|
||||
@@ -41,6 +42,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Posting Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -62,6 +64,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -83,6 +86,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Is Advance",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -104,6 +108,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Voucher Detail Number",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -125,6 +130,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -146,6 +152,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Invoice Number",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "",
|
||||
"permlevel": 0,
|
||||
@@ -168,6 +175,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Allocated amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
@@ -190,6 +198,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -211,6 +220,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Remark",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -229,7 +239,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"modified": "2015-09-21 03:39:40.320070",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:51.563989",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Reconciliation Payment",
|
||||
|
||||
34
erpnext/accounts/doctype/payment_request/payment_request.js
Normal file
34
erpnext/accounts/doctype/payment_request/payment_request.js
Normal file
@@ -0,0 +1,34 @@
|
||||
cur_frm.add_fetch("payment_gateway", "payment_account", "payment_account")
|
||||
cur_frm.add_fetch("payment_gateway", "gateway", "gateway")
|
||||
cur_frm.add_fetch("payment_gateway", "message", "message")
|
||||
cur_frm.add_fetch("payment_gateway", "payment_url_message", "payment_url_message")
|
||||
cur_frm.add_fetch("payment_gateway", "payment_success_url", "payment_success_url")
|
||||
|
||||
frappe.ui.form.on("Payment Request", "onload", function(frm, dt, dn){
|
||||
if (frm.doc.reference_doctype) {
|
||||
frappe.call({
|
||||
method:"erpnext.accounts.doctype.payment_request.payment_request.get_print_format_list",
|
||||
args: {"ref_doctype": frm.doc.reference_doctype},
|
||||
callback:function(r){
|
||||
set_field_options("print_format", r.message["print_format"])
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
frappe.ui.form.on("Payment Request", "refresh", function(frm) {
|
||||
frm.add_custom_button(__('Resend Payment Email'), function(){
|
||||
frappe.call({
|
||||
method: "erpnext.accounts.doctype.payment_request.payment_request.resend_payment_email",
|
||||
args: {"docname": frm.doc.name},
|
||||
freeze: true,
|
||||
freeze_message: __("Sending"),
|
||||
callback: function(r){
|
||||
if(!r.exc) {
|
||||
frappe.msgprint(__("Message Sent"));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,49 +2,30 @@
|
||||
"allow_copy": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"creation": "2013-04-30 12:58:38",
|
||||
"autoname": "PR.######",
|
||||
"creation": "2015-12-15 22:23:24.745065",
|
||||
"custom": 0,
|
||||
"description": "System for managing Backups",
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "System",
|
||||
"document_type": "",
|
||||
"fields": [
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "setup",
|
||||
"fieldname": "payment_details",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Download Backups",
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "current_backups",
|
||||
"fieldtype": "HTML",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Current Backups",
|
||||
"label": "Payment Details",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -56,17 +37,19 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"description": "",
|
||||
"fieldname": "sync_with_dropbox",
|
||||
"fieldtype": "Section Break",
|
||||
"fieldname": "amount",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Sync with Dropbox",
|
||||
"label": "Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "2",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -78,17 +61,21 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "backup_right_now",
|
||||
"fieldtype": "Button",
|
||||
"hidden": 1,
|
||||
"fieldname": "currency",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Backup Right Now",
|
||||
"label": "Currency",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Currency",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"read_only": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
@@ -99,17 +86,20 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "send_backups_to_dropbox",
|
||||
"depends_on": "eval:doc.reference_doctype==\"Sales Order\"",
|
||||
"fieldname": "make_sales_invoice",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Send Backups to Dropbox",
|
||||
"label": "Make Sales Invoice",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -121,63 +111,44 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"depends_on": "send_backups_to_dropbox",
|
||||
"description": "Note: Backups and files are not deleted from Dropbox, you will have to delete them manually.",
|
||||
"fieldname": "upload_backups_to_dropbox",
|
||||
"fieldname": "column_break_5",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"default": "Draft",
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Upload Backups to Dropbox",
|
||||
"no_copy": 0,
|
||||
"options": "Never\nWeekly\nDaily",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"depends_on": "send_backups_to_dropbox",
|
||||
"description": "Email ids separated by commas.",
|
||||
"fieldname": "send_notifications_to",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Send Notifications To",
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "dropbox_access_key",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 1,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Dropbox Access Key",
|
||||
"label": "Status",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "\nDraft\nInitiated\nPaid\nFailed\nCancelled",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -189,81 +160,18 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "dropbox_access_secret",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 1,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Dropbox Access Secret",
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "dropbox_access_allowed",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 1,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Dropbox Access Allowed",
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"depends_on": "send_backups_to_dropbox",
|
||||
"fieldname": "allow_dropbox_access",
|
||||
"fieldtype": "Button",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Allow Dropbox Access",
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"description": "Note: Backups and files are not deleted from Google Drive, you will have to delete them manually.",
|
||||
"fieldname": "sync_with_gdrive",
|
||||
"fieldname": "section_break_7",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 1,
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Sync with Google Drive",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -275,17 +183,167 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "upload_backups_to_gdrive",
|
||||
"fieldname": "payment_gateway",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Payment Gateway",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Payment Gateway Account",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "payment_success_url",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Payment Success URL",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "column_break_9",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "gateway",
|
||||
"fieldtype": "Read Only",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Gateway",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "payment_gateway.gateway",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "payment_account",
|
||||
"fieldtype": "Read Only",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Payment Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "payment_gateway.payment_account",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "recipient_and_message",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Recipient and Message",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"default": "",
|
||||
"fieldname": "print_format",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Upload Backups to Google Drive",
|
||||
"label": "Print Format",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Never\nDaily\nWeekly",
|
||||
"options": "",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -297,81 +355,21 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "allow_gdrive_access",
|
||||
"fieldtype": "Button",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Allow Google Drive Access",
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "verification_code",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Enter Verification Code",
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "validate_gdrive",
|
||||
"fieldtype": "Button",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Validate",
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "gdrive_access_allowed",
|
||||
"fieldname": "mute_email",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 1,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Google Drive Access Allowed",
|
||||
"no_copy": 0,
|
||||
"label": "Mute Email",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"report_hide": 1,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
@@ -381,16 +379,43 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "gdrive_credentials",
|
||||
"fieldtype": "Text",
|
||||
"hidden": 1,
|
||||
"fieldname": "email_to",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Credentials",
|
||||
"label": "Email To",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "subject",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Subject",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -402,16 +427,67 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "database_folder_id",
|
||||
"fieldname": "message",
|
||||
"fieldtype": "Text Editor",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Message",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "payment_url_message",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Payment URL Message",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "payment_url",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 1,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Database Folder ID",
|
||||
"label": "payment_url",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -423,16 +499,93 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "files_folder_id",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 1,
|
||||
"fieldname": "reference_details",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Files Folder ID",
|
||||
"label": "Reference Details",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "reference_doctype",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Reference Doctype",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"options": "DocType",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 1,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "reference_name",
|
||||
"fieldtype": "Dynamic Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Reference Name",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"options": "reference_doctype",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 1,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "amended_from",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Amended From",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"options": "Payment Request",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -443,17 +596,18 @@
|
||||
],
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"icon": "icon-cloud-upload",
|
||||
"idx": 1,
|
||||
"idx": 0,
|
||||
"in_create": 0,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 1,
|
||||
"is_submittable": 1,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"modified": "2015-05-26 04:54:10.193573",
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-01-11 05:49:28.342786",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Setup",
|
||||
"name": "Backup Manager",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Request",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
@@ -461,22 +615,64 @@
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 0,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 0,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 0,
|
||||
"role": "System Manager",
|
||||
"report": 1,
|
||||
"role": "Accounts User",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"amend": 1,
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 1,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Accounts Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"amend": 1,
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 1,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Administrator",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0
|
||||
"read_only_onload": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC"
|
||||
}
|
||||
234
erpnext/accounts/doctype/payment_request/payment_request.py
Normal file
234
erpnext/accounts/doctype/payment_request/payment_request.py
Normal file
@@ -0,0 +1,234 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import flt, nowdate, get_url, cstr
|
||||
from erpnext.accounts.party import get_party_account
|
||||
from erpnext.accounts.utils import get_account_currency, get_balance_on
|
||||
from erpnext.accounts.doctype.journal_entry.journal_entry import (get_payment_entry_against_invoice,
|
||||
get_payment_entry_against_order)
|
||||
|
||||
from itertools import chain
|
||||
|
||||
class PaymentRequest(Document):
|
||||
def validate(self):
|
||||
self.validate_payment_gateway_account()
|
||||
self.validate_payment_request()
|
||||
self.validate_currency()
|
||||
|
||||
def validate_payment_request(self):
|
||||
if frappe.db.get_value("Payment Request", {"reference_name": self.reference_name,
|
||||
"name": ("!=", self.name), "status": ("not in", ["Initiated", "Paid"]), "docstatus": 1}, "name"):
|
||||
frappe.throw(_("Payment Request already exists {0}".fomart(self.reference_name)))
|
||||
|
||||
def validate_currency(self):
|
||||
ref_doc = frappe.get_doc(self.reference_doctype, self.reference_name)
|
||||
if 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 validate_payment_gateway_account(self):
|
||||
if not self.payment_gateway:
|
||||
frappe.throw(_("Payment Gateway Account is not configured"))
|
||||
|
||||
def validate_payment_gateway(self):
|
||||
if self.gateway == "PayPal":
|
||||
if not frappe.db.get_value("PayPal Settings", None, "api_username"):
|
||||
if not frappe.conf.paypal_username:
|
||||
frappe.throw(_("PayPal Settings missing"))
|
||||
|
||||
def on_submit(self):
|
||||
if not self.mute_email:
|
||||
self.send_payment_request()
|
||||
self.send_email()
|
||||
|
||||
self.make_communication_entry()
|
||||
|
||||
def on_cancel(self):
|
||||
self.set_as_cancelled()
|
||||
|
||||
def on_update_after_submit(self):
|
||||
pass
|
||||
|
||||
def set_status(self):
|
||||
pass
|
||||
|
||||
def get_payment_url(self):
|
||||
pass
|
||||
|
||||
def make_invoice(self):
|
||||
if self.make_sales_invoice:
|
||||
from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice
|
||||
si = make_sales_invoice(self.reference_name, ignore_permissions=True)
|
||||
si = si.insert(ignore_permissions=True)
|
||||
si.submit()
|
||||
|
||||
def send_payment_request(self):
|
||||
self.payment_url = get_url("/api/method/erpnext.accounts.doctype.payment_request.payment_request.generate_payment_request?name={0}".format(self.name))
|
||||
if self.payment_url:
|
||||
frappe.db.set_value(self.doctype, self.name, "status", "Initiated")
|
||||
|
||||
def set_as_paid(self):
|
||||
if frappe.session.user == "Guest":
|
||||
frappe.set_user("Administrator")
|
||||
|
||||
jv = self.create_journal_entry()
|
||||
self.make_invoice()
|
||||
|
||||
return jv
|
||||
|
||||
def create_journal_entry(self):
|
||||
"""create entry"""
|
||||
payment_details = {
|
||||
"amount": self.amount,
|
||||
"journal_entry": True,
|
||||
"bank_account": self.payment_account
|
||||
}
|
||||
|
||||
frappe.flags.ignore_account_permission = True
|
||||
|
||||
if self.reference_doctype == "Sales Order":
|
||||
jv = get_payment_entry_against_order(self.reference_doctype, self.reference_name,\
|
||||
amount=self.amount, journal_entry=True, bank_account=self.payment_account)
|
||||
|
||||
if self.reference_doctype == "Sales Invoice":
|
||||
jv = get_payment_entry_against_invoice(self.reference_doctype, self.reference_name,\
|
||||
amount=self.amount, journal_entry=True, bank_account=self.payment_account)
|
||||
|
||||
jv.update({
|
||||
"voucher_type": "Journal Entry",
|
||||
"posting_date": nowdate()
|
||||
})
|
||||
jv.insert(ignore_permissions=True)
|
||||
jv.submit()
|
||||
|
||||
#set status as paid for Payment Request
|
||||
frappe.db.set_value(self.doctype, self.name, "status", "Paid")
|
||||
|
||||
return jv
|
||||
|
||||
def send_email(self):
|
||||
"""send email with payment link"""
|
||||
frappe.sendmail(recipients=self.email_to, sender=None, subject=self.subject,
|
||||
message=self.get_message(), attachments=[frappe.attach_print(self.reference_doctype,
|
||||
self.reference_name, file_name=self.reference_name, print_format=self.print_format)])
|
||||
|
||||
def get_message(self):
|
||||
"""return message with payment gateway link"""
|
||||
return cstr(self.message) + " <a href='{0}'>{1}</a>".format(self.payment_url, \
|
||||
self.payment_url_message or _(" Click here to pay"))
|
||||
|
||||
def set_failed(self):
|
||||
pass
|
||||
|
||||
def set_as_cancelled(self):
|
||||
frappe.db.set_value(self.doctype, self.name, "status", "Cancelled")
|
||||
|
||||
def make_communication_entry(self):
|
||||
"""Make communication entry"""
|
||||
comm = frappe.get_doc({
|
||||
"doctype":"Communication",
|
||||
"subject": self.subject,
|
||||
"content": self.get_message(),
|
||||
"sent_or_received": "Sent",
|
||||
"reference_doctype": self.reference_doctype,
|
||||
"reference_name": self.reference_name
|
||||
})
|
||||
comm.insert(ignore_permissions=True)
|
||||
|
||||
def get_payment_success_url(self):
|
||||
return self.payment_success_url
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def make_payment_request(**args):
|
||||
"""Make payment request"""
|
||||
|
||||
args = frappe._dict(args)
|
||||
ref_doc = frappe.get_doc(args.dt, args.dn)
|
||||
gateway_account = get_gateway_details(args)
|
||||
|
||||
pr = frappe.new_doc("Payment Request")
|
||||
pr.update({
|
||||
"payment_gateway": gateway_account.name,
|
||||
"gateway": gateway_account.gateway,
|
||||
"payment_account": gateway_account.payment_account,
|
||||
"currency": ref_doc.currency,
|
||||
"make_sales_invoice": args.cart or 0,
|
||||
"amount": get_amount(ref_doc, args.dt),
|
||||
"mute_email": args.mute_email or 0,
|
||||
"email_to": args.recipient_id or "",
|
||||
"subject": "Payment Request for %s"%args.dn,
|
||||
"message": gateway_account.message,
|
||||
"payment_url_message": gateway_account.payment_url_message,
|
||||
"payment_success_url": gateway_account.payment_success_url,
|
||||
"reference_doctype": args.dt,
|
||||
"reference_name": args.dn
|
||||
})
|
||||
|
||||
if args.return_doc:
|
||||
return pr
|
||||
|
||||
if args.submit_doc:
|
||||
pr.insert(ignore_permissions=True)
|
||||
pr.submit()
|
||||
|
||||
if args.cart:
|
||||
generate_payment_request(pr.name)
|
||||
frappe.db.commit()
|
||||
|
||||
if not args.cart:
|
||||
return pr
|
||||
|
||||
return pr.as_dict()
|
||||
|
||||
def get_amount(ref_doc, dt):
|
||||
"""get amount based on doctype"""
|
||||
if dt == "Sales Order":
|
||||
amount = flt(ref_doc.base_grand_total) - flt(ref_doc.advance_paid)
|
||||
|
||||
if dt == "Sales Invoice":
|
||||
amount = abs(ref_doc.outstanding_amount)
|
||||
|
||||
if amount > 0:
|
||||
return amount
|
||||
else:
|
||||
frappe.throw(_("Payment Entry is already created"))
|
||||
|
||||
def get_gateway_details(args):
|
||||
"""return gateway and payment account of default payment gateway"""
|
||||
if args.payemnt_gateway:
|
||||
gateway_account = frappe.db.get_value("Payment Gateway Account", args.payemnt_gateway,
|
||||
["name", "gateway", "payment_account", "message", "payment_url_message", "payment_success_url"],
|
||||
as_dict=1)
|
||||
|
||||
gateway_account = frappe.db.get_value("Payment Gateway Account", {"is_default": 1},
|
||||
["name", "gateway", "payment_account", "message", "payment_url_message", "payment_success_url"],
|
||||
as_dict=1)
|
||||
|
||||
if not gateway_account:
|
||||
frappe.throw(_("Payment Gateway Account is not configured"))
|
||||
|
||||
return gateway_account
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_print_format_list(ref_doctype):
|
||||
print_format_list = ["Standard"]
|
||||
|
||||
print_format_list.extend([p.name for p in frappe.get_all("Print Format",
|
||||
filters={"doc_type": ref_doctype})])
|
||||
|
||||
return {
|
||||
"print_format": print_format_list
|
||||
}
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def generate_payment_request(name):
|
||||
frappe.get_doc("Payment Request", name).run_method("get_payment_url")
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def resend_payment_email(docname):
|
||||
return frappe.get_doc("Payment Request", docname).send_email()
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
frappe.listview_settings['Payment Request'] = {
|
||||
add_fields: ["status"],
|
||||
get_indicator: function(doc) {
|
||||
if(doc.status == "Draft") {
|
||||
return [__("Draft"), "darkgrey", "status,=,Draft"];
|
||||
}
|
||||
else if(doc.status == "Initiated") {
|
||||
return [__("Initiated"), "green", "status,=,Initiated"];
|
||||
}
|
||||
else if(doc.status == "Paid") {
|
||||
return [__("Paid"), "blue", "status,=,Paid"];
|
||||
}
|
||||
else if(doc.status == "Cancelled") {
|
||||
return [__("Cancelled"), "orange", "status,=,Cancelled"];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
|
||||
from erpnext.accounts.doctype.payment_request.payment_request import make_payment_request
|
||||
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
|
||||
# test_records = frappe.get_test_records('Payment Request')
|
||||
|
||||
test_dependencies = ["Currency Exchange", "Journal Entry", "Contact", "Address"]
|
||||
|
||||
payment_gateway = {
|
||||
"doctype": "Payment Gateway",
|
||||
"gateway": "_Test Gateway"
|
||||
}
|
||||
|
||||
payment_method = [
|
||||
{
|
||||
"doctype": "Payment Gateway Account",
|
||||
"is_default": 1,
|
||||
"gateway": "_Test Gateway",
|
||||
"payment_account": "_Test Bank - _TC",
|
||||
"currency": "INR"
|
||||
},
|
||||
{
|
||||
"doctype": "Payment Gateway Account",
|
||||
"gateway": "_Test Gateway",
|
||||
"payment_account": "_Test Bank - _TC",
|
||||
"currency": "USD"
|
||||
}
|
||||
]
|
||||
|
||||
class TestPaymentRequest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
if not frappe.db.get_value("Payment Gateway", payment_gateway["gateway"], "name"):
|
||||
frappe.get_doc(payment_gateway).insert(ignore_permissions=True)
|
||||
|
||||
for method in payment_method:
|
||||
if not frappe.db.get_value("Payment Gateway Account", {"gateway": method["gateway"],
|
||||
"currency": method["currency"]}, "name"):
|
||||
frappe.get_doc(method).insert(ignore_permissions=True)
|
||||
|
||||
def test_payment_request_linkings(self):
|
||||
SO_INR = make_sales_order(currency="INR")
|
||||
pr = make_payment_request(dt="Sales Order", dn=SO_INR.name, recipient_id="saurabh@erpnext.com")
|
||||
|
||||
self.assertEquals(pr.reference_doctype, "Sales Order")
|
||||
self.assertEquals(pr.reference_name, SO_INR.name)
|
||||
self.assertEquals(pr.currency, "INR")
|
||||
|
||||
SI_USD = create_sales_invoice(currency="USD", conversion_rate=50)
|
||||
pr = make_payment_request(dt="Sales Invoice", dn=SI_USD.name, recipient_id="saurabh@erpnext.com")
|
||||
|
||||
self.assertEquals(pr.reference_doctype, "Sales Invoice")
|
||||
self.assertEquals(pr.reference_name, SI_USD.name)
|
||||
self.assertEquals(pr.currency, "USD")
|
||||
|
||||
def test_payment_entry(self):
|
||||
SO_INR = make_sales_order(currency="INR")
|
||||
pr = make_payment_request(dt="Sales Order", dn=SO_INR.name, recipient_id="saurabh@erpnext.com",
|
||||
mute_email=1, submit_doc=1)
|
||||
jv = pr.set_as_paid()
|
||||
|
||||
SO_INR = frappe.get_doc("Sales Order", SO_INR.name)
|
||||
|
||||
self.assertEquals(SO_INR.advance_paid, jv.total_debit)
|
||||
|
||||
SI_USD = create_sales_invoice(customer="_Test Customer USD", debit_to="_Test Receivable USD - _TC",
|
||||
currency="USD", conversion_rate=50)
|
||||
|
||||
pr = make_payment_request(dt="Sales Invoice", dn=SI_USD.name, recipient_id="saurabh@erpnext.com",
|
||||
mute_email=1, return_doc=1, payemnt_gateway="_Test Gateway - USD")
|
||||
|
||||
self.assertRaises(frappe.ValidationError, pr.save)
|
||||
|
||||
|
||||
@@ -42,6 +42,10 @@ frappe.ui.form.on("Payment Tool", "refresh", function(frm) {
|
||||
frappe.ui.form.trigger("Payment Tool", "party_type");
|
||||
});
|
||||
|
||||
frappe.ui.form.on("Payment Tool", "party_type", function(frm) {
|
||||
frm.set_value("received_or_paid", frm.doc.party_type=="Customer" ? "Received" : "Paid");
|
||||
});
|
||||
|
||||
frappe.ui.form.on("Payment Tool", "party", function(frm) {
|
||||
if(frm.doc.party_type && frm.doc.party) {
|
||||
return frappe.call({
|
||||
@@ -141,7 +145,10 @@ frappe.ui.form.on("Payment Tool", "get_outstanding_vouchers", function(frm) {
|
||||
c.against_voucher_no = d.voucher_no;
|
||||
c.total_amount = d.invoice_amount;
|
||||
c.outstanding_amount = d.outstanding_amount;
|
||||
c.payment_amount = d.outstanding_amount;
|
||||
|
||||
if (frm.doc.set_payment_amount) {
|
||||
c.payment_amount = d.outstanding_amount;
|
||||
}
|
||||
});
|
||||
}
|
||||
refresh_field("vouchers");
|
||||
|
||||
@@ -185,6 +185,28 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "set_payment_amount",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Set Payment Amount = Outstanding Amount",
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -474,7 +496,7 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 1,
|
||||
"istable": 0,
|
||||
"modified": "2015-08-31 18:58:21.813054",
|
||||
"modified": "2015-10-01 09:43:24.199025",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Tool",
|
||||
|
||||
@@ -7,6 +7,8 @@ from frappe import _, scrub
|
||||
from frappe.utils import flt
|
||||
from frappe.model.document import Document
|
||||
import json
|
||||
from erpnext.accounts.utils import get_account_currency
|
||||
from erpnext.accounts.doctype.journal_entry.journal_entry import get_exchange_rate
|
||||
|
||||
class PaymentTool(Document):
|
||||
def make_journal_entry(self):
|
||||
@@ -18,7 +20,15 @@ class PaymentTool(Document):
|
||||
jv.company = self.company
|
||||
jv.cheque_no = self.reference_no
|
||||
jv.cheque_date = self.reference_date
|
||||
|
||||
|
||||
party_account_currency, party_account_type = frappe.db.get_value("Account", self.party_account,
|
||||
["account_currency", "account_type"])
|
||||
|
||||
bank_account_currency, bank_account_type = None, None
|
||||
if self.payment_account:
|
||||
bank_account_currency, bank_account_type = frappe.db.get_value("Account", self.payment_account,
|
||||
["account_currency", "account_type"])
|
||||
|
||||
if not self.total_payment_amount:
|
||||
frappe.throw(_("Please enter Payment Amount in atleast one row"))
|
||||
|
||||
@@ -26,27 +36,58 @@ class PaymentTool(Document):
|
||||
if not frappe.db.get_value(v.against_voucher_type, {"name": v.against_voucher_no}):
|
||||
frappe.throw(_("Row {0}: {1} is not a valid {2}").format(v.idx, v.against_voucher_no,
|
||||
v.against_voucher_type))
|
||||
|
||||
|
||||
if v.payment_amount:
|
||||
exchange_rate = get_exchange_rate(self.party_account, party_account_currency,
|
||||
self.company, v.against_voucher_type, v.against_voucher_no)
|
||||
|
||||
d1 = jv.append("accounts")
|
||||
d1.account = self.party_account
|
||||
d1.party_type = self.party_type
|
||||
d1.party = self.party
|
||||
d1.account_currency = party_account_currency
|
||||
d1.account_type = party_account_type
|
||||
d1.balance = get_balance_on(self.party_account)
|
||||
d1.party_balance = get_balance_on(party=self.party, party_type=self.party_type)
|
||||
d1.exchange_rate = exchange_rate
|
||||
d1.set("debit_in_account_currency" if self.received_or_paid=="Paid" \
|
||||
else "credit_in_account_currency", flt(v.payment_amount))
|
||||
d1.set("reference_type", v.against_voucher_type)
|
||||
d1.set("reference_name", v.against_voucher_no)
|
||||
d1.set('is_advance', 'Yes' if v.against_voucher_type in ['Sales Order', 'Purchase Order'] else 'No')
|
||||
total_payment_amount = flt(total_payment_amount) + \
|
||||
flt(d1.debit_in_account_currency) - flt(d1.credit_in_account_currency)
|
||||
d1.reference_type = v.against_voucher_type
|
||||
d1.reference_name = v.against_voucher_no
|
||||
d1.is_advance = 'Yes' \
|
||||
if v.against_voucher_type in ['Sales Order', 'Purchase Order'] else 'No'
|
||||
|
||||
amount = flt(d1.debit_in_account_currency) - flt(d1.credit_in_account_currency)
|
||||
if bank_account_currency == party_account_currency:
|
||||
total_payment_amount += amount
|
||||
else:
|
||||
total_payment_amount += amount*exchange_rate
|
||||
|
||||
d2 = jv.append("accounts")
|
||||
d2.account = self.payment_account
|
||||
d2.set('debit_in_account_currency' if total_payment_amount < 0 \
|
||||
else 'credit_in_account_currency', abs(total_payment_amount))
|
||||
if self.payment_account:
|
||||
d2.balance = get_balance_on(self.payment_account)
|
||||
bank_account_currency, bank_account_type = frappe.db.get_value("Account", self.payment_account,
|
||||
["account_currency", "account_type"])
|
||||
|
||||
d2.account = self.payment_account
|
||||
d2.account_currency = bank_account_currency
|
||||
d2.account_type = bank_account_type
|
||||
d2.exchange_rate = get_exchange_rate(self.payment_account, bank_account_currency, self.company,
|
||||
debit=(abs(total_payment_amount) if total_payment_amount < 0 else 0),
|
||||
credit=(total_payment_amount if total_payment_amount > 0 else 0))
|
||||
d2.account_balance = get_balance_on(self.payment_account)
|
||||
|
||||
amount_field_bank = 'debit_in_account_currency' if total_payment_amount < 0 \
|
||||
else 'credit_in_account_currency'
|
||||
|
||||
d2.set(amount_field_bank, abs(total_payment_amount))
|
||||
|
||||
company_currency = frappe.db.get_value("Company", self.company, "default_currency")
|
||||
if party_account_currency != company_currency or \
|
||||
(bank_account_currency and bank_account_currency != company_currency):
|
||||
jv.multi_currency = 1
|
||||
|
||||
jv.set_amounts_in_company_currency()
|
||||
jv.set_total_debit_credit()
|
||||
|
||||
return jv.as_dict()
|
||||
|
||||
@@ -59,23 +100,21 @@ def get_outstanding_vouchers(args):
|
||||
|
||||
args = json.loads(args)
|
||||
|
||||
party_account_currency = frappe.db.get_value("Account", args.get("party_account"), "account_currency")
|
||||
party_account_currency = get_account_currency(args.get("party_account"))
|
||||
company_currency = frappe.db.get_value("Company", args.get("company"), "default_currency")
|
||||
|
||||
if args.get("party_type") == "Customer" and args.get("received_or_paid") == "Received":
|
||||
amount_query = "ifnull(debit_in_account_currency, 0) - ifnull(credit_in_account_currency, 0)"
|
||||
elif args.get("party_type") == "Supplier" and args.get("received_or_paid") == "Paid":
|
||||
amount_query = "ifnull(credit_in_account_currency, 0) - ifnull(debit_in_account_currency, 0)"
|
||||
else:
|
||||
if ((args.get("party_type") == "Customer" and args.get("received_or_paid") == "Paid")
|
||||
or (args.get("party_type") == "Supplier" and args.get("received_or_paid") == "Received")):
|
||||
|
||||
frappe.throw(_("Please enter the Against Vouchers manually"))
|
||||
|
||||
# Get all outstanding sales /purchase invoices
|
||||
outstanding_invoices = get_outstanding_invoices(amount_query, args.get("party_account"),
|
||||
args.get("party_type"), args.get("party"))
|
||||
outstanding_invoices = get_outstanding_invoices(args.get("party_type"), args.get("party"), args.get("party_account"))
|
||||
|
||||
# Get all SO / PO which are not fully billed or aginst which full advance not paid
|
||||
orders_to_be_billed = get_orders_to_be_billed(args.get("party_type"), args.get("party"),
|
||||
party_account_currency, company_currency)
|
||||
|
||||
return outstanding_invoices + orders_to_be_billed
|
||||
|
||||
def get_orders_to_be_billed(party_type, party, party_account_currency, company_currency):
|
||||
@@ -86,8 +125,8 @@ def get_orders_to_be_billed(party_type, party, party_account_currency, company_c
|
||||
orders = frappe.db.sql("""
|
||||
select
|
||||
name as voucher_no,
|
||||
ifnull({ref_field}, 0) as invoice_amount,
|
||||
(ifnull({ref_field}, 0) - ifnull(advance_paid, 0)) as outstanding_amount,
|
||||
{ref_field} as invoice_amount,
|
||||
({ref_field} - advance_paid) as outstanding_amount,
|
||||
transaction_date as posting_date
|
||||
from
|
||||
`tab{voucher_type}`
|
||||
@@ -95,8 +134,8 @@ def get_orders_to_be_billed(party_type, party, party_account_currency, company_c
|
||||
{party_type} = %s
|
||||
and docstatus = 1
|
||||
and ifnull(status, "") != "Stopped"
|
||||
and ifnull({ref_field}, 0) > ifnull(advance_paid, 0)
|
||||
and abs(100 - ifnull(per_billed, 0)) > 0.01
|
||||
and {ref_field} > advance_paid
|
||||
and abs(100 - per_billed) > 0.01
|
||||
""".format(**{
|
||||
"ref_field": ref_field,
|
||||
"voucher_type": voucher_type,
|
||||
@@ -112,12 +151,12 @@ def get_orders_to_be_billed(party_type, party, party_account_currency, company_c
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_against_voucher_amount(against_voucher_type, against_voucher_no, party_account, company):
|
||||
party_account_currency = frappe.db.get_value("Account", party_account, "account_currency")
|
||||
party_account_currency = get_account_currency(party_account)
|
||||
company_currency = frappe.db.get_value("Company", company, "default_currency")
|
||||
ref_field = "base_grand_total" if party_account_currency == company_currency else "grand_total"
|
||||
|
||||
if against_voucher_type in ["Sales Order", "Purchase Order"]:
|
||||
select_cond = "{0} as total_amount, ifnull({0}, 0) - ifnull(advance_paid, 0) as outstanding_amount"\
|
||||
select_cond = "{0} as total_amount, {0} - advance_paid as outstanding_amount"\
|
||||
.format(ref_field)
|
||||
elif against_voucher_type in ["Sales Invoice", "Purchase Invoice"]:
|
||||
select_cond = "{0} as total_amount, outstanding_amount".format(ref_field)
|
||||
@@ -126,6 +165,6 @@ def get_against_voucher_amount(against_voucher_type, against_voucher_no, party_a
|
||||
select_cond = "{0} as total_amount".format(ref_field)
|
||||
|
||||
details = frappe.db.sql("""select {0} from `tab{1}` where name = %s"""
|
||||
.format(select_cond, against_voucher_type), against_voucher_no, as_dict=1)
|
||||
.format(select_cond, frappe.db.escape(against_voucher_type)), against_voucher_no, as_dict=1)
|
||||
|
||||
return details[0] if details else {}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Against Voucher Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "DocType",
|
||||
"permlevel": 0,
|
||||
@@ -43,6 +44,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Against Voucher No",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "against_voucher_type",
|
||||
"permlevel": 0,
|
||||
@@ -64,6 +66,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
@@ -86,6 +89,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Total Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "party_account_currency",
|
||||
"permlevel": 0,
|
||||
@@ -108,6 +112,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Outstanding Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "party_account_currency",
|
||||
"permlevel": 0,
|
||||
@@ -130,6 +135,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Payment Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "party_account_currency",
|
||||
"permlevel": 0,
|
||||
@@ -149,7 +155,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"modified": "2015-08-31 18:58:35.537060",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:51.626386",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Tool Detail",
|
||||
|
||||
@@ -10,12 +10,12 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
|
||||
// ***************** Get Account Head *****************
|
||||
cur_frm.fields_dict['closing_account_head'].get_query = function(doc, cdt, cdn) {
|
||||
return{
|
||||
filters:{
|
||||
"company": doc.company,
|
||||
"report_type": "Balance Sheet",
|
||||
"freeze_account": "No",
|
||||
"is_group": 0
|
||||
}
|
||||
return {
|
||||
filters: [
|
||||
['Account', 'company', '=', doc.company],
|
||||
['Account', 'is_group', '=', '0'],
|
||||
['Account', 'freeze_account', '=', 'No'],
|
||||
['Account', 'root_type', 'in', 'Liability, Equity']
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldtype": "Column Break",
|
||||
"permlevel": 0,
|
||||
@@ -41,6 +42,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Transaction Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "transaction_date",
|
||||
"oldfieldtype": "Date",
|
||||
@@ -64,6 +66,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Posting Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "posting_date",
|
||||
"oldfieldtype": "Date",
|
||||
@@ -87,6 +90,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Closing Fiscal Year",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "fiscal_year",
|
||||
"oldfieldtype": "Select",
|
||||
@@ -111,6 +115,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Amended From",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "amended_from",
|
||||
"oldfieldtype": "Data",
|
||||
@@ -135,6 +140,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Company",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "company",
|
||||
"oldfieldtype": "Select",
|
||||
@@ -158,6 +164,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldtype": "Column Break",
|
||||
"permlevel": 0,
|
||||
@@ -173,7 +180,7 @@
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"description": "The account head under Liability, in which Profit/Loss will be booked",
|
||||
"description": "The account head under Liability or Equity, in which Profit/Loss will be booked",
|
||||
"fieldname": "closing_account_head",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
@@ -181,6 +188,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Closing Account Head",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "closing_account_head",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -194,29 +202,6 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "coa_help",
|
||||
"fieldtype": "HTML",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "CoA Help",
|
||||
"no_copy": 0,
|
||||
"oldfieldtype": "HTML",
|
||||
"options": "<a href=\"#!Accounts Browser/Account\">To manage Account Head, click here</a>",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
@@ -228,6 +213,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Remarks",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "remarks",
|
||||
"oldfieldtype": "Small Text",
|
||||
@@ -250,7 +236,8 @@
|
||||
"is_submittable": 1,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"modified": "2015-02-05 05:11:42.268561",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:51.671436",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Period Closing Voucher",
|
||||
|
||||
@@ -5,6 +5,7 @@ from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.utils import flt
|
||||
from frappe import _
|
||||
from erpnext.accounts.utils import get_account_currency
|
||||
from erpnext.controllers.accounts_controller import AccountsController
|
||||
|
||||
class PeriodClosingVoucher(AccountsController):
|
||||
@@ -20,51 +21,75 @@ class PeriodClosingVoucher(AccountsController):
|
||||
where voucher_type = 'Period Closing Voucher' and voucher_no=%s""", self.name)
|
||||
|
||||
def validate_account_head(self):
|
||||
if frappe.db.get_value("Account", self.closing_account_head, "report_type") \
|
||||
!= "Balance Sheet":
|
||||
frappe.throw(_("Closing Account {0} must be of type 'Liability'").format(self.closing_account_head))
|
||||
closing_account_type = frappe.db.get_value("Account", self.closing_account_head, "root_type")
|
||||
|
||||
if closing_account_type not in ["Liability", "Equity"]:
|
||||
frappe.throw(_("Closing Account {0} must be of type Liability / Equity")
|
||||
.format(self.closing_account_head))
|
||||
|
||||
account_currency = get_account_currency(self.closing_account_head)
|
||||
company_currency = frappe.db.get_value("Company", self.company, "default_currency")
|
||||
if account_currency != company_currency:
|
||||
frappe.throw(_("Currency of the Closing Account must be {0}").format(company_currency))
|
||||
|
||||
def validate_posting_date(self):
|
||||
from erpnext.accounts.utils import get_fiscal_year
|
||||
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)
|
||||
|
||||
self.year_start_date = get_fiscal_year(self.posting_date, self.fiscal_year)[1]
|
||||
|
||||
pce = frappe.db.sql("""select name from `tabPeriod Closing Voucher`
|
||||
where posting_date > %s and fiscal_year = %s and docstatus = 1""",
|
||||
(self.posting_date, self.fiscal_year))
|
||||
if pce and pce[0][0]:
|
||||
frappe.throw(_("Another Period Closing Entry {0} has been made after {1}").format(pce[0][0], self.posting_date))
|
||||
|
||||
def get_pl_balances(self):
|
||||
"""Get balance for pl accounts"""
|
||||
return frappe.db.sql("""
|
||||
select t1.account, sum(ifnull(t1.debit,0))-sum(ifnull(t1.credit,0)) as balance
|
||||
from `tabGL Entry` t1, `tabAccount` t2
|
||||
where t1.account = t2.name and ifnull(t2.report_type, '') = 'Profit and Loss'
|
||||
and t2.docstatus < 2 and t2.company = %s
|
||||
and t1.posting_date between %s and %s
|
||||
group by t1.account
|
||||
""", (self.company, self.get("year_start_date"), self.posting_date), as_dict=1)
|
||||
frappe.throw(_("Another Period Closing Entry {0} has been made after {1}")
|
||||
.format(pce[0][0], self.posting_date))
|
||||
|
||||
def make_gl_entries(self):
|
||||
gl_entries = []
|
||||
net_pl_balance = 0
|
||||
pl_accounts = self.get_pl_balances()
|
||||
|
||||
for acc in pl_accounts:
|
||||
if flt(acc.balance):
|
||||
if flt(acc.balance_in_company_currency):
|
||||
gl_entries.append(self.get_gl_dict({
|
||||
"account": acc.account,
|
||||
"debit": abs(flt(acc.balance)) if flt(acc.balance) < 0 else 0,
|
||||
"credit": abs(flt(acc.balance)) if flt(acc.balance) > 0 else 0,
|
||||
"account_currency": acc.account_currency,
|
||||
"debit_in_account_currency": abs(flt(acc.balance_in_account_currency)) \
|
||||
if flt(acc.balance_in_account_currency) < 0 else 0,
|
||||
"debit": abs(flt(acc.balance_in_company_currency)) \
|
||||
if flt(acc.balance_in_company_currency) < 0 else 0,
|
||||
"credit_in_account_currency": abs(flt(acc.balance_in_account_currency)) \
|
||||
if flt(acc.balance_in_account_currency) > 0 else 0,
|
||||
"credit": abs(flt(acc.balance_in_company_currency)) \
|
||||
if flt(acc.balance_in_company_currency) > 0 else 0
|
||||
}))
|
||||
|
||||
net_pl_balance += flt(acc.balance)
|
||||
net_pl_balance += flt(acc.balance_in_company_currency)
|
||||
|
||||
if net_pl_balance:
|
||||
gl_entries.append(self.get_gl_dict({
|
||||
"account": self.closing_account_head,
|
||||
"debit_in_account_currency": abs(net_pl_balance) if net_pl_balance > 0 else 0,
|
||||
"debit": abs(net_pl_balance) if net_pl_balance > 0 else 0,
|
||||
"credit_in_account_currency": abs(net_pl_balance) if net_pl_balance < 0 else 0,
|
||||
"credit": abs(net_pl_balance) if net_pl_balance < 0 else 0
|
||||
}))
|
||||
|
||||
from erpnext.accounts.general_ledger import make_gl_entries
|
||||
make_gl_entries(gl_entries)
|
||||
|
||||
def get_pl_balances(self):
|
||||
"""Get balance for pl accounts"""
|
||||
return frappe.db.sql("""
|
||||
select
|
||||
t1.account, t2.account_currency,
|
||||
sum(t1.debit_in_account_currency) - sum(t1.credit_in_account_currency) as balance_in_account_currency,
|
||||
sum(t1.debit) - sum(t1.credit) as balance_in_company_currency
|
||||
from `tabGL Entry` t1, `tabAccount` t2
|
||||
where t1.account = t2.name and t2.report_type = 'Profit and Loss'
|
||||
and t2.docstatus < 2 and t2.company = %s
|
||||
and t1.posting_date between %s and %s
|
||||
group by t1.account
|
||||
""", (self.company, self.get("year_start_date"), self.posting_date), as_dict=1)
|
||||
|
||||
@@ -5,47 +5,79 @@
|
||||
from __future__ import unicode_literals
|
||||
import unittest
|
||||
import frappe
|
||||
from frappe.utils import flt
|
||||
from frappe.utils import flt, today
|
||||
from erpnext.accounts.utils import get_fiscal_year
|
||||
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
|
||||
|
||||
class TestPeriodClosingVoucher(unittest.TestCase):
|
||||
def test_closing_entry(self):
|
||||
make_journal_entry("_Test Bank - _TC", "Sales - _TC", 400,
|
||||
year_start_date = get_fiscal_year(today())[1]
|
||||
|
||||
make_journal_entry("_Test Bank - _TC", "Sales - _TC", 400,
|
||||
"_Test Cost Center - _TC", submit=True)
|
||||
|
||||
make_journal_entry("_Test Account Cost for Goods Sold - _TC",
|
||||
|
||||
make_journal_entry("_Test Account Cost for Goods Sold - _TC",
|
||||
"_Test Bank - _TC", 600, "_Test Cost Center - _TC", submit=True)
|
||||
|
||||
profit_or_loss = frappe.db.sql("""select sum(ifnull(t1.debit,0))-sum(ifnull(t1.credit,0)) as balance
|
||||
|
||||
random_expense_account = frappe.db.sql("""
|
||||
select t1.account,
|
||||
sum(t1.debit) - sum(t1.credit) as balance,
|
||||
sum(t1.debit_in_account_currency) - sum(t1.credit_in_account_currency) \
|
||||
as balance_in_account_currency
|
||||
from `tabGL Entry` t1, `tabAccount` t2
|
||||
where t1.account = t2.name and ifnull(t2.report_type, '') = 'Profit and Loss'
|
||||
where t1.account = t2.name and t2.root_type = 'Expense'
|
||||
and t2.docstatus < 2 and t2.company = '_Test Company'
|
||||
and t1.posting_date between %s and %s
|
||||
group by t1.account
|
||||
having sum(t1.debit) > sum(t1.credit)
|
||||
limit 1""", (year_start_date, today()), as_dict=True)
|
||||
|
||||
profit_or_loss = frappe.db.sql("""select sum(t1.debit) - sum(t1.credit) as balance
|
||||
from `tabGL Entry` t1, `tabAccount` t2
|
||||
where t1.account = t2.name and t2.report_type = 'Profit and Loss'
|
||||
and t2.docstatus < 2 and t2.company = '_Test Company'
|
||||
and t1.posting_date between '2013-01-01' and '2013-12-31'""")
|
||||
|
||||
and t1.posting_date between %s and %s""", (year_start_date, today()))
|
||||
|
||||
profit_or_loss = flt(profit_or_loss[0][0]) if profit_or_loss else 0
|
||||
|
||||
|
||||
pcv = self.make_period_closing_voucher()
|
||||
|
||||
gle_value = frappe.db.sql("""select ifnull(debit, 0) - ifnull(credit, 0)
|
||||
|
||||
# Check value for closing account
|
||||
gle_amount_for_closing_account = frappe.db.sql("""select debit - credit
|
||||
from `tabGL Entry` where voucher_type='Period Closing Voucher' and voucher_no=%s
|
||||
and account = '_Test Account Reserves and Surplus - _TC'""", pcv.name)
|
||||
|
||||
gle_value = flt(gle_value[0][0]) if gle_value else 0
|
||||
|
||||
self.assertEqual(gle_value, profit_or_loss)
|
||||
|
||||
gle_amount_for_closing_account = flt(gle_amount_for_closing_account[0][0]) \
|
||||
if gle_amount_for_closing_account else 0
|
||||
|
||||
self.assertEqual(gle_amount_for_closing_account, profit_or_loss)
|
||||
|
||||
if random_expense_account:
|
||||
# Check posted value for teh above random_expense_account
|
||||
gle_for_random_expense_account = frappe.db.sql("""
|
||||
select debit - credit as amount,
|
||||
debit_in_account_currency - credit_in_account_currency
|
||||
as amount_in_account_currency
|
||||
from `tabGL Entry`
|
||||
where voucher_type='Period Closing Voucher' and voucher_no=%s and account =%s""",
|
||||
(pcv.name, random_expense_account[0].account), as_dict=True)
|
||||
|
||||
self.assertEqual(gle_for_random_expense_account[0].amount, -1*random_expense_account[0].balance)
|
||||
self.assertEqual(gle_for_random_expense_account[0].amount_in_account_currency,
|
||||
-1*random_expense_account[0].balance_in_account_currency)
|
||||
|
||||
def make_period_closing_voucher(self):
|
||||
pcv = frappe.get_doc({
|
||||
"doctype": "Period Closing Voucher",
|
||||
"closing_account_head": "_Test Account Reserves and Surplus - _TC",
|
||||
"company": "_Test Company",
|
||||
"fiscal_year": "_Test Fiscal Year 2013",
|
||||
"posting_date": "2013-12-31",
|
||||
"fiscal_year": get_fiscal_year(today())[0],
|
||||
"posting_date": today(),
|
||||
"remarks": "test"
|
||||
})
|
||||
pcv.insert()
|
||||
pcv.submit()
|
||||
|
||||
|
||||
return pcv
|
||||
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Applicable for User",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "user",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -43,6 +44,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Series",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "naming_series",
|
||||
"oldfieldtype": "Select",
|
||||
@@ -67,6 +69,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Warehouse",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "warehouse",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -93,6 +96,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Update Stock",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -113,6 +117,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
@@ -135,6 +140,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Customer",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "customer_account",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -159,6 +165,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Company",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "company",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -183,6 +190,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Currency",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "currency",
|
||||
"oldfieldtype": "Select",
|
||||
@@ -207,6 +215,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Mode of Payment",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Mode of Payment",
|
||||
"permlevel": 0,
|
||||
@@ -229,6 +238,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
@@ -251,6 +261,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Print Format",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Print Format",
|
||||
"permlevel": 0,
|
||||
@@ -274,6 +285,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Letter Head",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "letter_head",
|
||||
"oldfieldtype": "Select",
|
||||
@@ -298,6 +310,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Print Heading",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "select_print_heading",
|
||||
"oldfieldtype": "Select",
|
||||
@@ -322,6 +335,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Terms and Conditions",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "tc_name",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -345,6 +359,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldtype": "Column Break",
|
||||
"permlevel": 0,
|
||||
@@ -368,6 +383,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Territory",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "territory",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -392,6 +408,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Price List",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "price_list_name",
|
||||
"oldfieldtype": "Select",
|
||||
@@ -415,6 +432,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
@@ -437,6 +455,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Write Off Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Account",
|
||||
"permlevel": 0,
|
||||
@@ -460,6 +479,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Write Off Cost Center",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Cost Center",
|
||||
"permlevel": 0,
|
||||
@@ -483,6 +503,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Taxes and Charges",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "charge",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -506,6 +527,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
@@ -528,6 +550,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Cash/Bank Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "cash_bank_account",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -552,6 +575,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Income Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "income_account",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -577,6 +601,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Expense Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Account",
|
||||
"permlevel": 0,
|
||||
@@ -599,6 +624,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Cost Center",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "cost_center",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -622,7 +648,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"modified": "2015-09-07 15:51:26",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:51.741253",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "POS Profile",
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_import": 1,
|
||||
"allow_rename": 0,
|
||||
"autoname": "PRULE.#####",
|
||||
"allow_rename": 1,
|
||||
"autoname": "field:title",
|
||||
"creation": "2014-02-21 15:02:51",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
@@ -20,9 +20,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -41,10 +43,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Title",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -64,10 +68,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Apply On",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "\nItem Code\nItem Group\nBrand",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -87,10 +93,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Item Code",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Item",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -110,10 +118,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Brand",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Brand",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -133,10 +143,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Item Group",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Item Group",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -154,10 +166,12 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -177,10 +191,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Priority",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -199,9 +215,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Disable",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -219,10 +237,12 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -241,9 +261,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Selling",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -262,9 +284,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Buying",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -282,10 +306,12 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -305,10 +331,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Applicable For",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "\nCustomer\nCustomer Group\nTerritory\nSales Partner\nCampaign\nSupplier\nSupplier Type",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -328,10 +356,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Customer",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Customer",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -351,10 +381,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Customer Group",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Customer Group",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -374,10 +406,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Territory",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Territory",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -397,10 +431,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Sales Partner",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Sales Partner",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -420,10 +456,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Campaign",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Campaign",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -443,10 +481,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Supplier",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Supplier",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -466,10 +506,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Supplier Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Supplier Type",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -487,10 +529,12 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -509,9 +553,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Min Qty",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -529,10 +575,12 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -551,9 +599,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Max Qty",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -571,10 +621,12 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -594,9 +646,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Valid From",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -615,9 +669,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Valid Upto",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -635,9 +691,11 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -656,10 +714,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Company",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -678,9 +738,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -700,10 +762,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Price or Discount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "\nPrice\nDiscount Percentage",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -721,9 +785,11 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -743,9 +809,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Price",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -765,9 +833,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Discount on Price List Rate (%)",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -787,10 +857,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "For Price List",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Price List",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -809,10 +881,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Simple",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -831,9 +905,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Pricing Rule Help",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -851,7 +927,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"modified": "2015-09-11 12:19:52.242771",
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-01-15 04:05:11.633824",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Pricing Rule",
|
||||
@@ -962,5 +1039,5 @@
|
||||
"read_only_onload": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"title_field": "title"
|
||||
"title_field": ""
|
||||
}
|
||||
@@ -59,7 +59,7 @@ class PricingRule(Document):
|
||||
self.set(f, None)
|
||||
|
||||
def validate_price_or_discount(self):
|
||||
for field in ["Price", "Discount Percentage"]:
|
||||
for field in ["Price"]:
|
||||
if flt(self.get(frappe.scrub(field))) < 0:
|
||||
throw(_("{0} can not be negative").format(field))
|
||||
|
||||
@@ -76,7 +76,7 @@ class PricingRule(Document):
|
||||
def apply_pricing_rule(args):
|
||||
"""
|
||||
args = {
|
||||
"item_list": [{"doctype": "", "name": "", "item_code": "", "brand": "", "item_group": ""}, ...],
|
||||
"items": [{"doctype": "", "name": "", "item_code": "", "brand": "", "item_group": ""}, ...],
|
||||
"customer": "something",
|
||||
"customer_group": "something",
|
||||
"territory": "something",
|
||||
@@ -97,18 +97,17 @@ def apply_pricing_rule(args):
|
||||
args = json.loads(args)
|
||||
|
||||
args = frappe._dict(args)
|
||||
|
||||
|
||||
if not args.transaction_type:
|
||||
set_transaction_type(args)
|
||||
|
||||
# list of dictionaries
|
||||
out = []
|
||||
|
||||
if args.get("parenttype") == "Material Request": return out
|
||||
if args.get("doctype") == "Material Request": return out
|
||||
|
||||
if not args.transaction_type:
|
||||
args.transaction_type = "buying" if frappe.get_meta(args.parenttype).get_field("supplier") \
|
||||
else "selling"
|
||||
|
||||
item_list = args.get("item_list")
|
||||
args.pop("item_list")
|
||||
item_list = args.get("items")
|
||||
args.pop("items")
|
||||
|
||||
for item in item_list:
|
||||
args_copy = copy.deepcopy(args)
|
||||
@@ -138,13 +137,17 @@ def get_pricing_rule_for_item(args):
|
||||
if not args.item_group:
|
||||
frappe.throw(_("Item Group not mentioned in item master for item {0}").format(args.item_code))
|
||||
|
||||
if args.customer and not (args.customer_group and args.territory):
|
||||
customer = frappe.db.get_value("Customer", args.customer, ["customer_group", "territory"])
|
||||
if customer:
|
||||
args.customer_group, args.territory = customer
|
||||
if args.transaction_type=="selling":
|
||||
if args.customer and not (args.customer_group and args.territory):
|
||||
customer = frappe.db.get_value("Customer", args.customer, ["customer_group", "territory"])
|
||||
if customer:
|
||||
args.customer_group, args.territory = customer
|
||||
|
||||
args.supplier = args.supplier_type = None
|
||||
|
||||
elif args.supplier and not args.supplier_type:
|
||||
args.supplier_type = frappe.db.get_value("Supplier", args.supplier, "supplier_type")
|
||||
args.customer = args.customer_group = args.territory = None
|
||||
|
||||
pricing_rules = get_pricing_rules(args)
|
||||
pricing_rule = filter_pricing_rules(args, pricing_rules)
|
||||
@@ -168,21 +171,28 @@ def get_pricing_rules(args):
|
||||
field = frappe.scrub(parenttype)
|
||||
condition = ""
|
||||
if args.get(field):
|
||||
lft, rgt = frappe.db.get_value(parenttype, args[field], ["lft", "rgt"])
|
||||
try:
|
||||
lft, rgt = frappe.db.get_value(parenttype, args[field], ["lft", "rgt"])
|
||||
except TypeError:
|
||||
frappe.throw(_("Invalid {0}").format(args[field]))
|
||||
|
||||
parent_groups = frappe.db.sql_list("""select name from `tab%s`
|
||||
where lft<=%s and rgt>=%s""" % (parenttype, '%s', '%s'), (lft, rgt))
|
||||
|
||||
if parent_groups:
|
||||
if allow_blank: parent_groups.append('')
|
||||
condition = " ifnull("+field+", '') in ('" + \
|
||||
"', '".join([d.replace("'", "\\'").replace('"', '\\"') for d in parent_groups])+"')"
|
||||
"', '".join([frappe.db.escape(d) for d in parent_groups])+"')"
|
||||
return condition
|
||||
|
||||
|
||||
conditions = ""
|
||||
values = {"item_code": args.get("item_code"), "brand": args.get("brand")}
|
||||
|
||||
for field in ["company", "customer", "supplier", "supplier_type", "campaign", "sales_partner"]:
|
||||
if args.get(field):
|
||||
conditions += " and ifnull("+field+", '') in (%("+field+")s, '')"
|
||||
values[field] = args.get(field)
|
||||
else:
|
||||
conditions += " and ifnull("+field+", '') = ''"
|
||||
|
||||
@@ -190,23 +200,27 @@ def get_pricing_rules(args):
|
||||
group_condition = _get_tree_conditions(parenttype)
|
||||
if group_condition:
|
||||
conditions += " and " + group_condition
|
||||
|
||||
if not args.price_list: args.price_list = None
|
||||
conditions += " and ifnull(for_price_list, '') in (%(price_list)s, '')"
|
||||
values["price_list"] = args.get("price_list")
|
||||
|
||||
if args.get("transaction_date"):
|
||||
conditions += """ and %(transaction_date)s between ifnull(valid_from, '2000-01-01')
|
||||
and ifnull(valid_upto, '2500-12-31')"""
|
||||
values['transaction_date'] = args.get('transaction_date')
|
||||
|
||||
item_group_condition = _get_tree_conditions("Item Group", False)
|
||||
if item_group_condition: item_group_condition = " or " + item_group_condition
|
||||
|
||||
return frappe.db.sql("""select * from `tabPricing Rule`
|
||||
where (item_code=%(item_code)s {item_group_condition} or brand=%(brand)s)
|
||||
and docstatus < 2 and ifnull(disable, 0) = 0
|
||||
and ifnull({transaction_type}, 0) = 1 {conditions}
|
||||
and docstatus < 2 and disable = 0
|
||||
and {transaction_type} = 1 {conditions}
|
||||
order by priority desc, name desc""".format(
|
||||
item_group_condition=item_group_condition,
|
||||
transaction_type=args.transaction_type, conditions=conditions), args, as_dict=1)
|
||||
transaction_type= args.transaction_type,
|
||||
conditions=conditions), values, as_dict=1)
|
||||
|
||||
def filter_pricing_rules(args, pricing_rules):
|
||||
# filter for qty
|
||||
@@ -263,3 +277,14 @@ def apply_internal_priority(pricing_rules, field_set, args):
|
||||
if filtered_rules: break
|
||||
|
||||
return filtered_rules or pricing_rules
|
||||
|
||||
def set_transaction_type(args):
|
||||
if args.doctype in ("Opportunity", "Quotation", "Sales Order", "Delivery Note", "Sales Invoice"):
|
||||
args.transaction_type = "selling"
|
||||
elif args.doctype in ("Material Request", "Supplier Quotation", "Purchase Order",
|
||||
"Purchase Receipt", "Purchase Invoice"):
|
||||
args.transaction_type = "buying"
|
||||
elif args.customer:
|
||||
args.transaction_type = "selling"
|
||||
else:
|
||||
args.transaction_type = "buying"
|
||||
@@ -31,22 +31,22 @@ class TestPricingRule(unittest.TestCase):
|
||||
"company": "_Test Company",
|
||||
"price_list": "_Test Price List",
|
||||
"currency": "_Test Currency",
|
||||
"parenttype": "Sales Order",
|
||||
"doctype": "Sales Order",
|
||||
"conversion_rate": 1,
|
||||
"price_list_currency": "_Test Currency",
|
||||
"plc_conversion_rate": 1,
|
||||
"order_type": "Sales",
|
||||
"transaction_type": "selling",
|
||||
"customer": "_Test Customer",
|
||||
"doctype": "Sales Order Item",
|
||||
"name": None
|
||||
})
|
||||
details = get_item_details(args)
|
||||
self.assertEquals(details.get("discount_percentage"), 10)
|
||||
|
||||
|
||||
prule = frappe.get_doc(test_record.copy())
|
||||
prule.applicable_for = "Customer"
|
||||
prule.title = "_Test Pricing Rule for Customer"
|
||||
self.assertRaises(MandatoryError, prule.insert)
|
||||
|
||||
prule.customer = "_Test Customer"
|
||||
prule.discount_percentage = 20
|
||||
prule.insert()
|
||||
@@ -56,16 +56,18 @@ class TestPricingRule(unittest.TestCase):
|
||||
prule = frappe.get_doc(test_record.copy())
|
||||
prule.apply_on = "Item Group"
|
||||
prule.item_group = "All Item Groups"
|
||||
prule.title = "_Test Pricing Rule for Item Group"
|
||||
prule.discount_percentage = 15
|
||||
prule.insert()
|
||||
|
||||
args.customer = None
|
||||
|
||||
args.customer = "_Test Customer 1"
|
||||
details = get_item_details(args)
|
||||
self.assertEquals(details.get("discount_percentage"), 10)
|
||||
|
||||
prule = frappe.get_doc(test_record.copy())
|
||||
prule.applicable_for = "Campaign"
|
||||
prule.campaign = "_Test Campaign"
|
||||
prule.title = "_Test Pricing Rule for Campaign"
|
||||
prule.discount_percentage = 5
|
||||
prule.priority = 8
|
||||
prule.insert()
|
||||
|
||||
@@ -24,38 +24,40 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
||||
|
||||
if(!doc.is_return) {
|
||||
if(doc.docstatus==1) {
|
||||
if(doc.outstanding_amount > 0) {
|
||||
this.frm.add_custom_button(__('Payment'), this.make_bank_entry).addClass("btn-primary");
|
||||
if(doc.outstanding_amount != 0) {
|
||||
this.frm.add_custom_button(__('Payment'), this.make_bank_entry, __("Make"));
|
||||
cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
|
||||
}
|
||||
cur_frm.add_custom_button(__('Debit Note'), this.make_debit_note);
|
||||
cur_frm.add_custom_button(__('Debit Note'), this.make_debit_note, __("Make"));
|
||||
}
|
||||
|
||||
if(doc.docstatus===0) {
|
||||
cur_frm.add_custom_button(__('From Purchase Order'), function() {
|
||||
cur_frm.add_custom_button(__('Purchase Order'), function() {
|
||||
frappe.model.map_current_doc({
|
||||
method: "erpnext.buying.doctype.purchase_order.purchase_order.make_purchase_invoice",
|
||||
source_doctype: "Purchase Order",
|
||||
get_query_filters: {
|
||||
supplier: cur_frm.doc.supplier || undefined,
|
||||
docstatus: 1,
|
||||
status: ["!=", "Stopped"],
|
||||
status: ["not in", ["Stopped", "Closed"]],
|
||||
per_billed: ["<", 99.99],
|
||||
company: cur_frm.doc.company
|
||||
}
|
||||
})
|
||||
});
|
||||
}, __("Get items from"));
|
||||
|
||||
cur_frm.add_custom_button(__('From Purchase Receipt'), function() {
|
||||
cur_frm.add_custom_button(__('Purchase Receipt'), function() {
|
||||
frappe.model.map_current_doc({
|
||||
method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_purchase_invoice",
|
||||
source_doctype: "Purchase Receipt",
|
||||
get_query_filters: {
|
||||
supplier: cur_frm.doc.supplier || undefined,
|
||||
docstatus: 1,
|
||||
status: ["!=", "Closed"],
|
||||
company: cur_frm.doc.company
|
||||
}
|
||||
})
|
||||
});
|
||||
}, __("Get items from"));
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -75,7 +77,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
||||
me.apply_pricing_rule();
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
credit_to: function() {
|
||||
var me = this;
|
||||
if(this.frm.doc.credit_to) {
|
||||
@@ -135,9 +137,10 @@ cur_frm.script_manager.make(erpnext.accounts.PurchaseInvoice);
|
||||
|
||||
cur_frm.cscript.make_bank_entry = function() {
|
||||
return frappe.call({
|
||||
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_payment_entry_from_purchase_invoice",
|
||||
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_payment_entry_against_invoice",
|
||||
args: {
|
||||
"purchase_invoice": cur_frm.doc.name,
|
||||
"dt": "Purchase Invoice",
|
||||
"dn": cur_frm.doc.name
|
||||
},
|
||||
callback: function(r) {
|
||||
var doclist = frappe.model.sync(r.message);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,8 @@ import frappe.defaults
|
||||
|
||||
from erpnext.controllers.buying_controller import BuyingController
|
||||
from erpnext.accounts.party import get_party_account, get_due_date
|
||||
from erpnext.accounts.utils import get_account_currency
|
||||
from erpnext.stock.doctype.purchase_receipt.purchase_receipt import update_billed_amount_based_on_po
|
||||
|
||||
form_grid_templates = {
|
||||
"items": "templates/form_grid/item_grid.html"
|
||||
@@ -47,7 +49,7 @@ class PurchaseInvoice(BuyingController):
|
||||
self.check_conversion_rate()
|
||||
self.validate_credit_to_acc()
|
||||
self.clear_unallocated_advances("Purchase Invoice Advance", "advances")
|
||||
self.check_for_stopped_status()
|
||||
self.check_for_stopped_or_closed_status()
|
||||
self.validate_with_previous_doc()
|
||||
self.validate_uom_is_integer("uom", "qty")
|
||||
self.set_against_expense_account()
|
||||
@@ -66,7 +68,7 @@ class PurchaseInvoice(BuyingController):
|
||||
|
||||
def set_missing_values(self, for_validate=False):
|
||||
if not self.credit_to:
|
||||
self.credit_to = get_party_account(self.company, self.supplier, "Supplier")
|
||||
self.credit_to = get_party_account("Supplier", self.supplier, self.company)
|
||||
if not self.due_date:
|
||||
self.due_date = get_due_date(self.posting_date, "Supplier", self.supplier, self.company)
|
||||
|
||||
@@ -75,7 +77,7 @@ class PurchaseInvoice(BuyingController):
|
||||
def get_advances(self):
|
||||
if not self.is_return:
|
||||
super(PurchaseInvoice, self).get_advances(self.credit_to, "Supplier", self.supplier,
|
||||
"Purchase Invoice Advance", "advances", "debit", "purchase_order")
|
||||
"Purchase Invoice Advance", "advances", "debit_in_account_currency", "purchase_order")
|
||||
|
||||
def check_active_purchase_items(self):
|
||||
for d in self.get('items'):
|
||||
@@ -91,7 +93,7 @@ class PurchaseInvoice(BuyingController):
|
||||
throw(_("Conversion rate cannot be 0 or 1"))
|
||||
|
||||
def validate_credit_to_acc(self):
|
||||
account = frappe.db.get_value("Account", self.credit_to,
|
||||
account = frappe.db.get_value("Account", self.credit_to,
|
||||
["account_type", "report_type", "account_currency"], as_dict=True)
|
||||
|
||||
if account.report_type != "Balance Sheet":
|
||||
@@ -99,17 +101,17 @@ class PurchaseInvoice(BuyingController):
|
||||
|
||||
if self.supplier and account.account_type != "Payable":
|
||||
frappe.throw(_("Credit To account must be a Payable account"))
|
||||
|
||||
|
||||
self.party_account_currency = account.account_currency
|
||||
|
||||
def check_for_stopped_status(self):
|
||||
def check_for_stopped_or_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)
|
||||
stopped = frappe.db.sql("select name from `tabPurchase Order` where status = 'Stopped' and name = %s", d.purchase_order)
|
||||
if stopped:
|
||||
throw(_("Purchase Order {0} is 'Stopped'").format(d.purchase_order))
|
||||
pc_obj.check_for_stopped_or_closed_status('Purchase Order', d.purchase_order)
|
||||
|
||||
def validate_with_previous_doc(self):
|
||||
super(PurchaseInvoice, self).validate_with_previous_doc({
|
||||
@@ -149,10 +151,14 @@ class PurchaseInvoice(BuyingController):
|
||||
against_accounts = []
|
||||
stock_items = self.get_stock_items()
|
||||
for item in self.get("items"):
|
||||
# in case of auto inventory accounting,
|
||||
# against expense account is always "Stock Received But Not Billed"
|
||||
# for a stock item and if not epening entry and not drop-ship entry
|
||||
|
||||
if auto_accounting_for_stock and item.item_code in stock_items \
|
||||
and self.is_opening == 'No':
|
||||
# in case of auto inventory accounting, against expense account is always
|
||||
# Stock Received But Not Billed for a stock item
|
||||
and self.is_opening == 'No' and (not item.po_detail or
|
||||
not frappe.db.get_value("Purchase Order Item", item.po_detail, "delivered_by_supplier")):
|
||||
|
||||
item.expense_account = stock_not_billed_account
|
||||
item.cost_center = None
|
||||
|
||||
@@ -175,9 +181,10 @@ class PurchaseInvoice(BuyingController):
|
||||
throw(_("Purchse Order number required for Item {0}").format(d.item_code))
|
||||
|
||||
def pr_required(self):
|
||||
stock_items = self.get_stock_items()
|
||||
if frappe.db.get_value("Buying Settings", None, "pr_required") == 'Yes':
|
||||
for d in self.get('items'):
|
||||
if not d.purchase_receipt:
|
||||
if not d.purchase_receipt and d.item_code in stock_items:
|
||||
throw(_("Purchase Receipt number required for Item {0}").format(d.item_code))
|
||||
|
||||
def validate_write_off_account(self):
|
||||
@@ -240,6 +247,7 @@ class PurchaseInvoice(BuyingController):
|
||||
self.update_against_document_in_jv()
|
||||
self.update_prevdoc_status()
|
||||
self.update_billing_status_for_zero_amount_refdoc("Purchase Order")
|
||||
self.update_billing_status_in_pr()
|
||||
|
||||
self.update_project()
|
||||
|
||||
@@ -251,17 +259,21 @@ class PurchaseInvoice(BuyingController):
|
||||
expenses_included_in_valuation = self.get_company_default("expenses_included_in_valuation")
|
||||
|
||||
gl_entries = []
|
||||
|
||||
|
||||
# parent's gl entry
|
||||
if self.base_grand_total:
|
||||
if self.grand_total:
|
||||
# Didnot use base_grand_total to book rounding loss gle
|
||||
grand_total_in_company_currency = flt(self.grand_total * self.conversion_rate,
|
||||
self.precision("grand_total"))
|
||||
|
||||
gl_entries.append(
|
||||
self.get_gl_dict({
|
||||
"account": self.credit_to,
|
||||
"party_type": "Supplier",
|
||||
"party": self.supplier,
|
||||
"against": self.against_expense_account,
|
||||
"credit": self.base_grand_total,
|
||||
"credit_in_account_currency": self.base_grand_total \
|
||||
"credit": grand_total_in_company_currency,
|
||||
"credit_in_account_currency": grand_total_in_company_currency \
|
||||
if self.party_account_currency==self.company_currency else self.grand_total,
|
||||
"against_voucher": self.return_against if cint(self.is_return) else self.name,
|
||||
"against_voucher_type": self.doctype,
|
||||
@@ -272,10 +284,10 @@ class PurchaseInvoice(BuyingController):
|
||||
valuation_tax = {}
|
||||
for tax in self.get("taxes"):
|
||||
if tax.category in ("Total", "Valuation and Total") and flt(tax.base_tax_amount_after_discount_amount):
|
||||
account_currency = frappe.db.get_value("Account", tax.account_head, "account_currency")
|
||||
|
||||
account_currency = get_account_currency(tax.account_head)
|
||||
|
||||
dr_or_cr = "debit" if tax.add_deduct_tax == "Add" else "credit"
|
||||
|
||||
|
||||
gl_entries.append(
|
||||
self.get_gl_dict({
|
||||
"account": tax.account_head,
|
||||
@@ -301,7 +313,7 @@ class PurchaseInvoice(BuyingController):
|
||||
stock_items = self.get_stock_items()
|
||||
for item in self.get("items"):
|
||||
if flt(item.base_net_amount):
|
||||
account_currency = frappe.db.get_value("Account", item.expense_account, "account_currency")
|
||||
account_currency = get_account_currency(item.expense_account)
|
||||
gl_entries.append(
|
||||
self.get_gl_dict({
|
||||
"account": item.expense_account,
|
||||
@@ -316,23 +328,22 @@ class PurchaseInvoice(BuyingController):
|
||||
if auto_accounting_for_stock and self.is_opening == "No" and \
|
||||
item.item_code in stock_items and item.item_tax_amount:
|
||||
# Post reverse entry for Stock-Received-But-Not-Billed if it is booked in Purchase Receipt
|
||||
negative_expense_booked_in_pi = None
|
||||
if item.purchase_receipt:
|
||||
negative_expense_booked_in_pi = frappe.db.sql("""select name from `tabGL Entry`
|
||||
negative_expense_booked_in_pr = frappe.db.sql("""select name from `tabGL Entry`
|
||||
where voucher_type='Purchase Receipt' and voucher_no=%s and account=%s""",
|
||||
(item.purchase_receipt, expenses_included_in_valuation))
|
||||
|
||||
if not negative_expense_booked_in_pi:
|
||||
gl_entries.append(
|
||||
self.get_gl_dict({
|
||||
"account": stock_received_but_not_billed,
|
||||
"against": self.supplier,
|
||||
"debit": flt(item.item_tax_amount, self.precision("item_tax_amount", item)),
|
||||
"remarks": self.remarks or "Accounting Entry for Stock"
|
||||
})
|
||||
)
|
||||
if not negative_expense_booked_in_pr:
|
||||
gl_entries.append(
|
||||
self.get_gl_dict({
|
||||
"account": stock_received_but_not_billed,
|
||||
"against": self.supplier,
|
||||
"debit": flt(item.item_tax_amount, self.precision("item_tax_amount", item)),
|
||||
"remarks": self.remarks or "Accounting Entry for Stock"
|
||||
})
|
||||
)
|
||||
|
||||
negative_expense_to_be_booked += flt(item.item_tax_amount, self.precision("item_tax_amount", item))
|
||||
negative_expense_to_be_booked += flt(item.item_tax_amount, self.precision("item_tax_amount", item))
|
||||
|
||||
if self.is_opening == "No" and negative_expense_to_be_booked and valuation_tax:
|
||||
# credit valuation tax amount in "Expenses Included In Valuation"
|
||||
@@ -363,8 +374,8 @@ class PurchaseInvoice(BuyingController):
|
||||
# writeoff account includes petty difference in the invoice amount
|
||||
# and the amount that is paid
|
||||
if self.write_off_account and flt(self.write_off_amount):
|
||||
write_off_account_currency = frappe.db.get_value("Account", self.write_off_account, "account_currency")
|
||||
|
||||
write_off_account_currency = get_account_currency(self.write_off_account)
|
||||
|
||||
gl_entries.append(
|
||||
self.get_gl_dict({
|
||||
"account": self.credit_to,
|
||||
@@ -394,12 +405,16 @@ class PurchaseInvoice(BuyingController):
|
||||
make_gl_entries(gl_entries, cancel=(self.docstatus == 2))
|
||||
|
||||
def on_cancel(self):
|
||||
self.check_for_stopped_or_closed_status()
|
||||
|
||||
if not self.is_return:
|
||||
from erpnext.accounts.utils import remove_against_link_from_jv
|
||||
remove_against_link_from_jv(self.doctype, self.name)
|
||||
|
||||
self.update_prevdoc_status()
|
||||
self.update_billing_status_for_zero_amount_refdoc("Purchase Order")
|
||||
self.update_billing_status_in_pr()
|
||||
|
||||
self.make_gl_entries_on_cancel()
|
||||
self.update_project()
|
||||
|
||||
@@ -420,10 +435,28 @@ class PurchaseInvoice(BuyingController):
|
||||
if self.bill_no:
|
||||
if cint(frappe.db.get_single_value("Accounts Settings", "check_supplier_invoice_uniqueness")):
|
||||
pi = frappe.db.exists("Purchase Invoice", {"bill_no": self.bill_no,
|
||||
"fiscal_year": self.fiscal_year, "name": ("!=", self.name)})
|
||||
"fiscal_year": self.fiscal_year, "name": ("!=", self.name), "docstatus": ("<", 2)})
|
||||
if pi:
|
||||
frappe.throw("Supplier Invoice No exists in Purchase Invoice {0}".format(pi))
|
||||
|
||||
def update_billing_status_in_pr(self, update_modified=True):
|
||||
updated_pr = []
|
||||
for d in self.get("items"):
|
||||
if d.pr_detail:
|
||||
billed_amt = frappe.db.sql("""select sum(amount) from `tabPurchase Invoice Item`
|
||||
where pr_detail=%s and docstatus=1""", d.pr_detail)
|
||||
billed_amt = billed_amt and billed_amt[0][0] or 0
|
||||
frappe.db.set_value("Purchase Receipt Item", d.pr_detail, "billed_amt", billed_amt, update_modified=update_modified)
|
||||
updated_pr.append(d.purchase_receipt)
|
||||
elif d.po_detail:
|
||||
updated_pr += update_billed_amount_based_on_po(d.po_detail, update_modified)
|
||||
|
||||
for pr in set(updated_pr):
|
||||
frappe.get_doc("Purchase Receipt", pr).update_billing_percentage(update_modified=update_modified)
|
||||
|
||||
def on_recurring(self, reference_doc):
|
||||
self.due_date = None
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_expense_account(doctype, txt, searchfield, start, page_len, filters):
|
||||
from erpnext.controllers.queries import get_match_cond
|
||||
@@ -436,10 +469,10 @@ def get_expense_account(doctype, txt, searchfield, start, page_len, filters):
|
||||
or tabAccount.account_type in ("Expense Account", "Fixed Asset", "Temporary"))
|
||||
and tabAccount.is_group=0
|
||||
and tabAccount.docstatus!=2
|
||||
and tabAccount.company = '%(company)s'
|
||||
and tabAccount.%(key)s LIKE '%(txt)s'
|
||||
%(mcond)s""" % {'company': filters['company'], 'key': searchfield,
|
||||
'txt': "%%%s%%" % frappe.db.escape(txt), 'mcond':get_match_cond(doctype)})
|
||||
and tabAccount.company = %(company)s
|
||||
and tabAccount.{key} LIKE %(txt)s
|
||||
{mcond}""".format( key=frappe.db.escape(searchfield), mcond=get_match_cond(doctype) ),
|
||||
{ 'company': filters['company'], 'txt': "%%%s%%" % frappe.db.escape(txt) })
|
||||
|
||||
@frappe.whitelist()
|
||||
def make_debit_note(source_name, target_doc=None):
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user