Compare commits
1454 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c8dc1d273 | ||
|
|
a8d04b11c3 | ||
|
|
756e518bc1 | ||
|
|
c72267b98b | ||
|
|
526f042bb7 | ||
|
|
a289ab75bf | ||
|
|
14b83cf391 | ||
|
|
d627af2c97 | ||
|
|
fe3f78b0f6 | ||
|
|
cf6b786950 | ||
|
|
a12eb686a5 | ||
|
|
07263462f6 | ||
|
|
69cfab8559 | ||
|
|
32362f14f4 | ||
|
|
18bfad5a66 | ||
|
|
5839a8d7f0 | ||
|
|
f1ad694356 | ||
|
|
aac4dcedc8 | ||
|
|
b0f0aaf5b1 | ||
|
|
fe6eadfe22 | ||
|
|
425ab6bb1e | ||
|
|
cbed331047 | ||
|
|
4151e3dc92 | ||
|
|
6020e9ceb3 | ||
|
|
5b9d6494a6 | ||
|
|
e670525c55 | ||
|
|
39a6f804bf | ||
|
|
ddeb576d52 | ||
|
|
0a58d9e0f4 | ||
|
|
7bdd9979aa | ||
|
|
1f3d5b7ee9 | ||
|
|
45fd073094 | ||
|
|
980a00d9d7 | ||
|
|
95ffe3bc7b | ||
|
|
18d465dc0d | ||
|
|
23ef60a467 | ||
|
|
8f6b1e0549 | ||
|
|
ae7dc31d14 | ||
|
|
aabefe4b7c | ||
|
|
6fa497c87a | ||
|
|
a4decc2c59 | ||
|
|
f1083c9a74 | ||
|
|
e1f68b9904 | ||
|
|
94a1f3eb90 | ||
|
|
5a4c7d3b62 | ||
|
|
2620bf402f | ||
|
|
1b28f58829 | ||
|
|
034fcb3410 | ||
|
|
4403853828 | ||
|
|
8d1dea6aad | ||
|
|
f34e63123f | ||
|
|
598c9c4679 | ||
|
|
2174790545 | ||
|
|
f9103b1b0b | ||
|
|
e0cc597f70 | ||
|
|
ab40cd8d08 | ||
|
|
8fa6f79f7e | ||
|
|
f7face6384 | ||
|
|
3ef8d066b9 | ||
|
|
18e988e4ce | ||
|
|
7b52dc9f32 | ||
|
|
a897882434 | ||
|
|
cc7132763f | ||
|
|
593bfddb74 | ||
|
|
658b3260c2 | ||
|
|
6c30972931 | ||
|
|
d1029b54c2 | ||
|
|
56f7fa66ad | ||
|
|
bdf0f0a08d | ||
|
|
8f810c55d2 | ||
|
|
eb0c08f328 | ||
|
|
c37c7ed5c6 | ||
|
|
0f6eac3b35 | ||
|
|
91bd4ce3e1 | ||
|
|
36c0faa744 | ||
|
|
cd3b37dcfe | ||
|
|
55f0834e99 | ||
|
|
a45a6005b8 | ||
|
|
6107ccd5ea | ||
|
|
737849a0f5 | ||
|
|
ed71e6cea6 | ||
|
|
5afca21571 | ||
|
|
7f8a5fe6d2 | ||
|
|
6c7c1223c3 | ||
|
|
a1d5494fb3 | ||
|
|
e9065677c6 | ||
|
|
1a9c1c4243 | ||
|
|
eb9a794993 | ||
|
|
6071ddc3dd | ||
|
|
73c71f9dd5 | ||
|
|
2f0a14bda0 | ||
|
|
ae629ad29f | ||
|
|
02a38e8b5e | ||
|
|
f9a9754dab | ||
|
|
baa6d96a82 | ||
|
|
980f68a5fa | ||
|
|
ed08e88de4 | ||
|
|
40505dcfb1 | ||
|
|
3c0d5cbab5 | ||
|
|
ef3d18f127 | ||
|
|
0d6db633f7 | ||
|
|
00212a23e1 | ||
|
|
6d1dbd6384 | ||
|
|
4a6bbf9b72 | ||
|
|
f54be2c7f0 | ||
|
|
1864879b91 | ||
|
|
3a2682919a | ||
|
|
2dc2d671da | ||
|
|
7d5b47e113 | ||
|
|
fa32588e72 | ||
|
|
1e800a9ef0 | ||
|
|
da9e9cdb13 | ||
|
|
dca6302e15 | ||
|
|
883cc04701 | ||
|
|
da297dcfc5 | ||
|
|
acd1bcffde | ||
|
|
57b30430e4 | ||
|
|
d2d261dc87 | ||
|
|
38f470288f | ||
|
|
1a16a4f394 | ||
|
|
5f6e76ee03 | ||
|
|
6338f407d9 | ||
|
|
eeda0460d4 | ||
|
|
4b6b6fe5a8 | ||
|
|
64ec677cf7 | ||
|
|
a812d67837 | ||
|
|
cfb05e429f | ||
|
|
f79760ce2d | ||
|
|
0dd8500393 | ||
|
|
d5e15eaadf | ||
|
|
fd9dc5e9f5 | ||
|
|
877e2ebff8 | ||
|
|
43114bab71 | ||
|
|
dddf42560f | ||
|
|
abd9248ba6 | ||
|
|
0b40ccc43c | ||
|
|
695bf47a1d | ||
|
|
e9cd22aff9 | ||
|
|
9739dc3639 | ||
|
|
cc23bc0549 | ||
|
|
966e5643c9 | ||
|
|
3353b5ee62 | ||
|
|
ac33724656 | ||
|
|
3724448cd3 | ||
|
|
dcb72c6be7 | ||
|
|
3b06aeaffd | ||
|
|
8a59c33e2f | ||
|
|
42d5d8390d | ||
|
|
fb71f32ebf | ||
|
|
2e2dd0fb42 | ||
|
|
da321b44cb | ||
|
|
9364f35a2c | ||
|
|
724b4b17a5 | ||
|
|
fbcf44657c | ||
|
|
c422c23813 | ||
|
|
f703198082 | ||
|
|
ca3e7152d6 | ||
|
|
8e49951821 | ||
|
|
65820ed013 | ||
|
|
533a0f6527 | ||
|
|
60def66644 | ||
|
|
24358db7bf | ||
|
|
648fd33576 | ||
|
|
5265aa43e4 | ||
|
|
4db3b3cf1e | ||
|
|
29d77be648 | ||
|
|
cc7c9e4d0f | ||
|
|
b1efceccd4 | ||
|
|
195619e6d4 | ||
|
|
b17d4035c1 | ||
|
|
22230afa0a | ||
|
|
e32f9c3a24 | ||
|
|
22d8198058 | ||
|
|
bf2b511988 | ||
|
|
38be62c7e3 | ||
|
|
7736e092e7 | ||
|
|
db746f5bc7 | ||
|
|
68eb689450 | ||
|
|
65ec1bfa81 | ||
|
|
ed2849adf9 | ||
|
|
49c4aa6ce3 | ||
|
|
2e8cc89e34 | ||
|
|
ddcd8c58bf | ||
|
|
8fdd4e7b54 | ||
|
|
8fc643a815 | ||
|
|
626e8fc03b | ||
|
|
52780cb937 | ||
|
|
3bce3f412a | ||
|
|
1a99cb8bfe | ||
|
|
ff321763cf | ||
|
|
5a265408a3 | ||
|
|
c26c6c368c | ||
|
|
f1949781d6 | ||
|
|
755fefbfd4 | ||
|
|
3c2a10bf9f | ||
|
|
49c9746816 | ||
|
|
c2dae35966 | ||
|
|
a1c3ea2f86 | ||
|
|
3dcd4f3682 | ||
|
|
a6f57e1c4b | ||
|
|
2192ffe5af | ||
|
|
6b6977a090 | ||
|
|
c14f2c29b9 | ||
|
|
5d45176a1d | ||
|
|
b4079095fb | ||
|
|
3ec7649bae | ||
|
|
844cb5c810 | ||
|
|
6e8eaf097a | ||
|
|
6dc83b356a | ||
|
|
f5a39d628f | ||
|
|
fb24a27201 | ||
|
|
fa413bbab2 | ||
|
|
d843ec5fee | ||
|
|
67f40775ff | ||
|
|
7209cff29a | ||
|
|
78a62fe123 | ||
|
|
d9dc9e4616 | ||
|
|
5da941b82c | ||
|
|
bd0086c1c7 | ||
|
|
deccbabcc1 | ||
|
|
8e7240a556 | ||
|
|
828d5ffaab | ||
|
|
ed8d9dadfa | ||
|
|
7ae844f0a0 | ||
|
|
b7ae1c1076 | ||
|
|
5136a64d12 | ||
|
|
123ca0fdcd | ||
|
|
1d77452fe0 | ||
|
|
25ab93a881 | ||
|
|
9c0983f1b6 | ||
|
|
9aaa6e3ea0 | ||
|
|
65397f6de1 | ||
|
|
870d0441a8 | ||
|
|
5e771c5678 | ||
|
|
93b1072cba | ||
|
|
bddc80bc66 | ||
|
|
1b8ca1712c | ||
|
|
9a933788be | ||
|
|
541abf5687 | ||
|
|
fd08750e1c | ||
|
|
426bf4b5bb | ||
|
|
2331d4f9a1 | ||
|
|
c77669f3d1 | ||
|
|
429ab205d4 | ||
|
|
3d1f01ffc1 | ||
|
|
1d866e8ae0 | ||
|
|
d4069fa634 | ||
|
|
a8ad388fba | ||
|
|
c83802fae1 | ||
|
|
efef236fdf | ||
|
|
561e6cd27b | ||
|
|
5f72504de1 | ||
|
|
4741182b25 | ||
|
|
771568f42a | ||
|
|
620252cadb | ||
|
|
6921894f8e | ||
|
|
0e553aa6b8 | ||
|
|
39a289145c | ||
|
|
e156cd6379 | ||
|
|
e71fa9210f | ||
|
|
e9a1f1c5d8 | ||
|
|
f69b79fd16 | ||
|
|
2e9f10934f | ||
|
|
cc57088f5c | ||
|
|
4b249fe8ec | ||
|
|
eab1671214 | ||
|
|
6f574cd60f | ||
|
|
4bef7a3a52 | ||
|
|
580933998e | ||
|
|
b4a56bc45e | ||
|
|
adee283caf | ||
|
|
f2763d7abe | ||
|
|
1652839086 | ||
|
|
abfadce7d9 | ||
|
|
1ec626f39b | ||
|
|
9bc0d18996 | ||
|
|
7e02831897 | ||
|
|
c54d7ec445 | ||
|
|
a4faffb813 | ||
|
|
4715df1518 | ||
|
|
fc8d0f6ac7 | ||
|
|
dc83bb8d18 | ||
|
|
477ddf9119 | ||
|
|
ef864403a1 | ||
|
|
4fcf7bf01a | ||
|
|
bb514467f6 | ||
|
|
bec7e79ee8 | ||
|
|
247a8eedce | ||
|
|
cc35f62514 | ||
|
|
8d1c7a2524 | ||
|
|
3070deb295 | ||
|
|
e1f6e60cea | ||
|
|
3aa14f54b7 | ||
|
|
75de2238d1 | ||
|
|
826900822c | ||
|
|
6584240277 | ||
|
|
dd408d82da | ||
|
|
5ddb8ea124 | ||
|
|
7f3983a3d6 | ||
|
|
0c70a4ceb3 | ||
|
|
adc0923c7e | ||
|
|
cb7337f466 | ||
|
|
b38fac8bf1 | ||
|
|
68e6919d41 | ||
|
|
57ebde2b9e | ||
|
|
10663ab37f | ||
|
|
0a67c9715c | ||
|
|
c403ce3b4f | ||
|
|
3cdf9e4105 | ||
|
|
3cdf3544fb | ||
|
|
faf9b589c4 | ||
|
|
060f32d452 | ||
|
|
4c6af87ad0 | ||
|
|
a064e3a200 | ||
|
|
1106524121 | ||
|
|
451ee87e9f | ||
|
|
17d4fc4fa7 | ||
|
|
6bd9f7f5f0 | ||
|
|
289ffb788c | ||
|
|
45805622e4 | ||
|
|
467f5c7a75 | ||
|
|
ca2ce13817 | ||
|
|
57fb74f262 | ||
|
|
cde997edfa | ||
|
|
2b8472fe54 | ||
|
|
65ade073a9 | ||
|
|
e881b40ab2 | ||
|
|
903f675b32 | ||
|
|
3ebd956090 | ||
|
|
b01f1d2486 | ||
|
|
4c0c69b388 | ||
|
|
16d58560a0 | ||
|
|
dd556e7a89 | ||
|
|
12acd11814 | ||
|
|
c4d3283879 | ||
|
|
de7e760788 | ||
|
|
c2268caaf7 | ||
|
|
235de6566e | ||
|
|
acd9040346 | ||
|
|
e24cfdc556 | ||
|
|
53a46f68a2 | ||
|
|
af667f77e6 | ||
|
|
ce4e8ec178 | ||
|
|
4129ae5395 | ||
|
|
92c6c617de | ||
|
|
a731ad4433 | ||
|
|
3110c4a772 | ||
|
|
d50356dbab | ||
|
|
d1ba86a952 | ||
|
|
03f7aa9dab | ||
|
|
8c63697f41 | ||
|
|
e7dccca782 | ||
|
|
8d0ed21c04 | ||
|
|
bcc56a4557 | ||
|
|
7bb2f3a27b | ||
|
|
2d4cc7e71f | ||
|
|
fba61abd2a | ||
|
|
94bfe8ea0d | ||
|
|
31619f0a83 | ||
|
|
34037e0d88 | ||
|
|
647102fc94 | ||
|
|
a533b33fc6 | ||
|
|
995a71c854 | ||
|
|
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 | ||
|
|
915778fb69 | ||
|
|
e9b445c853 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,3 +7,4 @@ latest_updates.json
|
||||
.wnf-lang-status
|
||||
*.egg-info
|
||||
dist/
|
||||
erpnext/docs/current
|
||||
|
||||
@@ -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.7.0'
|
||||
__version__ = '6.24.2'
|
||||
|
||||
@@ -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')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldtype": "Section Break",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -41,9 +43,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,
|
||||
@@ -63,11 +67,13 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Account Name",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "account_name",
|
||||
"oldfieldtype": "Data",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -87,10 +93,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Is Group",
|
||||
"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,
|
||||
@@ -109,12 +117,14 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Company",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "company",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Company",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -132,11 +142,13 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Root Type",
|
||||
"label": "Root Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "\nAsset\nLiability\nIncome\nExpense\nEquity",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -154,11 +166,13 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Report Type",
|
||||
"label": "Report Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "\nBalance Sheet\nProfit and Loss",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -178,11 +192,13 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Currency",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Currency",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -200,9 +216,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,
|
||||
@@ -222,12 +240,14 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Parent Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "parent_account",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Account",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -246,13 +266,15 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Account Type",
|
||||
"label": "Account Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "account_type",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "\nBank\nCash\nTax\nChargeable\nWarehouse\nReceivable\nPayable\nEquity\nFixed Asset\nCost of Goods Sold\nExpense Account\nRound Off\nIncome Account\nStock Received But Not Billed\nExpenses Included In Valuation\nStock Adjustment\nStock\nTemporary",
|
||||
"options": "\nBank\nCash\nDepreciation\nTax\nChargeable\nWarehouse\nReceivable\nPayable\nEquity\nFixed Asset\nCost of Goods Sold\nExpense Account\nRound Off\nIncome Account\nStock Received But Not Billed\nExpenses Included In Valuation\nStock Adjustment\nStock\nTemporary",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -272,11 +294,13 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Rate",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "tax_rate",
|
||||
"oldfieldtype": "Currency",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -295,13 +319,15 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Frozen",
|
||||
"label": "Frozen",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "freeze_account",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "No\nYes",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -320,10 +346,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Warehouse",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Warehouse",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -341,11 +369,13 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Balance must be",
|
||||
"label": "Balance must be",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "\nDebit\nCredit",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -364,9 +394,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Lft",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -385,9 +417,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Rgt",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -406,9 +440,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Old Parent",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -426,7 +462,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"modified": "2015-10-02 07:38:37.436071",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-12-12 10:19:54.365839",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Account",
|
||||
|
||||
@@ -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()
|
||||
@@ -65,12 +68,33 @@ class Account(Document):
|
||||
if self.root_type != db_value.root_type:
|
||||
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")
|
||||
@@ -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")):
|
||||
@@ -192,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
|
||||
|
||||
|
||||
@@ -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,414 @@
|
||||
{
|
||||
"country_code": "at",
|
||||
"name": "Austria - Chart of Accounts - Einheitskontenrahmen provided by fairkom.eu",
|
||||
"tree": {
|
||||
"Klasse 0 Aktiva: Anlageverm\u00f6gen": {
|
||||
"0100 Konzessionen ": {"account_type": "Fixed Asset"},
|
||||
"0110 Patentrechte und Lizenzen ": {"account_type": "Fixed Asset"},
|
||||
"0120 Datenverarbeitungsprogramme ": {"account_type": "Fixed Asset"},
|
||||
"0130 Marken, Warenzeichen und Musterschutzrechte, sonstige Urheberrechte ": {"account_type": "Fixed Asset"},
|
||||
"0140 Pacht- und Mietrechte ": {"account_type": "Fixed Asset"},
|
||||
"0150 Bezugs- und ähnliche Rechte ": {"account_type": "Fixed Asset"},
|
||||
"0160 Geschäfts-/Firmenwert ": {"account_type": "Fixed Asset"},
|
||||
"0170 Umgründungsmehrwert ": {"account_type": "Fixed Asset"},
|
||||
"0180 Geleistete Anzahlungen auf immaterielle Vermögensgegenstände": {"account_type": "Fixed Asset"},
|
||||
"0190 Kumulierte Abschreibungen zu immateriellen Vermögensgegenständen ": {"account_type": "Fixed Asset"},
|
||||
"0200 Unbebaute Grundstücke, soweit nicht landwirtschaftlich genutzt ": {"account_type": "Fixed Asset"},
|
||||
"0210 Bebaute Grundstücke (Grundwert) ": {"account_type": "Fixed Asset"},
|
||||
"0220 Landwirtschaftlich genutzte Grundstücke ": {"account_type": "Fixed Asset"},
|
||||
"0230 Grundstücksgleiche Rechte ": {"account_type": "Fixed Asset"},
|
||||
"0300 Betriebs- und Geschäftsgebäude auf eigenem Grund ": {"account_type": "Fixed Asset"},
|
||||
"0310 Wohn- und Sozialgebäude auf eigenem Grund ": {"account_type": "Fixed Asset"},
|
||||
"0320 Betriebs- und Geschäftsgebäude auf fremdem Grund ": {"account_type": "Fixed Asset"},
|
||||
"0330 Wohn- und Sozialgebäude auf fremdem Grund ": {"account_type": "Fixed Asset"},
|
||||
"0340 Grundstückseinrichtungen auf eigenem Grund ": {"account_type": "Fixed Asset"},
|
||||
"0350 Grundstückseinrichtungen auf fremdem Grund ": {"account_type": "Fixed Asset"},
|
||||
"0360 Bauliche Investitionen in fremden (gepachteten) Betriebs- und Geschäftsgebäuden": {"account_type": "Fixed Asset"},
|
||||
"0370 Bauliche Investitionen in fremden (gepachteten) Wohn- und Sozialgebäuden": {"account_type": "Fixed Asset"},
|
||||
"0390 Kumulierte Abschreibungen zu Grundstücken ": {"account_type": "Fixed Asset"},
|
||||
"0400 Maschinen und Geräte ": {"account_type": "Fixed Asset"},
|
||||
"0500 Maschinenwerkzeuge ": {"account_type": "Fixed Asset"},
|
||||
"0510 Allgemeine Werkzeuge und Handwerkzeuge ": {"account_type": "Fixed Asset"},
|
||||
"0520 Prototypen, Formen, Modelle ": {"account_type": "Fixed Asset"},
|
||||
"0530 Andere Erzeugungshilfsmittel (auch Softwarewerkzeuge)": {"account_type": "Fixed Asset"},
|
||||
"0540 Hebezeuge und Montageanlagen ": {"account_type": "Fixed Asset"},
|
||||
"0550 Geringwertige Vermögensgegenstände, soweit im Erzeugungsprozess ": {"account_type": "Fixed Asset"},
|
||||
"0560 Festwerte technische Anlagen und Maschinen ": {"account_type": "Fixed Asset"},
|
||||
"0590 Kumulierte Abschreibungen zu technischen Anlagen und Maschinen ": {"account_type": "Fixed Asset"},
|
||||
"0600 Betriebs- und Geschäftsausstattung, soweit nicht gesondert angeführt ": {"account_type": "Fixed Asset"},
|
||||
"0610 Andere Anlagen, soweit nicht gesondert angeführt ": {"account_type": "Fixed Asset"},
|
||||
"0620 Büromaschinen, EDV-Anlagen ": {"account_type": "Fixed Asset"},
|
||||
"0630 PKW und Kombis ": {"account_type": "Fixed Asset"},
|
||||
"0640 LKW ": {"account_type": "Fixed Asset"},
|
||||
"0650 Andere Beförderungsmittel ": {"account_type": "Fixed Asset"},
|
||||
"0660 Gebinde ": {"account_type": "Fixed Asset"},
|
||||
"0670 Geringwertige Vermögensgegenstände, soweit nicht im Erzeugungssprozess verwendet": {"account_type": "Fixed Asset"},
|
||||
"0680 Festwerte außer technische Anlagen und Maschinen ": {"account_type": "Fixed Asset"},
|
||||
"0690 Kumulierte Abschreibungen zu anderen Anlagen, Betriebs- und Geschäftsausstattung": {"account_type": "Fixed Asset"},
|
||||
"0700 Geleistete Anzahlungen auf Sachanlagen ": {"account_type": "Fixed Asset"},
|
||||
"0710 Anlagen in Bau ": {"account_type": "Fixed Asset"},
|
||||
"0790 Kumulierte Abschreibungen zu geleisteten Anzahlungen auf Sachanlagen ": {"account_type": "Fixed Asset"},
|
||||
"0800 Anteile an verbundenen Unternehmen ": {"account_type": "Fixed Asset"},
|
||||
"0810 Beteiligungen an Gemeinschaftsunternehmen ": {"account_type": "Fixed Asset"},
|
||||
"0820 Beteiligungen an angeschlossenen (assoziierten) Unternehmen ": {"account_type": "Fixed Asset"},
|
||||
"0830 Eigene Anteile, Anteile an herrschenden oder mit Mehrheit beteiligten ": {"account_type": "Fixed Asset"},
|
||||
"0840 Sonstige Beteiligungen ": {"account_type": "Fixed Asset"},
|
||||
"0850 Ausleihungen an verbundene Unternehmen ": {"account_type": "Fixed Asset"},
|
||||
"0860 Ausleihungen an Unternehmen mit Beteiligungsverhältnis": {"account_type": "Fixed Asset"},
|
||||
"0870 Ausleihungen an Gesellschafter ": {"account_type": "Fixed Asset"},
|
||||
"0880 Sonstige Ausleihungen ": {"account_type": "Fixed Asset"},
|
||||
"0890 Anteile an Kapitalgesellschaften ohne Beteiligungscharakter ": {"account_type": "Fixed Asset"},
|
||||
"0900 Anteile an Personengesellschaften ohne Beteiligungscharakter ": {"account_type": "Fixed Asset"},
|
||||
"0910 Genossenschaftsanteile ohne Beteiligungscharakter ": {"account_type": "Fixed Asset"},
|
||||
"0920 Anteile an Investmentfonds ": {"account_type": "Fixed Asset"},
|
||||
"0930 Festverzinsliche Wertpapiere des Anlagevermögens ": {"account_type": "Fixed Asset"},
|
||||
"0980 Geleistete Anzahlungen auf Finanzanlagen ": {"account_type": "Fixed Asset"},
|
||||
"0990 Kumulierte Abschreibungen zu Finanzanlagen ": {"account_type": "Fixed Asset"},
|
||||
"root_type": "Asset"
|
||||
},
|
||||
"Klasse 1 Aktiva: Vorr\u00e4te": {
|
||||
"1000 Bezugsverrechnung": {"account_type": "Stock"},
|
||||
"1100 Rohstoffe": {"account_type": "Stock"},
|
||||
"1200 Bezogene Teile": {"account_type": "Stock"},
|
||||
"1300 Hilfsstoffe": {"account_type": "Stock"},
|
||||
"1350 Betriebsstoffe": {"account_type": "Stock"},
|
||||
"1360 Vorrat Energietraeger": {"account_type": "Stock"},
|
||||
"1400 Unfertige Erzeugnisse": {"account_type": "Stock"},
|
||||
"1500 Fertige Erzeugnisse": {"account_type": "Stock"},
|
||||
"1600 Handelswarenvorrat": {"account_type": "Stock Received But Not Billed"},
|
||||
"1700 Noch nicht abrechenbare Leistungen": {"account_type": "Stock"},
|
||||
"1900 Wertberichtigungen": {"account_type": "Stock"},
|
||||
"1800 Geleistete Anzahlungen": {"account_type": "Stock"},
|
||||
"root_type": "Asset"
|
||||
},
|
||||
"Klasse 3 Passiva: Verbindlichkeiten": {
|
||||
"3020 Steuerr\u00fcckstellungen": {"account_type": "Tax"},
|
||||
"3040 Sonstige R\u00fcckstellungen": {"account_type": "Payable"},
|
||||
"3110 Verbindlichkeiten gegen\u00fcber Bank": {"account_type": "Payable"},
|
||||
"3150 Verbindlichkeiten Darlehen": {"account_type": "Payable"},
|
||||
"3185 Verbindlichkeiten Kreditkarte": {"account_type": "Payable"},
|
||||
"3380 Verbindlichkeiten aus der Annahme gezogener Wechsel u. d. Ausstellungen eigener Wechsel": {
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"3400 Verbindlichkeiten gegen\u00fc. verb. Untern., Verbindl. gegen\u00fc. Untern., mit denen eine Beteiligungsverh\u00e4lnis besteht": {},
|
||||
"3460 Verbindlichkeiten gegenueber Gesellschaftern": {"account_type": "Payable"},
|
||||
"3470 Einlagen stiller Gesellschafter": {"account_type": "Payable"},
|
||||
"3590 Verbindlichkeiten Kommunalabgaben": {"account_type": "Tax"},
|
||||
"3600 Verbindlichkeiten Sozialversicherung": {"account_type": "Payable"},
|
||||
"3000 Allgemeine Verbindlichkeiten (Schuld)": {"account_type": "Payable"},
|
||||
"3700 Sonstige Verbindlichkeiten": {"account_type": "Payable"},
|
||||
"3900 Passive Rechnungsabgrenzungsposten": {"account_type": "Payable"},
|
||||
"3100 Anleihen (einschlie\u00dflich konvertibler)": {"account_type": "Payable"},
|
||||
"3200 Erhaltene Anzahlungen auf Bestellungen": {"account_type": "Payable"},
|
||||
"3040 R\u00fcckstellungen f\u00fcr Abfertigung": {"account_type": "Payable"},
|
||||
"3010 R\u00fcckstellungen f\u00fcr Pensionen": {"account_type": "Payable"},
|
||||
"3530 USt. \u00a719 (reverse charge)": {
|
||||
"account_type": "Tax"
|
||||
},
|
||||
"3500 Verbindlichkeiten aus Umsatzsteuer": {"account_type": "Tax"},
|
||||
"3580 Umsatzsteuer Zahllast": {
|
||||
"account_type": "Tax"
|
||||
},
|
||||
"3510 Umsatzsteuer aus i.g. Erwerb 10%": {
|
||||
"account_type": "Tax"
|
||||
},
|
||||
"3520 Umsatzsteuer aus i.g. Erwerb 20%": {
|
||||
"account_type": "Tax"
|
||||
},
|
||||
"3560 Umsatzsteuer-Evidenzkonto f\u00fcr erhaltene Anzahlungen auf Bestellungen": {},
|
||||
"3360 Verbindlichkeiten aus Lieferungen u. Leistungen EU": {
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"3000 Verbindlichkeiten aus Lieferungen u. Leistungen Inland": {
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"3370 Verbindlichkeiten aus Lieferungen u. Leistungen sonst. Ausland": {
|
||||
"account_type": "Payable"
|
||||
},
|
||||
"3400 Verbindlichkeiten gegen\u00fcber verbundenen Unternehmen": {},
|
||||
"3570 Verrechnung Finanzamt": {
|
||||
"account_type": "Tax"
|
||||
},
|
||||
"root_type": "Liability"
|
||||
},
|
||||
"Klasse 2 Aktiva: Umlaufverm\u00f6gen, Rechnungsabgrenzungen": {
|
||||
"2030 Forderungen aus Lieferungen und Leistungen Inland (0% USt, umsatzsteuerfrei)": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2010 Forderungen aus Lieferungen und Leistungen Inland (10% USt, umsatzsteuerfrei)": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2000 Forderungen aus Lieferungen und Leistungen Inland (20% USt, umsatzsteuerfrei)": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2040 Forderungen aus Lieferungen und Leistungen Inland (sonstiger USt-Satz)": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2100 Forderungen aus Lieferungen und Leistungen EU": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2150 Forderungen aus Lieferungen und Leistungen Ausland (Nicht-EU)": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2200 Forderungen gegen\u00fcber verbundenen Unternehmen": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2250 Forderungen gegen\u00fcber Unternehmen, mit denen ein Beteiligungsverh\u00e4ltnis besteht": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2300 Sonstige Forderungen und Verm\u00f6gensgegenst\u00e4nde": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2630 Sonstige Wertpapiere": {
|
||||
"account_type": "Stock"
|
||||
},
|
||||
"2750 Kassenbest\u00e4nde in Fremdw\u00e4hrung": {
|
||||
"account_type": "Cash"
|
||||
},
|
||||
"2900 Aktive Rechnungsabrenzungsposten": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2600 Anteile an verbundenen Unternehmen": {
|
||||
"account_type": "Equity"
|
||||
},
|
||||
"2680 Besitzwechsel ohne Forderungen": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2950 Aktiviertes Disagio": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2610 Eigene Anteile und Wertpapiere an mit Mehrheit beteiligten Unternehmen": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2570 Einfuhrumsatzsteuer (bezahlt)": {"account_type": "Tax"},
|
||||
|
||||
"2460 Eingeforderte aber noch nicht eingezahlte Einlagen": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2180 Einzelwertberichtigungen zu Forderungen aus Lief. und Leist. Ausland": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2130 Einzelwertberichtigungen zu Forderungen aus Lief. und Leist. EU": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2080 Einzelwertberichtigungen zu Forderungen aus Lief. und Leist. Inland ": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2270 Einzelwertberichtigungen zu Forderungen gegen\u00fcber Unternehmen mit denen ein Beteiligungsverh\u00e4ltnis besteht": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2230 Einzelwertberichtigungen zu Forderungen gegen\u00fcber verbundenen Unternehmen": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2470 Einzelwertberichtigungen zu sonstigen Forderungen und Verm\u00f6gensgegenst\u00e4nden": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2700 Kassenbestand": {
|
||||
"account_type": "Cash"
|
||||
},
|
||||
"2190 Pauschalwertberichtigungen zu Forderungen aus Lief. und Leist. sonstiges Ausland": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2130 Pauschalwertberichtigungen zu Forderungen aus Lief. und Leist. EU": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2100 Pauschalwertberichtigungen zu Forderungen aus Lief. und Leist. Inland ": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2280 Pauschalwertberichtigungen zu Forderungen gegen\u00fcber Unternehmen mit denen ein Beteiligungsverh\u00e4ltnis besteht": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2240 Pauschalwertberichtigungen zu Forderungen gegen\u00fcber verbundenen Unternehmen": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2480 Pauschalwertberichtigungen zu sonstigen Forderungen und Verm\u00f6gensgegenst\u00e4nden": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2740 Postwertzeichen": {
|
||||
"account_type": "Cash"
|
||||
},
|
||||
"2780 Schecks in Euro": {
|
||||
"account_type": "Cash"
|
||||
},
|
||||
"2800 Guthaben bei Kreditinstitut": {
|
||||
"account_type": "Bank"
|
||||
},
|
||||
"2810 Guthaben bei Paypal": {
|
||||
"account_type": "Bank"
|
||||
},
|
||||
"2930 Mietvorauszahlungen": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2980 Abgrenzung latenter Steuern": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2500 Vorsteuer": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"2510 Vorsteuer aus innergemeinschaftlichem Erwerb 10%": {
|
||||
"account_type": "Tax"
|
||||
},
|
||||
"2520 Vorsteuer aus innergemeinschaftlichem Erwerb 20%": {
|
||||
"account_type": "Tax"
|
||||
},
|
||||
"2530 Vorsteuer \u00a719/Art 19 ( reverse charge ) ": {
|
||||
"account_type": "Tax"
|
||||
},
|
||||
"2690 Wertberichtigungen zu Wertpapieren und Anteilen": {
|
||||
"account_type": "Receivable"
|
||||
},
|
||||
"root_type": "Asset"
|
||||
},
|
||||
"Klasse 4: Betriebliche Erträge": {
|
||||
"4000 Erlöse 20 %": {"account_type": "Income Account"},
|
||||
"4020 Erl\u00f6se 0 % steuerbefreit": {"account_type": "Income Account"},
|
||||
"4010 Erl\u00f6se 10 %": {"account_type": "Income Account"},
|
||||
"4030 Erl\u00f6se 13 %": {"account_type": "Income Account"},
|
||||
"4040 Erl\u00f6se 0 % innergemeinschaftliche Lieferungen": {"account_type": "Income Account"},
|
||||
"4400 Erl\u00f6sreduktion 0 % steuerbefreit": {"account_type": "Expense Account"},
|
||||
"4410 Erl\u00f6sreduktion 10 %": {"account_type": "Expense Account"},
|
||||
"4420 Erl\u00f6sreduktion 20 %": {"account_type": "Expense Account"},
|
||||
"4430 Erl\u00f6sreduktion 13 %": {"account_type": "Expense Account"},
|
||||
"4440 Erl\u00f6sreduktion 0 % innergemeinschaftliche Lieferungen": {"account_type": "Expense Account"},
|
||||
"4500 Ver\u00e4nderungen des Bestandes an fertigen und unfertigen Erzeugn. sowie an noch nicht abrechenbaren Leistungen": {"account_type": "Income Account"},
|
||||
"4580 Aktivierte Eigenleistungen": {"account_type": "Income Account"},
|
||||
"4600 Erl\u00f6se aus dem Abgang vom Anlageverm\u00f6gen, ausgen. Finanzanlagen": {"account_type": "Income Account"},
|
||||
"4630 Ertr\u00e4ge aus dem Abgang vom Anlageverm\u00f6gen, ausgen. Finanzanlagen": {"account_type": "Income Account"},
|
||||
"4660 Ertr\u00e4ge aus der Zuschreibung zum Anlageverm\u00f6gen, ausgen. Finanzanlagen": {"account_type": "Income Account"},
|
||||
"4700 Ertr\u00e4ge aus der Aufl\u00f6sung von R\u00fcckstellungen": {"account_type": "Income Account"},
|
||||
"4800 \u00dcbrige betriebliche Ertr\u00e4ge": {"account_type": "Income Account"},
|
||||
"root_type": "Income"
|
||||
},
|
||||
"Klasse 5: Aufwand f\u00fcr Material und Leistungen": {
|
||||
"5000 Einkauf Partnerleistungen": {"account_type": "Cost of Goods Sold"},
|
||||
"5100 Verbrauch an Rohstoffen": {"account_type": "Cost of Goods Sold"},
|
||||
"5200 Verbrauch von bezogenen Fertig- und Einzelteilen": {"account_type": "Cost of Goods Sold"},
|
||||
"5300 Verbrauch von Hilfsstoffen": {"account_type": "Cost of Goods Sold"},
|
||||
"5340 Verbrauch Verpackungsmaterial": {"account_type": "Cost of Goods Sold"},
|
||||
"5470 Verbrauch von Kleinmaterial": {"account_type": "Cost of Goods Sold"},
|
||||
"5450 Verbrauch von Reinigungsmaterial": {"account_type": "Cost of Goods Sold"},
|
||||
"5400 Verbrauch von Betriebsstoffen": {"account_type": "Cost of Goods Sold"},
|
||||
"5500 Verbrauch von Werkzeugen und anderen Erzeugungshilfsmittel": {"account_type": "Cost of Goods Sold"},
|
||||
"5600 Verbrauch von Brenn- und Treibstoffen, Energie und Wasser": {"account_type": "Cost of Goods Sold"},
|
||||
"5700 Bearbeitung durch Dritte": {"account_type": "Cost of Goods Sold"},
|
||||
"5900 Aufwandsstellenrechnung Material": {"account_type": "Cost of Goods Sold"},
|
||||
"5820 Skontoertr\u00e4ge (20% USt.)": {"account_type": "Income Account"},
|
||||
"5810 Skontoertr\u00e4ge (10% USt.)": {"account_type": "Income Account"},
|
||||
"5010 Handelswareneinkauf 10 %": {"account_type": "Cost of Goods Sold"},
|
||||
"5020 Handelswareneinkauf 20 %": {"account_type": "Cost of Goods Sold"},
|
||||
"5040 Handelswareneinkauf innergemeinschaftlicher Erwerb 10 % VSt/10 % USt": {"account_type": "Cost of Goods Sold"},
|
||||
"5050 Handelswareneinkauf innergemeinschaftlicher Erwerb 20 % VSt/20 % USt": {"account_type": "Cost of Goods Sold"},
|
||||
"5070 Handelswareneinkauf innergemeinschaftlicher Erwerb ohne Vorsteuerabzug und 10 % USt": {"account_type": "Cost of Goods Sold"},
|
||||
"5080 Handelswareneinkauf innergemeinschaftlicher Erwerb ohne Vorsteuerabzug und 20 % USt": {"account_type": "Cost of Goods Sold"},
|
||||
"root_type": "Expense"
|
||||
},
|
||||
"Klasse 6: Personalaufwand": {
|
||||
"6000 L\u00f6hne": {"account_type": "Payable"},
|
||||
"6200 Geh\u00e4lter": {"account_type": "Payable"},
|
||||
"6400 Aufwendungen f\u00fcr Abfertigungen": {"account_type": "Payable"},
|
||||
"6450 Aufwendungen f\u00fcr Altersversorgung": {"account_type": "Payable"},
|
||||
"6500 Gesetzlicher Sozialaufwand Arbeiter": {"account_type": "Payable"},
|
||||
"6560 Gesetzlicher Sozialaufwand Angestellte": {"account_type": "Payable"},
|
||||
"6600 Lohnabh\u00e4ngige Abgaben und Pflichtbeitr\u00e4gte": {"account_type": "Payable"},
|
||||
"6660 Gehaltsabh\u00e4ngige Abgaben und Pflichtbeitr\u00e4gte": {"account_type": "Payable"},
|
||||
"6700 Sonstige Sozialaufwendungen": {"account_type": "Payable"},
|
||||
"6900 Aufwandsstellenrechnung Personal": {"account_type": "Payable"},
|
||||
"root_type": "Expense"
|
||||
},
|
||||
"Klasse 7: Abschreibungen und sonstige betriebliche Aufwendungen": {
|
||||
"7010 Abschreibungen auf das Anlageverm\u00f6gen (ausgenommen Finanzanlagen)": {"account_type": "Depreciation"},
|
||||
"7100 Sonstige Steuern und Geb\u00fchren": {"account_type": "Tax"},
|
||||
"7200 Instandhaltung u. Reinigung durch Dritte, Entsorgung, Energie": {"account_type": "Expense Account"},
|
||||
"7300 Transporte durch Dritte": {"account_type": "Expense Account"},
|
||||
"7310 Fahrrad - Aufwand": {"account_type": "Expense Account"},
|
||||
"7320 Kfz - Aufwand": {"account_type": "Expense Account"},
|
||||
"7330 LKW - Aufwand": {"account_type": "Expense Account"},
|
||||
"7340 Lastenrad - Aufwand": {"account_type": "Expense Account"},
|
||||
"7350 Reise- und Fahraufwand": {"account_type": "Expense Account"},
|
||||
"7360 Tag- und N\u00e4chtigungsgelder": {"account_type": "Expense Account"},
|
||||
"7380 Nachrichtenaufwand": {"account_type": "Expense Account"},
|
||||
"7400 Miet- und Pachtaufwand": {"account_type": "Expense Account"},
|
||||
"7440 Leasingaufwand": {"account_type": "Expense Account"},
|
||||
"7480 Lizenzaufwand": {"account_type": "Expense Account"},
|
||||
"7500 Aufwand f\u00fcr beigestelltes Personal": {"account_type": "Expense Account"},
|
||||
"7540 Provisionen an Dritte": {"account_type": "Expense Account"},
|
||||
"7580 Aufsichtsratsverg\u00fctungen": {"account_type": "Expense Account"},
|
||||
"7610 Druckerzeugnisse und Vervielf\u00e4ltigungen": {"account_type": "Expense Account"},
|
||||
"7650 Werbung und Repr\u00e4sentationen": {"account_type": "Expense Account"},
|
||||
"7700 Versicherungen": {"account_type": "Expense Account"},
|
||||
"7750 Beratungs- und Pr\u00fcfungsaufwand": {"account_type": "Expense Account"},
|
||||
"7800 Forderungsverluste und Schadensf\u00e4lle": {"account_type": "Expense Account"},
|
||||
"7840 Verschiedene betriebliche Aufwendungen": {"account_type": "Expense Account"},
|
||||
"7910 Aufwandsstellenrechung der Hersteller": {"account_type": "Expense Account"},
|
||||
"7060 Sofortabschreibungen geringwertig": {"account_type": "Expense Account"},
|
||||
"7070 Abschreibungen vom Umlaufverm\u00f6gen, soweit diese die im Unternehmen \u00fcblichen Abschreibungen \u00fcbersteigen": {"account_type": "Depreciation"},
|
||||
"7900 Aufwandsstellenrechnung": {"account_type": "Expense Account"},
|
||||
"7770 Aus- und Fortbildung": {"account_type": "Expense Account"},
|
||||
"7820 Buchwert abgegangener Anlagen, ausgenommen Finanzanlagen": {"account_type": "Expense Account"},
|
||||
"7600 B\u00fcromaterial und Drucksorten": {"account_type": "Expense Account"},
|
||||
"7630 Fachliteratur und Zeitungen ": {"account_type": "Expense Account"},
|
||||
"7960 Herstellungskosten der zur Erzielung der Umsatzerl\u00f6se erbrachten Leistungen": {"account_type": "Expense Account"},
|
||||
"7780 Mitgliedsbeitr\u00e4ge": {"account_type": "Expense Account"},
|
||||
"7880 Skontoertr\u00e4ge auf sonstige betriebliche Aufwendungen": {"account_type": "Expense Account"},
|
||||
"7990 Sonstige betrieblichen Aufwendungen": {"account_type": "Expense Account"},
|
||||
"7680 Spenden und Trinkgelder": {"account_type": "Expense Account"},
|
||||
"7790 Spesen des Geldverkehrs": {"account_type": "Expense Account"},
|
||||
"7830 Verluste aus dem Abgang vom Anlageverm\u00f6gen, ausgenommen Finanzanlagen": {"account_type": "Expense Account"},
|
||||
"7970 Vertriebskosten": {"account_type": "Expense Account"},
|
||||
"7980 Verwaltungskosten": {"account_type": "Expense Account"},
|
||||
"root_type": "Expense"
|
||||
},
|
||||
"Klasse 8: Finanz- und ausserordentliche Ertr\u00e4ge und Aufwendungen": {
|
||||
"8000 Ertr\u00e4ge aus Beteiligungen": {"account_type": "Income Account"},
|
||||
"8050 Ertr\u00e4ge aus anderen Wertpapieren und Ausleihungen des Finanzanlageverm\u00f6gens": {"account_type": "Income Account"},
|
||||
"8100 Zinsen aus Bankguthaben": {"account_type": "Income Account"},
|
||||
"8110 Zinsen aus gewaehrten Darlehen": {"account_type": "Income Account"},
|
||||
"8130 Verzugszinsenertraege": {"account_type": "Income Account"},
|
||||
"8220 Aufwendungen aus Beteiligungen": {"account_type": "Expense Account"},
|
||||
"8260 Aufwendungen aus sonst. Fiananzanlagen und aus Wertpapieren des Umlaufverm\u00f6gens": {},
|
||||
"8280 Zinsen und \u00e4hnliche Aufwendungem": {"account_type": "Expense Account"},
|
||||
"8400 Au\u00dferordentliche Ertr\u00e4ge": {"account_type": "Income Account"},
|
||||
"8450 Au\u00dferordentliche Aufwendungen": {"account_type": "Expense Account"},
|
||||
"8500 Steuern vom Einkommen und vom Ertrag": {
|
||||
"account_type": "Tax"
|
||||
},
|
||||
"8600 Aufl\u00f6sung unversteuerten R\u00fccklagen": {"account_type": "Income Account"},
|
||||
"8700 Aufl\u00f6sung von Kapitalr\u00fccklagen": {"account_type": "Income Account"},
|
||||
"8750 Aufl\u00f6sung von Gewinnr\u00fccklagen": {"account_type": "Income Account"},
|
||||
"8800 Zuweisung zu unversteuerten R\u00fccklagen": {"account_type": "Expense Account"},
|
||||
"8900 Zuweisung zu Gewinnr\u00fccklagen": {"account_type": "Expense Account"},
|
||||
"8100 Buchwert abgegangener Beteiligungen": {"account_type": "Expense Account"},
|
||||
"8130 Buchwert abgegangener Wertpapiere des Umlaufverm\u00f6gens": {"account_type": "Expense Account"},
|
||||
"8120 Buchwert abgegangener sonstiger Finanzanlagen": {"account_type": "Expense Account"},
|
||||
"8990 Gewinnabfuhr bzw. Verlust\u00fcberrechnung aus Ergebnisabf\u00fchrungsvertr\u00e4gen": {"account_type": "Expense Account"},
|
||||
"8350 nicht ausgenutzte Lieferantenskonti": {"account_type": "Expense Account"},
|
||||
"root_type": "Income"
|
||||
},
|
||||
"Klasse 9 Passiva: Eigenkapital, R\u00fccklagen, stille Einlagen, Abschlusskonten": {
|
||||
"9000 Gezeichnetes bzw. gewidmetes Kapital": {
|
||||
"account_type": "Equity"
|
||||
},
|
||||
"9200 Kapitalr\u00fccklagen": {
|
||||
"account_type": "Equity"
|
||||
},
|
||||
"9300 Gewinnr\u00fccklagen": {
|
||||
"account_type": "Equity"
|
||||
},
|
||||
"9400 Bewertungsreserven uns sonst. unversteuerte R\u00fccklagen": {
|
||||
"account_type": "Equity"
|
||||
},
|
||||
"9600 Private Entnahmen": {"account_type": "Equity"},
|
||||
"9610 Privatsteuern": {"account_type": "Equity"},
|
||||
"9700 Einlagen stiller Gesellschafter ": {"account_type": "Equity"},
|
||||
"9900 Evidenzkonto": {"account_type": "Equity"},
|
||||
"9800 Er\u00f6ffnungsbilanzkonto (EBK)": {"account_type": "Equity"},
|
||||
"9880 Jahresergebnis laut Gewinn- und Verlustrechnung (G+V)": {"account_type": "Equity"},
|
||||
"9850 Schlussbilanzkonto (SBK)": {"account_type": "Round Off"},
|
||||
"9190 nicht eingeforderte ausstehende Einlagen und berechtigte Entnahmen von Gesellschaftern": {
|
||||
"account_type": "Equity"
|
||||
},
|
||||
"root_type": "Equity"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"country_code": "gt",
|
||||
"name": "Cuentas de Guatemala",
|
||||
"is_active": "Yes",
|
||||
"tree": {
|
||||
"Activos": {
|
||||
"Activo Corriente": {
|
||||
@@ -11,7 +10,10 @@
|
||||
"IVA por Cobrar": {},
|
||||
"Retenciones de IVA recibidas": {}
|
||||
},
|
||||
"Inventario": {}
|
||||
"Inventario": {
|
||||
"is_group": 1,
|
||||
"account_type": "Stock"
|
||||
}
|
||||
},
|
||||
"No Corriente": {
|
||||
"Activos Fijos": {},
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -7,6 +7,10 @@ from frappe.utils import flt, getdate, nowdate
|
||||
from frappe import msgprint, _
|
||||
from frappe.model.document import Document
|
||||
|
||||
form_grid_templates = {
|
||||
"journal_entries": "templates/form_grid/bank_reconciliation_grid.html"
|
||||
}
|
||||
|
||||
class BankReconciliation(Document):
|
||||
def get_details(self):
|
||||
if not (self.bank_account and self.from_date and self.to_date):
|
||||
@@ -15,19 +19,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 +42,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 +55,9 @@ 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:
|
||||
if not d.clearance_date:
|
||||
d.clearance_date = None
|
||||
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,46 @@
|
||||
"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
|
||||
}
|
||||
],
|
||||
"hide_heading": 0,
|
||||
@@ -249,7 +245,9 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"modified": "2015-10-02 07:38:39.149782",
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2016-02-17 06:50:40.074578",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Bank Reconciliation Detail",
|
||||
|
||||
@@ -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-10-02 07:38:40.727468",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:43.050558",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Budget Detail",
|
||||
|
||||
@@ -18,9 +18,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,
|
||||
"print_width": "50%",
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
@@ -40,11 +42,13 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Series",
|
||||
"label": "Series",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "C-FORM-",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -63,9 +67,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "C-Form No",
|
||||
"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": "Received 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,10 +113,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"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": 1,
|
||||
@@ -126,9 +136,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,
|
||||
"print_width": "50%",
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
@@ -149,10 +161,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,
|
||||
@@ -171,10 +185,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Fiscal Year",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Fiscal Year",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -192,11 +208,13 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Quarter",
|
||||
"label": "Quarter",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "\nI\nII\nIII\nIV",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -215,10 +233,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Total Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company:company:default_currency",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -237,9 +257,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "State",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -257,9 +279,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,
|
||||
@@ -278,10 +302,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Invoices",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "C-Form Invoice Detail",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -300,10 +326,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Total Invoiced Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company:company:default_currency",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -322,10 +350,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Amended From",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"options": "C-Form",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -344,7 +374,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 3,
|
||||
"modified": "2015-10-02 07:38:40.926061",
|
||||
"modified": "2016-02-03 01:09:33.043437",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "C-Form",
|
||||
@@ -412,5 +442,7 @@
|
||||
}
|
||||
],
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0
|
||||
"read_only_onload": 0,
|
||||
"sort_order": "DESC",
|
||||
"timeline_field": "customer"
|
||||
}
|
||||
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-10-02 07:38:41.105885",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:43.221484",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "C-Form Invoice Detail",
|
||||
|
||||
@@ -51,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) {
|
||||
@@ -62,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-10-02 07:38:42.617993",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:43.870712",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Cost Center",
|
||||
|
||||
@@ -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-10-02 07:38:50.942038",
|
||||
"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
|
||||
|
||||
@@ -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-10-02 07:38:51.045350",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:47.344839",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Fiscal Year Company",
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Posting Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "posting_date",
|
||||
"oldfieldtype": "Date",
|
||||
@@ -42,6 +43,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Transaction Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "transaction_date",
|
||||
"oldfieldtype": "Date",
|
||||
@@ -65,6 +67,7 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "account",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -89,6 +92,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Party Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "DocType",
|
||||
"permlevel": 0,
|
||||
@@ -111,6 +115,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Party",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "party_type",
|
||||
"permlevel": 0,
|
||||
@@ -133,6 +138,7 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Cost Center",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "cost_center",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -157,6 +163,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Debit Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "debit",
|
||||
"oldfieldtype": "Currency",
|
||||
@@ -182,6 +189,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Credit Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "credit",
|
||||
"oldfieldtype": "Currency",
|
||||
@@ -207,6 +215,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Account Currency",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Currency",
|
||||
"permlevel": 0,
|
||||
@@ -230,6 +239,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Debit Amount in Account Currency",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "currency",
|
||||
"permlevel": 0,
|
||||
@@ -253,6 +263,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Credit Amount in Account Currency",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "currency",
|
||||
"permlevel": 0,
|
||||
@@ -276,6 +287,7 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Against",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "against",
|
||||
"oldfieldtype": "Text",
|
||||
@@ -299,6 +311,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Against Voucher Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "against_voucher_type",
|
||||
"oldfieldtype": "Data",
|
||||
@@ -323,6 +336,7 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Against Voucher",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "against_voucher",
|
||||
"oldfieldtype": "Data",
|
||||
@@ -347,6 +361,7 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Voucher Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "voucher_type",
|
||||
"oldfieldtype": "Select",
|
||||
@@ -371,6 +386,7 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Voucher No",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "voucher_no",
|
||||
"oldfieldtype": "Data",
|
||||
@@ -395,6 +411,7 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Remarks",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "remarks",
|
||||
"oldfieldtype": "Text",
|
||||
@@ -418,6 +435,7 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Is Opening",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "is_opening",
|
||||
"oldfieldtype": "Select",
|
||||
@@ -442,6 +460,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Is Advance",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "is_advance",
|
||||
"oldfieldtype": "Select",
|
||||
@@ -466,6 +485,7 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Fiscal Year",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "fiscal_year",
|
||||
"oldfieldtype": "Select",
|
||||
@@ -490,6 +510,7 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Company",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "company",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -513,7 +534,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"modified": "2015-10-20 12:10:59.771050",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:47.382225",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "GL Entry",
|
||||
|
||||
@@ -6,10 +6,10 @@ import frappe
|
||||
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
|
||||
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, CustomerFrozen
|
||||
from erpnext.exceptions import InvalidAccountCurrency
|
||||
|
||||
exclude_from_linked_with = True
|
||||
|
||||
@@ -96,11 +96,7 @@ 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 = get_company_currency(self.company)
|
||||
@@ -120,7 +116,7 @@ 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 \
|
||||
@@ -142,14 +138,14 @@ 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),
|
||||
@@ -159,9 +155,9 @@ def update_outstanding_amt(account, party_type, party, against_voucher_type, aga
|
||||
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)
|
||||
|
||||
@@ -11,7 +11,7 @@ frappe.ui.form.on("Journal Entry", {
|
||||
frm.cscript.voucher_type(frm.doc);
|
||||
|
||||
if(frm.doc.docstatus==1) {
|
||||
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,
|
||||
@@ -347,6 +347,7 @@ 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');
|
||||
}
|
||||
}
|
||||
@@ -355,11 +356,11 @@ frappe.ui.form.on("Journal Entry Account", {
|
||||
},
|
||||
|
||||
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) {
|
||||
@@ -369,8 +370,15 @@ frappe.ui.form.on("Journal Entry Account", {
|
||||
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);
|
||||
}
|
||||
})
|
||||
@@ -399,8 +407,6 @@ $.extend(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",
|
||||
@@ -417,8 +423,9 @@ $.extend(erpnext.journal_entry, {
|
||||
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") {
|
||||
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: {
|
||||
@@ -433,11 +440,15 @@ $.extend(erpnext.journal_entry, {
|
||||
},
|
||||
callback: function(r) {
|
||||
if(r.message) {
|
||||
frappe.model.set_value(cdt, cdn, "exchange_rate", 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) {
|
||||
|
||||
@@ -19,10 +19,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "icon-flag",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -42,10 +44,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": 0,
|
||||
@@ -64,13 +68,15 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Entry Type",
|
||||
"label": "Entry Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "voucher_type",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "Journal Entry\nBank Entry\nCash Entry\nCredit Card Entry\nDebit Note\nCredit Note\nContra Entry\nExcise Entry\nWrite Off Entry\nOpening Entry",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -88,13 +94,15 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Series",
|
||||
"label": "Series",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "naming_series",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "JV-",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -112,10 +120,12 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldtype": "Column Break",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -135,11 +145,13 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Posting Date",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "posting_date",
|
||||
"oldfieldtype": "Date",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -158,11 +170,13 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldtype": "Section Break",
|
||||
"options": "icon-table",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -181,12 +195,14 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Accounting Entries",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "entries",
|
||||
"oldfieldtype": "Table",
|
||||
"options": "Journal Entry Account",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -204,9 +220,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,
|
||||
@@ -226,11 +244,13 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Reference Number",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "cheque_no",
|
||||
"oldfieldtype": "Data",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -249,11 +269,13 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Reference Date",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "cheque_date",
|
||||
"oldfieldtype": "Date",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -272,11 +294,13 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "User Remark",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "user_remark",
|
||||
"oldfieldtype": "Small Text",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -294,9 +318,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,
|
||||
@@ -315,12 +341,14 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Total Debit",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "total_debit",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "Company:company:default_currency",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -339,12 +367,14 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Total Credit",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "total_credit",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "Company:company:default_currency",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -364,12 +394,14 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Difference (Dr - Cr)",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "difference",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "Company:company:default_currency",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -389,10 +421,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Make Difference Entry",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldtype": "Button",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -411,10 +445,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Multi Currency",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -433,10 +469,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Total Amount",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"options": "Company:company:default_currency",
|
||||
"options": "",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 1,
|
||||
"reqd": 0,
|
||||
@@ -455,9 +493,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Total Amount in Words",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 1,
|
||||
"reqd": 0,
|
||||
@@ -476,10 +516,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Reference",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "icon-pushpin",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -498,11 +540,13 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Clearance Date",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "clearance_date",
|
||||
"oldfieldtype": "Date",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -522,11 +566,13 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Remark",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "remark",
|
||||
"oldfieldtype": "Small Text",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -544,9 +590,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,
|
||||
@@ -565,11 +613,13 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Bill No",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "bill_no",
|
||||
"oldfieldtype": "Data",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -588,11 +638,13 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Bill Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "bill_date",
|
||||
"oldfieldtype": "Date",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -611,11 +663,13 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Due Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "due_date",
|
||||
"oldfieldtype": "Date",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -635,10 +689,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Write Off",
|
||||
"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,
|
||||
@@ -658,11 +714,13 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Write Off Based On",
|
||||
"label": "Write Off Based On",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Accounts Receivable\nAccounts Payable",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 1,
|
||||
"reqd": 0,
|
||||
@@ -682,10 +740,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Get Outstanding Invoices",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "get_outstanding_invoices",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -703,10 +763,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,
|
||||
@@ -726,10 +788,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Write Off Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company:company:default_currency",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 1,
|
||||
"reqd": 0,
|
||||
@@ -748,10 +812,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Printing Settings",
|
||||
"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,
|
||||
@@ -770,9 +836,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Pay To / Recd From",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 1,
|
||||
"reqd": 0,
|
||||
@@ -790,10 +858,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,
|
||||
@@ -812,10 +882,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Letter Head",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Letter Head",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -834,12 +906,14 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Print Heading",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "select_print_heading",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Print Heading",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 1,
|
||||
"reqd": 0,
|
||||
@@ -858,11 +932,13 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "More Information",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldtype": "Section Break",
|
||||
"options": "icon-file-text",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -881,12 +957,14 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Company",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "company",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Company",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -905,12 +983,14 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Fiscal Year",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "fiscal_year",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "Fiscal Year",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
@@ -928,10 +1008,12 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldtype": "Column Break",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -952,13 +1034,15 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Is Opening",
|
||||
"label": "Is Opening",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "is_opening",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "No\nYes",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -978,11 +1062,13 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Stock Entry",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Stock Entry",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -1001,12 +1087,14 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Amended From",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "amended_from",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Journal Entry",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -1024,7 +1112,9 @@
|
||||
"is_submittable": 1,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"modified": "2015-10-02 07:38:54.074343",
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2015-11-30 16:11:45.556341",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Journal Entry",
|
||||
@@ -1096,5 +1186,6 @@
|
||||
"search_fields": "voucher_type,posting_date, due_date, cheque_no",
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"title_field": "title"
|
||||
"title_field": "title",
|
||||
"version": 0
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
# 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
|
||||
@@ -28,7 +28,7 @@ class JournalEntry(AccountsController):
|
||||
self.validate_entries_for_advance()
|
||||
self.validate_multi_currency()
|
||||
self.set_amounts_in_company_currency()
|
||||
self.validate_debit_and_credit()
|
||||
self.validate_total_debit_and_credit()
|
||||
self.validate_against_jv()
|
||||
self.validate_reference_doc()
|
||||
self.set_against_account()
|
||||
@@ -105,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":
|
||||
@@ -121,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:
|
||||
@@ -197,15 +203,13 @@ class JournalEntry(AccountsController):
|
||||
self.validate_invoices()
|
||||
|
||||
def validate_orders(self):
|
||||
"""Validate totals, stopped and docstatus for orders"""
|
||||
"""Validate totals, closed and docstatus for orders"""
|
||||
for reference_name, total in self.reference_totals.iteritems():
|
||||
reference_type = self.reference_types[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))
|
||||
@@ -213,18 +217,22 @@ class JournalEntry(AccountsController):
|
||||
if flt(order.per_billed) >= 100:
|
||||
frappe.throw(_("{0} {1} is fully billed").format(reference_type, reference_name))
|
||||
|
||||
if cstr(order.status) == "Stopped":
|
||||
frappe.throw(_("{0} {1} is stopped").format(reference_type, reference_name))
|
||||
if cstr(order.status) == "Closed":
|
||||
frappe.throw(_("{0} {1} is closed").format(reference_type, reference_name))
|
||||
|
||||
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"""
|
||||
@@ -252,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:
|
||||
@@ -264,18 +278,18 @@ 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:
|
||||
@@ -283,17 +297,20 @@ class JournalEntry(AccountsController):
|
||||
frappe.throw(_("Please check Multi Currency option to allow accounts with other currency"))
|
||||
|
||||
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)
|
||||
@@ -337,20 +354,30 @@ 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
|
||||
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,
|
||||
if not pay_to_recd_from:
|
||||
pay_to_recd_from = frappe.db.get_value(d.party_type, d.party,
|
||||
"customer_name" if d.party_type=="Customer" else "supplier_name")
|
||||
|
||||
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 pay_to_recd_from:
|
||||
self.pay_to_recd_from = pay_to_recd_from
|
||||
else:
|
||||
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
|
||||
@@ -404,7 +431,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', [])
|
||||
@@ -432,7 +459,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):
|
||||
@@ -492,7 +519,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)
|
||||
@@ -500,16 +527,18 @@ 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,
|
||||
@@ -520,14 +549,14 @@ def get_default_bank_cash_account(company, voucher_type, mode_of_payment=None):
|
||||
"account_currency": account_details.account_currency,
|
||||
"account_type": account_details.account_type
|
||||
}
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_payment_entry_against_order(dt, dn):
|
||||
def get_payment_entry_against_order(dt, dn, amount=None, debit_in_account_currency=None, journal_entry=False, bank_account=None):
|
||||
ref_doc = frappe.get_doc(dt, dn)
|
||||
|
||||
|
||||
if flt(ref_doc.per_billed, 2) > 0:
|
||||
frappe.throw(_("Can only make payment against unbilled {0}").format(dt))
|
||||
|
||||
|
||||
if dt == "Sales Order":
|
||||
party_type = "Customer"
|
||||
amount_field_party = "credit_in_account_currency"
|
||||
@@ -536,15 +565,16 @@ def get_payment_entry_against_order(dt, dn):
|
||||
party_type = "Supplier"
|
||||
amount_field_party = "debit_in_account_currency"
|
||||
amount_field_bank = "credit_in_account_currency"
|
||||
|
||||
|
||||
party_account = get_party_account(party_type, ref_doc.get(party_type.lower()), ref_doc.company)
|
||||
party_account_currency = get_account_currency(party_account)
|
||||
|
||||
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)
|
||||
|
||||
|
||||
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,
|
||||
@@ -552,48 +582,61 @@ def get_payment_entry_against_order(dt, dn):
|
||||
"amount_field_party": amount_field_party,
|
||||
"amount_field_bank": amount_field_bank,
|
||||
"amount": amount,
|
||||
"debit_in_account_currency": debit_in_account_currency,
|
||||
"remarks": 'Advance Payment received against {0} {1}'.format(dt, dn),
|
||||
"is_advance": "Yes"
|
||||
"is_advance": "Yes",
|
||||
"bank_account": bank_account,
|
||||
"journal_entry": journal_entry
|
||||
})
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_payment_entry_against_invoice(dt, dn):
|
||||
def get_payment_entry_against_invoice(dt, dn, amount=None, debit_in_account_currency=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
|
||||
amount_field_party = "credit_in_account_currency"
|
||||
amount_field_bank = "debit_in_account_currency"
|
||||
else:
|
||||
party_type = "Supplier"
|
||||
party_account = ref_doc.credit_to
|
||||
|
||||
|
||||
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_field_party = "debit_in_account_currency"
|
||||
amount_field_bank = "credit_in_account_currency"
|
||||
|
||||
|
||||
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": ref_doc.outstanding_amount,
|
||||
"amount": amount if amount else abs(ref_doc.outstanding_amount),
|
||||
"debit_in_account_currency": debit_in_account_currency,
|
||||
"remarks": 'Payment received against {0} {1}. {2}'.format(dt, dn, ref_doc.remarks),
|
||||
"is_advance": "No"
|
||||
"is_advance": "No",
|
||||
"bank_account": bank_account,
|
||||
"journal_entry": journal_entry
|
||||
})
|
||||
|
||||
|
||||
def get_payment_entry(ref_doc, args):
|
||||
cost_center = frappe.db.get_value("Company", ref_doc.company, "cost_center")
|
||||
exchange_rate = get_exchange_rate(args.get("party_account"), args.get("party_account_currency"),
|
||||
ref_doc.company, ref_doc.doctype, ref_doc.name)
|
||||
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)
|
||||
|
||||
jv = frappe.new_doc("Journal Entry")
|
||||
jv.update({
|
||||
je = frappe.new_doc("Journal Entry")
|
||||
je.update({
|
||||
"voucher_type": "Bank Entry",
|
||||
"company": ref_doc.company,
|
||||
"remark": args.get("remarks")
|
||||
})
|
||||
|
||||
party_row = jv.append("accounts", {
|
||||
|
||||
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()),
|
||||
@@ -601,7 +644,7 @@ def get_payment_entry(ref_doc, args):
|
||||
"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")),
|
||||
"account_balance": get_balance_on(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"),
|
||||
@@ -610,28 +653,33 @@ def get_payment_entry(ref_doc, args):
|
||||
"reference_name": ref_doc.name
|
||||
})
|
||||
|
||||
bank_row = jv.append("accounts")
|
||||
bank_account = get_default_bank_cash_account(ref_doc.company, "Bank Entry")
|
||||
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:
|
||||
bank_row.update(bank_account)
|
||||
bank_row.exchange_rate = get_exchange_rate(bank_account["account"],
|
||||
bank_row.exchange_rate = get_exchange_rate(bank_account["account"],
|
||||
bank_account["account_currency"], ref_doc.company)
|
||||
|
||||
|
||||
bank_row.cost_center = cost_center
|
||||
|
||||
amount = args.get("debit_in_account_currency") or args.get("amount")
|
||||
|
||||
if bank_row.account_currency == args.get("party_account_currency"):
|
||||
bank_row.set(args.get("amount_field_bank"), args.get("amount"))
|
||||
bank_row.set(args.get("amount_field_bank"), amount)
|
||||
else:
|
||||
bank_row.set(args.get("amount_field_bank"), args.get("amount") * exchange_rate)
|
||||
bank_row.set(args.get("amount_field_bank"), 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):
|
||||
jv.multi_currency = 1
|
||||
je.multi_currency = 1
|
||||
|
||||
jv.set_amounts_in_company_currency()
|
||||
|
||||
return jv.as_dict()
|
||||
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):
|
||||
@@ -646,24 +694,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"
|
||||
@@ -728,6 +779,11 @@ 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()
|
||||
@@ -737,6 +793,9 @@ def get_exchange_rate(account, account_currency=None, company=None,
|
||||
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
|
||||
|
||||
@@ -746,7 +805,7 @@ def get_exchange_rate(account, account_currency=None, company=None,
|
||||
company_currency = get_company_currency(company)
|
||||
|
||||
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 and account_details.account_type == "Bank" and \
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"fields": [
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"fieldname": "account",
|
||||
"fieldtype": "Link",
|
||||
@@ -19,12 +19,14 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 1,
|
||||
"label": "Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "account",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Account",
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"print_width": "250px",
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
@@ -45,10 +47,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Account Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -67,12 +71,14 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Account Balance",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "balance",
|
||||
"oldfieldtype": "Data",
|
||||
"options": "account_currency",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -93,12 +99,14 @@
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"label": "Cost Center",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "cost_center",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Cost Center",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"print_width": "180px",
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
@@ -118,9 +126,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,
|
||||
@@ -139,10 +149,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": 0,
|
||||
@@ -161,10 +173,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"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": 0,
|
||||
@@ -183,11 +197,13 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Party Balance",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "account_currency",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -208,10 +224,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Currency",
|
||||
"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,
|
||||
@@ -230,11 +248,13 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Account Currency",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"options": "Currency",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -252,10 +272,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,
|
||||
@@ -274,10 +296,12 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Exchange Rate",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "6",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -296,9 +320,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "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,
|
||||
@@ -308,7 +334,7 @@
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"fieldname": "debit_in_account_currency",
|
||||
"fieldtype": "Currency",
|
||||
@@ -316,12 +342,14 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Debit in Account Currency",
|
||||
"label": "Debit",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "account_currency",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 1,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -331,7 +359,7 @@
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"fieldname": "debit",
|
||||
"fieldtype": "Currency",
|
||||
@@ -340,6 +368,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Debit in Company Currency",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "debit",
|
||||
"oldfieldtype": "Currency",
|
||||
@@ -347,6 +376,7 @@
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -364,9 +394,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,
|
||||
@@ -376,7 +408,7 @@
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"fieldname": "credit_in_account_currency",
|
||||
"fieldtype": "Currency",
|
||||
@@ -384,12 +416,14 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Credit in Account Currency",
|
||||
"label": "Credit",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "account_currency",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 1,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -399,7 +433,7 @@
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"bold": 1,
|
||||
"collapsible": 0,
|
||||
"fieldname": "credit",
|
||||
"fieldtype": "Currency",
|
||||
@@ -408,6 +442,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Credit in Company Currency",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "credit",
|
||||
"oldfieldtype": "Currency",
|
||||
@@ -415,6 +450,7 @@
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -433,9 +469,11 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Reference",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -454,11 +492,13 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Reference Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "\nSales Invoice\nPurchase Invoice\nJournal Entry\nSales Order\nPurchase Order\nExpense Claim",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -477,11 +517,13 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Reference Name",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "reference_type",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -499,9 +541,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,
|
||||
@@ -520,12 +564,14 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Is Advance",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "is_advance",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "No\nYes",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -544,11 +590,13 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Against Account",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "against_account",
|
||||
"oldfieldtype": "Text",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
@@ -565,7 +613,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"modified": "2015-10-20 12:10:22.203395",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-12-02 04:14:37.571883",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Journal Entry Account",
|
||||
|
||||
@@ -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-10-02 07:38:57.318104",
|
||||
"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-10-02 07:38:57.388194",
|
||||
"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-10-02 07:38:57.594541",
|
||||
"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-10-02 07:38:57.670950",
|
||||
"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-10-02 07:38:59.582533",
|
||||
"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, "payment_gateway", doc.name);
|
||||
df.read_only = 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
{
|
||||
"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": "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",
|
||||
"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
|
||||
}
|
||||
],
|
||||
"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-21 11:32:10.311015",
|
||||
"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,27 @@
|
||||
# -*- 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.payment_gateway + " - " + self.currency
|
||||
|
||||
def validate(self):
|
||||
self.currency = frappe.db.get_value("Account", self.payment_account, "account_currency")
|
||||
|
||||
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() {
|
||||
@@ -75,6 +80,7 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext
|
||||
method: 'get_unreconciled_entries',
|
||||
callback: function(r, rt) {
|
||||
me.set_invoice_options();
|
||||
me.toggle_primary_action();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -87,10 +93,11 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext
|
||||
method: 'reconcile',
|
||||
callback: function(r, rt) {
|
||||
me.set_invoice_options();
|
||||
me.toggle_primary_action();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
set_invoice_options: function() {
|
||||
var invoices = [];
|
||||
|
||||
@@ -107,6 +114,20 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext
|
||||
});
|
||||
|
||||
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",
|
||||
|
||||
@@ -6,6 +6,7 @@ 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,8 +18,6 @@ class PaymentReconciliation(Document):
|
||||
dr_or_cr = "credit_in_account_currency" if self.party_type == "Customer" \
|
||||
else "debit_in_account_currency"
|
||||
|
||||
cond = self.check_condition(dr_or_cr)
|
||||
|
||||
bank_account_condition = "t2.against_account like %(bank_cash_account)s" \
|
||||
if self.bank_cash_account else "1=1"
|
||||
|
||||
@@ -32,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
|
||||
@@ -41,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,
|
||||
@@ -65,65 +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_in_account_currency" if self.party_type == "Customer" else "credit_in_account_currency"
|
||||
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)
|
||||
condition = self.check_condition()
|
||||
|
||||
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_in_account_currency" if self.party_type == "Customer"
|
||||
else "debit_in_account_currency"), {
|
||||
"party_type": self.party_type,
|
||||
"party": self.party,
|
||||
"account": self.receivable_payable_account,
|
||||
"against_voucher_type": d.voucher_type,
|
||||
"against_voucher": d.voucher_no
|
||||
}
|
||||
)
|
||||
|
||||
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)
|
||||
|
||||
@@ -210,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,
|
||||
@@ -84,6 +87,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"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": "2015-10-16 06:14:07.460813",
|
||||
"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-10-02 07:38:59.835936",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:51.563989",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Reconciliation Payment",
|
||||
|
||||
35
erpnext/accounts/doctype/payment_request/payment_request.js
Normal file
35
erpnext/accounts/doctype/payment_request/payment_request.js
Normal file
@@ -0,0 +1,35 @@
|
||||
cur_frm.add_fetch("payment_gateway", "payment_account", "payment_account")
|
||||
cur_frm.add_fetch("payment_gateway", "payment_gateway", "payment_gateway")
|
||||
cur_frm.add_fetch("payment_gateway", "message", "message")
|
||||
cur_frm.add_fetch("payment_gateway", "payment_url_message", "payment_url_message")
|
||||
|
||||
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) {
|
||||
if(!in_list(["Initiated", "Paid"], frm.doc.status) && !frm.doc.__islocal){
|
||||
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"));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
679
erpnext/accounts/doctype/payment_request/payment_request.json
Normal file
679
erpnext/accounts/doctype/payment_request/payment_request.json
Normal file
@@ -0,0 +1,679 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"autoname": "PR.######",
|
||||
"creation": "2015-12-15 22:23:24.745065",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"fields": [
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "payment_details",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"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,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "currency",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Transaction Currency",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "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,
|
||||
"description": "Amount in customer's currency",
|
||||
"fieldname": "grand_total",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Grand Total",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "currency",
|
||||
"permlevel": 0,
|
||||
"precision": "2",
|
||||
"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_5",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 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,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"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,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"depends_on": "eval:doc.reference_doctype==\"Sales Order\"",
|
||||
"fieldname": "make_sales_invoice",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"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,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "section_break_7",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 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_gateway_account",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Payment Gateway Account",
|
||||
"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": "column_break_9",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 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_gateway",
|
||||
"fieldtype": "Read Only",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Payment Gateway",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "payment_gateway_account.payment_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,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Payment Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "payment_gateway_account.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,
|
||||
"ignore_xss_filter": 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,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Print Format",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "",
|
||||
"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": "mute_email",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 1,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Mute Email",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"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": "email_to",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"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,
|
||||
"ignore_xss_filter": 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,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "message",
|
||||
"fieldtype": "Text Editor",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 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,
|
||||
"ignore_xss_filter": 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,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"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,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"fieldname": "reference_details",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"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,
|
||||
"ignore_xss_filter": 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,
|
||||
"ignore_xss_filter": 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,
|
||||
"ignore_xss_filter": 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,
|
||||
"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": 1,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-02-24 16:49:46.832403",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Payment Request",
|
||||
"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": "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,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC"
|
||||
}
|
||||
261
erpnext/accounts/doctype/payment_request/payment_request.py
Normal file
261
erpnext/accounts/doctype/payment_request/payment_request.py
Normal file
@@ -0,0 +1,261 @@
|
||||
# -*- 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
|
||||
from erpnext.accounts.doctype.journal_entry.journal_entry import (get_payment_entry_against_invoice,
|
||||
get_payment_entry_against_order)
|
||||
|
||||
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}".format(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.payment_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 get_payment_url(self):
|
||||
""" This is blanck method to trigger hooks call from individual payment gateway app
|
||||
which will return respective payment gateway"""
|
||||
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, "payment_url", 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"""
|
||||
frappe.flags.ignore_account_permission = True
|
||||
|
||||
ref_doc = frappe.get_doc(self.reference_doctype, self.reference_name)
|
||||
|
||||
party_account = get_party_account("Customer", ref_doc.get("customer"), ref_doc.company)
|
||||
party_account_currency = get_account_currency(party_account)
|
||||
|
||||
debit_in_account_currency = 0.0
|
||||
|
||||
if party_account_currency == ref_doc.company_currency:
|
||||
amount = flt(flt(self.grand_total) * \
|
||||
flt(ref_doc.conversion_rate, ref_doc.precision("conversion_rate")), \
|
||||
ref_doc.precision("base_grand_total"))
|
||||
|
||||
if self.currency != ref_doc.company_currency:
|
||||
debit_in_account_currency = self.grand_total
|
||||
|
||||
else:
|
||||
amount = debit_in_account_currency = self.grand_total
|
||||
|
||||
if self.reference_doctype == "Sales Order":
|
||||
jv = get_payment_entry_against_order(self.reference_doctype, self.reference_name,
|
||||
amount=amount, debit_in_account_currency=debit_in_account_currency , 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=amount, debit_in_account_currency=debit_in_account_currency, 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)
|
||||
|
||||
grand_total = get_amount(ref_doc, args.dt)
|
||||
|
||||
existing_payment_request = frappe.db.get_value("Payment Request",
|
||||
{"reference_doctype": args.dt, "reference_name": args.dn})
|
||||
|
||||
if existing_payment_request:
|
||||
pr = frappe.get_doc("Payment Request", existing_payment_request)
|
||||
|
||||
else:
|
||||
pr = frappe.new_doc("Payment Request")
|
||||
pr.update({
|
||||
"payment_gateway_account": gateway_account.name,
|
||||
"payment_gateway": gateway_account.payment_gateway,
|
||||
"payment_account": gateway_account.payment_account,
|
||||
"currency": ref_doc.currency,
|
||||
"make_sales_invoice": args.cart or 0,
|
||||
"grand_total": grand_total,
|
||||
"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":
|
||||
grand_total = flt(ref_doc.grand_total) - flt(ref_doc.advance_paid)
|
||||
|
||||
if dt == "Sales Invoice":
|
||||
grand_total = flt(ref_doc.outstanding_amount)
|
||||
|
||||
if grand_total > 0 :
|
||||
return grand_total
|
||||
|
||||
else:
|
||||
frappe.throw(_("Payment Entry is already created"))
|
||||
|
||||
def get_gateway_details(args):
|
||||
"""return gateway and payment account of default payment gateway"""
|
||||
if args.get("payment_gateway"):
|
||||
return get_payment_gateway_account(args.get("payment_gateway"))
|
||||
|
||||
if args.cart:
|
||||
payment_gateway_account = frappe.get_doc("Shopping Cart Settings").payment_gateway_account
|
||||
return get_payment_gateway_account(payment_gateway_account)
|
||||
|
||||
gateway_account = get_payment_gateway_account({"is_default": 1})
|
||||
|
||||
if not gateway_account:
|
||||
frappe.throw(_("Payment Gateway Account is not configured"))
|
||||
|
||||
return gateway_account
|
||||
|
||||
def get_payment_gateway_account(args):
|
||||
return frappe.db.get_value("Payment Gateway Account", args,
|
||||
["name", "payment_gateway", "payment_account", "message", "payment_url_message"],
|
||||
as_dict=1)
|
||||
|
||||
@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,88 @@
|
||||
# -*- 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, get_gateway_details
|
||||
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
|
||||
from erpnext.setup.utils import get_exchange_rate
|
||||
# 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,
|
||||
"payment_gateway": "_Test Gateway",
|
||||
"payment_account": "_Test Bank - _TC",
|
||||
"currency": "INR"
|
||||
},
|
||||
{
|
||||
"doctype": "Payment Gateway Account",
|
||||
"payment_gateway": "_Test Gateway",
|
||||
"payment_account": "_Test Bank USD - _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", {"payment_gateway": method["payment_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")
|
||||
|
||||
conversion_rate = get_exchange_rate("USD", "INR")
|
||||
|
||||
si_usd = create_sales_invoice(currency="USD", conversion_rate=conversion_rate)
|
||||
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)
|
||||
|
||||
conversion_rate = get_exchange_rate("USD", "INR")
|
||||
|
||||
si_usd = create_sales_invoice(customer="_Test Customer USD", debit_to="_Test Receivable USD - _TC",
|
||||
currency="USD", conversion_rate=conversion_rate)
|
||||
|
||||
pr = make_payment_request(dt="Sales Invoice", dn=si_usd.name, recipient_id="saurabh@erpnext.com",
|
||||
mute_email=1, return_doc=1, payment_gateway="_Test Gateway - USD")
|
||||
|
||||
jv = pr.set_as_paid()
|
||||
|
||||
payment_gateway_details = get_gateway_details({"payment_gateway": "_Test Gateway - USD"})
|
||||
|
||||
self.assertEquals(jv.accounts[0].account, "_Test Receivable USD - _TC")
|
||||
self.assertEquals(jv.accounts[1].account, payment_gateway_details.payment_account)
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -8,6 +8,7 @@ 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):
|
||||
@@ -19,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"))
|
||||
|
||||
@@ -27,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()
|
||||
|
||||
@@ -63,20 +103,18 @@ def get_outstanding_vouchers(args):
|
||||
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):
|
||||
@@ -87,17 +125,17 @@ 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}`
|
||||
where
|
||||
{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 ifnull(status, "") != "Closed"
|
||||
and {ref_field} > advance_paid
|
||||
and abs(100 - per_billed) > 0.01
|
||||
""".format(**{
|
||||
"ref_field": ref_field,
|
||||
"voucher_type": voucher_type,
|
||||
@@ -118,7 +156,7 @@ def get_against_voucher_amount(against_voucher_type, against_voucher_no, party_a
|
||||
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)
|
||||
@@ -127,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-10-02 07:38:59.950506",
|
||||
"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,
|
||||
"root_type": "Liability",
|
||||
"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",
|
||||
@@ -205,6 +213,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Remarks",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"oldfieldname": "remarks",
|
||||
"oldfieldtype": "Small Text",
|
||||
@@ -227,7 +236,8 @@
|
||||
"is_submittable": 1,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"modified": "2015-10-21 12:40:58.278256",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:51.671436",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Period Closing Voucher",
|
||||
|
||||
@@ -22,21 +22,21 @@ class PeriodClosingVoucher(AccountsController):
|
||||
|
||||
def validate_account_head(self):
|
||||
closing_account_type = frappe.db.get_value("Account", self.closing_account_head, "root_type")
|
||||
|
||||
if closing_account_type != "Liability":
|
||||
frappe.throw(_("Closing Account {0} must be of type 'Liability'")
|
||||
|
||||
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")
|
||||
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, 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`
|
||||
@@ -50,7 +50,7 @@ class PeriodClosingVoucher(AccountsController):
|
||||
gl_entries = []
|
||||
net_pl_balance = 0
|
||||
pl_accounts = self.get_pl_balances()
|
||||
|
||||
|
||||
for acc in pl_accounts:
|
||||
if flt(acc.balance_in_company_currency):
|
||||
gl_entries.append(self.get_gl_dict({
|
||||
@@ -67,7 +67,7 @@ class PeriodClosingVoucher(AccountsController):
|
||||
}))
|
||||
|
||||
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,
|
||||
@@ -76,20 +76,20 @@ class PeriodClosingVoucher(AccountsController):
|
||||
"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(ifnull(t1.debit_in_account_currency,0))-sum(ifnull(t1.credit_in_account_currency,0))
|
||||
as balance_in_account_currency,
|
||||
sum(ifnull(t1.debit,0))-sum(ifnull(t1.credit,0)) as balance_in_company_currency
|
||||
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 ifnull(t2.report_type, '') = 'Profit and Loss'
|
||||
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)
|
||||
""", (self.company, self.get("year_start_date"), self.posting_date), as_dict=1)
|
||||
|
||||
@@ -12,60 +12,60 @@ from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journ
|
||||
class TestPeriodClosingVoucher(unittest.TestCase):
|
||||
def test_closing_entry(self):
|
||||
year_start_date = get_fiscal_year(today())[1]
|
||||
|
||||
make_journal_entry("_Test Bank - _TC", "Sales - _TC", 400,
|
||||
|
||||
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)
|
||||
|
||||
|
||||
random_expense_account = frappe.db.sql("""
|
||||
select t1.account,
|
||||
sum(ifnull(t1.debit,0))-sum(ifnull(t1.credit,0)) as balance,
|
||||
sum(ifnull(t1.debit_in_account_currency,0))-sum(ifnull(t1.credit_in_account_currency,0)) \
|
||||
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.root_type, '') = 'Expense'
|
||||
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(ifnull(t1.debit,0)) > sum(ifnull(t1.credit,0))
|
||||
having sum(t1.debit) > sum(t1.credit)
|
||||
limit 1""", (year_start_date, today()), as_dict=True)
|
||||
|
||||
profit_or_loss = frappe.db.sql("""select sum(ifnull(t1.debit,0))-sum(ifnull(t1.credit,0)) as balance
|
||||
|
||||
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 ifnull(t2.report_type, '') = 'Profit and Loss'
|
||||
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 %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()
|
||||
|
||||
|
||||
# Check value for closing account
|
||||
gle_amount_for_closing_account = frappe.db.sql("""select ifnull(debit, 0) - ifnull(credit, 0)
|
||||
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_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 ifnull(debit, 0) - ifnull(credit, 0) as amount,
|
||||
ifnull(debit_in_account_currency, 0) - ifnull(credit_in_account_currency, 0)
|
||||
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""",
|
||||
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,
|
||||
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",
|
||||
@@ -77,7 +77,7 @@ class TestPeriodClosingVoucher(unittest.TestCase):
|
||||
})
|
||||
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-10-02 07:39:00.196535",
|
||||
"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,
|
||||
@@ -63,11 +67,13 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Apply On",
|
||||
"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,
|
||||
@@ -176,11 +190,13 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Priority",
|
||||
"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,
|
||||
@@ -304,11 +330,13 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Applicable For",
|
||||
"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,
|
||||
@@ -699,11 +761,13 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Price or Discount",
|
||||
"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-10-02 07:39:00.632196",
|
||||
"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",
|
||||
@@ -98,17 +98,16 @@ def apply_pricing_rule(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('"', '\\"').replace("%", "%%") for d in parent_groups])+"')"
|
||||
"', '".join([frappe.db.escape(d) for d in parent_groups])+"')"
|
||||
return condition
|
||||
|
||||
|
||||
conditions = ""
|
||||
conditions = item_variant_condition = ""
|
||||
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,37 @@ 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
|
||||
if item_group_condition:
|
||||
item_group_condition = " or " + item_group_condition
|
||||
|
||||
# load variant of if not defined
|
||||
if "variant_of" not in args:
|
||||
args.variant_of = frappe.db.get_value("Item", args.item_code, "variant_of")
|
||||
|
||||
if args.variant_of:
|
||||
item_variant_condition = ' or item_code=%(variant_of)s '
|
||||
values['variant_of'] = args.variant_of
|
||||
|
||||
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}
|
||||
where (item_code=%(item_code)s {item_variant_condition} {item_group_condition} or brand=%(brand)s)
|
||||
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)
|
||||
item_group_condition = item_group_condition,
|
||||
item_variant_condition = item_variant_condition,
|
||||
transaction_type = args.transaction_type,
|
||||
conditions = conditions), values, as_dict=1)
|
||||
|
||||
def filter_pricing_rules(args, pricing_rules):
|
||||
# filter for qty
|
||||
@@ -214,6 +238,11 @@ def filter_pricing_rules(args, pricing_rules):
|
||||
pricing_rules = filter(lambda x: (flt(args.get("qty"))>=flt(x.min_qty)
|
||||
and (flt(args.get("qty"))<=x.max_qty if x.max_qty else True)), pricing_rules)
|
||||
|
||||
# add variant_of property in pricing rule
|
||||
for p in pricing_rules:
|
||||
if p.item_code and args.variant_of:
|
||||
p.variant_of = args.variant_of
|
||||
|
||||
# find pricing rule with highest priority
|
||||
if pricing_rules:
|
||||
max_priority = max([cint(p.priority) for p in pricing_rules])
|
||||
@@ -225,7 +254,7 @@ def filter_pricing_rules(args, pricing_rules):
|
||||
"supplier", "supplier_type", "campaign", "sales_partner"]
|
||||
|
||||
if len(pricing_rules) > 1:
|
||||
for field_set in [["item_code", "item_group", "brand"],
|
||||
for field_set in [["item_code", "variant_of", "item_group", "brand"],
|
||||
["customer", "customer_group", "territory"], ["supplier", "supplier_type"]]:
|
||||
remaining_fields = list(set(all_fields) - set(field_set))
|
||||
if if_all_rules_same(pricing_rules, remaining_fields):
|
||||
@@ -239,8 +268,7 @@ def filter_pricing_rules(args, pricing_rules):
|
||||
or pricing_rules
|
||||
|
||||
if len(pricing_rules) > 1:
|
||||
frappe.throw(_("Multiple Price Rule exists with same criteria, please resolve \
|
||||
conflict by assigning priority. Price Rules: {0}")
|
||||
frappe.throw(_("Multiple Price Rules exists with same criteria, please resolve conflict by assigning priority. Price Rules: {0}")
|
||||
.format("\n".join([d.name for d in pricing_rules])), MultiplePricingRuleConflict)
|
||||
elif pricing_rules:
|
||||
return pricing_rules[0]
|
||||
@@ -263,3 +291,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,14 +31,12 @@ 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)
|
||||
@@ -46,7 +44,9 @@ class TestPricingRule(unittest.TestCase):
|
||||
|
||||
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()
|
||||
@@ -83,3 +85,73 @@ class TestPricingRule(unittest.TestCase):
|
||||
self.assertEquals(details.get("discount_percentage"), 15)
|
||||
|
||||
frappe.db.sql("delete from `tabPricing Rule`")
|
||||
|
||||
def test_pricing_rule_for_variants(self):
|
||||
from erpnext.stock.get_item_details import get_item_details
|
||||
from frappe import MandatoryError
|
||||
|
||||
frappe.db.sql("delete from `tabPricing Rule`")
|
||||
|
||||
if not frappe.db.exists("Item", "Test Variant PRT"):
|
||||
frappe.get_doc({
|
||||
"doctype": "Item",
|
||||
"item_code": "Test Variant PRT",
|
||||
"item_name": "Test Variant PRT",
|
||||
"description": "Test Variant PRT",
|
||||
"item_group": "_Test Item Group",
|
||||
"is_stock_item": 1,
|
||||
"variant_of": "_Test Variant Item",
|
||||
"default_warehouse": "_Test Warehouse - _TC",
|
||||
"stock_uom": "_Test UOM",
|
||||
"attributes": [
|
||||
{
|
||||
"attribute": "Test Size",
|
||||
"attribute_value": "Medium"
|
||||
}
|
||||
],
|
||||
}).insert()
|
||||
|
||||
frappe.get_doc({
|
||||
"doctype": "Pricing Rule",
|
||||
"title": "_Test Pricing Rule 1",
|
||||
"apply_on": "Item Code",
|
||||
"item_code": "_Test Variant Item",
|
||||
"selling": 1,
|
||||
"price_or_discount": "Discount Percentage",
|
||||
"price": 0,
|
||||
"discount_percentage": 7.5,
|
||||
"company": "_Test Company"
|
||||
}).insert()
|
||||
|
||||
args = frappe._dict({
|
||||
"item_code": "Test Variant PRT",
|
||||
"company": "_Test Company",
|
||||
"price_list": "_Test Price List",
|
||||
"currency": "_Test Currency",
|
||||
"doctype": "Sales Order",
|
||||
"conversion_rate": 1,
|
||||
"price_list_currency": "_Test Currency",
|
||||
"plc_conversion_rate": 1,
|
||||
"order_type": "Sales",
|
||||
"customer": "_Test Customer",
|
||||
"name": None
|
||||
})
|
||||
|
||||
details = get_item_details(args)
|
||||
self.assertEquals(details.get("discount_percentage"), 7.5)
|
||||
|
||||
# add a new pricing rule for that item code, it should take priority
|
||||
frappe.get_doc({
|
||||
"doctype": "Pricing Rule",
|
||||
"title": "_Test Pricing Rule 2",
|
||||
"apply_on": "Item Code",
|
||||
"item_code": "Test Variant PRT",
|
||||
"selling": 1,
|
||||
"price_or_discount": "Discount Percentage",
|
||||
"price": 0,
|
||||
"discount_percentage": 17.5,
|
||||
"company": "_Test Company"
|
||||
}).insert()
|
||||
|
||||
details = get_item_details(args)
|
||||
self.assertEquals(details.get("discount_percentage"), 17.5)
|
||||
|
||||
@@ -25,27 +25,30 @@ 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");
|
||||
this.frm.add_custom_button(__('Payment'), this.make_bank_entry, __("Make"));
|
||||
cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
|
||||
}
|
||||
if(doc.outstanding_amount >= 0 || Math.abs(flt(doc.outstanding_amount)) < flt(doc.grand_total)) {
|
||||
cur_frm.add_custom_button(__('Debit Note'), this.make_debit_note, __("Make"));
|
||||
}
|
||||
cur_frm.add_custom_button(__('Debit Note'), this.make_debit_note);
|
||||
}
|
||||
|
||||
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: ["not in", ["Stopped", "Closed"]],
|
||||
status: ["!=", "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",
|
||||
@@ -56,7 +59,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
||||
company: cur_frm.doc.company
|
||||
}
|
||||
})
|
||||
});
|
||||
}, __("Get items from"));
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -76,7 +79,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
||||
me.apply_pricing_rule();
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
credit_to: function() {
|
||||
var me = this;
|
||||
if(this.frm.doc.credit_to) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,7 @@ 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"
|
||||
@@ -48,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_or_closed_status()
|
||||
self.check_for_closed_status()
|
||||
self.validate_with_previous_doc()
|
||||
self.validate_uom_is_integer("uom", "qty")
|
||||
self.set_against_expense_account()
|
||||
@@ -103,14 +104,14 @@ class PurchaseInvoice(BuyingController):
|
||||
|
||||
self.party_account_currency = account.account_currency
|
||||
|
||||
def check_for_stopped_or_closed_status(self):
|
||||
def check_for_closed_status(self):
|
||||
check_list = []
|
||||
pc_obj = frappe.get_doc('Purchase Common')
|
||||
|
||||
|
||||
for d in self.get('items'):
|
||||
if d.purchase_order and not d.purchase_order in check_list and not d.purchase_receipt:
|
||||
check_list.append(d.purchase_order)
|
||||
pc_obj.check_for_stopped_or_closed_status('Purchase Order', d.purchase_order)
|
||||
pc_obj.check_for_closed_status('Purchase Order', d.purchase_order)
|
||||
|
||||
def validate_with_previous_doc(self):
|
||||
super(PurchaseInvoice, self).validate_with_previous_doc({
|
||||
@@ -150,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
|
||||
|
||||
@@ -176,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):
|
||||
@@ -241,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()
|
||||
|
||||
@@ -254,15 +261,19 @@ class PurchaseInvoice(BuyingController):
|
||||
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,
|
||||
@@ -394,14 +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()
|
||||
|
||||
self.check_for_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()
|
||||
|
||||
@@ -426,6 +439,24 @@ class PurchaseInvoice(BuyingController):
|
||||
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
|
||||
@@ -438,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):
|
||||
|
||||
@@ -221,7 +221,7 @@ class TestPurchaseInvoice(unittest.TestCase):
|
||||
test_recurring_document(self, test_records)
|
||||
|
||||
def test_total_purchase_cost_for_project(self):
|
||||
existing_purchase_cost = frappe.db.sql("""select sum(ifnull(base_net_amount, 0))
|
||||
existing_purchase_cost = frappe.db.sql("""select sum(base_net_amount)
|
||||
from `tabPurchase Invoice Item` where project_name = '_Test Project' and docstatus=1""")
|
||||
existing_purchase_cost = existing_purchase_cost and existing_purchase_cost[0][0] or 0
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Journal Entry",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "journal_voucher",
|
||||
"oldfieldtype": "Link",
|
||||
@@ -44,6 +45,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Journal Entry Detail No",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "jv_detail_no",
|
||||
"oldfieldtype": "Date",
|
||||
@@ -69,6 +71,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Remarks",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "remarks",
|
||||
"oldfieldtype": "Small Text",
|
||||
@@ -93,6 +96,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"print_hide": 0,
|
||||
@@ -114,6 +118,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Advance Amount",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "advance_amount",
|
||||
"oldfieldtype": "Currency",
|
||||
@@ -140,6 +145,7 @@
|
||||
"in_filter": 0,
|
||||
"in_list_view": 1,
|
||||
"label": "Allocated Amount",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"oldfieldname": "allocated_amount",
|
||||
"oldfieldtype": "Currency",
|
||||
@@ -164,7 +170,8 @@
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"modified": "2015-10-02 07:39:03.538046",
|
||||
"max_attachments": 0,
|
||||
"modified": "2015-11-16 06:29:53.288895",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Purchase Invoice Advance",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user