Compare commits
883 Commits
v15.23.2
...
fix-get_si
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0255642deb | ||
|
|
2178fdc65a | ||
|
|
eabf706f37 | ||
|
|
d4d9e6c6fa | ||
|
|
2eb318a5ce | ||
|
|
b897225136 | ||
|
|
bb18ae82cf | ||
|
|
74ceb6da5e | ||
|
|
e0ad52b500 | ||
|
|
8252d92e6a | ||
|
|
b15795392b | ||
|
|
274c65c451 | ||
|
|
1b4fbbb115 | ||
|
|
f95403d1dc | ||
|
|
2d2ff7cf52 | ||
|
|
d32a407e08 | ||
|
|
5e0d017497 | ||
|
|
ec07b42ea2 | ||
|
|
3b861798e6 | ||
|
|
b498094a97 | ||
|
|
62bbcbc7ef | ||
|
|
96530b9c0b | ||
|
|
0cbcc55d9a | ||
|
|
6b5c54bcbc | ||
|
|
c2dde04aa2 | ||
|
|
c14986f9e6 | ||
|
|
62a6945bd2 | ||
|
|
be8bb235dc | ||
|
|
498bf15ecd | ||
|
|
210d7711b4 | ||
|
|
cf988434e9 | ||
|
|
466625213b | ||
|
|
9ba6ff67d5 | ||
|
|
eab22eb282 | ||
|
|
7e198ccb21 | ||
|
|
3d54fd8389 | ||
|
|
d0ea598cdf | ||
|
|
6de8c18f98 | ||
|
|
5923b48ede | ||
|
|
7d264696f3 | ||
|
|
b96c063c93 | ||
|
|
2bad706dcf | ||
|
|
7fa3e82ac7 | ||
|
|
7ddbfa10c9 | ||
|
|
4bd437b59d | ||
|
|
fca8028e3c | ||
|
|
cd293a5173 | ||
|
|
07b605a287 | ||
|
|
54383cfb55 | ||
|
|
4cc3c1b765 | ||
|
|
4d56f725fe | ||
|
|
c34f09c503 | ||
|
|
fe43dab4d7 | ||
|
|
b69cdeb4a6 | ||
|
|
15dc5c7e99 | ||
|
|
e05bf9d32a | ||
|
|
3fb7886418 | ||
|
|
bae7c64964 | ||
|
|
68c0e188e8 | ||
|
|
e912e9597d | ||
|
|
610d4f5cb6 | ||
|
|
cdd5441435 | ||
|
|
f09e2130a1 | ||
|
|
0819675fce | ||
|
|
784b6dcfea | ||
|
|
245effcccd | ||
|
|
0d01bd8a5a | ||
|
|
57b6a98703 | ||
|
|
e1b0fffd0c | ||
|
|
c2f88f29dc | ||
|
|
277dade9f9 | ||
|
|
e2cf1ea73e | ||
|
|
df409d80e0 | ||
|
|
5b1571879c | ||
|
|
bb839b2924 | ||
|
|
5bc2035bd0 | ||
|
|
9e973476b2 | ||
|
|
5e2669f4b6 | ||
|
|
0f1be03faf | ||
|
|
351ee5b8fe | ||
|
|
e84c9f7c51 | ||
|
|
7da9ffa3bd | ||
|
|
4415212a2d | ||
|
|
6401908f41 | ||
|
|
beee98da6d | ||
|
|
60c33ac3e6 | ||
|
|
1bc74bde29 | ||
|
|
12c40ef2e4 | ||
|
|
b250a21a2b | ||
|
|
4e28b5a199 | ||
|
|
739434b727 | ||
|
|
9ea963bfe9 | ||
|
|
6e5484ea03 | ||
|
|
d048644327 | ||
|
|
1a9e091d12 | ||
|
|
1b0d9643cd | ||
|
|
92bc962f60 | ||
|
|
a9576f0cf6 | ||
|
|
4f8a16848f | ||
|
|
bacf2b7431 | ||
|
|
34d8bc4701 | ||
|
|
510fdf7bf6 | ||
|
|
0346f47c1d | ||
|
|
3f9693b31f | ||
|
|
877cc7255d | ||
|
|
70abedc57a | ||
|
|
0c6de4ecb2 | ||
|
|
a517125d64 | ||
|
|
b7f283b2f0 | ||
|
|
cd37fd790b | ||
|
|
f983e09f92 | ||
|
|
3b4b2275de | ||
|
|
b5340c5ec0 | ||
|
|
10074e9980 | ||
|
|
bbee9b5637 | ||
|
|
915d864166 | ||
|
|
8555617295 | ||
|
|
b71b0d5997 | ||
|
|
a117ef3cb8 | ||
|
|
33b631e395 | ||
|
|
9b1c22250f | ||
|
|
4feecb69d8 | ||
|
|
12560e2407 | ||
|
|
0890b414b1 | ||
|
|
d54f8318fb | ||
|
|
fe77b9d633 | ||
|
|
47ee801d37 | ||
|
|
705ae7da14 | ||
|
|
7223106417 | ||
|
|
5a5758423e | ||
|
|
b09c9354fb | ||
|
|
d00f6672a8 | ||
|
|
06d6220a2a | ||
|
|
3011322b22 | ||
|
|
e560029736 | ||
|
|
b1ba210332 | ||
|
|
cb9114442b | ||
|
|
eb5bb9f9a9 | ||
|
|
87ba3b64f7 | ||
|
|
47f7b65058 | ||
|
|
161ae1edd1 | ||
|
|
d097ad6c19 | ||
|
|
a5d5223c0e | ||
|
|
1a1629196d | ||
|
|
d0ed8ef83b | ||
|
|
0773f66feb | ||
|
|
2dc49c834a | ||
|
|
787333896c | ||
|
|
283763dfb2 | ||
|
|
07175367d8 | ||
|
|
61219ca4ce | ||
|
|
c20995ec2f | ||
|
|
6a0a08b59c | ||
|
|
d370c60a6c | ||
|
|
a6ab53236e | ||
|
|
9a00edb031 | ||
|
|
ae353398d9 | ||
|
|
9983283f95 | ||
|
|
6d5bdc6c68 | ||
|
|
80e69210db | ||
|
|
793e3ad78e | ||
|
|
4057682c87 | ||
|
|
5e68b7e3a6 | ||
|
|
495b47db16 | ||
|
|
4aa960b744 | ||
|
|
dd6c192695 | ||
|
|
8772628912 | ||
|
|
a99d0a65b0 | ||
|
|
a09241e3c7 | ||
|
|
c7b961ffa2 | ||
|
|
32a608f948 | ||
|
|
8d79365e0d | ||
|
|
71e833c3f2 | ||
|
|
b5f3013005 | ||
|
|
39ef75e2d0 | ||
|
|
42813d38c3 | ||
|
|
55147781f3 | ||
|
|
c9fd182268 | ||
|
|
0743289925 | ||
|
|
4d75159247 | ||
|
|
baa1978128 | ||
|
|
259f313af7 | ||
|
|
863116f1cd | ||
|
|
5cb5e09dbb | ||
|
|
fa1c7b663c | ||
|
|
a9a84cc7d4 | ||
|
|
ff967c45f7 | ||
|
|
9a5c422074 | ||
|
|
5a83a16e60 | ||
|
|
1704180f38 | ||
|
|
0cf9ff0a04 | ||
|
|
41ae2a2dc5 | ||
|
|
f7b2380ec1 | ||
|
|
5eeb650dfd | ||
|
|
a1b95606b1 | ||
|
|
726ac6bda1 | ||
|
|
d6201ce5c7 | ||
|
|
e7e23fbc96 | ||
|
|
e7544e9fc1 | ||
|
|
eaf86a6461 | ||
|
|
f53ba178a8 | ||
|
|
c68ad73c6e | ||
|
|
6851c5042f | ||
|
|
da96578afb | ||
|
|
27f05145ae | ||
|
|
1b3ba25220 | ||
|
|
13cba5068b | ||
|
|
db24e24882 | ||
|
|
e7984b3ef9 | ||
|
|
b562b4cf99 | ||
|
|
69d7a640ee | ||
|
|
fa2d33cb50 | ||
|
|
2588970d55 | ||
|
|
d4ac57704c | ||
|
|
15c90551b6 | ||
|
|
0acd0f50c5 | ||
|
|
acb6e8e120 | ||
|
|
ccff588563 | ||
|
|
780c4278e6 | ||
|
|
2d6506ecec | ||
|
|
a97b3db749 | ||
|
|
cc15f695b4 | ||
|
|
c41cbb3e29 | ||
|
|
6ad298adfc | ||
|
|
db9829e83f | ||
|
|
956c3c50a0 | ||
|
|
40c1acc961 | ||
|
|
7babfd4ac4 | ||
|
|
65df4b6aa8 | ||
|
|
2721ee3a8d | ||
|
|
137b5a6108 | ||
|
|
b023e5d6b3 | ||
|
|
89a0e9c245 | ||
|
|
89326bd657 | ||
|
|
8ddc26eb2e | ||
|
|
ca0c3eb184 | ||
|
|
0465c9aabb | ||
|
|
a045916aca | ||
|
|
be312cea4c | ||
|
|
9611e9bd7f | ||
|
|
08ed3cd313 | ||
|
|
231ab83562 | ||
|
|
f45dd740c5 | ||
|
|
0156339f34 | ||
|
|
f99bb61181 | ||
|
|
6a47a2ceaf | ||
|
|
525f656cc1 | ||
|
|
d34787cf6d | ||
|
|
9424bbc01c | ||
|
|
16c297c2ec | ||
|
|
8beec58670 | ||
|
|
bac811bd5e | ||
|
|
eb9ee3f79b | ||
|
|
5da3e532c9 | ||
|
|
b1d9f3132d | ||
|
|
aaa9036eca | ||
|
|
005c5a587f | ||
|
|
47c78a5a73 | ||
|
|
24ccb3eb78 | ||
|
|
a56b79cc72 | ||
|
|
84ee50e492 | ||
|
|
16b7401d4c | ||
|
|
1a5d56977e | ||
|
|
6812e91893 | ||
|
|
4ca84eadb6 | ||
|
|
27aba02d16 | ||
|
|
3d7ad71b22 | ||
|
|
8d5045ef4c | ||
|
|
00261094c8 | ||
|
|
9471d8fff9 | ||
|
|
ab6e92aae1 | ||
|
|
fb3421fcce | ||
|
|
c8693cdf37 | ||
|
|
3df1d75bdd | ||
|
|
fc12238fcc | ||
|
|
15fff84bb5 | ||
|
|
01aadbef85 | ||
|
|
ccdcb7dfcc | ||
|
|
94fabe0321 | ||
|
|
dd39da0b77 | ||
|
|
3688d9412e | ||
|
|
4918aeb4c6 | ||
|
|
d659d407a0 | ||
|
|
262cafc430 | ||
|
|
11190aac4c | ||
|
|
6d31563920 | ||
|
|
b6957ddac2 | ||
|
|
b2d8a44199 | ||
|
|
2815d196de | ||
|
|
64266c4d38 | ||
|
|
f4d418ea6d | ||
|
|
a008f5f611 | ||
|
|
74eab91042 | ||
|
|
9aeb3932d0 | ||
|
|
b6a7549407 | ||
|
|
9087e1443e | ||
|
|
5952cfa673 | ||
|
|
a1e0197a8b | ||
|
|
af7bc4f178 | ||
|
|
023bc36592 | ||
|
|
ceeb724acc | ||
|
|
5e9016ffab | ||
|
|
6bc40373f2 | ||
|
|
14c8c8c33d | ||
|
|
0925706d5e | ||
|
|
ca14ae8f1b | ||
|
|
90c6d4dc85 | ||
|
|
228aa1a244 | ||
|
|
993e2bfbf9 | ||
|
|
ea3071db66 | ||
|
|
395299803f | ||
|
|
5e2d21c033 | ||
|
|
c4c3090f46 | ||
|
|
6492019383 | ||
|
|
f6831fba13 | ||
|
|
16db6c2f47 | ||
|
|
bd3dc6482e | ||
|
|
f7b7b2b438 | ||
|
|
99fbd8ad18 | ||
|
|
9d20256366 | ||
|
|
85f2a6dd54 | ||
|
|
de2eba0d98 | ||
|
|
705ef4f5a3 | ||
|
|
b2dde55f2c | ||
|
|
d53b34c0ce | ||
|
|
a427029151 | ||
|
|
2de3e6ce6d | ||
|
|
03a38ed025 | ||
|
|
26503a205f | ||
|
|
5a25c80f2e | ||
|
|
4c8a8c3bcd | ||
|
|
decdbd2782 | ||
|
|
eb4c476490 | ||
|
|
68f5dd3e7b | ||
|
|
68aee8c144 | ||
|
|
b24e28953b | ||
|
|
9656412bba | ||
|
|
61280117eb | ||
|
|
961bdf0d24 | ||
|
|
080aa30407 | ||
|
|
eecf9cd1d8 | ||
|
|
e2a519464b | ||
|
|
60a81a563e | ||
|
|
3a66aefd2c | ||
|
|
54f7cf59fd | ||
|
|
ba10f7d04c | ||
|
|
691e3bb24f | ||
|
|
832734ff4c | ||
|
|
3d4156cc7d | ||
|
|
cc053ad894 | ||
|
|
ae294ee470 | ||
|
|
e4bdd3a28d | ||
|
|
63313eef6f | ||
|
|
1da9087cc4 | ||
|
|
de3795a7d4 | ||
|
|
cfd3230c75 | ||
|
|
e38b06bf2d | ||
|
|
7cb0b1b7c3 | ||
|
|
62b4a263f8 | ||
|
|
96b13c59c1 | ||
|
|
1423b38d50 | ||
|
|
ff27cccff4 | ||
|
|
abc7d30024 | ||
|
|
591f4ebdca | ||
|
|
ef8e4191cd | ||
|
|
cf97e3c21f | ||
|
|
2e8739fff7 | ||
|
|
3da0aa6a0b | ||
|
|
97be527ee9 | ||
|
|
cac3b4a0d8 | ||
|
|
96f31847b2 | ||
|
|
85f9f8d176 | ||
|
|
7b0cd03f88 | ||
|
|
68585f6f2b | ||
|
|
857f2b5a01 | ||
|
|
258148b615 | ||
|
|
7145b040f1 | ||
|
|
874766a82f | ||
|
|
096a2c8cd0 | ||
|
|
4a047fefb8 | ||
|
|
fddf341f44 | ||
|
|
fe5fc5bd3a | ||
|
|
0255e09285 | ||
|
|
2b0b15f4d1 | ||
|
|
8e4b591ea2 | ||
|
|
663bb8726c | ||
|
|
2add802d0d | ||
|
|
adfcdb3b65 | ||
|
|
9fadf5f426 | ||
|
|
3e6306348a | ||
|
|
458dd51af7 | ||
|
|
23b0b8ba36 | ||
|
|
592fc81260 | ||
|
|
c232acbe9b | ||
|
|
640dfab827 | ||
|
|
01044ca8e9 | ||
|
|
2633d7dca3 | ||
|
|
ecb533c4d1 | ||
|
|
5fc19dab54 | ||
|
|
58114e7b24 | ||
|
|
1763824e5f | ||
|
|
aee2e12f39 | ||
|
|
500573067a | ||
|
|
8052103197 | ||
|
|
78ab11f991 | ||
|
|
3263f2023c | ||
|
|
8f00481c5f | ||
|
|
9872e371a2 | ||
|
|
37b3ac7952 | ||
|
|
d891bd7fac | ||
|
|
d366a91d9e | ||
|
|
8c3713b649 | ||
|
|
729fc738af | ||
|
|
add238c892 | ||
|
|
ad3634be7c | ||
|
|
5a53a4b044 | ||
|
|
5a97fa6336 | ||
|
|
657bb9d682 | ||
|
|
b9f5a1c85d | ||
|
|
592ce45da7 | ||
|
|
d9b3b95854 | ||
|
|
5426b93387 | ||
|
|
284a40aa63 | ||
|
|
2989e36b1d | ||
|
|
d8245cef72 | ||
|
|
edf4514d8b | ||
|
|
477d9fa87e | ||
|
|
01f133f8c8 | ||
|
|
d32147f8fe | ||
|
|
86aeacf393 | ||
|
|
dd80d3b9b9 | ||
|
|
98cba5ed30 | ||
|
|
ca8a5b45ba | ||
|
|
9d6a06aec5 | ||
|
|
dd016e6ced | ||
|
|
0fe6dcd742 | ||
|
|
bcbe6c4a53 | ||
|
|
f09c5f32cf | ||
|
|
3ca7e442bc | ||
|
|
8ac647ece7 | ||
|
|
4307d3b5c9 | ||
|
|
aa17110bde | ||
|
|
3f6d805033 | ||
|
|
64b44a360a | ||
|
|
040cc8d22f | ||
|
|
3be345e605 | ||
|
|
e1cea25781 | ||
|
|
a2ede7d6d5 | ||
|
|
7e4dd33ab0 | ||
|
|
45d5cff47d | ||
|
|
745e3bfb73 | ||
|
|
762906f240 | ||
|
|
9ec6f1e1d6 | ||
|
|
628ea42b63 | ||
|
|
1efff268b0 | ||
|
|
b206b0583b | ||
|
|
816b1b6bd5 | ||
|
|
24fcd67f8b | ||
|
|
c99c805743 | ||
|
|
f258ab5e98 | ||
|
|
880a85d2af | ||
|
|
efd31a429c | ||
|
|
728cc9f725 | ||
|
|
52305e3000 | ||
|
|
1657337887 | ||
|
|
362f377f61 | ||
|
|
8bdb61cb87 | ||
|
|
67f43d37df | ||
|
|
3543f86c63 | ||
|
|
627165dc7c | ||
|
|
874774fe6c | ||
|
|
ee76af7681 | ||
|
|
f9713eeb56 | ||
|
|
0ca7527f7a | ||
|
|
2a41da94d4 | ||
|
|
73586fd9b2 | ||
|
|
9c889b37fb | ||
|
|
b11ae4b54c | ||
|
|
e3af1dc864 | ||
|
|
8b04c1d4f6 | ||
|
|
74f9e34182 | ||
|
|
1fddc30350 | ||
|
|
e2bb4e2baa | ||
|
|
9006c9b747 | ||
|
|
6518582ed3 | ||
|
|
5c308a4f9a | ||
|
|
ac91030b31 | ||
|
|
9680edfcc3 | ||
|
|
56e991b7f4 | ||
|
|
9903049c7a | ||
|
|
f34ffc2062 | ||
|
|
f50d933a25 | ||
|
|
ce092bf23b | ||
|
|
fb06ad7330 | ||
|
|
80ab4eea8c | ||
|
|
83a13e22b7 | ||
|
|
ee0c64215d | ||
|
|
5ac8bd7f08 | ||
|
|
2f3fc12c08 | ||
|
|
331ad62f3c | ||
|
|
f6e93f084a | ||
|
|
7b2eacd4d8 | ||
|
|
a9bf906545 | ||
|
|
97090ff367 | ||
|
|
6c8b6de4c9 | ||
|
|
f91752cad2 | ||
|
|
cc60c328fe | ||
|
|
ff5b1b7ded | ||
|
|
a1ff7cab7e | ||
|
|
32f622ef80 | ||
|
|
969616ed09 | ||
|
|
ca62cde9aa | ||
|
|
3d1e3a9cde | ||
|
|
184848edf9 | ||
|
|
65ba5b3000 | ||
|
|
3a487bd33a | ||
|
|
56e92b702c | ||
|
|
45299fe4b3 | ||
|
|
434c2a1815 | ||
|
|
f31002636b | ||
|
|
b5dd0c8630 | ||
|
|
9c7b19e0b7 | ||
|
|
3a51a3f37e | ||
|
|
a5a5341643 | ||
|
|
20c6e9fca2 | ||
|
|
5b3eba7bee | ||
|
|
8c6e341a71 | ||
|
|
545ef3c234 | ||
|
|
7842c9fba8 | ||
|
|
7e43d7b131 | ||
|
|
089da459f7 | ||
|
|
b27af6b5c8 | ||
|
|
c69fb80222 | ||
|
|
134201794a | ||
|
|
2df767f596 | ||
|
|
da80e4dbce | ||
|
|
5cc8603cff | ||
|
|
426c245032 | ||
|
|
9731b74ad3 | ||
|
|
ee29526bbe | ||
|
|
3e884d347a | ||
|
|
6e0362dee8 | ||
|
|
2499675ad1 | ||
|
|
908b21f7fd | ||
|
|
e93a19ffb5 | ||
|
|
3e77c0b564 | ||
|
|
e769e750ec | ||
|
|
c31ee8ea33 | ||
|
|
894ae1fe0f | ||
|
|
5fae2f6d57 | ||
|
|
ad5edbb1de | ||
|
|
780b827adc | ||
|
|
8e010ef063 | ||
|
|
09f9764bbd | ||
|
|
a59c942cd4 | ||
|
|
b097bb20d9 | ||
|
|
2f9e96e324 | ||
|
|
56b8d1b927 | ||
|
|
5b446d4575 | ||
|
|
9ae5c979e8 | ||
|
|
ea7565889f | ||
|
|
4a111f7362 | ||
|
|
ffd171a26b | ||
|
|
95edd82638 | ||
|
|
e07c3aad6b | ||
|
|
a393a6b76c | ||
|
|
d380bf8179 | ||
|
|
8062d2be3b | ||
|
|
d17e37c581 | ||
|
|
6f432b8e45 | ||
|
|
94faa44697 | ||
|
|
9fde782403 | ||
|
|
ecc305dd59 | ||
|
|
6f6d5cb4cf | ||
|
|
8634abc021 | ||
|
|
a74e1f1600 | ||
|
|
59438ee8d4 | ||
|
|
4ed9927a30 | ||
|
|
ae508144cd | ||
|
|
a52a1b49af | ||
|
|
93295bf25b | ||
|
|
73639db910 | ||
|
|
c320288690 | ||
|
|
0aa1636d04 | ||
|
|
194d70f8a0 | ||
|
|
af35590549 | ||
|
|
a248b13cc3 | ||
|
|
b0dfc936a1 | ||
|
|
73090fa130 | ||
|
|
ade09bc709 | ||
|
|
8d9f391309 | ||
|
|
ebd74a4e5b | ||
|
|
c4f8f3613f | ||
|
|
e5a8ad54e2 | ||
|
|
815c616f18 | ||
|
|
1d8fcd66e6 | ||
|
|
6ca3b26820 | ||
|
|
18a2e6ecb2 | ||
|
|
922fffda1f | ||
|
|
1fc5844025 | ||
|
|
45b4bfc947 | ||
|
|
92f6d2c87c | ||
|
|
c2bda2c705 | ||
|
|
4b4b176fcf | ||
|
|
a27374fd8f | ||
|
|
56ac3424d2 | ||
|
|
696e2108ac | ||
|
|
89612f2605 | ||
|
|
a8216b9727 | ||
|
|
779260fb49 | ||
|
|
860b67e9c0 | ||
|
|
47ba357bea | ||
|
|
3502c01aa4 | ||
|
|
6e3e094c95 | ||
|
|
a89afb65d7 | ||
|
|
9a171db97f | ||
|
|
48567ef755 | ||
|
|
b57eba6eaf | ||
|
|
70d99eebc0 | ||
|
|
4783e4beee | ||
|
|
450c2470e9 | ||
|
|
09439334ca | ||
|
|
f9c88ea7bc | ||
|
|
33eedb97dc | ||
|
|
2984a86f37 | ||
|
|
5f5d75a0bb | ||
|
|
6f231e4c83 | ||
|
|
c750e4d7ef | ||
|
|
291a499124 | ||
|
|
67b36a0823 | ||
|
|
162c0497d1 | ||
|
|
416bd400bb | ||
|
|
ee60fa940c | ||
|
|
6210b24c64 | ||
|
|
68c6ad6036 | ||
|
|
10b9570429 | ||
|
|
11c8d9fcf1 | ||
|
|
61705047b0 | ||
|
|
ea4b6ff27b | ||
|
|
5ce395a60a | ||
|
|
ac79b8483f | ||
|
|
0135293127 | ||
|
|
adff287160 | ||
|
|
b651b36fff | ||
|
|
5a068410c6 | ||
|
|
ebb186c8df | ||
|
|
d582a73795 | ||
|
|
e845b63228 | ||
|
|
cfe0479dfb | ||
|
|
67e74d03ed | ||
|
|
8722318081 | ||
|
|
2d272fa51c | ||
|
|
15840d408b | ||
|
|
f9fc6c9c9d | ||
|
|
30c6b83a10 | ||
|
|
1754d027b3 | ||
|
|
a1f8595a6a | ||
|
|
5cce522ecd | ||
|
|
758ec720de | ||
|
|
6280031722 | ||
|
|
ff0343d2cc | ||
|
|
3d00d74fed | ||
|
|
30402033bc | ||
|
|
de445b32f5 | ||
|
|
34d3eb88b3 | ||
|
|
a9d91189b0 | ||
|
|
84f0d1ff1f | ||
|
|
98a8288da2 | ||
|
|
0e100cd451 | ||
|
|
e5a018f84c | ||
|
|
2b02ef0066 | ||
|
|
e5bc8fccb1 | ||
|
|
0c5bdbdcf3 | ||
|
|
a3191f1c8c | ||
|
|
787784e937 | ||
|
|
539ff03a7e | ||
|
|
e42a3e0084 | ||
|
|
8fbd4cea5b | ||
|
|
05f24ede96 | ||
|
|
54b323e557 | ||
|
|
9231706227 | ||
|
|
1f88b1ef84 | ||
|
|
10242235bc | ||
|
|
73b65ac82e | ||
|
|
f52916a2c3 | ||
|
|
98d6cdd53c | ||
|
|
e1a87a802d | ||
|
|
d9e284366d | ||
|
|
56e9a46c17 | ||
|
|
2ce6bbf291 | ||
|
|
568d5bfbe8 | ||
|
|
60435daba3 | ||
|
|
f14d1eb871 | ||
|
|
d4c0dbfacc | ||
|
|
469ae2c7f1 | ||
|
|
a9372c42cd | ||
|
|
edf67444ea | ||
|
|
4867ca353c | ||
|
|
4015723591 | ||
|
|
f70d779034 | ||
|
|
23beb46d15 | ||
|
|
e019d43d0b | ||
|
|
c37e374fdd | ||
|
|
cd1e016163 | ||
|
|
1f4b381748 | ||
|
|
fb9a80923b | ||
|
|
ed1c198897 | ||
|
|
1b808e1d7c | ||
|
|
639f427d6d | ||
|
|
539f0251d9 | ||
|
|
d91d9b02d4 | ||
|
|
0104897d69 | ||
|
|
5530a5b303 | ||
|
|
a9fceeb00f | ||
|
|
34e3538b55 | ||
|
|
851a234988 | ||
|
|
17893eff59 | ||
|
|
54e8ce1ac5 | ||
|
|
38e5e4a893 | ||
|
|
65cc804186 | ||
|
|
8fa677b8e8 | ||
|
|
6bd56d2d5f | ||
|
|
204face50d | ||
|
|
c5f5aa8208 | ||
|
|
3d9938221a | ||
|
|
f0a1f4ac7c | ||
|
|
ec1a7869f8 | ||
|
|
7e67d42d1d | ||
|
|
da9a7ff63d | ||
|
|
47f913abcb | ||
|
|
fc4199504f | ||
|
|
0fc14b72ca | ||
|
|
804ed0d26a | ||
|
|
028b3e2fbf | ||
|
|
e0a03789ae | ||
|
|
7a3e4a8a05 | ||
|
|
e16cc38b70 | ||
|
|
c43b30cf36 | ||
|
|
07a8024b45 | ||
|
|
b64147cce9 | ||
|
|
058bb95171 | ||
|
|
daf2ec063c | ||
|
|
77af247450 | ||
|
|
1fd888175f | ||
|
|
fb0ec74d08 | ||
|
|
eb73017798 | ||
|
|
139a68fd0f | ||
|
|
d758fc1b89 | ||
|
|
056b74b162 | ||
|
|
e752f8f0ef | ||
|
|
54a32adef3 | ||
|
|
ca69845238 | ||
|
|
d2fdda8bcd | ||
|
|
afc64ed9ee | ||
|
|
500435b856 | ||
|
|
a15484fe3d | ||
|
|
76c61c1b04 | ||
|
|
de58c67991 | ||
|
|
8a34a4ba68 | ||
|
|
208d5042ee | ||
|
|
ece7049390 | ||
|
|
e72afd0bd6 | ||
|
|
83db7c6a65 | ||
|
|
62384e9321 | ||
|
|
1081df3d7e | ||
|
|
3a8736374c | ||
|
|
f276fbba4f | ||
|
|
fd78f868e1 | ||
|
|
d99a56bc27 | ||
|
|
48c66b68ab | ||
|
|
8d9b90f3f5 | ||
|
|
4a86375e89 | ||
|
|
b60c57a97d | ||
|
|
8903c1bc6f | ||
|
|
e33fd450fd | ||
|
|
dc5d2c7406 | ||
|
|
1612d7ba3f | ||
|
|
681782121c | ||
|
|
35cf944cb7 | ||
|
|
4bbad7f448 | ||
|
|
74b6bfb9eb | ||
|
|
46ea868559 | ||
|
|
3290df5593 | ||
|
|
8e3b9ec879 | ||
|
|
787fc8737f | ||
|
|
fcfcf6957e | ||
|
|
8ffa2bfe25 | ||
|
|
d69b0d76dd | ||
|
|
2bcff4c7f2 | ||
|
|
d436a40739 | ||
|
|
5deba1b6f9 | ||
|
|
886102d462 | ||
|
|
7be578485e | ||
|
|
7c1b990c55 | ||
|
|
74a0d6408a | ||
|
|
92cbe580e6 | ||
|
|
d92eb0c603 | ||
|
|
11d956fa18 | ||
|
|
8e523961dc | ||
|
|
cdbe1c87d4 | ||
|
|
3f42128fff | ||
|
|
4dff2c7a0d | ||
|
|
547993f801 | ||
|
|
946228d783 | ||
|
|
23df4205f8 | ||
|
|
89f484282a | ||
|
|
9ef26e1df0 | ||
|
|
025acc0e48 | ||
|
|
6942ab1012 | ||
|
|
3bfb7b79f2 | ||
|
|
24788ddcc0 | ||
|
|
adf313a6d3 | ||
|
|
7f39318340 | ||
|
|
a432290a82 | ||
|
|
2b64e1ca8b | ||
|
|
514d5434a3 | ||
|
|
7e600a6494 | ||
|
|
17ebc1ea80 | ||
|
|
b099590b2c | ||
|
|
5323bb7bee | ||
|
|
55dbcee36a | ||
|
|
ec9434aae3 | ||
|
|
d1ec0a6093 | ||
|
|
5136fe196b | ||
|
|
4aa841786f | ||
|
|
98cc7434d2 | ||
|
|
35020a9423 | ||
|
|
1cc1c9aa38 | ||
|
|
9d392970f0 | ||
|
|
b0d440c34b | ||
|
|
21c3d9c371 | ||
|
|
dae66eab36 | ||
|
|
9474908449 | ||
|
|
eec4057e8d | ||
|
|
08bc77fb95 | ||
|
|
fff97b1cd2 | ||
|
|
2a7d1c4c8d | ||
|
|
0b674b608b | ||
|
|
14b009b093 | ||
|
|
530922848f | ||
|
|
79d51a0a0b | ||
|
|
85488cd0dc | ||
|
|
ce7ac29d06 | ||
|
|
4f363f5bf3 | ||
|
|
ff7108a3b1 | ||
|
|
77cc91d06b | ||
|
|
45395027d3 | ||
|
|
6d5ccde864 | ||
|
|
961d2d9926 | ||
|
|
75441017c6 | ||
|
|
ed2457bddf | ||
|
|
4471ad581e | ||
|
|
7ecc0d5a04 | ||
|
|
78fe567419 | ||
|
|
5ae9c2f62b | ||
|
|
705dadae8e | ||
|
|
40cdde8820 | ||
|
|
64497c9228 | ||
|
|
188175be84 | ||
|
|
2b4fa98941 | ||
|
|
36a996d704 | ||
|
|
7f1d916f04 | ||
|
|
e15546b42f | ||
|
|
8c61fe2ca5 | ||
|
|
7f865492d0 | ||
|
|
726fba61f3 | ||
|
|
0b85a525fb | ||
|
|
35d92abe73 | ||
|
|
28445058ef | ||
|
|
aab5737ff3 | ||
|
|
115f024260 | ||
|
|
952e8cf60c | ||
|
|
fcfdb9b566 | ||
|
|
ff1dc72d74 | ||
|
|
b3486b43c4 | ||
|
|
f705bf2efe | ||
|
|
6e1565c32c | ||
|
|
4ea43ebc5d | ||
|
|
f292a0cc4c | ||
|
|
4c5a83d6cf | ||
|
|
82774f89b1 | ||
|
|
19b220f39c | ||
|
|
725a7f90e9 |
@@ -28,4 +28,7 @@ b147b85e6ac19a9220cd1e2958a6ebd99373283a
|
|||||||
494bd9ef78313436f0424b918f200dab8fc7c20b
|
494bd9ef78313436f0424b918f200dab8fc7c20b
|
||||||
|
|
||||||
# bulk format python code with black
|
# bulk format python code with black
|
||||||
baec607ff5905b1c67531096a9cf50ec7ff00a5d
|
baec607ff5905b1c67531096a9cf50ec7ff00a5d
|
||||||
|
|
||||||
|
# bulk refactor with sourcery
|
||||||
|
eb9ee3f79b94e594fc6dfa4f6514580e125eee8c
|
||||||
|
|||||||
2
.github/workflows/backport.yml
vendored
2
.github/workflows/backport.yml
vendored
@@ -21,6 +21,6 @@ jobs:
|
|||||||
- name: Run backport
|
- name: Run backport
|
||||||
uses: ./actions/backport
|
uses: ./actions/backport
|
||||||
with:
|
with:
|
||||||
token: ${{secrets.BACKPORT_BOT_TOKEN}}
|
token: ${{secrets.RELEASE_TOKEN}}
|
||||||
labelsToAdd: "backport"
|
labelsToAdd: "backport"
|
||||||
title: "{{originalTitle}}"
|
title: "{{originalTitle}}"
|
||||||
|
|||||||
2
.github/workflows/initiate_release.yml
vendored
2
.github/workflows/initiate_release.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
version: ["13", "14"]
|
version: ["14", "15"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: octokit/request-action@v2.x
|
- uses: octokit/request-action@v2.x
|
||||||
|
|||||||
21
.github/workflows/lock.yml
vendored
Normal file
21
.github/workflows/lock.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
name: 'Lock threads'
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lock:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: dessant/lock-threads@v5
|
||||||
|
with:
|
||||||
|
github-token: ${{ github.token }}
|
||||||
|
issue-inactive-days: 14
|
||||||
|
pr-inactive-days: 14
|
||||||
1
.github/workflows/patch.yml
vendored
1
.github/workflows/patch.yml
vendored
@@ -134,6 +134,7 @@ jobs:
|
|||||||
}
|
}
|
||||||
|
|
||||||
update_to_version 14
|
update_to_version 14
|
||||||
|
update_to_version 15
|
||||||
|
|
||||||
echo "Updating to latest version"
|
echo "Updating to latest version"
|
||||||
git -C "apps/frappe" checkout -q -f "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}"
|
git -C "apps/frappe" checkout -q -f "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}"
|
||||||
|
|||||||
46
.mergify.yml
46
.mergify.yml
@@ -17,6 +17,7 @@ pull_request_rules:
|
|||||||
- base=version-12
|
- base=version-12
|
||||||
- base=version-14
|
- base=version-14
|
||||||
- base=version-15
|
- base=version-15
|
||||||
|
- base=version-16
|
||||||
actions:
|
actions:
|
||||||
close:
|
close:
|
||||||
comment:
|
comment:
|
||||||
@@ -24,16 +25,6 @@ pull_request_rules:
|
|||||||
@{{author}}, thanks for the contribution, but we do not accept pull requests on a stable branch. Please raise PR on an appropriate hotfix branch.
|
@{{author}}, thanks for the contribution, but we do not accept pull requests on a stable branch. Please raise PR on an appropriate hotfix branch.
|
||||||
https://github.com/frappe/erpnext/wiki/Pull-Request-Checklist#which-branch
|
https://github.com/frappe/erpnext/wiki/Pull-Request-Checklist#which-branch
|
||||||
|
|
||||||
- name: Auto-close PRs on pre-release branch
|
|
||||||
conditions:
|
|
||||||
- base=version-13-pre-release
|
|
||||||
actions:
|
|
||||||
close:
|
|
||||||
comment:
|
|
||||||
message: |
|
|
||||||
@{{author}}, pre-release branch is not maintained anymore. Releases are directly done by merging hotfix branch to stable branches.
|
|
||||||
|
|
||||||
|
|
||||||
- name: backport to develop
|
- name: backport to develop
|
||||||
conditions:
|
conditions:
|
||||||
- label="backport develop"
|
- label="backport develop"
|
||||||
@@ -54,13 +45,13 @@ pull_request_rules:
|
|||||||
assignees:
|
assignees:
|
||||||
- "{{ author }}"
|
- "{{ author }}"
|
||||||
|
|
||||||
- name: backport to version-14-pre-release
|
- name: backport to version-15-hotfix
|
||||||
conditions:
|
conditions:
|
||||||
- label="backport version-14-pre-release"
|
- label="backport version-15-hotfix"
|
||||||
actions:
|
actions:
|
||||||
backport:
|
backport:
|
||||||
branches:
|
branches:
|
||||||
- version-14-pre-release
|
- version-15-hotfix
|
||||||
assignees:
|
assignees:
|
||||||
- "{{ author }}"
|
- "{{ author }}"
|
||||||
|
|
||||||
@@ -74,35 +65,6 @@ pull_request_rules:
|
|||||||
assignees:
|
assignees:
|
||||||
- "{{ author }}"
|
- "{{ author }}"
|
||||||
|
|
||||||
- name: backport to version-13-pre-release
|
|
||||||
conditions:
|
|
||||||
- label="backport version-13-pre-release"
|
|
||||||
actions:
|
|
||||||
backport:
|
|
||||||
branches:
|
|
||||||
- version-13-pre-release
|
|
||||||
assignees:
|
|
||||||
- "{{ author }}"
|
|
||||||
|
|
||||||
- name: backport to version-12-hotfix
|
|
||||||
conditions:
|
|
||||||
- label="backport version-12-hotfix"
|
|
||||||
actions:
|
|
||||||
backport:
|
|
||||||
branches:
|
|
||||||
- version-12-hotfix
|
|
||||||
assignees:
|
|
||||||
- "{{ author }}"
|
|
||||||
|
|
||||||
- name: backport to version-12-pre-release
|
|
||||||
conditions:
|
|
||||||
- label="backport version-12-pre-release"
|
|
||||||
actions:
|
|
||||||
backport:
|
|
||||||
branches:
|
|
||||||
- version-12-pre-release
|
|
||||||
assignees:
|
|
||||||
- "{{ author }}"
|
|
||||||
|
|
||||||
- name: Automatic merge on CI success and review
|
- name: Automatic merge on CI success and review
|
||||||
conditions:
|
conditions:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ fail_fast: false
|
|||||||
|
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.0.1
|
rev: v4.3.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
files: "erpnext.*"
|
files: "erpnext.*"
|
||||||
@@ -15,6 +15,10 @@ repos:
|
|||||||
args: ['--branch', 'develop']
|
args: ['--branch', 'develop']
|
||||||
- id: check-merge-conflict
|
- id: check-merge-conflict
|
||||||
- id: check-ast
|
- id: check-ast
|
||||||
|
- id: check-json
|
||||||
|
- id: check-toml
|
||||||
|
- id: check-yaml
|
||||||
|
- id: debug-statements
|
||||||
|
|
||||||
- repo: https://github.com/pre-commit/mirrors-eslint
|
- repo: https://github.com/pre-commit/mirrors-eslint
|
||||||
rev: v8.44.0
|
rev: v8.44.0
|
||||||
|
|||||||
@@ -73,8 +73,6 @@ New passwords will be created for the ERPNext "Administrator" user, the MariaDB
|
|||||||
1. [Issue Guidelines](https://github.com/frappe/erpnext/wiki/Issue-Guidelines)
|
1. [Issue Guidelines](https://github.com/frappe/erpnext/wiki/Issue-Guidelines)
|
||||||
1. [Report Security Vulnerabilities](https://erpnext.com/security)
|
1. [Report Security Vulnerabilities](https://erpnext.com/security)
|
||||||
1. [Pull Request Requirements](https://github.com/frappe/erpnext/wiki/Contribution-Guidelines)
|
1. [Pull Request Requirements](https://github.com/frappe/erpnext/wiki/Contribution-Guidelines)
|
||||||
1. [Translations](https://translate.erpnext.com)
|
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import inspect
|
|||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
__version__ = "15.0.0-dev"
|
__version__ = "16.0.0-dev"
|
||||||
|
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
@@ -36,7 +36,7 @@ def get_default_cost_center(company):
|
|||||||
|
|
||||||
if not frappe.flags.company_cost_center:
|
if not frappe.flags.company_cost_center:
|
||||||
frappe.flags.company_cost_center = {}
|
frappe.flags.company_cost_center = {}
|
||||||
if not company in frappe.flags.company_cost_center:
|
if company not in frappe.flags.company_cost_center:
|
||||||
frappe.flags.company_cost_center[company] = frappe.get_cached_value(
|
frappe.flags.company_cost_center[company] = frappe.get_cached_value(
|
||||||
"Company", company, "cost_center"
|
"Company", company, "cost_center"
|
||||||
)
|
)
|
||||||
@@ -47,7 +47,7 @@ def get_company_currency(company):
|
|||||||
"""Returns the default company currency"""
|
"""Returns the default company currency"""
|
||||||
if not frappe.flags.company_currency:
|
if not frappe.flags.company_currency:
|
||||||
frappe.flags.company_currency = {}
|
frappe.flags.company_currency = {}
|
||||||
if not company in frappe.flags.company_currency:
|
if company not in frappe.flags.company_currency:
|
||||||
frappe.flags.company_currency[company] = frappe.db.get_value(
|
frappe.flags.company_currency[company] = frappe.db.get_value(
|
||||||
"Company", company, "default_currency", cache=True
|
"Company", company, "default_currency", cache=True
|
||||||
)
|
)
|
||||||
@@ -81,7 +81,7 @@ def is_perpetual_inventory_enabled(company):
|
|||||||
if not hasattr(frappe.local, "enable_perpetual_inventory"):
|
if not hasattr(frappe.local, "enable_perpetual_inventory"):
|
||||||
frappe.local.enable_perpetual_inventory = {}
|
frappe.local.enable_perpetual_inventory = {}
|
||||||
|
|
||||||
if not company in frappe.local.enable_perpetual_inventory:
|
if company not in frappe.local.enable_perpetual_inventory:
|
||||||
frappe.local.enable_perpetual_inventory[company] = (
|
frappe.local.enable_perpetual_inventory[company] = (
|
||||||
frappe.get_cached_value("Company", company, "enable_perpetual_inventory") or 0
|
frappe.get_cached_value("Company", company, "enable_perpetual_inventory") or 0
|
||||||
)
|
)
|
||||||
@@ -96,7 +96,7 @@ def get_default_finance_book(company=None):
|
|||||||
if not hasattr(frappe.local, "default_finance_book"):
|
if not hasattr(frappe.local, "default_finance_book"):
|
||||||
frappe.local.default_finance_book = {}
|
frappe.local.default_finance_book = {}
|
||||||
|
|
||||||
if not company in frappe.local.default_finance_book:
|
if company not in frappe.local.default_finance_book:
|
||||||
frappe.local.default_finance_book[company] = frappe.get_cached_value(
|
frappe.local.default_finance_book[company] = frappe.get_cached_value(
|
||||||
"Company", company, "default_finance_book"
|
"Company", company, "default_finance_book"
|
||||||
)
|
)
|
||||||
@@ -108,7 +108,7 @@ def get_party_account_type(party_type):
|
|||||||
if not hasattr(frappe.local, "party_account_types"):
|
if not hasattr(frappe.local, "party_account_types"):
|
||||||
frappe.local.party_account_types = {}
|
frappe.local.party_account_types = {}
|
||||||
|
|
||||||
if not party_type in frappe.local.party_account_types:
|
if party_type not in frappe.local.party_account_types:
|
||||||
frappe.local.party_account_types[party_type] = (
|
frappe.local.party_account_types[party_type] = (
|
||||||
frappe.db.get_value("Party Type", party_type, "account_type") or ""
|
frappe.db.get_value("Party Type", party_type, "account_type") or ""
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ def calculate_monthly_amount(
|
|||||||
if amount + already_booked_amount_in_account_currency > item.net_amount:
|
if amount + already_booked_amount_in_account_currency > item.net_amount:
|
||||||
amount = item.net_amount - already_booked_amount_in_account_currency
|
amount = item.net_amount - already_booked_amount_in_account_currency
|
||||||
|
|
||||||
if not (get_first_day(start_date) == start_date and get_last_day(end_date) == end_date):
|
if get_first_day(start_date) != start_date or get_last_day(end_date) != end_date:
|
||||||
partial_month = flt(date_diff(end_date, start_date)) / flt(
|
partial_month = flt(date_diff(end_date, start_date)) / flt(
|
||||||
date_diff(get_last_day(end_date), get_first_day(start_date))
|
date_diff(get_last_day(end_date), get_first_day(start_date))
|
||||||
)
|
)
|
||||||
@@ -358,9 +358,11 @@ def book_deferred_income_or_expense(doc, deferred_process, posting_date=None):
|
|||||||
|
|
||||||
account_currency = get_account_currency(item.expense_account or item.income_account)
|
account_currency = get_account_currency(item.expense_account or item.income_account)
|
||||||
if doc.doctype == "Sales Invoice":
|
if doc.doctype == "Sales Invoice":
|
||||||
|
against_type = "Customer"
|
||||||
against, project = doc.customer, doc.project
|
against, project = doc.customer, doc.project
|
||||||
credit_account, debit_account = item.income_account, item.deferred_revenue_account
|
credit_account, debit_account = item.income_account, item.deferred_revenue_account
|
||||||
else:
|
else:
|
||||||
|
against_type = "Supplier"
|
||||||
against, project = doc.supplier, item.project
|
against, project = doc.supplier, item.project
|
||||||
credit_account, debit_account = item.deferred_expense_account, item.expense_account
|
credit_account, debit_account = item.deferred_expense_account, item.expense_account
|
||||||
|
|
||||||
@@ -413,6 +415,7 @@ def book_deferred_income_or_expense(doc, deferred_process, posting_date=None):
|
|||||||
doc,
|
doc,
|
||||||
credit_account,
|
credit_account,
|
||||||
debit_account,
|
debit_account,
|
||||||
|
against_type,
|
||||||
against,
|
against,
|
||||||
amount,
|
amount,
|
||||||
base_amount,
|
base_amount,
|
||||||
@@ -494,6 +497,7 @@ def make_gl_entries(
|
|||||||
doc,
|
doc,
|
||||||
credit_account,
|
credit_account,
|
||||||
debit_account,
|
debit_account,
|
||||||
|
against_type,
|
||||||
against,
|
against,
|
||||||
amount,
|
amount,
|
||||||
base_amount,
|
base_amount,
|
||||||
@@ -515,7 +519,9 @@ def make_gl_entries(
|
|||||||
doc.get_gl_dict(
|
doc.get_gl_dict(
|
||||||
{
|
{
|
||||||
"account": credit_account,
|
"account": credit_account,
|
||||||
|
"against_type": against_type,
|
||||||
"against": against,
|
"against": against,
|
||||||
|
"against_link": against,
|
||||||
"credit": base_amount,
|
"credit": base_amount,
|
||||||
"credit_in_account_currency": amount,
|
"credit_in_account_currency": amount,
|
||||||
"cost_center": cost_center,
|
"cost_center": cost_center,
|
||||||
@@ -534,7 +540,9 @@ def make_gl_entries(
|
|||||||
doc.get_gl_dict(
|
doc.get_gl_dict(
|
||||||
{
|
{
|
||||||
"account": debit_account,
|
"account": debit_account,
|
||||||
|
"against_type": against_type,
|
||||||
"against": against,
|
"against": against,
|
||||||
|
"against_link": against,
|
||||||
"debit": base_amount,
|
"debit": base_amount,
|
||||||
"debit_in_account_currency": amount,
|
"debit_in_account_currency": amount,
|
||||||
"cost_center": cost_center,
|
"cost_center": cost_center,
|
||||||
|
|||||||
@@ -23,6 +23,65 @@ class InvalidAccountMergeError(frappe.ValidationError):
|
|||||||
|
|
||||||
|
|
||||||
class Account(NestedSet):
|
class Account(NestedSet):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account_currency: DF.Link | None
|
||||||
|
account_name: DF.Data
|
||||||
|
account_number: DF.Data | None
|
||||||
|
account_type: DF.Literal[
|
||||||
|
"",
|
||||||
|
"Accumulated Depreciation",
|
||||||
|
"Asset Received But Not Billed",
|
||||||
|
"Bank",
|
||||||
|
"Cash",
|
||||||
|
"Chargeable",
|
||||||
|
"Capital Work in Progress",
|
||||||
|
"Cost of Goods Sold",
|
||||||
|
"Current Asset",
|
||||||
|
"Current Liability",
|
||||||
|
"Depreciation",
|
||||||
|
"Direct Expense",
|
||||||
|
"Direct Income",
|
||||||
|
"Equity",
|
||||||
|
"Expense Account",
|
||||||
|
"Expenses Included In Asset Valuation",
|
||||||
|
"Expenses Included In Valuation",
|
||||||
|
"Fixed Asset",
|
||||||
|
"Income Account",
|
||||||
|
"Indirect Expense",
|
||||||
|
"Indirect Income",
|
||||||
|
"Liability",
|
||||||
|
"Payable",
|
||||||
|
"Receivable",
|
||||||
|
"Round Off",
|
||||||
|
"Stock",
|
||||||
|
"Stock Adjustment",
|
||||||
|
"Stock Received But Not Billed",
|
||||||
|
"Service Received But Not Billed",
|
||||||
|
"Tax",
|
||||||
|
"Temporary",
|
||||||
|
]
|
||||||
|
balance_must_be: DF.Literal["", "Debit", "Credit"]
|
||||||
|
company: DF.Link
|
||||||
|
disabled: DF.Check
|
||||||
|
freeze_account: DF.Literal["No", "Yes"]
|
||||||
|
include_in_gross: DF.Check
|
||||||
|
is_group: DF.Check
|
||||||
|
lft: DF.Int
|
||||||
|
old_parent: DF.Data | None
|
||||||
|
parent_account: DF.Link
|
||||||
|
report_type: DF.Literal["", "Balance Sheet", "Profit and Loss"]
|
||||||
|
rgt: DF.Int
|
||||||
|
root_type: DF.Literal["", "Asset", "Liability", "Income", "Expense", "Equity"]
|
||||||
|
tax_rate: DF.Float
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
nsm_parent_field = "parent_account"
|
nsm_parent_field = "parent_account"
|
||||||
|
|
||||||
def on_update(self):
|
def on_update(self):
|
||||||
@@ -32,8 +91,8 @@ class Account(NestedSet):
|
|||||||
super(Account, self).on_update()
|
super(Account, self).on_update()
|
||||||
|
|
||||||
def onload(self):
|
def onload(self):
|
||||||
frozen_accounts_modifier = frappe.db.get_value(
|
frozen_accounts_modifier = frappe.db.get_single_value(
|
||||||
"Accounts Settings", "Accounts Settings", "frozen_accounts_modifier"
|
"Accounts Settings", "frozen_accounts_modifier"
|
||||||
)
|
)
|
||||||
if not frozen_accounts_modifier or frozen_accounts_modifier in frappe.get_roles():
|
if not frozen_accounts_modifier or frozen_accounts_modifier in frappe.get_roles():
|
||||||
self.set_onload("can_freeze_account", True)
|
self.set_onload("can_freeze_account", True)
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ frappe.treeview_settings["Account"] = {
|
|||||||
|
|
||||||
// show Dr if positive since balance is calculated as debit - credit else show Cr
|
// show Dr if positive since balance is calculated as debit - credit else show Cr
|
||||||
const balance = account.balance_in_account_currency || account.balance;
|
const balance = account.balance_in_account_currency || account.balance;
|
||||||
const dr_or_cr = balance > 0 ? "Dr": "Cr";
|
const dr_or_cr = balance > 0 ? __("Dr"): __("Cr");
|
||||||
const format = (value, currency) => format_currency(Math.abs(value), currency);
|
const format = (value, currency) => format_currency(Math.abs(value), currency);
|
||||||
|
|
||||||
if (account.balance!==undefined) {
|
if (account.balance!==undefined) {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ def create_charts(
|
|||||||
# after all accounts are already inserted.
|
# after all accounts are already inserted.
|
||||||
frappe.local.flags.ignore_update_nsm = True
|
frappe.local.flags.ignore_update_nsm = True
|
||||||
_import_accounts(chart, None, None, root_account=True)
|
_import_accounts(chart, None, None, root_account=True)
|
||||||
rebuild_tree("Account", "parent_account")
|
rebuild_tree("Account")
|
||||||
frappe.local.flags.ignore_update_nsm = False
|
frappe.local.flags.ignore_update_nsm = False
|
||||||
|
|
||||||
|
|
||||||
@@ -231,6 +231,8 @@ def build_account_tree(tree, parent, all_accounts):
|
|||||||
tree[child.account_name]["account_type"] = child.account_type
|
tree[child.account_name]["account_type"] = child.account_type
|
||||||
if child.tax_rate:
|
if child.tax_rate:
|
||||||
tree[child.account_name]["tax_rate"] = child.tax_rate
|
tree[child.account_name]["tax_rate"] = child.tax_rate
|
||||||
|
if child.account_currency:
|
||||||
|
tree[child.account_name]["account_currency"] = child.account_currency
|
||||||
if not parent:
|
if not parent:
|
||||||
tree[child.account_name]["root_type"] = child.root_type
|
tree[child.account_name]["root_type"] = child.root_type
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
"0360 Bauliche Investitionen in fremden (gepachteten) Betriebs- und Geschäftsgebäuden": {"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"},
|
"0370 Bauliche Investitionen in fremden (gepachteten) Wohn- und Sozialgebäuden": {"account_type": "Fixed Asset"},
|
||||||
"0390 Kumulierte Abschreibungen zu Grundstücken ": {"account_type": "Fixed Asset"},
|
"0390 Kumulierte Abschreibungen zu Grundstücken ": {"account_type": "Fixed Asset"},
|
||||||
"0400 Maschinen und Geräte ": {"account_type": "Fixed Asset"},
|
"0400 Maschinen und Geräte ": {"account_type": "Fixed Asset"},
|
||||||
"0500 Maschinenwerkzeuge ": {"account_type": "Fixed Asset"},
|
"0500 Maschinenwerkzeuge ": {"account_type": "Fixed Asset"},
|
||||||
"0510 Allgemeine Werkzeuge und Handwerkzeuge ": {"account_type": "Fixed Asset"},
|
"0510 Allgemeine Werkzeuge und Handwerkzeuge ": {"account_type": "Fixed Asset"},
|
||||||
"0520 Prototypen, Formen, Modelle ": {"account_type": "Fixed Asset"},
|
"0520 Prototypen, Formen, Modelle ": {"account_type": "Fixed Asset"},
|
||||||
@@ -65,42 +65,41 @@
|
|||||||
"0980 Geleistete Anzahlungen auf Finanzanlagen ": {"account_type": "Fixed Asset"},
|
"0980 Geleistete Anzahlungen auf Finanzanlagen ": {"account_type": "Fixed Asset"},
|
||||||
"0990 Kumulierte Abschreibungen zu Finanzanlagen ": {"account_type": "Fixed Asset"},
|
"0990 Kumulierte Abschreibungen zu Finanzanlagen ": {"account_type": "Fixed Asset"},
|
||||||
"root_type": "Asset"
|
"root_type": "Asset"
|
||||||
},
|
},
|
||||||
"Klasse 1 Aktiva: Vorr\u00e4te": {
|
"Klasse 1 Aktiva: Vorr\u00e4te": {
|
||||||
"1000 Bezugsverrechnung": {"account_type": "Stock"},
|
"1000 Bezugsverrechnung": {"account_type": "Stock"},
|
||||||
"1100 Rohstoffe": {"account_type": "Stock"},
|
"1100 Rohstoffe": {"account_type": "Stock"},
|
||||||
"1200 Bezogene Teile": {"account_type": "Stock"},
|
"1200 Bezogene Teile": {"account_type": "Stock"},
|
||||||
"1300 Hilfsstoffe": {"account_type": "Stock"},
|
"1300 Hilfsstoffe": {"account_type": "Stock"},
|
||||||
"1350 Betriebsstoffe": {"account_type": "Stock"},
|
"1350 Betriebsstoffe": {"account_type": "Stock"},
|
||||||
"1360 Vorrat Energietraeger": {"account_type": "Stock"},
|
"1360 Vorrat Energietraeger": {"account_type": "Stock"},
|
||||||
"1400 Unfertige Erzeugnisse": {"account_type": "Stock"},
|
"1400 Unfertige Erzeugnisse": {"account_type": "Stock"},
|
||||||
"1500 Fertige Erzeugnisse": {"account_type": "Stock"},
|
"1500 Fertige Erzeugnisse": {"account_type": "Stock"},
|
||||||
"1600 Handelswarenvorrat": {"account_type": "Stock Received But Not Billed"},
|
"1600 Handelswarenvorrat": {"account_type": "Stock Received But Not Billed"},
|
||||||
"1700 Noch nicht abrechenbare Leistungen": {"account_type": "Stock"},
|
"1700 Noch nicht abrechenbare Leistungen": {"account_type": "Stock"},
|
||||||
"1900 Wertberichtigungen": {"account_type": "Stock"},
|
|
||||||
"1800 Geleistete Anzahlungen": {"account_type": "Stock"},
|
"1800 Geleistete Anzahlungen": {"account_type": "Stock"},
|
||||||
"1900 Wertberichtigungen": {"account_type": "Stock"},
|
"1900 Wertberichtigungen": {"account_type": "Stock"},
|
||||||
"root_type": "Asset"
|
"root_type": "Asset"
|
||||||
},
|
},
|
||||||
"Klasse 3 Passiva: Verbindlichkeiten": {
|
"Klasse 3 Passiva: Verbindlichkeiten": {
|
||||||
"3000 Allgemeine Verbindlichkeiten (Schuld)": {"account_type": "Payable"},
|
"3000 Allgemeine Verbindlichkeiten (Schuld)": {"account_type": "Payable"},
|
||||||
"3010 R\u00fcckstellungen f\u00fcr Pensionen": {"account_type": "Payable"},
|
"3010 R\u00fcckstellungen f\u00fcr Pensionen": {"account_type": "Payable"},
|
||||||
"3020 Steuerr\u00fcckstellungen": {"account_type": "Tax"},
|
"3020 Steuerr\u00fcckstellungen": {"account_type": "Tax"},
|
||||||
"3041 Sonstige R\u00fcckstellungen": {"account_type": "Payable"},
|
"3041 Sonstige R\u00fcckstellungen": {"account_type": "Payable"},
|
||||||
"3110 Verbindlichkeiten gegen\u00fcber Bank": {"account_type": "Payable"},
|
"3110 Verbindlichkeiten gegen\u00fcber Bank": {"account_type": "Payable"},
|
||||||
"3150 Verbindlichkeiten Darlehen": {"account_type": "Payable"},
|
"3150 Verbindlichkeiten Darlehen": {"account_type": "Payable"},
|
||||||
"3185 Verbindlichkeiten Kreditkarte": {"account_type": "Payable"},
|
"3185 Verbindlichkeiten Kreditkarte": {"account_type": "Payable"},
|
||||||
"3380 Verbindlichkeiten aus der Annahme gezogener Wechsel u. d. Ausstellungen eigener Wechsel": {
|
"3380 Verbindlichkeiten aus der Annahme gezogener Wechsel u. d. Ausstellungen eigener Wechsel": {
|
||||||
"account_type": "Payable"
|
"account_type": "Payable"
|
||||||
},
|
},
|
||||||
"3400 Verbindlichkeiten gegen\u00fc. verb. Untern., Verbindl. gegen\u00fc. Untern., mit denen eine Beteiligungsverh\u00e4lnis besteht": {},
|
"3400 Verbindlichkeiten gegen\u00fc. verb. Untern., Verbindl. gegen\u00fc. Untern., mit denen eine Beteiligungsverh\u00e4lnis besteht": {},
|
||||||
"3460 Verbindlichkeiten gegenueber Gesellschaftern": {"account_type": "Payable"},
|
"3460 Verbindlichkeiten gegenueber Gesellschaftern": {"account_type": "Payable"},
|
||||||
"3470 Einlagen stiller Gesellschafter": {"account_type": "Payable"},
|
"3470 Einlagen stiller Gesellschafter": {"account_type": "Payable"},
|
||||||
"3585 Verbindlichkeiten Lohnsteuer": {"account_type": "Tax"},
|
"3585 Verbindlichkeiten Lohnsteuer": {"account_type": "Tax"},
|
||||||
"3590 Verbindlichkeiten Kommunalabgaben": {"account_type": "Tax"},
|
"3590 Verbindlichkeiten Kommunalabgaben": {"account_type": "Tax"},
|
||||||
"3595 Verbindlichkeiten Dienstgeberbeitrag": {"account_type": "Tax"},
|
"3595 Verbindlichkeiten Dienstgeberbeitrag": {"account_type": "Tax"},
|
||||||
"3600 Verbindlichkeiten Sozialversicherung": {"account_type": "Payable"},
|
"3600 Verbindlichkeiten Sozialversicherung": {"account_type": "Payable"},
|
||||||
"3640 Verbindlichkeiten Loehne und Gehaelter": {"account_type": "Payable"},
|
"3640 Verbindlichkeiten Loehne und Gehaelter": {"account_type": "Payable"},
|
||||||
"3700 Sonstige Verbindlichkeiten": {"account_type": "Payable"},
|
"3700 Sonstige Verbindlichkeiten": {"account_type": "Payable"},
|
||||||
"3900 Passive Rechnungsabgrenzungsposten": {"account_type": "Payable"},
|
"3900 Passive Rechnungsabgrenzungsposten": {"account_type": "Payable"},
|
||||||
"3100 Anleihen (einschlie\u00dflich konvertibler)": {"account_type": "Payable"},
|
"3100 Anleihen (einschlie\u00dflich konvertibler)": {"account_type": "Payable"},
|
||||||
@@ -119,13 +118,13 @@
|
|||||||
},
|
},
|
||||||
"3515 Umsatzsteuer Inland 10%": {
|
"3515 Umsatzsteuer Inland 10%": {
|
||||||
"account_type": "Tax"
|
"account_type": "Tax"
|
||||||
},
|
},
|
||||||
"3520 Umsatzsteuer aus i.g. Erwerb 20%": {
|
"3520 Umsatzsteuer aus i.g. Erwerb 20%": {
|
||||||
"account_type": "Tax"
|
"account_type": "Tax"
|
||||||
},
|
},
|
||||||
"3525 Umsatzsteuer aus i.g. Erwerb 10%": {
|
"3525 Umsatzsteuer aus i.g. Erwerb 10%": {
|
||||||
"account_type": "Tax"
|
"account_type": "Tax"
|
||||||
},
|
},
|
||||||
"3560 Umsatzsteuer-Evidenzkonto f\u00fcr erhaltene Anzahlungen auf Bestellungen": {},
|
"3560 Umsatzsteuer-Evidenzkonto f\u00fcr erhaltene Anzahlungen auf Bestellungen": {},
|
||||||
"3360 Verbindlichkeiten aus Lieferungen u. Leistungen EU": {
|
"3360 Verbindlichkeiten aus Lieferungen u. Leistungen EU": {
|
||||||
"account_type": "Payable"
|
"account_type": "Payable"
|
||||||
@@ -141,7 +140,7 @@
|
|||||||
"account_type": "Tax"
|
"account_type": "Tax"
|
||||||
},
|
},
|
||||||
"root_type": "Liability"
|
"root_type": "Liability"
|
||||||
},
|
},
|
||||||
"Klasse 2 Aktiva: Umlaufverm\u00f6gen, Rechnungsabgrenzungen": {
|
"Klasse 2 Aktiva: Umlaufverm\u00f6gen, Rechnungsabgrenzungen": {
|
||||||
"2030 Forderungen aus Lieferungen und Leistungen Inland (0% USt, umsatzsteuerfrei)": {
|
"2030 Forderungen aus Lieferungen und Leistungen Inland (0% USt, umsatzsteuerfrei)": {
|
||||||
"account_type": "Receivable"
|
"account_type": "Receivable"
|
||||||
@@ -154,7 +153,7 @@
|
|||||||
},
|
},
|
||||||
"2040 Forderungen aus Lieferungen und Leistungen Inland (sonstiger USt-Satz)": {
|
"2040 Forderungen aus Lieferungen und Leistungen Inland (sonstiger USt-Satz)": {
|
||||||
"account_type": "Receivable"
|
"account_type": "Receivable"
|
||||||
},
|
},
|
||||||
"2100 Forderungen aus Lieferungen und Leistungen EU": {
|
"2100 Forderungen aus Lieferungen und Leistungen EU": {
|
||||||
"account_type": "Receivable"
|
"account_type": "Receivable"
|
||||||
},
|
},
|
||||||
@@ -192,7 +191,7 @@
|
|||||||
"account_type": "Receivable"
|
"account_type": "Receivable"
|
||||||
},
|
},
|
||||||
"2570 Einfuhrumsatzsteuer (bezahlt)": {"account_type": "Tax"},
|
"2570 Einfuhrumsatzsteuer (bezahlt)": {"account_type": "Tax"},
|
||||||
|
|
||||||
"2460 Eingeforderte aber noch nicht eingezahlte Einlagen": {
|
"2460 Eingeforderte aber noch nicht eingezahlte Einlagen": {
|
||||||
"account_type": "Receivable"
|
"account_type": "Receivable"
|
||||||
},
|
},
|
||||||
@@ -243,10 +242,10 @@
|
|||||||
},
|
},
|
||||||
"2800 Guthaben bei Bank": {
|
"2800 Guthaben bei Bank": {
|
||||||
"account_type": "Bank"
|
"account_type": "Bank"
|
||||||
},
|
},
|
||||||
"2801 Guthaben bei Bank - Sparkonto": {
|
"2801 Guthaben bei Bank - Sparkonto": {
|
||||||
"account_type": "Bank"
|
"account_type": "Bank"
|
||||||
},
|
},
|
||||||
"2810 Guthaben bei Paypal": {
|
"2810 Guthaben bei Paypal": {
|
||||||
"account_type": "Bank"
|
"account_type": "Bank"
|
||||||
},
|
},
|
||||||
@@ -264,19 +263,19 @@
|
|||||||
},
|
},
|
||||||
"2895 Schwebende Geldbewegugen": {
|
"2895 Schwebende Geldbewegugen": {
|
||||||
"account_type": "Bank"
|
"account_type": "Bank"
|
||||||
},
|
},
|
||||||
"2513 Vorsteuer Inland 5%": {
|
"2513 Vorsteuer Inland 5%": {
|
||||||
"account_type": "Tax"
|
"account_type": "Tax"
|
||||||
},
|
},
|
||||||
"2515 Vorsteuer Inland 20%": {
|
"2515 Vorsteuer Inland 20%": {
|
||||||
"account_type": "Tax"
|
"account_type": "Tax"
|
||||||
},
|
},
|
||||||
"2520 Vorsteuer aus innergemeinschaftlichem Erwerb 10%": {
|
"2520 Vorsteuer aus innergemeinschaftlichem Erwerb 10%": {
|
||||||
"account_type": "Tax"
|
"account_type": "Tax"
|
||||||
},
|
},
|
||||||
"2525 Vorsteuer aus innergemeinschaftlichem Erwerb 20%": {
|
"2525 Vorsteuer aus innergemeinschaftlichem Erwerb 20%": {
|
||||||
"account_type": "Tax"
|
"account_type": "Tax"
|
||||||
},
|
},
|
||||||
"2530 Vorsteuer \u00a719/Art 19 ( reverse charge ) ": {
|
"2530 Vorsteuer \u00a719/Art 19 ( reverse charge ) ": {
|
||||||
"account_type": "Tax"
|
"account_type": "Tax"
|
||||||
},
|
},
|
||||||
@@ -286,16 +285,16 @@
|
|||||||
"root_type": "Asset"
|
"root_type": "Asset"
|
||||||
},
|
},
|
||||||
"Klasse 4: Betriebliche Erträge": {
|
"Klasse 4: Betriebliche Erträge": {
|
||||||
"4000 Erlöse 20 %": {"account_type": "Income Account"},
|
"4000 Erlöse 20 %": {"account_type": "Income Account"},
|
||||||
"4020 Erl\u00f6se 0 % steuerbefreit": {"account_type": "Income Account"},
|
"4020 Erl\u00f6se 0 % steuerbefreit": {"account_type": "Income Account"},
|
||||||
"4010 Erl\u00f6se 10 %": {"account_type": "Income Account"},
|
"4010 Erl\u00f6se 10 %": {"account_type": "Income Account"},
|
||||||
"4030 Erl\u00f6se 13 %": {"account_type": "Income Account"},
|
"4030 Erl\u00f6se 13 %": {"account_type": "Income Account"},
|
||||||
"4040 Erl\u00f6se 0 % innergemeinschaftliche Lieferungen": {"account_type": "Income Account"},
|
"4040 Erl\u00f6se 0 % innergemeinschaftliche Lieferungen": {"account_type": "Income Account"},
|
||||||
"4400 Erl\u00f6sreduktion 0 % steuerbefreit": {"account_type": "Expense Account"},
|
"4400 Erl\u00f6sreduktion 0 % steuerbefreit": {"account_type": "Expense Account"},
|
||||||
"4410 Erl\u00f6sreduktion 10 %": {"account_type": "Expense Account"},
|
"4410 Erl\u00f6sreduktion 10 %": {"account_type": "Expense Account"},
|
||||||
"4420 Erl\u00f6sreduktion 20 %": {"account_type": "Expense Account"},
|
"4420 Erl\u00f6sreduktion 20 %": {"account_type": "Expense Account"},
|
||||||
"4430 Erl\u00f6sreduktion 13 %": {"account_type": "Expense Account"},
|
"4430 Erl\u00f6sreduktion 13 %": {"account_type": "Expense Account"},
|
||||||
"4440 Erl\u00f6sreduktion 0 % innergemeinschaftliche Lieferungen": {"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"},
|
"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"},
|
"4580 Aktivierte Eigenleistungen": {"account_type": "Income Account"},
|
||||||
"4600 Erl\u00f6se aus dem Abgang vom Anlageverm\u00f6gen, ausgen. Finanzanlagen": {"account_type": "Income Account"},
|
"4600 Erl\u00f6se aus dem Abgang vom Anlageverm\u00f6gen, ausgen. Finanzanlagen": {"account_type": "Income Account"},
|
||||||
@@ -304,15 +303,15 @@
|
|||||||
"4700 Ertr\u00e4ge aus der Aufl\u00f6sung von R\u00fcckstellungen": {"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"},
|
"4800 \u00dcbrige betriebliche Ertr\u00e4ge": {"account_type": "Income Account"},
|
||||||
"root_type": "Income"
|
"root_type": "Income"
|
||||||
},
|
},
|
||||||
"Klasse 5: Aufwand f\u00fcr Material und Leistungen": {
|
"Klasse 5: Aufwand f\u00fcr Material und Leistungen": {
|
||||||
"5000 Einkauf Partnerleistungen": {"account_type": "Cost of Goods Sold"},
|
"5000 Einkauf Partnerleistungen": {"account_type": "Cost of Goods Sold"},
|
||||||
"5100 Verbrauch an Rohstoffen": {"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"},
|
"5200 Verbrauch von bezogenen Fertig- und Einzelteilen": {"account_type": "Cost of Goods Sold"},
|
||||||
"5300 Verbrauch von Hilfsstoffen": {"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"},
|
"5340 Verbrauch Verpackungsmaterial": {"account_type": "Cost of Goods Sold"},
|
||||||
"5470 Verbrauch von Kleinmaterial": {"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"},
|
"5450 Verbrauch von Reinigungsmaterial": {"account_type": "Cost of Goods Sold"},
|
||||||
"5400 Verbrauch von Betriebsstoffen": {"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"},
|
"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"},
|
"5600 Verbrauch von Brenn- und Treibstoffen, Energie und Wasser": {"account_type": "Cost of Goods Sold"},
|
||||||
@@ -340,7 +339,7 @@
|
|||||||
"6700 Sonstige Sozialaufwendungen": {"account_type": "Payable"},
|
"6700 Sonstige Sozialaufwendungen": {"account_type": "Payable"},
|
||||||
"6900 Aufwandsstellenrechnung Personal": {"account_type": "Payable"},
|
"6900 Aufwandsstellenrechnung Personal": {"account_type": "Payable"},
|
||||||
"root_type": "Expense"
|
"root_type": "Expense"
|
||||||
},
|
},
|
||||||
"Klasse 7: Abschreibungen und sonstige betriebliche Aufwendungen": {
|
"Klasse 7: Abschreibungen und sonstige betriebliche Aufwendungen": {
|
||||||
"7010 Abschreibungen auf das Anlageverm\u00f6gen (ausgenommen Finanzanlagen)": {"account_type": "Depreciation"},
|
"7010 Abschreibungen auf das Anlageverm\u00f6gen (ausgenommen Finanzanlagen)": {"account_type": "Depreciation"},
|
||||||
"7100 Sonstige Steuern und Geb\u00fchren": {"account_type": "Tax"},
|
"7100 Sonstige Steuern und Geb\u00fchren": {"account_type": "Tax"},
|
||||||
@@ -349,7 +348,7 @@
|
|||||||
"7310 Fahrrad - Aufwand": {"account_type": "Expense Account"},
|
"7310 Fahrrad - Aufwand": {"account_type": "Expense Account"},
|
||||||
"7320 Kfz - Aufwand": {"account_type": "Expense Account"},
|
"7320 Kfz - Aufwand": {"account_type": "Expense Account"},
|
||||||
"7330 LKW - Aufwand": {"account_type": "Expense Account"},
|
"7330 LKW - Aufwand": {"account_type": "Expense Account"},
|
||||||
"7340 Lastenrad - Aufwand": {"account_type": "Expense Account"},
|
"7340 Lastenrad - Aufwand": {"account_type": "Expense Account"},
|
||||||
"7350 Reise- und Fahraufwand": {"account_type": "Expense Account"},
|
"7350 Reise- und Fahraufwand": {"account_type": "Expense Account"},
|
||||||
"7360 Tag- und N\u00e4chtigungsgelder": {"account_type": "Expense Account"},
|
"7360 Tag- und N\u00e4chtigungsgelder": {"account_type": "Expense Account"},
|
||||||
"7380 Nachrichtenaufwand": {"account_type": "Expense Account"},
|
"7380 Nachrichtenaufwand": {"account_type": "Expense Account"},
|
||||||
@@ -409,7 +408,7 @@
|
|||||||
"8990 Gewinnabfuhr bzw. Verlust\u00fcberrechnung aus Ergebnisabf\u00fchrungsvertr\u00e4gen": {"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"},
|
"8350 nicht ausgenutzte Lieferantenskonti": {"account_type": "Expense Account"},
|
||||||
"root_type": "Income"
|
"root_type": "Income"
|
||||||
},
|
},
|
||||||
"Klasse 9 Passiva: Eigenkapital, R\u00fccklagen, stille Einlagen, Abschlusskonten": {
|
"Klasse 9 Passiva: Eigenkapital, R\u00fccklagen, stille Einlagen, Abschlusskonten": {
|
||||||
"9000 Gezeichnetes bzw. gewidmetes Kapital": {
|
"9000 Gezeichnetes bzw. gewidmetes Kapital": {
|
||||||
"account_type": "Equity"
|
"account_type": "Equity"
|
||||||
@@ -435,5 +434,5 @@
|
|||||||
},
|
},
|
||||||
"root_type": "Equity"
|
"root_type": "Equity"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,9 @@
|
|||||||
},
|
},
|
||||||
"Stocks": {
|
"Stocks": {
|
||||||
"Mati\u00e8res premi\u00e8res": {},
|
"Mati\u00e8res premi\u00e8res": {},
|
||||||
"Stock de produits fini": {},
|
"Stock de produits fini": {
|
||||||
|
"account_type": "Stock"
|
||||||
|
},
|
||||||
"Stock exp\u00e9di\u00e9 non-factur\u00e9": {},
|
"Stock exp\u00e9di\u00e9 non-factur\u00e9": {},
|
||||||
"Travaux en cours": {},
|
"Travaux en cours": {},
|
||||||
"account_type": "Stock"
|
"account_type": "Stock"
|
||||||
@@ -395,9 +397,11 @@
|
|||||||
},
|
},
|
||||||
"Produits": {
|
"Produits": {
|
||||||
"Revenus de ventes": {
|
"Revenus de ventes": {
|
||||||
" Escomptes de volume sur ventes": {},
|
"Escomptes de volume sur ventes": {},
|
||||||
"Autres produits d'exploitation": {},
|
"Autres produits d'exploitation": {},
|
||||||
"Ventes": {},
|
"Ventes": {
|
||||||
|
"account_type": "Income Account"
|
||||||
|
},
|
||||||
"Ventes avec des provinces harmonis\u00e9es": {},
|
"Ventes avec des provinces harmonis\u00e9es": {},
|
||||||
"Ventes avec des provinces non-harmonis\u00e9es": {},
|
"Ventes avec des provinces non-harmonis\u00e9es": {},
|
||||||
"Ventes \u00e0 l'\u00e9tranger": {}
|
"Ventes \u00e0 l'\u00e9tranger": {}
|
||||||
|
|||||||
@@ -53,8 +53,13 @@
|
|||||||
},
|
},
|
||||||
"II. Forderungen und sonstige Vermögensgegenstände": {
|
"II. Forderungen und sonstige Vermögensgegenstände": {
|
||||||
"is_group": 1,
|
"is_group": 1,
|
||||||
"Ford. a. Lieferungen und Leistungen": {
|
"Forderungen aus Lieferungen und Leistungen mit Kontokorrent": {
|
||||||
"account_number": "1400",
|
"account_number": "1400",
|
||||||
|
"account_type": "Receivable",
|
||||||
|
"is_group": 1
|
||||||
|
},
|
||||||
|
"Forderungen aus Lieferungen und Leistungen ohne Kontokorrent": {
|
||||||
|
"account_number": "1410",
|
||||||
"account_type": "Receivable"
|
"account_type": "Receivable"
|
||||||
},
|
},
|
||||||
"Durchlaufende Posten": {
|
"Durchlaufende Posten": {
|
||||||
@@ -180,8 +185,13 @@
|
|||||||
},
|
},
|
||||||
"IV. Verbindlichkeiten aus Lieferungen und Leistungen": {
|
"IV. Verbindlichkeiten aus Lieferungen und Leistungen": {
|
||||||
"is_group": 1,
|
"is_group": 1,
|
||||||
"Verbindlichkeiten aus Lieferungen u. Leistungen": {
|
"Verbindlichkeiten aus Lieferungen und Leistungen mit Kontokorrent": {
|
||||||
"account_number": "1600",
|
"account_number": "1600",
|
||||||
|
"account_type": "Payable",
|
||||||
|
"is_group": 1
|
||||||
|
},
|
||||||
|
"Verbindlichkeiten aus Lieferungen und Leistungen ohne Kontokorrent": {
|
||||||
|
"account_number": "1610",
|
||||||
"account_type": "Payable"
|
"account_type": "Payable"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,6 @@
|
|||||||
{
|
{
|
||||||
|
"country_code": "hu",
|
||||||
|
"name": "Hungary - Chart of Accounts for Microenterprises",
|
||||||
"tree": {
|
"tree": {
|
||||||
"SZ\u00c1MLAOSZT\u00c1LY BEFEKTETETT ESZK\u00d6Z\u00d6K": {
|
"SZ\u00c1MLAOSZT\u00c1LY BEFEKTETETT ESZK\u00d6Z\u00d6K": {
|
||||||
"account_number": 1,
|
"account_number": 1,
|
||||||
@@ -1651,4 +1653,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"country_code": "ni",
|
"country_code": "ni",
|
||||||
"name": "Nicaragua - Catalogo de Cuentas",
|
"name": "Nicaragua - Catálogo de Cuentas",
|
||||||
"tree": {
|
"tree": {
|
||||||
"Activo": {
|
"Activo": {
|
||||||
"Activo Corriente": {
|
"Activo Corriente": {
|
||||||
@@ -491,4 +491,4 @@
|
|||||||
"root_type": "Liability"
|
"root_type": "Liability"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,29 @@ from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
|
|||||||
|
|
||||||
|
|
||||||
class AccountClosingBalance(Document):
|
class AccountClosingBalance(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link | None
|
||||||
|
account_currency: DF.Link | None
|
||||||
|
closing_date: DF.Date | None
|
||||||
|
company: DF.Link | None
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
credit: DF.Currency
|
||||||
|
credit_in_account_currency: DF.Currency
|
||||||
|
debit: DF.Currency
|
||||||
|
debit_in_account_currency: DF.Currency
|
||||||
|
finance_book: DF.Link | None
|
||||||
|
is_period_closing_voucher_entry: DF.Check
|
||||||
|
period_closing_voucher: DF.Link | None
|
||||||
|
project: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,25 @@ from frappe.utils import cstr
|
|||||||
|
|
||||||
|
|
||||||
class AccountingDimension(Document):
|
class AccountingDimension(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.accounting_dimension_detail.accounting_dimension_detail import (
|
||||||
|
AccountingDimensionDetail,
|
||||||
|
)
|
||||||
|
|
||||||
|
dimension_defaults: DF.Table[AccountingDimensionDetail]
|
||||||
|
disabled: DF.Check
|
||||||
|
document_type: DF.Link
|
||||||
|
fieldname: DF.Data | None
|
||||||
|
label: DF.Data | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def before_insert(self):
|
def before_insert(self):
|
||||||
self.set_fieldname_and_label()
|
self.set_fieldname_and_label()
|
||||||
|
|
||||||
|
|||||||
@@ -7,4 +7,24 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class AccountingDimensionDetail(Document):
|
class AccountingDimensionDetail(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
automatically_post_balancing_accounting_entry: DF.Check
|
||||||
|
company: DF.Link | None
|
||||||
|
default_dimension: DF.DynamicLink | None
|
||||||
|
mandatory_for_bs: DF.Check
|
||||||
|
mandatory_for_pl: DF.Check
|
||||||
|
offsetting_account: DF.Link | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
reference_document: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -8,6 +8,28 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class AccountingDimensionFilter(Document):
|
class AccountingDimensionFilter(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.allowed_dimension.allowed_dimension import AllowedDimension
|
||||||
|
from erpnext.accounts.doctype.applicable_on_account.applicable_on_account import (
|
||||||
|
ApplicableOnAccount,
|
||||||
|
)
|
||||||
|
|
||||||
|
accounting_dimension: DF.Literal
|
||||||
|
accounts: DF.Table[ApplicableOnAccount]
|
||||||
|
allow_or_restrict: DF.Literal["Allow", "Restrict"]
|
||||||
|
apply_restriction_on_values: DF.Check
|
||||||
|
company: DF.Link
|
||||||
|
dimensions: DF.Table[AllowedDimension]
|
||||||
|
disabled: DF.Check
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def before_save(self):
|
def before_save(self):
|
||||||
# If restriction is not applied on values, then remove all the dimensions and set allow_or_restrict to Restrict
|
# If restriction is not applied on values, then remove all the dimensions and set allow_or_restrict to Restrict
|
||||||
if not self.apply_restriction_on_values:
|
if not self.apply_restriction_on_values:
|
||||||
|
|||||||
@@ -16,6 +16,23 @@ class ClosedAccountingPeriod(frappe.ValidationError):
|
|||||||
|
|
||||||
|
|
||||||
class AccountingPeriod(Document):
|
class AccountingPeriod(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.closed_document.closed_document import ClosedDocument
|
||||||
|
|
||||||
|
closed_documents: DF.Table[ClosedDocument]
|
||||||
|
company: DF.Link
|
||||||
|
end_date: DF.Date
|
||||||
|
period_name: DF.Data
|
||||||
|
start_date: DF.Date
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_overlap()
|
self.validate_overlap()
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,12 @@
|
|||||||
"show_balance_in_coa",
|
"show_balance_in_coa",
|
||||||
"banking_tab",
|
"banking_tab",
|
||||||
"enable_party_matching",
|
"enable_party_matching",
|
||||||
"enable_fuzzy_matching"
|
"enable_fuzzy_matching",
|
||||||
|
"reports_tab",
|
||||||
|
"remarks_section",
|
||||||
|
"general_ledger_remarks_length",
|
||||||
|
"column_break_lvjk",
|
||||||
|
"receivable_payable_remarks_length"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
@@ -422,6 +427,34 @@
|
|||||||
"fieldname": "round_row_wise_tax",
|
"fieldname": "round_row_wise_tax",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Round Tax Amount Row-wise"
|
"label": "Round Tax Amount Row-wise"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "reports_tab",
|
||||||
|
"fieldtype": "Tab Break",
|
||||||
|
"label": "Reports"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"description": "Truncates 'Remarks' column to set character length",
|
||||||
|
"fieldname": "general_ledger_remarks_length",
|
||||||
|
"fieldtype": "Int",
|
||||||
|
"label": "General Ledger"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"description": "Truncates 'Remarks' column to set character length",
|
||||||
|
"fieldname": "receivable_payable_remarks_length",
|
||||||
|
"fieldtype": "Int",
|
||||||
|
"label": "Accounts Receivable/Payable"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_lvjk",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "remarks_section",
|
||||||
|
"fieldtype": "Section Break",
|
||||||
|
"label": "Remarks Column Length"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "icon-cog",
|
"icon": "icon-cog",
|
||||||
@@ -429,7 +462,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-08-28 00:12:02.740633",
|
"modified": "2023-11-20 09:37:47.650347",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Accounts Settings",
|
"name": "Accounts Settings",
|
||||||
|
|||||||
@@ -14,6 +14,52 @@ from erpnext.stock.utils import check_pending_reposting
|
|||||||
|
|
||||||
|
|
||||||
class AccountsSettings(Document):
|
class AccountsSettings(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
acc_frozen_upto: DF.Date | None
|
||||||
|
add_taxes_from_item_tax_template: DF.Check
|
||||||
|
allow_multi_currency_invoices_against_single_party_account: DF.Check
|
||||||
|
allow_stale: DF.Check
|
||||||
|
auto_reconcile_payments: DF.Check
|
||||||
|
automatically_fetch_payment_terms: DF.Check
|
||||||
|
automatically_process_deferred_accounting_entry: DF.Check
|
||||||
|
book_asset_depreciation_entry_automatically: DF.Check
|
||||||
|
book_deferred_entries_based_on: DF.Literal["Days", "Months"]
|
||||||
|
book_deferred_entries_via_journal_entry: DF.Check
|
||||||
|
book_tax_discount_loss: DF.Check
|
||||||
|
check_supplier_invoice_uniqueness: DF.Check
|
||||||
|
credit_controller: DF.Link | None
|
||||||
|
delete_linked_ledger_entries: DF.Check
|
||||||
|
determine_address_tax_category_from: DF.Literal["Billing Address", "Shipping Address"]
|
||||||
|
enable_common_party_accounting: DF.Check
|
||||||
|
enable_fuzzy_matching: DF.Check
|
||||||
|
enable_party_matching: DF.Check
|
||||||
|
frozen_accounts_modifier: DF.Link | None
|
||||||
|
general_ledger_remarks_length: DF.Int
|
||||||
|
ignore_account_closing_balance: DF.Check
|
||||||
|
make_payment_via_journal_entry: DF.Check
|
||||||
|
merge_similar_account_heads: DF.Check
|
||||||
|
over_billing_allowance: DF.Currency
|
||||||
|
post_change_gl_entries: DF.Check
|
||||||
|
receivable_payable_remarks_length: DF.Int
|
||||||
|
role_allowed_to_over_bill: DF.Link | None
|
||||||
|
round_row_wise_tax: DF.Check
|
||||||
|
show_balance_in_coa: DF.Check
|
||||||
|
show_inclusive_tax_in_print: DF.Check
|
||||||
|
show_payment_schedule_in_print: DF.Check
|
||||||
|
show_taxes_as_table_in_print: DF.Check
|
||||||
|
stale_days: DF.Int
|
||||||
|
submit_journal_entries: DF.Check
|
||||||
|
unlink_advance_payment_on_cancelation_of_order: DF.Check
|
||||||
|
unlink_payment_on_cancellation_of_invoice: DF.Check
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
old_doc = self.get_doc_before_save()
|
old_doc = self.get_doc_before_save()
|
||||||
clear_cache = False
|
clear_cache = False
|
||||||
|
|||||||
@@ -6,4 +6,22 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class AdvanceTax(Document):
|
class AdvanceTax(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account_head: DF.Link | None
|
||||||
|
allocated_amount: DF.Currency
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
reference_detail: DF.Data | None
|
||||||
|
reference_name: DF.DynamicLink | None
|
||||||
|
reference_type: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -7,4 +7,33 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class AdvanceTaxesandCharges(Document):
|
class AdvanceTaxesandCharges(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account_head: DF.Link
|
||||||
|
add_deduct_tax: DF.Literal["Add", "Deduct"]
|
||||||
|
allocated_amount: DF.Currency
|
||||||
|
base_tax_amount: DF.Currency
|
||||||
|
base_total: DF.Currency
|
||||||
|
charge_type: DF.Literal[
|
||||||
|
"", "Actual", "On Paid Amount", "On Previous Row Amount", "On Previous Row Total"
|
||||||
|
]
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
currency: DF.Link | None
|
||||||
|
description: DF.SmallText
|
||||||
|
included_in_paid_amount: DF.Check
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
rate: DF.Float
|
||||||
|
row_id: DF.Data | None
|
||||||
|
tax_amount: DF.Currency
|
||||||
|
total: DF.Currency
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -7,4 +7,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class AllowedDimension(Document):
|
class AllowedDimension(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
accounting_dimension: DF.Link | None
|
||||||
|
dimension_value: DF.DynamicLink | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "company",
|
"fieldname": "company",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
|
"ignore_user_permissions": 1,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Company",
|
"label": "Company",
|
||||||
"options": "Company",
|
"options": "Company",
|
||||||
@@ -19,7 +20,7 @@
|
|||||||
],
|
],
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2020-05-01 12:32:34.044911",
|
"modified": "2024-01-03 11:13:02.669632",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Allowed To Transact With",
|
"name": "Allowed To Transact With",
|
||||||
@@ -28,5 +29,6 @@
|
|||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
|
"states": [],
|
||||||
"track_changes": 1
|
"track_changes": 1
|
||||||
}
|
}
|
||||||
@@ -6,4 +6,18 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class AllowedToTransactWith(Document):
|
class AllowedToTransactWith(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
company: DF.Link
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -7,4 +7,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class ApplicableOnAccount(Document):
|
class ApplicableOnAccount(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
applicable_on_account: DF.Link
|
||||||
|
is_mandatory: DF.Check
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -10,6 +10,25 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class Bank(Document):
|
class Bank(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.bank_transaction_mapping.bank_transaction_mapping import (
|
||||||
|
BankTransactionMapping,
|
||||||
|
)
|
||||||
|
|
||||||
|
bank_name: DF.Data
|
||||||
|
bank_transaction_mapping: DF.Table[BankTransactionMapping]
|
||||||
|
plaid_access_token: DF.Data | None
|
||||||
|
swift_number: DF.Data | None
|
||||||
|
website: DF.Data | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def onload(self):
|
def onload(self):
|
||||||
"""Load address and contacts in `__onload`"""
|
"""Load address and contacts in `__onload`"""
|
||||||
load_address_and_contact(self)
|
load_address_and_contact(self)
|
||||||
|
|||||||
@@ -12,6 +12,33 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class BankAccount(Document):
|
class BankAccount(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link | None
|
||||||
|
account_name: DF.Data
|
||||||
|
account_subtype: DF.Link | None
|
||||||
|
account_type: DF.Link | None
|
||||||
|
bank: DF.Link
|
||||||
|
bank_account_no: DF.Data | None
|
||||||
|
branch_code: DF.Data | None
|
||||||
|
company: DF.Link | None
|
||||||
|
disabled: DF.Check
|
||||||
|
iban: DF.Data | None
|
||||||
|
integration_id: DF.Data | None
|
||||||
|
is_company_account: DF.Check
|
||||||
|
is_default: DF.Check
|
||||||
|
last_integration_date: DF.Date | None
|
||||||
|
mask: DF.Data | None
|
||||||
|
party: DF.DynamicLink | None
|
||||||
|
party_type: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def onload(self):
|
def onload(self):
|
||||||
"""Load address and contacts in `__onload`"""
|
"""Load address and contacts in `__onload`"""
|
||||||
load_address_and_contact(self)
|
load_address_and_contact(self)
|
||||||
|
|||||||
@@ -6,4 +6,15 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class BankAccountSubtype(Document):
|
class BankAccountSubtype(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account_subtype: DF.Data | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -7,4 +7,15 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class BankAccountType(Document):
|
class BankAccountType(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account_type: DF.Data | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -13,6 +13,28 @@ form_grid_templates = {"journal_entries": "templates/form_grid/bank_reconciliati
|
|||||||
|
|
||||||
|
|
||||||
class BankClearance(Document):
|
class BankClearance(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.bank_clearance_detail.bank_clearance_detail import (
|
||||||
|
BankClearanceDetail,
|
||||||
|
)
|
||||||
|
|
||||||
|
account: DF.Link
|
||||||
|
account_currency: DF.Link | None
|
||||||
|
bank_account: DF.Link | None
|
||||||
|
from_date: DF.Date
|
||||||
|
include_pos_transactions: DF.Check
|
||||||
|
include_reconciled_entries: DF.Check
|
||||||
|
payment_entries: DF.Table[BankClearanceDetail]
|
||||||
|
to_date: DF.Date
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_payment_entries(self):
|
def get_payment_entries(self):
|
||||||
if not (self.from_date and self.to_date):
|
if not (self.from_date and self.to_date):
|
||||||
|
|||||||
@@ -6,4 +6,25 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class BankClearanceDetail(Document):
|
class BankClearanceDetail(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
against_account: DF.Data | None
|
||||||
|
amount: DF.Data | None
|
||||||
|
cheque_date: DF.Date | None
|
||||||
|
cheque_number: DF.Data | None
|
||||||
|
clearance_date: DF.Date | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
payment_document: DF.Link | None
|
||||||
|
payment_entry: DF.DynamicLink | None
|
||||||
|
posting_date: DF.Date | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -8,6 +8,40 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class BankGuarantee(Document):
|
class BankGuarantee(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link | None
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
amount: DF.Currency
|
||||||
|
bank: DF.Link | None
|
||||||
|
bank_account: DF.Link | None
|
||||||
|
bank_account_no: DF.Data | None
|
||||||
|
bank_guarantee_number: DF.Data | None
|
||||||
|
bg_type: DF.Literal["", "Receiving", "Providing"]
|
||||||
|
branch_code: DF.Data | None
|
||||||
|
charges: DF.Currency
|
||||||
|
customer: DF.Link | None
|
||||||
|
end_date: DF.Date | None
|
||||||
|
fixed_deposit_number: DF.Data | None
|
||||||
|
iban: DF.Data | None
|
||||||
|
margin_money: DF.Currency
|
||||||
|
more_information: DF.TextEditor | None
|
||||||
|
name_of_beneficiary: DF.Data | None
|
||||||
|
project: DF.Link | None
|
||||||
|
reference_docname: DF.DynamicLink | None
|
||||||
|
reference_doctype: DF.Link | None
|
||||||
|
start_date: DF.Date
|
||||||
|
supplier: DF.Link | None
|
||||||
|
swift_number: DF.Data | None
|
||||||
|
validity: DF.Int
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if not (self.customer or self.supplier):
|
if not (self.customer or self.supplier):
|
||||||
frappe.throw(_("Select the customer or supplier."))
|
frappe.throw(_("Select the customer or supplier."))
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
|
|||||||
"erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_account_balance",
|
"erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_account_balance",
|
||||||
args: {
|
args: {
|
||||||
bank_account: frm.doc.bank_account,
|
bank_account: frm.doc.bank_account,
|
||||||
till_date: frm.doc.bank_statement_from_date,
|
till_date: frappe.datetime.add_days(frm.doc.bank_statement_from_date, -1)
|
||||||
},
|
},
|
||||||
callback: (response) => {
|
callback: (response) => {
|
||||||
frm.set_value("account_opening_balance", response.message);
|
frm.set_value("account_opening_balance", response.message);
|
||||||
|
|||||||
@@ -18,9 +18,30 @@ from erpnext.accounts.report.bank_reconciliation_statement.bank_reconciliation_s
|
|||||||
get_entries,
|
get_entries,
|
||||||
)
|
)
|
||||||
from erpnext.accounts.utils import get_account_currency, get_balance_on
|
from erpnext.accounts.utils import get_account_currency, get_balance_on
|
||||||
|
from erpnext.setup.utils import get_exchange_rate
|
||||||
|
|
||||||
|
|
||||||
class BankReconciliationTool(Document):
|
class BankReconciliationTool(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account_currency: DF.Link | None
|
||||||
|
account_opening_balance: DF.Currency
|
||||||
|
bank_account: DF.Link | None
|
||||||
|
bank_statement_closing_balance: DF.Currency
|
||||||
|
bank_statement_from_date: DF.Date | None
|
||||||
|
bank_statement_to_date: DF.Date | None
|
||||||
|
company: DF.Link | None
|
||||||
|
filter_by_reference_date: DF.Check
|
||||||
|
from_reference_date: DF.Date | None
|
||||||
|
to_reference_date: DF.Date | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -130,7 +151,7 @@ def create_journal_entry_bts(
|
|||||||
bank_transaction = frappe.db.get_values(
|
bank_transaction = frappe.db.get_values(
|
||||||
"Bank Transaction",
|
"Bank Transaction",
|
||||||
bank_transaction_name,
|
bank_transaction_name,
|
||||||
fieldname=["name", "deposit", "withdrawal", "bank_account"],
|
fieldname=["name", "deposit", "withdrawal", "bank_account", "currency"],
|
||||||
as_dict=True,
|
as_dict=True,
|
||||||
)[0]
|
)[0]
|
||||||
company_account = frappe.get_value("Bank Account", bank_transaction.bank_account, "account")
|
company_account = frappe.get_value("Bank Account", bank_transaction.bank_account, "account")
|
||||||
@@ -144,29 +165,94 @@ def create_journal_entry_bts(
|
|||||||
)
|
)
|
||||||
|
|
||||||
company = frappe.get_value("Account", company_account, "company")
|
company = frappe.get_value("Account", company_account, "company")
|
||||||
|
company_default_currency = frappe.get_cached_value("Company", company, "default_currency")
|
||||||
|
company_account_currency = frappe.get_cached_value("Account", company_account, "account_currency")
|
||||||
|
second_account_currency = frappe.get_cached_value("Account", second_account, "account_currency")
|
||||||
|
|
||||||
|
# determine if multi-currency Journal or not
|
||||||
|
is_multi_currency = (
|
||||||
|
True
|
||||||
|
if company_default_currency != company_account_currency
|
||||||
|
or company_default_currency != second_account_currency
|
||||||
|
or company_default_currency != bank_transaction.currency
|
||||||
|
else False
|
||||||
|
)
|
||||||
|
|
||||||
accounts = []
|
accounts = []
|
||||||
# Multi Currency?
|
second_account_dict = {
|
||||||
accounts.append(
|
"account": second_account,
|
||||||
{
|
"account_currency": second_account_currency,
|
||||||
"account": second_account,
|
"credit_in_account_currency": bank_transaction.deposit,
|
||||||
"credit_in_account_currency": bank_transaction.deposit,
|
"debit_in_account_currency": bank_transaction.withdrawal,
|
||||||
"debit_in_account_currency": bank_transaction.withdrawal,
|
"party_type": party_type,
|
||||||
"party_type": party_type,
|
"party": party,
|
||||||
"party": party,
|
"cost_center": get_default_cost_center(company),
|
||||||
"cost_center": get_default_cost_center(company),
|
}
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
accounts.append(
|
company_account_dict = {
|
||||||
{
|
"account": company_account,
|
||||||
"account": company_account,
|
"account_currency": company_account_currency,
|
||||||
"bank_account": bank_transaction.bank_account,
|
"bank_account": bank_transaction.bank_account,
|
||||||
"credit_in_account_currency": bank_transaction.withdrawal,
|
"credit_in_account_currency": bank_transaction.withdrawal,
|
||||||
"debit_in_account_currency": bank_transaction.deposit,
|
"debit_in_account_currency": bank_transaction.deposit,
|
||||||
"cost_center": get_default_cost_center(company),
|
"cost_center": get_default_cost_center(company),
|
||||||
}
|
}
|
||||||
)
|
|
||||||
|
# convert transaction amount to company currency
|
||||||
|
if is_multi_currency:
|
||||||
|
exc_rate = get_exchange_rate(bank_transaction.currency, company_default_currency, posting_date)
|
||||||
|
withdrawal_in_company_currency = flt(exc_rate * abs(bank_transaction.withdrawal))
|
||||||
|
deposit_in_company_currency = flt(exc_rate * abs(bank_transaction.deposit))
|
||||||
|
else:
|
||||||
|
withdrawal_in_company_currency = bank_transaction.withdrawal
|
||||||
|
deposit_in_company_currency = bank_transaction.deposit
|
||||||
|
|
||||||
|
# if second account is of foreign currency, convert and set debit and credit fields.
|
||||||
|
if second_account_currency != company_default_currency:
|
||||||
|
exc_rate = get_exchange_rate(second_account_currency, company_default_currency, posting_date)
|
||||||
|
second_account_dict.update(
|
||||||
|
{
|
||||||
|
"exchange_rate": exc_rate,
|
||||||
|
"credit": deposit_in_company_currency,
|
||||||
|
"debit": withdrawal_in_company_currency,
|
||||||
|
"credit_in_account_currency": flt(deposit_in_company_currency / exc_rate) or 0,
|
||||||
|
"debit_in_account_currency": flt(withdrawal_in_company_currency / exc_rate) or 0,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
second_account_dict.update(
|
||||||
|
{
|
||||||
|
"exchange_rate": 1,
|
||||||
|
"credit": deposit_in_company_currency,
|
||||||
|
"debit": withdrawal_in_company_currency,
|
||||||
|
"credit_in_account_currency": deposit_in_company_currency,
|
||||||
|
"debit_in_account_currency": withdrawal_in_company_currency,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
# if company account is of foreign currency, convert and set debit and credit fields.
|
||||||
|
if company_account_currency != company_default_currency:
|
||||||
|
exc_rate = get_exchange_rate(company_account_currency, company_default_currency, posting_date)
|
||||||
|
company_account_dict.update(
|
||||||
|
{
|
||||||
|
"exchange_rate": exc_rate,
|
||||||
|
"credit": withdrawal_in_company_currency,
|
||||||
|
"debit": deposit_in_company_currency,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
company_account_dict.update(
|
||||||
|
{
|
||||||
|
"exchange_rate": 1,
|
||||||
|
"credit": withdrawal_in_company_currency,
|
||||||
|
"debit": deposit_in_company_currency,
|
||||||
|
"credit_in_account_currency": withdrawal_in_company_currency,
|
||||||
|
"debit_in_account_currency": deposit_in_company_currency,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
accounts.append(second_account_dict)
|
||||||
|
accounts.append(company_account_dict)
|
||||||
|
|
||||||
journal_entry_dict = {
|
journal_entry_dict = {
|
||||||
"voucher_type": entry_type,
|
"voucher_type": entry_type,
|
||||||
@@ -176,6 +262,9 @@ def create_journal_entry_bts(
|
|||||||
"cheque_no": reference_number,
|
"cheque_no": reference_number,
|
||||||
"mode_of_payment": mode_of_payment,
|
"mode_of_payment": mode_of_payment,
|
||||||
}
|
}
|
||||||
|
if is_multi_currency:
|
||||||
|
journal_entry_dict.update({"multi_currency": True})
|
||||||
|
|
||||||
journal_entry = frappe.new_doc("Journal Entry")
|
journal_entry = frappe.new_doc("Journal Entry")
|
||||||
journal_entry.update(journal_entry_dict)
|
journal_entry.update(journal_entry_dict)
|
||||||
journal_entry.set("accounts", accounts)
|
journal_entry.set("accounts", accounts)
|
||||||
@@ -355,7 +444,13 @@ def reconcile_vouchers(bank_transaction_name, vouchers):
|
|||||||
vouchers = json.loads(vouchers)
|
vouchers = json.loads(vouchers)
|
||||||
transaction = frappe.get_doc("Bank Transaction", bank_transaction_name)
|
transaction = frappe.get_doc("Bank Transaction", bank_transaction_name)
|
||||||
transaction.add_payment_entries(vouchers)
|
transaction.add_payment_entries(vouchers)
|
||||||
return frappe.get_doc("Bank Transaction", bank_transaction_name)
|
transaction.validate_duplicate_references()
|
||||||
|
transaction.allocate_payment_entries()
|
||||||
|
transaction.update_allocated_amount()
|
||||||
|
transaction.set_status()
|
||||||
|
transaction.save()
|
||||||
|
|
||||||
|
return transaction
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
|
|||||||
@@ -2,6 +2,16 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on("Bank Statement Import", {
|
frappe.ui.form.on("Bank Statement Import", {
|
||||||
|
onload(frm) {
|
||||||
|
frm.set_query("bank_account", function (doc) {
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
company: doc.company,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
setup(frm) {
|
setup(frm) {
|
||||||
frappe.realtime.on("data_import_refresh", ({ data_import }) => {
|
frappe.realtime.on("data_import_refresh", ({ data_import }) => {
|
||||||
frm.import_in_progress = false;
|
frm.import_in_progress = false;
|
||||||
|
|||||||
@@ -20,6 +20,30 @@ INVALID_VALUES = ("", None)
|
|||||||
|
|
||||||
|
|
||||||
class BankStatementImport(DataImport):
|
class BankStatementImport(DataImport):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
bank: DF.Link | None
|
||||||
|
bank_account: DF.Link
|
||||||
|
company: DF.Link
|
||||||
|
google_sheets_url: DF.Data | None
|
||||||
|
import_file: DF.Attach | None
|
||||||
|
import_type: DF.Literal["", "Insert New Records", "Update Existing Records"]
|
||||||
|
mute_emails: DF.Check
|
||||||
|
reference_doctype: DF.Link
|
||||||
|
show_failed_logs: DF.Check
|
||||||
|
statement_import_log: DF.Code | None
|
||||||
|
status: DF.Literal["Pending", "Success", "Partial Success", "Error"]
|
||||||
|
submit_after_import: DF.Check
|
||||||
|
template_options: DF.Code | None
|
||||||
|
template_warnings: DF.Code | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(BankStatementImport, self).__init__(*args, **kwargs)
|
super(BankStatementImport, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,8 @@ class AutoMatchbyPartyNameDescription:
|
|||||||
|
|
||||||
for party in parties:
|
for party in parties:
|
||||||
filters = {"status": "Active"} if party == "Employee" else {"disabled": 0}
|
filters = {"status": "Active"} if party == "Employee" else {"disabled": 0}
|
||||||
names = frappe.get_all(party, filters=filters, pluck=party.lower() + "_name")
|
field = party.lower() + "_name"
|
||||||
|
names = frappe.get_all(party, filters=filters, fields=[f"{field} as party_name", "name"])
|
||||||
|
|
||||||
for field in ["bank_party_name", "description"]:
|
for field in ["bank_party_name", "description"]:
|
||||||
if not self.get(field):
|
if not self.get(field):
|
||||||
@@ -131,7 +132,11 @@ class AutoMatchbyPartyNameDescription:
|
|||||||
|
|
||||||
def fuzzy_search_and_return_result(self, party, names, field) -> Union[Tuple, None]:
|
def fuzzy_search_and_return_result(self, party, names, field) -> Union[Tuple, None]:
|
||||||
skip = False
|
skip = False
|
||||||
result = process.extract(query=self.get(field), choices=names, scorer=fuzz.token_set_ratio)
|
result = process.extract(
|
||||||
|
query=self.get(field),
|
||||||
|
choices={row.get("name"): row.get("party_name") for row in names},
|
||||||
|
scorer=fuzz.token_set_ratio,
|
||||||
|
)
|
||||||
party_name, skip = self.process_fuzzy_result(result)
|
party_name, skip = self.process_fuzzy_result(result)
|
||||||
|
|
||||||
if not party_name:
|
if not party_name:
|
||||||
@@ -149,14 +154,14 @@ class AutoMatchbyPartyNameDescription:
|
|||||||
|
|
||||||
Returns: Result, Skip (whether or not to discontinue matching)
|
Returns: Result, Skip (whether or not to discontinue matching)
|
||||||
"""
|
"""
|
||||||
PARTY, SCORE, CUTOFF = 0, 1, 80
|
SCORE, PARTY_ID, CUTOFF = 1, 2, 80
|
||||||
|
|
||||||
if not result or not len(result):
|
if not result or not len(result):
|
||||||
return None, False
|
return None, False
|
||||||
|
|
||||||
first_result = result[0]
|
first_result = result[0]
|
||||||
if len(result) == 1:
|
if len(result) == 1:
|
||||||
return (first_result[PARTY] if first_result[SCORE] > CUTOFF else None), True
|
return (first_result[PARTY_ID] if first_result[SCORE] > CUTOFF else None), True
|
||||||
|
|
||||||
second_result = result[1]
|
second_result = result[1]
|
||||||
if first_result[SCORE] > CUTOFF:
|
if first_result[SCORE] > CUTOFF:
|
||||||
@@ -165,7 +170,7 @@ class AutoMatchbyPartyNameDescription:
|
|||||||
if first_result[SCORE] == second_result[SCORE]:
|
if first_result[SCORE] == second_result[SCORE]:
|
||||||
return None, True
|
return None, True
|
||||||
|
|
||||||
return first_result[PARTY], True
|
return first_result[PARTY_ID], True
|
||||||
else:
|
else:
|
||||||
return None, False
|
return None, False
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"status",
|
"status",
|
||||||
"bank_account",
|
"bank_account",
|
||||||
"company",
|
"company",
|
||||||
|
"amended_from",
|
||||||
"section_break_4",
|
"section_break_4",
|
||||||
"deposit",
|
"deposit",
|
||||||
"withdrawal",
|
"withdrawal",
|
||||||
@@ -25,10 +26,10 @@
|
|||||||
"transaction_id",
|
"transaction_id",
|
||||||
"transaction_type",
|
"transaction_type",
|
||||||
"section_break_14",
|
"section_break_14",
|
||||||
|
"column_break_oufv",
|
||||||
"payment_entries",
|
"payment_entries",
|
||||||
"section_break_18",
|
"section_break_18",
|
||||||
"allocated_amount",
|
"allocated_amount",
|
||||||
"amended_from",
|
|
||||||
"column_break_17",
|
"column_break_17",
|
||||||
"unallocated_amount",
|
"unallocated_amount",
|
||||||
"party_section",
|
"party_section",
|
||||||
@@ -138,10 +139,12 @@
|
|||||||
"fieldtype": "Section Break"
|
"fieldtype": "Section Break"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_on_submit": 1,
|
||||||
"fieldname": "allocated_amount",
|
"fieldname": "allocated_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Allocated Amount",
|
"label": "Allocated Amount",
|
||||||
"options": "currency"
|
"options": "currency",
|
||||||
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "amended_from",
|
"fieldname": "amended_from",
|
||||||
@@ -157,10 +160,12 @@
|
|||||||
"fieldtype": "Column Break"
|
"fieldtype": "Column Break"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_on_submit": 1,
|
||||||
"fieldname": "unallocated_amount",
|
"fieldname": "unallocated_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Unallocated Amount",
|
"label": "Unallocated Amount",
|
||||||
"options": "currency"
|
"options": "currency",
|
||||||
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "party_section",
|
"fieldname": "party_section",
|
||||||
@@ -225,11 +230,15 @@
|
|||||||
"fieldname": "bank_party_account_number",
|
"fieldname": "bank_party_account_number",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"label": "Party Account No. (Bank Statement)"
|
"label": "Party Account No. (Bank Statement)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_oufv",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-06-06 13:58:12.821411",
|
"modified": "2023-11-18 18:32:47.203694",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Bank Transaction",
|
"name": "Bank Transaction",
|
||||||
|
|||||||
@@ -2,78 +2,117 @@
|
|||||||
# For license information, please see license.txt
|
# For license information, please see license.txt
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
|
from frappe import _
|
||||||
|
from frappe.model.document import Document
|
||||||
from frappe.utils import flt
|
from frappe.utils import flt
|
||||||
|
|
||||||
from erpnext.controllers.status_updater import StatusUpdater
|
|
||||||
|
|
||||||
|
class BankTransaction(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
class BankTransaction(StatusUpdater):
|
from typing import TYPE_CHECKING
|
||||||
def after_insert(self):
|
|
||||||
self.unallocated_amount = abs(flt(self.withdrawal) - flt(self.deposit))
|
|
||||||
|
|
||||||
def on_submit(self):
|
if TYPE_CHECKING:
|
||||||
self.clear_linked_payment_entries()
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.bank_transaction_payments.bank_transaction_payments import (
|
||||||
|
BankTransactionPayments,
|
||||||
|
)
|
||||||
|
|
||||||
|
allocated_amount: DF.Currency
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
bank_account: DF.Link | None
|
||||||
|
bank_party_account_number: DF.Data | None
|
||||||
|
bank_party_iban: DF.Data | None
|
||||||
|
bank_party_name: DF.Data | None
|
||||||
|
company: DF.Link | None
|
||||||
|
currency: DF.Link | None
|
||||||
|
date: DF.Date | None
|
||||||
|
deposit: DF.Currency
|
||||||
|
description: DF.SmallText | None
|
||||||
|
naming_series: DF.Literal["ACC-BTN-.YYYY.-"]
|
||||||
|
party: DF.DynamicLink | None
|
||||||
|
party_type: DF.Link | None
|
||||||
|
payment_entries: DF.Table[BankTransactionPayments]
|
||||||
|
reference_number: DF.Data | None
|
||||||
|
status: DF.Literal["", "Pending", "Settled", "Unreconciled", "Reconciled", "Cancelled"]
|
||||||
|
transaction_id: DF.Data | None
|
||||||
|
transaction_type: DF.Data | None
|
||||||
|
unallocated_amount: DF.Currency
|
||||||
|
withdrawal: DF.Currency
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
|
def before_validate(self):
|
||||||
|
self.update_allocated_amount()
|
||||||
|
|
||||||
|
def validate(self):
|
||||||
|
self.validate_duplicate_references()
|
||||||
|
|
||||||
|
def set_status(self):
|
||||||
|
if self.docstatus == 2:
|
||||||
|
self.db_set("status", "Cancelled")
|
||||||
|
elif self.docstatus == 1:
|
||||||
|
if self.unallocated_amount > 0:
|
||||||
|
self.db_set("status", "Unreconciled")
|
||||||
|
elif self.unallocated_amount <= 0:
|
||||||
|
self.db_set("status", "Reconciled")
|
||||||
|
|
||||||
|
def validate_duplicate_references(self):
|
||||||
|
"""Make sure the same voucher is not allocated twice within the same Bank Transaction"""
|
||||||
|
if not self.payment_entries:
|
||||||
|
return
|
||||||
|
|
||||||
|
pe = []
|
||||||
|
for row in self.payment_entries:
|
||||||
|
reference = (row.payment_document, row.payment_entry)
|
||||||
|
if reference in pe:
|
||||||
|
frappe.throw(
|
||||||
|
_("{0} {1} is allocated twice in this Bank Transaction").format(
|
||||||
|
row.payment_document, row.payment_entry
|
||||||
|
)
|
||||||
|
)
|
||||||
|
pe.append(reference)
|
||||||
|
|
||||||
|
def update_allocated_amount(self):
|
||||||
|
self.allocated_amount = (
|
||||||
|
sum(p.allocated_amount for p in self.payment_entries) if self.payment_entries else 0.0
|
||||||
|
)
|
||||||
|
self.unallocated_amount = abs(flt(self.withdrawal) - flt(self.deposit)) - self.allocated_amount
|
||||||
|
|
||||||
|
def before_submit(self):
|
||||||
|
self.allocate_payment_entries()
|
||||||
self.set_status()
|
self.set_status()
|
||||||
|
|
||||||
if frappe.db.get_single_value("Accounts Settings", "enable_party_matching"):
|
if frappe.db.get_single_value("Accounts Settings", "enable_party_matching"):
|
||||||
self.auto_set_party()
|
self.auto_set_party()
|
||||||
|
|
||||||
_saving_flag = False
|
def before_update_after_submit(self):
|
||||||
|
self.validate_duplicate_references()
|
||||||
# nosemgrep: frappe-semgrep-rules.rules.frappe-modifying-but-not-comitting
|
self.allocate_payment_entries()
|
||||||
def on_update_after_submit(self):
|
self.update_allocated_amount()
|
||||||
"Run on save(). Avoid recursion caused by multiple saves"
|
self.set_status()
|
||||||
if not self._saving_flag:
|
|
||||||
self._saving_flag = True
|
|
||||||
self.clear_linked_payment_entries()
|
|
||||||
self.update_allocations()
|
|
||||||
self._saving_flag = False
|
|
||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
self.clear_linked_payment_entries(for_cancel=True)
|
for payment_entry in self.payment_entries:
|
||||||
self.set_status(update=True)
|
self.clear_linked_payment_entry(payment_entry, for_cancel=True)
|
||||||
|
|
||||||
def update_allocations(self):
|
self.set_status()
|
||||||
"The doctype does not allow modifications after submission, so write to the db direct"
|
|
||||||
if self.payment_entries:
|
|
||||||
allocated_amount = sum(p.allocated_amount for p in self.payment_entries)
|
|
||||||
else:
|
|
||||||
allocated_amount = 0.0
|
|
||||||
|
|
||||||
amount = abs(flt(self.withdrawal) - flt(self.deposit))
|
|
||||||
self.db_set("allocated_amount", flt(allocated_amount))
|
|
||||||
self.db_set("unallocated_amount", amount - flt(allocated_amount))
|
|
||||||
self.reload()
|
|
||||||
self.set_status(update=True)
|
|
||||||
|
|
||||||
def add_payment_entries(self, vouchers):
|
def add_payment_entries(self, vouchers):
|
||||||
"Add the vouchers with zero allocation. Save() will perform the allocations and clearance"
|
"Add the vouchers with zero allocation. Save() will perform the allocations and clearance"
|
||||||
if 0.0 >= self.unallocated_amount:
|
if 0.0 >= self.unallocated_amount:
|
||||||
frappe.throw(frappe._("Bank Transaction {0} is already fully reconciled").format(self.name))
|
frappe.throw(_("Bank Transaction {0} is already fully reconciled").format(self.name))
|
||||||
|
|
||||||
added = False
|
|
||||||
for voucher in vouchers:
|
for voucher in vouchers:
|
||||||
# Can't add same voucher twice
|
self.append(
|
||||||
found = False
|
"payment_entries",
|
||||||
for pe in self.payment_entries:
|
{
|
||||||
if (
|
|
||||||
pe.payment_document == voucher["payment_doctype"]
|
|
||||||
and pe.payment_entry == voucher["payment_name"]
|
|
||||||
):
|
|
||||||
found = True
|
|
||||||
|
|
||||||
if not found:
|
|
||||||
pe = {
|
|
||||||
"payment_document": voucher["payment_doctype"],
|
"payment_document": voucher["payment_doctype"],
|
||||||
"payment_entry": voucher["payment_name"],
|
"payment_entry": voucher["payment_name"],
|
||||||
"allocated_amount": 0.0, # Temporary
|
"allocated_amount": 0.0, # Temporary
|
||||||
}
|
},
|
||||||
child = self.append("payment_entries", pe)
|
)
|
||||||
added = True
|
|
||||||
|
|
||||||
# runs on_update_after_submit
|
|
||||||
if added:
|
|
||||||
self.save()
|
|
||||||
|
|
||||||
def allocate_payment_entries(self):
|
def allocate_payment_entries(self):
|
||||||
"""Refactored from bank reconciliation tool.
|
"""Refactored from bank reconciliation tool.
|
||||||
@@ -89,8 +128,8 @@ class BankTransaction(StatusUpdater):
|
|||||||
- 0 > a: Error: already over-allocated
|
- 0 > a: Error: already over-allocated
|
||||||
- clear means: set the latest transaction date as clearance date
|
- clear means: set the latest transaction date as clearance date
|
||||||
"""
|
"""
|
||||||
gl_bank_account = frappe.db.get_value("Bank Account", self.bank_account, "account")
|
|
||||||
remaining_amount = self.unallocated_amount
|
remaining_amount = self.unallocated_amount
|
||||||
|
to_remove = []
|
||||||
for payment_entry in self.payment_entries:
|
for payment_entry in self.payment_entries:
|
||||||
if payment_entry.allocated_amount == 0.0:
|
if payment_entry.allocated_amount == 0.0:
|
||||||
unallocated_amount, should_clear, latest_transaction = get_clearance_details(
|
unallocated_amount, should_clear, latest_transaction = get_clearance_details(
|
||||||
@@ -100,49 +139,39 @@ class BankTransaction(StatusUpdater):
|
|||||||
if 0.0 == unallocated_amount:
|
if 0.0 == unallocated_amount:
|
||||||
if should_clear:
|
if should_clear:
|
||||||
latest_transaction.clear_linked_payment_entry(payment_entry)
|
latest_transaction.clear_linked_payment_entry(payment_entry)
|
||||||
self.db_delete_payment_entry(payment_entry)
|
to_remove.append(payment_entry)
|
||||||
|
|
||||||
elif remaining_amount <= 0.0:
|
elif remaining_amount <= 0.0:
|
||||||
self.db_delete_payment_entry(payment_entry)
|
to_remove.append(payment_entry)
|
||||||
|
|
||||||
elif 0.0 < unallocated_amount and unallocated_amount <= remaining_amount:
|
elif 0.0 < unallocated_amount <= remaining_amount:
|
||||||
payment_entry.db_set("allocated_amount", unallocated_amount)
|
payment_entry.allocated_amount = unallocated_amount
|
||||||
remaining_amount -= unallocated_amount
|
remaining_amount -= unallocated_amount
|
||||||
if should_clear:
|
if should_clear:
|
||||||
latest_transaction.clear_linked_payment_entry(payment_entry)
|
latest_transaction.clear_linked_payment_entry(payment_entry)
|
||||||
|
|
||||||
elif 0.0 < unallocated_amount and unallocated_amount > remaining_amount:
|
elif 0.0 < unallocated_amount:
|
||||||
payment_entry.db_set("allocated_amount", remaining_amount)
|
payment_entry.allocated_amount = remaining_amount
|
||||||
remaining_amount = 0.0
|
remaining_amount = 0.0
|
||||||
|
|
||||||
elif 0.0 > unallocated_amount:
|
elif 0.0 > unallocated_amount:
|
||||||
self.db_delete_payment_entry(payment_entry)
|
frappe.throw(_("Voucher {0} is over-allocated by {1}").format(unallocated_amount))
|
||||||
frappe.throw(frappe._("Voucher {0} is over-allocated by {1}").format(unallocated_amount))
|
|
||||||
|
|
||||||
self.reload()
|
for payment_entry in to_remove:
|
||||||
|
self.remove(to_remove)
|
||||||
def db_delete_payment_entry(self, payment_entry):
|
|
||||||
frappe.db.delete("Bank Transaction Payments", {"name": payment_entry.name})
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def remove_payment_entries(self):
|
def remove_payment_entries(self):
|
||||||
for payment_entry in self.payment_entries:
|
for payment_entry in self.payment_entries:
|
||||||
self.remove_payment_entry(payment_entry)
|
self.remove_payment_entry(payment_entry)
|
||||||
# runs on_update_after_submit
|
|
||||||
self.save()
|
self.save() # runs before_update_after_submit
|
||||||
|
|
||||||
def remove_payment_entry(self, payment_entry):
|
def remove_payment_entry(self, payment_entry):
|
||||||
"Clear payment entry and clearance"
|
"Clear payment entry and clearance"
|
||||||
self.clear_linked_payment_entry(payment_entry, for_cancel=True)
|
self.clear_linked_payment_entry(payment_entry, for_cancel=True)
|
||||||
self.remove(payment_entry)
|
self.remove(payment_entry)
|
||||||
|
|
||||||
def clear_linked_payment_entries(self, for_cancel=False):
|
|
||||||
if for_cancel:
|
|
||||||
for payment_entry in self.payment_entries:
|
|
||||||
self.clear_linked_payment_entry(payment_entry, for_cancel)
|
|
||||||
else:
|
|
||||||
self.allocate_payment_entries()
|
|
||||||
|
|
||||||
def clear_linked_payment_entry(self, payment_entry, for_cancel=False):
|
def clear_linked_payment_entry(self, payment_entry, for_cancel=False):
|
||||||
clearance_date = None if for_cancel else self.date
|
clearance_date = None if for_cancel else self.date
|
||||||
set_voucher_clearance(
|
set_voucher_clearance(
|
||||||
@@ -163,11 +192,10 @@ class BankTransaction(StatusUpdater):
|
|||||||
deposit=self.deposit,
|
deposit=self.deposit,
|
||||||
).match()
|
).match()
|
||||||
|
|
||||||
if result:
|
if not result:
|
||||||
party_type, party = result
|
return
|
||||||
frappe.db.set_value(
|
|
||||||
"Bank Transaction", self.name, field={"party_type": party_type, "party": party}
|
self.party_type, self.party = result
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
@@ -199,9 +227,7 @@ def get_clearance_details(transaction, payment_entry):
|
|||||||
if gle["gl_account"] == gl_bank_account:
|
if gle["gl_account"] == gl_bank_account:
|
||||||
if gle["amount"] <= 0.0:
|
if gle["amount"] <= 0.0:
|
||||||
frappe.throw(
|
frappe.throw(
|
||||||
frappe._("Voucher {0} value is broken: {1}").format(
|
_("Voucher {0} value is broken: {1}").format(payment_entry.payment_entry, gle["amount"])
|
||||||
payment_entry.payment_entry, gle["amount"]
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
unmatched_gles -= 1
|
unmatched_gles -= 1
|
||||||
@@ -222,7 +248,7 @@ def get_clearance_details(transaction, payment_entry):
|
|||||||
|
|
||||||
def get_related_bank_gl_entries(doctype, docname):
|
def get_related_bank_gl_entries(doctype, docname):
|
||||||
# nosemgrep: frappe-semgrep-rules.rules.frappe-using-db-sql
|
# nosemgrep: frappe-semgrep-rules.rules.frappe-using-db-sql
|
||||||
result = frappe.db.sql(
|
return frappe.db.sql(
|
||||||
"""
|
"""
|
||||||
SELECT
|
SELECT
|
||||||
ABS(gle.credit_in_account_currency - gle.debit_in_account_currency) AS amount,
|
ABS(gle.credit_in_account_currency - gle.debit_in_account_currency) AS amount,
|
||||||
@@ -240,7 +266,6 @@ def get_related_bank_gl_entries(doctype, docname):
|
|||||||
dict(doctype=doctype, docname=docname),
|
dict(doctype=doctype, docname=docname),
|
||||||
as_dict=True,
|
as_dict=True,
|
||||||
)
|
)
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
def get_total_allocated_amount(doctype, docname):
|
def get_total_allocated_amount(doctype, docname):
|
||||||
@@ -350,15 +375,17 @@ def set_voucher_clearance(doctype, docname, clearance_date, self):
|
|||||||
and len(get_reconciled_bank_transactions(doctype, docname)) < 2
|
and len(get_reconciled_bank_transactions(doctype, docname)) < 2
|
||||||
):
|
):
|
||||||
return
|
return
|
||||||
frappe.db.set_value(doctype, docname, "clearance_date", clearance_date)
|
|
||||||
|
|
||||||
elif doctype == "Sales Invoice":
|
if doctype == "Sales Invoice":
|
||||||
frappe.db.set_value(
|
frappe.db.set_value(
|
||||||
"Sales Invoice Payment",
|
"Sales Invoice Payment",
|
||||||
dict(parenttype=doctype, parent=docname),
|
dict(parenttype=doctype, parent=docname),
|
||||||
"clearance_date",
|
"clearance_date",
|
||||||
clearance_date,
|
clearance_date,
|
||||||
)
|
)
|
||||||
|
return
|
||||||
|
|
||||||
|
frappe.db.set_value(doctype, docname, "clearance_date", clearance_date)
|
||||||
|
|
||||||
elif doctype == "Bank Transaction":
|
elif doctype == "Bank Transaction":
|
||||||
# For when a second bank transaction has fixed another, e.g. refund
|
# For when a second bank transaction has fixed another, e.g. refund
|
||||||
@@ -366,6 +393,7 @@ def set_voucher_clearance(doctype, docname, clearance_date, self):
|
|||||||
if clearance_date:
|
if clearance_date:
|
||||||
vouchers = [{"payment_doctype": "Bank Transaction", "payment_name": self.name}]
|
vouchers = [{"payment_doctype": "Bank Transaction", "payment_name": self.name}]
|
||||||
bt.add_payment_entries(vouchers)
|
bt.add_payment_entries(vouchers)
|
||||||
|
bt.save()
|
||||||
else:
|
else:
|
||||||
for pe in bt.payment_entries:
|
for pe in bt.payment_entries:
|
||||||
if pe.payment_document == self.doctype and pe.payment_entry == self.name:
|
if pe.payment_document == self.doctype and pe.payment_entry == self.name:
|
||||||
|
|||||||
@@ -6,4 +6,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class BankTransactionMapping(Document):
|
class BankTransactionMapping(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
bank_transaction_field: DF.Literal
|
||||||
|
file_field: DF.Data
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,21 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class BankTransactionPayments(Document):
|
class BankTransactionPayments(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
allocated_amount: DF.Currency
|
||||||
|
clearance_date: DF.Date | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
payment_document: DF.Link
|
||||||
|
payment_entry: DF.DynamicLink
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -0,0 +1,100 @@
|
|||||||
|
// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
|
||||||
|
frappe.ui.form.on("Bisect Accounting Statements", {
|
||||||
|
onload(frm) {
|
||||||
|
frm.trigger("render_heatmap");
|
||||||
|
},
|
||||||
|
refresh(frm) {
|
||||||
|
frm.add_custom_button(__('Bisect Left'), () => {
|
||||||
|
frm.trigger("bisect_left");
|
||||||
|
});
|
||||||
|
|
||||||
|
frm.add_custom_button(__('Bisect Right'), () => {
|
||||||
|
frm.trigger("bisect_right");
|
||||||
|
});
|
||||||
|
|
||||||
|
frm.add_custom_button(__('Up'), () => {
|
||||||
|
frm.trigger("move_up");
|
||||||
|
});
|
||||||
|
frm.add_custom_button(__('Build Tree'), () => {
|
||||||
|
frm.trigger("build_tree");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
render_heatmap(frm) {
|
||||||
|
let bisect_heatmap = frm.get_field("bisect_heatmap").$wrapper;
|
||||||
|
bisect_heatmap.addClass("bisect_heatmap_location");
|
||||||
|
|
||||||
|
// milliseconds in a day
|
||||||
|
let msiad=24*60*60*1000;
|
||||||
|
let datapoints = {};
|
||||||
|
let fr_dt = new Date(frm.doc.from_date).getTime();
|
||||||
|
let to_dt = new Date(frm.doc.to_date).getTime();
|
||||||
|
let bisect_start = new Date(frm.doc.current_from_date).getTime();
|
||||||
|
let bisect_end = new Date(frm.doc.current_to_date).getTime();
|
||||||
|
|
||||||
|
for(let x=fr_dt; x <= to_dt; x+=msiad){
|
||||||
|
let epoch_in_seconds = x/1000;
|
||||||
|
if ((bisect_start <= x) && (x <= bisect_end )) {
|
||||||
|
datapoints[epoch_in_seconds] = 1.0;
|
||||||
|
} else {
|
||||||
|
datapoints[epoch_in_seconds] = 0.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
new frappe.Chart(".bisect_heatmap_location", {
|
||||||
|
type: "heatmap",
|
||||||
|
data: {
|
||||||
|
dataPoints: datapoints,
|
||||||
|
start: new Date(frm.doc.from_date),
|
||||||
|
end: new Date(frm.doc.to_date),
|
||||||
|
},
|
||||||
|
countLabel: 'Bisecting',
|
||||||
|
discreteDomains: 1,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
bisect_left(frm) {
|
||||||
|
frm.call({
|
||||||
|
doc: frm.doc,
|
||||||
|
method: 'bisect_left',
|
||||||
|
freeze: true,
|
||||||
|
freeze_message: __("Bisecting Left ..."),
|
||||||
|
callback: (r) => {
|
||||||
|
frm.trigger("render_heatmap");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
bisect_right(frm) {
|
||||||
|
frm.call({
|
||||||
|
doc: frm.doc,
|
||||||
|
freeze: true,
|
||||||
|
freeze_message: __("Bisecting Right ..."),
|
||||||
|
method: 'bisect_right',
|
||||||
|
callback: (r) => {
|
||||||
|
frm.trigger("render_heatmap");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
move_up(frm) {
|
||||||
|
frm.call({
|
||||||
|
doc: frm.doc,
|
||||||
|
freeze: true,
|
||||||
|
freeze_message: __("Moving up in tree ..."),
|
||||||
|
method: 'move_up',
|
||||||
|
callback: (r) => {
|
||||||
|
frm.trigger("render_heatmap");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
build_tree(frm) {
|
||||||
|
frm.call({
|
||||||
|
doc: frm.doc,
|
||||||
|
freeze: true,
|
||||||
|
freeze_message: __("Rebuilding BTree for period ..."),
|
||||||
|
method: 'build_tree',
|
||||||
|
callback: (r) => {
|
||||||
|
frm.trigger("render_heatmap");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,194 @@
|
|||||||
|
{
|
||||||
|
"actions": [],
|
||||||
|
"allow_rename": 1,
|
||||||
|
"creation": "2023-09-15 21:28:28.054773",
|
||||||
|
"default_view": "List",
|
||||||
|
"doctype": "DocType",
|
||||||
|
"editable_grid": 1,
|
||||||
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"section_break_cvfg",
|
||||||
|
"company",
|
||||||
|
"column_break_hcam",
|
||||||
|
"from_date",
|
||||||
|
"column_break_qxbi",
|
||||||
|
"to_date",
|
||||||
|
"column_break_iwny",
|
||||||
|
"algorithm",
|
||||||
|
"section_break_8ph9",
|
||||||
|
"current_node",
|
||||||
|
"section_break_ngid",
|
||||||
|
"bisect_heatmap",
|
||||||
|
"section_break_hmsy",
|
||||||
|
"bisecting_from",
|
||||||
|
"current_from_date",
|
||||||
|
"column_break_uqyd",
|
||||||
|
"bisecting_to",
|
||||||
|
"current_to_date",
|
||||||
|
"section_break_hbyo",
|
||||||
|
"heading_cppb",
|
||||||
|
"p_l_summary",
|
||||||
|
"column_break_aivo",
|
||||||
|
"balance_sheet_summary",
|
||||||
|
"b_s_summary",
|
||||||
|
"column_break_gvwx",
|
||||||
|
"difference_heading",
|
||||||
|
"difference"
|
||||||
|
],
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_qxbi",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "from_date",
|
||||||
|
"fieldtype": "Datetime",
|
||||||
|
"label": "From Date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "to_date",
|
||||||
|
"fieldtype": "Datetime",
|
||||||
|
"label": "To Date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "BFS",
|
||||||
|
"fieldname": "algorithm",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"label": "Algorithm",
|
||||||
|
"options": "BFS\nDFS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_iwny",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "current_node",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Current Node",
|
||||||
|
"options": "Bisect Nodes"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "section_break_hmsy",
|
||||||
|
"fieldtype": "Section Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "current_from_date",
|
||||||
|
"fieldtype": "Datetime",
|
||||||
|
"read_only": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "current_to_date",
|
||||||
|
"fieldtype": "Datetime",
|
||||||
|
"read_only": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_uqyd",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "section_break_hbyo",
|
||||||
|
"fieldtype": "Section Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "p_l_summary",
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"read_only": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "b_s_summary",
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"read_only": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "difference",
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"read_only": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_aivo",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_gvwx",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "company",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Company",
|
||||||
|
"options": "Company"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_hcam",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "section_break_ngid",
|
||||||
|
"fieldtype": "Section Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "section_break_8ph9",
|
||||||
|
"fieldtype": "Section Break",
|
||||||
|
"hidden": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "bisect_heatmap",
|
||||||
|
"fieldtype": "HTML",
|
||||||
|
"label": "Heatmap"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "heading_cppb",
|
||||||
|
"fieldtype": "Heading",
|
||||||
|
"label": "Profit and Loss Summary"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "balance_sheet_summary",
|
||||||
|
"fieldtype": "Heading",
|
||||||
|
"label": "Balance Sheet Summary"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "difference_heading",
|
||||||
|
"fieldtype": "Heading",
|
||||||
|
"label": "Difference"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "bisecting_from",
|
||||||
|
"fieldtype": "Heading",
|
||||||
|
"label": "Bisecting From"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "bisecting_to",
|
||||||
|
"fieldtype": "Heading",
|
||||||
|
"label": "Bisecting To"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "section_break_cvfg",
|
||||||
|
"fieldtype": "Section Break"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"hide_toolbar": 1,
|
||||||
|
"index_web_pages_for_search": 1,
|
||||||
|
"issingle": 1,
|
||||||
|
"links": [],
|
||||||
|
"modified": "2023-12-01 16:49:54.073890",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "Accounts",
|
||||||
|
"name": "Bisect Accounting Statements",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"permissions": [
|
||||||
|
{
|
||||||
|
"create": 1,
|
||||||
|
"delete": 1,
|
||||||
|
"email": 1,
|
||||||
|
"print": 1,
|
||||||
|
"read": 1,
|
||||||
|
"role": "Administrator",
|
||||||
|
"share": 1,
|
||||||
|
"write": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"read_only": 1,
|
||||||
|
"sort_field": "modified",
|
||||||
|
"sort_order": "DESC",
|
||||||
|
"states": []
|
||||||
|
}
|
||||||
@@ -0,0 +1,226 @@
|
|||||||
|
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
import datetime
|
||||||
|
from collections import deque
|
||||||
|
from math import floor
|
||||||
|
|
||||||
|
import frappe
|
||||||
|
from dateutil.relativedelta import relativedelta
|
||||||
|
from frappe import _
|
||||||
|
from frappe.model.document import Document
|
||||||
|
from frappe.utils import getdate
|
||||||
|
from frappe.utils.data import guess_date_format
|
||||||
|
|
||||||
|
|
||||||
|
class BisectAccountingStatements(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
algorithm: DF.Literal["BFS", "DFS"]
|
||||||
|
b_s_summary: DF.Float
|
||||||
|
company: DF.Link | None
|
||||||
|
current_from_date: DF.Datetime | None
|
||||||
|
current_node: DF.Link | None
|
||||||
|
current_to_date: DF.Datetime | None
|
||||||
|
difference: DF.Float
|
||||||
|
from_date: DF.Datetime | None
|
||||||
|
p_l_summary: DF.Float
|
||||||
|
to_date: DF.Datetime | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
|
def validate(self):
|
||||||
|
self.validate_dates()
|
||||||
|
|
||||||
|
def validate_dates(self):
|
||||||
|
if getdate(self.from_date) > getdate(self.to_date):
|
||||||
|
frappe.throw(
|
||||||
|
_("From Date: {0} cannot be greater than To date: {1}").format(
|
||||||
|
frappe.bold(self.from_date), frappe.bold(self.to_date)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
def bfs(self, from_date: datetime, to_date: datetime):
|
||||||
|
# Make Root node
|
||||||
|
node = frappe.new_doc("Bisect Nodes")
|
||||||
|
node.root = None
|
||||||
|
node.period_from_date = from_date
|
||||||
|
node.period_to_date = to_date
|
||||||
|
node.insert()
|
||||||
|
|
||||||
|
period_queue = deque([node])
|
||||||
|
while period_queue:
|
||||||
|
cur_node = period_queue.popleft()
|
||||||
|
delta = cur_node.period_to_date - cur_node.period_from_date
|
||||||
|
if delta.days == 0:
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
cur_floor = floor(delta.days / 2)
|
||||||
|
next_to_date = cur_node.period_from_date + relativedelta(days=+cur_floor)
|
||||||
|
left_node = frappe.new_doc("Bisect Nodes")
|
||||||
|
left_node.period_from_date = cur_node.period_from_date
|
||||||
|
left_node.period_to_date = next_to_date
|
||||||
|
left_node.root = cur_node.name
|
||||||
|
left_node.generated = False
|
||||||
|
left_node.insert()
|
||||||
|
cur_node.left_child = left_node.name
|
||||||
|
period_queue.append(left_node)
|
||||||
|
|
||||||
|
next_from_date = cur_node.period_from_date + relativedelta(days=+(cur_floor + 1))
|
||||||
|
right_node = frappe.new_doc("Bisect Nodes")
|
||||||
|
right_node.period_from_date = next_from_date
|
||||||
|
right_node.period_to_date = cur_node.period_to_date
|
||||||
|
right_node.root = cur_node.name
|
||||||
|
right_node.generated = False
|
||||||
|
right_node.insert()
|
||||||
|
cur_node.right_child = right_node.name
|
||||||
|
period_queue.append(right_node)
|
||||||
|
|
||||||
|
cur_node.save()
|
||||||
|
|
||||||
|
def dfs(self, from_date: datetime, to_date: datetime):
|
||||||
|
# Make Root node
|
||||||
|
node = frappe.new_doc("Bisect Nodes")
|
||||||
|
node.root = None
|
||||||
|
node.period_from_date = from_date
|
||||||
|
node.period_to_date = to_date
|
||||||
|
node.insert()
|
||||||
|
|
||||||
|
period_stack = [node]
|
||||||
|
while period_stack:
|
||||||
|
cur_node = period_stack.pop()
|
||||||
|
delta = cur_node.period_to_date - cur_node.period_from_date
|
||||||
|
if delta.days == 0:
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
cur_floor = floor(delta.days / 2)
|
||||||
|
next_to_date = cur_node.period_from_date + relativedelta(days=+cur_floor)
|
||||||
|
left_node = frappe.new_doc("Bisect Nodes")
|
||||||
|
left_node.period_from_date = cur_node.period_from_date
|
||||||
|
left_node.period_to_date = next_to_date
|
||||||
|
left_node.root = cur_node.name
|
||||||
|
left_node.generated = False
|
||||||
|
left_node.insert()
|
||||||
|
cur_node.left_child = left_node.name
|
||||||
|
period_stack.append(left_node)
|
||||||
|
|
||||||
|
next_from_date = cur_node.period_from_date + relativedelta(days=+(cur_floor + 1))
|
||||||
|
right_node = frappe.new_doc("Bisect Nodes")
|
||||||
|
right_node.period_from_date = next_from_date
|
||||||
|
right_node.period_to_date = cur_node.period_to_date
|
||||||
|
right_node.root = cur_node.name
|
||||||
|
right_node.generated = False
|
||||||
|
right_node.insert()
|
||||||
|
cur_node.right_child = right_node.name
|
||||||
|
period_stack.append(right_node)
|
||||||
|
|
||||||
|
cur_node.save()
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def build_tree(self):
|
||||||
|
frappe.db.delete("Bisect Nodes")
|
||||||
|
|
||||||
|
# Convert str to datetime format
|
||||||
|
dt_format = guess_date_format(self.from_date)
|
||||||
|
from_date = datetime.datetime.strptime(self.from_date, dt_format)
|
||||||
|
to_date = datetime.datetime.strptime(self.to_date, dt_format)
|
||||||
|
|
||||||
|
if self.algorithm == "BFS":
|
||||||
|
self.bfs(from_date, to_date)
|
||||||
|
|
||||||
|
if self.algorithm == "DFS":
|
||||||
|
self.dfs(from_date, to_date)
|
||||||
|
|
||||||
|
# set root as current node
|
||||||
|
root = frappe.db.get_all("Bisect Nodes", filters={"root": ["is", "not set"]})[0]
|
||||||
|
self.get_report_summary()
|
||||||
|
self.current_node = root.name
|
||||||
|
self.current_from_date = self.from_date
|
||||||
|
self.current_to_date = self.to_date
|
||||||
|
self.save()
|
||||||
|
|
||||||
|
def get_report_summary(self):
|
||||||
|
filters = {
|
||||||
|
"company": self.company,
|
||||||
|
"filter_based_on": "Date Range",
|
||||||
|
"period_start_date": self.current_from_date,
|
||||||
|
"period_end_date": self.current_to_date,
|
||||||
|
"periodicity": "Yearly",
|
||||||
|
}
|
||||||
|
pl_summary = frappe.get_doc("Report", "Profit and Loss Statement")
|
||||||
|
self.p_l_summary = pl_summary.execute_script_report(filters=filters)[5]
|
||||||
|
bs_summary = frappe.get_doc("Report", "Balance Sheet")
|
||||||
|
self.b_s_summary = bs_summary.execute_script_report(filters=filters)[5]
|
||||||
|
self.difference = abs(self.p_l_summary - self.b_s_summary)
|
||||||
|
|
||||||
|
def update_node(self):
|
||||||
|
current_node = frappe.get_doc("Bisect Nodes", self.current_node)
|
||||||
|
current_node.balance_sheet_summary = self.b_s_summary
|
||||||
|
current_node.profit_loss_summary = self.p_l_summary
|
||||||
|
current_node.difference = self.difference
|
||||||
|
current_node.generated = True
|
||||||
|
current_node.save()
|
||||||
|
|
||||||
|
def current_node_has_summary_info(self):
|
||||||
|
"Assertion method"
|
||||||
|
return frappe.db.get_value("Bisect Nodes", self.current_node, "generated")
|
||||||
|
|
||||||
|
def fetch_summary_info_from_current_node(self):
|
||||||
|
current_node = frappe.get_doc("Bisect Nodes", self.current_node)
|
||||||
|
self.p_l_summary = current_node.balance_sheet_summary
|
||||||
|
self.b_s_summary = current_node.profit_loss_summary
|
||||||
|
self.difference = abs(self.p_l_summary - self.b_s_summary)
|
||||||
|
|
||||||
|
def fetch_or_calculate(self):
|
||||||
|
if self.current_node_has_summary_info():
|
||||||
|
self.fetch_summary_info_from_current_node()
|
||||||
|
else:
|
||||||
|
self.get_report_summary()
|
||||||
|
self.update_node()
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def bisect_left(self):
|
||||||
|
if self.current_node is not None:
|
||||||
|
cur_node = frappe.get_doc("Bisect Nodes", self.current_node)
|
||||||
|
if cur_node.left_child is not None:
|
||||||
|
lft_node = frappe.get_doc("Bisect Nodes", cur_node.left_child)
|
||||||
|
self.current_node = cur_node.left_child
|
||||||
|
self.current_from_date = lft_node.period_from_date
|
||||||
|
self.current_to_date = lft_node.period_to_date
|
||||||
|
self.fetch_or_calculate()
|
||||||
|
self.save()
|
||||||
|
else:
|
||||||
|
frappe.msgprint(_("No more children on Left"))
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def bisect_right(self):
|
||||||
|
if self.current_node is not None:
|
||||||
|
cur_node = frappe.get_doc("Bisect Nodes", self.current_node)
|
||||||
|
if cur_node.right_child is not None:
|
||||||
|
rgt_node = frappe.get_doc("Bisect Nodes", cur_node.right_child)
|
||||||
|
self.current_node = cur_node.right_child
|
||||||
|
self.current_from_date = rgt_node.period_from_date
|
||||||
|
self.current_to_date = rgt_node.period_to_date
|
||||||
|
self.fetch_or_calculate()
|
||||||
|
self.save()
|
||||||
|
else:
|
||||||
|
frappe.msgprint(_("No more children on Right"))
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def move_up(self):
|
||||||
|
if self.current_node is not None:
|
||||||
|
cur_node = frappe.get_doc("Bisect Nodes", self.current_node)
|
||||||
|
if cur_node.root is not None:
|
||||||
|
root = frappe.get_doc("Bisect Nodes", cur_node.root)
|
||||||
|
self.current_node = cur_node.root
|
||||||
|
self.current_from_date = root.period_from_date
|
||||||
|
self.current_to_date = root.period_to_date
|
||||||
|
self.fetch_or_calculate()
|
||||||
|
self.save()
|
||||||
|
else:
|
||||||
|
frappe.msgprint(_("Reached Root"))
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
|
# See license.txt
|
||||||
|
|
||||||
|
# import frappe
|
||||||
|
from frappe.tests.utils import FrappeTestCase
|
||||||
|
|
||||||
|
|
||||||
|
class TestBisectAccountingStatements(FrappeTestCase):
|
||||||
|
pass
|
||||||
8
erpnext/accounts/doctype/bisect_nodes/bisect_nodes.js
Normal file
8
erpnext/accounts/doctype/bisect_nodes/bisect_nodes.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
|
||||||
|
// frappe.ui.form.on("Bisect Nodes", {
|
||||||
|
// refresh(frm) {
|
||||||
|
|
||||||
|
// },
|
||||||
|
// });
|
||||||
97
erpnext/accounts/doctype/bisect_nodes/bisect_nodes.json
Normal file
97
erpnext/accounts/doctype/bisect_nodes/bisect_nodes.json
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
{
|
||||||
|
"actions": [],
|
||||||
|
"autoname": "autoincrement",
|
||||||
|
"creation": "2023-09-27 14:56:38.112462",
|
||||||
|
"default_view": "List",
|
||||||
|
"doctype": "DocType",
|
||||||
|
"editable_grid": 1,
|
||||||
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"root",
|
||||||
|
"left_child",
|
||||||
|
"right_child",
|
||||||
|
"period_from_date",
|
||||||
|
"period_to_date",
|
||||||
|
"difference",
|
||||||
|
"balance_sheet_summary",
|
||||||
|
"profit_loss_summary",
|
||||||
|
"generated"
|
||||||
|
],
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"fieldname": "root",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Root",
|
||||||
|
"options": "Bisect Nodes"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "left_child",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Left Child",
|
||||||
|
"options": "Bisect Nodes"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "right_child",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Right Child",
|
||||||
|
"options": "Bisect Nodes"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "period_from_date",
|
||||||
|
"fieldtype": "Datetime",
|
||||||
|
"label": "Period_from_date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "period_to_date",
|
||||||
|
"fieldtype": "Datetime",
|
||||||
|
"label": "Period To Date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "difference",
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"label": "Difference"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "balance_sheet_summary",
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"label": "Balance Sheet Summary"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "profit_loss_summary",
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"label": "Profit and Loss Summary"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"fieldname": "generated",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Generated"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"index_web_pages_for_search": 1,
|
||||||
|
"links": [],
|
||||||
|
"modified": "2023-12-01 17:46:12.437996",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "Accounts",
|
||||||
|
"name": "Bisect Nodes",
|
||||||
|
"naming_rule": "Autoincrement",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"permissions": [
|
||||||
|
{
|
||||||
|
"create": 1,
|
||||||
|
"delete": 1,
|
||||||
|
"email": 1,
|
||||||
|
"export": 1,
|
||||||
|
"print": 1,
|
||||||
|
"read": 1,
|
||||||
|
"report": 1,
|
||||||
|
"role": "Administrator",
|
||||||
|
"share": 1,
|
||||||
|
"write": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"read_only": 1,
|
||||||
|
"sort_field": "modified",
|
||||||
|
"sort_order": "DESC",
|
||||||
|
"states": []
|
||||||
|
}
|
||||||
29
erpnext/accounts/doctype/bisect_nodes/bisect_nodes.py
Normal file
29
erpnext/accounts/doctype/bisect_nodes/bisect_nodes.py
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
# import frappe
|
||||||
|
from frappe.model.document import Document
|
||||||
|
|
||||||
|
|
||||||
|
class BisectNodes(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
balance_sheet_summary: DF.Float
|
||||||
|
difference: DF.Float
|
||||||
|
generated: DF.Check
|
||||||
|
left_child: DF.Link | None
|
||||||
|
name: DF.Int | None
|
||||||
|
period_from_date: DF.Datetime | None
|
||||||
|
period_to_date: DF.Datetime | None
|
||||||
|
profit_loss_summary: DF.Float
|
||||||
|
right_child: DF.Link | None
|
||||||
|
root: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
|
pass
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
|
# See license.txt
|
||||||
|
|
||||||
|
# import frappe
|
||||||
|
from frappe.tests.utils import FrappeTestCase
|
||||||
|
|
||||||
|
|
||||||
|
class TestBisectNodes(FrappeTestCase):
|
||||||
|
pass
|
||||||
@@ -22,6 +22,36 @@ class DuplicateBudgetError(frappe.ValidationError):
|
|||||||
|
|
||||||
|
|
||||||
class Budget(Document):
|
class Budget(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.budget_account.budget_account import BudgetAccount
|
||||||
|
|
||||||
|
accounts: DF.Table[BudgetAccount]
|
||||||
|
action_if_accumulated_monthly_budget_exceeded: DF.Literal["", "Stop", "Warn", "Ignore"]
|
||||||
|
action_if_accumulated_monthly_budget_exceeded_on_mr: DF.Literal["", "Stop", "Warn", "Ignore"]
|
||||||
|
action_if_accumulated_monthly_budget_exceeded_on_po: DF.Literal["", "Stop", "Warn", "Ignore"]
|
||||||
|
action_if_annual_budget_exceeded: DF.Literal["", "Stop", "Warn", "Ignore"]
|
||||||
|
action_if_annual_budget_exceeded_on_mr: DF.Literal["", "Stop", "Warn", "Ignore"]
|
||||||
|
action_if_annual_budget_exceeded_on_po: DF.Literal["", "Stop", "Warn", "Ignore"]
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
applicable_on_booking_actual_expenses: DF.Check
|
||||||
|
applicable_on_material_request: DF.Check
|
||||||
|
applicable_on_purchase_order: DF.Check
|
||||||
|
budget_against: DF.Literal["", "Cost Center", "Project"]
|
||||||
|
company: DF.Link
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
fiscal_year: DF.Link
|
||||||
|
monthly_distribution: DF.Link | None
|
||||||
|
naming_series: DF.Data | None
|
||||||
|
project: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if not self.get(frappe.scrub(self.budget_against)):
|
if not self.get(frappe.scrub(self.budget_against)):
|
||||||
frappe.throw(_("{0} is mandatory").format(self.budget_against))
|
frappe.throw(_("{0} is mandatory").format(self.budget_against))
|
||||||
|
|||||||
@@ -6,4 +6,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class BudgetAccount(Document):
|
class BudgetAccount(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link
|
||||||
|
budget_amount: DF.Currency
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,18 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class CampaignItem(Document):
|
class CampaignItem(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
campaign: DF.Link | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -1,457 +1,152 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"actions": [],
|
||||||
"allow_events_in_timeline": 0,
|
|
||||||
"allow_guest_to_view": 0,
|
|
||||||
"allow_import": 0,
|
|
||||||
"allow_rename": 0,
|
|
||||||
"autoname": "naming_series:",
|
"autoname": "naming_series:",
|
||||||
"beta": 0,
|
|
||||||
"creation": "2018-06-18 16:51:49.994750",
|
"creation": "2018-06-18 16:51:49.994750",
|
||||||
"custom": 0,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "",
|
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"naming_series",
|
||||||
|
"user",
|
||||||
|
"date",
|
||||||
|
"from_time",
|
||||||
|
"time",
|
||||||
|
"expense",
|
||||||
|
"custody",
|
||||||
|
"returns",
|
||||||
|
"outstanding_amount",
|
||||||
|
"payments",
|
||||||
|
"net_amount",
|
||||||
|
"amended_from"
|
||||||
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"default": "POS-CLO-",
|
"default": "POS-CLO-",
|
||||||
"fieldname": "naming_series",
|
"fieldname": "naming_series",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 1,
|
"in_filter": 1,
|
||||||
"in_global_search": 1,
|
"in_global_search": 1,
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 1,
|
"in_standard_filter": 1,
|
||||||
"label": "Series",
|
"label": "Series",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "POS-CLO-",
|
"options": "POS-CLO-",
|
||||||
"permlevel": 0,
|
"read_only": 1
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "user",
|
"fieldname": "user",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 1,
|
"in_filter": 1,
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 1,
|
"in_standard_filter": 1,
|
||||||
"label": "User",
|
"label": "User",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "User",
|
"options": "User",
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"remember_last_selected_value": 0,
|
"reqd": 1
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"default": "Today",
|
"default": "Today",
|
||||||
"fieldname": "date",
|
"fieldname": "date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 1,
|
"in_filter": 1,
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 1,
|
"in_standard_filter": 1,
|
||||||
"label": "Date",
|
"label": "Date",
|
||||||
"length": 0,
|
"read_only": 1
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "from_time",
|
"fieldname": "from_time",
|
||||||
"fieldtype": "Time",
|
"fieldtype": "Time",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 1,
|
"in_filter": 1,
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 1,
|
"in_standard_filter": 1,
|
||||||
"label": "From Time",
|
"label": "From Time",
|
||||||
"length": 0,
|
"reqd": 1
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"default": "",
|
|
||||||
"fieldname": "time",
|
"fieldname": "time",
|
||||||
"fieldtype": "Time",
|
"fieldtype": "Time",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 1,
|
"in_filter": 1,
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 1,
|
"in_standard_filter": 1,
|
||||||
"label": "To Time",
|
"label": "To Time",
|
||||||
"length": 0,
|
"reqd": 1
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"default": "0.00",
|
"default": "0.00",
|
||||||
"fieldname": "expense",
|
"fieldname": "expense",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 1,
|
"in_filter": 1,
|
||||||
"in_global_search": 0,
|
"label": "Expense"
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Expense",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"default": "0.00",
|
"default": "0.00",
|
||||||
"fieldname": "custody",
|
"fieldname": "custody",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 1,
|
"in_filter": 1,
|
||||||
"in_global_search": 0,
|
"label": "Custody"
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Custody",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"default": "0.00",
|
"default": "0.00",
|
||||||
"fieldname": "returns",
|
"fieldname": "returns",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 1,
|
"in_filter": 1,
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Returns",
|
"label": "Returns",
|
||||||
"length": 0,
|
"precision": "2"
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "2",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"default": "0.00",
|
"default": "0.00",
|
||||||
"fieldname": "outstanding_amount",
|
"fieldname": "outstanding_amount",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Outstanding Amount",
|
"label": "Outstanding Amount",
|
||||||
"length": 0,
|
"read_only": 1
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"default": "0.0",
|
|
||||||
"fieldname": "payments",
|
"fieldname": "payments",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 1,
|
"in_filter": 1,
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Payments",
|
"label": "Payments",
|
||||||
"length": 0,
|
"options": "Cashier Closing Payments"
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Cashier Closing Payments",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "net_amount",
|
"fieldname": "net_amount",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 1,
|
"in_filter": 1,
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 1,
|
"in_standard_filter": 1,
|
||||||
"label": "Net Amount",
|
"label": "Net Amount",
|
||||||
"length": 0,
|
"read_only": 1
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "amended_from",
|
"fieldname": "amended_from",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Amended From",
|
"label": "Amended From",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"options": "Cashier Closing",
|
"options": "Cashier Closing",
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_hide_if_no_value": 0,
|
"read_only": 1
|
||||||
"read_only": 1,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
|
||||||
"hide_heading": 0,
|
|
||||||
"hide_toolbar": 0,
|
|
||||||
"idx": 0,
|
|
||||||
"image_view": 0,
|
|
||||||
"in_create": 0,
|
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"issingle": 0,
|
"links": [],
|
||||||
"istable": 0,
|
"modified": "2023-12-28 13:15:46.858427",
|
||||||
"max_attachments": 0,
|
|
||||||
"modified": "2019-02-19 08:35:24.157327",
|
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Cashier Closing",
|
"name": "Cashier Closing",
|
||||||
"name_case": "",
|
"naming_rule": "By \"Naming Series\" field",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
"amend": 0,
|
|
||||||
"cancel": 0,
|
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"delete": 1,
|
"delete": 1,
|
||||||
"email": 1,
|
"email": 1,
|
||||||
"export": 1,
|
"export": 1,
|
||||||
"if_owner": 0,
|
|
||||||
"import": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print": 1,
|
"print": 1,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 1,
|
"report": 1,
|
||||||
"role": "System Manager",
|
"role": "System Manager",
|
||||||
"set_user_permissions": 0,
|
|
||||||
"share": 1,
|
"share": 1,
|
||||||
"submit": 1,
|
"submit": 1,
|
||||||
"write": 1
|
"write": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"quick_entry": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"read_only_onload": 0,
|
|
||||||
"show_name_in_global_search": 0,
|
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"track_changes": 1,
|
"states": [],
|
||||||
"track_seen": 0,
|
"track_changes": 1
|
||||||
"track_views": 0
|
}
|
||||||
}
|
|
||||||
@@ -9,6 +9,32 @@ from frappe.utils import flt
|
|||||||
|
|
||||||
|
|
||||||
class CashierClosing(Document):
|
class CashierClosing(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.cashier_closing_payments.cashier_closing_payments import (
|
||||||
|
CashierClosingPayments,
|
||||||
|
)
|
||||||
|
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
custody: DF.Float
|
||||||
|
date: DF.Date | None
|
||||||
|
expense: DF.Float
|
||||||
|
from_time: DF.Time
|
||||||
|
naming_series: DF.Literal["POS-CLO-"]
|
||||||
|
net_amount: DF.Float
|
||||||
|
outstanding_amount: DF.Float
|
||||||
|
payments: DF.Table[CashierClosingPayments]
|
||||||
|
returns: DF.Float
|
||||||
|
time: DF.Time
|
||||||
|
user: DF.Link
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_time()
|
self.validate_time()
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class CashierClosingPayments(Document):
|
class CashierClosingPayments(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
amount: DF.Float
|
||||||
|
mode_of_payment: DF.Link
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -53,10 +53,18 @@ frappe.ui.form.on('Chart of Accounts Importer', {
|
|||||||
of Accounts. Please enter the account names and add more rows as per your requirement.`);
|
of Accounts. Please enter the account names and add more rows as per your requirement.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
label : "Company",
|
||||||
|
fieldname: "company",
|
||||||
|
fieldtype: "Link",
|
||||||
|
reqd: 1,
|
||||||
|
hidden: 1,
|
||||||
|
default: frm.doc.company,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
primary_action: function() {
|
primary_action: function() {
|
||||||
var data = d.get_values();
|
let data = d.get_values();
|
||||||
|
|
||||||
if (!data.template_type) {
|
if (!data.template_type) {
|
||||||
frappe.throw(__('Please select <b>Template Type</b> to download template'));
|
frappe.throw(__('Please select <b>Template Type</b> to download template'));
|
||||||
@@ -66,7 +74,8 @@ frappe.ui.form.on('Chart of Accounts Importer', {
|
|||||||
'/api/method/erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.download_template',
|
'/api/method/erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.download_template',
|
||||||
{
|
{
|
||||||
file_type: data.file_type,
|
file_type: data.file_type,
|
||||||
template_type: data.template_type
|
template_type: data.template_type,
|
||||||
|
company: data.company
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ from functools import reduce
|
|||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
|
from frappe.desk.form.linked_with import get_linked_fields
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from frappe.utils import cint, cstr
|
from frappe.utils import cint, cstr
|
||||||
from frappe.utils.csvutils import UnicodeWriter
|
from frappe.utils.csvutils import UnicodeWriter
|
||||||
@@ -23,6 +24,18 @@ from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import
|
|||||||
|
|
||||||
|
|
||||||
class ChartofAccountsImporter(Document):
|
class ChartofAccountsImporter(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
company: DF.Link | None
|
||||||
|
import_file: DF.Attach | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if self.import_file:
|
if self.import_file:
|
||||||
get_coa(
|
get_coa(
|
||||||
@@ -112,7 +125,7 @@ def generate_data_from_csv(file_doc, as_dict=False):
|
|||||||
if as_dict:
|
if as_dict:
|
||||||
data.append({frappe.scrub(header): row[index] for index, header in enumerate(headers)})
|
data.append({frappe.scrub(header): row[index] for index, header in enumerate(headers)})
|
||||||
else:
|
else:
|
||||||
if not row[1]:
|
if not row[1] and len(row) > 1:
|
||||||
row[1] = row[0]
|
row[1] = row[0]
|
||||||
row[3] = row[2]
|
row[3] = row[2]
|
||||||
data.append(row)
|
data.append(row)
|
||||||
@@ -294,10 +307,8 @@ def build_response_as_excel(writer):
|
|||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def download_template(file_type, template_type):
|
def download_template(file_type, template_type, company):
|
||||||
data = frappe._dict(frappe.local.form_dict)
|
writer = get_template(template_type, company)
|
||||||
|
|
||||||
writer = get_template(template_type)
|
|
||||||
|
|
||||||
if file_type == "CSV":
|
if file_type == "CSV":
|
||||||
# download csv file
|
# download csv file
|
||||||
@@ -308,8 +319,7 @@ def download_template(file_type, template_type):
|
|||||||
build_response_as_excel(writer)
|
build_response_as_excel(writer)
|
||||||
|
|
||||||
|
|
||||||
def get_template(template_type):
|
def get_template(template_type, company):
|
||||||
|
|
||||||
fields = [
|
fields = [
|
||||||
"Account Name",
|
"Account Name",
|
||||||
"Parent Account",
|
"Parent Account",
|
||||||
@@ -335,34 +345,17 @@ def get_template(template_type):
|
|||||||
["", "", "", "", 0, account_type.get("account_type"), account_type.get("root_type")]
|
["", "", "", "", 0, account_type.get("account_type"), account_type.get("root_type")]
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
writer = get_sample_template(writer)
|
writer = get_sample_template(writer, company)
|
||||||
|
|
||||||
return writer
|
return writer
|
||||||
|
|
||||||
|
|
||||||
def get_sample_template(writer):
|
def get_sample_template(writer, company):
|
||||||
template = [
|
currency = frappe.db.get_value("Company", company, "default_currency")
|
||||||
["Application Of Funds(Assets)", "", "", "", 1, "", "Asset"],
|
with open(os.path.join(os.path.dirname(__file__), "coa_sample_template.csv"), "r") as f:
|
||||||
["Sources Of Funds(Liabilities)", "", "", "", 1, "", "Liability"],
|
for row in f:
|
||||||
["Equity", "", "", "", 1, "", "Equity"],
|
row = row.strip().split(",") + [currency]
|
||||||
["Expenses", "", "", "", 1, "", "Expense"],
|
writer.writerow(row)
|
||||||
["Income", "", "", "", 1, "", "Income"],
|
|
||||||
["Bank Accounts", "Application Of Funds(Assets)", "", "", 1, "Bank", "Asset"],
|
|
||||||
["Cash In Hand", "Application Of Funds(Assets)", "", "", 1, "Cash", "Asset"],
|
|
||||||
["Stock Assets", "Application Of Funds(Assets)", "", "", 1, "Stock", "Asset"],
|
|
||||||
["Cost Of Goods Sold", "Expenses", "", "", 0, "Cost of Goods Sold", "Expense"],
|
|
||||||
["Asset Depreciation", "Expenses", "", "", 0, "Depreciation", "Expense"],
|
|
||||||
["Fixed Assets", "Application Of Funds(Assets)", "", "", 0, "Fixed Asset", "Asset"],
|
|
||||||
["Accounts Payable", "Sources Of Funds(Liabilities)", "", "", 0, "Payable", "Liability"],
|
|
||||||
["Accounts Receivable", "Application Of Funds(Assets)", "", "", 1, "Receivable", "Asset"],
|
|
||||||
["Stock Expenses", "Expenses", "", "", 0, "Stock Adjustment", "Expense"],
|
|
||||||
["Sample Bank", "Bank Accounts", "", "", 0, "Bank", "Asset"],
|
|
||||||
["Cash", "Cash In Hand", "", "", 0, "Cash", "Asset"],
|
|
||||||
["Stores", "Stock Assets", "", "", 0, "Stock", "Asset"],
|
|
||||||
]
|
|
||||||
|
|
||||||
for row in template:
|
|
||||||
writer.writerow(row)
|
|
||||||
|
|
||||||
return writer
|
return writer
|
||||||
|
|
||||||
@@ -453,14 +446,11 @@ def get_mandatory_account_types():
|
|||||||
|
|
||||||
|
|
||||||
def unset_existing_data(company):
|
def unset_existing_data(company):
|
||||||
linked = frappe.db.sql(
|
|
||||||
'''select fieldname from tabDocField
|
|
||||||
where fieldtype="Link" and options="Account" and parent="Company"''',
|
|
||||||
as_dict=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
# remove accounts data from company
|
# remove accounts data from company
|
||||||
update_values = {d.fieldname: "" for d in linked}
|
|
||||||
|
fieldnames = get_linked_fields("Account").get("Company", {}).get("fieldname", [])
|
||||||
|
linked = [{"fieldname": name} for name in fieldnames]
|
||||||
|
update_values = {d.get("fieldname"): "" for d in linked}
|
||||||
frappe.db.set_value("Company", company, update_values, update_values)
|
frappe.db.set_value("Company", company, update_values, update_values)
|
||||||
|
|
||||||
# remove accounts data from various doctypes
|
# remove accounts data from various doctypes
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
Application Of Funds(Assets),,,,1,,Asset
|
||||||
|
Sources Of Funds(Liabilities),,,,1,,Liability
|
||||||
|
Equity,,,,1,,Equity
|
||||||
|
Expenses,,,,1,Expense Account,Expense
|
||||||
|
Income,,,,1,Income Account,Income
|
||||||
|
Bank Accounts,Application Of Funds(Assets),,,1,Bank,Asset
|
||||||
|
Cash In Hand,Application Of Funds(Assets),,,1,Cash,Asset
|
||||||
|
Stock Assets,Application Of Funds(Assets),,,1,Stock,Asset
|
||||||
|
Cost Of Goods Sold,Expenses,,,0,Cost of Goods Sold,Expense
|
||||||
|
Asset Depreciation,Expenses,,,0,Depreciation,Expense
|
||||||
|
Fixed Assets,Application Of Funds(Assets),,,0,Fixed Asset,Asset
|
||||||
|
Accounts Payable,Sources Of Funds(Liabilities),,,0,Payable,Liability
|
||||||
|
Accounts Receivable,Application Of Funds(Assets),,,1,Receivable,Asset
|
||||||
|
Stock Expenses,Expenses,,,0,Stock Adjustment,Expense
|
||||||
|
Sample Bank,Bank Accounts,,,0,Bank,Asset
|
||||||
|
Cash,Cash In Hand,,,0,Cash,Asset
|
||||||
|
Stores,Stock Assets,,,0,Stock,Asset
|
||||||
|
@@ -8,6 +8,41 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class ChequePrintTemplate(Document):
|
class ChequePrintTemplate(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
acc_no_dist_from_left_edge: DF.Float
|
||||||
|
acc_no_dist_from_top_edge: DF.Float
|
||||||
|
acc_pay_dist_from_left_edge: DF.Float
|
||||||
|
acc_pay_dist_from_top_edge: DF.Float
|
||||||
|
amt_in_figures_from_left_edge: DF.Float
|
||||||
|
amt_in_figures_from_top_edge: DF.Float
|
||||||
|
amt_in_word_width: DF.Float
|
||||||
|
amt_in_words_from_left_edge: DF.Float
|
||||||
|
amt_in_words_from_top_edge: DF.Float
|
||||||
|
amt_in_words_line_spacing: DF.Float
|
||||||
|
bank_name: DF.Data
|
||||||
|
cheque_height: DF.Float
|
||||||
|
cheque_size: DF.Literal["", "Regular", "A4"]
|
||||||
|
cheque_width: DF.Float
|
||||||
|
date_dist_from_left_edge: DF.Float
|
||||||
|
date_dist_from_top_edge: DF.Float
|
||||||
|
has_print_format: DF.Check
|
||||||
|
is_account_payable: DF.Check
|
||||||
|
message_to_show: DF.Data | None
|
||||||
|
payer_name_from_left_edge: DF.Float
|
||||||
|
payer_name_from_top_edge: DF.Float
|
||||||
|
scanned_cheque: DF.Attach | None
|
||||||
|
signatory_from_left_edge: DF.Float
|
||||||
|
signatory_from_top_edge: DF.Float
|
||||||
|
starting_position_from_top_edge: DF.Float
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class ClosedDocument(Document):
|
class ClosedDocument(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
closed: DF.Check
|
||||||
|
document_type: DF.Link
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -10,6 +10,25 @@ from erpnext.accounts.utils import validate_field_number
|
|||||||
|
|
||||||
|
|
||||||
class CostCenter(NestedSet):
|
class CostCenter(NestedSet):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
company: DF.Link
|
||||||
|
cost_center_name: DF.Data
|
||||||
|
cost_center_number: DF.Data | None
|
||||||
|
disabled: DF.Check
|
||||||
|
is_group: DF.Check
|
||||||
|
lft: DF.Int
|
||||||
|
old_parent: DF.Link | None
|
||||||
|
parent_cost_center: DF.Link
|
||||||
|
rgt: DF.Int
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
nsm_parent_field = "parent_cost_center"
|
nsm_parent_field = "parent_cost_center"
|
||||||
|
|
||||||
def autoname(self):
|
def autoname(self):
|
||||||
|
|||||||
@@ -28,6 +28,25 @@ class InvalidDateError(frappe.ValidationError):
|
|||||||
|
|
||||||
|
|
||||||
class CostCenterAllocation(Document):
|
class CostCenterAllocation(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.cost_center_allocation_percentage.cost_center_allocation_percentage import (
|
||||||
|
CostCenterAllocationPercentage,
|
||||||
|
)
|
||||||
|
|
||||||
|
allocation_percentages: DF.Table[CostCenterAllocationPercentage]
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
company: DF.Link
|
||||||
|
main_cost_center: DF.Link
|
||||||
|
valid_from: DF.Date
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(CostCenterAllocation, self).__init__(*args, **kwargs)
|
super(CostCenterAllocation, self).__init__(*args, **kwargs)
|
||||||
self._skip_from_date_validation = False
|
self._skip_from_date_validation = False
|
||||||
|
|||||||
@@ -6,4 +6,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class CostCenterAllocationPercentage(Document):
|
class CostCenterAllocationPercentage(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
cost_center: DF.Link
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
percentage: DF.Percent
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -9,6 +9,27 @@ from frappe.utils import strip
|
|||||||
|
|
||||||
|
|
||||||
class CouponCode(Document):
|
class CouponCode(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
coupon_code: DF.Data | None
|
||||||
|
coupon_name: DF.Data
|
||||||
|
coupon_type: DF.Literal["Promotional", "Gift Card"]
|
||||||
|
customer: DF.Link | None
|
||||||
|
description: DF.TextEditor | None
|
||||||
|
maximum_use: DF.Int
|
||||||
|
pricing_rule: DF.Link
|
||||||
|
used: DF.Int
|
||||||
|
valid_from: DF.Date | None
|
||||||
|
valid_upto: DF.Date | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def autoname(self):
|
def autoname(self):
|
||||||
self.coupon_name = strip(self.coupon_name)
|
self.coupon_name = strip(self.coupon_name)
|
||||||
self.name = self.coupon_name
|
self.name = self.coupon_name
|
||||||
|
|||||||
@@ -9,6 +9,30 @@ from frappe.utils import nowdate
|
|||||||
|
|
||||||
|
|
||||||
class CurrencyExchangeSettings(Document):
|
class CurrencyExchangeSettings(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.currency_exchange_settings_details.currency_exchange_settings_details import (
|
||||||
|
CurrencyExchangeSettingsDetails,
|
||||||
|
)
|
||||||
|
from erpnext.accounts.doctype.currency_exchange_settings_result.currency_exchange_settings_result import (
|
||||||
|
CurrencyExchangeSettingsResult,
|
||||||
|
)
|
||||||
|
|
||||||
|
access_key: DF.Data | None
|
||||||
|
api_endpoint: DF.Data
|
||||||
|
disabled: DF.Check
|
||||||
|
req_params: DF.Table[CurrencyExchangeSettingsDetails]
|
||||||
|
result_key: DF.Table[CurrencyExchangeSettingsResult]
|
||||||
|
service_provider: DF.Literal["frankfurter.app", "exchangerate.host", "Custom"]
|
||||||
|
url: DF.Data | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.set_parameters_and_result()
|
self.set_parameters_and_result()
|
||||||
if frappe.flags.in_test or frappe.flags.in_install or frappe.flags.in_setup_wizard:
|
if frappe.flags.in_test or frappe.flags.in_install or frappe.flags.in_setup_wizard:
|
||||||
|
|||||||
@@ -6,4 +6,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class CurrencyExchangeSettingsDetails(Document):
|
class CurrencyExchangeSettingsDetails(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
key: DF.Data
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
value: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,18 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class CurrencyExchangeSettingsResult(Document):
|
class CurrencyExchangeSettingsResult(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
key: DF.Data
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,18 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class CustomerGroupItem(Document):
|
class CustomerGroupItem(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
customer_group: DF.Link | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,18 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class CustomerItem(Document):
|
class CustomerItem(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
customer: DF.Link | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -7,4 +7,22 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class DiscountedInvoice(Document):
|
class DiscountedInvoice(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
customer: DF.Link | None
|
||||||
|
debit_to: DF.Link | None
|
||||||
|
outstanding_amount: DF.Currency
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
posting_date: DF.Date | None
|
||||||
|
sales_invoice: DF.Link
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -22,6 +22,52 @@ from erpnext.controllers.accounts_controller import AccountsController
|
|||||||
|
|
||||||
|
|
||||||
class Dunning(AccountsController):
|
class Dunning(AccountsController):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.overdue_payment.overdue_payment import OverduePayment
|
||||||
|
|
||||||
|
address_display: DF.SmallText | None
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
base_dunning_amount: DF.Currency
|
||||||
|
body_text: DF.TextEditor | None
|
||||||
|
closing_text: DF.TextEditor | None
|
||||||
|
company: DF.Link
|
||||||
|
company_address: DF.Link | None
|
||||||
|
company_address_display: DF.SmallText | None
|
||||||
|
contact_display: DF.SmallText | None
|
||||||
|
contact_email: DF.Data | None
|
||||||
|
contact_mobile: DF.SmallText | None
|
||||||
|
contact_person: DF.Link | None
|
||||||
|
conversion_rate: DF.Float
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
currency: DF.Link | None
|
||||||
|
customer: DF.Link
|
||||||
|
customer_address: DF.Link | None
|
||||||
|
customer_name: DF.Data | None
|
||||||
|
dunning_amount: DF.Currency
|
||||||
|
dunning_fee: DF.Currency
|
||||||
|
dunning_type: DF.Link | None
|
||||||
|
grand_total: DF.Currency
|
||||||
|
income_account: DF.Link | None
|
||||||
|
language: DF.Link | None
|
||||||
|
letter_head: DF.Link | None
|
||||||
|
naming_series: DF.Literal["DUNN-.MM.-.YY.-"]
|
||||||
|
overdue_payments: DF.Table[OverduePayment]
|
||||||
|
posting_date: DF.Date
|
||||||
|
posting_time: DF.Time | None
|
||||||
|
rate_of_interest: DF.Float
|
||||||
|
spacer: DF.Data | None
|
||||||
|
status: DF.Literal["Draft", "Resolved", "Unresolved", "Cancelled"]
|
||||||
|
total_interest: DF.Currency
|
||||||
|
total_outstanding: DF.Currency
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_same_currency()
|
self.validate_same_currency()
|
||||||
self.validate_overdue_payments()
|
self.validate_overdue_payments()
|
||||||
|
|||||||
@@ -7,4 +7,21 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class DunningLetterText(Document):
|
class DunningLetterText(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
body_text: DF.TextEditor | None
|
||||||
|
closing_text: DF.TextEditor | None
|
||||||
|
is_default_language: DF.Check
|
||||||
|
language: DF.Link | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -7,6 +7,26 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class DunningType(Document):
|
class DunningType(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.dunning_letter_text.dunning_letter_text import DunningLetterText
|
||||||
|
|
||||||
|
company: DF.Link
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
dunning_fee: DF.Currency
|
||||||
|
dunning_letter_text: DF.Table[DunningLetterText]
|
||||||
|
dunning_type: DF.Data
|
||||||
|
income_account: DF.Link | None
|
||||||
|
is_default: DF.Check
|
||||||
|
rate_of_interest: DF.Float
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def autoname(self):
|
def autoname(self):
|
||||||
company_abbr = frappe.get_value("Company", self.company, "abbr")
|
company_abbr = frappe.get_value("Company", self.company, "abbr")
|
||||||
self.name = f"{self.dunning_type} - {company_abbr}"
|
self.name = f"{self.dunning_type} - {company_abbr}"
|
||||||
|
|||||||
@@ -17,12 +17,34 @@ from erpnext.setup.utils import get_exchange_rate
|
|||||||
|
|
||||||
|
|
||||||
class ExchangeRateRevaluation(Document):
|
class ExchangeRateRevaluation(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.exchange_rate_revaluation_account.exchange_rate_revaluation_account import (
|
||||||
|
ExchangeRateRevaluationAccount,
|
||||||
|
)
|
||||||
|
|
||||||
|
accounts: DF.Table[ExchangeRateRevaluationAccount]
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
company: DF.Link
|
||||||
|
gain_loss_booked: DF.Currency
|
||||||
|
gain_loss_unbooked: DF.Currency
|
||||||
|
posting_date: DF.Date
|
||||||
|
rounding_loss_allowance: DF.Float
|
||||||
|
total_gain_loss: DF.Currency
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_rounding_loss_allowance()
|
self.validate_rounding_loss_allowance()
|
||||||
self.set_total_gain_loss()
|
self.set_total_gain_loss()
|
||||||
|
|
||||||
def validate_rounding_loss_allowance(self):
|
def validate_rounding_loss_allowance(self):
|
||||||
if not (self.rounding_loss_allowance >= 0 and self.rounding_loss_allowance < 1):
|
if self.rounding_loss_allowance < 0 or self.rounding_loss_allowance >= 1:
|
||||||
frappe.throw(_("Rounding Loss Allowance should be between 0 and 1"))
|
frappe.throw(_("Rounding Loss Allowance should be between 0 and 1"))
|
||||||
|
|
||||||
def set_total_gain_loss(self):
|
def set_total_gain_loss(self):
|
||||||
@@ -192,7 +214,7 @@ class ExchangeRateRevaluation(Document):
|
|||||||
# round off balance based on currency precision
|
# round off balance based on currency precision
|
||||||
# and consider debit-credit difference allowance
|
# and consider debit-credit difference allowance
|
||||||
currency_precision = get_currency_precision()
|
currency_precision = get_currency_precision()
|
||||||
rounding_loss_allowance = float(rounding_loss_allowance) or 0.05
|
rounding_loss_allowance = float(rounding_loss_allowance)
|
||||||
for acc in account_details:
|
for acc in account_details:
|
||||||
acc.balance_in_account_currency = flt(acc.balance_in_account_currency, currency_precision)
|
acc.balance_in_account_currency = flt(acc.balance_in_account_currency, currency_precision)
|
||||||
if abs(acc.balance_in_account_currency) <= rounding_loss_allowance:
|
if abs(acc.balance_in_account_currency) <= rounding_loss_allowance:
|
||||||
|
|||||||
@@ -6,4 +6,29 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class ExchangeRateRevaluationAccount(Document):
|
class ExchangeRateRevaluationAccount(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link
|
||||||
|
account_currency: DF.Link | None
|
||||||
|
balance_in_account_currency: DF.Currency
|
||||||
|
balance_in_base_currency: DF.Currency
|
||||||
|
current_exchange_rate: DF.Float
|
||||||
|
gain_loss: DF.Currency
|
||||||
|
new_balance_in_account_currency: DF.Currency
|
||||||
|
new_balance_in_base_currency: DF.Currency
|
||||||
|
new_exchange_rate: DF.Float
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
party: DF.DynamicLink | None
|
||||||
|
party_type: DF.Link | None
|
||||||
|
zero_balance: DF.Check
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,15 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class FinanceBook(Document):
|
class FinanceBook(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
finance_book_name: DF.Data | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -10,6 +10,25 @@ from frappe.utils import add_days, add_years, cstr, getdate
|
|||||||
|
|
||||||
|
|
||||||
class FiscalYear(Document):
|
class FiscalYear(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.fiscal_year_company.fiscal_year_company import FiscalYearCompany
|
||||||
|
|
||||||
|
auto_created: DF.Check
|
||||||
|
companies: DF.Table[FiscalYearCompany]
|
||||||
|
disabled: DF.Check
|
||||||
|
is_short_year: DF.Check
|
||||||
|
year: DF.Data
|
||||||
|
year_end_date: DF.Date
|
||||||
|
year_start_date: DF.Date
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_dates()
|
self.validate_dates()
|
||||||
self.validate_overlap()
|
self.validate_overlap()
|
||||||
|
|||||||
@@ -6,4 +6,18 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class FiscalYearCompany(Document):
|
class FiscalYearCompany(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
company: DF.Link | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -17,10 +17,13 @@
|
|||||||
"account_currency",
|
"account_currency",
|
||||||
"debit_in_account_currency",
|
"debit_in_account_currency",
|
||||||
"credit_in_account_currency",
|
"credit_in_account_currency",
|
||||||
|
"against_type",
|
||||||
"against",
|
"against",
|
||||||
|
"against_link",
|
||||||
"against_voucher_type",
|
"against_voucher_type",
|
||||||
"against_voucher",
|
"against_voucher",
|
||||||
"voucher_type",
|
"voucher_type",
|
||||||
|
"voucher_subtype",
|
||||||
"voucher_no",
|
"voucher_no",
|
||||||
"voucher_detail_no",
|
"voucher_detail_no",
|
||||||
"project",
|
"project",
|
||||||
@@ -128,6 +131,13 @@
|
|||||||
"label": "Credit Amount in Account Currency",
|
"label": "Credit Amount in Account Currency",
|
||||||
"options": "account_currency"
|
"options": "account_currency"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "against_type",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"in_filter": 1,
|
||||||
|
"label": "Against Type",
|
||||||
|
"options": "DocType"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "against",
|
"fieldname": "against",
|
||||||
"fieldtype": "Text",
|
"fieldtype": "Text",
|
||||||
@@ -136,14 +146,20 @@
|
|||||||
"oldfieldname": "against",
|
"oldfieldname": "against",
|
||||||
"oldfieldtype": "Text"
|
"oldfieldtype": "Text"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "against_link",
|
||||||
|
"fieldtype": "Dynamic Link",
|
||||||
|
"in_filter": 1,
|
||||||
|
"label": "Against",
|
||||||
|
"options": "against_type"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "against_voucher_type",
|
"fieldname": "against_voucher_type",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Against Voucher Type",
|
"label": "Against Voucher Type",
|
||||||
"oldfieldname": "against_voucher_type",
|
"oldfieldname": "against_voucher_type",
|
||||||
"oldfieldtype": "Data",
|
"oldfieldtype": "Data",
|
||||||
"options": "DocType",
|
"options": "DocType"
|
||||||
"search_index": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "against_voucher",
|
"fieldname": "against_voucher",
|
||||||
@@ -162,8 +178,7 @@
|
|||||||
"label": "Voucher Type",
|
"label": "Voucher Type",
|
||||||
"oldfieldname": "voucher_type",
|
"oldfieldname": "voucher_type",
|
||||||
"oldfieldtype": "Select",
|
"oldfieldtype": "Select",
|
||||||
"options": "DocType",
|
"options": "DocType"
|
||||||
"search_index": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "voucher_no",
|
"fieldname": "voucher_no",
|
||||||
@@ -280,13 +295,18 @@
|
|||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Credit Amount in Transaction Currency",
|
"label": "Credit Amount in Transaction Currency",
|
||||||
"options": "transaction_currency"
|
"options": "transaction_currency"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "voucher_subtype",
|
||||||
|
"fieldtype": "Small Text",
|
||||||
|
"label": "Voucher Subtype"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-list",
|
"icon": "fa fa-list",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"in_create": 1,
|
"in_create": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-08-16 21:38:44.072267",
|
"modified": "2023-12-18 15:38:14.006208",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "GL Entry",
|
"name": "GL Entry",
|
||||||
@@ -321,4 +341,4 @@
|
|||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"states": []
|
"states": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,50 @@ exclude_from_linked_with = True
|
|||||||
|
|
||||||
|
|
||||||
class GLEntry(Document):
|
class GLEntry(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link | None
|
||||||
|
account_currency: DF.Link | None
|
||||||
|
against: DF.Text | None
|
||||||
|
against_link: DF.DynamicLink | None
|
||||||
|
against_type: DF.Link | None
|
||||||
|
against_voucher: DF.DynamicLink | None
|
||||||
|
against_voucher_type: DF.Link | None
|
||||||
|
company: DF.Link | None
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
credit: DF.Currency
|
||||||
|
credit_in_account_currency: DF.Currency
|
||||||
|
credit_in_transaction_currency: DF.Currency
|
||||||
|
debit: DF.Currency
|
||||||
|
debit_in_account_currency: DF.Currency
|
||||||
|
debit_in_transaction_currency: DF.Currency
|
||||||
|
due_date: DF.Date | None
|
||||||
|
finance_book: DF.Link | None
|
||||||
|
fiscal_year: DF.Link | None
|
||||||
|
is_advance: DF.Literal["No", "Yes"]
|
||||||
|
is_cancelled: DF.Check
|
||||||
|
is_opening: DF.Literal["No", "Yes"]
|
||||||
|
party: DF.DynamicLink | None
|
||||||
|
party_type: DF.Link | None
|
||||||
|
posting_date: DF.Date | None
|
||||||
|
project: DF.Link | None
|
||||||
|
remarks: DF.Text | None
|
||||||
|
to_rename: DF.Check
|
||||||
|
transaction_currency: DF.Link | None
|
||||||
|
transaction_date: DF.Date | None
|
||||||
|
transaction_exchange_rate: DF.Float
|
||||||
|
voucher_detail_no: DF.Data | None
|
||||||
|
voucher_no: DF.DynamicLink | None
|
||||||
|
voucher_subtype: DF.SmallText | None
|
||||||
|
voucher_type: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def autoname(self):
|
def autoname(self):
|
||||||
"""
|
"""
|
||||||
Temporarily name doc for fast insertion
|
Temporarily name doc for fast insertion
|
||||||
@@ -391,8 +435,8 @@ def update_outstanding_amt(
|
|||||||
def validate_frozen_account(account, adv_adj=None):
|
def validate_frozen_account(account, adv_adj=None):
|
||||||
frozen_account = frappe.get_cached_value("Account", account, "freeze_account")
|
frozen_account = frappe.get_cached_value("Account", account, "freeze_account")
|
||||||
if frozen_account == "Yes" and not adv_adj:
|
if frozen_account == "Yes" and not adv_adj:
|
||||||
frozen_accounts_modifier = frappe.db.get_value(
|
frozen_accounts_modifier = frappe.db.get_single_value(
|
||||||
"Accounts Settings", None, "frozen_accounts_modifier"
|
"Accounts Settings", "frozen_accounts_modifier"
|
||||||
)
|
)
|
||||||
|
|
||||||
if not frozen_accounts_modifier:
|
if not frozen_accounts_modifier:
|
||||||
|
|||||||
@@ -17,6 +17,34 @@ from erpnext.controllers.accounts_controller import AccountsController
|
|||||||
|
|
||||||
|
|
||||||
class InvoiceDiscounting(AccountsController):
|
class InvoiceDiscounting(AccountsController):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.discounted_invoice.discounted_invoice import DiscountedInvoice
|
||||||
|
|
||||||
|
accounts_receivable_credit: DF.Link
|
||||||
|
accounts_receivable_discounted: DF.Link
|
||||||
|
accounts_receivable_unpaid: DF.Link
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
bank_account: DF.Link
|
||||||
|
bank_charges: DF.Currency
|
||||||
|
bank_charges_account: DF.Link
|
||||||
|
company: DF.Link
|
||||||
|
invoices: DF.Table[DiscountedInvoice]
|
||||||
|
loan_end_date: DF.Date | None
|
||||||
|
loan_period: DF.Int
|
||||||
|
loan_start_date: DF.Date | None
|
||||||
|
posting_date: DF.Date
|
||||||
|
short_term_loan: DF.Link
|
||||||
|
status: DF.Literal["Draft", "Sanctioned", "Disbursed", "Settled", "Cancelled"]
|
||||||
|
total_amount: DF.Currency
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_mandatory()
|
self.validate_mandatory()
|
||||||
self.validate_invoices()
|
self.validate_invoices()
|
||||||
@@ -125,7 +153,9 @@ class InvoiceDiscounting(AccountsController):
|
|||||||
"account": inv.debit_to,
|
"account": inv.debit_to,
|
||||||
"party_type": "Customer",
|
"party_type": "Customer",
|
||||||
"party": d.customer,
|
"party": d.customer,
|
||||||
|
"against_type": "Account",
|
||||||
"against": self.accounts_receivable_credit,
|
"against": self.accounts_receivable_credit,
|
||||||
|
"against_link": self.accounts_receivable_credit,
|
||||||
"credit": outstanding_in_company_currency,
|
"credit": outstanding_in_company_currency,
|
||||||
"credit_in_account_currency": outstanding_in_company_currency
|
"credit_in_account_currency": outstanding_in_company_currency
|
||||||
if inv.party_account_currency == company_currency
|
if inv.party_account_currency == company_currency
|
||||||
@@ -145,7 +175,9 @@ class InvoiceDiscounting(AccountsController):
|
|||||||
"account": self.accounts_receivable_credit,
|
"account": self.accounts_receivable_credit,
|
||||||
"party_type": "Customer",
|
"party_type": "Customer",
|
||||||
"party": d.customer,
|
"party": d.customer,
|
||||||
|
"against_type": "Account",
|
||||||
"against": inv.debit_to,
|
"against": inv.debit_to,
|
||||||
|
"against_link": inv.debit_to,
|
||||||
"debit": outstanding_in_company_currency,
|
"debit": outstanding_in_company_currency,
|
||||||
"debit_in_account_currency": outstanding_in_company_currency
|
"debit_in_account_currency": outstanding_in_company_currency
|
||||||
if ar_credit_account_currency == company_currency
|
if ar_credit_account_currency == company_currency
|
||||||
|
|||||||
@@ -8,6 +8,24 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class ItemTaxTemplate(Document):
|
class ItemTaxTemplate(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.item_tax_template_detail.item_tax_template_detail import (
|
||||||
|
ItemTaxTemplateDetail,
|
||||||
|
)
|
||||||
|
|
||||||
|
company: DF.Link
|
||||||
|
disabled: DF.Check
|
||||||
|
taxes: DF.Table[ItemTaxTemplateDetail]
|
||||||
|
title: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_tax_accounts()
|
self.validate_tax_accounts()
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class ItemTaxTemplateDetail(Document):
|
class ItemTaxTemplateDetail(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
tax_rate: DF.Float
|
||||||
|
tax_type: DF.Link
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ frappe.provide("erpnext.journal_entry");
|
|||||||
frappe.ui.form.on("Journal Entry", {
|
frappe.ui.form.on("Journal Entry", {
|
||||||
setup: function(frm) {
|
setup: function(frm) {
|
||||||
frm.add_fetch("bank_account", "account", "account");
|
frm.add_fetch("bank_account", "account", "account");
|
||||||
frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice', 'Journal Entry', "Repost Payment Ledger", 'Asset', 'Asset Movement', 'Asset Depreciation Schedule', "Repost Accounting Ledger"];
|
frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice', 'Journal Entry', "Repost Payment Ledger", 'Asset', 'Asset Movement', 'Asset Depreciation Schedule', "Repost Accounting Ledger", "Unreconcile Payment", "Unreconcile Payment Entries"];
|
||||||
},
|
},
|
||||||
|
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
@@ -51,7 +51,7 @@ frappe.ui.form.on("Journal Entry", {
|
|||||||
}, __('Make'));
|
}, __('Make'));
|
||||||
}
|
}
|
||||||
|
|
||||||
erpnext.accounts.unreconcile_payments.add_unreconcile_btn(frm);
|
erpnext.accounts.unreconcile_payment.add_unreconcile_btn(frm);
|
||||||
},
|
},
|
||||||
before_save: function(frm) {
|
before_save: function(frm) {
|
||||||
if ((frm.doc.docstatus == 0) && (!frm.doc.is_system_generated)) {
|
if ((frm.doc.docstatus == 0) && (!frm.doc.is_system_generated)) {
|
||||||
@@ -220,6 +220,16 @@ erpnext.accounts.JournalEntry = class JournalEntry extends frappe.ui.form.Contro
|
|||||||
return erpnext.journal_entry.account_query(me.frm);
|
return erpnext.journal_entry.account_query(me.frm);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
me.frm.set_query("against_account_link", "accounts", function(doc, cdt, cdn) {
|
||||||
|
return erpnext.journal_entry.against_account_query(me.frm);
|
||||||
|
});
|
||||||
|
|
||||||
|
me.frm.set_query("against_type", "accounts", function(){
|
||||||
|
return {
|
||||||
|
query: "erpnext.accounts.doctype.journal_entry.journal_entry.get_against_type",
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
me.frm.set_query("party_type", "accounts", function(doc, cdt, cdn) {
|
me.frm.set_query("party_type", "accounts", function(doc, cdt, cdn) {
|
||||||
const row = locals[cdt][cdn];
|
const row = locals[cdt][cdn];
|
||||||
|
|
||||||
@@ -591,6 +601,21 @@ $.extend(erpnext.journal_entry, {
|
|||||||
return { filters: filters };
|
return { filters: filters };
|
||||||
},
|
},
|
||||||
|
|
||||||
|
against_account_query: function(frm) {
|
||||||
|
if (frm.doc.against_type != "Account"){
|
||||||
|
return { filters: {} };
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let filters = { company: frm.doc.company, is_group: 0 };
|
||||||
|
if(!frm.doc.multi_currency) {
|
||||||
|
$.extend(filters, {
|
||||||
|
account_currency: ['in', [frappe.get_doc(":Company", frm.doc.company).default_currency, null]]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return { filters: filters };
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
reverse_journal_entry: function() {
|
reverse_journal_entry: function() {
|
||||||
frappe.model.open_mapped_doc({
|
frappe.model.open_mapped_doc({
|
||||||
method: "erpnext.accounts.doctype.journal_entry.journal_entry.make_reverse_journal_entry",
|
method: "erpnext.accounts.doctype.journal_entry.journal_entry.make_reverse_journal_entry",
|
||||||
|
|||||||
@@ -548,8 +548,16 @@
|
|||||||
"icon": "fa fa-file-text",
|
"icon": "fa fa-file-text",
|
||||||
"idx": 176,
|
"idx": 176,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [
|
||||||
"modified": "2023-08-10 14:32:22.366895",
|
{
|
||||||
|
"is_child_table": 1,
|
||||||
|
"link_doctype": "Bank Transaction Payments",
|
||||||
|
"link_fieldname": "payment_entry",
|
||||||
|
"parent_doctype": "Bank Transaction",
|
||||||
|
"table_fieldname": "payment_entries"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"modified": "2023-11-23 12:11:04.128015",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Journal Entry",
|
"name": "Journal Entry",
|
||||||
|
|||||||
@@ -35,6 +35,78 @@ class StockAccountInvalidTransaction(frappe.ValidationError):
|
|||||||
|
|
||||||
|
|
||||||
class JournalEntry(AccountsController):
|
class JournalEntry(AccountsController):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.journal_entry_account.journal_entry_account import (
|
||||||
|
JournalEntryAccount,
|
||||||
|
)
|
||||||
|
|
||||||
|
accounts: DF.Table[JournalEntryAccount]
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
apply_tds: DF.Check
|
||||||
|
auto_repeat: DF.Link | None
|
||||||
|
bill_date: DF.Date | None
|
||||||
|
bill_no: DF.Data | None
|
||||||
|
cheque_date: DF.Date | None
|
||||||
|
cheque_no: DF.Data | None
|
||||||
|
clearance_date: DF.Date | None
|
||||||
|
company: DF.Link
|
||||||
|
difference: DF.Currency
|
||||||
|
due_date: DF.Date | None
|
||||||
|
finance_book: DF.Link | None
|
||||||
|
from_template: DF.Link | None
|
||||||
|
inter_company_journal_entry_reference: DF.Link | None
|
||||||
|
is_opening: DF.Literal["No", "Yes"]
|
||||||
|
is_system_generated: DF.Check
|
||||||
|
letter_head: DF.Link | None
|
||||||
|
mode_of_payment: DF.Link | None
|
||||||
|
multi_currency: DF.Check
|
||||||
|
naming_series: DF.Literal["ACC-JV-.YYYY.-"]
|
||||||
|
paid_loan: DF.Data | None
|
||||||
|
pay_to_recd_from: DF.Data | None
|
||||||
|
payment_order: DF.Link | None
|
||||||
|
posting_date: DF.Date
|
||||||
|
process_deferred_accounting: DF.Link | None
|
||||||
|
remark: DF.SmallText | None
|
||||||
|
reversal_of: DF.Link | None
|
||||||
|
select_print_heading: DF.Link | None
|
||||||
|
stock_entry: DF.Link | None
|
||||||
|
tax_withholding_category: DF.Link | None
|
||||||
|
title: DF.Data | None
|
||||||
|
total_amount: DF.Currency
|
||||||
|
total_amount_currency: DF.Link | None
|
||||||
|
total_amount_in_words: DF.Data | None
|
||||||
|
total_credit: DF.Currency
|
||||||
|
total_debit: DF.Currency
|
||||||
|
user_remark: DF.SmallText | None
|
||||||
|
voucher_type: DF.Literal[
|
||||||
|
"Journal Entry",
|
||||||
|
"Inter Company Journal Entry",
|
||||||
|
"Bank Entry",
|
||||||
|
"Cash Entry",
|
||||||
|
"Credit Card Entry",
|
||||||
|
"Debit Note",
|
||||||
|
"Credit Note",
|
||||||
|
"Contra Entry",
|
||||||
|
"Excise Entry",
|
||||||
|
"Write Off Entry",
|
||||||
|
"Opening Entry",
|
||||||
|
"Depreciation Entry",
|
||||||
|
"Exchange Rate Revaluation",
|
||||||
|
"Exchange Gain Or Loss",
|
||||||
|
"Deferred Revenue",
|
||||||
|
"Deferred Expense",
|
||||||
|
]
|
||||||
|
write_off_amount: DF.Currency
|
||||||
|
write_off_based_on: DF.Literal["Accounts Receivable", "Accounts Payable"]
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(JournalEntry, self).__init__(*args, **kwargs)
|
super(JournalEntry, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
@@ -98,6 +170,8 @@ class JournalEntry(AccountsController):
|
|||||||
"Repost Payment Ledger Items",
|
"Repost Payment Ledger Items",
|
||||||
"Repost Accounting Ledger",
|
"Repost Accounting Ledger",
|
||||||
"Repost Accounting Ledger Items",
|
"Repost Accounting Ledger Items",
|
||||||
|
"Unreconcile Payment",
|
||||||
|
"Unreconcile Payment Entries",
|
||||||
)
|
)
|
||||||
self.make_gl_entries(1)
|
self.make_gl_entries(1)
|
||||||
self.update_advance_paid()
|
self.update_advance_paid()
|
||||||
@@ -230,6 +304,7 @@ class JournalEntry(AccountsController):
|
|||||||
"account": tax_withholding_details.get("account_head"),
|
"account": tax_withholding_details.get("account_head"),
|
||||||
rev_debit_or_credit: tax_withholding_details.get("tax_amount"),
|
rev_debit_or_credit: tax_withholding_details.get("tax_amount"),
|
||||||
"against_account": parties[0],
|
"against_account": parties[0],
|
||||||
|
"against_account_link": parties[0],
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -508,7 +583,7 @@ class JournalEntry(AccountsController):
|
|||||||
).format(d.reference_name, d.account)
|
).format(d.reference_name, d.account)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
dr_or_cr = "debit" if d.credit > 0 else "credit"
|
dr_or_cr = "debit" if flt(d.credit) > 0 else "credit"
|
||||||
valid = False
|
valid = False
|
||||||
for jvd in against_entries:
|
for jvd in against_entries:
|
||||||
if flt(jvd[dr_or_cr]) > 0:
|
if flt(jvd[dr_or_cr]) > 0:
|
||||||
@@ -557,7 +632,7 @@ class JournalEntry(AccountsController):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# set totals
|
# set totals
|
||||||
if not d.reference_name in self.reference_totals:
|
if d.reference_name not in self.reference_totals:
|
||||||
self.reference_totals[d.reference_name] = 0.0
|
self.reference_totals[d.reference_name] = 0.0
|
||||||
|
|
||||||
if self.voucher_type not in ("Deferred Revenue", "Deferred Expense"):
|
if self.voucher_type not in ("Deferred Revenue", "Deferred Expense"):
|
||||||
@@ -676,27 +751,90 @@ class JournalEntry(AccountsController):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def set_against_account(self):
|
def set_against_account(self):
|
||||||
accounts_debited, accounts_credited = [], []
|
|
||||||
if self.voucher_type in ("Deferred Revenue", "Deferred Expense"):
|
if self.voucher_type in ("Deferred Revenue", "Deferred Expense"):
|
||||||
for d in self.get("accounts"):
|
for d in self.get("accounts"):
|
||||||
if d.reference_type == "Sales Invoice":
|
if d.reference_type == "Sales Invoice":
|
||||||
field = "customer"
|
against_type = "Customer"
|
||||||
else:
|
else:
|
||||||
field = "supplier"
|
against_type = "Supplier"
|
||||||
|
|
||||||
d.against_account = frappe.db.get_value(d.reference_type, d.reference_name, field)
|
against_account = frappe.db.get_value(d.reference_type, d.reference_name, against_type.lower())
|
||||||
|
d.against_type = against_type
|
||||||
|
d.against_account_link = against_account
|
||||||
else:
|
else:
|
||||||
for d in self.get("accounts"):
|
self.get_debited_credited_accounts()
|
||||||
if flt(d.debit) > 0:
|
if len(self.accounts_credited) > 1 and len(self.accounts_debited) > 1:
|
||||||
accounts_debited.append(d.party or d.account)
|
self.auto_set_against_accounts()
|
||||||
if flt(d.credit) > 0:
|
return
|
||||||
accounts_credited.append(d.party or d.account)
|
self.get_against_accounts()
|
||||||
|
|
||||||
for d in self.get("accounts"):
|
def auto_set_against_accounts(self):
|
||||||
if flt(d.debit) > 0:
|
for i in range(0, len(self.accounts), 2):
|
||||||
d.against_account = ", ".join(list(set(accounts_credited)))
|
acc = self.accounts[i]
|
||||||
if flt(d.credit) > 0:
|
against_acc = self.accounts[i + 1]
|
||||||
d.against_account = ", ".join(list(set(accounts_debited)))
|
if acc.debit_in_account_currency > 0:
|
||||||
|
current_val = acc.debit_in_account_currency * flt(acc.exchange_rate)
|
||||||
|
against_val = against_acc.credit_in_account_currency * flt(against_acc.exchange_rate)
|
||||||
|
else:
|
||||||
|
current_val = acc.credit_in_account_currency * flt(acc.exchange_rate)
|
||||||
|
against_val = against_acc.debit_in_account_currency * flt(against_acc.exchange_rate)
|
||||||
|
|
||||||
|
if current_val == against_val:
|
||||||
|
acc.against_type = against_acc.party_type or "Account"
|
||||||
|
against_acc.against_type = acc.party_type or "Account"
|
||||||
|
|
||||||
|
acc.against_account_link = against_acc.party or against_acc.account
|
||||||
|
against_acc.against_account_link = acc.party or acc.account
|
||||||
|
else:
|
||||||
|
frappe.msgprint(
|
||||||
|
_(
|
||||||
|
"Unable to automatically determine {0} accounts. Set them up in the {1} table if needed."
|
||||||
|
).format(frappe.bold("against"), frappe.bold("Accounting Entries")),
|
||||||
|
alert=True,
|
||||||
|
)
|
||||||
|
break
|
||||||
|
|
||||||
|
def get_against_accounts(self):
|
||||||
|
self.against_accounts = []
|
||||||
|
self.split_account = {}
|
||||||
|
self.get_debited_credited_accounts()
|
||||||
|
|
||||||
|
if self.separate_against_account_entries:
|
||||||
|
no_of_credited_acc, no_of_debited_acc = len(self.accounts_credited), len(self.accounts_debited)
|
||||||
|
if no_of_credited_acc <= 1 and no_of_debited_acc <= 1:
|
||||||
|
self.set_against_accounts_for_single_dr_cr()
|
||||||
|
self.separate_against_account_entries = 0
|
||||||
|
elif no_of_credited_acc == 1:
|
||||||
|
self.against_accounts = self.accounts_debited
|
||||||
|
self.split_account = self.accounts_credited[0]
|
||||||
|
elif no_of_debited_acc == 1:
|
||||||
|
self.against_accounts = self.accounts_credited
|
||||||
|
self.split_account = self.accounts_debited[0]
|
||||||
|
|
||||||
|
def get_debited_credited_accounts(self):
|
||||||
|
self.accounts_debited, self.accounts_credited = [], []
|
||||||
|
self.separate_against_account_entries = 1
|
||||||
|
for d in self.get("accounts"):
|
||||||
|
if flt(d.debit) > 0:
|
||||||
|
self.accounts_debited.append(d)
|
||||||
|
elif flt(d.credit) > 0:
|
||||||
|
self.accounts_credited.append(d)
|
||||||
|
|
||||||
|
if d.against_account_link:
|
||||||
|
self.separate_against_account_entries = 0
|
||||||
|
break
|
||||||
|
|
||||||
|
def set_against_accounts_for_single_dr_cr(self):
|
||||||
|
against_account = None
|
||||||
|
for d in self.accounts:
|
||||||
|
if flt(d.debit) > 0:
|
||||||
|
against_account = self.accounts_credited[0]
|
||||||
|
elif flt(d.credit) > 0:
|
||||||
|
against_account = self.accounts_debited[0]
|
||||||
|
if against_account:
|
||||||
|
d.against_type = against_account.party_type or "Account"
|
||||||
|
d.against_account = against_account.party or against_account.account
|
||||||
|
d.against_account_link = against_account.party or against_account.account
|
||||||
|
|
||||||
def validate_debit_credit_amount(self):
|
def validate_debit_credit_amount(self):
|
||||||
if not (self.voucher_type == "Exchange Gain Or Loss" and self.multi_currency):
|
if not (self.voucher_type == "Exchange Gain Or Loss" and self.multi_currency):
|
||||||
@@ -868,7 +1006,7 @@ class JournalEntry(AccountsController):
|
|||||||
party_account_currency = d.account_currency
|
party_account_currency = d.account_currency
|
||||||
|
|
||||||
elif frappe.get_cached_value("Account", d.account, "account_type") in ["Bank", "Cash"]:
|
elif frappe.get_cached_value("Account", d.account, "account_type") in ["Bank", "Cash"]:
|
||||||
bank_amount += d.debit_in_account_currency or d.credit_in_account_currency
|
bank_amount += flt(d.debit_in_account_currency) or flt(d.credit_in_account_currency)
|
||||||
bank_account_currency = d.account_currency
|
bank_account_currency = d.account_currency
|
||||||
|
|
||||||
if party_type and pay_to_recd_from:
|
if party_type and pay_to_recd_from:
|
||||||
@@ -893,42 +1031,108 @@ class JournalEntry(AccountsController):
|
|||||||
|
|
||||||
def build_gl_map(self):
|
def build_gl_map(self):
|
||||||
gl_map = []
|
gl_map = []
|
||||||
|
conversion_rate_map = self.get_conversion_rate_map()
|
||||||
|
transaction_currency_map = self.get_transaction_currency_map()
|
||||||
|
company_currency = erpnext.get_company_currency(self.company)
|
||||||
|
|
||||||
|
self.get_against_accounts()
|
||||||
for d in self.get("accounts"):
|
for d in self.get("accounts"):
|
||||||
if d.debit or d.credit or (self.voucher_type == "Exchange Gain Or Loss"):
|
if d.debit or d.credit or (self.voucher_type == "Exchange Gain Or Loss"):
|
||||||
r = [d.user_remark, self.remark]
|
r = [d.user_remark, self.remark]
|
||||||
r = [x for x in r if x]
|
r = [x for x in r if x]
|
||||||
remarks = "\n".join(r)
|
remarks = "\n".join(r)
|
||||||
|
|
||||||
gl_map.append(
|
gl_dict = self.get_gl_dict(
|
||||||
self.get_gl_dict(
|
{
|
||||||
{
|
"account": d.account,
|
||||||
"account": d.account,
|
"party_type": d.party_type,
|
||||||
"party_type": d.party_type,
|
"due_date": self.due_date,
|
||||||
"due_date": self.due_date,
|
"party": d.party,
|
||||||
"party": d.party,
|
"debit": flt(d.debit, d.precision("debit")),
|
||||||
"against": d.against_account,
|
"credit": flt(d.credit, d.precision("credit")),
|
||||||
"debit": flt(d.debit, d.precision("debit")),
|
"account_currency": d.account_currency,
|
||||||
"credit": flt(d.credit, d.precision("credit")),
|
"debit_in_account_currency": flt(
|
||||||
"account_currency": d.account_currency,
|
d.debit_in_account_currency, d.precision("debit_in_account_currency")
|
||||||
"debit_in_account_currency": flt(
|
),
|
||||||
d.debit_in_account_currency, d.precision("debit_in_account_currency")
|
"credit_in_account_currency": flt(
|
||||||
),
|
d.credit_in_account_currency, d.precision("credit_in_account_currency")
|
||||||
"credit_in_account_currency": flt(
|
),
|
||||||
d.credit_in_account_currency, d.precision("credit_in_account_currency")
|
"against_voucher_type": d.reference_type,
|
||||||
),
|
"against_voucher": d.reference_name,
|
||||||
"against_voucher_type": d.reference_type,
|
"remarks": remarks,
|
||||||
"against_voucher": d.reference_name,
|
"voucher_detail_no": d.reference_detail_no,
|
||||||
"remarks": remarks,
|
"cost_center": d.cost_center,
|
||||||
"voucher_detail_no": d.reference_detail_no,
|
"project": d.project,
|
||||||
"cost_center": d.cost_center,
|
"finance_book": self.finance_book,
|
||||||
"project": d.project,
|
"conversion_rate": conversion_rate_map.get(d.against_account_link, 1)
|
||||||
"finance_book": self.finance_book,
|
if d.account_currency == company_currency
|
||||||
},
|
else 1,
|
||||||
item=d,
|
"currency": transaction_currency_map.get(d.against_account_link, d.account_currency)
|
||||||
)
|
if d.account_currency == company_currency
|
||||||
|
else d.account_currency,
|
||||||
|
},
|
||||||
|
item=d,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not self.separate_against_account_entries:
|
||||||
|
gl_dict.update(
|
||||||
|
{
|
||||||
|
"against_type": d.against_type,
|
||||||
|
"against_link": d.against_account_link,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
gl_map.append(gl_dict)
|
||||||
|
|
||||||
|
elif d in self.against_accounts:
|
||||||
|
gl_dict.update(
|
||||||
|
{
|
||||||
|
"against_type": self.split_account.get("party_type") or "Account",
|
||||||
|
"against": self.split_account.get("party") or self.split_account.get("account"),
|
||||||
|
"against_link": self.split_account.get("party") or self.split_account.get("account"),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
gl_map.append(gl_dict)
|
||||||
|
|
||||||
|
else:
|
||||||
|
for against_account in self.against_accounts:
|
||||||
|
against_account = against_account.as_dict()
|
||||||
|
debit = against_account.credit or against_account.credit_in_account_currency
|
||||||
|
credit = against_account.debit or against_account.debit_in_account_currency
|
||||||
|
gl_dict = gl_dict.copy()
|
||||||
|
gl_dict.update(
|
||||||
|
{
|
||||||
|
"against_type": against_account.party_type or "Account",
|
||||||
|
"against": against_account.party or against_account.account,
|
||||||
|
"against_link": against_account.party or against_account.account,
|
||||||
|
"debit": flt(debit, d.precision("debit")),
|
||||||
|
"credit": flt(credit, d.precision("credit")),
|
||||||
|
"account_currency": d.account_currency,
|
||||||
|
"debit_in_account_currency": flt(
|
||||||
|
debit / d.exchange_rate, d.precision("debit_in_account_currency")
|
||||||
|
),
|
||||||
|
"credit_in_account_currency": flt(
|
||||||
|
credit / d.exchange_rate, d.precision("credit_in_account_currency")
|
||||||
|
),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
gl_map.append(gl_dict)
|
||||||
|
|
||||||
return gl_map
|
return gl_map
|
||||||
|
|
||||||
|
def get_transaction_currency_map(self):
|
||||||
|
transaction_currency_map = {}
|
||||||
|
for account in self.get("accounts"):
|
||||||
|
transaction_currency_map.setdefault(account.party or account.account, account.account_currency)
|
||||||
|
|
||||||
|
return transaction_currency_map
|
||||||
|
|
||||||
|
def get_conversion_rate_map(self):
|
||||||
|
conversion_rate_map = {}
|
||||||
|
for account in self.get("accounts"):
|
||||||
|
conversion_rate_map.setdefault(account.party or account.account, account.exchange_rate)
|
||||||
|
|
||||||
|
return conversion_rate_map
|
||||||
|
|
||||||
def make_gl_entries(self, cancel=0, adv_adj=0):
|
def make_gl_entries(self, cancel=0, adv_adj=0):
|
||||||
from erpnext.accounts.general_ledger import make_gl_entries
|
from erpnext.accounts.general_ledger import make_gl_entries
|
||||||
|
|
||||||
@@ -1551,3 +1755,10 @@ def make_reverse_journal_entry(source_name, target_doc=None):
|
|||||||
)
|
)
|
||||||
|
|
||||||
return doclist
|
return doclist
|
||||||
|
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def get_against_type(doctype, txt, searchfield, start, page_len, filters):
|
||||||
|
against_types = frappe.db.get_list("Party Type", pluck="name") + ["Account"]
|
||||||
|
doctype = frappe.qb.DocType("DocType")
|
||||||
|
return frappe.qb.from_(doctype).select(doctype.name).where(doctype.name.isin(against_types)).run()
|
||||||
|
|||||||
@@ -1,97 +1,94 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"cheque_date": "2013-03-14",
|
"cheque_date": "2013-03-14",
|
||||||
"cheque_no": "33",
|
"cheque_no": "33",
|
||||||
"company": "_Test Company",
|
"company": "_Test Company",
|
||||||
"doctype": "Journal Entry",
|
"doctype": "Journal Entry",
|
||||||
"accounts": [
|
"accounts": [
|
||||||
{
|
{
|
||||||
"account": "Debtors - _TC",
|
"account": "Debtors - _TC",
|
||||||
"party_type": "Customer",
|
"party_type": "Customer",
|
||||||
"party": "_Test Customer",
|
"party": "_Test Customer",
|
||||||
"credit_in_account_currency": 400.0,
|
"credit_in_account_currency": 400.0,
|
||||||
"debit_in_account_currency": 0.0,
|
"debit_in_account_currency": 0.0,
|
||||||
"doctype": "Journal Entry Account",
|
"doctype": "Journal Entry Account",
|
||||||
"parentfield": "accounts",
|
"parentfield": "accounts",
|
||||||
"cost_center": "_Test Cost Center - _TC"
|
"cost_center": "_Test Cost Center - _TC"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"account": "_Test Bank - _TC",
|
"account": "_Test Bank - _TC",
|
||||||
"credit_in_account_currency": 0.0,
|
"credit_in_account_currency": 0.0,
|
||||||
"debit_in_account_currency": 400.0,
|
"debit_in_account_currency": 400.0,
|
||||||
"doctype": "Journal Entry Account",
|
"doctype": "Journal Entry Account",
|
||||||
"parentfield": "accounts",
|
"parentfield": "accounts",
|
||||||
"cost_center": "_Test Cost Center - _TC"
|
"cost_center": "_Test Cost Center - _TC"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"naming_series": "_T-Journal Entry-",
|
"naming_series": "_T-Journal Entry-",
|
||||||
"posting_date": "2013-02-14",
|
"posting_date": "2013-02-14",
|
||||||
"user_remark": "test",
|
"user_remark": "test",
|
||||||
"voucher_type": "Bank Entry"
|
"voucher_type": "Bank Entry"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
{
|
"cheque_date": "2013-02-14",
|
||||||
"cheque_date": "2013-02-14",
|
"cheque_no": "33",
|
||||||
"cheque_no": "33",
|
"company": "_Test Company",
|
||||||
"company": "_Test Company",
|
"doctype": "Journal Entry",
|
||||||
"doctype": "Journal Entry",
|
"accounts": [
|
||||||
"accounts": [
|
{
|
||||||
{
|
"account": "_Test Payable - _TC",
|
||||||
"account": "_Test Payable - _TC",
|
"party_type": "Supplier",
|
||||||
"party_type": "Supplier",
|
"party": "_Test Supplier",
|
||||||
"party": "_Test Supplier",
|
"credit_in_account_currency": 0.0,
|
||||||
"credit_in_account_currency": 0.0,
|
"debit_in_account_currency": 400.0,
|
||||||
"debit_in_account_currency": 400.0,
|
"doctype": "Journal Entry Account",
|
||||||
"doctype": "Journal Entry Account",
|
"parentfield": "accounts",
|
||||||
"parentfield": "accounts",
|
"cost_center": "_Test Cost Center - _TC"
|
||||||
"cost_center": "_Test Cost Center - _TC"
|
},
|
||||||
},
|
{
|
||||||
{
|
"account": "_Test Bank - _TC",
|
||||||
"account": "_Test Bank - _TC",
|
"credit_in_account_currency": 400.0,
|
||||||
"credit_in_account_currency": 400.0,
|
"debit_in_account_currency": 0.0,
|
||||||
"debit_in_account_currency": 0.0,
|
"doctype": "Journal Entry Account",
|
||||||
"doctype": "Journal Entry Account",
|
"parentfield": "accounts",
|
||||||
"parentfield": "accounts",
|
"cost_center": "_Test Cost Center - _TC"
|
||||||
"cost_center": "_Test Cost Center - _TC"
|
}
|
||||||
}
|
],
|
||||||
],
|
"naming_series": "_T-Journal Entry-",
|
||||||
"naming_series": "_T-Journal Entry-",
|
"posting_date": "2013-02-14",
|
||||||
"posting_date": "2013-02-14",
|
"user_remark": "test",
|
||||||
"user_remark": "test",
|
"voucher_type": "Bank Entry"
|
||||||
"voucher_type": "Bank Entry"
|
},
|
||||||
},
|
|
||||||
|
{
|
||||||
|
"cheque_date": "2013-02-14",
|
||||||
{
|
"cheque_no": "33",
|
||||||
"cheque_date": "2013-02-14",
|
"company": "_Test Company",
|
||||||
"cheque_no": "33",
|
"doctype": "Journal Entry",
|
||||||
"company": "_Test Company",
|
"accounts": [
|
||||||
"doctype": "Journal Entry",
|
{
|
||||||
"accounts": [
|
"account": "Debtors - _TC",
|
||||||
{
|
"party_type": "Customer",
|
||||||
"account": "Debtors - _TC",
|
"party": "_Test Customer",
|
||||||
"party_type": "Customer",
|
"credit_in_account_currency": 0.0,
|
||||||
"party": "_Test Customer",
|
"debit_in_account_currency": 400.0,
|
||||||
"credit_in_account_currency": 0.0,
|
"doctype": "Journal Entry Account",
|
||||||
"debit_in_account_currency": 400.0,
|
"parentfield": "accounts",
|
||||||
"doctype": "Journal Entry Account",
|
"cost_center": "_Test Cost Center - _TC"
|
||||||
"parentfield": "accounts",
|
},
|
||||||
"cost_center": "_Test Cost Center - _TC"
|
{
|
||||||
},
|
"account": "Sales - _TC",
|
||||||
{
|
"credit_in_account_currency": 400.0,
|
||||||
"account": "Sales - _TC",
|
"debit_in_account_currency": 0.0,
|
||||||
"cost_center": "_Test Cost Center - _TC",
|
"doctype": "Journal Entry Account",
|
||||||
"credit_in_account_currency": 400.0,
|
"parentfield": "accounts",
|
||||||
"debit_in_account_currency": 0.0,
|
"cost_center": "_Test Cost Center - _TC"
|
||||||
"doctype": "Journal Entry Account",
|
}
|
||||||
"parentfield": "accounts",
|
],
|
||||||
"cost_center": "_Test Cost Center - _TC"
|
"naming_series": "_T-Journal Entry-",
|
||||||
}
|
"posting_date": "2013-02-14",
|
||||||
],
|
"user_remark": "test",
|
||||||
"naming_series": "_T-Journal Entry-",
|
"voucher_type": "Bank Entry"
|
||||||
"posting_date": "2013-02-14",
|
}
|
||||||
"user_remark": "test",
|
|
||||||
"voucher_type": "Bank Entry"
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -37,7 +37,9 @@
|
|||||||
"col_break3",
|
"col_break3",
|
||||||
"is_advance",
|
"is_advance",
|
||||||
"user_remark",
|
"user_remark",
|
||||||
"against_account"
|
"against_type",
|
||||||
|
"against_account",
|
||||||
|
"against_account_link"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
@@ -203,7 +205,8 @@
|
|||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"label": "Reference Type",
|
"label": "Reference Type",
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"options": "\nSales Invoice\nPurchase Invoice\nJournal Entry\nSales Order\nPurchase Order\nExpense Claim\nAsset\nLoan\nPayroll Entry\nEmployee Advance\nExchange Rate Revaluation\nInvoice Discounting\nFees\nFull and Final Statement\nPayment Entry"
|
"options": "\nSales Invoice\nPurchase Invoice\nJournal Entry\nSales Order\nPurchase Order\nExpense Claim\nAsset\nLoan\nPayroll Entry\nEmployee Advance\nExchange Rate Revaluation\nInvoice Discounting\nFees\nFull and Final Statement\nPayment Entry",
|
||||||
|
"search_index": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "reference_name",
|
"fieldname": "reference_name",
|
||||||
@@ -211,7 +214,8 @@
|
|||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Reference Name",
|
"label": "Reference Name",
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"options": "reference_type"
|
"options": "reference_type",
|
||||||
|
"search_index": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"depends_on": "eval:doc.reference_type&&!in_list(doc.reference_type, ['Expense Claim', 'Asset', 'Employee Loan', 'Employee Advance'])",
|
"depends_on": "eval:doc.reference_type&&!in_list(doc.reference_type, ['Expense Claim', 'Asset', 'Employee Loan', 'Employee Advance'])",
|
||||||
@@ -248,14 +252,21 @@
|
|||||||
"print_hide": 1
|
"print_hide": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "against_account",
|
"fieldname": "against_account",
|
||||||
"fieldtype": "Text",
|
"fieldtype": "Text",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
|
"label": "Against Account",
|
||||||
|
"no_copy": 1,
|
||||||
|
"oldfieldname": "against_account",
|
||||||
|
"oldfieldtype": "Text",
|
||||||
|
"print_hide": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "against_account_link",
|
||||||
|
"fieldtype": "Dynamic Link",
|
||||||
"label": "Against Account",
|
"label": "Against Account",
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"oldfieldname": "against_account",
|
"options": "against_type"
|
||||||
"oldfieldtype": "Text",
|
|
||||||
"print_hide": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
@@ -279,12 +290,18 @@
|
|||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
"label": "Reference Detail No",
|
"label": "Reference Detail No",
|
||||||
"no_copy": 1
|
"no_copy": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "against_type",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Against Type",
|
||||||
|
"options": "DocType"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-06-16 14:11:13.507807",
|
"modified": "2023-12-02 23:21:22.205409",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Journal Entry Account",
|
"name": "Journal Entry Account",
|
||||||
|
|||||||
@@ -6,4 +6,56 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class JournalEntryAccount(Document):
|
class JournalEntryAccount(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link
|
||||||
|
account_currency: DF.Link | None
|
||||||
|
account_type: DF.Data | None
|
||||||
|
against_account: DF.Text | None
|
||||||
|
balance: DF.Currency
|
||||||
|
bank_account: DF.Link | None
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
credit: DF.Currency
|
||||||
|
credit_in_account_currency: DF.Currency
|
||||||
|
debit: DF.Currency
|
||||||
|
debit_in_account_currency: DF.Currency
|
||||||
|
exchange_rate: DF.Float
|
||||||
|
is_advance: DF.Literal["No", "Yes"]
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
party: DF.DynamicLink | None
|
||||||
|
party_balance: DF.Currency
|
||||||
|
party_type: DF.Link | None
|
||||||
|
project: DF.Link | None
|
||||||
|
reference_detail_no: DF.Data | None
|
||||||
|
reference_due_date: DF.Date | None
|
||||||
|
reference_name: DF.DynamicLink | None
|
||||||
|
reference_type: DF.Literal[
|
||||||
|
"",
|
||||||
|
"Sales Invoice",
|
||||||
|
"Purchase Invoice",
|
||||||
|
"Journal Entry",
|
||||||
|
"Sales Order",
|
||||||
|
"Purchase Order",
|
||||||
|
"Expense Claim",
|
||||||
|
"Asset",
|
||||||
|
"Loan",
|
||||||
|
"Payroll Entry",
|
||||||
|
"Employee Advance",
|
||||||
|
"Exchange Rate Revaluation",
|
||||||
|
"Invoice Discounting",
|
||||||
|
"Fees",
|
||||||
|
"Full and Final Statement",
|
||||||
|
"Payment Entry",
|
||||||
|
]
|
||||||
|
user_remark: DF.SmallText | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -7,6 +7,41 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class JournalEntryTemplate(Document):
|
class JournalEntryTemplate(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.journal_entry_template_account.journal_entry_template_account import (
|
||||||
|
JournalEntryTemplateAccount,
|
||||||
|
)
|
||||||
|
|
||||||
|
accounts: DF.Table[JournalEntryTemplateAccount]
|
||||||
|
company: DF.Link
|
||||||
|
is_opening: DF.Literal["No", "Yes"]
|
||||||
|
multi_currency: DF.Check
|
||||||
|
naming_series: DF.Literal
|
||||||
|
template_title: DF.Data
|
||||||
|
voucher_type: DF.Literal[
|
||||||
|
"Journal Entry",
|
||||||
|
"Inter Company Journal Entry",
|
||||||
|
"Bank Entry",
|
||||||
|
"Cash Entry",
|
||||||
|
"Credit Card Entry",
|
||||||
|
"Debit Note",
|
||||||
|
"Credit Note",
|
||||||
|
"Contra Entry",
|
||||||
|
"Excise Entry",
|
||||||
|
"Write Off Entry",
|
||||||
|
"Opening Entry",
|
||||||
|
"Depreciation Entry",
|
||||||
|
"Exchange Rate Revaluation",
|
||||||
|
]
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user