Compare commits

...

1960 Commits

Author SHA1 Message Date
Frappe PR Bot
eb723637d3 chore(release): Bumped to Version 14.25.1
## [14.25.1](https://github.com/frappe/erpnext/compare/v14.25.0...v14.25.1) (2023-05-25)

### Bug Fixes

* Negative value in Reserved Qty for Production Plan ([20ceb6c](20ceb6c617))
2023-05-25 06:54:14 +00:00
rohitwaghchaure
aba322e086 Merge pull request #35414 from frappe/mergify/bp/version-14/pr-35411
fix: Negative value in Reserved Qty for Production Plan (backport #35410) (backport #35411)
2023-05-25 12:21:59 +05:30
Rohit Waghchaure
20ceb6c617 fix: Negative value in Reserved Qty for Production Plan
(cherry picked from commit a37608a36c)
(cherry picked from commit 6fe42c937c)
2023-05-25 04:37:18 +00:00
Frappe PR Bot
cd3991dd14 chore(release): Bumped to Version 14.25.0
# [14.25.0](https://github.com/frappe/erpnext/compare/v14.24.3...v14.25.0) (2023-05-24)

### Bug Fixes

* consider 0 if rate/qty are null (backport [#35338](https://github.com/frappe/erpnext/issues/35338)) ([#35340](https://github.com/frappe/erpnext/issues/35340)) ([15c1af3](15c1af3d8a))
* Creating landed cost voucher from connections ([2631224](2631224e49))
* depreciation schedule for existing assets [v14] ([#35255](https://github.com/frappe/erpnext/issues/35255)) ([0a080ef](0a080efce2))
* don't recalculate rate for SCR rejected warehouse SLE ([633a170](633a1703dc))
* error while saving job card ([fb7d3b7](fb7d3b7878))
* incorrect depr schedule and posting dates on selling of existing assets [v14] ([#35396](https://github.com/frappe/erpnext/issues/35396)) ([8af6a11](8af6a113d1))
* Pick List Status ([4888436](48884366ea))
* Pick List TypeError ([6df9b53](6df9b53682))
* possible type error on quotation -> sales order creation ([d23b93a](d23b93a462))
* replace quotation with invoice in first onboarding (backport [#35389](https://github.com/frappe/erpnext/issues/35389)) ([#35394](https://github.com/frappe/erpnext/issues/35394)) ([9b9772e](9b9772eb14))
* tds incorrectly calculated for invoice that are below threshold ([bdf81a4](bdf81a43c6))
* **test:** cumulative threshold checks ([879946e](879946e2c8))
* use flt instead of mandatory field ([668b092](668b092f6b))
* **ux:** SCR consumed-qty read-only property ([aa7fede](aa7fede0dc))

### Features

* provision to make reposting entries from Stock and Account Value Comparison Report ([3a0cdf3](3a0cdf30ce))
* provision to skip available sub assembly items in the production plan ([ce601af](ce601afc4e))
2023-05-24 03:05:06 +00:00
Deepesh Garg
e586c07bdd Merge pull request #35392 from frappe/version-14-hotfix
chore: release v14
2023-05-24 08:31:31 +05:30
Anand Baburajan
8af6a113d1 fix: incorrect depr schedule and posting dates on selling of existing assets [v14] (#35396)
* fix: use date in asset get gl entries functions

* fix: calc depr amount properly on selling of existing assets

* fix: calc depr amount properly on selling of existing assets again

* chore: remove unnecessary line breaks
2023-05-23 23:04:04 +05:30
mergify[bot]
9b9772eb14 fix: replace quotation with invoice in first onboarding (backport #35389) (#35394)
fix: replace quotation with invoice in first onboarding (#35389)

(cherry picked from commit b0eb72ffac)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-05-23 15:36:56 +05:30
Sagar Sharma
88ecc933f7 Merge pull request #35390 from frappe/mergify/bp/version-14-hotfix/pr-35303
fix: Pick List TypeError (backport #35303)
2023-05-23 15:06:05 +05:30
Sagar Sharma
6df9b53682 fix: Pick List TypeError
(cherry picked from commit a111917114)
2023-05-23 08:51:32 +00:00
rohitwaghchaure
47e97e0b3d Merge pull request #35382 from frappe/mergify/bp/version-14-hotfix/pr-35381
feat: provision to skip available sub assembly items in the production plan (backport #35381)
2023-05-23 12:29:18 +05:30
Sagar Sharma
fec6e3724e Merge pull request #35383 from frappe/mergify/bp/version-14-hotfix/pr-35380
fix: TypeError while saving Job card (backport #35380)
2023-05-23 10:52:00 +05:30
vishnu
668b092f6b fix: use flt instead of mandatory field
(cherry picked from commit 8c34cc0e00)
2023-05-23 05:20:22 +00:00
vishnu
fb7d3b7878 fix: error while saving job card
(cherry picked from commit a209fb4b64)
2023-05-23 05:20:22 +00:00
Rohit Waghchaure
f6857b4698 test: test case to skip available qty for sub-assembly items
(cherry picked from commit 9dd566c1e8)
2023-05-23 04:09:40 +00:00
Rohit Waghchaure
ce601afc4e feat: provision to skip available sub assembly items in the production plan
(cherry picked from commit 64751ec4d9)
2023-05-23 04:09:40 +00:00
Sagar Sharma
1b827f61f7 Merge pull request #35377 from frappe/mergify/bp/version-14-hotfix/pr-35376
fix: don't recalculate rate for SCR rejected warehouse SLE (backport #35376)
2023-05-22 16:08:25 +05:30
Sagar Sharma
633a1703dc fix: don't recalculate rate for SCR rejected warehouse SLE
(cherry picked from commit 57ee473fa4)
2023-05-22 10:16:09 +00:00
Ankush Menat
abfd975eb6 chore: drop outdated navigation video
new stuff is in work, this one is actually counter-productive rn.

(cherry picked from commit ba61865ee6)
2023-05-20 19:47:17 +05:30
rohitwaghchaure
9106b01c04 Merge pull request #35368 from frappe/mergify/bp/version-14-hotfix/pr-35365
feat: provision to make reposting entries from Stock and Account Value Comparison Report (backport #35365)
2023-05-20 18:31:00 +05:30
Rohit Waghchaure
3a0cdf30ce feat: provision to make reposting entries from Stock and Account Value Comparison Report
(cherry picked from commit 7b818e9d34)
2023-05-20 11:37:02 +00:00
Frappe PR Bot
756ac6c587 chore(release): Bumped to Version 14.24.3
## [14.24.3](https://github.com/frappe/erpnext/compare/v14.24.2...v14.24.3) (2023-05-18)

### Bug Fixes

* tds incorrectly calculated for invoice that are below threshold ([14565ed](14565ed8b1))
* **test:** cumulative threshold checks ([cdd378c](cdd378c518))
2023-05-18 14:07:04 +00:00
ruthra kumar
b5b1b2da32 Merge pull request #35359 from frappe/mergify/bp/version-14/pr-35335
fix: tds incorrectly calculated for invoice that are below threshold (backport #35335)
2023-05-18 19:35:11 +05:30
ruthra kumar
cdd378c518 fix(test): cumulative threshold checks
(cherry picked from commit 132846bbd1)
2023-05-18 13:30:03 +00:00
ruthra kumar
14565ed8b1 fix: tds incorrectly calculated for invoice that are below threshold
Two purchase invoices for the same supplier, using different tax
withholding categories have this issue.

| Category | single | cumulative |
|----------+--------+------------|
| cat1     |    100 |        500 |
| cat2     |   1000 |       5000 |

1. PINV1 of net total: 105/- uses cat1. TDS is calculated as it
breached single threshold
2. PINV2 of net total: 200/- uses cat2. TDS incorrectly calculated as
PINV1 already has TDS calculated and 'consider_party_ledger_amount' is enabled.

(cherry picked from commit 84b7c1bba0)
2023-05-18 13:30:02 +00:00
ruthra kumar
44b290f58e Merge pull request #35357 from frappe/mergify/bp/version-14-hotfix/pr-35355
fix: possible type error on quotation -> sales order creation (backport #35355)
2023-05-18 14:35:53 +05:30
ruthra kumar
d23b93a462 fix: possible type error on quotation -> sales order creation
(cherry picked from commit b2290c6f57)
2023-05-18 13:39:58 +05:30
ruthra kumar
80f4a11d60 Merge pull request #35353 from frappe/mergify/bp/version-14-hotfix/pr-35335
fix: tds incorrectly calculated for invoice that are below threshold (backport #35335)
2023-05-18 13:03:40 +05:30
Sagar Sharma
9caa39195c Merge pull request #35344 from frappe/mergify/bp/version-14-hotfix/pr-35306
fix: Pick List Status (backport #35306)
2023-05-18 12:52:25 +05:30
ruthra kumar
879946e2c8 fix(test): cumulative threshold checks
(cherry picked from commit 132846bbd1)
2023-05-18 07:09:20 +00:00
ruthra kumar
bdf81a43c6 fix: tds incorrectly calculated for invoice that are below threshold
Two purchase invoices for the same supplier, using different tax
withholding categories have this issue.

| Category | single | cumulative |
|----------+--------+------------|
| cat1     |    100 |        500 |
| cat2     |   1000 |       5000 |

1. PINV1 of net total: 105/- uses cat1. TDS is calculated as it
breached single threshold
2. PINV2 of net total: 200/- uses cat2. TDS incorrectly calculated as
PINV1 already has TDS calculated and 'consider_party_ledger_amount' is enabled.

(cherry picked from commit 84b7c1bba0)
2023-05-18 07:09:19 +00:00
Sagar Sharma
cb681e0b96 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-35306 2023-05-18 12:30:40 +05:30
ruthra kumar
65554bdabf Merge pull request #35336 from frappe/mergify/bp/version-14-hotfix/pr-35239
fix: in payment_entry  difference amount cal is broken (backport #35239)
2023-05-18 12:15:44 +05:30
rohitwaghchaure
0d2d45f32f Merge pull request #35351 from frappe/mergify/bp/version-14-hotfix/pr-35298
fix: Creating landed cost voucher from connections (backport #35298)
2023-05-18 06:16:11 +05:30
vishnu
2631224e49 fix: Creating landed cost voucher from connections
(cherry picked from commit f2ceb00379)
2023-05-18 00:43:36 +00:00
Anand Baburajan
0a080efce2 fix: depreciation schedule for existing assets [v14] (#35255)
* fix: depreciation schedule for existing assets

* chore: correct logic for existing assets and fix test
2023-05-17 22:21:00 +05:30
Sagar Sharma
48884366ea fix: Pick List Status
(cherry picked from commit 9fb8b1827d)
2023-05-17 12:43:08 +00:00
mergify[bot]
15c1af3d8a fix: consider 0 if rate/qty are null (backport #35338) (#35340)
fix: consider 0 if rate/qty are null (#35338)

[skip ci]

(cherry picked from commit e5c86bc2e8)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-05-17 16:17:21 +05:30
Sagar Sharma
350f75877a Merge pull request #35339 from frappe/mergify/bp/version-14-hotfix/pr-35337
fix(ux): SCR consumed-qty read-only property (backport #35337)
2023-05-17 15:58:29 +05:30
Sagar Sharma
aa7fede0dc fix(ux): SCR consumed-qty read-only property
(cherry picked from commit adf2474d9d)
2023-05-17 10:28:03 +00:00
Ashish Shah
e9f2ab5caf refactor: use 'flt' for base_total_taxes_and_charges
difference_amount calculation is broken, as calculation gives NaN. Fix is make frm.doc.base_total_taxes_and_charges as flt(frm.doc.base_total_taxes_and_charges)

(cherry picked from commit ae4e56747c)
2023-05-17 09:40:55 +00:00
Frappe PR Bot
7076c23a4f chore(release): Bumped to Version 14.24.2
## [14.24.2](https://github.com/frappe/erpnext/compare/v14.24.1...v14.24.2) (2023-05-16)

### Bug Fixes

* add missing options for `Content Align` ([3697e8f](3697e8f1f9))
* allow over-payment against SO ([#35079](https://github.com/frappe/erpnext/issues/35079)) ([fe9e0c2](fe9e0c2121))
* bad strings format for command get-untraslated  ([#34361](https://github.com/frappe/erpnext/issues/34361)) ([5a54296](5a54296686))
* bad strings format for update-translations ([#34592](https://github.com/frappe/erpnext/issues/34592)) ([e3c1d73](e3c1d736ce))
* bom item filter issue ([098603d](098603dd35))
* cancelled vouchers in tax withheld vouchers list ([#35309](https://github.com/frappe/erpnext/issues/35309)) ([c41e1d7](c41e1d7d71))
* enqueue submit/cancel action for stock entry to avoid time out error ([457846e](457846e34c))
* force to do reposting for cancelled document ([6f96e5d](6f96e5dcd4))
* function `batch_no` should only be declared once ([#35115](https://github.com/frappe/erpnext/issues/35115)) ([26928b3](26928b395b))
* incorrect packing items ([ab56470](ab56470171))
* inventory dimension for inter company transfer return use case ([6d121b8](6d121b8107))
* inventory dimension for material transfer not working ([1d8050d](1d8050d24d))
* item list view not working ([d9efa66](d9efa662d4))
* port option for additional_conditions in item wise sales register ([#35187](https://github.com/frappe/erpnext/issues/35187)) ([42037f9](42037f9f73))
* recalculate costs in SCR while reposting ([9a8ee62](9a8ee62d5a))
* sales person allocated amount calculation error nonetype and float ([#35293](https://github.com/frappe/erpnext/issues/35293)) ([3a7c69f](3a7c69fc71))
* test case ([3f8928b](3f8928be5c))
* test case ([9b2b467](9b2b46737e))
* typo ([2772a91](2772a911ed))
* unable to create partial invoice with auto fetch terms enabled ([#35285](https://github.com/frappe/erpnext/issues/35285)) ([fa9fa97](fa9fa97e05))
* update workstation hour rate when workstation change in job card ([bc88415](bc88415e73))
* **UX:** misc "home" onboarding improvements (backport [#35319](https://github.com/frappe/erpnext/issues/35319)) ([#35321](https://github.com/frappe/erpnext/issues/35321)) ([f8c58b6](f8c58b6893))
* validate for active sla ([#32132](https://github.com/frappe/erpnext/issues/32132)) ([38e27a6](38e27a68d5))

### Performance Improvements

* cache and simplify queries for holiday list (backport [#35315](https://github.com/frappe/erpnext/issues/35315)) ([#35318](https://github.com/frappe/erpnext/issues/35318)) ([0e78403](0e7840301f))
2023-05-16 17:00:00 +00:00
Deepesh Garg
bdfd682664 Merge pull request #35324 from frappe/version-14-hotfix
chore: release v14
2023-05-16 22:28:33 +05:30
mergify[bot]
fa9fa97e05 fix: unable to create partial invoice with auto fetch terms enabled (#35285)
fix: unable to create partial invoice with auto fetch terms enabled (#35285)

fix: fetch so/po terms if auto fetch is enabled
(cherry picked from commit 0da6c1688b)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-05-16 18:59:12 +05:30
mergify[bot]
c41e1d7d71 fix: cancelled vouchers in tax withheld vouchers list (#35309)
fix: cancelled vouchers in tax withheld vouchers list (#35309)

(cherry picked from commit 776a83066d)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-05-16 18:58:04 +05:30
rohitwaghchaure
8f8c0a597b Merge pull request #35329 from frappe/mergify/bp/version-14-hotfix/pr-35328
fix: force to do reposting for cancelled document (backport #35328)
2023-05-16 18:53:33 +05:30
Rohit Waghchaure
6f96e5dcd4 fix: force to do reposting for cancelled document
(cherry picked from commit 6e661e7c0e)
2023-05-16 12:03:43 +00:00
mergify[bot]
f8c58b6893 fix(UX): misc "home" onboarding improvements (backport #35319) (#35321)
fix(UX): misc "home" onboarding improvements (#35319)

* fix(UX): cleanup "Home" onboarding

- Remove company, letterhead, data import etc from home onboarding step

* fix(UX): Show quick entry for item

* chore: fix copy here and there

(cherry picked from commit 5574d9a72d)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-05-16 16:00:25 +05:30
mergify[bot]
0e7840301f perf: cache and simplify queries for holiday list (backport #35315) (#35318)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2023-05-16 13:44:35 +05:30
rohitwaghchaure
19f08afcef Merge pull request #35314 from frappe/mergify/bp/version-14-hotfix/pr-35312
fix: item list view not working (backport #35312)
2023-05-16 11:10:18 +05:30
mergify[bot]
42037f9f73 fix: port option for additional_conditions in item wise sales register (#35187)
fix: port option for additional_conditions in item wise sales register (#35187)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 2a609616d9)

Co-authored-by: Smit Vora <smitvora203@gmail.com>
2023-05-16 07:29:48 +05:30
Rohit Waghchaure
d9efa662d4 fix: item list view not working
(cherry picked from commit 0489e30244)
2023-05-15 19:40:23 +00:00
rohitwaghchaure
ee147e62d5 Merge pull request #35311 from CodeVenturers/version-14-hotfix
fix: update workstation hour rate when workstation change in job card
2023-05-16 00:44:26 +05:30
vishnu
bc88415e73 fix: update workstation hour rate when workstation change in job card 2023-05-15 14:50:40 +00:00
Sagar Sharma
5463f0b137 Merge pull request #35308 from frappe/mergify/bp/version-14-hotfix/pr-35138
fix: recalculate costs in SCR while reposting (backport #35138)
2023-05-15 17:14:57 +05:30
Sagar Sharma
a8fc17e0ae refactor: use calculate_items_qty_and_amount() to update scr items rate
(cherry picked from commit 9c72c2a6cb)
2023-05-15 10:56:51 +00:00
Sagar Sharma
0575b105d0 refactor(minor): rename function to be more descriptive
(cherry picked from commit d6433f803b)
2023-05-15 10:56:51 +00:00
Sagar Sharma
4c8dbeddec test: add test case
(cherry picked from commit e0b22edb2e)
2023-05-15 10:56:51 +00:00
s-aga-r
9a8ee62d5a fix: recalculate costs in SCR while reposting
(cherry picked from commit a6cb6c6f47)
2023-05-15 10:56:50 +00:00
mergify[bot]
3a7c69fc71 fix: sales person allocated amount calculation error nonetype and float (#35293)
fix: sales person allocated amount calculation error nonetype and float (#35293)

fix: sales person allocated amount calculation error nontype and float
(cherry picked from commit 0c8276ec82)

Co-authored-by: Indrajith.vs <91895505+Gubbu77@users.noreply.github.com>
2023-05-15 13:16:47 +05:30
rohitwaghchaure
dd116a3071 Merge pull request #35291 from frappe/mergify/bp/version-14-hotfix/pr-35289
fix: inventory dimension for returned inter company transfer (backport #35289)
2023-05-14 16:29:34 +05:30
rohitwaghchaure
3f8928be5c fix: test case 2023-05-14 15:49:58 +05:30
mergify[bot]
26928b395b fix: function batch_no should only be declared once (#35115)
fix: function `batch_no` should only be declared once (#35115)

fix: remove twice event call of `batch_no` to update batch qty
(cherry picked from commit 19cd687784)

Co-authored-by: Daizy Modi <modidaizy5217@gmail.com>
2023-05-14 11:54:15 +05:30
mergify[bot]
fe9e0c2121 fix: allow over-payment against SO (#35079)
fix: allow over-payment against SO (#35079)

(cherry picked from commit 870b02b03c)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-05-14 11:44:50 +05:30
Deepesh Garg
77cf2e5475 Merge pull request #35262 from akiratfli/fix-bad-string
fix: bad strings format for translations
2023-05-14 08:06:24 +05:30
rohitwaghchaure
2772a911ed fix: typo 2023-05-13 15:14:41 +05:30
Rohit Waghchaure
6d121b8107 fix: inventory dimension for inter company transfer return use case
(cherry picked from commit 38aaba5720)
2023-05-13 08:57:03 +00:00
Sagar Sharma
c30dda3328 Merge pull request #35283 from frappe/mergify/bp/version-14-hotfix/pr-35275
fix: add missing options for `Content Align` (backport #35275)
2023-05-13 09:42:20 +05:30
Sagar Sharma
b2e6fdc0cb Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-35275 2023-05-13 09:41:30 +05:30
rohitwaghchaure
75af689f77 Merge pull request #35282 from frappe/mergify/bp/version-14-hotfix/pr-35224
fix: inventory dimension for material transfer not working (backport #35224)
2023-05-13 09:36:42 +05:30
Sagar Sharma
3697e8f1f9 fix: add missing options for Content Align
(cherry picked from commit d16caa2d2c)
2023-05-13 04:05:15 +00:00
Rohit Waghchaure
1d8050d24d fix: inventory dimension for material transfer not working
(cherry picked from commit 6798b900ef)
2023-05-12 20:46:04 +00:00
Frappe PR Bot
897a467846 chore(release): Bumped to Version 14.24.1
## [14.24.1](https://github.com/frappe/erpnext/compare/v14.24.0...v14.24.1) (2023-05-12)

### Bug Fixes

* bom item filter issue ([54e822d](54e822d83a))
* enqueue submit/cancel action for stock entry to avoid time out error ([762a46a](762a46a5e3))
* incorrect packing items ([b02ed0d](b02ed0d9a8))
* test case ([1783594](1783594178))
2023-05-12 10:05:31 +00:00
rohitwaghchaure
f06a8fd01c Merge pull request #35270 from frappe/mergify/bp/version-14/pr-35266
fix: enqueue submit/cancel action for stock entry to avoid time out error (backport #35261) (backport #35266)
2023-05-12 15:30:55 +05:30
rohitwaghchaure
b139ec6ec0 Merge pull request #35271 from frappe/mergify/bp/version-14/pr-35269
fix: BOM item filter issue (backport #35268) (backport #35269)
2023-05-12 15:30:43 +05:30
rohitwaghchaure
e97eaccdfb Merge pull request #35276 from frappe/mergify/bp/version-14/pr-35274
fix: incorrect packing items (backport #35273) (backport #35274)
2023-05-12 15:30:28 +05:30
Rohit Waghchaure
b02ed0d9a8 fix: incorrect packing items
(cherry picked from commit a686b8c337)
(cherry picked from commit ab56470171)
2023-05-12 09:37:12 +00:00
rohitwaghchaure
4206f01c05 Merge pull request #35274 from frappe/mergify/bp/version-14-hotfix/pr-35273
fix: incorrect packing items (backport #35273)
2023-05-12 15:06:25 +05:30
Rohit Waghchaure
ab56470171 fix: incorrect packing items
(cherry picked from commit a686b8c337)
2023-05-12 09:13:52 +00:00
Rohit Waghchaure
54e822d83a fix: bom item filter issue
(cherry picked from commit 2879cb7c28)
(cherry picked from commit 098603dd35)
2023-05-12 07:42:57 +00:00
rohitwaghchaure
8af1e49e96 Merge pull request #35269 from frappe/mergify/bp/version-14-hotfix/pr-35268
fix: BOM item filter issue (backport #35268)
2023-05-12 13:12:11 +05:30
Rohit Waghchaure
1783594178 fix: test case
(cherry picked from commit 2d6f112727)
(cherry picked from commit 9b2b46737e)
2023-05-12 07:41:34 +00:00
Rohit Waghchaure
762a46a5e3 fix: enqueue submit/cancel action for stock entry to avoid time out error
(cherry picked from commit 7a3801578c)
(cherry picked from commit 457846e34c)
2023-05-12 07:41:34 +00:00
rohitwaghchaure
19f0676592 Merge pull request #35266 from frappe/mergify/bp/version-14-hotfix/pr-35261
fix: enqueue submit/cancel action for stock entry to avoid time out error (backport #35261)
2023-05-12 13:10:48 +05:30
Rohit Waghchaure
098603dd35 fix: bom item filter issue
(cherry picked from commit 2879cb7c28)
2023-05-12 07:40:38 +00:00
Rohit Waghchaure
9b2b46737e fix: test case
(cherry picked from commit 2d6f112727)
2023-05-12 07:03:22 +00:00
Rohit Waghchaure
457846e34c fix: enqueue submit/cancel action for stock entry to avoid time out error
(cherry picked from commit 7a3801578c)
2023-05-12 07:03:21 +00:00
Danny
5a54296686 fix: bad strings format for command get-untraslated (#34361)
(cherry picked from commit ca10e2bb9f)
2023-05-12 03:19:01 +00:00
justin.li
e3c1d736ce fix: bad strings format for update-translations (#34592)
(cherry picked from commit 07c9b99072)
2023-05-12 02:21:19 +00:00
Saqib Ansari
c8e3ce48e1 Merge pull request #35257 from frappe/mergify/bp/version-14-hotfix/pr-32132
fix: validate for active sla (backport #32132)
2023-05-11 17:50:00 +05:30
Shadrak Gurupnor
38e27a68d5 fix: validate for active sla (#32132)
(cherry picked from commit f2b7c9ee66)
2023-05-11 12:18:49 +00:00
Frappe PR Bot
e509664d4f chore(release): Bumped to Version 14.24.0
# [14.24.0](https://github.com/frappe/erpnext/compare/v14.23.4...v14.24.0) (2023-05-10)

### Bug Fixes

* added search index to improve performance ([362003e](362003ec5f))
* broken save on empty row existance ([c0f9ff4](c0f9ff4995))
* bypass flag in Customer Group wasn't effective ([c73b76f](c73b76fdb6))
* Changed type of column 'serial_no' in Stock Reconciliation to fix Data too long error ([709f94c](709f94c8d3))
* child acc will inherit acc currency if explicitly specified ([72255fa](72255fae80))
* enabling lead even after "Opportunity" created against it ([#34627](https://github.com/frappe/erpnext/issues/34627)) ([5e98679](5e98679f91))
* error regarding accepted and supplier warehouse ([42f5888](42f5888426))
* fetch default sales team on Quotation -> Sales Order creation ([f42225b](f42225bc82))
* handle empty FBs properly in TB and GL [v14] ([#35189](https://github.com/frappe/erpnext/issues/35189)) ([ed5f39c](ed5f39c2c2))
* incorrect fg item quantity in subcontracted PO ([5c38645](5c38645560))
* internal transfer condition ([f5f4902](f5f4902494))
* non manufacturing items/fixed asset items in BOM ([8133be4](8133be4868))
* not allow to transfer excess materials against the job card ([b0c042d](b0c042de1b))
* over production percentage not considered in validation ([bf6e1b6](bf6e1b67a5))
* pick the in progress reposting entries first ([545f956](545f956160))

### Features

* configuration to notify reposting errors to specific role ([33cd14f](33cd14f859))
* reserve qty against production plan raw materials in BIN ([d1a9117](d1a91177e5))
2023-05-10 05:40:21 +00:00
Deepesh Garg
2fb3659694 Merge pull request #35222 from frappe/version-14-hotfix
chore: release v14
2023-05-10 11:08:42 +05:30
ruthra kumar
1145149f0e Merge pull request #35228 from frappe/mergify/bp/version-14-hotfix/pr-35216
fix: broken save on empty row existance (backport #35216)
2023-05-10 10:11:32 +05:30
rohitwaghchaure
dd20bf931b Merge pull request #35234 from frappe/mergify/bp/version-14-hotfix/pr-35230
fix: Changed type of column 'serial_no' in Stock Reconciliation to fix Data too Long error (backport #35230)
2023-05-09 21:06:14 +05:30
Rohit Waghchaure
709f94c8d3 fix: Changed type of column 'serial_no' in Stock Reconciliation to fix Data too long error
(cherry picked from commit 1a673fd424)
2023-05-09 14:26:13 +00:00
rohitwaghchaure
2933c4f1c5 Merge pull request #35231 from frappe/mergify/bp/version-14-hotfix/pr-35227
fix: non manufacturing items/fixed asset items in BOM (backport #35227)
2023-05-09 19:53:53 +05:30
Rohit Waghchaure
8133be4868 fix: non manufacturing items/fixed asset items in BOM
(cherry picked from commit aba8431d70)
2023-05-09 13:18:47 +00:00
Dany Robert
c0f9ff4995 fix: broken save on empty row existance
(cherry picked from commit d9b231aa16)
2023-05-09 13:02:54 +00:00
rohitwaghchaure
7b6a1e5184 Merge pull request #35221 from frappe/mergify/bp/version-14-hotfix/pr-35220
fix: added search index to improve performance (backport #35220)
2023-05-09 16:04:36 +05:30
Rohit Waghchaure
362003ec5f fix: added search index to improve performance
(cherry picked from commit 80ea22b56c)
2023-05-09 09:05:43 +00:00
ruthra kumar
30e137e9f2 Merge pull request #35214 from frappe/mergify/bp/version-14-hotfix/pr-35212
chore: convert throw to msgprint in payment reconciliation job hook (backport #35212)
2023-05-08 19:07:41 +05:30
ruthra kumar
08a4781de7 chore: convert throw to msgprint
(cherry picked from commit 73134d57bf)
2023-05-08 12:28:01 +00:00
ruthra kumar
14706d4326 Merge pull request #35209 from frappe/mergify/bp/version-14-hotfix/pr-35153
fix: fetch default sales team on Quotation -> Sales Order creation (backport #35153)
2023-05-08 14:51:45 +05:30
ruthra kumar
fd09d1c4c3 Merge pull request #35208 from frappe/mergify/bp/version-14-hotfix/pr-35142
fix: ineffective bypass flag for Credit Limit in Customer Group (backport #35142)
2023-05-08 14:51:29 +05:30
rohitwaghchaure
afbbf26f15 Merge pull request #35202 from frappe/mergify/bp/version-14-hotfix/pr-35196
fix: pick the in progress reposting entries first (backport #35196)
2023-05-08 14:40:10 +05:30
rohitwaghchaure
f83fcf5261 Merge pull request #35203 from frappe/mergify/bp/version-14-hotfix/pr-35200
fix: error regarding accepted and supplier warehouse (backport #35200)
2023-05-08 14:39:52 +05:30
ruthra kumar
5879475a00 Merge pull request #35207 from frappe/mergify/bp/version-14-hotfix/pr-35186
fix: child acc will inherit acc currency if explicitly specified (backport #35186)
2023-05-08 14:35:26 +05:30
ruthra kumar
f42225bc82 fix: fetch default sales team on Quotation -> Sales Order creation
(cherry picked from commit 4d31436917)
2023-05-08 08:50:09 +00:00
ruthra kumar
c73b76fdb6 fix: bypass flag in Customer Group wasn't effective
(cherry picked from commit f9a4972cb6)
2023-05-08 08:41:51 +00:00
ruthra kumar
e451916803 test: currency inheritance on child accounts
(cherry picked from commit f6ea8fd8d7)
2023-05-08 08:40:28 +00:00
ruthra kumar
72255fae80 fix: child acc will inherit acc currency if explicitly specified
(cherry picked from commit abe691c03d)
2023-05-08 08:40:28 +00:00
Rohit Waghchaure
42f5888426 fix: error regarding accepted and supplier warehouse
(cherry picked from commit 15f5f98858)
2023-05-08 03:54:40 +00:00
Rohit Waghchaure
545f956160 fix: pick the in progress reposting entries first
(cherry picked from commit c8a4791d9b)
2023-05-08 03:54:22 +00:00
rohitwaghchaure
1226f3294f Merge pull request #35198 from frappe/mergify/bp/version-14-hotfix/pr-35197
fix: incorrect fg item quantity in subcontracted PO (backport #35197)
2023-05-07 17:05:13 +05:30
Rohit Waghchaure
5c38645560 fix: incorrect fg item quantity in subcontracted PO
(cherry picked from commit af16fbb0a3)
2023-05-06 20:09:31 +00:00
Frappe PR Bot
9a755ca23d chore(release): Bumped to Version 14.23.4
## [14.23.4](https://github.com/frappe/erpnext/compare/v14.23.3...v14.23.4) (2023-05-06)

### Bug Fixes

* handle empty FBs properly in TB and GL [v14] (backport [#35189](https://github.com/frappe/erpnext/issues/35189)) ([#35191](https://github.com/frappe/erpnext/issues/35191)) ([a5a08c9](a5a08c9889))
2023-05-06 11:12:52 +00:00
mergify[bot]
a5a08c9889 fix: handle empty FBs properly in TB and GL [v14] (backport #35189) (#35191)
fix: handle empty FBs properly in TB and GL [v14] (#35189)

fix: handle empty FBs properly in TB and GL
(cherry picked from commit ed5f39c2c2)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-05-06 16:41:10 +05:30
Anand Baburajan
ed5f39c2c2 fix: handle empty FBs properly in TB and GL [v14] (#35189)
fix: handle empty FBs properly in TB and GL
2023-05-06 16:38:59 +05:30
Frappe PR Bot
a1842103b6 chore(release): Bumped to Version 14.23.3
## [14.23.3](https://github.com/frappe/erpnext/compare/v14.23.2...v14.23.3) (2023-05-04)

### Bug Fixes

* internal transfer condition ([736c34e](736c34e61a))
* not allow to transfer excess materials against the job card ([580641f](580641f55c))
2023-05-04 18:02:30 +00:00
rohitwaghchaure
4d54430010 Merge pull request #35174 from frappe/mergify/bp/version-14/pr-35163
fix: internal transfer condition (backport #35158) (backport #35163)
2023-05-04 23:30:29 +05:30
rohitwaghchaure
e855866820 Merge pull request #35175 from frappe/mergify/bp/version-14/pr-35169
fix: not allow to transfer excess materials against the job card (backport #35167) (backport #35169)
2023-05-04 23:30:07 +05:30
Rohit Waghchaure
580641f55c fix: not allow to transfer excess materials against the job card
(cherry picked from commit 8167b24219)
(cherry picked from commit b0c042de1b)
2023-05-04 17:11:54 +00:00
rohitwaghchaure
816ce879f9 Merge pull request #35169 from frappe/mergify/bp/version-14-hotfix/pr-35167
fix: not allow to transfer excess materials against the job card (backport #35167)
2023-05-04 22:41:07 +05:30
Rohit Waghchaure
736c34e61a fix: internal transfer condition
(cherry picked from commit b5a2ccf21d)
(cherry picked from commit f5f4902494)
2023-05-04 17:10:41 +00:00
rohitwaghchaure
f4858fbf8a Merge pull request #35163 from frappe/mergify/bp/version-14-hotfix/pr-35158
fix: internal transfer condition (backport #35158)
2023-05-04 22:39:55 +05:30
Rohit Waghchaure
b0c042de1b fix: not allow to transfer excess materials against the job card
(cherry picked from commit 8167b24219)
2023-05-04 13:41:34 +00:00
rohitwaghchaure
c463df4fd1 Merge pull request #35166 from frappe/mergify/bp/version-14-hotfix/pr-35161
feat: configuration to notify reposting errors to specific role (backport #35161)
2023-05-04 18:46:05 +05:30
Rohit Waghchaure
33cd14f859 feat: configuration to notify reposting errors to specific role
(cherry picked from commit c7b62011db)
2023-05-04 12:06:35 +00:00
Rohit Waghchaure
f5f4902494 fix: internal transfer condition
(cherry picked from commit b5a2ccf21d)
2023-05-04 11:32:45 +00:00
Frappe PR Bot
144594b3e1 chore(release): Bumped to Version 14.23.2
## [14.23.2](https://github.com/frappe/erpnext/compare/v14.23.1...v14.23.2) (2023-05-04)

### Bug Fixes

* over production percentage not considered in validation ([4e83d0b](4e83d0baa6))
2023-05-04 04:54:00 +00:00
rohitwaghchaure
64b416b4dd Merge pull request #35152 from frappe/mergify/bp/version-14/pr-35149
fix: over production percentage not considered in validation (backport #35148) (backport #35149)
2023-05-04 10:22:33 +05:30
Rohit Waghchaure
4e83d0baa6 fix: over production percentage not considered in validation
(cherry picked from commit a84d0af81e)
(cherry picked from commit bf6e1b67a5)
2023-05-04 04:29:28 +00:00
rohitwaghchaure
a01e2ca9ac Merge pull request #35149 from frappe/mergify/bp/version-14-hotfix/pr-35148
fix: over production percentage not considered in validation (backport #35148)
2023-05-04 09:58:43 +05:30
Rohit Waghchaure
bf6e1b67a5 fix: over production percentage not considered in validation
(cherry picked from commit a84d0af81e)
2023-05-03 18:44:32 +00:00
rohitwaghchaure
148342a132 Merge pull request #35147 from frappe/mergify/bp/version-14-hotfix/pr-35144
feat: reserve qty against production plan raw materials in BIN (backport #35144)
2023-05-04 00:00:04 +05:30
Rohit Waghchaure
d1a91177e5 feat: reserve qty against production plan raw materials in BIN
(cherry picked from commit 06e91e758f)
2023-05-03 16:54:53 +00:00
Nabin Hait
8d6034de16 Merge pull request #34647 from frappe/mergify/bp/version-14-hotfix/pr-34627
fix: enabling lead even after "Opportunity" created against it (backport #34627)
2023-05-03 13:27:07 +05:30
Nabin Hait
d306bb080a Update patches.txt 2023-05-03 12:42:36 +05:30
Nabin Hait
eb3e6ff145 Update patches.txt 2023-05-03 12:21:23 +05:30
Nabin Hait
82c3d862ce Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-34627 2023-05-03 11:21:48 +05:30
Frappe PR Bot
5eb5bf7102 chore(release): Bumped to Version 14.23.1
## [14.23.1](https://github.com/frappe/erpnext/compare/v14.23.0...v14.23.1) (2023-05-03)

### Bug Fixes

* conflicts ([3ba2b9e](3ba2b9ed2e))
* don't allow to make reposting for the closed period ([cca2fce](cca2fcec54))
* don't create material request from sales order against the delivered items ([a5489ee](a5489ee2ac))
* handle expected_value_after_useful_life properly in asset value adjustment ([#35117](https://github.com/frappe/erpnext/issues/35117)) ([80230fe](80230fec3e))
* handle finance book properly in trial balance and general ledger [v14] ([#35136](https://github.com/frappe/erpnext/issues/35136)) ([344c339](344c339484))
* Hyperlink in Quality Inspection Summary ([e4ce6fa](e4ce6fa195))
* incorrect paid_amount and exchange rate in PE ([f50b4d8](f50b4d80f1))
* linter issue ([78c34d7](78c34d71e2))
* linter issue ([453249d](453249d868))
* Naming series error in Journal Entry template ([#35084](https://github.com/frappe/erpnext/issues/35084)) ([7021e3a](7021e3adb1))
* not able to create delivery note from sales order ([28dfc13](28dfc13dc6))
* Report link, option, and added a link for Sales Person in GP ([fc611cf](fc611cf86b))
* test case ([35ec125](35ec125b34))
* test case ([6597c74](6597c74d6c))
* test case ([d844a2b](d844a2b990))
* timeout error while submitting delivery note ([e33fb3b](e33fb3b242))
* Updates in process statement of Accounts ([#35064](https://github.com/frappe/erpnext/issues/35064)) ([bef9dd7](bef9dd79e7))
2023-05-03 04:22:30 +00:00
Deepesh Garg
51d9d0a454 Merge pull request #35131 from frappe/version-14-hotfix
chore: release v14
2023-05-03 09:50:51 +05:30
Anand Baburajan
344c339484 fix: handle finance book properly in trial balance and general ledger [v14] (#35136)
fix: handle FBs properly in general ledger and trial balance
2023-05-03 07:11:01 +05:30
mergify[bot]
bef9dd79e7 fix: Updates in process statement of Accounts (#35064)
* fix: Updates in process statement of Accounts (#35064)

(cherry picked from commit ea0b03ae9e)

# Conflicts:
#	erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json

* chore: resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-05-02 23:06:52 +05:30
rohitwaghchaure
815696964a Merge pull request #35121 from frappe/mergify/bp/version-14-hotfix/pr-35118
fix: don't allow to make reposting for the closed period (backport #35118)
2023-05-02 18:02:23 +05:30
ruthra kumar
f0ae02e921 Merge pull request #35132 from frappe/mergify/bp/version-14-hotfix/pr-35107
fix: incorrect paid_amount and exchange rate in Payment Entry (backport #35107)
2023-05-02 15:43:08 +05:30
ruthra kumar
f50b4d80f1 fix: incorrect paid_amount and exchange rate in PE
If Company master has no default cash or bank account set but Party has
default company bank account set. In this case, paid_amount and
conversion rate are not calculated correctly

(cherry picked from commit 123355392b)
2023-05-02 09:39:03 +00:00
ruthra kumar
7ad795bec5 Merge pull request #35129 from frappe/mergify/bp/version-14-hotfix/pr-35091
refactor: button to toggle parent doc cost center preference for rounding adjustment amount (backport #35091)
2023-05-02 15:07:54 +05:30
ruthra kumar
662d9cb5aa Merge pull request #35128 from frappe/mergify/bp/version-14-hotfix/pr-35061
refactor: don't book exchange gain/loss for sales/purchase orders (backport #35061)
2023-05-02 15:07:09 +05:30
ruthra kumar
8ac718d98c refactor: checkbox to toggle parent doc cost center preference
(cherry picked from commit 4ccce93394)
2023-05-02 08:38:13 +00:00
ruthra kumar
3810b02023 refactor: checkbox in Sales Invoice
(cherry picked from commit 0f3b06cc8a)
2023-05-02 08:38:13 +00:00
ruthra kumar
25b37737a2 refactor: checkbox to toggle parent doc cost center preference
(cherry picked from commit ebe6787510)
2023-05-02 08:38:13 +00:00
ruthra kumar
0e39e5e868 refactor: checkbox in purchase invoice
(cherry picked from commit b44331c981)
2023-05-02 08:38:13 +00:00
ruthra kumar
fedde7fe3b test: Sales/Purchase Orders will not book Exchange gain/loss
(cherry picked from commit ce4e18c8d2)
2023-05-02 08:34:53 +00:00
ruthra kumar
551c96e1e5 refactor: don't book exch gain/loss for sales/purchase orders
(cherry picked from commit effb34bbfa)
2023-05-02 08:34:53 +00:00
rohitwaghchaure
78c34d71e2 fix: linter issue 2023-05-02 14:01:26 +05:30
rohitwaghchaure
453249d868 fix: linter issue 2023-05-02 11:08:06 +05:30
rohitwaghchaure
35ec125b34 fix: test case 2023-05-02 11:00:12 +05:30
rohitwaghchaure
2f3ed23a9d Merge pull request #35125 from frappe/mergify/bp/version-14-hotfix/pr-35123
fix: timeout error while submitting delivery note (backport #35123)
2023-05-02 00:00:46 +05:30
rohitwaghchaure
6597c74d6c fix: test case 2023-05-01 23:32:54 +05:30
Rohit Waghchaure
e33fb3b242 fix: timeout error while submitting delivery note
(cherry picked from commit 2d5ccc07b1)
2023-05-01 18:01:02 +00:00
rohitwaghchaure
d844a2b990 fix: test case 2023-05-01 20:49:17 +05:30
rohitwaghchaure
3ba2b9ed2e fix: conflicts 2023-05-01 20:47:12 +05:30
Rohit Waghchaure
cca2fcec54 fix: don't allow to make reposting for the closed period
(cherry picked from commit f751727149)

# Conflicts:
#	erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py
2023-05-01 15:12:01 +00:00
Anand Baburajan
80230fec3e fix: handle expected_value_after_useful_life properly in asset value adjustment (#35117) 2023-05-01 19:53:39 +05:30
mergify[bot]
7021e3adb1 fix: Naming series error in Journal Entry template (#35084)
fix: Naming series error in Journal Entry template (#35084)

(cherry picked from commit f3b3dabb9a)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-05-01 13:02:11 +05:30
rohitwaghchaure
69c0d81c55 Merge pull request #35093 from frappe/mergify/bp/version-14-hotfix/pr-35092
fix: not able to create delivery note from sales order (backport #35092)
2023-04-30 14:54:43 +05:30
Rohit Waghchaure
28dfc13dc6 fix: not able to create delivery note from sales order
(cherry picked from commit bdf2f7416a)
2023-04-28 10:33:23 +00:00
rohitwaghchaure
5f381cd520 Merge pull request #35070 from frappe/mergify/bp/version-14-hotfix/pr-35066
fix: don't create material request from sales order against delivered items (backport #35066)
2023-04-28 16:02:15 +05:30
Sagar Sharma
8571e6c5d2 Merge pull request #35088 from frappe/mergify/bp/version-14-hotfix/pr-35081
fix: Hyperlink in Quality Inspection Summary (backport #35081)
2023-04-28 12:53:45 +05:30
Nihantra Patel
e4ce6fa195 fix: Hyperlink in Quality Inspection Summary
(cherry picked from commit 72dd7884a8)
2023-04-28 07:19:15 +00:00
ruthra kumar
ef3d352a17 Merge pull request #35080 from frappe/mergify/bp/version-14-hotfix/pr-35077
fix: Report link, option, and added a link for Sales Person in GP (backport #35077)
2023-04-27 17:42:30 +05:30
Nihantra Patel
fc611cf86b fix: Report link, option, and added a link for Sales Person in GP
(cherry picked from commit 6dfca79af3)
2023-04-27 11:12:01 +00:00
Rohit Waghchaure
a5489ee2ac fix: don't create material request from sales order against the delivered items
(cherry picked from commit 1e2deee579)
2023-04-27 03:36:23 +00:00
Frappe PR Bot
85f3a5d318 chore(release): Bumped to Version 14.23.0
# [14.23.0](https://github.com/frappe/erpnext/compare/v14.22.3...v14.23.0) (2023-04-25)

### Bug Fixes

* `PermissionError` in Work Order ([a3568c1](a3568c1b27))
* Add company field to lower deduction certificate ([#34914](https://github.com/frappe/erpnext/issues/34914)) ([d732083](d732083166))
* add item-code filter for SCR supplied-items batch-no ([7c4f83e](7c4f83ed60))
* add limit for get_next_stock_reco ([#34937](https://github.com/frappe/erpnext/issues/34937)) ([7131ff2](7131ff28fd))
* added validation for extra job card ([a5fde5d](a5fde5d933))
* batch qty conversion factor issue fixed in pos transaction ([#34917](https://github.com/frappe/erpnext/issues/34917)) ([56ef0ba](56ef0baa9d))
* broken 'set exchange gain/loss' btn in payment entry ([#34940](https://github.com/frappe/erpnext/issues/34940)) ([00968ba](00968badf5))
* Bulk Payment Entry from PO/SO ([#34942](https://github.com/frappe/erpnext/issues/34942)) ([878d747](878d7477bc))
* click handler should not attempt indexed access of empty array ([#35013](https://github.com/frappe/erpnext/issues/35013)) ([06f204a](06f204a8d6))
* Common party JV cost center ([#35008](https://github.com/frappe/erpnext/issues/35008)) ([693007a](693007adfe))
* duplicate reposting entries of same voucher ([aeac43c](aeac43ccf9))
* FEC report for France accountancy  ([#34781](https://github.com/frappe/erpnext/issues/34781)) ([6aabab2](6aabab26d8))
* filtering via batch no ([#34951](https://github.com/frappe/erpnext/issues/34951)) ([3b23fc1](3b23fc1eba)), closes [#34950](https://github.com/frappe/erpnext/issues/34950)
* Incorrect difference value in Stock and Account Value Comparison report ([e7ca833](e7ca833929))
* incorrect OR condition causing timeout error ([c020789](c020789bfc))
* internal Purchase Receipt GL Entries ([f7e436f](f7e436fe71))
* item not showing in the BOM ([28cd79a](28cd79a040))
* pass reference_doctype in link queries (backport [#35038](https://github.com/frappe/erpnext/issues/35038)) ([#35039](https://github.com/frappe/erpnext/issues/35039)) ([5cc3978](5cc3978c16))
* Payment entry with TDS in bank reco statement ([#34961](https://github.com/frappe/erpnext/issues/34961)) ([f43ea0d](f43ea0d6ff))
* per_billed condition for Payment Entry ([#34969](https://github.com/frappe/erpnext/issues/34969)) ([f9f42c7](f9f42c7e98))
* process_loss_percentage in BOM ([4418862](4418862965))
* removed depends on for the Employee Detail section ([9d17d3f](9d17d3ff06))
* respect title_field from doctype to bulk transactions ([#34928](https://github.com/frappe/erpnext/issues/34928)) ([29aa4a0](29aa4a0222))
* set `frappe.flags.company` to call regional code accurately ([789dfd6](789dfd6774))
* simplify `erpnext.get_region` ([87595bd](87595bdb7e))
* SLA permissions (backport [#34981](https://github.com/frappe/erpnext/issues/34981)) ([#34986](https://github.com/frappe/erpnext/issues/34986)) ([83a1b83](83a1b836f9))
* stock entry type issue ([33a1608](33a16086ef))
* **test:** `test_backdated_stock_reco_cancellation_future_negative_stock` ([2ad157b](2ad157bd77))
* **test:** `test_internal_pr_gl_entries` ([7740ceb](7740ceb27e))
* Unable to allocate advance against invoice ([#35007](https://github.com/frappe/erpnext/issues/35007)) ([5045ad6](5045ad6be6))
* use `functools.wraps` to preserve doc signature ([2ec18eb](2ec18eb4cf))
* use CombineDatetime instead of Timestamp in QB queries ([55da91c](55da91cb34))
* use filter_by_finance_book instead of only_depreciable_assets in fixed asset register (backport [#35031](https://github.com/frappe/erpnext/issues/35031)) ([#35035](https://github.com/frappe/erpnext/issues/35035)) ([5630e81](5630e8189b))
* Use set instead of db_set as it is called from validate ([#34967](https://github.com/frappe/erpnext/issues/34967)) ([6650212](665021270f))
* v14, Bank Reconcile Tools not cover case JV debit bank ([#35000](https://github.com/frappe/erpnext/issues/35000)) ([82d8379](82d8379188))
* validation for internal transfer entry ([a582354](a5823547d3))
* value of depreciable assets not updating after manual depr entry [v14] ([#35010](https://github.com/frappe/erpnext/issues/35010)) ([3c75e55](3c75e55cb9))
* wrong qty of remaining work orders to be created when using "Create" > "Work Order" ([#34726](https://github.com/frappe/erpnext/issues/34726)) ([47df41f](47df41fdbd))

### Features

* Reconcile Payments in background ([#34596](https://github.com/frappe/erpnext/issues/34596)) ([5923a80](5923a80a0f))

### Performance Improvements

* Journal Entries (backport [#34918](https://github.com/frappe/erpnext/issues/34918)) ([#35054](https://github.com/frappe/erpnext/issues/35054)) ([39b5147](39b5147768))

### Reverts

* Revert "fix: Rate from LDC in TDS reports (#33699)" ([f44a79f](f44a79fa73)), closes [#33699](https://github.com/frappe/erpnext/issues/33699)
2023-04-25 17:00:40 +00:00
Deepesh Garg
b1473c9932 Merge pull request #35034 from frappe/version-14-hotfix
chore: release v14
2023-04-25 22:28:48 +05:30
mergify[bot]
82d8379188 fix: v14, Bank Reconcile Tools not cover case JV debit bank (#35000)
fix: v14, Bank Reconcile Tools not cover case JV debit bank (#35000)

(cherry picked from commit c36dc3dc57)

Co-authored-by: Kitti U. @ Ecosoft <kittiu@gmail.com>
2023-04-25 21:58:27 +05:30
mergify[bot]
39b5147768 perf: Journal Entries (backport #34918) (#35054)
* refactor: rewrite `get_stock_value_on()` queries in `QB`

(cherry picked from commit e43bc38e05)

* refactor: sum up SLE value in query

(cherry picked from commit 9a37ac6c25)

* refactor: `get_stock_value_on()` to get stock value of multiple warehouses at once

(cherry picked from commit e782a054c8)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-04-25 21:53:07 +05:30
mergify[bot]
d732083166 fix: Add company field to lower deduction certificate (#34914)
* fix: Add company field to lower deduction certificate (#34914)

(cherry picked from commit b545e3def0)

# Conflicts:
#	erpnext/patches.txt

* chore: resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-25 21:33:43 +05:30
mergify[bot]
693007adfe fix: Common party JV cost center (#35008)
fix: Common party JV cost center (#35008)

(cherry picked from commit f88431a79a)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-25 21:16:59 +05:30
mergify[bot]
f43ea0d6ff fix: Payment entry with TDS in bank reco statement (#34961)
fix: Payment entry with TDS in bank reco statement (#34961)

(cherry picked from commit ecea9b44a3)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-25 21:13:20 +05:30
mergify[bot]
f9f42c7e98 fix: per_billed condition for Payment Entry (#34969)
fix: per_billed condition for Payment Entry (#34969)

(cherry picked from commit d6bc8bba8b)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-04-25 21:12:58 +05:30
mergify[bot]
06f204a8d6 fix: click handler should not attempt indexed access of empty array (#35013)
fix: click handler should not attempt indexed access of empty array (#35013)

fix: click handler should not attempt indexed access
of empty array

(cherry picked from commit 3d90b970d1)

Co-authored-by: tundebabzy <tundebabzy@gmail.com>
2023-04-25 21:11:08 +05:30
mergify[bot]
47df41fdbd fix: wrong qty of remaining work orders to be created when using "Create" > "Work Order" (#34726)
fix: wrong qty of remaining work orders to be created when using "Create" > "Work Order" (#34726)

* fix: convert asynchronous field update to synchronous

* fix: wrong qty of remaining work orders to be created when using "Create" > "Work Order"

(cherry picked from commit 189b020d22)

Co-authored-by: danjeremynavarro <46537526+danjeremynavarro@users.noreply.github.com>
2023-04-25 20:08:01 +05:30
mergify[bot]
878d7477bc fix: Bulk Payment Entry from PO/SO (#34942)
fix: Bulk Payment Entry from PO/SO (#34942)

Co-authored-by: Nihantra Patel <n.patel.serpentcs@gmail.com>
(cherry picked from commit f1acc5fabb)

Co-authored-by: Solufy Solution <34390782+Solufyin@users.noreply.github.com>
2023-04-25 20:05:34 +05:30
mergify[bot]
29aa4a0222 fix: respect title_field from doctype to bulk transactions (#34928)
fix: respect title_field from doctype to bulk transactions (#34928)

(cherry picked from commit 22290c2694)

Co-authored-by: HarryPaulo <paulo_fabris@hotmail.com>
2023-04-25 20:05:13 +05:30
mergify[bot]
5045ad6be6 fix: Unable to allocate advance against invoice (#35007)
fix: Unable to allocate advance against invoice (#35007)

(cherry picked from commit f7b50f2ade)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-25 20:04:47 +05:30
mergify[bot]
665021270f fix: Use set instead of db_set as it is called from validate (#34967)
fix: Use set instead of db_set as it is called from validate (#34967)

(cherry picked from commit 72b5c1f70a)

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2023-04-25 20:04:28 +05:30
mergify[bot]
5923a80a0f feat: Reconcile Payments in background (#34596)
feat: Reconcile Payments in background (#34596)

* feat: auto reconcile in background

* chore: Option to enable auto reconciliation in settings

* refactor: validate if feature is enabled in settings

* refactor: check for running job while using reconciliation tool

* chore: using doc to get filter values

* chore: use frappe.db.get_value in validations

* chore: cleanup commented out code

* chore: replace get_list with get_all

* chore: use block scope variable

* chore: type information for functions

* refactor: flag to ignore job validation check

* refactor: update parent doc status if all reconciled

* chore: create test_records file

* test: create a bunch of vouchers for testing auto reconcile

* chore: renamed auto_reconcile to process_payment_reconciliation

* chore: another child doctype to hold payments

* chore: remove duplicate field

* chore: add fetched payments to log

* chore: Popup comment message update

* chore: replace get_all with get_value

* chore: replace label in settings page

* chore: remove unit test and records

* refactor: status in reconciliation log

* refactor: set status in log as well

* chore: fix field name

* chore: change triggered job name

* chore: use status field in list view of log

* chore: status while there are no allocations

* refactor: split trigger function into two

* chore: adding cancelled status

* refactor: function trigger queued docs

* chore: cron job scheduled

* chore: fixing accouts settings json file

* chore: typos and variable scope

* chore: use 'pluck' in db call

* chore: remove redundant whitelist decorator

* chore: use single DB call to fetch values

* chore: replace get_all with get_value

* refactor: use raw db calls to fetch reconciliation log records

Using get_doc on `Process Payment Reconciliation Log` is costly when
handling large volumes of invoices.

Use raw frappe.db.get_all to selectively pull status and reconciled count

* chore: update status on successful batch operation

* chore: make payment table readonly

* chore: ability to pause the background job

* chore: remove isolate_each_allocation

* chore: more description in progress bar

* refactor: partially working state

* refactor: update reconcile flag and setting hard limits for fetching

* chore: make allocation editable -- NEED TO REVERT

* chore: pause button

* refactor: skip setter function in Payment Entry for better performan

* refactor: split reconcile function and skip a setter function

1. Split reconcile function into 2
2. While reconciling against payment entry, skip a
set_missing_ref_details setter method

* chore: increase payment limit

* refactor: replace frappe.db.get_all with frappe.db.get_value

* chore: remove unwanted doctypes

* refactor: make allocation table readonly

* perf: update ref_details only for newly linked invoices

* chore: rename skip flag

* refactor(UI): receivable_payable field should auto populate

* refactor: no control statements in finally block

* chore: cleanup section and rename checkbox

* chore: update new fieldname in code

* chore: update error msg

* refactor: start and pause integrated into status

pause checkbox has been removed

* refactor: added cancelled status to the log doctype

1. Moved the status section to the bottom in parent doc
2. Using alerts to indicate Job trigger status

(cherry picked from commit ed14d1ce44)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-04-25 19:20:06 +05:30
mergify[bot]
5cc3978c16 fix: pass reference_doctype in link queries (backport #35038) (#35039)
fix: pass reference_doctype in link queries (#35038)

(cherry picked from commit 6de71eb158)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-04-25 18:42:32 +05:30
mergify[bot]
5630e8189b fix: use filter_by_finance_book instead of only_depreciable_assets in fixed asset register (backport #35031) (#35035)
fix: use filter_by_finance_book instead of only_depreciable_assets in fixed asset register (#35031)

fix: use filter_by_finance_book instead of only_depreciable_assets
(cherry picked from commit e08d636bf7)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-04-25 15:53:10 +05:30
rohitwaghchaure
d121282439 Merge pull request #35016 from frappe/mergify/bp/version-14-hotfix/pr-35012
fix: item not showing in the BOM (backport #35012)
2023-04-25 14:49:35 +05:30
Anand Baburajan
3c75e55cb9 fix: value of depreciable assets not updating after manual depr entry [v14] (#35010)
* fix: update value of asset with calc_depr on after manual depr entry

* fix: value of asset with calc_depr on after manual depr entry not reflecting in asset_depr_and_bal report

* chore: add validation for depr journal entry

* test: manual_depr_for_depreciable_asset and manual_depr_w_incorrect_jv_voucher_type

* chore: unlink depreciable asset from manual depr entry
2023-04-25 12:44:58 +05:30
rohitwaghchaure
aa22cccf99 Merge pull request #35028 from frappe/mergify/bp/version-14-hotfix/pr-35026
Revert "fix: Incorrect difference value in Stock and Account Value Comparison…" (backport #35026)
2023-04-25 12:10:03 +05:30
rohitwaghchaure
7d9c9884dc Revert "fix: Incorrect difference value in Stock and Account Value Comparison…"
(cherry picked from commit 7a63fbef4f)
2023-04-25 06:39:36 +00:00
ruthra kumar
e03eaa31fe Merge pull request #35023 from frappe/mergify/bp/version-14-hotfix/pr-34974
Revert "fix: Rate from LDC in TDS reports" (backport #34974)
2023-04-25 12:04:50 +05:30
ruthra kumar
f44a79fa73 Revert "fix: Rate from LDC in TDS reports (#33699)"
This reverts commit db9beb3cdd.

(cherry picked from commit cb7a99cbaa)
2023-04-25 05:47:51 +00:00
Frappe PR Bot
943acbfea8 chore(release): Bumped to Version 14.22.3
## [14.22.3](https://github.com/frappe/erpnext/compare/v14.22.2...v14.22.3) (2023-04-24)

### Bug Fixes

* incorrect OR condition causing timeout error ([d5910fb](d5910fba44))
2023-04-24 12:41:30 +00:00
rohitwaghchaure
e955eeeabc Merge pull request #35018 from frappe/mergify/bp/version-14/pr-35017
fix: incorrect OR condition causing timeout error (For more than 50 line items) (backport #35015) (backport #35017)
2023-04-24 18:09:45 +05:30
Rohit Waghchaure
d5910fba44 fix: incorrect OR condition causing timeout error
(cherry picked from commit 379b215aea)
(cherry picked from commit c020789bfc)
2023-04-24 12:39:21 +00:00
rohitwaghchaure
c8622fb46f Merge pull request #35017 from frappe/mergify/bp/version-14-hotfix/pr-35015
fix: incorrect OR condition causing timeout error (For more than 50 line items) (backport #35015)
2023-04-24 18:08:34 +05:30
Rohit Waghchaure
c020789bfc fix: incorrect OR condition causing timeout error
(cherry picked from commit 379b215aea)
2023-04-24 12:37:50 +00:00
Rohit Waghchaure
28cd79a040 fix: item not showing in the BOM
(cherry picked from commit 02c3b41dc2)
2023-04-24 12:37:26 +00:00
mergify[bot]
70014028e9 chore: ERPNext setup wizard cleanup (#33675)
chore: ERPNext setup wizard cleanup (#33675)

* chore: ERPNext setup wizard cleanup

* chore: Remove default website

* chore: Remove flaky tests

* chore: remove unwanted tests

(cherry picked from commit 3598bcc9a8)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-24 15:28:41 +05:30
rohitwaghchaure
79cbe1cce8 Merge pull request #34995 from frappe/mergify/bp/version-14-hotfix/pr-34994
fix: duplicate reposting entries of same voucher (backport #34994)
2023-04-22 14:55:50 +05:30
Rohit Waghchaure
aeac43ccf9 fix: duplicate reposting entries of same voucher
(cherry picked from commit f2253dd645)
2023-04-22 08:38:53 +00:00
rohitwaghchaure
a5e6b371ac Merge pull request #34987 from frappe/mergify/bp/version-14-hotfix/pr-34982
fix: added validation for extra job cards (backport #34982)
2023-04-22 08:40:42 +05:30
mergify[bot]
83a1b836f9 fix: SLA permissions (backport #34981) (#34986)
fix: SLA permissions (#34981)

(cherry picked from commit ac871797b2)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-04-21 21:13:38 +05:30
rohitwaghchaure
6e03c09017 Merge pull request #34983 from frappe/mergify/bp/version-14-hotfix/pr-34980
fix: validation for internal transfer entry (backport #34980)
2023-04-21 18:53:41 +05:30
Rohit Waghchaure
a5fde5d933 fix: added validation for extra job card
(cherry picked from commit 6a0b7c9e8c)
2023-04-21 13:21:27 +00:00
Rohit Waghchaure
a5823547d3 fix: validation for internal transfer entry
(cherry picked from commit 19911b48fd)
2023-04-21 12:16:43 +00:00
mergify[bot]
00968badf5 fix: broken 'set exchange gain/loss' btn in payment entry (#34940)
fix: broken set exchagne gain/loss btn broken in payment entry

(cherry picked from commit df0682fa8c)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-04-21 14:26:10 +05:30
mergify[bot]
6aabab26d8 fix: FEC report for France accountancy (#34781)
fix: FEC report for France accountancy  (#34781)

* fix: FEC report for France Accountancy legal requirement

* fix: FEC report for France Accountancy legal requirement

* fix: change to query standard

* fix: change to query standard

* fix: columns to standard dict

* fix: columns to standard dict

* fix: columns to data

* refactor: french report FEC

* refactor: french report FEC (2)

---------

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
(cherry picked from commit af8da53cf4)

Co-authored-by: HENRY Florian <florian.henry@open-concept.pro>
2023-04-21 14:23:18 +05:30
mergify[bot]
de86e8fb95 chore: Move source and campaign to more info section (#34946)
chore: Move source and campaign to more info section (#34946)

(cherry picked from commit a02705ded7)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-21 14:22:42 +05:30
ruthra kumar
e5048812fd Merge pull request #34943 from frappe/mergify/bp/version-14-hotfix/pr-34922
refactor: refactor set_missing_values and set_missing_ref_details in Payment Entry (backport #34922)
2023-04-21 09:41:28 +05:30
rohitwaghchaure
237bd6e831 Merge pull request #34964 from frappe/mergify/bp/version-14-hotfix/pr-34960
fix: stock entry type issue (backport #34960)
2023-04-20 23:41:46 +05:30
rohitwaghchaure
c2953bc3e0 Merge pull request #34965 from frappe/mergify/bp/version-14-hotfix/pr-34958
fix: removed depends on for the Employee Detail section (backport #34958)
2023-04-20 23:41:06 +05:30
Rohit Waghchaure
9d17d3ff06 fix: removed depends on for the Employee Detail section
(cherry picked from commit a90a5b4aa4)
2023-04-20 12:34:34 +00:00
Rohit Waghchaure
33a16086ef fix: stock entry type issue
(cherry picked from commit c3b5dcb767)
2023-04-20 12:34:11 +00:00
Sagar Vora
6e0d22c23b Merge pull request #34962 from frappe/mergify/bp/version-14-hotfix/pr-34738
fix: misc regional improvements (backport #34738)
2023-04-20 05:20:19 -07:00
Sagar Vora
2ec18eb4cf fix: use functools.wraps to preserve doc signature
(cherry picked from commit 776b56ccd1)
2023-04-20 12:18:21 +00:00
Sagar Vora
87595bdb7e fix: simplify erpnext.get_region
(cherry picked from commit 2fa641f86d)
2023-04-20 12:18:21 +00:00
Sagar Vora
789dfd6774 fix: set frappe.flags.company to call regional code accurately
(cherry picked from commit 17ef3c964f)
2023-04-20 12:18:20 +00:00
mergify[bot]
56ef0baa9d fix: batch qty conversion factor issue fixed in pos transaction (#34917)
fix: batch qty conversion factor issue fixed in pos transaction (#34917)

(cherry picked from commit 59f3fedbf7)

Co-authored-by: Vishal Dhayagude <vishdha@users.noreply.github.com>
Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2023-04-20 17:23:23 +05:30
Sagar Sharma
11e4fcb058 Merge pull request #34956 from frappe/mergify/bp/version-14-hotfix/pr-34953
fix: `PermissionError` in Work Order (backport #34953)
2023-04-20 16:01:47 +05:30
s-aga-r
a3568c1b27 fix: PermissionError in Work Order
(cherry picked from commit 8108b2de0a)
2023-04-20 10:28:04 +00:00
rohitwaghchaure
2a48a7b427 Merge pull request #34955 from frappe/mergify/bp/version-14-hotfix/pr-34954
fix: process_loss_percentage in BOM (backport #34954)
2023-04-20 15:02:05 +05:30
Nihantra Patel
4418862965 fix: process_loss_percentage in BOM
(cherry picked from commit b572bef71d)
2023-04-20 09:31:46 +00:00
rohitwaghchaure
e5aae90078 Merge pull request #34944 from frappe/mergify/bp/version-14-hotfix/pr-34912
fix: internal Purchase Receipt GL Entries (backport #34912)
2023-04-20 14:36:56 +05:30
Sagar Sharma
e2818afb62 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-34912 2023-04-20 14:05:48 +05:30
s-aga-r
7740ceb27e fix(test): test_internal_pr_gl_entries 2023-04-20 14:05:08 +05:30
ruthra kumar
3d3da75726 refactor: update ref details for selected references
set_missing_ref_details can update only for selected references

(cherry picked from commit b7d6e30f63)
2023-04-20 13:29:51 +05:30
ruthra kumar
8c5d644671 refactor: move set_missing_ref_detials out of set_missing_values
(cherry picked from commit 11cb2db3fe)
2023-04-20 13:29:47 +05:30
Frappe PR Bot
ca9b02fb53 chore(release): Bumped to Version 14.22.2
## [14.22.2](https://github.com/frappe/erpnext/compare/v14.22.1...v14.22.2) (2023-04-20)

### Bug Fixes

* filtering via batch no ([#34951](https://github.com/frappe/erpnext/issues/34951)) ([1b827e6](1b827e6b67)), closes [#34950](https://github.com/frappe/erpnext/issues/34950)
2023-04-20 07:24:45 +00:00
Deepesh Garg
74abe94711 Merge pull request #34952 from frappe/mergify/bp/version-14/pr-34951
fix: filtering via batch no (backport #34951)
2023-04-20 12:53:14 +05:30
mergify[bot]
1b827e6b67 fix: filtering via batch no (#34951)
fix: filtering via batch no(#34950)

* fix: filtering via batch no

(cherry picked from commit ea6eeace80)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 3b23fc1eba)
2023-04-20 07:21:04 +00:00
mergify[bot]
3b23fc1eba fix: filtering via batch no (#34951)
fix: filtering via batch no(#34950)

* fix: filtering via batch no

(cherry picked from commit ea6eeace80)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-20 12:50:40 +05:30
Sagar Sharma
1743413e00 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-34912 2023-04-20 12:19:43 +05:30
Sagar Sharma
c11b98fa9f Merge pull request #34926 from frappe/mergify/bp/version-14-hotfix/pr-34895
fix: use `CombineDatetime` instead of `Timestamp` in QB queries (backport #34895)
2023-04-20 12:17:32 +05:30
Sagar Sharma
a2c25ed49e Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-34895 2023-04-20 12:17:12 +05:30
s-aga-r
2ad157bd77 fix(test): test_backdated_stock_reco_cancellation_future_negative_stock
(cherry picked from commit 11c8503180)
2023-04-20 06:06:05 +00:00
s-aga-r
7cc0129302 test: add test case for internal PR GL Entries
(cherry picked from commit c86c543fbf)
2023-04-20 06:06:05 +00:00
s-aga-r
f7e436fe71 fix: internal Purchase Receipt GL Entries
(cherry picked from commit 6fca9adcd4)
2023-04-20 06:06:05 +00:00
ruthra kumar
1ab83c5c02 Merge pull request #34916 from frappe/mergify/bp/version-14-hotfix/pr-34838
refactor: toggle merging similar ledger entries in JE (backport #34838)
2023-04-20 11:15:36 +05:30
Frappe PR Bot
6faf459f97 chore(release): Bumped to Version 14.22.1
## [14.22.1](https://github.com/frappe/erpnext/compare/v14.22.0...v14.22.1) (2023-04-20)

### Bug Fixes

* add limit for get_next_stock_reco ([#34937](https://github.com/frappe/erpnext/issues/34937)) ([78ad0ea](78ad0eaa74))
2023-04-20 05:12:57 +00:00
Deepesh Garg
40058c2617 Merge pull request #34939 from frappe/mergify/bp/version-14/pr-34938
fix: add limit for get_next_stock_reco (#34937)
2023-04-20 10:41:31 +05:30
mergify[bot]
78ad0eaa74 fix: add limit for get_next_stock_reco (#34937)
fix: limit stock reco issue

(cherry picked from commit fcfa8842a7)

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
(cherry picked from commit 7131ff28fd)
2023-04-20 05:08:45 +00:00
mergify[bot]
7131ff28fd fix: add limit for get_next_stock_reco (#34937)
fix: limit stock reco issue

(cherry picked from commit fcfa8842a7)

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
2023-04-20 10:37:58 +05:30
Sagar Sharma
33d89b4a8b Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-34895 2023-04-20 10:05:58 +05:30
rohitwaghchaure
fef381e8eb Merge pull request #34930 from frappe/mergify/bp/version-14-hotfix/pr-34929
fix: Incorrect difference value in Stock and Account Value Comparison… (backport #34929)
2023-04-19 23:58:34 +05:30
Sagar Sharma
9e148b4277 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-34895 2023-04-19 21:21:52 +05:30
Rohit Waghchaure
e7ca833929 fix: Incorrect difference value in Stock and Account Value Comparison report
(cherry picked from commit a77182645f)
2023-04-19 15:38:16 +00:00
Sagar Sharma
322102e56b Merge pull request #34927 from frappe/mergify/bp/version-14-hotfix/pr-34901
fix: add item-code filter for SCR supplied-items batch-no (backport #34901)
2023-04-19 19:26:39 +05:30
s-aga-r
7c4f83ed60 fix: add item-code filter for SCR supplied-items batch-no
(cherry picked from commit e91abbfbe3)
2023-04-19 13:54:00 +00:00
s-aga-r
55da91cb34 fix: use CombineDatetime instead of Timestamp in QB queries
(cherry picked from commit 91a398a191)
2023-04-19 13:50:30 +00:00
ruthra kumar
9f090d2861 chore(patch): by default ledger entries of JE's will not be merged
(cherry picked from commit 3f537d30bd)
2023-04-19 09:59:36 +05:30
ruthra kumar
93bc1c5382 refactor: checkbox to toggle merging of JE account heads
(cherry picked from commit a3e3fe149d)
2023-04-19 04:19:31 +00:00
Frappe PR Bot
b12bd5f558 chore(release): Bumped to Version 14.22.0
# [14.22.0](https://github.com/frappe/erpnext/compare/v14.21.0...v14.22.0) (2023-04-19)

### Bug Fixes

* Add offers info to website item ([#34873](https://github.com/frappe/erpnext/issues/34873)) ([f1a1fc6](f1a1fc6c5b))
* Advance payment against payment terms ([#34872](https://github.com/frappe/erpnext/issues/34872)) ([7461239](7461239218))
* change discuss forum url ([#34891](https://github.com/frappe/erpnext/issues/34891)) ([8f26d62](8f26d62b35))
* don't show disabled warehouses in the Warehouse Wise Stock Balance report ([461780d](461780da22))
* Don't use stale item details ([#34847](https://github.com/frappe/erpnext/issues/34847)) ([c11aeba](c11aebaaae))
* for Tree Type item and item group show net amount ([#31776](https://github.com/frappe/erpnext/issues/31776)) ([7c8194a](7c8194a1a8))
* linters issues ([c53dc06](c53dc06f80))
* Remove unnecessary checkbox from Accounts doctype ([#34821](https://github.com/frappe/erpnext/issues/34821)) ([0cf6144](0cf6144b3f))
* selling workspace is not migrating properly ([79fd38c](79fd38cf3f))
* stock reco test case ([2f356dc](2f356dcc6c))
* too many writes error while making backdated stock reconciliation ([a981b79](a981b79865))
* unable to change `company` for manual `Serial No` entry ([2e7043c](2e7043ca90))
* **ux:** don't throw error when company defaults aren't set ([#34825](https://github.com/frappe/erpnext/issues/34825)) ([15f5e8d](15f5e8d4ff))
* whitelist doc method ([09b92fd](09b92fd78c))

### Features

* add german sales tax template ([#34823](https://github.com/frappe/erpnext/issues/34823)) ([3738ea5](3738ea5794))
2023-04-19 01:36:11 +00:00
Deepesh Garg
be8a22d33b Merge pull request #34905 from frappe/version-14-hotfix
chore: release v14
2023-04-19 07:04:25 +05:30
Sagar Sharma
757c168a8d Merge pull request #34903 from frappe/mergify/bp/version-14-hotfix/pr-34860
fix: add items field label (backport #34860)
2023-04-18 14:22:47 +05:30
s-aga-r
b0b00dc869 chore: add items field label
(cherry picked from commit c9418aab45)
2023-04-18 07:35:01 +00:00
Ankush Menat
09b92fd78c fix: whitelist doc method
This should've been whitelisted, looks like it was missed out

closes https://github.com/frappe/erpnext/issues/34898

(cherry picked from commit e4f152a416)
2023-04-18 08:25:26 +05:30
mergify[bot]
f1a1fc6c5b fix: Add offers info to website item (#34873)
fix: Add offers info to website item (#34873)

* fix: Add offers info to website item

* Revert "fix: Add offers info to website item"

This reverts commit 88b598edb6.

* fix: Add offer properties to website item

(cherry picked from commit 534ea5ad21)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-18 07:43:17 +05:30
mergify[bot]
8f26d62b35 fix: change discuss forum url (#34891)
fix: change discuss forum url (#34891)

[skip ci]

(cherry picked from commit dd93ea067e)

Co-authored-by: MohsinAli <mmatiyailol@gmail.com>
2023-04-18 07:42:45 +05:30
rohitwaghchaure
8e9d72bd2e Merge pull request #34887 from frappe/mergify/bp/version-14-hotfix/pr-34886
fix: stock reconciliation test case (backport #34886)
2023-04-17 16:02:15 +05:30
mergify[bot]
7461239218 fix: Advance payment against payment terms (#34872)
* fix: Advance payment against payment terms (#34872)

(cherry picked from commit 5c75894065)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.py

* chore: resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-17 15:54:54 +05:30
Rohit Waghchaure
2f356dcc6c fix: stock reco test case
(cherry picked from commit 6bccd8644e)
2023-04-17 09:52:59 +00:00
rohitwaghchaure
4640febc83 Merge pull request #34884 from frappe/mergify/bp/version-14-hotfix/pr-34851
fix: too many writes error while making backdated stock reconciliation (backport #34851)
2023-04-17 13:48:25 +05:30
Rohit Waghchaure
c53dc06f80 fix: linters issues
(cherry picked from commit d9dd64b4d2)
2023-04-17 07:13:00 +00:00
Rohit Waghchaure
a981b79865 fix: too many writes error while making backdated stock reconciliation
(cherry picked from commit 7bfc8f1236)
2023-04-17 07:13:00 +00:00
rohitwaghchaure
050339c88e Merge pull request #34883 from frappe/mergify/bp/version-14-hotfix/pr-34882
fix: don't show disabled warehouses in the Warehouse Wise Stock Balance report (backport #34882)
2023-04-17 12:41:25 +05:30
Rohit Waghchaure
461780da22 fix: don't show disabled warehouses in the Warehouse Wise Stock Balance report
(cherry picked from commit 9ceb1f6bda)
2023-04-17 06:31:44 +00:00
Shariq Ansari
e8db543028 Merge pull request #34877 from frappe/mergify/bp/version-14-hotfix/pr-34876
fix: selling workspace is not migrating properly (backport #34876)
2023-04-16 14:30:23 +05:30
Shariq Ansari
79fd38cf3f fix: selling workspace is not migrating properly
(cherry picked from commit 5a4dd354c1)
2023-04-16 08:57:11 +00:00
Sagar Sharma
dfb1e105bd Merge pull request #34868 from frappe/mergify/bp/version-14-hotfix/pr-34858
fix: unable to change `company` for manual `Serial No` entry (backport #34858)
2023-04-15 12:45:29 +05:30
s-aga-r
2e7043ca90 fix: unable to change company for manual Serial No entry
(cherry picked from commit fb3271c624)
2023-04-15 06:41:00 +00:00
mergify[bot]
7c8194a1a8 fix: for Tree Type item and item group show net amount (#31776)
fix: for Tree Type item and item group show net amout

(cherry picked from commit 91762097a5)

Co-authored-by: hrzzz <paulo_fabris@hotmail.com>
2023-04-14 16:42:37 +05:30
mergify[bot]
15f5e8d4ff fix(ux): don't throw error when company defaults aren't set (#34825)
fix(ux): don't throw error when company defaults aren't set (#34825)

* fix(ux): don't throw error when company defaults aren't set; instead prompt account input.

* fix: translate label and title

(cherry picked from commit 51c4338661)

Co-authored-by: Devin Slauenwhite <devin.slauenwhite@gmail.com>
2023-04-14 16:42:12 +05:30
mergify[bot]
3738ea5794 feat: add german sales tax template (#34823)
feat: add german sales tax template (#34823)

Nullsteuersatz nach § 12 Abs. 3 UStG

(cherry picked from commit 59f6b773cd)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-04-14 14:52:02 +05:30
mergify[bot]
c11aebaaae fix: Don't use stale item details (#34847)
fix: Don't use stale item details (#34847)

(cherry picked from commit a7051cb9b5)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-14 11:26:33 +05:30
mergify[bot]
0cf6144b3f fix: Remove unnecessary checkbox from Accounts doctype (#34821)
fix: Remove unnecessary checkbox from Accounts doctype (#34821)

(cherry picked from commit 66130493eb)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-14 11:26:14 +05:30
mergify[bot]
41a7d3fd60 chore: update CODEOWNERS (#34817)
* chore: update CODEOWNERS

[skip ci]

(cherry picked from commit aa8b241d5a)

# Conflicts:
#	CODEOWNERS

* fix: conflicts

---------

Co-authored-by: Saqib Ansari <nextchamp.saqib@gmail.com>
2023-04-12 07:39:07 +05:30
Frappe PR Bot
2b0b24f7c3 chore(release): Bumped to Version 14.21.0
# [14.21.0](https://github.com/frappe/erpnext/compare/v14.20.3...v14.21.0) (2023-04-11)

### Bug Fixes

* `payment entry is already created` on posawesome. (backport [#34712](https://github.com/frappe/erpnext/issues/34712)) ([#34752](https://github.com/frappe/erpnext/issues/34752)) ([8ba1e0f](8ba1e0f31e))
* add german translation of "Partly Paid" ([#34776](https://github.com/frappe/erpnext/issues/34776)) ([3023dbb](3023dbbe95))
* Allocate tax loss to tax account head on early payment discount ([#34287](https://github.com/frappe/erpnext/issues/34287)) ([be2990e](be2990ec88))
* asset monthly WDV and DD schedule [v14] ([#34644](https://github.com/frappe/erpnext/issues/34644)) ([88c8c36](88c8c36805))
* Bank clearance for case loan (disburstment/repayment) ([#34586](https://github.com/frappe/erpnext/issues/34586)) ([f1687cf](f1687cfb14))
* BOM Update Cost, when no actual qty ([8757435](8757435898))
* bom update log not working for large batch size ([551190a](551190af30))
* Column value mismatch in COA blank template ([#34658](https://github.com/frappe/erpnext/issues/34658)) ([5e03a4e](5e03a4e9e2))
* consider qty field precision ([2c54e76](2c54e763e4))
* customer selection not mandatory in purchase invoice to fetch item details ([#34810](https://github.com/frappe/erpnext/issues/34810)) ([994272b](994272b966))
* don't include cancelled JVs in assdeprledger report ([3896d41](3896d41e95))
* enclose ternary operator in parentheses ([b835760](b835760b0b))
* incorrect arg name in asset value adjustment ([8d9305e](8d9305ee5f))
* incorrect balance qty in the stock ledger report ([3494c9c](3494c9ccb6))
* incorrect stock balance quantity for batch item ([d817c50](d817c50581))
* Item tax validity comparison fixes ([#34784](https://github.com/frappe/erpnext/issues/34784)) ([cc21241](cc21241887))
* lost opportunity report issue ([#34626](https://github.com/frappe/erpnext/issues/34626)) ([3e67994](3e67994cc7))
* Multiple issues in purchase invoice submission ([#34600](https://github.com/frappe/erpnext/issues/34600)) ([5677f25](5677f25215))
* plaid log_error syntax issue (backport [#34642](https://github.com/frappe/erpnext/issues/34642)) ([#34667](https://github.com/frappe/erpnext/issues/34667)) ([61858a6](61858a60c2))
* posting time issue ([bb5eeb6](bb5eeb6bd6))
* provide filter by depreciable assets in fixed asset register ([#34803](https://github.com/frappe/erpnext/issues/34803)) ([fee4cd5](fee4cd5f40))
* reposting record not created for backdated stock reco ([9b90323](9b90323d53))
* serial no with zero quantity issue in stock reco ([f47be46](f47be46717))
* Shop by category fixes (backport [#34688](https://github.com/frappe/erpnext/issues/34688)) ([#34750](https://github.com/frappe/erpnext/issues/34750)) ([3ad5d67](3ad5d676ab))
* Subcontracting Receipt incorrect `status` ([99226d3](99226d3811))
* Supplier RFQ email link ([#34338](https://github.com/frappe/erpnext/issues/34338)) ([a00459a](a00459aec3))
* Total debit and credit while importing via Data Import ([#34659](https://github.com/frappe/erpnext/issues/34659)) ([5e28d02](5e28d0234e))
* **ui:** recalculate difference amount on allocation change ([#34694](https://github.com/frappe/erpnext/issues/34694)) ([6b866e2](6b866e24f6))
* Unable to create payment request against purchase invoice ([#34762](https://github.com/frappe/erpnext/issues/34762)) ([a1f7e35](a1f7e35914))
* use stock qty to calculate POS reserved stock ([c0f7f7d](c0f7f7da42))
* UX for stock entry, bom and work order ([d4a6035](d4a6035c83))

### Features

* add `Received Qty` field in `Delivery Note Item` ([1c5e36c](1c5e36c7b6))
* Auto allocate advance payments only against orders ([#34727](https://github.com/frappe/erpnext/issues/34727)) ([05d24e3](05d24e3665))

### Reverts

* remove frappe.send_message (v14) ([#34816](https://github.com/frappe/erpnext/issues/34816)) ([8a331e0](8a331e0f26))
2023-04-11 11:40:59 +00:00
Deepesh Garg
f72fc73913 Merge pull request #34813 from frappe/version-14-hotfix
chore: release v14
2023-04-11 17:09:31 +05:30
Ritwik Puri
8a331e0f26 revert: remove frappe.send_message (v14) (#34816)
revert: remove frappe.send_message
2023-04-11 16:10:32 +05:30
Deepesh Garg
da913d49a7 Merge branch 'version-14' into version-14-hotfix 2023-04-11 15:56:58 +05:30
rohitwaghchaure
21aea52c32 Merge pull request #34814 from frappe/mergify/bp/version-14-hotfix/pr-34808
fix: reposting record not created for backdated stock reconciliation  (backport #34808)
2023-04-11 15:36:32 +05:30
Rohit Waghchaure
9b90323d53 fix: reposting record not created for backdated stock reco
(cherry picked from commit 6851b5ba97)
2023-04-11 09:33:26 +00:00
Deepesh Garg
994272b966 fix: customer selection not mandatory in purchase invoice to fetch item details (#34810) 2023-04-11 14:17:27 +05:30
mergify[bot]
fee4cd5f40 fix: provide filter by depreciable assets in fixed asset register (#34803)
fix: provide filter by depreciable assets in fixed asset register (#34803)

(cherry picked from commit c957a5cd2e)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-04-11 13:50:04 +05:30
mergify[bot]
3023dbbe95 fix: add german translation of "Partly Paid" (#34776)
fix: add german translation of "Partly Paid" (#34776)

(cherry picked from commit 934e1b4e6a)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-04-09 20:13:36 +05:30
mergify[bot]
cc21241887 fix: Item tax validity comparison fixes (#34784)
fix: Item tax validity comparison fixes (#34784)

fix: Item tax validity comparsion fixes
(cherry picked from commit 6f6928fa7b)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-09 18:55:11 +05:30
Sagar Sharma
66fdd1c13f Merge pull request #34786 from frappe/mergify/bp/version-14-hotfix/pr-34632
refactor: rewrite `batch.py` queries in `QB` (backport #34632)
2023-04-08 22:10:22 +05:30
s-aga-r
5723a200c5 chore: conflicts 2023-04-08 19:10:39 +05:30
s-aga-r
35c9493336 refactor: rewrite batch.py queries in QB
(cherry picked from commit 517b5f8567)

# Conflicts:
#	erpnext/stock/doctype/batch/batch.py
2023-04-08 07:41:49 +00:00
Anand Baburajan
b235b95bed Merge pull request #34779 from frappe/mergify/bp/version-14-hotfix/pr-34735
'Make Asset Movement' button translation fix in asset_list.js (backport #34735)
2023-04-07 15:34:20 +05:30
Hossein Yousefian
50abbded34 'Make Asset Movement' button translation fix
(cherry picked from commit b70615ef18)
2023-04-07 10:01:19 +00:00
Sagar Sharma
31b479d71f Merge pull request #34772 from frappe/mergify/bp/version-14-hotfix/pr-34760
fix: validate `Received Qty` for Internal Purchase Receipt (backport #34760)
2023-04-06 17:20:46 +05:30
s-aga-r
769736ffea test: add test cases for internal PR received qty
(cherry picked from commit a575bd50ef)
2023-04-06 10:56:11 +00:00
s-aga-r
b79ddbbf60 chore: add Delivery Note Item in Purchase Receipt Status Updater
(cherry picked from commit 0d1df26b88)
2023-04-06 10:56:11 +00:00
s-aga-r
1c5e36c7b6 feat: add Received Qty field in Delivery Note Item
(cherry picked from commit bc39dfab5d)
2023-04-06 10:56:11 +00:00
Sagar Sharma
eaf577f078 Merge pull request #34770 from frappe/mergify/bp/version-14-hotfix/pr-34769
fix: Subcontracting Receipt incorrect `status` (backport #34769)
2023-04-06 14:53:34 +05:30
rohitwaghchaure
e02ad91c39 Merge pull request #34771 from frappe/mergify/bp/version-14-hotfix/pr-34768
fix: UX for stock entry, bom and work order (backport #34768)
2023-04-06 14:44:45 +05:30
Rohit Waghchaure
d4a6035c83 fix: UX for stock entry, bom and work order
(cherry picked from commit 82a136f991)
2023-04-06 08:47:08 +00:00
s-aga-r
99226d3811 fix: Subcontracting Receipt incorrect status
(cherry picked from commit a55b818119)
2023-04-06 08:27:32 +00:00
Frappe PR Bot
2a8c9f8e69 chore(release): Bumped to Version 14.20.3
## [14.20.3](https://github.com/frappe/erpnext/compare/v14.20.2...v14.20.3) (2023-04-06)

### Bug Fixes

* Unable to create payment request against purchase invoice ([#34762](https://github.com/frappe/erpnext/issues/34762)) ([f4473b3](f4473b36a5))
2023-04-06 07:54:09 +00:00
mergify[bot]
f4473b36a5 fix: Unable to create payment request against purchase invoice (#34762)
fix: Unable to create payment request against purchase invoice (#34762)

fix: Unable to create payment request against purchase invoice (#34762)

(cherry picked from commit 91a26608ee)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit a1f7e35914)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-04-06 13:22:09 +05:30
mergify[bot]
a1f7e35914 fix: Unable to create payment request against purchase invoice (#34762)
fix: Unable to create payment request against purchase invoice (#34762)

(cherry picked from commit 91a26608ee)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-06 12:49:15 +05:30
Frappe PR Bot
b6ae9a4a72 chore(release): Bumped to Version 14.20.2
## [14.20.2](https://github.com/frappe/erpnext/compare/v14.20.1...v14.20.2) (2023-04-05)

### Bug Fixes

* incorrect stock balance quantity for batch item ([c7cee86](c7cee86685))
2023-04-05 18:57:55 +00:00
rohitwaghchaure
313e1a5e04 Merge pull request #34759 from frappe/mergify/bp/version-14/pr-34758
fix: incorrect stock balance quantity for batch item (backport #34743) (backport #34758)
2023-04-06 00:26:07 +05:30
Rohit Waghchaure
c7cee86685 fix: incorrect stock balance quantity for batch item
(cherry picked from commit ef4bd77196)
(cherry picked from commit d817c50581)
2023-04-05 18:18:47 +00:00
rohitwaghchaure
915c4819b6 Merge pull request #34758 from frappe/mergify/bp/version-14-hotfix/pr-34743
fix: incorrect stock balance quantity for batch item (backport #34743)
2023-04-05 23:47:17 +05:30
Rohit Waghchaure
d817c50581 fix: incorrect stock balance quantity for batch item
(cherry picked from commit ef4bd77196)
2023-04-05 17:52:45 +00:00
Frappe PR Bot
33ee958cfb chore: release v14 (#34733) 2023-04-05 17:41:20 +05:30
mergify[bot]
8ba1e0f31e fix: payment entry is already created on posawesome. (backport #34712) (#34752) 2023-04-05 13:55:13 +05:30
mergify[bot]
3ad5d676ab fix: Shop by category fixes (backport #34688) (#34750)
fix: Shop by category fixes (#34688)

* fix: Shop by category fixes

* chore: Update tests

(cherry picked from commit 56f5078357)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-05 13:09:34 +05:30
mergify[bot]
05d24e3665 feat: Auto allocate advance payments only against orders (#34727)
* feat: Auto allocate advance payments only against orders (#34727)

feat: Auto allocate advance payments only againt orders
(cherry picked from commit fd3fb64aa3)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.json

* chore: Resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-05 13:00:40 +05:30
mergify[bot]
3c0cc024aa fix!: require sender and message for contact us page (#34707)
fix!: require sender and message for contact us page (#34707)

* fix: require sender and message for contact us page

* refactor: dont override frappe.send_message from client side

used override_whitelisted_method hook for the same

(cherry picked from commit f193393f57)

Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
2023-04-05 12:33:55 +05:30
Anand Baburajan
88c8c36805 fix: asset monthly WDV and DD schedule [v14] (#34644)
* fix: monthly wdv and dd schedule

* chore: handle case without pro rata

* chore: fix DD rate and prev depr amount in case of disposal

* chore: minor fix for schedules with just 2 rows

* chore: minor bug

* refactor: get_depreciation_amount

* refactor: another one for get_depreciation_amount
2023-04-05 11:45:45 +05:30
Anand Baburajan
7c4a9b56ff Merge pull request #34737 from AnandBaburajan/asdeprledger_cancelled_deprs
fix: don't include cancelled JVs in assdeprledger report
2023-04-05 11:33:53 +05:30
Anand Baburajan
16e554dd7b Merge branch 'version-14-hotfix' into asdeprledger_cancelled_deprs 2023-04-04 17:51:21 +05:30
anandbaburajan
3896d41e95 fix: don't include cancelled JVs in assdeprledger report 2023-04-04 17:49:16 +05:30
Sagar Sharma
12625d87b0 Merge pull request #34717 from frappe/mergify/bp/version-14-hotfix/pr-34713
fix: consider qty field precision (backport #34713)
2023-04-04 08:45:12 +05:30
Frappe PR Bot
dfadfdc32c chore(release): Bumped to Version 14.20.1
## [14.20.1](https://github.com/frappe/erpnext/compare/v14.20.0...v14.20.1) (2023-04-03)

### Bug Fixes

* bom update log not working for large batch size ([da35436](da354362be))
2023-04-03 17:50:43 +00:00
rohitwaghchaure
e4def081f5 Merge pull request #34724 from frappe/mergify/bp/version-14/pr-34719
fix: bom update log not working for large batch size (backport #34715) (backport #34719)
2023-04-03 23:19:00 +05:30
Sagar Sharma
cbb8dd6aa6 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-34713 2023-04-03 22:23:20 +05:30
Rohit Waghchaure
da354362be fix: bom update log not working for large batch size
(cherry picked from commit d56070301c)
(cherry picked from commit 551190af30)
2023-04-03 16:06:57 +00:00
rohitwaghchaure
9372d46c08 Merge pull request #34711 from vishdha/reserved_pos_qty
fix: use stock qty to calculate POS reserved stock
2023-04-03 21:14:36 +05:30
rohitwaghchaure
dff61ab759 Merge pull request #34719 from frappe/mergify/bp/version-14-hotfix/pr-34715
fix: bom update log not working for large batch size (backport #34715)
2023-04-03 16:55:27 +05:30
Rohit Waghchaure
551190af30 fix: bom update log not working for large batch size
(cherry picked from commit d56070301c)
2023-04-03 10:20:09 +00:00
s-aga-r
2c54e763e4 fix: consider qty field precision
(cherry picked from commit 6ec7590c21)
2023-04-03 10:07:42 +00:00
mergify[bot]
6b866e24f6 fix(ui): recalculate difference amount on allocation change (#34694)
fix: recalculate difference amount on allocation change

(cherry picked from commit 32a4ca6b6c)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-04-03 14:55:32 +05:30
mergify[bot]
be2990ec88 fix: Allocate tax loss to tax account head on early payment discount (#34287)
* fix: Taxes aren't discounted on early payment discount

- Deductions in payment entry must be split into income loss and tax loss
- Compute total discount in percentage, makes discounting different amounts proportionately easier

(cherry picked from commit 768c3a4927)

* fix: Recalculate difference amount after setting deductions

(cherry picked from commit 75ec0a0a85)

* fix: Set deductions in base currency

- Use field precision to get more accurate values

(cherry picked from commit dc2998f544)

* fix: Back update discounted amount in Invoice based on discount type

- Discount value was always trated as a percentage on back updation

(cherry picked from commit 2ae5834290)

* test: PE from SI with early payment discount amount & PE assertions in discount % test

(cherry picked from commit c217bb2018)

* fix: Set deduction amount in company currency on Doctype

- Even via JS, deductions amount is always in company currency
- Since there is nothing dynamic about this field, set it in the doctype spec itself
- fixed: Inconsistency between label currency and field currency formatted value

(cherry picked from commit 7f2e7badff)

* fix: Don't add to deductions if amount is 0

- misc: better docstring

(cherry picked from commit f02fc8acf0)

* fix: Paid amount must be discounted considering accounting currency

- Accounting is in the same currency if party currency and company currency is the same
- If accounting is in the same currency, paid and recvd amount is in the base currency
- Then, discount amount must also be in the base currency as it is deducted from paid amount
- Received amount must be in base currency if not multi currency
- cleanup: Deductions setting broken into smaller functions

(cherry picked from commit 761f68d7bf)

* fix: Multi-currency SI with base currency PE

- Return total discount loss in base currency
- Allocate payment based on terms: Set allocated amount in references table in base currency if accounting is in that currency
- Allocate payment based on terms: While back updating set paid amount (payment schedule) in transaction currency always
- minor: discount msgprint in correct currency

(cherry picked from commit b09c2381ca)

* test: Multi currency SI with multi-currency accounting and single currency accounting + Early payment discount

(cherry picked from commit 9abf0ef615)

* fix: Handle rounding more gracefully

- Round off pending discount loss to avoid miniscule losses rounded to 0.0 that are added in deductions
- Use base amounts to calculate base losses instead of using conversion factor which increases rounding error
- Round of total base loss instead of individual income and tax losses to reduce rounding error
- Use default round off account for pending rounding loss in deductions

(cherry picked from commit caa1a3dccf)

* fix: Provision to apply early payment discount if payment is recorded late

- Party could have paid on time but payment is recorded late
- Prompt for reference date so that discount is applied while mapping
- Prompt only if discount in payment schedule of valid doctypes
- test: Reference date and impact on PE
- `make_payment_entry` (JS) must be able to access `this`

(cherry picked from commit d6d0163514)

* feat: Make Tax loss booking optional

- Checkbox in Accounts Settings
- Apply checkbox in PE deductions setting logic
- Adjust tests

(cherry picked from commit 216a46bd66)

# Conflicts:
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.json

* fix: Merge conflicts

---------

Co-authored-by: marination <maricadsouza221197@gmail.com>
2023-04-03 13:00:22 +05:30
Vishal
c0f7f7da42 fix: use stock qty to calculate POS reserved stock 2023-04-03 12:46:57 +05:30
Sagar Sharma
b34c78c4e7 Merge pull request #34697 from frappe/mergify/bp/version-14-hotfix/pr-34656
fix: BOM Update Cost, when no actual qty (backport #34656)
2023-04-02 19:16:41 +05:30
Sagar Sharma
4ada090cb2 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-34656 2023-04-02 14:59:38 +05:30
mergify[bot]
5677f25215 fix: Multiple issues in purchase invoice submission (#34600)
fix: Multiple issues in purchase invoice submission (#34600)

* fix: Multiple issues in purchase invoice submission

* fix: Base grand total calculation

* chore: Calculate base grand total separately only in multi currency docs

* fix: Add gl entry for round off

(cherry picked from commit 4c61ee30bb)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-02 12:56:58 +05:30
mergify[bot]
f1687cfb14 fix: Bank clearance for case loan (disburstment/repayment) (#34586)
fix: Bank clearance for case loan (disburstment/repayment) (#34586)

(cherry picked from commit 74b29eb5e2)

Co-authored-by: Kitti U. @ Ecosoft <kittiu@ecosoft.co.th>
2023-04-01 22:07:50 +05:30
mergify[bot]
a00459aec3 fix: Supplier RFQ email link (#34338)
fix: Supplier RFQ email link (#34338)

(cherry picked from commit fc86a8568f)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-01 22:07:28 +05:30
s-aga-r
8757435898 fix: BOM Update Cost, when no actual qty
(cherry picked from commit a4112c75c5)
2023-04-01 10:54:51 +00:00
ruthra kumar
dcf62dc548 Merge pull request #34686 from frappe/mergify/bp/version-14-hotfix/pr-34679
fix: enclose ternary operator in parenthesis (backport #34679)
2023-03-31 14:05:30 +05:30
ruthra kumar
b835760b0b fix: enclose ternary operator in parentheses
(cherry picked from commit 986daa6578)
2023-03-31 08:02:13 +00:00
Sagar Sharma
bd0c20f789 Merge pull request #34681 from frappe/mergify/bp/version-14-hotfix/pr-34677
chore: make `Production Plan Item Reference` table hidden in Production Plan (backport #34677)
2023-03-31 12:37:19 +05:30
s-aga-r
5ef98fcea1 chore: make Production Plan Item Reference table hidden in Production Plan
(cherry picked from commit 706be2a415)
2023-03-31 07:05:20 +00:00
Deepesh Garg
985b232251 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-34627 2023-03-31 11:59:48 +05:30
mergify[bot]
5e28d0234e fix: Total debit and credit while importing via Data Import (#34659)
fix: Total debit and credit while importing via Data Import (#34659)

(cherry picked from commit 7c42b72ee7)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-31 11:58:45 +05:30
mergify[bot]
5e03a4e9e2 fix: Column value mismatch in COA blank template (#34658)
fix: Column value mismatch in COA blank template (#34658)

(cherry picked from commit 576575c227)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-31 11:58:16 +05:30
rohitwaghchaure
e98e64f925 Merge pull request #34669 from frappe/mergify/bp/version-14-hotfix/pr-34664
fix: incorrect balance qty in the stock ledger report (backport #34664)
2023-03-30 18:18:07 +05:30
rohitwaghchaure
9ce281d008 Merge pull request #34671 from frappe/mergify/bp/version-14-hotfix/pr-34636
fix: posting time issue (backport #34636)
2023-03-30 18:17:31 +05:30
Anand Baburajan
27a3f2ce55 Merge pull request #34665 from frappe/mergify/bp/version-14-hotfix/pr-34661
chore: improve asset depr posting failure msg (backport #34661)
2023-03-30 17:50:24 +05:30
mergify[bot]
61858a60c2 fix: plaid log_error syntax issue (backport #34642) (#34667)
fix: plaid log_error syntax issue (#34642)

(cherry picked from commit ddb17a8880)

Co-authored-by: Richard Case <110036763+casesolved-co-uk@users.noreply.github.com>
2023-03-30 17:28:37 +05:30
Rohit Waghchaure
bb5eeb6bd6 fix: posting time issue
(cherry picked from commit 345e6facbe)
2023-03-30 11:56:35 +00:00
Rohit Waghchaure
3494c9ccb6 fix: incorrect balance qty in the stock ledger report
(cherry picked from commit cbdaab940d)
2023-03-30 11:56:27 +00:00
Anand Baburajan
a0df23415b chore: improve asset depr posting failure msg (#34661)
* chore: improve asset depr posting error msg

* chore: add period

* chore: improve msg

(cherry picked from commit d999dea3e4)
2023-03-30 11:09:32 +00:00
mergify[bot]
8510c398a4 chore: auto fill asset name and available for use date (backport #34660) (#34662)
* chore: auto fill asset name and available for use date

(cherry picked from commit af3e807607)

# Conflicts:
#	erpnext/assets/doctype/asset/asset.json

* Update asset.json

---------

Co-authored-by: anandbaburajan <anandbaburajan@gmail.com>
2023-03-30 16:37:35 +05:30
rohitwaghchaure
bae476cc99 Merge pull request #34652 from frappe/mergify/bp/version-14-hotfix/pr-34648
fix: serial no with zero quantity issue in stock reco (backport #34648)
2023-03-30 13:39:58 +05:30
Anand Baburajan
4dfc660cc0 Merge pull request #34650 from frappe/mergify/bp/version-14-hotfix/pr-34649
fix: incorrect arg name in asset value adjustment (backport #34649)
2023-03-30 13:10:26 +05:30
Rohit Waghchaure
f47be46717 fix: serial no with zero quantity issue in stock reco
(cherry picked from commit 17131e5a02)
2023-03-30 07:35:38 +00:00
anandbaburajan
8d9305ee5f fix: incorrect arg name in asset value adjustment
(cherry picked from commit 2b0470d1f5)
2023-03-30 07:34:09 +00:00
Deepesh Garg
bc94358e98 chore: resolve conflicts 2023-03-30 12:15:56 +05:30
Komal-Saraf0609
5e98679f91 fix: enabling lead even after "Opportunity" created against it (#34627)
* fix: enabling lead even after "Opportunity" created against it

* chore: Linting Issues

---------

Co-authored-by: Komal Saraf <komal@frappe.io>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit ad11934d39)

# Conflicts:
#	erpnext/patches.txt
#	erpnext/patches/v14_0/enable_all_leads.py
2023-03-30 02:34:48 +00:00
Anand Baburajan
6819f0106d Merge pull request #34640 from frappe/mergify/bp/version-14-hotfix/pr-34607
Asset maintenance task add dropdown "3 Yearly" (backport #34607)
2023-03-29 18:13:54 +05:30
Bevan Tony Medrano
e3de229b82 Asset maintenance task add dropdown "3 Yearly" (#34607)
* feat(asset_maintenance.json):Add 3 yearly in periodicity dropdown

* add server side implications for 3 yearly

(cherry picked from commit 625b8e8005)
2023-03-29 12:15:40 +00:00
mergify[bot]
3e67994cc7 fix: lost opportunity report issue (#34626)
fix: lost opportunity report issue (#34626)

* fix: lost opportunity report issue

* chore: Linting Issues

---------

Co-authored-by: Komal Saraf <komal@frappe.io>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit d0660ad222)

Co-authored-by: Komal-Saraf0609 <81952590+Komal-Saraf0609@users.noreply.github.com>
2023-03-29 17:04:00 +05:30
Frappe PR Bot
a60c8f0e18 chore(release): Bumped to Version 14.20.0
# [14.20.0](https://github.com/frappe/erpnext/compare/v14.19.0...v14.20.0) (2023-03-28)

### Bug Fixes

* default pos conversion factor set to 1 ([#34437](https://github.com/frappe/erpnext/issues/34437)) ([18d813a](18d813a656))
* don't get zero value entries for exchange rate calculation ([#34475](https://github.com/frappe/erpnext/issues/34475)) ([ff24b3e](ff24b3e40c))
* incorrect `Opening Value` in `Stock Balance` report ([76b782a](76b782a03f))
* Note username overlapping with note content(CRM) ([096e5ef](096e5ef197))
* Party Name in SOA print when viewed from Customer/Supplier master ([#34597](https://github.com/frappe/erpnext/issues/34597)) ([835edbe](835edbe80e))
* Percentage billing in Sales Order ([#34606](https://github.com/frappe/erpnext/issues/34606)) ([477cb12](477cb12240))
* recalculate WDV rate after asset repair [v14] ([#34571](https://github.com/frappe/erpnext/issues/34571)) ([d2ca6f8](d2ca6f8d1f))
* remove unused translation ([#34519](https://github.com/frappe/erpnext/issues/34519)) ([881e92e](881e92e7b3))
* removing redundant validation ([fd6db41](fd6db41b6e))
* Sales person variance report without item group ([#34552](https://github.com/frappe/erpnext/issues/34552)) ([90ddc4a](90ddc4a1e2))
* Tax Category not able to set hence it calculating zero tax for item whoes tax template set ([#34525](https://github.com/frappe/erpnext/issues/34525)) ([a8567b0](a8567b09e6))
* Time button not working in the job card ([8fed33b](8fed33b03b))
* translations and UX in alternative item mapping ([#34433](https://github.com/frappe/erpnext/issues/34433)) ([702d07e](702d07ea7d))
* unset address and contact on trash (backport [#34495](https://github.com/frappe/erpnext/issues/34495)) ([#34560](https://github.com/frappe/erpnext/issues/34560)) ([db01bf5](db01bf5dec))
* zero rm-cost for batch rm item in SCR (backport [#34616](https://github.com/frappe/erpnext/issues/34616)) ([#34623](https://github.com/frappe/erpnext/issues/34623)) ([cff35d7](cff35d7286))

### Features

* deprecate get_customer_list ([#34563](https://github.com/frappe/erpnext/issues/34563)) ([67576ad](67576ad5bd))
2023-03-28 18:23:52 +00:00
Deepesh Garg
efdbb91a21 Merge pull request #34611 from frappe/version-14-hotfix
chore: release v14
2023-03-28 23:49:38 +05:30
mergify[bot]
cff35d7286 fix: zero rm-cost for batch rm item in SCR (backport #34616) (#34623)
fix: zero rm-cost for batch rm item in SCR (#34616)

fix: `0` rm-cost for batch rm item in SCR
(cherry picked from commit 867d898304)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2023-03-28 21:09:01 +05:30
rohitwaghchaure
c671f3ddc9 Merge pull request #34621 from frappe/mergify/bp/version-14-hotfix/pr-34461
fix: incorrect `Opening Value` in `Stock Balance` report (backport #34461)
2023-03-28 18:41:42 +05:30
s-aga-r
76b782a03f fix: incorrect Opening Value in Stock Balance report
(cherry picked from commit b04a101c11)
2023-03-28 12:11:54 +00:00
ruthra kumar
6f502bdc54 Merge pull request #34619 from frappe/mergify/bp/version-14-hotfix/pr-34608
chore: removing redundant validation (backport #34608)
2023-03-28 17:21:11 +05:30
mergify[bot]
a8567b09e6 fix: Tax Category not able to set hence it calculating zero tax for item whoes tax template set (#34525)
fix: Tax Category not able to set hence it calculating zero tax for item whoes tax template set (#34525)

* fix: Tax Category not able to set hence it calculating zero tax for item whoes tax template set

* fix: minor change added

(cherry picked from commit 7aafc90d58)

Co-authored-by: Vishal Dhayagude <vishdha@users.noreply.github.com>
2023-03-28 17:20:26 +05:30
ruthra kumar
fd6db41b6e fix: removing redundant validation
(cherry picked from commit d52f7e2820)
2023-03-28 16:59:42 +05:30
mergify[bot]
ff24b3e40c fix: don't get zero value entries for exchange rate calculation (#34475)
fix: don't get zero value entries for exchange rate calculation (#34475)

* fix: multiply None by float

* chore: remove debug

(cherry picked from commit 393bc25e2d)

Co-authored-by: Devin Slauenwhite <devin.slauenwhite@gmail.com>
2023-03-28 16:58:22 +05:30
mergify[bot]
477cb12240 fix: Percentage billing in Sales Order (#34606)
fix: Percentage billing in Sales Order (#34606)

(cherry picked from commit 12ad2aa2e5)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-28 16:52:53 +05:30
mergify[bot]
835edbe80e fix: Party Name in SOA print when viewed from Customer/Supplier master (#34597)
fix: Party Name in SOA print when viewed from Customer/Supplier master (#34597)

fix: Party Name in SOA print when viewd from Customer/Supplier master
(cherry picked from commit 50c1172f29)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-28 16:48:53 +05:30
mergify[bot]
18d813a656 fix: default pos conversion factor set to 1 (#34437)
* fix: default pos conversion factor set to 1 (#34437)

(cherry picked from commit 08fc686513)

# Conflicts:
#	erpnext/selling/page/point_of_sale/point_of_sale.py

* chore: Resolve conflicts

---------

Co-authored-by: Shram Kadia <65490105+Shram007@users.noreply.github.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-24 15:14:52 +05:30
mergify[bot]
67576ad5bd feat: deprecate get_customer_list (#34563)
feat: deprecate get_customer_list (#34563)

(cherry picked from commit 8c7fa5712b)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-03-24 15:14:25 +05:30
ruthra kumar
37f2ba882e Merge pull request #34583 from frappe/mergify/bp/version-14-hotfix/pr-34577
refactor: additional filters and columns in Payment Ledger report (backport #34577)
2023-03-24 14:22:55 +05:30
ruthra kumar
57ecac4aa7 refactor: additional filters and columns in Payment Ledger report (#34577)
1. 'Party type' and 'Party' filters have been added
2. checkbox to include Amount in Acccount Currency
3. Grouping vouchers on Party
4. Replaced Company with Posting Date

(cherry picked from commit f7780cdb58)
2023-03-24 08:11:34 +00:00
rohitwaghchaure
070dea1bc5 Merge pull request #34574 from frappe/mergify/bp/version-14-hotfix/pr-34573
fix: Timer buttons not working in the job card (backport #34573)
2023-03-24 08:40:56 +05:30
Rohit Waghchaure
8fed33b03b fix: Time button not working in the job card
(cherry picked from commit 34c190b7d6)
2023-03-23 17:06:58 +00:00
mergify[bot]
90ddc4a1e2 fix: Sales person variance report without item group (#34552)
fix: Sales person variance report without item group (#34552)

fix: Sales person variance report witout item group
(cherry picked from commit 87108be11a)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-23 21:49:13 +05:30
Anand Baburajan
d2ca6f8d1f fix: recalculate WDV rate after asset repair [v14] (#34571)
fix: recalculate wdv rate after asset repair
2023-03-23 21:08:59 +05:30
mergify[bot]
db01bf5dec fix: unset address and contact on trash (backport #34495) (#34560)
fix: unset address and contact on trash (#34495)

* fix(Customer): unset address and contact on trash

* fix(Supplier): unset address and contact on trash

---------

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
(cherry picked from commit f7bf1b8a0c)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-03-23 12:58:32 +05:30
mergify[bot]
881e92e7b3 fix: remove unused translation (#34519)
* fix: remove unused translation (#34519)

(cherry picked from commit 0df3a1a3af)

# Conflicts:
#	erpnext/translations/tr.csv

* chore: resolve conflicts

---------

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-03-23 00:06:14 +05:30
Shariq Ansari
d2e9527563 Merge pull request #34549 from frappe/mergify/bp/version-14-hotfix/pr-34547
fix: Note username overlapping with note content(CRM) (backport #34547)
2023-03-22 12:05:56 +05:30
Shariq Ansari
096e5ef197 fix: Note username overlapping with note content(CRM)
(cherry picked from commit 76cea7dd6a)
2023-03-22 06:32:46 +00:00
mergify[bot]
702d07ea7d fix: translations and UX in alternative item mapping (#34433)
fix: translations and UX in alternative item mapping (#34433)

* fix: disable deletion in alternative item mapping

* feat: german translations

* fix: make string translatable

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 79911734e9)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-03-21 22:48:38 +05:30
Frappe PR Bot
e271935673 chore(release): Bumped to Version 14.19.0
# [14.19.0](https://github.com/frappe/erpnext/compare/v14.18.3...v14.19.0) (2023-03-21)

### Bug Fixes

* **client:** Amount calculation for 0 qty debit notes ([#34455](https://github.com/frappe/erpnext/issues/34455)) ([d24f4d2](d24f4d2873))
* difference amount calculation for company currency accounts ([9ab7bff](9ab7bff0e0))
* don't map item row having `0` qty ([7611a49](7611a49db7))
* E-commerce issue with Item Variants ([53c3fff](53c3fff235))
* german translations ([#34312](https://github.com/frappe/erpnext/issues/34312)) ([dd0c833](dd0c8334cd))
* hide `+` button based on `Blanket Order Type` ([daa1bb8](daa1bb86e3))
* incorrect depr schedules after asset repair [v14] ([#34527](https://github.com/frappe/erpnext/issues/34527)) ([560df63](560df6330a)), closes [#30838](https://github.com/frappe/erpnext/issues/30838)
* Multiple accounting dimension filtering in AR/AP reports ([#34464](https://github.com/frappe/erpnext/issues/34464)) ([f146479](f146479362))
* Overallocation of 'qty' from Cr Notes to Parent Invoice ([848e56b](848e56bd4c))
* patch depends on Currency Exchange Settings ([#34494](https://github.com/frappe/erpnext/issues/34494)) ([4acde44](4acde4468f))
* POS not picking up pos profile company address instead fetch any random company address ([#34521](https://github.com/frappe/erpnext/issues/34521)) ([01f4cc7](01f4cc76fc))
* Update account number from parent company ([#34474](https://github.com/frappe/erpnext/issues/34474)) ([55d002c](55d002c636))
* use max function to get default company address (backport [#34116](https://github.com/frappe/erpnext/issues/34116)) ([#34452](https://github.com/frappe/erpnext/issues/34452)) ([ba2fd71](ba2fd71b65))

### Features

* add field `Over Order Allowance (%)` in `Buying Settings` ([da915f1](da915f1510))
* add field `Over Order Allowance (%)` in `Selling Settings` ([46b5ba9](46b5ba9c2a))
* bank reconciliation and plaid changes ([#33986](https://github.com/frappe/erpnext/issues/33986)) ([9b608ea](9b608eaa0f))
* consider `over_order_allowance` while validating order qty ([932639b](932639b4df))
* consider `over_order_allowance` while validating sales order qty ([09b577a](09b577a91f))
* Support for Alternative Items in Quotation ([#33874](https://github.com/frappe/erpnext/issues/33874)) ([9f7da21](9f7da21c93))

### Performance Improvements

* index against_sales_invoice field on DN items (backport [#34509](https://github.com/frappe/erpnext/issues/34509)) ([#34510](https://github.com/frappe/erpnext/issues/34510)) ([baa789b](baa789be34))
2023-03-21 12:52:05 +00:00
Deepesh Garg
78f4082893 Merge pull request #34532 from frappe/version-14-hotfix
chore: release v14
2023-03-21 18:20:39 +05:30
mergify[bot]
dd0c8334cd fix: german translations (#34312)
fix: german translations (#34312)

fix: some german translations
(cherry picked from commit 59c2e7ec3e)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-03-21 16:08:32 +05:30
mergify[bot]
01f4cc76fc fix: POS not picking up pos profile company address instead fetch any random company address (#34521)
fix: POS not picking up pos profile company address instead fetch any random company address (#34521)

(cherry picked from commit 6966fa4d88)

Co-authored-by: Vishal Dhayagude <vishdha@users.noreply.github.com>
2023-03-21 16:06:54 +05:30
mergify[bot]
d24f4d2873 fix(client): Amount calculation for 0 qty debit notes (#34455)
fix(client): Amount calculation for 0 qty debit notes (#34455)

fix(client): Amount calculaton for 0 qty debit notes

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
(cherry picked from commit ee6c107d58)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-21 16:05:41 +05:30
mergify[bot]
17744a99a1 refactor(bank reconciliation tool): currency symbol fix and concurrent usage (#34501)
* fix: incorrect currency symbol in Bank Reconciliation tool

(cherry picked from commit 2d14d92b32)

* refactor: allow for concurrent use of reconciliation tool

1. set default filter dates a period of one month from current date

(cherry picked from commit 1eea585d29)

---------

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-03-21 16:01:09 +05:30
rohitwaghchaure
8c40dd93c3 Merge pull request #34530 from frappe/mergify/bp/version-14-hotfix/pr-34528
fix: E-commerce issue with Item Variants (backport #34528)
2023-03-21 14:52:39 +05:30
Rohit Waghchaure
53c3fff235 fix: E-commerce issue with Item Variants
(cherry picked from commit aaa4d1eb55)
2023-03-21 09:17:33 +00:00
Anand Baburajan
560df6330a fix: incorrect depr schedules after asset repair [v14] (#34527)
* fix: backport missing changes from #30838

* fix: incorrect schedule after repair
2023-03-21 14:31:23 +05:30
ruthra kumar
91a609d2ab Merge pull request #34513 from ruthra-kumar/manual_backport_of_34456_to_v14
fix: Gross Profit reports Invoices with -ve qty for Invoices with Cr Notes (manual backport to version 14)
2023-03-20 17:05:28 +05:30
ruthra kumar
aead554d31 test: Gross Profit report output for Cr notes
2 New test cases added.
1. Standalone Cr notes will be reported as normal Invoices
2. Cr notes against an Invoice will not overallocate qty if there are
multiple instances of same item
2023-03-20 16:06:53 +05:30
ruthra kumar
e0e89b4209 refactor: Ignore linked Cr Notes in Report output 2023-03-20 16:06:53 +05:30
ruthra kumar
848e56bd4c fix: Overallocation of 'qty' from Cr Notes to Parent Invoice
Cr Notes 'qty' are overallocated to parent invoice, when there are
mulitple instances of same item in Invoice.
2023-03-20 16:06:53 +05:30
mergify[bot]
baa789be34 perf: index against_sales_invoice field on DN items (backport #34509) (#34510)
perf: index against_sales_invoice field on DN items (#34509)

This is used on Sales invoice dashboard and takes a lot of time to load
as db size increases.

Results:

Before: ~10-20 seconds to load dashboard
After: few milliseconds because of index

[skip ci]

(cherry picked from commit 109a9f1390)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-03-20 14:48:46 +05:30
mergify[bot]
4acde4468f fix: patch depends on Currency Exchange Settings (#34494)
fix: patch depends on Currency Exchange Settings (#34494)

(cherry picked from commit d791dc11a3)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-03-20 14:27:34 +05:30
mergify[bot]
de5fabc67a chore: Update user manual link (#34478)
* chore: Update user manual link (#34478)

(cherry picked from commit be723bb9d4)

# Conflicts:
#	erpnext/patches.txt

* chore: resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-19 18:06:45 +05:30
mergify[bot]
f146479362 fix: Multiple accounting dimension filtering in AR/AP reports (#34464)
fix: Multiple accounting dimension filtering in AR/AP reports (#34464)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
(cherry picked from commit 7b630217bd)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-19 18:06:00 +05:30
mergify[bot]
55d002c636 fix: Update account number from parent company (#34474)
fix: Update account number from parent company (#34474)

(cherry picked from commit d8ece86463)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-19 18:05:33 +05:30
Sagar Sharma
b20296b2fe Merge pull request #34487 from frappe/mergify/bp/version-14-hotfix/pr-34440
chore: `Allow Zero Valuation Rate` msg in SE (backport #34440)
2023-03-17 16:56:37 +05:30
s-aga-r
5604074935 chore: Allow Zero Valuation Rate msg in SE
(cherry picked from commit 22ad9a1903)
2023-03-17 10:33:42 +00:00
ruthra kumar
bd1b955eb6 Merge pull request #34481 from frappe/mergify/bp/version-14-hotfix/pr-34466
fix: unwanted difference amt while reconciling vouchers from base currency account (backport #34466)
2023-03-17 15:26:10 +05:30
ruthra kumar
c71b4ed6ec refactor: difference amt validation for same currency accounts
(cherry picked from commit ec075122b6)
2023-03-17 09:22:32 +00:00
ruthra kumar
e81ad864cf test: difference amount should not be calculated for base currency
(cherry picked from commit 861387f164)
2023-03-17 09:22:32 +00:00
ruthra kumar
9ab7bff0e0 fix: difference amount calculation for company currency accounts
(cherry picked from commit 48fae0c1ce)
2023-03-17 09:22:32 +00:00
Sagar Sharma
524ed324fb Merge pull request #34480 from frappe/mergify/bp/version-14-hotfix/pr-34279
fix: `Blanket Order` (backport #34279)
2023-03-17 11:03:33 +05:30
s-aga-r
c46e5a81d4 test: add test cases for Over Order Allowance against Blanket Order
(cherry picked from commit 66f650061d)
2023-03-17 04:45:27 +00:00
s-aga-r
09b577a91f feat: consider over_order_allowance while validating sales order qty
(cherry picked from commit 53701c37b1)
2023-03-17 04:45:27 +00:00
s-aga-r
46b5ba9c2a feat: add field Over Order Allowance (%) in Selling Settings
(cherry picked from commit d7da8928ac)
2023-03-17 04:45:26 +00:00
s-aga-r
932639b4df feat: consider over_order_allowance while validating order qty
(cherry picked from commit 8bcbc45add)
2023-03-17 04:45:26 +00:00
s-aga-r
7611a49db7 fix: don't map item row having 0 qty
(cherry picked from commit fc1088d9c4)
2023-03-17 04:45:26 +00:00
s-aga-r
35297f6ac1 refactor: rewrite blanket_order.py queries in QB
(cherry picked from commit f3993783a3)
2023-03-17 04:45:26 +00:00
s-aga-r
da915f1510 feat: add field Over Order Allowance (%) in Buying Settings
(cherry picked from commit f5937f46cb)
2023-03-17 04:45:26 +00:00
s-aga-r
daa1bb86e3 fix: hide + button based on Blanket Order Type
(cherry picked from commit abf9a28d6a)
2023-03-17 04:45:25 +00:00
Raffael Meyer
9b608eaa0f feat: bank reconciliation and plaid changes (#33986)
feat: bank reconciliation and plaid changes (#33986)

fix: plaid link refresh: update account ids
fix: plaid transactions for credit cards & add accounts on link refresh if they don't exist
fix: bank reconciliation amount matching
fix: bank reconciliation dialog usability
feat: rewrite bank transaction reconciliation to allow multiple transactions to reconcile against vouchers before clearance
fix: matching transaction amounts and race condition bug
fix: ensure there is a reference number in plaid transactions and other tweaks
feat: add references to Payroll Entry Bank Journal Entry
feat: only clear Voucher once all Bank GLEs are allocated to Bank Transactions
fix: strange type error
feat: add payment method field to bank and plaid transactions and prepopulate relevant bank reconciliation new voucher fields
feat: bank reconciliation - allow bank transactions to reconcile against themselves for when there are banking amendments
fix: bank transaction self-reconcile bug and tidy
fix: bank reconciliation datatable index update

Co-authored-by: Richard Case <110036763+casesolved-co-uk@users.noreply.github.com>
2023-03-17 09:01:29 +05:30
Ritwik Puri
befd1a0f91 ci: use version specific payments repo (#34468)
ci: use version-14 branch of payments repo for v14 erpnext
2023-03-16 16:04:21 +05:30
mergify[bot]
9f7da21c93 feat: Support for Alternative Items in Quotation (#33874)
* feat: Filter out alternative item rows in taxes and totals for Quotation

- Added a Quotation Item field `is_alternative_item`
- Use filtered rows for taxes and totals computation

(cherry picked from commit 91982d1e4f)

# Conflicts:
#	erpnext/selling/doctype/quotation_item/quotation_item.json

* feat: Consider filtered items table in JS for totals computation

- Set `_items` as filtered rows if quotation else the entire table. Set at entry point of JS API
- Use `_items` instead of `items` to compute taxes and charges. Exclude alternative item rows

(cherry picked from commit f19eadab9a)

* feat: Dialog to select alternative item before creating Sales order

- Users can leave the row blank in the dialog if original item is to be used
- Else users can select an alternative item against an original item
- In the document, users must check `Is Alternative Item` if needed and also specify which item it is an altenrative to since there are no documented mappings

(cherry picked from commit cef7dfd0b4)

# Conflicts:
#	erpnext/selling/doctype/quotation/quotation.js
#	erpnext/selling/doctype/quotation_item/quotation_item.json

* feat: Filter rows to be mapped on server side mapping function

- Pass dialog selections to `make_sales_order`
- Map either original item or its alternative depending on mapping
- Only qty check for simple rows (without alternatives and not an alternative itself)

(cherry picked from commit 94cacb60de)

* chore: Validate 'alternative_to' field values, must be a valid non-alterntaive item from table

(cherry picked from commit fa9b327501)

* fix: Iterate over list instead of map's output and formatting

(cherry picked from commit ece6358e60)

* fix: Consider only ordered alternative/original item for Quotation status

- The original and its alternatives make a set of items where one is chosen
- While setting order status of Quotation, check if the chosen item from the set is fully ordered or not
- Filter out unselected items from the set
- Create a map containing the set of items and if they were ordered or not for ease of grouping
- The simple items will work as it used to

(cherry picked from commit b3fe7c6dad)

* chore: Code simplification

- Map is not required, avoid filter multiple times, use single loop instead
- Better variable name
- Reduce LOC

(cherry picked from commit 03321f5f13)

* refactor: Order based alternative items mapping

- Alternatives must be followed by a non-alternative item row
- On submit, store non-alternative rows in hidden checkbox to avoid recomputation
- Check for valid/mappable rows by row name
- UI: Select from table rows.Add single row for original/alternative item in dialog
- UI: Indicator for alternative items in dialog grid
- UI: Indicator legend and description of table
- DB: Added check field 'Has Alternative Item' not to be confused with 'Has Alternative' in Mfg

(cherry picked from commit db2076db69)

# Conflicts:
#	erpnext/selling/doctype/quotation_item/quotation_item.json

* test: Alternative items in Quotation

- Taxes and totals, mapping, back updation

(cherry picked from commit 74fab53e28)

* fix: Use block variable

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 3c96791d52)

* fix: Handle `Get Items From` in Sales Order

- Map all non alternatives from Quotation to SO if no selected items
- Show disclaimer mentioning that Qtns with alternatives must be mapped to SO from the Qtn form

(cherry picked from commit 19456127cf)

* fix: Map only non alternative items from Quotation in Sales Invoice

- Since there's no item selection, only Quotation selection :/

(cherry picked from commit 6b789e2f04)

* fix: Merge conflicts

---------

Co-authored-by: marination <maricadsouza221197@gmail.com>
2023-03-16 11:50:19 +05:30
mergify[bot]
68f9863ae5 test: add timeout to all BOM related tests (backport #34446) (#34453)
test: add timeout to all BOM related tests (#34446)

* Revert "chore: remove failing test (#34444)"

This reverts commit b89ecd482d.

* test: add timeout to bom tests

(cherry picked from commit f95ad039e4)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-03-15 14:19:09 +05:30
mergify[bot]
ba2fd71b65 fix: use max function to get default company address (backport #34116) (#34452)
* fix: use max function to get default company address

(cherry picked from commit b93c18bd4a)

* test: add test for primary address sorting

(cherry picked from commit e0042972c8)

---------

Co-authored-by: Prateek <40106895+prateekkaramchandani@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-03-15 10:38:49 +05:30
Frappe PR Bot
3e61e76317 chore(release): Bumped to Version 14.18.3
## [14.18.3](https://github.com/frappe/erpnext/compare/v14.18.2...v14.18.3) (2023-03-14)

### Bug Fixes

* `BOM Stock Report` ([1c00077](1c0007768b))
* `required_qty` get reset to `1` for Alternative Item in WO ([51bcdb3](51bcdb32f2))
* Don't use get_list & get_all interchangeably ([27c524e](27c524e337))
* Error in consolidated financial statement ([#34330](https://github.com/frappe/erpnext/issues/34330)) ([73866f4](73866f4da7))
* exchange rate revaluation errors ([#33947](https://github.com/frappe/erpnext/issues/33947)) ([1a629b6](1a629b6418))
* filters not getting applied on `Web Form` ([6ef7ddf](6ef7ddfbce))
* Linked invoice cancellation issue via timesheet ([#34337](https://github.com/frappe/erpnext/issues/34337)) ([da8cc2b](da8cc2bba9))
* operation time for multi-level BOM in WO ([76e04c8](76e04c8625))
* Set contact filter link in Opportunity ([#34325](https://github.com/frappe/erpnext/issues/34325)) ([c64836d](c64836d3d6))
* set tax category from address before executing `get_regional_address_details` ([#34372](https://github.com/frappe/erpnext/issues/34372)) ([bf0cbe0](bf0cbe09b9))
* **test:** flaky test case in Payment terms report ([69a5411](69a5411f0e))
* Total row in trail balance report ([#34395](https://github.com/frappe/erpnext/issues/34395)) ([c353ba7](c353ba741c))
* Use customer name instead of name(id) in PSOA (backport [#34412](https://github.com/frappe/erpnext/issues/34412)) ([#34425](https://github.com/frappe/erpnext/issues/34425)) ([209adf3](209adf32a5))

### Performance Improvements

* `update_completed_qty()` in `material_request.py` ([b37712c](b37712c038))
* Stock Entry (Material Transfer) ([1b51463](1b514632d2))

### Reverts

* Revert "Update tr.csv (backport #34285)" (#34427) ([b6d059c](b6d059ccb8)), closes [#34285](https://github.com/frappe/erpnext/issues/34285) [#34427](https://github.com/frappe/erpnext/issues/34427) [#34285](https://github.com/frappe/erpnext/issues/34285)
* Revert "fix: Default sales team not getting set" (#34376) ([ed338b1](ed338b1395)), closes [#34376](https://github.com/frappe/erpnext/issues/34376) [#34376](https://github.com/frappe/erpnext/issues/34376) [#34284](https://github.com/frappe/erpnext/issues/34284)
2023-03-14 17:37:03 +00:00
Deepesh Garg
c44579ff52 Merge pull request #34442 from frappe/version-14-hotfix
chore: release v14
2023-03-14 23:05:05 +05:30
Sagar Sharma
3f7e82f8b1 Merge pull request #34448 from frappe/mergify/bp/version-14-hotfix/pr-34415
fix: operation time for multi-level BOM in WO (backport #34415)
2023-03-14 19:55:38 +05:30
Sagar Sharma
6787a1fe91 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-34415 2023-03-14 18:55:51 +05:30
Sagar Sharma
12fa080c00 Merge pull request #34450 from frappe/mergify/bp/version-14-hotfix/pr-34381
chore: fix french translation (backport #34381)
2023-03-14 18:55:07 +05:30
HENRY Florian
6303d2d8e1 chore: fix french translation (#34381)
chore: update french translation
(cherry picked from commit d267111e13)
2023-03-14 13:20:05 +00:00
s-aga-r
76e04c8625 fix: operation time for multi-level BOM in WO
(cherry picked from commit 442ee3adba)
2023-03-14 13:18:30 +00:00
mergify[bot]
c353ba741c fix: Total row in trail balance report (#34395)
fix: Total row in trail balance report (#34395)

* fix: Total row in trail balance report

* fix: Calculate total after preparing opening and closing

(cherry picked from commit c6999fc687)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-14 15:08:33 +05:30
mergify[bot]
bf0cbe09b9 fix: set tax category from address before executing get_regional_address_details (#34372)
fix: set tax category from address before executing `get_regional_address_details` (#34372)

(cherry picked from commit 5c06620f97)

Co-authored-by: Sagar Vora <sagar@resilient.tech>
2023-03-13 21:15:43 +05:30
mergify[bot]
630386fd8c chore: Move source and campaign to additional info section (#34414)
* chore: Move source and campaign to additional info section (#34414)

(cherry picked from commit c8cc3fc65f)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.json

* chore: resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-13 21:11:49 +05:30
mergify[bot]
209adf32a5 fix: Use customer name instead of name(id) in PSOA (backport #34412) (#34425)
fix: Use customer name instead of name(id) in PSOA (#34412)

(cherry picked from commit fa776d2987)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-13 21:11:22 +05:30
Deepesh Garg
b6d059ccb8 Revert "Update tr.csv (backport #34285)" (#34427)
Revert "Update tr.csv (#34285)"

This reverts commit 5266a7e8a7.
2023-03-13 19:43:26 +05:30
mergify[bot]
da8cc2bba9 fix: Linked invoice cancellation issue via timesheet (#34337)
fix: Linked invoice cancellation issue via timesheet (#34337)

(cherry picked from commit 4416ddc4af)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-13 18:58:54 +05:30
mergify[bot]
af629f92f0 test: fix hypothesis tests (backport #34416) (#34418)
test: fix hypothesis tests (#34416)

(cherry picked from commit b8a61be080)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-03-13 15:28:30 +05:30
mergify[bot]
5266a7e8a7 Update tr.csv (#34285)
chore: Improve Turkish language translation

chore: Improve Turkish language translation
(cherry picked from commit fa6d37542b)

Co-authored-by: Mehmet Demirel <unibravo@gmail.com>
2023-03-13 14:03:38 +05:30
mergify[bot]
73866f4da7 fix: Error in consolidated financial statement (#34330)
fix: Error in consolidated financial statement (#34330)

(cherry picked from commit aae53bb910)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-13 14:03:02 +05:30
ruthra kumar
b0c5f5594d Merge pull request #34413 from frappe/mergify/bp/version-14-hotfix/pr-34408
chore: delete remarks migration patch (backport #34408)
2023-03-13 10:24:42 +05:30
ruthra kumar
502a45e54f chore: delete remarks migration patch
Versions higher than V14.18.2, 'remarks' will be moved in 'migrate_gl_to_payment_ledger'

(cherry picked from commit da37573b73)
2023-03-13 03:45:17 +00:00
ruthra kumar
f854316eb2 Merge pull request #34405 from frappe/mergify/bp/version-14-hotfix/pr-34387
refactor(patch): remove inner join to improve SQL performance (backport #34387)
2023-03-12 13:16:01 +05:30
ruthra kumar
0b184667fc chore: remove remarks migrations patch from patches.txt
'Remarks' field is moved in migrate_gl_to_payment_ledger patch itself
from versions highers than v14.18.2. Removing it from patches.txt

(cherry picked from commit 9d0a1149d8)
2023-03-12 11:08:34 +05:30
ruthra kumar
3923044d88 Merge pull request #34400 from frappe/mergify/bp/version-14-hotfix/pr-34370
fix(test): flaky test case in Payment terms report (backport #34370)
2023-03-11 21:29:56 +05:30
ruthra kumar
0ef1d1b2ae refactor: add remarks to column as well
(cherry picked from commit 1744f1d4e4)
2023-03-11 15:31:17 +00:00
ruthra kumar
e6de87a1b7 refactor(patch): remove inner join to improve SQL performance
(cherry picked from commit f9cfabf78e)
2023-03-11 15:31:16 +00:00
mergify[bot]
c64836d3d6 fix: Set contact filter link in Opportunity (#34325)
fix: Set contact filter link in Opportunity (#34325)

Co-authored-by: Nihantra C. Patel <n.patel.serpentcs@gmail.com>
(cherry picked from commit 71de72bdd0)

Co-authored-by: Solufyin <34390782+Solufyin@users.noreply.github.com>
2023-03-11 19:05:26 +05:30
ruthra kumar
69a5411f0e fix(test): flaky test case in Payment terms report
(cherry picked from commit 7fcd74ed03)
2023-03-11 08:49:03 +00:00
Sagar Sharma
29c58b6f75 Merge pull request #34384 from frappe/mergify/bp/version-14-hotfix/pr-34383
fix: filters not getting applied on `Web Form` (backport #34383)
2023-03-10 13:48:38 +05:30
s-aga-r
6ef7ddfbce fix: filters not getting applied on Web Form
(cherry picked from commit 9c1e566394)
2023-03-09 18:55:03 +00:00
gavin
27c524e337 fix: Don't use get_list & get_all interchangeably
fix: Fetch all fields via get_returned_qty_map_for_row
2023-03-09 16:05:37 +05:30
Frappe PR Bot
fcbcbc0aa7 chore(release): Bumped to Version 14.18.2
## [14.18.2](https://github.com/frappe/erpnext/compare/v14.18.1...v14.18.2) (2023-03-09)

### Reverts

* Revert "fix: Default sales team not getting set" (#34376) ([f71d85d](f71d85d7c3)), closes [#34376](https://github.com/frappe/erpnext/issues/34376) [#34376](https://github.com/frappe/erpnext/issues/34376) [#34284](https://github.com/frappe/erpnext/issues/34284)
2023-03-09 10:26:37 +00:00
Deepesh Garg
7ca3130010 Merge pull request #34379 from frappe/mergify/bp/version-14/pr-34377
Revert "fix: Default sales team not getting set" (backport #34376) (backport #34377)
2023-03-09 15:43:17 +05:30
mergify[bot]
f71d85d7c3 Revert "fix: Default sales team not getting set" (#34376)
Revert "fix: Default sales team not getting set" (#34376)

Revert "fix: Default sales team not getting set (#34284)"

This reverts commit 7d0199d743.

(cherry picked from commit 9a8f8e8b7d)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit ed338b1395)
2023-03-09 10:11:18 +00:00
mergify[bot]
ed338b1395 Revert "fix: Default sales team not getting set" (#34376)
Revert "fix: Default sales team not getting set" (#34376)

Revert "fix: Default sales team not getting set (#34284)"

This reverts commit 7d0199d743.

(cherry picked from commit 9a8f8e8b7d)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-09 15:39:56 +05:30
Sagar Sharma
9f0dff9e7a Merge pull request #34368 from frappe/mergify/bp/version-14-hotfix/pr-34360
chore: `Alternative Item Code` error msg (backport #34360)
2023-03-09 11:10:13 +05:30
Sagar Sharma
31f9d23b17 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-34360 2023-03-09 11:09:48 +05:30
Sagar Sharma
ce8e3e92dd Merge pull request #34366 from frappe/mergify/bp/version-14-hotfix/pr-34362
fix: `required_qty` get reset to `1` for Alternative Item in WO (backport #34362)
2023-03-09 11:09:25 +05:30
s-aga-r
c734a78f3c chore: Alternative Item Code error msg
(cherry picked from commit baef5ae1ef)
2023-03-09 04:38:21 +00:00
s-aga-r
51bcdb32f2 fix: required_qty get reset to 1 for Alternative Item in WO
(cherry picked from commit 046834a97a)
2023-03-09 04:35:58 +00:00
Sagar Sharma
68b9581176 Merge pull request #34356 from frappe/mergify/bp/version-14-hotfix/pr-34352
fix: `BOM Stock Report` (backport #34352)
2023-03-08 17:45:52 +05:30
s-aga-r
df98e25312 test: add test cases for BOM Stock Report
(cherry picked from commit b53dcb04ed)
2023-03-08 10:56:44 +00:00
s-aga-r
1c0007768b fix: BOM Stock Report
(cherry picked from commit a65b80911b)
2023-03-08 10:56:44 +00:00
Deepesh Garg
d42af42cec Merge pull request #34331 from frappe/mergify/bp/version-14-hotfix/pr-33947
fix: exchange rate revaluation errors (backport #33947)
2023-03-08 13:07:04 +05:30
Frappe PR Bot
cfe28663bc chore(release): Bumped to Version 14.18.1
## [14.18.1](https://github.com/frappe/erpnext/compare/v14.18.0...v14.18.1) (2023-03-07)

### Performance Improvements

* `update_completed_qty()` in `material_request.py` ([7a5f7d4](7a5f7d4920))
* Stock Entry (Material Transfer) ([59a415e](59a415eaa9))
2023-03-07 17:23:00 +00:00
Sagar Sharma
943599f3ac Merge pull request #34342 from frappe/mergify/bp/version-14/pr-34335
perf: Stock Entry (Material Transfer) (backport #34313) (backport #34335)
2023-03-07 22:51:22 +05:30
s-aga-r
7a5f7d4920 perf: update_completed_qty() in material_request.py
(cherry picked from commit 8ad9e99cea)
(cherry picked from commit b37712c038)
2023-03-07 16:14:55 +00:00
s-aga-r
59a415eaa9 perf: Stock Entry (Material Transfer)
(cherry picked from commit de18f98c5c)
(cherry picked from commit 1b514632d2)
2023-03-07 16:14:55 +00:00
Sagar Sharma
a18c4c839e Merge pull request #34335 from frappe/mergify/bp/version-14-hotfix/pr-34313
perf: Stock Entry (Material Transfer) (backport #34313)
2023-03-07 21:43:05 +05:30
Frappe PR Bot
0696128acc chore(release): Bumped to Version 14.18.0
# [14.18.0](https://github.com/frappe/erpnext/compare/v14.17.4...v14.18.0) (2023-03-07)

### Bug Fixes

* `Inventory Dimension` for `Stock Reconciliation` ([b08cdc0](b08cdc00f2))
* `rejected_serial_no` not getting copied from PR to PR(Return) ([3db8258](3db82587eb))
* `Serial No is mandatory` even if the `qty` is `0` ([aa6b891](aa6b891ef0))
* BOM Update log not completed ([235ecca](235ecca9fa))
* consumed qty validation for subcontracting receipt ([7eccf43](7eccf431fd))
* Default sales team not getting set ([#34284](https://github.com/frappe/erpnext/issues/34284)) ([64c758d](64c758d0c0))
* Do not calculate commission post submit ([#34267](https://github.com/frappe/erpnext/issues/34267)) ([480797e](480797e856))
* labels name ([5e9f1df](5e9f1dfbb3))
* **minor:** Dirty the form after clicking on Get advances button in Invoices ([#34323](https://github.com/frappe/erpnext/issues/34323)) ([0e9f9c3](0e9f9c31a0))
* Payment Request against sales order with disabled rounded total ([#34281](https://github.com/frappe/erpnext/issues/34281)) ([ca59c69](ca59c699cd))
* Performance improvement when adding a new item ([#34195](https://github.com/frappe/erpnext/issues/34195)) ([71a281f](71a281fb11))
* Resolve conflicts ([f6469d8](f6469d8398))
* Stock Reconciliation `actual_qty` ([d97c1bf](d97c1bf0f4))
* update inventory dimensions before returning sle ([ab73742](ab737424c2))
* Wrap unexpectedly long text in remark ([b13bf1e](b13bf1ebc5))

### Features

* adjust purchase receipt valuation rate as per purchase invoice rate ([db033c6](db033c6862))

### Reverts

* Revert "refactor: use renamed timezone utils (#34301)" ([a2e001a](a2e001a2da)), closes [#34301](https://github.com/frappe/erpnext/issues/34301) [#34301](https://github.com/frappe/erpnext/issues/34301)
2023-03-07 14:26:16 +00:00
Deepesh Garg
1cf79f05c5 Merge pull request #34327 from frappe/version-14-hotfix
chore: release v14
2023-03-07 19:54:30 +05:30
s-aga-r
b37712c038 perf: update_completed_qty() in material_request.py
(cherry picked from commit 8ad9e99cea)
2023-03-07 12:33:48 +00:00
s-aga-r
1b514632d2 perf: Stock Entry (Material Transfer)
(cherry picked from commit de18f98c5c)
2023-03-07 12:33:47 +00:00
Deepesh Garg
a2e001a2da Revert "refactor: use renamed timezone utils (#34301)"
Revert "refactor: use renamed timezone utils (#34301)"

This reverts commit 164933aae8.
2023-03-07 17:56:57 +05:30
Devin Slauenwhite
1a629b6418 fix: exchange rate revaluation errors (#33947)
* fix: set new balance for non-positive balances

* fix: don't add debit: 0, credit: 0 entries to journal entry.

* fix: add journal entry difference to unbooked gain/loss of exchange.

* chore: linter

* chore: remove invlaid TODO. [skip-ci]

(cherry picked from commit 6de826b8c4)
2023-03-07 11:46:58 +00:00
mergify[bot]
164933aae8 refactor: use renamed timezone utils (#34301)
refactor: use renamed timezone utils

https://github.com/frappe/frappe/pull/20253
(cherry picked from commit 502a37a864)

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-07 16:52:56 +05:30
mergify[bot]
0e9f9c31a0 fix(minor): Dirty the form after clicking on Get advances button in Invoices (#34323)
fix(minor): Dirty the form after clicking on Get advances button in Invoices (#34323)

fix(minor): Dirty form after clicking on Get advances button

(cherry picked from commit 2feb27e399)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2023-03-07 15:47:54 +05:30
mergify[bot]
71a281fb11 fix: Performance improvement when adding a new item (#34195)
fix: Performance improvement when adding a new item

(cherry picked from commit 49af5ba434)

Co-authored-by: HarryPaulo <paulo_fabris@hotmail.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-03-07 15:46:18 +05:30
mergify[bot]
64c758d0c0 fix: Default sales team not getting set (#34284)
fix: Default sales team not getting set (#34284)

(cherry picked from commit 7d0199d743)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-07 15:45:43 +05:30
mergify[bot]
480797e856 fix: Do not calculate commission post submit (#34267)
fix: Do not calculate commission post submit (#34267)

* fix: Do not calculate commision post submit

* chore: Update condition to match server side logic

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>

---------

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
(cherry picked from commit 10632d75b0)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-07 15:44:15 +05:30
mergify[bot]
ca59c699cd fix: Payment Request against sales order with disabled rounded total (#34281)
fix: Payment Request against sales order with disabled rounded total (#34281)

* fix: Payment Request against sales order with disabled rounded total

* chore: Do not consider advance amount

(cherry picked from commit ea8e23384d)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-07 13:34:25 +05:30
mergify[bot]
9b84e1e39c chore: add german translations (#34167)
chore: add german translations (#34167)

* chore: add german translations

* Apply suggestions from code review

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>

---------

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
(cherry picked from commit bbb6a62a7d)

Co-authored-by: Patrick Eissler <77415730+PatrickDenis-stack@users.noreply.github.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-03-07 11:45:51 +05:30
rohitwaghchaure
cfb93b6c58 Merge pull request #34316 from frappe/mergify/bp/version-14-hotfix/pr-34305
fix: BOM Update log not completed (backport #34305)
2023-03-07 08:39:09 +05:30
Rohit Waghchaure
235ecca9fa fix: BOM Update log not completed
(cherry picked from commit 2f157fa5d3)
2023-03-06 17:54:50 +00:00
Sagar Sharma
c49be03d0f Merge pull request #34300 from frappe/mergify/bp/version-14-hotfix/pr-34299
fix: Stock Reconciliation `actual_qty` (backport #34299)
2023-03-04 18:00:33 +05:30
s-aga-r
d97c1bf0f4 fix: Stock Reconciliation actual_qty
(cherry picked from commit 70de444b7b)
2023-03-04 12:05:49 +00:00
Sagar Sharma
2f74427132 Merge pull request #34294 from frappe/mergify/bp/version-14-hotfix/pr-34293
fix: `Inventory Dimension` for `Stock Reconciliation` (backport #34293)
2023-03-04 16:49:59 +05:30
s-aga-r
ab737424c2 fix: update inventory dimensions before returning sle 2023-03-04 16:07:59 +05:30
s-aga-r
b08cdc00f2 fix: Inventory Dimension for Stock Reconciliation
(cherry picked from commit 0e1b7760a8)
2023-03-03 20:43:56 +00:00
Deepesh Garg
829bbdd5c5 Merge pull request #34280 from frappe/mergify/bp/version-14-hotfix/pr-34258
chore: Make finance book read only (backport #34258)
2023-03-03 11:09:13 +05:30
Deepesh Garg
1cdf7e0988 chore: Make finance book read only
(cherry picked from commit 28dd1a25cb)
2023-03-02 11:18:42 +00:00
Sagar Sharma
fa1b25d0f2 Merge pull request #34278 from frappe/mergify/bp/version-14-hotfix/pr-34117
refactor: rewrite `get_item_details.py` queries in `QB` (backport #34117)
2023-03-02 15:25:12 +05:30
s-aga-r
731dc4cdd9 chore: Linters
(cherry picked from commit 58c027d4cc)
2023-03-02 09:25:38 +00:00
s-aga-r
dea5290d81 refactor: remove method get_serial_no_batchwise from get_item_details.py
(cherry picked from commit 35489fbbf9)
2023-03-02 09:25:38 +00:00
s-aga-r
1e086db7c7 refactor: rewrite get_item_details.py queries in QB
(cherry picked from commit 6b144baa69)
2023-03-02 09:25:38 +00:00
Frappe PR Bot
a59c580480 chore(release): Bumped to Version 14.17.4
## [14.17.4](https://github.com/frappe/erpnext/compare/v14.17.3...v14.17.4) (2023-03-02)

### Bug Fixes

* `rejected_serial_no` not getting copied from PR to PR(Return) ([9930adc](9930adcd28))
* `Serial No is mandatory` even if the `qty` is `0` ([7629caa](7629caa647))
2023-03-02 08:08:44 +00:00
Sagar Sharma
ba1cfa992d Merge pull request #34277 from frappe/mergify/bp/version-14/pr-34275
fix: `rejected_serial_no` not getting copied from PR to PR(Return) (backport #34273) (backport #34275)
2023-03-02 13:34:32 +05:30
s-aga-r
7629caa647 fix: Serial No is mandatory even if the qty is 0
(cherry picked from commit cb0b6de4b9)
(cherry picked from commit aa6b891ef0)
2023-03-02 07:35:46 +00:00
s-aga-r
9930adcd28 fix: rejected_serial_no not getting copied from PR to PR(Return)
(cherry picked from commit a9f0a11ce6)
(cherry picked from commit 3db82587eb)
2023-03-02 07:35:45 +00:00
Sagar Sharma
ab8ea2371b Merge pull request #34275 from frappe/mergify/bp/version-14-hotfix/pr-34273
fix: `rejected_serial_no` not getting copied from PR to PR(Return) (backport #34273)
2023-03-02 13:04:51 +05:30
s-aga-r
aa6b891ef0 fix: Serial No is mandatory even if the qty is 0
(cherry picked from commit cb0b6de4b9)
2023-03-02 07:08:15 +00:00
s-aga-r
3db82587eb fix: rejected_serial_no not getting copied from PR to PR(Return)
(cherry picked from commit a9f0a11ce6)
2023-03-02 07:08:14 +00:00
Suraj Shetty
da150e1a3c Merge pull request #34265 from frappe/mergify/bp/version-14-hotfix/pr-34262
fix(General Ledger): Wrap unexpectedly long word  (backport #34262)
2023-03-01 16:27:57 +05:30
Suraj Shetty
f6469d8398 fix: Resolve conflicts 2023-03-01 16:25:25 +05:30
Suraj Shetty
b13bf1ebc5 fix: Wrap unexpectedly long text in remark
(cherry picked from commit ba66a6714c)

# Conflicts:
#	erpnext/accounts/report/general_ledger/general_ledger.html
2023-03-01 10:53:38 +00:00
Frappe PR Bot
60a1e10b11 chore(release): Bumped to Version 14.17.3
## [14.17.3](https://github.com/frappe/erpnext/compare/v14.17.2...v14.17.3) (2023-03-01)

### Bug Fixes

* consumed qty validation for subcontracting receipt ([6ba9750](6ba97504ed))
2023-03-01 10:22:45 +00:00
rohitwaghchaure
1b578483f4 Merge pull request #34261 from frappe/mergify/bp/version-14/pr-34260
fix: consumed qty validation for subcontracting receipt (backport #34254) (backport #34260)
2023-03-01 15:41:54 +05:30
Rohit Waghchaure
6ba97504ed fix: consumed qty validation for subcontracting receipt
(cherry picked from commit b38fe24090)
(cherry picked from commit 7eccf431fd)
2023-03-01 10:10:02 +00:00
rohitwaghchaure
5e51ba2342 Merge pull request #34260 from frappe/mergify/bp/version-14-hotfix/pr-34254
fix: consumed qty validation for subcontracting receipt (backport #34254)
2023-03-01 15:39:29 +05:30
Rohit Waghchaure
7eccf431fd fix: consumed qty validation for subcontracting receipt
(cherry picked from commit b38fe24090)
2023-03-01 09:46:22 +00:00
rohitwaghchaure
0d6a2aed3e Merge pull request #34242 from frappe/mergify/bp/version-14-hotfix/pr-34235
feat: adjust purchase receipt valuation rate as per purchase invoice rate (backport #34235)
2023-02-28 22:11:21 +05:30
Frappe PR Bot
cc4448b5d5 chore(release): Bumped to Version 14.17.2
## [14.17.2](https://github.com/frappe/erpnext/compare/v14.17.1...v14.17.2) (2023-02-28)

### Bug Fixes

* conversion factor not set ([089c7d0](089c7d0a37))
* currency in coa import ([#34174](https://github.com/frappe/erpnext/issues/34174)) ([4d92d46](4d92d469e4))
* default date in Subcontracting reports ([5fce8e2](5fce8e2700))
* german translations ([#31732](https://github.com/frappe/erpnext/issues/31732)) ([88a781f](88a781fa43))
* incorrect acc depr amount if multiple FBs with straight line or manual method ([dda6bae](dda6baea3e))
* incorrect color in the BOM Stock Report ([001ed9e](001ed9e9ff))
* manual depr schedule ([971c072](971c0720e5))
* multiple pos conversion issue resolved ([db964e8](db964e8256))
* not able to repost gl entries ([ae0318e](ae0318ef74))
* permission error while calling get_work_order_items ([3ea90ee](3ea90ee5cb))
* pos return throwing amount greater than grand total ([9cd7b27](9cd7b27ce0))
* Remove missing DocField in fetch_from ([dc6ae46](dc6ae46d59))
* set `from_warehouse` and `to_warehouse` while mapping SE ([80e23d0](80e23d035e))
* **test:** use standalone method to fetch work orders from SO ([1719884](17198844c0))
* ui freeze on item selection in sales invoice ([1750ed4](1750ed4fb6))
* user shouldn't able to make item price for item template ([fb8e45d](fb8e45d3d9))
* zero division error while making LCV ([1859be6](1859be6fef))

### Performance Improvements

* fetch SLE's on demand and memoize ([db1f17e](db1f17e5bc))

### Reverts

* Revert "fix: Concurrency issues in Sales and Purchase returns" (#34202) ([9341d3e](9341d3e60e)), closes [#34202](https://github.com/frappe/erpnext/issues/34202) [#34019](https://github.com/frappe/erpnext/issues/34019)
2023-02-28 13:29:26 +00:00
ruthra kumar
60ab0d3981 Merge pull request #34238 from frappe/version-14-hotfix
chore: release v14
2023-02-28 18:57:57 +05:30
ruthra kumar
01b5ed91ba Merge pull request #34245 from frappe/mergify/bp/version-14-hotfix/pr-34241
fix: pos return throwing amount greater than grand total (backport #34241)
2023-02-28 18:32:48 +05:30
ruthra kumar
9cd7b27ce0 fix: pos return throwing amount greater than grand total
(cherry picked from commit 35c70f39fa)
2023-02-28 12:53:32 +00:00
rohitwaghchaure
521f19a044 Merge pull request #34244 from frappe/mergify/bp/version-14-hotfix/pr-34243
fix: default date in Subcontracting reports (backport #34243)
2023-02-28 18:06:34 +05:30
Rohit Waghchaure
5fce8e2700 fix: default date in Subcontracting reports
(cherry picked from commit dfddc4efc3)
2023-02-28 12:32:13 +00:00
Rohit Waghchaure
5e9f1dfbb3 fix: labels name
(cherry picked from commit a8445da02a)
2023-02-28 12:05:58 +00:00
Rohit Waghchaure
3ea1c73c07 test: added test cases
(cherry picked from commit 8e86553717)
2023-02-28 12:05:57 +00:00
Rohit Waghchaure
db033c6862 feat: adjust purchase receipt valuation rate as per purchase invoice rate
(cherry picked from commit eab775ef32)
2023-02-28 12:05:56 +00:00
Sagar Sharma
667ec983ec Merge pull request #34236 from frappe/mergify/bp/version-14-hotfix/pr-34060
fix: multiple Point of Sale conversion issue resolved (backport #34060)
2023-02-28 16:49:35 +05:30
Vishal
bbcd101613 chore: minor changes in pos_controller
(cherry picked from commit f18ae5856f)
2023-02-28 09:26:38 +00:00
Vishal
f812dbc524 chore: minor change
(cherry picked from commit a51bec0269)
2023-02-28 09:26:37 +00:00
Vishal
786eb97ab4 chore: minor changes added to code
(cherry picked from commit 3ebe7d861d)
2023-02-28 09:26:37 +00:00
Vishal
db964e8256 fix: multiple pos conversion issue resolved
(cherry picked from commit 1de531e56e)
2023-02-28 09:26:36 +00:00
ruthra kumar
3117758575 Merge pull request #34219 from frappe/mergify/bp/version-14-hotfix/pr-34207
fix: permission error while calling get_work_order_items (backport #34207)
2023-02-28 10:16:36 +05:30
Sagar Sharma
7797645583 Merge pull request #34226 from frappe/mergify/bp/version-14-hotfix/pr-34225
fix: set `from_warehouse` and `to_warehouse` while mapping SE (backport #34225)
2023-02-27 13:21:03 +05:30
s-aga-r
80e23d035e fix: set from_warehouse and to_warehouse while mapping SE
(cherry picked from commit c09a61f360)
2023-02-27 07:23:21 +00:00
mergify[bot]
4d92d469e4 fix: currency in coa import (#34174)
* fix: currency in coa import

(cherry picked from commit 19c0b7a523)

* chore: change column label

(cherry picked from commit e3c000d0be)

---------

Co-authored-by: vishnu <vishnuviswambaran2002@gmail.com>
2023-02-27 12:19:12 +05:30
Sagar Sharma
14c248cfbc Merge pull request #34223 from frappe/mergify/bp/version-14-hotfix/pr-34212
fix: Remove missing DocField in fetch_from (backport #34212)
2023-02-27 12:15:43 +05:30
Brian Pond
dc6ae46d59 fix: Remove missing DocField in fetch_from
(cherry picked from commit 83f3e317e1)
2023-02-27 06:24:24 +00:00
mergify[bot]
88a781fa43 fix: german translations (#31732)
fix: german translations (#31732)

(cherry picked from commit 6b510546ae)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-02-27 11:50:45 +05:30
Sagar Sharma
dd0876da17 Merge pull request #34208 from frappe/mergify/bp/version-14-hotfix/pr-34206
fix: not able to repost gl entries (backport #34206)
2023-02-27 10:27:00 +05:30
Sagar Sharma
e93bc94f0b Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-34206 2023-02-27 10:26:45 +05:30
ruthra kumar
17198844c0 fix(test): use standalone method to fetch work orders from SO
(cherry picked from commit a11d3327df)
2023-02-27 04:33:17 +00:00
ruthra kumar
3ea90ee5cb fix: permission error while calling get_work_order_items
(cherry picked from commit b6bad728cd)
2023-02-27 04:33:17 +00:00
Anand Baburajan
a9b8187dd0 Merge pull request #34205 from AnandBaburajan/manual_asset_schedule
fix: asset manual depr schedule
2023-02-26 20:07:50 +05:30
anandbaburajan
d56ca011fe chore: refactor long if conditions 2023-02-26 15:03:16 +05:30
anandbaburajan
75386e3653 chore: should prepare schedule if not draft 2023-02-25 21:17:18 +05:30
anandbaburajan
dda6baea3e fix: incorrect acc depr amount if multiple FBs with straight line or manual method 2023-02-25 14:43:24 +05:30
Rohit Waghchaure
ae0318ef74 fix: not able to repost gl entries
(cherry picked from commit 7d10dd9ea8)
2023-02-24 15:41:25 +00:00
anandbaburajan
b0d670a51d chore: handle change in opening_accumulated_depreciation properly 2023-02-24 20:35:29 +05:30
Anand Baburajan
e0ad1a305e Merge branch 'version-14-hotfix' into manual_asset_schedule 2023-02-24 18:14:03 +05:30
rohitwaghchaure
dddbfba6da Merge pull request #34200 from frappe/mergify/bp/version-14-hotfix/pr-34199
fix: conversion factor not set (backport #34199)
2023-02-24 17:53:03 +05:30
Anand Baburajan
149043e8d4 Merge branch 'version-14-hotfix' into manual_asset_schedule 2023-02-24 16:48:43 +05:30
anandbaburajan
971c0720e5 fix: manual depr schedule 2023-02-24 16:38:39 +05:30
Frappe PR Bot
cb266cd1c6 chore(release): Bumped to Version 14.17.1
## [14.17.1](https://github.com/frappe/erpnext/compare/v14.17.0...v14.17.1) (2023-02-24)

### Reverts

* Revert "fix: Concurrency issues in Sales and Purchase returns" (#34202) ([3c2e21e](3c2e21e2ae)), closes [#34202](https://github.com/frappe/erpnext/issues/34202) [#34019](https://github.com/frappe/erpnext/issues/34019)
2023-02-24 10:07:56 +00:00
Deepesh Garg
d6d1238974 Merge pull request #34204 from frappe/mergify/bp/version-14/pr-34203
Revert "fix: Concurrency issues in Sales and Purchase returns" (backport #34202) (backport #34203)
2023-02-24 15:36:02 +05:30
Deepesh Garg
3c2e21e2ae Revert "fix: Concurrency issues in Sales and Purchase returns" (#34202)
Revert "fix: Concurrency issues in Sales and Purchase returns (#34019)"

This reverts commit a67284e96d.

(cherry picked from commit e26c6dc76b)
(cherry picked from commit 9341d3e60e)
2023-02-24 10:03:47 +00:00
Deepesh Garg
c6a46bc184 Merge pull request #34203 from frappe/mergify/bp/version-14-hotfix/pr-34202
Revert "fix: Concurrency issues in Sales and Purchase returns" (backport #34202)
2023-02-24 15:32:00 +05:30
Deepesh Garg
9341d3e60e Revert "fix: Concurrency issues in Sales and Purchase returns" (#34202)
Revert "fix: Concurrency issues in Sales and Purchase returns (#34019)"

This reverts commit a67284e96d.

(cherry picked from commit e26c6dc76b)
2023-02-24 09:58:40 +00:00
Rohit Waghchaure
089c7d0a37 fix: conversion factor not set
(cherry picked from commit 8e46aebc50)
2023-02-24 09:27:37 +00:00
rohitwaghchaure
230e345732 Merge pull request #34190 from frappe/mergify/bp/version-14-hotfix/pr-34189
fix: user shouldn't able to make item price for item template (backport #34189)
2023-02-24 09:23:22 +05:30
Rohit Waghchaure
fb8e45d3d9 fix: user shouldn't able to make item price for item template
(cherry picked from commit 6417ae0ee8)
2023-02-23 15:18:43 +00:00
rohitwaghchaure
b2582c56b7 Merge pull request #34177 from frappe/mergify/bp/version-14-hotfix/pr-34173
fix: incorrect color in the BOM Stock Report (backport #34173)
2023-02-23 20:47:24 +05:30
ruthra kumar
908d2f687e Merge pull request #34184 from frappe/mergify/bp/version-14-hotfix/pr-34022
perf: Gross Profit report will fetch SLE's on demand and memoize (backport #34022)
2023-02-23 12:54:25 +05:30
ruthra kumar
204f9a414f refactor: use docstatus from Delivery Note Item
(cherry picked from commit 88d888d9d0)
2023-02-23 06:26:15 +00:00
ruthra kumar
db1f17e5bc perf: fetch SLE's on demand and memoize
(cherry picked from commit 3e5691072a)
2023-02-23 06:26:15 +00:00
rohitwaghchaure
292f7c57c5 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-34173 2023-02-23 11:36:34 +05:30
rohitwaghchaure
b0103b85a0 Merge pull request #34181 from frappe/mergify/bp/version-14-hotfix/pr-34172
fix: zero division error while making LCV (backport #34172)
2023-02-23 11:25:03 +05:30
Rohit Waghchaure
1859be6fef fix: zero division error while making LCV
(cherry picked from commit 80e94a08cf)
2023-02-23 05:24:58 +00:00
ruthra kumar
b37695f2f3 Merge pull request #34180 from frappe/mergify/bp/version-14-hotfix/pr-34176
fix: ui freeze upon item selection in sales invoice (backport #34176)
2023-02-23 10:52:32 +05:30
ruthra kumar
1750ed4fb6 fix: ui freeze on item selection in sales invoice
(cherry picked from commit 6412583e98)
2023-02-23 05:06:51 +00:00
Rohit Waghchaure
001ed9e9ff fix: incorrect color in the BOM Stock Report
(cherry picked from commit a8f03ebf7f)
2023-02-23 04:25:45 +00:00
Frappe PR Bot
0d986a2ac4 chore(release): Bumped to Version 14.17.0
# [14.17.0](https://github.com/frappe/erpnext/compare/v14.16.1...v14.17.0) (2023-02-21)

### Bug Fixes

* asset repair status after deletion and asset status after manual depr entry ([03f07a2](03f07a20e7))
* asset_depreciation_and_balances report doesn't reflect manual depr entries ([1535c3d](1535c3d856))
* change parameter name for letter head ([4f37ba9](4f37ba9cfe))
* check for duplicate in pos closing and pos merge log entry ([05d6490](05d649087b))
* consider rounded total amount while making payment request ([#34110](https://github.com/frappe/erpnext/issues/34110)) ([7879564](78795643cc))
* create `Delivery Trip` from `Delivery Note` list ([ba5ea88](ba5ea886cf))
* differency entry journal debit/credit missing ([#34104](https://github.com/frappe/erpnext/issues/34104)) ([7556739](75567391a7))
* Filters in item-wise sales history report ([#34145](https://github.com/frappe/erpnext/issues/34145)) ([44c837f](44c837f862))
* fiscal year error for existing assets in fixed asset register ([7074c2b](7074c2b161))
* forced delete linked desktop_icons (backport [#34107](https://github.com/frappe/erpnext/issues/34107)) ([#34130](https://github.com/frappe/erpnext/issues/34130)) ([53ab4d9](53ab4d92e8))
* ignore repost payment ledger on basic documents cancellation ([#34054](https://github.com/frappe/erpnext/issues/34054)) ([9890cce](9890cce680))
* incorrect consumed qty in subcontracting receipt ([d5f6a5d](d5f6a5d193))
* inventory dimension filter not overriding with existing filter for stock ledger report ([6959283](6959283893))
* linters issue ([f65e471](f65e471a75))
* opening_accumulated_depreciation and precision in charts ([47cc8ab](47cc8ab6c6))
* purchase invoice performance issue ([8d98599](8d98599a6c))
* rename duplicate field name with same type into a DocType to avoid import Error ([#34053](https://github.com/frappe/erpnext/issues/34053)) ([d783168](d7831685af))
* show Purchase Order Portal `Pay` button based on configuration ([84da0c6](84da0c6f1e))
* update `reserved_qty` when `Sales Order` marked as `Hold` ([15898cc](15898cc2ec))
* Use normal rounding for Tax Withholding Category ([#34114](https://github.com/frappe/erpnext/issues/34114)) ([65aec3e](65aec3e4ff))
* **ux:** `ReferenceError: me is not defined` Delivery Note ([7bd04c2](7bd04c27c8))

### Features

* allow to make in transit transfer entry from material request ([a7b682e](a7b682e26b))
* Editable Sales Invoice ([#32625](https://github.com/frappe/erpnext/issues/32625)) ([00eb632](00eb6329a7))
* provision to convert transaction based reposting to item warehouse based reposting ([72c0b22](72c0b2208f))
* translate fixtures during runtime, not installation ([#33996](https://github.com/frappe/erpnext/issues/33996)) ([d117de7](d117de7813))
2023-02-21 17:17:32 +00:00
Deepesh Garg
9aa25c4373 Merge pull request #34161 from frappe/version-14-hotfix
chore: release v14
2023-02-21 22:45:54 +05:30
ruthra kumar
9c43e3a721 Merge pull request #34164 from frappe/mergify/bp/version-14-hotfix/pr-34102
fix: check for duplicate pos invoices in closing entry (backport #34102)
2023-02-21 20:03:08 +05:30
ruthra kumar
05d649087b fix: check for duplicate in pos closing and pos merge log entry
(cherry picked from commit 47add0b751)
2023-02-21 13:16:33 +00:00
mergify[bot]
74a3588e04 patch: reorder migration patches (#34071)
chore: reorder migration patches.

'migrate_gl_to_payment_ledger',
'migrate_remarks_from_gl_to_payment_ledger' should always run last.

(cherry picked from commit 68202639f5)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-02-21 15:34:24 +05:30
mergify[bot]
0bd765b8ca refactor: clear records in batches in 'Transaction Deletion Record' (#34109)
refactor: clear records in batches in 'Transaction Deletion Record' (#34109)

refactor: clear records in batches
(cherry picked from commit 4a7b1de2d8)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-02-21 15:06:45 +05:30
mergify[bot]
44c837f862 fix: Filters in item-wise sales history report (#34145)
fix: Filters in item-wise sales history report (#34145)

(cherry picked from commit c88444a6c4)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-21 15:06:00 +05:30
mergify[bot]
65aec3e4ff fix: Use normal rounding for Tax Withholding Category (#34114)
fix: Use normal rounding for Tax Withholding Category (#34114)

(cherry picked from commit 35cdd996a9)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-21 14:22:57 +05:30
mergify[bot]
00eb6329a7 feat: Editable Sales Invoice (#32625)
* feat: Editable Sales Invoice

(cherry picked from commit 30da6ab2c1)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.json

* chore: Update allow on submit for Sales Invoice fields

(cherry picked from commit e626107d3d)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json

* chore: Break into smaller functions

(cherry picked from commit 42e4c37f15)

* chore: Update allow on submit fields

(cherry picked from commit 1105e52031)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.json

* test: Add unit tests

(cherry picked from commit ed98015a56)

* chore: Update tests

(cherry picked from commit 1a980123a2)

* chore: Reset repost_required_flag on cancel

(cherry picked from commit 0966867c08)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.py

* chore: Enable no-copy for repost required field

(cherry picked from commit 5fe55176ec)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.json

* chore: Validate for deferred revenue invoices

(cherry picked from commit e29f756146)

* chore: Resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-21 14:21:36 +05:30
Anand Baburajan
ce817e97eb Merge pull request #34155 from frappe/mergify/bp/version-14-hotfix/pr-34153
fix: fiscal year error for existing assets in fixed asset register (backport #34153)
2023-02-21 14:18:21 +05:30
anandbaburajan
7074c2b161 fix: fiscal year error for existing assets in fixed asset register
(cherry picked from commit 76861eb332)
2023-02-21 08:25:46 +00:00
Sagar Sharma
0de0501a48 Merge pull request #34146 from frappe/mergify/bp/version-14-hotfix/pr-34138
fix(ux): `ReferenceError: me is not defined` Delivery Note (backport #34138)
2023-02-21 10:31:17 +05:30
s-aga-r
bc86b6977f chore: Linters
(cherry picked from commit 44ee9f0f19)
2023-02-21 04:57:41 +00:00
s-aga-r
7bd04c27c8 fix(ux): ReferenceError: me is not defined Delivery Note
(cherry picked from commit 1b010add26)
2023-02-21 04:57:40 +00:00
rohitwaghchaure
92dee9e1cf Merge pull request #34141 from frappe/mergify/bp/version-14-hotfix/pr-34139
fix: inventory dimension filter not overriding with existing filter for stock ledger report (backport #34139)
2023-02-20 13:38:54 +05:30
rohitwaghchaure
3c0500efb7 Merge pull request #34140 from frappe/mergify/bp/version-14-hotfix/pr-33722
fix: purchase invoice performance issue (backport #33722)
2023-02-20 13:17:44 +05:30
Rohit Waghchaure
6959283893 fix: inventory dimension filter not overriding with existing filter for stock ledger report
(cherry picked from commit 0e388ba872)
2023-02-20 07:35:16 +00:00
Rohit Waghchaure
8d98599a6c fix: purchase invoice performance issue
(cherry picked from commit 92d857d49c)
2023-02-20 07:18:11 +00:00
mergify[bot]
75567391a7 fix: differency entry journal debit/credit missing (#34104)
fix: differency entry journal debit/credit missing (#34104)

* fix: difference entry journal is wrong

* fix: difference entry journal is wrong

(cherry picked from commit 183e42af1a)

Co-authored-by: Alirio Castro <aliriocastro@gmail.com>
2023-02-19 20:50:56 +05:30
mergify[bot]
9890cce680 fix: ignore repost payment ledger on basic documents cancellation (#34054)
fix: ignore repost payment ledger on basic documents cancellation (#34054)

fix: ignore repost payment ledger on cancel/delete of Inv/Pay/JE's

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit c722f2819c)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-02-19 20:50:37 +05:30
mergify[bot]
78795643cc fix: consider rounded total amount while making payment request (#34110)
fix: consider rounded total amount while making payment request (#34110)

(cherry picked from commit 9c6466f15b)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-02-19 13:38:02 +05:30
mergify[bot]
53ab4d92e8 fix: forced delete linked desktop_icons (backport #34107) (#34130)
fix: forced delete linked desktop_icons (#34107)

* fix: forced delete linked desktop_icons

* fix: black

(cherry picked from commit 5e48e61c66)

Co-authored-by: Shadrak Gurupnor <30501401+shadrak98@users.noreply.github.com>
2023-02-19 12:08:12 +05:30
rohitwaghchaure
ced7860d1b Merge pull request #34124 from frappe/mergify/bp/version-14-hotfix/pr-34115
feat: provision to convert transaction based reposting to item wareho… (backport #34115)
2023-02-18 23:17:55 +05:30
Rohit Waghchaure
72c0b2208f feat: provision to convert transaction based reposting to item warehouse based reposting
(cherry picked from commit f1383b5ef9)
2023-02-18 16:02:12 +00:00
Sagar Sharma
529d5f3d05 Merge pull request #34118 from frappe/mergify/bp/version-14-hotfix/pr-34077
fix: show Purchase Order Portal `Pay` button based on configuration (backport #34077)
2023-02-18 13:16:43 +05:30
s-aga-r
84da0c6f1e fix: show Purchase Order Portal Pay button based on configuration
(cherry picked from commit 20bdc63b03)
2023-02-18 06:51:14 +00:00
s-aga-r
05f7fb8fa1 chore: add field show_pay_button in Buying Settings
(cherry picked from commit d7ef5ad955)
2023-02-18 06:51:13 +00:00
Anand Baburajan
dbf39a7ff3 Merge pull request #34112 from AnandBaburajan/asset_fixes_17_feb_v14
fix: repair status after deletion, asset status after manual depr entry and other misc bugs [v14]
2023-02-17 16:13:17 +05:30
anandbaburajan
03f07a20e7 fix: asset repair status after deletion and asset status after manual depr entry 2023-02-17 15:32:55 +05:30
Sagar Sharma
48f6cc09c1 Merge pull request #34098 from frappe/mergify/bp/version-14-hotfix/pr-34091
fix: incorrect consumed qty in subcontracting receipt (backport #34091)
2023-02-16 17:29:06 +05:30
Rohit Waghchaure
d5f6a5d193 fix: incorrect consumed qty in subcontracting receipt
(cherry picked from commit 156e45970a)
2023-02-16 09:41:06 +00:00
Sagar Sharma
bafb976bbd Merge pull request #34093 from frappe/mergify/bp/version-14-hotfix/pr-34053
fix: rename duplicate field name with same type into a DocType to avoid import Error (backport #34053)
2023-02-16 14:29:12 +05:30
Sagar Sharma
1367e09f0f Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-34053 2023-02-16 14:28:49 +05:30
Sagar Sharma
7fefad9f5c Merge pull request #34095 from frappe/mergify/bp/version-14-hotfix/pr-34090
chore: update `CODEOWNERS` (backport #34090)
2023-02-16 14:27:36 +05:30
Sagar Sharma
f7ea98cf44 chore: update CODEOWNERS
(cherry picked from commit e8b8c51d82)
2023-02-16 08:57:04 +00:00
s-aga-r
2fdf6ab164 chore: conflicts 2023-02-16 14:01:17 +05:30
HENRY Florian
d7831685af fix: rename duplicate field name with same type into a DocType to avoid import Error (#34053)
* fix: Delivery Note field label set

* fix: Item field label de-duplicate name

* fix: Payment Entry field label de-duplicate name

* fix: Pruicing Rule field label de-duplicate name

* fix: Project field label de-duplicate name

* fix: Timesheet field label de-duplicate name

* Update erpnext/accounts/doctype/pricing_rule/pricing_rule.json

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>

* Update erpnext/stock/doctype/item/item.json

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>

---------

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
(cherry picked from commit 4d79ffe3c6)

# Conflicts:
#	erpnext/stock/doctype/item/item.json
2023-02-16 08:17:47 +00:00
Sagar Sharma
b01da15ce2 Merge pull request #34087 from frappe/mergify/bp/version-14-hotfix/pr-34086
fix: create `Delivery Trip` from `Delivery Note` list (backport #34086)
2023-02-15 22:44:58 +05:30
s-aga-r
ba5ea886cf fix: create Delivery Trip from Delivery Note list
(cherry picked from commit 6c6195bae6)
2023-02-15 17:11:41 +00:00
Sagar Sharma
702a3e5ce1 Merge pull request #34085 from frappe/mergify/bp/version-14-hotfix/pr-34080
chore: copy `item_code` to `Batch` while creating new batch from SCR (backport #34080)
2023-02-15 21:48:20 +05:30
s-aga-r
72e17e3267 chore: copy item_code to Batch while creating new batch from SCR
(cherry picked from commit ffa9c6e4d9)
2023-02-15 16:10:57 +00:00
Frappe PR Bot
e82c101b13 chore(release): Bumped to Version 14.16.1
## [14.16.1](https://github.com/frappe/erpnext/compare/v14.16.0...v14.16.1) (2023-02-15)

### Bug Fixes

* asset_depreciation_and_balances report doesn't reflect manual depr entries ([7692db2](7692db27bd))
* opening_accumulated_depreciation and precision in charts ([4a209fc](4a209fcb7c))
2023-02-15 10:33:52 +00:00
Anand Baburajan
a934cf0d92 Merge pull request #34074 from frappe/mergify/bp/version-14/pr-34058
fix: manual depr entries in asset_depreciations_and_balances report and some misc bugs [v14] (backport #34058)
2023-02-15 16:02:16 +05:30
anandbaburajan
7692db27bd fix: asset_depreciation_and_balances report doesn't reflect manual depr entries
(cherry picked from commit 1535c3d856)
2023-02-15 08:36:28 +00:00
anandbaburajan
be2ddd1536 chore: break look if je processed
(cherry picked from commit a220dc0c9c)
2023-02-15 08:36:28 +00:00
anandbaburajan
4a209fcb7c fix: opening_accumulated_depreciation and precision in charts
(cherry picked from commit 47cc8ab6c6)
2023-02-15 08:36:28 +00:00
Anand Baburajan
09f5e290a3 Merge pull request #34058 from AnandBaburajan/more_asset_bug_fixes_v14
fix: manual depr entries in asset_depreciations_and_balances report and some misc bugs [v14]
2023-02-15 12:33:30 +05:30
Anand Baburajan
8d61404a5b Merge branch 'version-14-hotfix' into more_asset_bug_fixes_v14 2023-02-15 11:55:52 +05:30
rohitwaghchaure
bc8cf10e39 Merge pull request #34070 from frappe/mergify/bp/version-14-hotfix/pr-34065
fix: change parameter name for letter head (backport #34065)
2023-02-15 10:08:30 +05:30
rohitwaghchaure
eb300f52d9 Merge pull request #34069 from frappe/mergify/bp/version-14-hotfix/pr-34061
feat: allow to make in transit transfer entry from material request (backport #34061)
2023-02-15 09:57:30 +05:30
barredterra
bb174f931d test: download RFQ PDF
(cherry picked from commit d5b7f2e49e)
2023-02-15 04:01:57 +00:00
barredterra
1e2611fb1e refactor: download RFQ PDF
(cherry picked from commit 8e40c04494)
2023-02-15 04:01:56 +00:00
barredterra
4f37ba9cfe fix: change parameter name for letter head
To match changes from https://github.com/frappe/frappe/pull/19627

(cherry picked from commit f7fd30fecf)
2023-02-15 04:01:56 +00:00
rohitwaghchaure
f65e471a75 fix: linters issue 2023-02-15 09:28:56 +05:30
Rohit Waghchaure
a7b682e26b feat: allow to make in transit transfer entry from material request
(cherry picked from commit 5b6128848f)
2023-02-15 03:39:12 +00:00
Anand Baburajan
a3f96652d4 Merge pull request #34062 from frappe/mergify/bp/version-14-hotfix/pr-34059
chore: add anand to asset's codeowner (backport #34059)
2023-02-14 20:16:52 +05:30
anandbaburajan
dbd4466817 chore: add anand to asset's codeowner
(cherry picked from commit d003370f61)
2023-02-14 14:21:38 +00:00
Anand Baburajan
25951debb5 Merge branch 'version-14-hotfix' into more_asset_bug_fixes_v14 2023-02-14 18:14:14 +05:30
anandbaburajan
1535c3d856 fix: asset_depreciation_and_balances report doesn't reflect manual depr entries 2023-02-14 17:54:51 +05:30
Sagar Sharma
2bc12d478b Merge pull request #34055 from frappe/mergify/bp/version-14-hotfix/pr-34018
fix: update `reserved_qty` when `Sales Order` marked as `Hold` (backport #34018)
2023-02-14 17:41:01 +05:30
Sagar Sharma
7dff06a0f6 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-34018 2023-02-14 17:40:48 +05:30
Deepesh Garg
1f6474d5ab Merge pull request #34047 from frappe/mergify/bp/version-14-hotfix/pr-33996
feat: translate fixtures during runtime, not installation (backport #33996)
2023-02-14 16:57:29 +05:30
s-aga-r
15898cc2ec fix: update reserved_qty when Sales Order marked as Hold
(cherry picked from commit d76759e066)
2023-02-14 11:22:52 +00:00
Frappe PR Bot
26c9782960 chore(release): Bumped to Version 14.16.0
# [14.16.0](https://github.com/frappe/erpnext/compare/v14.15.1...v14.16.0) (2023-02-14)

### Bug Fixes

* `amount` in `Material Request` ([f1dd923](f1dd923a50))
* `get_picked_items_details` ([7afbd92](7afbd9201d))
* `pymysql.err.ProgrammingError` ([aa3dd33](aa3dd33f56))
* Add missing 1 required positional argument: 'bill_date' ([ced9274](ced9274d1b))
* add payment hook to point of sale JS ([#33988](https://github.com/frappe/erpnext/issues/33988)) ([49fd712](49fd712966))
* allow PI cancel if linked asset is cancelled ([c98b2b5](c98b2b5918))
* Amount for debit and credit notes with 0 qty line items ([#33902](https://github.com/frappe/erpnext/issues/33902)) ([87a8c17](87a8c17314))
* Amount validation in Payment Request against Purchase Order ([#34042](https://github.com/frappe/erpnext/issues/34042)) ([c7c6123](c7c61239a3))
* BOM import failed as importer use same label field for Raw MaterialsItem table and Scrap Item table ([47d17f4](47d17f4136))
* Concurrency issues in Sales and Purchase returns ([#34019](https://github.com/frappe/erpnext/issues/34019)) ([087333a](087333abcb))
* consider `stock_qty` if `picked_qty` is zero ([df72e4a](df72e4a221))
* consider existing pick list ([466a791](466a791f68))
* currency formatting in item-wise sales history ([#33903](https://github.com/frappe/erpnext/issues/33903)) ([8e2d7bb](8e2d7bb44a))
* default due_date was wrong calculated on template "_Test Payment Term Template 1" (last day of next month) ([c8c9c50](c8c9c50993))
* **ecommerce:** throw invalid doctype error in shop by category ([#33901](https://github.com/frappe/erpnext/issues/33901)) ([1d0e71b](1d0e71bfe5))
* failed test, convert date time to string ([7228a49](7228a492ef))
* german chart of accounts "SKR03" ([#33909](https://github.com/frappe/erpnext/issues/33909)) ([02c4c55](02c4c55adc))
* Ignore mandatory fields while creating tax templates for new companies ([#34005](https://github.com/frappe/erpnext/issues/34005)) ([b0ed3c8](b0ed3c8aed))
* Ignore Payment Ledger Entry on dunning cancel (backport [#34025](https://github.com/frappe/erpnext/issues/34025)) ([#34028](https://github.com/frappe/erpnext/issues/34028)) ([699e93e](699e93e17f))
* incorrect actual qty in Bin ([01ff6a1](01ff6a1f19))
* IntegrityError while cancelling journals against cr note ([c71d035](c71d03555f))
* list view for Terms and Conditions ([#33925](https://github.com/frappe/erpnext/issues/33925)) ([bb8e232](bb8e232aea))
* negative stock error ([e0cd6c2](e0cd6c20a3))
* set per_billed based on hours when amounts are zero ([#33984](https://github.com/frappe/erpnext/issues/33984)) ([5270fbe](5270fbe01a))
* should never get cutomer price on purchase document ([#34002](https://github.com/frappe/erpnext/issues/34002)) ([6fe7600](6fe7600844)), closes [#33998](https://github.com/frappe/erpnext/issues/33998)
* stock entry from item dashboard (stock levels) ([04a474d](04a474d0a1))
* **test:** `test_pick_list_for_items_with_multiple_UOM()` ([7124c0c](7124c0ca30))
* unwanted difference amount calculation on cr note and invoice with same currency ([#34020](https://github.com/frappe/erpnext/issues/34020)) ([cbafc51](cbafc51e75))

### Features

* Add filters in Loan Interest Report ([#33907](https://github.com/frappe/erpnext/issues/33907)) ([52bfb66](52bfb66729))
* add incoterm named place to RFQ ([68a1615](68a1615eae))
* mandatory and mandatory depends on in inventory dimension ([3aca84c](3aca84c43f))
* Setting to allow Sales Order creation against expired quotation ([#33952](https://github.com/frappe/erpnext/issues/33952)) ([4d0e27e](4d0e27ed2b))

### Performance Improvements

* reduce memory usage by paging through records ([3ce8dc7](3ce8dc70cb))
* reduce memory usage while migrating remarks ([c191a3f](c191a3f7c6))
2023-02-14 10:38:44 +00:00
Deepesh Garg
7dee5207df Merge pull request #34051 from frappe/version-14-hotfix
chore: release v14
2023-02-14 16:06:52 +05:30
rohitwaghchaure
e214a336be Merge pull request #34049 from frappe/mergify/bp/version-14-hotfix/pr-34046
fix: BOM import failed as use same label field for Raw Materials Item table and Scrap Item table (backport #34046)
2023-02-14 11:55:29 +05:30
Florian HENRY
47d17f4136 fix: BOM import failed as importer use same label field for Raw MaterialsItem table and Scrap Item table
(cherry picked from commit 86be259341)
2023-02-14 05:00:25 +00:00
Raffael Meyer
d117de7813 feat: translate fixtures during runtime, not installation (#33996)
feat: install untranslated fixtures from files

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 770369e5c1)
2023-02-14 04:00:23 +00:00
mergify[bot]
6fe7600844 fix: should never get cutomer price on purchase document (#34002)
fix: should never get cutomer price on purchase document (#34002)

* fix: never get cutomer price on purchase document

chores: syntax

chore: typo in stock_entry get_uom_details (#33998)

fix: typo in stock_entry get_uom_details

chores: syntax

* feat: add test for get_item_detail price list oriented

* feat: add test for get_item_detail price price oriented

* feat: add test for get_item_detail price price oriented

* chore: clean test code

(cherry picked from commit 231fe4156f)

Co-authored-by: HENRY Florian <florian.henry@open-concept.pro>
2023-02-14 08:59:25 +05:30
mergify[bot]
c7c61239a3 fix: Amount validation in Payment Request against Purchase Order (#34042)
fix: Amount validation in Payment Request against Purchase Order (#34042)

(cherry picked from commit ce748cec3a)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-14 08:59:03 +05:30
anandbaburajan
a220dc0c9c chore: break look if je processed 2023-02-13 17:28:46 +05:30
anandbaburajan
47cc8ab6c6 fix: opening_accumulated_depreciation and precision in charts 2023-02-13 17:22:54 +05:30
mergify[bot]
087333abcb fix: Concurrency issues in Sales and Purchase returns (#34019)
fix: Concurrency issues in Sales and Purchase returns (#34019)

(cherry picked from commit a67284e96d)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-13 16:30:03 +05:30
ruthra kumar
80c83f14e9 Merge pull request #34034 from frappe/mergify/bp/version-14-hotfix/pr-34021
fix: rare instances of IntegrityError while cancelling journals against cr note (backport #34021)
2023-02-13 14:59:12 +05:30
ruthra kumar
c71d03555f fix: IntegrityError while cancelling journals against cr note
(cherry picked from commit b9a7ff7c3d)
2023-02-13 08:45:18 +00:00
mergify[bot]
1540aea21d refactor: filter only immediate upcoming payment term for each SO (#33923)
refactor: filter only immediate upcoming payment term for each SO (#33923)

* fix: ignore closed or 'on hold' orders

* refactor: filter immediate upcoming term

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 192a3395a5)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-02-13 13:29:41 +05:30
mergify[bot]
cbafc51e75 fix: unwanted difference amount calculation on cr note and invoice with same currency (#34020)
fix: unwanted difference amount calculation on cr note and invoice with same currency (#34020)

* fix: incorrect difference amount while reconiling cr/dr notes

* fix(test): catch incorrect difference amount calculation

Fixed issues where difference amount was calculated for Cr Notes and Invoices of
the same currency.

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit e5a2b15fba)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-02-13 13:29:18 +05:30
mergify[bot]
4d0e27ed2b feat: Setting to allow Sales Order creation against expired quotation (#33952)
feat: Setting to allow Sales Order creation against expired quotation (#33952)

* feat: Setting to allow Sales Order creation against expired quotation

* chore: linting issues

(cherry picked from commit 148703bfc2)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-13 11:08:55 +05:30
mergify[bot]
699e93e17f fix: Ignore Payment Ledger Entry on dunning cancel (backport #34025) (#34028)
fix: Ignore Payment Ledger Entry on dunning cancel (#34025)

* fix: Ignore Payment Ledger Entry on dunning cancel

* chore: fix translation issue

(cherry picked from commit 48bb2c942b)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-13 10:19:19 +05:30
mergify[bot]
1d0e71bfe5 fix(ecommerce): throw invalid doctype error in shop by category (#33901)
fix(ecommerce): throw invalid doctype error in shop by category (#33901)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 0df28c7174)

Co-authored-by: Sabu Siyad <hello@ssiyad.com>
2023-02-12 13:35:54 +05:30
mergify[bot]
49fd712966 fix: add payment hook to point of sale JS (#33988)
fix: add payment hook to point of sale JS (#33988)

(cherry picked from commit a0eb5e5535)

Co-authored-by: Richard Case <110036763+casesolved-co-uk@users.noreply.github.com>
2023-02-12 09:02:40 +05:30
ruthra kumar
679b16e1bc Merge pull request #33934 from frappe/mergify/bp/version-14-hotfix/pr-33777
fix(patch): reduce memory usage while migrating remarks (backport #33777)
2023-02-11 17:50:15 +05:30
ruthra kumar
24cac4ff22 Merge pull request #33935 from frappe/mergify/bp/version-14-hotfix/pr-33776
patch: reduce memory usage by paging through records (backport #33776)
2023-02-11 17:49:55 +05:30
mergify[bot]
dd31bd5254 refactor: install fixtures (#33964)
refactor: install fixtures (#33964)

* refactor: install fixtures

* style: disable semgrep for install_defaults signature

(cherry picked from commit 201573ab9a)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-02-11 16:22:26 +05:30
mergify[bot]
5270fbe01a fix: set per_billed based on hours when amounts are zero (#33984)
fix: set per_billed based on hours when amounts are zero (#33984)

* fix: set per_billed based on hours when amounts are zero

* test: calculate_percentage_billed

(cherry picked from commit e4953df4a3)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-02-11 14:54:22 +05:30
mergify[bot]
b0ed3c8aed fix: Ignore mandatory fields while creating tax templates for new companies (#34005)
fix: Ignore mandatory fields while creating tax templates for new companies (#34005)

(cherry picked from commit 0efdc6c13a)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-11 12:27:06 +05:30
mergify[bot]
02c4c55adc fix: german chart of accounts "SKR03" (#33909)
fix: german chart of accounts "SKR03" (#33909)

* fix: german chart of accounts "SKR03"

- Added some missing account types and tax rates
- Added some missing accounts

* style: convert indentation to tabs

* fix: space before percentage sign

* feat: add some expense accounts

* refactor: replace unicode characters with utf-8

for better readability

* revert: add back groups for Bank and Cash accounts

Removed in 7d0d9c6900

(cherry picked from commit 3c7b460fd8)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-11 11:59:23 +05:30
mergify[bot]
8e2d7bb44a fix: currency formatting in item-wise sales history (#33903)
fix: currency formatting in item-wise sales history (#33903)

* fix(item-sales-history): currency formatting

* chore: linting issues

* fix: convert raw sql to qb

(cherry picked from commit 2cc7239dd5)

Co-authored-by: Dany Robert <danyrt@wahni.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-11 11:54:12 +05:30
mergify[bot]
87a8c17314 fix: Amount for debit and credit notes with 0 qty line items (#33902)
fix: Amount for debit and credit notes with 0 qty line items (#33902)

(cherry picked from commit 47c91324b1)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-11 11:53:47 +05:30
mergify[bot]
bb8e232aea fix: list view for Terms and Conditions (#33925)
fix: list view for Terms and Conditions (#33925)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit ab7293bcd3)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-02-11 11:53:27 +05:30
Deepesh Garg
dc8fc813ff Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-33777 2023-02-11 11:20:53 +05:30
mergify[bot]
52bfb66729 feat: Add filters in Loan Interest Report (#33907)
* feat: Add filters in Loan Interest Report (#33907)

(cherry picked from commit e478a5d0ce)

* chore: remove flaky tests

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-11 11:20:10 +05:30
mergify[bot]
6e8a985bc6 chore: typo in stock_entry get_uom_details (backport #33998) (#34003)
chore: typo in stock_entry get_uom_details (#33998)

fix: typo in stock_entry get_uom_details
(cherry picked from commit 185c543b73)

Co-authored-by: Akshay <60477442+akshayitzme@users.noreply.github.com>
2023-02-10 20:55:03 +05:30
Anand Baburajan
eab3c41a7b Merge pull request #33962 from frappe/mergify/bp/version-14-hotfix/pr-33946
fix: allow cancelling purchase invoice if linked asset is already cancelled (backport #33946)
2023-02-05 17:11:53 +05:30
anandbaburajan
68df9ad83c chore: use continue, not break
(cherry picked from commit 3380dc5dea)
2023-02-05 10:37:40 +00:00
anandbaburajan
c98b2b5918 fix: allow PI cancel if linked asset is cancelled
(cherry picked from commit b961321de5)
2023-02-05 10:37:40 +00:00
rohitwaghchaure
18a1707df9 Merge pull request #33955 from frappe/mergify/bp/version-14-hotfix/pr-33936
fix: negative stock error (backport #33936)
2023-02-05 12:13:30 +05:30
Sagar Sharma
6f8ff6f41d Merge pull request #33958 from frappe/mergify/bp/version-14-hotfix/pr-33942
fix: stock entry from item dashboard (stock levels) (backport #33942)
2023-02-05 10:05:13 +05:30
s-aga-r
04a474d0a1 fix: stock entry from item dashboard (stock levels)
(cherry picked from commit dc0ddf8d7e)
2023-02-05 04:17:17 +00:00
Rohit Waghchaure
388cc31e9e test: test case
(cherry picked from commit 9ae7578b07)
2023-02-04 18:05:47 +00:00
Rohit Waghchaure
e0cd6c20a3 fix: negative stock error
(cherry picked from commit 6d513e2519)
2023-02-04 18:05:47 +00:00
rohitwaghchaure
6df730ce96 Merge pull request #33954 from frappe/mergify/bp/version-14-hotfix/pr-33941
fix: default due_date was wrong calculated on template "_Test Payment Term Template 1" (last day of next month) (backport #33941)
2023-02-04 23:34:32 +05:30
developsessions
d2836c16a7 style: apply results of lint run
(cherry picked from commit c8cd351b39)
2023-02-04 17:05:39 +00:00
developsessions
7228a492ef fix: failed test, convert date time to string
(cherry picked from commit 9d0096ad9e)
2023-02-04 17:05:39 +00:00
developsessions
ced9274d1b fix: Add missing 1 required positional argument: 'bill_date'
(cherry picked from commit be1f941996)
2023-02-04 17:05:38 +00:00
developsessions
76c4dc8177 style: lint wrong from position
(cherry picked from commit c80aaad437)
2023-02-04 17:05:38 +00:00
developsessions
c8c9c50993 fix: default due_date was wrong calculated on template "_Test Payment Term Template 1" (last day of next month)
(cherry picked from commit ce8a1086a7)
2023-02-04 17:05:38 +00:00
Sagar Sharma
bccfb8184e Merge pull request #33950 from frappe/mergify/bp/version-14-hotfix/pr-33940
chore: report `Warehouse wise Item Balance Age and Value` (backport #33940)
2023-02-04 18:59:28 +05:30
s-aga-r
00e93dc076 chore: add Item Name column in Warehouse wise Item Balance Age and Value report
(cherry picked from commit 56356ffbb9)
2023-02-04 07:58:41 +00:00
s-aga-r
9f3bb84990 chore: column width in Warehouse wise Item Balance Age and Value report
(cherry picked from commit d7a665cb84)
2023-02-04 07:58:41 +00:00
ruthra kumar
3ce8dc70cb perf: reduce memory usage by paging through records
While migrating GL entries to Payment Ledger, page through records using
primary key to reduce memory usage.

(cherry picked from commit fee0ca8cd9)
2023-02-02 11:19:17 +00:00
ruthra kumar
c191a3f7c6 perf: reduce memory usage while migrating remarks
Page through records using primary key

(cherry picked from commit 9bb64107c5)
2023-02-02 11:18:12 +00:00
Sagar Sharma
6e7eee7fa3 Merge pull request #33913 from frappe/mergify/bp/version-14-hotfix/pr-33910
feat: add incoterm named place to RFQ (backport #33910)
2023-02-02 10:33:15 +05:30
Sagar Sharma
bf23984b4f Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-33910 2023-02-02 10:30:22 +05:30
Frappe PR Bot
171df32407 chore(release): Bumped to Version 14.15.1
## [14.15.1](https://github.com/frappe/erpnext/compare/v14.15.0...v14.15.1) (2023-02-01)

### Bug Fixes

* incorrect actual qty in Bin ([4c238f1](4c238f1871))
2023-02-01 17:46:44 +00:00
rohitwaghchaure
e927f30654 Merge pull request #33929 from frappe/mergify/bp/version-14/pr-33921
fix: incorrect actual qty in Bin (backport #33918) (backport #33921)
2023-02-01 23:15:02 +05:30
Rohit Waghchaure
4c238f1871 fix: incorrect actual qty in Bin
(cherry picked from commit f8c852c54c)
(cherry picked from commit 01ff6a1f19)
2023-02-01 16:53:09 +00:00
rohitwaghchaure
f5a0da21a7 Merge pull request #33921 from frappe/mergify/bp/version-14-hotfix/pr-33918
fix: incorrect actual qty in Bin (backport #33918)
2023-02-01 22:21:39 +05:30
Rohit Waghchaure
01ff6a1f19 fix: incorrect actual qty in Bin
(cherry picked from commit f8c852c54c)
2023-02-01 12:53:57 +00:00
barredterra
68a1615eae feat: add incoterm named place to RFQ
(cherry picked from commit 7156184933)
2023-02-01 05:11:00 +00:00
Sagar Sharma
2605e8a049 Merge pull request #33899 from frappe/mergify/bp/version-14-hotfix/pr-33715
fix: consider existing pick-list (backport #33715)
2023-01-31 16:39:44 +05:30
Sagar Sharma
9c2aba6619 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-33715 2023-01-31 16:15:19 +05:30
s-aga-r
075c547184 chore: conflicts 2023-01-31 16:14:45 +05:30
Sagar Sharma
cd00962b3a Merge pull request #33897 from frappe/mergify/bp/version-14-hotfix/pr-33869
fix: `amount` in `Material Request` (backport #33869)
2023-01-31 16:02:14 +05:30
Sagar Sharma
956b45ec2a Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-33869 2023-01-31 16:01:57 +05:30
rohitwaghchaure
b5baf3aa74 Merge pull request #33900 from frappe/mergify/bp/version-14-hotfix/pr-33896
feat: mandatory and mandatory depends on in inventory dimension (backport #33896)
2023-01-31 15:28:53 +05:30
Rohit Waghchaure
f47b05f58c test: added test case
(cherry picked from commit 22d0e1373b)
2023-01-31 09:49:06 +00:00
Rohit Waghchaure
3aca84c43f feat: mandatory and mandatory depends on in inventory dimension
(cherry picked from commit 423f2b5627)
2023-01-31 09:49:05 +00:00
s-aga-r
df72e4a221 fix: consider stock_qty if picked_qty is zero
(cherry picked from commit 6ffdeb1af8)
2023-01-31 09:41:20 +00:00
s-aga-r
4f56c72bed refactor: test_consider_existing_pick_list()
(cherry picked from commit 0b76a26c8a)
2023-01-31 09:41:20 +00:00
s-aga-r
cdb6abf569 test: add test cases
(cherry picked from commit bb7fe795fe)
2023-01-31 09:41:19 +00:00
s-aga-r
7124c0ca30 fix(test): test_pick_list_for_items_with_multiple_UOM()
(cherry picked from commit 207eeefc85)
2023-01-31 09:41:19 +00:00
s-aga-r
aa3dd33f56 fix: pymysql.err.ProgrammingError
(cherry picked from commit 5138ef0160)
2023-01-31 09:41:19 +00:00
s-aga-r
7afbd9201d fix: get_picked_items_details
(cherry picked from commit 7b3d496ce0)
2023-01-31 09:41:18 +00:00
s-aga-r
e8d617ada2 chore: add status field in Pick List
(cherry picked from commit be41052dc8)

# Conflicts:
#	erpnext/patches.txt
2023-01-31 09:41:18 +00:00
s-aga-r
466a791f68 fix: consider existing pick list
(cherry picked from commit b642718f08)
2023-01-31 09:41:17 +00:00
s-aga-r
140be10060 chore: add method get_picked_items_details()
(cherry picked from commit 9ae3a54ce9)
2023-01-31 09:41:17 +00:00
s-aga-r
6166a6e64f refactor: rewrite get_available_item_locations_for_serial_and_batched_item query in QB
(cherry picked from commit 57c3216683)
2023-01-31 09:41:16 +00:00
s-aga-r
d9d986a512 refactor: rewrite get_available_item_locations_for_serialized_item query in QB
(cherry picked from commit 5b76e8b193)
2023-01-31 09:41:16 +00:00
s-aga-r
167a5596cb refactor: rewrite get_available_item_locations_for_other_item query in QB
(cherry picked from commit 58dd40a2d7)
2023-01-31 09:41:15 +00:00
s-aga-r
a5d09270cb refactor: rewrite get_picked_items_qty query in QB
(cherry picked from commit 29bf787313)
2023-01-31 09:41:15 +00:00
s-aga-r
f1dd923a50 fix: amount in Material Request
(cherry picked from commit 6b781d78e0)
2023-01-31 09:15:25 +00:00
Frappe PR Bot
c8226ff642 chore(release): Bumped to Version 14.15.0
# [14.15.0](https://github.com/frappe/erpnext/compare/v14.14.0...v14.15.0) (2023-01-31)

### Bug Fixes

* Amount validation in Payment Request against Purchase Order ([#33855](https://github.com/frappe/erpnext/issues/33855)) ([5605f1e](5605f1e3ef))
* Currency symbol for tax withholding net total field ([#33850](https://github.com/frappe/erpnext/issues/33850)) ([f54e862](f54e8625f6))
* disfuctional cost center filter on Journal Entries ([#33815](https://github.com/frappe/erpnext/issues/33815)) ([58c3e16](58c3e16fec))
* disposal_was_made_on_original_schedule_date ([4586806](4586806ed1))
* double salutation on quotation print ([#33834](https://github.com/frappe/erpnext/issues/33834)) ([0fcf364](0fcf364aaa))
* Fetch commission rate from sales partner ([#33851](https://github.com/frappe/erpnext/issues/33851)) ([868c8d6](868c8d65ae))
* **gp:** fetch buying amount from dn related to so ([f5bde9c](f5bde9cf6d))
* GST Category validation broken for pos unregistered customer who dont have address. ([#33800](https://github.com/frappe/erpnext/issues/33800)) ([f124dd3](f124dd3112))
* Ignore linked JE on JE cancellation ([#33852](https://github.com/frappe/erpnext/issues/33852)) ([a0e1ee0](a0e1ee0450))
* item rate not fetching ([b98d351](b98d3514ab))
* Lead to customer creation ([#33859](https://github.com/frappe/erpnext/issues/33859)) ([44692e9](44692e9b57))
* manual depr entry not updating asset value [v14] ([#33788](https://github.com/frappe/erpnext/issues/33788)) ([f487eae](f487eae28e))
* **patch:** validation error on cost center allocation migration ([#33835](https://github.com/frappe/erpnext/issues/33835)) ([5d4967c](5d4967ceee))
* use correct filter name in `item_query` (backport [#33814](https://github.com/frappe/erpnext/issues/33814)) ([#33816](https://github.com/frappe/erpnext/issues/33816)) ([f7eabca](f7eabcafde))

### Features

* **gp:** test for inv and dn related via so ([7a793ea](7a793ea588))

### Performance Improvements

* show update items dialog ([ac2ebfb](ac2ebfbf59))
2023-01-31 06:20:11 +00:00
Deepesh Garg
cdfda06d63 Merge pull request #33873 from frappe/version-14-hotfix
chore: release v14
2023-01-31 11:48:25 +05:30
Anand Baburajan
f487eae28e fix: manual depr entry not updating asset value [v14] (#33788)
* fix: get value_after_depreciation functions and manual depr entry not updating asset value

* fix: reflect manual depr entry in chart and fixed asset register

* fix: add linked JEs in asset connections

* chore: add test

* chore: add patch and fix some things

* chore: get depreciation_expense_account properly

* chore: fix patch

* chore: fix patch

* chore: fix patch again

* chore: rename var in patch

* fix: filter assets with finance books properly

* chore: refactor get_value_after_depreciation

* chore: use dict format for filters in assets_linked_to_fb

* chore: refactor update_asset_value

* chore: sort manual depr entries
2023-01-31 10:59:38 +05:30
mergify[bot]
868c8d65ae fix: Fetch commission rate from sales partner (#33851)
fix: Fetch commission rate from sales partner (#33851)
2023-01-31 10:15:56 +05:30
ruthra kumar
670df3061a Merge pull request #33877 from frappe/mergify/bp/version-14-hotfix/pr-33736
fix(gp): fetch buying amount from dn related to so (backport #33736)
2023-01-31 09:31:20 +05:30
mergify[bot]
f54e8625f6 fix: Currency symbol for tax withholding net total field (#33850)
* fix: Currency symbol for tax withholding net total field (#33850)
2023-01-31 09:21:59 +05:30
mergify[bot]
5605f1e3ef fix: Amount validation in Payment Request against Purchase Order (#33855)
fix: Amount validation in Payment Request against Purchase Order (#33855)

fix: Amount validation in Payment Request againt Purchase Order
(cherry picked from commit a34a1f8fd2)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-31 09:20:33 +05:30
mergify[bot]
44692e9b57 fix: Lead to customer creation (#33859)
fix: Lead to customer creation (#33859)

(cherry picked from commit faecf3ee40)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-31 09:20:10 +05:30
mergify[bot]
1b79837e1b chore: Resize numeric and date columns (#33858)
chore: Resize numeric and date columns (#33858)
2023-01-31 09:19:46 +05:30
mergify[bot]
3f87a0eceb ci: bump isort to 5.12.0 (backport #33875) (#33879)
ci: bump isort to 5.12.0 (#33875)

[skip ci]

(cherry picked from commit 2bad86d8d8)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-31 08:49:43 +05:30
Anand Baburajan
5d3b2280d4 Merge pull request #33882 from AnandBaburajan/fix_disposal_was_made_on_original_schedule_date_v14
fix: disposal_was_made_on_original_schedule_date [v14]
2023-01-30 22:03:12 +05:30
Anand Baburajan
948a951c8a Merge branch 'version-14-hotfix' into fix_disposal_was_made_on_original_schedule_date_v14 2023-01-30 21:28:12 +05:30
anandbaburajan
4586806ed1 fix: disposal_was_made_on_original_schedule_date 2023-01-30 21:25:04 +05:30
Dany Robert
5caa9e2240 chore: linting issues
(cherry picked from commit d69c839369)
2023-01-30 13:36:14 +00:00
Dany Robert
7a793ea588 feat(gp): test for inv and dn related via so
(cherry picked from commit 1f6ab86a65)
2023-01-30 13:36:14 +00:00
Dany Robert
a659208ed1 chore: linting issue
(cherry picked from commit ef90e24931)
2023-01-30 13:36:13 +00:00
Dany Robert
f5bde9cf6d fix(gp): fetch buying amount from dn related to so
(cherry picked from commit e8e20da78e)
2023-01-30 13:36:13 +00:00
mergify[bot]
a0e1ee0450 fix: Ignore linked JE on JE cancellation (#33852)
fix: Ignore linked JE on JE cancellation (#33852)

(cherry picked from commit 428b099f63)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-29 21:26:06 +05:30
mergify[bot]
0fcf364aaa fix: double salutation on quotation print (#33834)
fix: double salutation on quotation print (#33834)

'lead_name' always has salutation.

(cherry picked from commit f270880735)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-01-29 17:08:30 +05:30
rohitwaghchaure
72da41ebea Merge pull request #33846 from frappe/mergify/bp/version-14-hotfix/pr-33845
fix: item rate not fetching (backport #33845)
2023-01-28 22:41:29 +05:30
Rohit Waghchaure
b98d3514ab fix: item rate not fetching
(cherry picked from commit 0d7f98b496)
2023-01-28 09:40:59 +00:00
mergify[bot]
5d4967ceee fix(patch): validation error on cost center allocation migration (#33835)
fix(patch): validation error on cost center allocation migration

If Distributed cost centers have GL postings on patch run date,
patch failes with valiation error.

(cherry picked from commit de10f2dc00)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-01-28 10:28:06 +05:30
ruthra kumar
5c28ca2b0b Merge pull request #33828 from frappe/mergify/bp/version-14-hotfix/pr-33815
fix: disfuctional cost center filter on Journal Entries (backport #33815)
2023-01-27 10:32:47 +05:30
Sagar Vora
0e0c133cd0 Merge pull request #33832 from frappe/mergify/bp/version-14-hotfix/pr-33831
perf: show update items dialog (backport #33831)
2023-01-27 04:19:49 +00:00
Devin Slauenwhite
ac2ebfbf59 perf: show update items dialog
(cherry picked from commit a835c1a418)
2023-01-27 04:18:32 +00:00
ruthra kumar
58c3e16fec fix: disfuctional cost center filter on Journal Entries (#33815)
* fix: missing cost_center filter for journal entries

* test: cost center filter on invoices, journals and payments

(cherry picked from commit b31b850db8)
2023-01-26 14:57:05 +00:00
mergify[bot]
f124dd3112 fix: GST Category validation broken for pos unregistered customer who dont have address. (#33800)
fix: GST Category validation broken for pos unregistered customer who dont have address. (#33800)

* fix: GST Category validation is given for pos customer

(cherry picked from commit c5ca8d74c4)

Co-authored-by: Vishal Dhayagude <vishdha@users.noreply.github.com>
2023-01-26 20:26:50 +05:30
Anand Baburajan
a930dab25d Merge pull request #33824 from frappe/mergify/bp/version-14-hotfix/pr-33823
chore: remove broken translation (backport #33823)
2023-01-26 13:51:55 +05:30
anandbaburajan
fc0ba2b9c8 chore: remove broken translation
(cherry picked from commit 21f425660d)
2023-01-26 08:17:12 +00:00
mergify[bot]
f7eabcafde fix: use correct filter name in item_query (backport #33814) (#33816)
fix: use correct filter name in `item_query` (#33814)

(cherry picked from commit da323cbb40)

Co-authored-by: Daizy Modi <modidaizy5217@gmail.com>
2023-01-25 17:37:57 +05:30
Ankush Menat
440e16dc10 chore: remove broken translation
[skip ci]
2023-01-25 17:36:37 +05:30
mergify[bot]
5eb84f65ef ci: documentation helper (backport #33757) (#33798)
ci: documentation helper (#33757)

refactor: documentation helper
(cherry picked from commit d155042edd)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-01-25 12:38:17 +05:30
Frappe PR Bot
9fe9d7de6b chore(release): Bumped to Version 14.14.0
# [14.14.0](https://github.com/frappe/erpnext/compare/v14.13.0...v14.14.0) (2023-01-25)

### Bug Fixes

* Better budget exceeding validation messages ([#33713](https://github.com/frappe/erpnext/issues/33713)) ([4be8375](4be8375e36))
* bom.json updated ([9469488](9469488254))
* calculate correct amount for qty == 0 ([#33739](https://github.com/frappe/erpnext/issues/33739)) ([1c1c903](1c1c903fee))
* don't add template item in sales/purchase transaction ([8c12f7f](8c12f7f2f2))
* **ecommerce:** breadcrumb: fallback to `/all-products` ([#33718](https://github.com/frappe/erpnext/issues/33718)) ([1a33324](1a33324b4a))
* fb issue in asset chart, asset split and reverse_depreciation_entry_made_after_disposal ([dffdc67](dffdc67455))
* hide with_operation on selection on fg_based and vice versa ([8ee6db3](8ee6db3b7b))
* incorrect `rate` and `amount` in MR Item ([#33547](https://github.com/frappe/erpnext/issues/33547)) ([ff731ea](ff731ea70a))
* incorrect actual qty for the packed item ([bcd1fca](bcd1fca37b))
* incorrect row order and accumulated_depreciation when schedule with multiple FBs is scrapped ([96f9b34](96f9b34b19))
* linting ([dedc9ec](dedc9ecc7c))
* local variable 'stock_rbnb' referenced before assignment ([21cf929](21cf929c7a))
* minor change in bom.js added ([19aa237](19aa23765a))
* minor changes added ([7fd8cef](7fd8cef4d3))
* **minor:** Label updates in Statement of Accounts ([#33639](https://github.com/frappe/erpnext/issues/33639)) ([8af9a2f](8af9a2fad1))
* missing constant definition ([219aa81](219aa81eb6))
* not able to change default BOM in the Subcontracting Order ([ed1aed2](ed1aed22c0))
* Patch to update reference_due_date in Journal Entry ([#33616](https://github.com/frappe/erpnext/issues/33616)) ([0740120](0740120914))
* **pricing rule:** free item duplication ([#33746](https://github.com/frappe/erpnext/issues/33746)) ([5a49884](5a49884636))
* rewrite logic for duplicate check in Item Attribute ([6544cb8](6544cb8822))
* Short closed order, receipt, and delivery note status on cancellation ([#33743](https://github.com/frappe/erpnext/issues/33743)) ([89f1eef](89f1eefe2b))
* TDS deduction in payment entry ([#33747](https://github.com/frappe/erpnext/issues/33747)) ([f9a43e5](f9a43e5470))
* test case added for FG_BASED OPERTING COST ([30af8c3](30af8c3acb))
* the frappe throw message is corrected in the group task validation ([cf43930](cf439301f6))
* use hash based naming for tax withheld vouchers child table (backport [#33643](https://github.com/frappe/erpnext/issues/33643)) ([#33748](https://github.com/frappe/erpnext/issues/33748)) ([cf6d454](cf6d454606))
* web supplier quotation ([ceef2d6](ceef2d6553))

### Features

* Add operating cost based on bom quanity without creating job card ([0035ee2](0035ee2a74))
* get items from Transit Stock Entry ([31fd6f3](31fd6f300f))
2023-01-25 04:00:05 +00:00
Deepesh Garg
891b96e85c Merge pull request #33802 from frappe/version-14-hotfix
chore: release v14
2023-01-25 09:28:32 +05:30
rohitwaghchaure
475445dd8f Merge pull request #33803 from frappe/mergify/bp/version-14-hotfix/pr-33790
fix: web supplier quotation (backport #33790)
2023-01-24 22:06:33 +05:30
Sagar Sharma
e534e27b9e Merge pull request #33804 from frappe/mergify/bp/version-14-hotfix/pr-33797
chore: add `Cancelled` status in SCO `get_indicator` (backport #33797)
2023-01-24 17:36:33 +05:30
s-aga-r
5f6979d444 chore: add Cancelled status in SCO get_indicator
(cherry picked from commit 840f9d8987)
2023-01-24 12:05:08 +00:00
Rohit Waghchaure
ceef2d6553 fix: web supplier quotation
(cherry picked from commit 7800db7c0d)
2023-01-24 10:30:07 +00:00
Anand Baburajan
c928816fc2 Merge pull request #33792 from frappe/mergify/bp/version-14-hotfix/pr-33789
chore: update translations for naming series error (backport #33789)
2023-01-23 19:00:41 +05:30
anandbaburajan
52ba266302 chore: fix translations
(cherry picked from commit 4e6066f929)
2023-01-23 13:19:18 +00:00
anandbaburajan
c04f11b4f8 chore: update translations for naming series error
(cherry picked from commit bbde1f611f)
2023-01-23 13:19:08 +00:00
mergify[bot]
f9a43e5470 fix: TDS deduction in payment entry (#33747)
fix: TDS deduction in payment entry (#33747)
2023-01-23 17:51:51 +05:30
rohitwaghchaure
c706a4fc6f Merge pull request #33786 from frappe/mergify/bp/version-14-hotfix/pr-33785
feat: get items from Transit Stock Entry (backport #33785)
2023-01-23 14:16:28 +05:30
Rohit Waghchaure
31fd6f300f feat: get items from Transit Stock Entry
(cherry picked from commit 62141b0b63)
2023-01-23 07:34:50 +00:00
Sagar Sharma
9e007e1b3a Merge pull request #33782 from frappe/mergify/bp/version-14-hotfix/pr-33547
fix: incorrect `rate` and `amount` in MR Item (backport #33547)
2023-01-22 18:55:54 +05:30
Sagar Sharma
ff731ea70a fix: incorrect rate and amount in MR Item (#33547)
* fix: incorrect `rate` and `amount` in MR Item

(cherry picked from commit 7a8e89e2fe)
2023-01-22 12:34:52 +00:00
mergify[bot]
4be8375e36 fix: Better budget exceeding validation messages (#33713)
fix: Better budget exceeding validation messages (#33713)
2023-01-22 17:57:47 +05:30
Anand Baburajan
2dfa366b81 Merge pull request #33772 from AnandBaburajan/asset_bug_fixes_14
fix: some asset bugs related to finance books [v14]
2023-01-22 16:25:28 +05:30
Anand Baburajan
bdc816d166 Merge branch 'version-14-hotfix' into asset_bug_fixes_14 2023-01-22 13:57:36 +05:30
Sagar Sharma
a0297286b2 Merge pull request #33779 from frappe/mergify/bp/version-14-hotfix/pr-33778
fix: missing constant definition (backport #33778)
2023-01-21 22:31:57 +05:30
barredterra
219aa81eb6 fix: missing constant definition
(cherry picked from commit 547d37b1db)
2023-01-21 16:59:14 +00:00
Anand Baburajan
03b208db7b Merge branch 'version-14-hotfix' into asset_bug_fixes_14 2023-01-21 20:04:17 +05:30
anandbaburajan
9e2329dcfa chore: rename date_of_sale to date_of_disposal 2023-01-21 19:54:14 +05:30
anandbaburajan
96f9b34b19 fix: incorrect row order and accumulated_depreciation when schedule with multiple FBs is scrapped 2023-01-21 18:40:57 +05:30
mergify[bot]
8af9a2fad1 fix(minor): Label updates in Statement of Accounts (#33639)
fix(minor): Label updates in Statement of Accounts
2023-01-21 15:45:01 +05:30
rohitwaghchaure
125c411000 Merge pull request #33768 from frappe/mergify/bp/version-14-hotfix/pr-33760
fix: not able to change default BOM in the Subcontracting Order (backport #33760)
2023-01-21 12:33:51 +05:30
Rohit Waghchaure
ed1aed22c0 fix: not able to change default BOM in the Subcontracting Order
(cherry picked from commit 11b2994fe8)
2023-01-21 06:35:40 +00:00
mergify[bot]
bfc33fb2f5 Removed an unnecessary check in code which always evaluates to true (backport #33710) (#33763)
fix: removed an unnecessary check which always evaluates to true

(cherry picked from commit 49aed7ff69)

Co-authored-by: OpenRefactory, Inc <56681071+openrefactory@users.noreply.github.com>
2023-01-21 12:02:50 +05:30
rohitwaghchaure
779691da55 Merge pull request #33761 from frappe/mergify/bp/version-14-hotfix/pr-33759
fix: incorrect actual qty for the packed item (backport #33759)
2023-01-21 09:47:13 +05:30
mergify[bot]
5a49884636 fix(pricing rule): free item duplication (#33746)
fix(pricing rule): free item duplication (#33746)
2023-01-20 23:41:55 +05:30
mergify[bot]
89f1eefe2b fix: Short closed order, receipt, and delivery note status on cancellation (#33743)
fix: Short closed order, receipt, and delivery note status on cancellation (#33743)
2023-01-20 23:40:15 +05:30
Rohit Waghchaure
bcd1fca37b fix: incorrect actual qty for the packed item
(cherry picked from commit 02566a02a8)
2023-01-20 18:09:49 +00:00
rohitwaghchaure
4590e18145 Merge pull request #33758 from frappe/mergify/bp/version-14-hotfix/pr-33595
feat: Add operating cost based on bom quanity without creating job card (backport #33595)
2023-01-20 23:39:18 +05:30
Vishal
8ee6db3b7b fix: hide with_operation on selection on fg_based and vice versa
(cherry picked from commit 694fc3e20c)
2023-01-20 17:07:36 +00:00
Vishal
19aa23765a fix: minor change in bom.js added
(cherry picked from commit a5cbdea8e4)
2023-01-20 17:07:35 +00:00
Vishal
9469488254 fix: bom.json updated
(cherry picked from commit c51f9e0a97)
2023-01-20 17:07:35 +00:00
Vishal
30af8c3acb fix: test case added for FG_BASED OPERTING COST
(cherry picked from commit f0c0a64984)
2023-01-20 17:07:35 +00:00
Vishal
7fd8cef4d3 fix: minor changes added
(cherry picked from commit ddc0127e05)
2023-01-20 17:07:35 +00:00
Vishal
0035ee2a74 feat: Add operating cost based on bom quanity without creating job card
(cherry picked from commit b559245f2a)
2023-01-20 17:07:34 +00:00
mergify[bot]
1c1c903fee fix: calculate correct amount for qty == 0 (#33739)
fix: calculate correct amount for qty == 0 (#33739)

(cherry picked from commit 327b6fdb32)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-01-20 19:43:31 +05:30
mergify[bot]
cf6d454606 fix: use hash based naming for tax withheld vouchers child table (backport #33643) (#33748)
fix: use hash based naming for tax withheld vouchers child table (#33643)

(cherry picked from commit 17045f88a1)

Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
2023-01-20 19:26:29 +05:30
mergify[bot]
1a33324b4a fix(ecommerce): breadcrumb: fallback to /all-products (#33718)
fix(ecommerce): breadcrumb: fallback to `/all-products` (#33718)
2023-01-20 19:25:28 +05:30
mergify[bot]
0740120914 fix: Patch to update reference_due_date in Journal Entry (#33616)
* fix: Patch to update reference_due_date in Journal Entry (#33616)
2023-01-20 18:54:17 +05:30
anandbaburajan
dffdc67455 fix: fb issue in asset chart, asset split and reverse_depreciation_entry_made_after_disposal 2023-01-20 15:38:26 +05:30
rohitwaghchaure
0f9d81e5fa Merge pull request #33731 from frappe/mergify/bp/version-14-hotfix/pr-33723
fix: don't add template item in sales/purchase transaction (backport #33723)
2023-01-19 16:54:49 +05:30
Sagar Sharma
1d73f1f275 Merge pull request #33733 from frappe/mergify/bp/version-14-hotfix/pr-33619
fix: rewrite logic for duplicate check in Item Attribute (backport #33619)
2023-01-19 15:29:08 +05:30
unknown
dedc9ecc7c fix: linting
(cherry picked from commit 2ca4d3fb71)
2023-01-19 07:58:40 +00:00
unknown
6544cb8822 fix: rewrite logic for duplicate check in Item Attribute
Previously, Item Attribute values were not checked for case-insensitive duplicates, and Item tttribute abbreviations were forced to be uppercase. This commit fixes both problems.

(cherry picked from commit 974e12c837)
2023-01-19 07:58:39 +00:00
Rohit Waghchaure
8c12f7f2f2 fix: don't add template item in sales/purchase transaction
(cherry picked from commit 2c83fff1a1)
2023-01-19 07:13:03 +00:00
Deepesh Garg
0001ae113d Merge pull request #33698 from shamilnk/version-14-fix-task
fix: the frappe throw message is corrected in the group task validation
2023-01-18 21:28:28 +05:30
mergify[bot]
9bc2675493 refactor: make payments app a soft dependency (backport #33245) (#33677)
refactor: make payments app a soft dependency (#33245)

refactor: make payment app a soft dependency
(cherry picked from commit 0b86b1baca)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-01-18 21:11:37 +05:30
rohitwaghchaure
0d46ec2640 Merge pull request #33714 from frappe/mergify/bp/version-14-hotfix/pr-33712
fix: local variable 'stock_rbnb' referenced before assignment (backport #33712)
2023-01-18 19:18:43 +05:30
Sagar Sharma
9152def27e Merge pull request #33716 from frappe/mergify/bp/version-14-hotfix/pr-33679
refactor: rewrite `pick_list.py` queries in `QB` (backport #33679)
2023-01-18 18:55:47 +05:30
s-aga-r
26eb0e2fcd refactor: rewrite pick_list.py queries in QB
(cherry picked from commit 0ed6552655)
2023-01-18 12:57:01 +00:00
Rohit Waghchaure
21cf929c7a fix: local variable 'stock_rbnb' referenced before assignment
(cherry picked from commit 1de4742ffb)
2023-01-18 11:07:42 +00:00
ShamilNK
3119c3d777 Merge branch 'version-14-hotfix' into version-14-fix-task 2023-01-18 09:13:10 +05:30
Frappe PR Bot
e910c949f7 chore(release): Bumped to Version 14.13.0
# [14.13.0](https://github.com/frappe/erpnext/compare/v14.12.1...v14.13.0) (2023-01-17)

### Bug Fixes

* allow to create sales order from expired quotation ([#33582](https://github.com/frappe/erpnext/issues/33582)) ([fe51343](fe513433b2))
* asset repair link ([bc55f44](bc55f44de6))
* asset value in fixed asset register ([#33608](https://github.com/frappe/erpnext/issues/33608)) ([4d2497f](4d2497faf1))
* attribute error while submitting Repost PLE ([0431a57](0431a57ff0))
* better comparision of difference value between stock and account ([5869fcb](5869fcbd86))
* minor filter issue while reconciliation tool from bench console ([bddf330](bddf330754))
* Missing constructor args in Bank Reco Tool ([#33705](https://github.com/frappe/erpnext/issues/33705)) ([f88c8c4](f88c8c48c9))
* only group similar items in print format if group_same_items is checked in pick list (backport [#33627](https://github.com/frappe/erpnext/issues/33627)) ([#33630](https://github.com/frappe/erpnext/issues/33630)) ([28f2d35](28f2d357ab))
* patch item_reposting_for_incorrect_sl_and_gl ([1928195](1928195167))
* Rate from LDC in TDS reports (backport [#33699](https://github.com/frappe/erpnext/issues/33699)) ([#33700](https://github.com/frappe/erpnext/issues/33700)) ([9fa4c1a](9fa4c1a3bd))
* Return against internal purchase invoice (backport [#33635](https://github.com/frappe/erpnext/issues/33635)) ([#33658](https://github.com/frappe/erpnext/issues/33658)) ([35fbd67](35fbd67a93))
* Sales ORder Connections on Material Request ([8a04031](8a0403119f))
* Updating SO throws ordered_qty not allowed to change after submission ([f915c18](f915c18137))
* zero rm-cost in SCR ([2dfbc6e](2dfbc6e4eb))

### Features

* Date filters on bank reconciliation tool ([#33271](https://github.com/frappe/erpnext/issues/33271)) ([91b08f1](91b08f179a))
* provision to select date type based on filter ([4d65d6f](4d65d6f9bd))

### Performance Improvements

* improve reconciliation speed on JE's with 1000's of rows ([8a498ed](8a498ed029))

### Reverts

* Reverting changes done on 33495 ([#33662](https://github.com/frappe/erpnext/issues/33662)) ([23b9f66](23b9f661b6))
2023-01-17 16:02:54 +00:00
Deepesh Garg
7a5ec088df Merge pull request #33701 from frappe/version-14-hotfix
chore: release v14
2023-01-17 21:31:17 +05:30
mergify[bot]
f88c8c48c9 fix: Missing constructor args in Bank Reco Tool (#33705)
fix: Missing constructor args in Bank Reco Tool (#33705)

(cherry picked from commit 6b31c27ed6)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-17 21:05:49 +05:30
ShamilNK
f3184dcd10 Merge branch 'version-14-hotfix' into version-14-fix-task 2023-01-17 17:44:53 +05:30
mergify[bot]
9fa4c1a3bd fix: Rate from LDC in TDS reports (backport #33699) (#33700)
fix: Rate from LDC in TDS reports (#33699)

(cherry picked from commit db9beb3cdd)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-17 15:59:13 +05:30
Anand Baburajan
7665f85f0a Merge pull request #33688 from AnandBaburajan/asset_repair_link
fix: asset repair link [v14]
2023-01-17 15:12:18 +05:30
Anand Baburajan
8ac82ccae2 Merge branch 'version-14-hotfix' into asset_repair_link 2023-01-17 12:57:35 +05:30
shamilnk
cf439301f6 fix: the frappe throw message is corrected in the group task validation 2023-01-17 12:54:49 +05:30
rohitwaghchaure
59018f1012 Merge pull request #33697 from frappe/mergify/bp/version-14-hotfix/pr-33695
fix: patch item_reposting_for_incorrect_sl_and_gl (backport #33695)
2023-01-17 12:43:43 +05:30
Rohit Waghchaure
1928195167 fix: patch item_reposting_for_incorrect_sl_and_gl
(cherry picked from commit dbde3a3421)
2023-01-17 06:49:25 +00:00
Anand Baburajan
709706e645 Merge branch 'version-14-hotfix' into asset_repair_link 2023-01-17 11:21:34 +05:30
Ankush Menat
79f171c31a chore: ignore b028 2023-01-17 10:58:38 +05:30
Sagar Sharma
59964b5297 Merge pull request #33692 from frappe/mergify/bp/version-14-hotfix/pr-33690
fix: Sales Order Connections Tabs do not show linked Material Request or "+" button  (intoduce by #33304) (backport #33690)
2023-01-17 10:07:29 +05:30
Florian HENRY
8a0403119f fix: Sales ORder Connections on Material Request
(cherry picked from commit e19161a8ee)
2023-01-17 04:36:45 +00:00
mergify[bot]
a1bfa569e6 chore: Typo in payment reconciliation (backport #33686) (#33691)
chore: Typo in payment reconciliation (#33686)

(cherry picked from commit 0639d9e32a)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-17 09:16:26 +05:30
rohitwaghchaure
25c2e5fa71 Merge pull request #33685 from frappe/mergify/bp/version-14-hotfix/pr-33680
refactor: picked qty in sales order item (backport #33680)
2023-01-17 00:27:23 +05:30
rohitwaghchaure
bdf7fdda3e Merge pull request #33687 from frappe/mergify/bp/version-14-hotfix/pr-33684
feat: [minor] date type based on filter in Work Order Summary report (backport #33684)
2023-01-17 00:09:59 +05:30
Anand Baburajan
222b2dc487 Merge branch 'version-14-hotfix' into asset_repair_link 2023-01-17 00:02:07 +05:30
Rohit Waghchaure
4d65d6f9bd feat: provision to select date type based on filter
(cherry picked from commit 20c8873208)
2023-01-16 18:28:18 +00:00
anandbaburajan
bc55f44de6 fix: asset repair link 2023-01-16 23:36:46 +05:30
Rohit Waghchaure
6b3dc90560 refactor: picked qty in sales order item
(cherry picked from commit 1bcff80074)
2023-01-16 18:02:45 +00:00
ruthra kumar
6f967df9bb Merge pull request #33674 from frappe/mergify/bp/version-14-hotfix/pr-33661
perf: improve reconciliation performance for JE with 100s of accounts (backport #33661)
2023-01-16 18:03:08 +05:30
Sagar Sharma
1ebafb97a5 Merge pull request #33665 from frappe/mergify/bp/version-14-hotfix/pr-33664
chore: `Sales Order` link in `Pick List` (backport #33664)
2023-01-16 15:37:05 +05:30
Sagar Sharma
68877db0fa Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-33664 2023-01-16 15:36:54 +05:30
ruthra kumar
3ce819464d Merge pull request #33673 from frappe/mergify/bp/version-14-hotfix/pr-33646
Revert "fix: Updating SO throws ordered_qty not allowed to change after submission" (backport #33646)
2023-01-16 15:29:21 +05:30
ruthra kumar
5ba0aff551 Merge pull request #33671 from frappe/mergify/bp/version-14-hotfix/pr-33663
fix: attribute error while submitting Repost PLE (backport #33663)
2023-01-16 14:28:11 +05:30
ruthra kumar
b2ee981f52 Merge pull request #33670 from frappe/mergify/bp/version-14-hotfix/pr-33662
revert: Reverting changes done on 33495 (backport #33662)
2023-01-16 14:27:38 +05:30
ruthra kumar
0431a57ff0 fix: attribute error while submitting Repost PLE
(cherry picked from commit 2c50f43cdd)
2023-01-16 11:16:39 +05:30
Sagar Sharma
136a50948e Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-33664 2023-01-16 10:30:24 +05:30
mergify[bot]
35fbd67a93 fix: Return against internal purchase invoice (backport #33635) (#33658)
fix: Return against internal purchase invoice (#33635)

(cherry picked from commit 906ad10d16)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-16 10:03:12 +05:30
mergify[bot]
fe513433b2 fix: allow to create sales order from expired quotation (#33582)
fix: allow to create sales order from expired quotation (#33582)

(cherry picked from commit dceef0397a)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-01-16 10:01:43 +05:30
ruthra kumar
bddf330754 fix: minor filter issue while reconciliation tool from bench console
(cherry picked from commit 828eaf0930)
2023-01-16 04:12:07 +00:00
ruthra kumar
8a498ed029 perf: improve reconciliation speed on JE's with 1000's of rows
1. No need to keep old PLE's on reconciliation.
2. Added Validation to catch debit-credit mismatch on JE's
3. Only update outstanding amount for newly reconciled invoices

(cherry picked from commit 11cf694d9a)
2023-01-16 04:12:07 +00:00
ruthra kumar
faea73a4ee Revert "fix: Updating SO throws ordered_qty not allowed to change after submission" (#33646)
(cherry picked from commit 333907b7a5)
2023-01-16 04:09:45 +00:00
ruthra kumar
23b9f661b6 revert: Reverting changes done on 33495 (#33662)
'ordered_qty' will not be fetched from `tabBin`

(cherry picked from commit be382054e5)
2023-01-16 04:03:51 +00:00
mergify[bot]
623c35dfe1 refactor: use DocStatus (#33594)
refactor: use DocStatus (#33594)

(cherry picked from commit 67cf7e1728)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-01-16 08:45:31 +05:30
s-aga-r
df41b006fc chore: Sales Order link in Pick List
(cherry picked from commit b3759890d7)
2023-01-15 17:35:31 +00:00
mergify[bot]
4d2497faf1 fix: asset value in fixed asset register (#33608)
fix: asset value in fixed asset register

(cherry picked from commit aa1f2a7297)

Co-authored-by: anandbaburajan <anandbaburajan@gmail.com>
2023-01-15 17:33:39 +05:30
mergify[bot]
91b08f179a feat: Date filters on bank reconciliation tool (#33271)
* Update bank_reconciliation_tool.py

Applying date filter on transactions and all the bank entries and also gives the filter the bank entries as per reference date. Sorted all transactions and entries as per date in ascending order.
Also added posting date columns in all bank entries and default checkbox tick of journal entry, hide the sales invoice and purchase invoice checkbox.

(cherry picked from commit e5a1189bec)

* Filters on Bank Reconciliation

Applying date filter on transactions and all the bank entries and also gives the filter the bank entries as per reference date. Sorted all transactions and entries as per date in ascending order. Also added posting date columns in all bank entries and default checkbox tick of journal entry, hide the sales invoice and purchase invoice checkbox.

(cherry picked from commit 447272aa4d)

* Update bank_reconciliation_tool.json

Adding fields in bank reconciliation tool

(cherry picked from commit 8e7c8a6482)

* Feat:Filter on Payment Entries and Journal Entries

Applying filters on Payement entries and Journal Entries as per reference  date and posting date

(cherry picked from commit 408c89df03)

* feat:filters on bank reconciliation

Added date filters on bank transactions, payment entries and journal entries and sorted list as per date in ascending order.

(cherry picked from commit 05b6fce03d)

* feat: added arguments of posting date and reference date

(cherry picked from commit 645869e6ff)

* fix: linters

(cherry picked from commit 6b5276398e)

* fix: json issue

(cherry picked from commit 81e5f71172)

* fix: filtered as per reference date

On bank reconciliation, transactions will be filtered as per date selected in 'from_date' and 'to_date' fields , In dialog, all the bank entries will  be fetched as per the posting date selected and if filtered by reference date checkbox is tick then then there will be two fields 'from_reference_date' and 'to_reference_date' then all bank entries in dialog box came as per reference date, selected. And by default journal entry checkbox is tick.
Also sorted the bank transactions and bank entries as per ascending order date wise.

(cherry picked from commit 3aaa2f5326)

* fix: pre-commit

(cherry picked from commit e2614b8a21)

* fix: passing from_date and to_date filters in test cases

passing from_date and to_date filters in  test_linked_payments and test_debit_credit_output  for unit testing

(cherry picked from commit f1810803e1)

* fix: pre-commit

(cherry picked from commit 35c29e0226)

* fix: pre-commit

(cherry picked from commit c764f14f53)

* feat: consolidated auto bank reconciliation

Added a button of Auto Reconcile, to reconcile the bank entries as per the matching reference number with the bank transaction and count of transactions reconciled message will be pop up on clicking the auto reconcile button.

(cherry picked from commit d65243eb65)

* fix: data format

(cherry picked from commit 12822f7c36)

* fix: remove comments

(cherry picked from commit 917b2190aa)

* chore: fix fieldnames and order

(cherry picked from commit 232726288a)

Co-authored-by: sonali <sonali@8848digital.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-15 17:30:32 +05:30
Sagar Sharma
40d3b26fd8 Merge pull request #33654 from frappe/mergify/bp/version-14-hotfix/pr-33651
fix: zero rm-cost in SCR (backport #33651)
2023-01-15 12:53:04 +05:30
s-aga-r
2dfbc6e4eb fix: zero rm-cost in SCR
(cherry picked from commit f70d757b82)
2023-01-14 17:41:46 +00:00
ruthra kumar
5631cbba6a Merge pull request #33628 from frappe/mergify/bp/version-14-hotfix/pr-33622
fix: Updating SO throws ordered_qty not allowed to change after submission (backport #33622)
2023-01-13 10:14:19 +05:30
ruthra kumar
f915c18137 fix: Updating SO throws ordered_qty not allowed to change after submission
(cherry picked from commit 391f42db04)
2023-01-13 08:21:36 +05:30
mergify[bot]
1f0a569c7f chore: reuse doc object in test_pick_list_grouping_before_print (backport #33636) (#33637)
chore: reuse doc object in test_pick_list_grouping_before_print (#33636)

(cherry picked from commit e22d56484d)

Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
2023-01-13 01:34:31 +05:30
mergify[bot]
28f2d357ab fix: only group similar items in print format if group_same_items is checked in pick list (backport #33627) (#33630)
fix: only group similar items in print format if group_same_items is checked in pick list (#33627)

* fix: only group similar items if group same items is checked in pick list

* test: non grouping of locations if group_same_items is false

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
(cherry picked from commit cfb0bb1eaa)

Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2023-01-12 20:33:18 +05:30
mergify[bot]
120dca44ad chore: subcontracting validations (backport #33621) (#33626)
* fix: `ZeroDivisionError: float division by zero` in SCR

(cherry picked from commit 434aa594d5)

* chore: add row-index in error msgs

(cherry picked from commit 6878f40d1d)

* chore: update error msgs for Subcontracted PO

(cherry picked from commit a0e2a93f3f)

* fix: validate accepted and rejected qty in SCR Item

(cherry picked from commit f028bd6e69)

* chore: linter

(cherry picked from commit b26e96cdf4)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-01-12 20:31:24 +05:30
Sagar Sharma
c9edf10693 Merge pull request #33614 from frappe/mergify/bp/version-14-hotfix/pr-33611
fix: better comparision of `difference_value` of Stock and Account (backport #33611)
2023-01-11 15:44:22 +05:30
Smit Vora
5869fcbd86 fix: better comparision of difference value between stock and account
(cherry picked from commit be05aea101)
2023-01-11 09:23:43 +00:00
Frappe PR Bot
1b3df094af chore(release): Bumped to Version 14.12.1
## [14.12.1](https://github.com/frappe/erpnext/compare/v14.12.0...v14.12.1) (2023-01-10)

### Bug Fixes

* **accounts:** currency fields no longer read as strings by validation function in Payment Entry ([#33535](https://github.com/frappe/erpnext/issues/33535)) ([44a95da](44a95da8ab))
* better handling of duplicate bundle items ([b96a97f](b96a97f6b4))
* customer/supplier quick entry dialog ([#33496](https://github.com/frappe/erpnext/issues/33496)) ([914e2fd](914e2fdded))
* don't check other warehouse ledgers to calculate valuation rate ([ab0a2b4](ab0a2b4272))
* Exchange gain and loss booking on multi-currency invoice reconciliation ([#32900](https://github.com/frappe/erpnext/issues/32900)) ([fe82ebc](fe82ebcc38))
* Exchange gain and loss booking on multi-currency invoice reconciliation ([#32900](https://github.com/frappe/erpnext/issues/32900)) ([259639a](259639a456))
* Incorrect exchange rate in payment entries ([#33481](https://github.com/frappe/erpnext/issues/33481)) ([e995e95](e995e952b5))
* incorrect status in the work order ([2658fc9](2658fc9f9b))
* incorrect warehouse and selling amount on bundled products ([#33549](https://github.com/frappe/erpnext/issues/33549)) ([c6c3ac3](c6c3ac3e55))
* RFQ emails not sent with pdf attachment ([#33604](https://github.com/frappe/erpnext/issues/33604)) ([34df9ab](34df9ab7d5))
* **stock entry:** wrong valuation rate in repack ([#33579](https://github.com/frappe/erpnext/issues/33579)) ([a92b4e7](a92b4e7255))
* Timeout error while saving the purchase invoice ([#33577](https://github.com/frappe/erpnext/issues/33577)) ([d2e3701](d2e3701b1a))

### Performance Improvements

* Drop `name` part from posting sort index ([#33551](https://github.com/frappe/erpnext/issues/33551)) ([f501575](f5015750e4))
2023-01-10 17:48:26 +00:00
Deepesh Garg
e6b9931552 Merge pull request #33601 from frappe/version-14-hotfix
chore: release v14
2023-01-10 23:16:52 +05:30
mergify[bot]
34df9ab7d5 fix: RFQ emails not sent with pdf attachment (#33604)
fix: RFQ emails not sent with pdf attachment (#33604)

(cherry picked from commit e0f5ecdad6)

Co-authored-by: Smit Vora <smitvora203@gmail.com>
2023-01-10 22:19:24 +05:30
mergify[bot]
e995e952b5 fix: Incorrect exchange rate in payment entries (#33481)
fix: Incorrect exchange rate in payment entries (#33481)

* fix: Incorrect exchange rate in payment entries

* test: Update failing tests

(cherry picked from commit 0ed938a490)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-10 22:18:59 +05:30
rohitwaghchaure
39e5aabc57 Merge pull request #33598 from frappe/mergify/bp/version-14-hotfix/pr-33597
fix: don't check other warehouse ledgers to calculate valuation rate (backport #33597)
2023-01-10 15:34:17 +05:30
Rohit Waghchaure
ab0a2b4272 fix: don't check other warehouse ledgers to calculate valuation rate
(cherry picked from commit ef2bf3c223)
2023-01-10 08:26:59 +00:00
Sagar Sharma
68027b164c Merge pull request #33596 from frappe/mergify/bp/version-14-hotfix/pr-33551
perf: Drop `name` part from posting sort index (backport #33551)
2023-01-10 12:56:57 +05:30
Sagar Sharma
57a6cfe690 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-33551 2023-01-10 12:14:47 +05:30
Deepesh Garg
955b487296 chore: resolve conflicts 2023-01-10 10:44:38 +05:30
mergify[bot]
44a95da8ab fix(accounts): currency fields no longer read as strings by validation function in Payment Entry (#33535)
fix(accounts): currency fields no longer read as strings by validation function in Payment Entry (#33535)

explicitly cast paid_amount and received_amount to float in the Payment Entry set_unallocated_amount validation function

(cherry picked from commit 4d5067d6d4)

Co-authored-by: Gughan Ravikumar <gughanrk@gmail.com>
2023-01-10 09:55:12 +05:30
Ankush Menat
f5015750e4 perf: Drop name part from posting sort index (#33551)
(cherry picked from commit 8a56df695d)

# Conflicts:
#	erpnext/patches.txt
2023-01-10 04:25:07 +00:00
mergify[bot]
914e2fdded fix: customer/supplier quick entry dialog (#33496)
fix: customer/supplier quick entry dialog (#33496)

* fix: readonly primary contact fields.

* refactor: supplier and customer quick entry form into common class.

(cherry picked from commit 6bc8bb26b6)

Co-authored-by: Devin Slauenwhite <devin.slauenwhite@gmail.com>
2023-01-10 09:02:50 +05:30
mergify[bot]
d2e3701b1a fix: Timeout error while saving the purchase invoice (#33577)
* fix: timeout error in the Purchase Invoice

(cherry picked from commit 7249657d15)

* feat: provision to disable get last purchase rate
fix: set_incoming_rate condition

(cherry picked from commit d1d4671320)

* fix: linters issue

(cherry picked from commit 05df8579cd)

* test: test case to check disable last purchase rate

(cherry picked from commit ec171fc7c1)

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
2023-01-10 09:02:15 +05:30
mergify[bot]
a92b4e7255 fix(stock entry): wrong valuation rate in repack (#33579)
fix(stock entry): wrong valuation rate in repack

(cherry picked from commit 99f5e869e0)

Co-authored-by: safvanhuzain <danyrt@wahni.com>
2023-01-10 09:01:51 +05:30
mergify[bot]
c6c3ac3e55 fix: incorrect warehouse and selling amount on bundled products (#33549)
fix: incorrect warehouse and selling amount on bundled products (#33549)

(cherry picked from commit bbe5e5d9d6)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-01-09 23:11:34 +05:30
Sagar Sharma
fb59c5b911 Merge pull request #33586 from frappe/mergify/bp/version-14-hotfix/pr-33562
fix: better handling of duplicate bundle items (backport #33562)
2023-01-09 22:45:46 +05:30
ruthra kumar
b96a97f6b4 fix: better handling of duplicate bundle items
(cherry picked from commit c717e87c9e)
2023-01-09 16:54:34 +00:00
mergify[bot]
1d26d7c077 chore: patch property setters for JE with new entry type (backport #33569) (#33583)
chore: patch property setters for JE with new entry type

(cherry picked from commit 789e448f0e)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-01-09 22:22:33 +05:30
mergify[bot]
1d045e0458 ci: bump node in release workflow (backport #33574) (#33575)
* ci: bump node in release workflow (#33574)

[skip ci]

(cherry picked from commit 1ad1fc4c7d)

# Conflicts:
#	.github/workflows/release.yml

* chore: conflicts

[skip ci]

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-01-09 13:27:40 +05:30
Deepesh Garg
7574fc8bcc Merge pull request #33567 from frappe/mergify/bp/version-14/pr-32900
fix: Exchange gain and loss booking on multi-currency invoice reconciliation (backport #32900)
2023-01-07 14:01:20 +05:30
mergify[bot]
fe82ebcc38 fix: Exchange gain and loss booking on multi-currency invoice reconciliation (#32900)
fix: Exchange gain and loss booking on multi-currency invoice reconciliation (#32900)

* fix: Exchange gain and loss booking on multi-curreny invoice reconciliation

* test: Update test cases

* chore: Ignore SQL linting rule

* chore: Joural Entry for exchange gainand loss booking

* chore: Journal entry for exchange gain loss booking

* test: Update test case

* chore: Default exchange gain and loss account

(cherry picked from commit 9a3d947e89)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-07 14:00:13 +05:30
Deepesh Garg
259639a456 fix: Exchange gain and loss booking on multi-currency invoice reconciliation (#32900)
* fix: Exchange gain and loss booking on multi-curreny invoice reconciliation

* test: Update test cases

* chore: Ignore SQL linting rule

* chore: Joural Entry for exchange gainand loss booking

* chore: Journal entry for exchange gain loss booking

* test: Update test case

* chore: Default exchange gain and loss account

(cherry picked from commit 9a3d947e89)
2023-01-07 08:11:15 +00:00
rohitwaghchaure
a9322ff13a Merge pull request #33561 from frappe/mergify/bp/version-14-hotfix/pr-33548
fix: incorrect status in the work order (backport #33548)
2023-01-06 18:45:42 +05:30
Rohit Waghchaure
2658fc9f9b fix: incorrect status in the work order
(cherry picked from commit b0baba84a0)
2023-01-06 10:32:19 +00:00
ruthra kumar
c6a136d2ad Merge pull request #33560 from frappe/mergify/bp/version-14-hotfix/pr-33537
refactor: Sales Partner column in AR and AR Summary Report (backport #33537)
2023-01-06 12:38:48 +05:30
ruthra kumar
031841d58e refactor: Sales Partner column in AR and AR Summary Report
(cherry picked from commit ee94127974)
2023-01-06 06:39:34 +00:00
Sagar Sharma
1366094b37 Merge pull request #33545 from frappe/mergify/bp/version-14-hotfix/pr-33543
chore: enable `No Copy` attribute for `route` in Item Group (backport #33543)
2023-01-05 13:32:59 +05:30
s-aga-r
3dab539719 chore: enable No Copy attribute for route in Item Group
(cherry picked from commit 348dc32514)
2023-01-05 07:32:43 +00:00
rohitwaghchaure
3731d76ff9 Merge pull request #33541 from frappe/mergify/bp/version-14-hotfix/pr-33524
refactor: revamp process loss feature & added tab breaks (backport #33524)
2023-01-04 19:59:56 +05:30
Rohit Waghchaure
28d5990326 test: test cases for process loss
(cherry picked from commit 524c0994e0)
2023-01-04 13:08:25 +00:00
Rohit Waghchaure
14d8e621bb refactor: revamp process loss feature & added tab breaks
(cherry picked from commit ae039777f9)
2023-01-04 13:08:25 +00:00
Frappe PR Bot
aab856ceb1 chore(release): Bumped to Version 14.12.0
# [14.12.0](https://github.com/frappe/erpnext/compare/v14.11.1...v14.12.0) (2023-01-04)

### Bug Fixes

* [concurrency issue] incorrect picked qty in sales order ([e7254fd](e7254fd161))
* `fg_item_qty` in non-subcontracted PO ([6e15331](6e15331fd4))
* `shipping_address` for non-drop shipping item ([a7a3654](a7a3654541))
* `shipping_address` in PO ([448fbe5](448fbe5582))
* add missing 'ordered_qty' to get_bin_details ([55e8e45](55e8e45d52))
* consider child nodes while getting bin details ([e296408](e2964088b7))
* Conversion factor error for invoices without item code (petty expenses) ([#32714](https://github.com/frappe/erpnext/issues/32714)) ([ba5a149](ba5a149a6b))
* Customer Primary Contact (backport [#33424](https://github.com/frappe/erpnext/issues/33424)) ([#33440](https://github.com/frappe/erpnext/issues/33440)) ([73c9820](73c9820e82))
* Default dimensions on fetching items from BOM (backport [#33439](https://github.com/frappe/erpnext/issues/33439)) ([#33459](https://github.com/frappe/erpnext/issues/33459)) ([a332b22](a332b229cf))
* Deferred revenue date comparison ([#33515](https://github.com/frappe/erpnext/issues/33515)) ([027510b](027510b629))
* ERR journals reported in AR/AP ([823b352](823b352c57))
* Get payment entry button not visible in Bank Clearance doc (backport [#33518](https://github.com/frappe/erpnext/issues/33518)) ([#33525](https://github.com/frappe/erpnext/issues/33525)) ([fcf052d](fcf052d3c4))
* Missing opening entry in general ledger (backport [#33519](https://github.com/frappe/erpnext/issues/33519)) ([#33526](https://github.com/frappe/erpnext/issues/33526)) ([8e375db](8e375db0b2))
* Multi-currency issues in Bank Reconciliation Tool ([#33488](https://github.com/frappe/erpnext/issues/33488)) ([d030852](d03085259d))
* Multiple rows for same warehouse and batches in pick list (backport [#33456](https://github.com/frappe/erpnext/issues/33456)) ([#33458](https://github.com/frappe/erpnext/issues/33458)) ([a166a76](a166a76768))
* payment terms and sales partner filter issue in AR/AP report ([0f6790b](0f6790be11))
* **pricing rule:** consider child tables in condition (backport [#33469](https://github.com/frappe/erpnext/issues/33469)) ([#33470](https://github.com/frappe/erpnext/issues/33470)) ([3bceb47](3bceb47542))
* Random behaviour while picking items using picklist (backport [#33449](https://github.com/frappe/erpnext/issues/33449)) ([#33450](https://github.com/frappe/erpnext/issues/33450)) ([1edde9c](1edde9c9e0))
* set `supplier` details while mapping SE(Send to Subcontractor) ([06e13b6](06e13b64a4))
* timeout error while submitting stock entry ([f30f77c](f30f77cde6))
* typerror on multi warehouse in Packed Items ([9b24940](9b24940059))
* use base_net_amount in case of missing stock qty ([#33457](https://github.com/frappe/erpnext/issues/33457)) ([88ca780](88ca7806af))

### Features

* Accounting Dimension updation in Payment Request and Entry ([#33411](https://github.com/frappe/erpnext/issues/33411)) ([e7704b2](e7704b2321))
2023-01-04 02:54:39 +00:00
Deepesh Garg
6a76153e54 Merge pull request #33511 from frappe/version-14-hotfix
chore: release v14
2023-01-04 08:23:11 +05:30
mergify[bot]
8e375db0b2 fix: Missing opening entry in general ledger (backport #33519) (#33526)
fix: Missing opening entry in general ledger (#33519)

(cherry picked from commit c78399c618)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-03 22:13:29 +05:30
mergify[bot]
fcf052d3c4 fix: Get payment entry button not visible in Bank Clearance doc (backport #33518) (#33525)
fix: Get payment entry button not visible in Bank Clearance doc (#33518)

(cherry picked from commit 1a83a67d41)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-03 22:09:50 +05:30
Sagar Sharma
011fc3a27c Merge pull request #33523 from frappe/mergify/bp/version-14-hotfix/pr-33514
fix: set `supplier` details while mapping SE(Send to Subcontractor) (backport #33514)
2023-01-03 19:27:23 +05:30
s-aga-r
06e13b64a4 fix: set supplier details while mapping SE(Send to Subcontractor)
(cherry picked from commit 751bdc98ed)
2023-01-03 13:27:55 +00:00
mergify[bot]
027510b629 fix: Deferred revenue date comparison (#33515)
fix: Deferred revenue date comparison (#33515)

(cherry picked from commit a3ab8f973a)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-03 18:39:19 +05:30
rohitwaghchaure
84289495c4 Merge pull request #33505 from frappe/mergify/bp/version-14-hotfix/pr-33504
fix: [concurrency issue] incorrect picked qty in sales order (backport #33504)
2023-01-02 21:13:50 +05:30
Rohit Waghchaure
e7254fd161 fix: [concurrency issue] incorrect picked qty in sales order
(cherry picked from commit aba83849a6)
2023-01-02 14:42:47 +00:00
mergify[bot]
648e979eb2 refactor: Exchange rate revaluation to handle accounts with zero account balance (#33165)
refactor: Exchange rate revaluation to handle accounts with zero account balance (#33165)

* refactor: new type for JE - Exchange Gain or Loss

* refactor: skip few validations for Exchanage Gain Or Loss type Jour

* refactor: ERR create 2 journals for handling zero and non-zero compa

1. Additional check box accounts table to identify accounts with zero balance
2. Accounts with zero balance only in either of the 2 currencies will be handled on separate Journal

* refactor: skips few validation for allowing 0 debit/credit

* fix: General Ledger presentaion currency

* test: fix test case in general ledger

* test: fix failing test case in AR report

(cherry picked from commit 914b23038c)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-01-02 16:37:53 +05:30
Sagar Sharma
45d8feba6d Merge pull request #33500 from frappe/mergify/bp/version-14-hotfix/pr-33444
fix: consider child nodes while getting bin details (backport #33444)
2023-01-02 12:31:12 +05:30
s-aga-r
ff38ca8ec7 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-33444 2023-01-02 12:01:00 +05:30
Sagar Sharma
f4861554d3 Merge pull request #33498 from frappe/mergify/bp/version-14-hotfix/pr-33495
fix(stock): missing ordered_qty in get_bin_details (backport #33495)
2023-01-02 11:55:28 +05:30
s-aga-r
ec538b27fe chore: use frappe.qb instead of frappe.db.get_value
(cherry picked from commit c3911a592a)
2023-01-02 06:25:00 +00:00
s-aga-r
e2964088b7 fix: consider child nodes while getting bin details
(cherry picked from commit c716dcc01e)
2023-01-02 06:24:59 +00:00
Devin Slauenwhite
6ec8088eb3 test: get_item_details contains bin details
(cherry picked from commit 239a5f8bf4)
2023-01-02 05:45:10 +00:00
Devin Slauenwhite
55e8e45d52 fix: add missing 'ordered_qty' to get_bin_details
(cherry picked from commit 8d62cdfd5f)
2023-01-02 05:45:10 +00:00
mergify[bot]
d03085259d fix: Multi-currency issues in Bank Reconciliation Tool (#33488)
fix: Multi-currency issues in Bank Recociliation Tool

(cherry picked from commit ad53ecf2b4)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-02 08:52:23 +05:30
mergify[bot]
ba5a149a6b fix: Conversion factor error for invoices without item code (petty expenses) (#32714)
fix: Conversion factor error for invoices without item code (petty expenses) (#32714)

* fix: Set default uom conversion factor to 1 for invoices

* chore: set default conversion_factor as 1

* chore: remove print statements

(cherry picked from commit 617518389a)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2022-12-30 16:00:45 +05:30
rohitwaghchaure
83a2c9b429 Merge pull request #33489 from frappe/mergify/bp/version-14-hotfix/pr-33487
Revert "fix: daily scheduler to identify and fix stock transfer entries having incorrect valuation" (backport #33487)
2022-12-30 15:31:29 +05:30
rohitwaghchaure
a7901c2b9c Revert "fix: daily scheduler to identify and fix stock transfer entries having incorrect valuation"
(cherry picked from commit 728dc1acf4)
2022-12-30 08:51:29 +00:00
ruthra kumar
60a30840ee Merge pull request #33474 from frappe/mergify/bp/version-14-hotfix/pr-33457
fix: use base_net_amount in case of missing stock qty (backport #33457)
2022-12-30 13:39:27 +05:30
ruthra kumar
88ca7806af fix: use base_net_amount in case of missing stock qty (#33457)
(cherry picked from commit e3a0ce5d63)
2022-12-29 04:05:31 +00:00
mergify[bot]
3bceb47542 fix(pricing rule): consider child tables in condition (backport #33469) (#33470)
fix(pricing rule): consider child tables in condition (#33469)

(cherry picked from commit cabaed9ed2)

Co-authored-by: Dany Robert <rtdany10@gmail.com>
2022-12-29 09:33:59 +05:30
Sagar Sharma
1b7be86a0a Merge pull request #33466 from frappe/mergify/bp/version-14-hotfix/pr-33465
fix: `fg_item_qty` in non-subcontracted PO (backport #33465)
2022-12-28 16:59:09 +05:30
s-aga-r
6e15331fd4 fix: fg_item_qty in non-subcontracted PO
(cherry picked from commit 6f5824cb21)
2022-12-28 09:58:19 +00:00
ruthra kumar
123493b87d Merge pull request #33461 from frappe/mergify/bp/version-14-hotfix/pr-33380
fix: ERR journals should be reported in AR/AP (backport #33380)
2022-12-28 10:42:50 +05:30
ruthra kumar
1f40d9be93 test: err for party should be in AR/AP report
(cherry picked from commit 2ed86760d7)
2022-12-27 16:04:28 +00:00
ruthra kumar
823b352c57 fix: ERR journals reported in AR/AP
Exchange Rate Revaluation on Receivable/Payable will included in AR/AP report

(cherry picked from commit b09eade3e4)
2022-12-27 16:04:27 +00:00
mergify[bot]
73c9820e82 fix: Customer Primary Contact (backport #33424) (#33440)
fix: Customer Primary Contact (#33424)

Co-authored-by: Nihantra C. Patel <n.patel.serpentcs@gmail.com>
(cherry picked from commit 7d9f3f23dd)

Co-authored-by: Solufyin <34390782+Solufyin@users.noreply.github.com>
2022-12-27 18:28:36 +05:30
Frappe PR Bot
24d161d670 chore: release v14 (#33452)
* fix: typerror on multi warehouse in Packed Items

DN(with bundled item with varying warehouses)-> Sales Invoice.

(cherry picked from commit e684eb32d0)

* test: type error on bundled products with different warehouses

(cherry picked from commit 5918bb03f7)

* fix: payment terms and sales partner filter issue in AR/AP report

(cherry picked from commit 13c4420f42)

* fix: timeout error while submitting stock entry

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit a05c47e499)

* fix: `shipping_address` in PO

(cherry picked from commit 7e1b6b3c2a)

* refactor: Customer and Supplier Ledger summary will have hidden fields for better handling of user permission (#33433)

* feat: Accounting Dimension updation in Payment Request and Entry (#33411)

* fix: `shipping_address` for non-drop shipping item

(cherry picked from commit 67a7ccf3ce)

* fix: Random behaviour while picking items using picklist (backport #33449) (#33450)

fix: Random behaviour while picking items using picklist (#33449)

(cherry picked from commit 8263bf9a9a)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>

* fix: Multiple rows for same warehouse and batches in pick list (backport #33456) (#33458)

fix: Multiple rows for same warehouse and batches in pick list (#33456)

(cherry picked from commit d2686ce75b)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>

* fix: Default dimensions on fetching items from BOM (backport #33439) (#33459)

fix: Default dimensions on fetching items from BOM (#33439)

(cherry picked from commit 0b75aa5390)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2022-12-27 18:26:24 +05:30
mergify[bot]
a332b229cf fix: Default dimensions on fetching items from BOM (backport #33439) (#33459)
fix: Default dimensions on fetching items from BOM (#33439)

(cherry picked from commit 0b75aa5390)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2022-12-27 17:56:05 +05:30
mergify[bot]
a166a76768 fix: Multiple rows for same warehouse and batches in pick list (backport #33456) (#33458)
fix: Multiple rows for same warehouse and batches in pick list (#33456)

(cherry picked from commit d2686ce75b)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2022-12-27 17:49:22 +05:30
Frappe PR Bot
0dbac5b689 chore(release): Bumped to Version 14.11.1
## [14.11.1](https://github.com/frappe/erpnext/compare/v14.11.0...v14.11.1) (2022-12-27)

### Bug Fixes

* Random behaviour while picking items using picklist (backport [#33449](https://github.com/frappe/erpnext/issues/33449)) ([#33451](https://github.com/frappe/erpnext/issues/33451)) ([abfb3bf](abfb3bf1c6))
2022-12-27 09:35:01 +00:00
mergify[bot]
abfb3bf1c6 fix: Random behaviour while picking items using picklist (backport #33449) (#33451)
fix: Random behaviour while picking items using picklist (#33449)

(cherry picked from commit 8263bf9a9a)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2022-12-27 15:01:44 +05:30
mergify[bot]
1edde9c9e0 fix: Random behaviour while picking items using picklist (backport #33449) (#33450)
fix: Random behaviour while picking items using picklist (#33449)

(cherry picked from commit 8263bf9a9a)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2022-12-27 15:01:31 +05:30
Sagar Sharma
6bf6b8c15e Merge pull request #33445 from frappe/mergify/bp/version-14-hotfix/pr-33437
fix: `shipping_address` in PO for non-drop ship item (backport #33437)
2022-12-27 10:16:59 +05:30
s-aga-r
a7a3654541 fix: shipping_address for non-drop shipping item
(cherry picked from commit 67a7ccf3ce)
2022-12-26 15:51:29 +00:00
mergify[bot]
e7704b2321 feat: Accounting Dimension updation in Payment Request and Entry (#33411) 2022-12-26 11:34:47 +05:30
mergify[bot]
7a98ece7f1 refactor: Customer and Supplier Ledger summary will have hidden fields for better handling of user permission (#33433) 2022-12-26 10:12:12 +05:30
Sagar Sharma
86e16fd567 Merge pull request #33435 from frappe/mergify/bp/version-14-hotfix/pr-33434
fix(ux): `shipping_address` in PO (backport #33434)
2022-12-25 20:45:51 +05:30
s-aga-r
448fbe5582 fix: shipping_address in PO
(cherry picked from commit 7e1b6b3c2a)
2022-12-25 14:10:50 +00:00
rohitwaghchaure
cc400abc47 Merge pull request #33423 from frappe/mergify/bp/version-14-hotfix/pr-33422
fix: timeout error while submitting stock entry (backport #33422)
2022-12-23 17:19:09 +05:30
Rohit Waghchaure
f30f77cde6 fix: timeout error while submitting stock entry
Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit a05c47e499)
2022-12-23 08:28:35 +00:00
ruthra kumar
81d82c1427 Merge pull request #33419 from frappe/mergify/bp/version-14-hotfix/pr-33418
fix: payment terms and sales partner filter issue in Accounts Receivable report (backport #33418)
2022-12-22 12:33:52 +05:30
ruthra kumar
0f6790be11 fix: payment terms and sales partner filter issue in AR/AP report
(cherry picked from commit 13c4420f42)
2022-12-22 06:36:58 +00:00
ruthra kumar
f6a0435963 Merge pull request #33414 from frappe/mergify/bp/version-14-hotfix/pr-33410
fix: TypeError on GP Report due to multiple warehouse on bundled items (backport #33410)
2022-12-21 19:00:55 +05:30
ruthra kumar
007a111847 test: type error on bundled products with different warehouses
(cherry picked from commit 5918bb03f7)
2022-12-21 12:58:47 +00:00
ruthra kumar
9b24940059 fix: typerror on multi warehouse in Packed Items
DN(with bundled item with varying warehouses)-> Sales Invoice.

(cherry picked from commit e684eb32d0)
2022-12-21 12:58:46 +00:00
Frappe PR Bot
29bb873347 chore(release): Bumped to Version 14.11.0
# [14.11.0](https://github.com/frappe/erpnext/compare/v14.10.1...v14.11.0) (2022-12-20)

### Bug Fixes

* Consolidated financial report ([16ce411](16ce411b8f))
* Cost center filter not working in cash flow report ([ce5065b](ce5065b132))
* Cost Center for tax withholding invoices ([728643a](728643aa4a))
* cost_center filter fix for 'Get Outstanding Invoice' in PE ([ff61997](ff61997d25))
* cost_center filter gives incorrect output ([9b2b281](9b2b2812ca))
* daily scheduler to identify and fix stock transfer entries having incorrect valuation ([deb3efd](deb3efdd9a))
* disabled items showing in the report 'Itemwise Recommended Reorder Level ([493509e](493509e42d))
* get_serial_nos_for_fg() missing 1 required positional argument: 'args' ([bddb5b8](bddb5b8d25))
* incorrect type hints (backport [#33381](https://github.com/frappe/erpnext/issues/33381)) ([#33384](https://github.com/frappe/erpnext/issues/33384)) ([fa77259](fa77259f8d))
* Payment Request flow fixes from Order to Payment Entry ([a01db8f](a01db8fc38))
* remove unnecessary permissions from Appointment and Appointment Booking Settings ([#33358](https://github.com/frappe/erpnext/issues/33358)) ([#33395](https://github.com/frappe/erpnext/issues/33395)) ([6ef7eaf](6ef7eaf82e))
* translation for warning on Overbilling/-receipt/-delivery ([ba51d50](ba51d50fef))
* Unable to import COA through importer ([f8c09ee](f8c09ee720))
* unsupported operand type(s) for +: 'int' and 'NoneType' ([7bdfb3d](7bdfb3d181))
* unsupported operand type(s) for +=: 'int' and 'NoneType' ([88dc81b](88dc81b7d4))
* use highest precision for exchange rate. ([4a8a84d](4a8a84d6f0))

### Features

* Ignore company related doctype for other apps via hooks ([cd5a2af](cd5a2af272))
* improve visibility of default values ([7ff50b9](7ff50b9446))
* incoterm named place ([bfe57ac](bfe57acdbf))
* more control when printing RFQ ([07cda0a](07cda0aeb5))
2022-12-20 14:01:35 +00:00
Deepesh Garg
c9156635a7 Merge pull request #33404 from frappe/version-14-hotfix
chore: release v14
2022-12-20 19:30:05 +05:30
mergify[bot]
6ef7eaf82e fix: remove unnecessary permissions from Appointment and Appointment Booking Settings (#33358) (#33395) 2022-12-20 18:23:47 +05:30
Deepesh Garg
647b532e04 Merge pull request #33400 from frappe/mergify/bp/version-14-hotfix/pr-33393
fix: Cost center filter not working in cash flow report (backport #33393)
2022-12-20 18:22:30 +05:30
rohitwaghchaure
32f4dfb31e Merge pull request #33391 from frappe/mergify/bp/version-14-hotfix/pr-33382
fix: unsupported operand type(s) for +=: 'int' and 'NoneType' (backport #33382)
2022-12-20 17:00:41 +05:30
Deepesh Garg
16ce411b8f fix: Consolidated financial report 2022-12-20 16:48:08 +05:30
Deepesh Garg
a7c7558b68 Merge pull request #33399 from frappe/mergify/bp/version-14-hotfix/pr-33350
fix: Payment Request flow fixes from Order to Payment Entry (backport #33350)
2022-12-20 16:17:43 +05:30
Deepesh Garg
a86b8eada9 chore: remove print statement
(cherry picked from commit 068df9f815)
2022-12-20 08:16:53 +00:00
Deepesh Garg
ce5065b132 fix: Cost center filter not working in cash flow report
(cherry picked from commit d0dbfec052)
2022-12-20 08:16:52 +00:00
Deepesh Garg
d8d5fa6d10 chore: More fixes
(cherry picked from commit 31c95deb88)
2022-12-20 08:16:03 +00:00
Deepesh Garg
fa2df8db8c chore: Update test case
(cherry picked from commit e25b98b620)
2022-12-20 08:16:03 +00:00
Deepesh Garg
a01db8fc38 fix: Payment Request flow fixes from Order to Payment Entry
(cherry picked from commit dc178984ae)
2022-12-20 08:16:03 +00:00
rohitwaghchaure
1f0f6e136b Merge pull request #33389 from frappe/mergify/bp/version-14-hotfix/pr-33387
fix: daily scheduler to identify and fix stock transfer entries having incorrect valuation (backport #33387)
2022-12-20 11:47:08 +05:30
Rohit Waghchaure
88dc81b7d4 fix: unsupported operand type(s) for +=: 'int' and 'NoneType'
(cherry picked from commit 2b4eae5f84)
2022-12-20 04:18:50 +00:00
Rohit Waghchaure
64b25fba48 test: added test case to validate audit for incorrect entries
(cherry picked from commit f31612376a)
2022-12-20 04:17:51 +00:00
Rohit Waghchaure
deb3efdd9a fix: daily scheduler to identify and fix stock transfer entries having incorrect valuation
(cherry picked from commit b1721b79ce)
2022-12-20 04:17:51 +00:00
mergify[bot]
fa77259f8d fix: incorrect type hints (backport #33381) (#33384)
fix: incorrect type hints (#33381)


(cherry picked from commit 88ce11f03d)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-12-19 18:01:42 +05:30
Deepesh Garg
71496a56ae Merge pull request #33376 from frappe/mergify/bp/version-14-hotfix/pr-33341
fix: Cost Center for tax withholding invoices (backport #33341)
2022-12-17 21:13:07 +05:30
Deepesh Garg
aac567c31c Merge pull request #33377 from frappe/mergify/bp/version-14-hotfix/pr-33339
feat: more control when printing RFQ (backport #33339)
2022-12-17 20:06:23 +05:30
barredterra
7ff50b9446 feat: improve visibility of default values
(cherry picked from commit 8717148d9b)
2022-12-17 13:55:47 +00:00
barredterra
07cda0aeb5 feat: more control when printing RFQ
(cherry picked from commit ce9626fead)
2022-12-17 13:55:47 +00:00
Deepesh Garg
4ea930a9e5 chore: resolve errors in test
(cherry picked from commit 26277cfcf3)
2022-12-17 13:55:15 +00:00
Deepesh Garg
728643aa4a fix: Cost Center for tax withholding invoices
(cherry picked from commit 973ef33eb5)
2022-12-17 13:55:15 +00:00
Deepesh Garg
cfa6ba1594 Merge pull request #33375 from frappe/mergify/bp/version-14-hotfix/pr-33371
fix: Unable to import COA through importer (backport #33371)
2022-12-17 19:22:35 +05:30
Deepesh Garg
f8c09ee720 fix: Unable to import COA through importer
(cherry picked from commit 3b66920342)
2022-12-17 11:13:07 +00:00
Deepesh Garg
6c63965b1f Merge pull request #33369 from frappe/mergify/bp/version-14-hotfix/pr-33275
fix: use highest precision for exchange rate. (backport #33275)
2022-12-16 16:11:51 +05:30
Devin Slauenwhite
4a8a84d6f0 fix: use highest precision for exchange rate.
(cherry picked from commit 2010b1b6e8)
2022-12-16 10:14:23 +00:00
Deepesh Garg
6f16cfa4ca Merge pull request #33366 from frappe/mergify/bp/version-14-hotfix/pr-33362
feat: Ignore company related doctype for other apps via hooks (backport #33362)
2022-12-16 12:30:50 +05:30
rohitwaghchaure
c4e80ab9f8 Merge pull request #33359 from frappe/mergify/bp/version-14-hotfix/pr-33355
fix: disabled items showing in the report Itemwise Recommended Reorder Level (backport #33355)
2022-12-16 11:39:51 +05:30
Deepesh Garg
cd5a2af272 feat: Ignore company related doctype for other apps via hooks
(cherry picked from commit 1a40c04b72)
2022-12-16 05:38:27 +00:00
Rohit Waghchaure
493509e42d fix: disabled items showing in the report 'Itemwise Recommended Reorder Level
'

(cherry picked from commit ae31ff1c48)
2022-12-15 12:38:53 +00:00
rohitwaghchaure
beaf9558ef Merge pull request #33356 from frappe/mergify/bp/version-14-hotfix/pr-33354
fix: unsupported operand type(s) for +: 'int' and 'NoneType' (backport #33354)
2022-12-15 18:08:45 +05:30
Rohit Waghchaure
7bdfb3d181 fix: unsupported operand type(s) for +: 'int' and 'NoneType'
(cherry picked from commit 0f28074e5a)
2022-12-15 11:44:34 +00:00
ruthra kumar
69409233c0 Merge pull request #33351 from frappe/mergify/bp/version-14-hotfix/pr-33335
fix: paid invoices shows up as outstanding when 'cost_center' filter is applied (backport #33335)
2022-12-15 17:00:46 +05:30
ruthra kumar
7d1ec5af39 test: cost center should not affect outstanding calculation
(cherry picked from commit a998a8a2da)
2022-12-15 09:33:07 +00:00
ruthra kumar
ff61997d25 fix: cost_center filter fix for 'Get Outstanding Invoice' in PE
(cherry picked from commit 8eb93004f7)
2022-12-15 09:33:07 +00:00
ruthra kumar
9b2b2812ca fix: cost_center filter gives incorrect output
filtering on cost center gives invoices that are reconciled as having outstanding

(cherry picked from commit 6d9d730759)
2022-12-15 09:33:07 +00:00
Deepesh Garg
74d9b1c700 Merge pull request #33348 from frappe/mergify/bp/version-14-hotfix/pr-33305
feat: incoterm named place (backport #33305)
2022-12-15 13:38:09 +05:30
Deepesh Garg
83ba5c5fb1 chore: resolve conflicts 2022-12-15 12:28:11 +05:30
barredterra
bfe57acdbf feat: incoterm named place
(cherry picked from commit e057e1dfe7)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
2022-12-15 06:30:37 +00:00
Deepesh Garg
f47d01fcb1 Merge pull request #33346 from frappe/mergify/bp/version-14-hotfix/pr-33309
refactor: translatable strings and guard clause (backport #33309)
2022-12-15 12:00:17 +05:30
barredterra
43f990f5e8 refactor: translatable strings and guard clause
(cherry picked from commit f20370c5ef)
2022-12-15 03:52:17 +00:00
rohitwaghchaure
c69e054d2e Merge pull request #33342 from frappe/mergify/bp/version-14-hotfix/pr-33323
fix: translatability of warning on overbilling/-receipt/-delivery (backport #33323)
2022-12-15 00:54:38 +05:30
barredterra
ba51d50fef fix: translation for warning on Overbilling/-receipt/-delivery
(cherry picked from commit 36997d9788)
2022-12-14 17:55:04 +00:00
rohitwaghchaure
56db733797 Merge pull request #33333 from frappe/mergify/bp/version-14-hotfix/pr-33332
fix: get_serial_nos_for_fg() missing 1 required positional argument: … (backport #33332)
2022-12-14 23:07:22 +05:30
Rohit Waghchaure
bddb5b8d25 fix: get_serial_nos_for_fg() missing 1 required positional argument: 'args'
(cherry picked from commit 410a58b3de)
2022-12-14 10:38:16 +00:00
Frappe PR Bot
ac1af3bce9 chore(release): Bumped to Version 14.10.1
## [14.10.1](https://github.com/frappe/erpnext/compare/v14.10.0...v14.10.1) (2022-12-13)

### Bug Fixes

* `Enough Parts to Build` in `BOM Stock Report` ([3b9e9d2](3b9e9d2c6e))
* `Material Request` reference in internal `Sales Order` ([416d178](416d178209))
* add translation variable order ([ef933a8](ef933a8231))
* Buying and selling check in pricing rule ([f5205a5](f5205a5b5d))
* **ecommerce:** remove query parameters from referer ([40621b9](40621b99c8))
* handle_post_depr_entries_fail, show error alert and send email ([b661f57](b661f5758a))
* incorrect balance on parent company due to key mismatch ([436e93c](436e93c129))
* index error on customer master ([02cc618](02cc618a1f))
* Maintain Same Rate Throughout Sales Cycle doesn't work ([5398cf8](5398cf8f22)), closes [#32923](https://github.com/frappe/erpnext/issues/32923)
* order status in `Production Planning Report` ([a657db6](a657db66b4))
* Permission issue in Tax Detail report ([7a5b80d](7a5b80dfbc))
* **pos:** variable typo: `s_pos` -> `is_pos` ([afbd48f](afbd48f26e))
* Reapply pricing rule on qty change ([c726c16](c726c16702))
* Remove free items ([5e5937d](5e5937d6d0))
* total value in Warehouse Wise Stock Balance ([c5a54d7](c5a54d7912))

### Performance Improvements

* add indexes on payment entry reference (backport [#33288](https://github.com/frappe/erpnext/issues/33288)) ([#33289](https://github.com/frappe/erpnext/issues/33289)) ([ce63086](ce63086813))
2022-12-13 12:30:55 +00:00
Ankush Menat
983cc345f2 Merge pull request #33318 from frappe/version-14-hotfix
chore: release v14
2022-12-13 17:59:30 +05:30
Sagar Sharma
6c3e802657 Merge pull request #33320 from frappe/mergify/bp/version-14-hotfix/pr-33314
fix: `Enough Parts to Build` in `BOM Stock Report` (backport #33314)
2022-12-13 15:58:24 +05:30
Sagar Sharma
4059b768f6 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-33314 2022-12-13 15:24:41 +05:30
Nabin Hait
bd6d249b8a Merge pull request #33322 from frappe/mergify/bp/version-14-hotfix/pr-33300
fix(pos): variable typo: `s_pos` -> `is_pos` (backport #33300)
2022-12-13 15:22:53 +05:30
Sabu Siyad
afbd48f26e fix(pos): variable typo: s_pos -> is_pos
Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit 7d64bf78cf)
2022-12-13 09:52:15 +00:00
s-aga-r
3b9e9d2c6e fix: Enough Parts to Build in BOM Stock Report
(cherry picked from commit 723c64ba73)
2022-12-13 09:50:01 +00:00
Nabin Hait
00ce3382b8 Merge pull request #33316 from frappe/mergify/bp/version-14-hotfix/pr-33313
fix: Permission issue in Tax Detail report (backport #33313)
2022-12-13 15:15:35 +05:30
Nabin Hait
00379c277b Merge pull request #33259 from AnandBaburajan/handle_post_depr_entries_fail
fix: handle asset depreciation entries posting failure, show error alert and send email
2022-12-13 15:05:36 +05:30
Nabin Hait
7a5b80dfbc fix: Permission issue in Tax Detail report
(cherry picked from commit aa787e4030)
2022-12-13 08:58:29 +00:00
Anand Baburajan
db36ddc7c0 Merge branch 'version-14-hotfix' into handle_post_depr_entries_fail 2022-12-13 14:09:11 +05:30
ruthra kumar
dbd0d560a8 Merge pull request #33311 from frappe/mergify/bp/version-14-hotfix/pr-33303
fix: incorrect balance on parent company on consolidate Balance sheet due to key mismatch (backport #33303)
2022-12-13 13:45:41 +05:30
rohitwaghchaure
d707528113 Merge pull request #33301 from frappe/mergify/bp/version-14-hotfix/pr-33281
fix: maintain same rate throughout sales cycle doesn't work with quotation (backport #33281)
2022-12-13 10:59:11 +05:30
ruthra kumar
436e93c129 fix: incorrect balance on parent company due to key mismatch
(cherry picked from commit 7b3316dc31)
2022-12-13 03:37:05 +00:00
Sagar Sharma
8b7c9ced0a Merge pull request #33306 from frappe/mergify/bp/version-14-hotfix/pr-33304
fix: `Material Request` reference in internal `Sales Order` (backport #33304)
2022-12-12 23:53:10 +05:30
s-aga-r
416d178209 fix: Material Request reference in internal Sales Order
(cherry picked from commit 78b438f6cf)
2022-12-12 18:18:53 +00:00
Tunde Akinyanmi
5d410f114a test: refactor test case
(cherry picked from commit 71aa8c5e1c)
2022-12-12 14:10:04 +00:00
Tunde Akinyanmi
1b94200ab7 test: ensure test case sets Selling Settings
(cherry picked from commit d193a14b8f)
2022-12-12 14:10:04 +00:00
Tunde Akinyanmi
5398cf8f22 fix: Maintain Same Rate Throughout Sales Cycle doesn't work
Issue #29976 was partly fixed by #32923 but the problem still persists.
The reason is because an incorrect fieldname was passed to the
`validate_rate_with_reference_doc` method.
This commit fixes it

(cherry picked from commit 97ddfcfc7c)
2022-12-12 14:10:03 +00:00
Anand Baburajan
7a7325fd90 Merge branch 'version-14-hotfix' into handle_post_depr_entries_fail 2022-12-12 16:36:19 +05:30
mergify[bot]
ce63086813 perf: add indexes on payment entry reference (backport #33288) (#33289)
perf: add indexes on payment entry reference (#33288)

Adds index on:
1. reference doctype
2. reference name

*Why not composite index?*

There are three type of queries on this doctype

- filtering ref_doctype - doctype index helps here
- filtering ref_name - name index helps here
- filtering both - name index helps here too. Since it has sufficiently
  high cardinality. Composite index wont help in case where ref_doctype
  isn't specfied.

[skip ci]

(cherry picked from commit 593626f502)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-12-12 13:02:23 +05:30
Anand Baburajan
92ed9fdd03 Merge branch 'version-14-hotfix' into handle_post_depr_entries_fail 2022-12-08 21:26:27 +05:30
rohitwaghchaure
52e07da535 Merge pull request #33262 from frappe/mergify/bp/version-14-hotfix/pr-33258
fix: total value in Warehouse Wise Stock Balance (backport #33258)
2022-12-08 21:14:29 +05:30
Anand Baburajan
9b5620c838 Merge branch 'version-14-hotfix' into handle_post_depr_entries_fail 2022-12-08 21:04:32 +05:30
anandbaburajan
4fbf65dd57 chore: use frappe.db.set_value instead of asset.save 2022-12-08 21:04:08 +05:30
Deepesh Garg
c2aaab9e15 Merge pull request #33272 from frappe/mergify/bp/version-14-hotfix/pr-33200
fix: Buying and selling check in pricing rule (backport #33200)
2022-12-08 20:54:48 +05:30
Deepesh Garg
ad03355333 chore: Update tests
(cherry picked from commit 6192af5cf0)
2022-12-08 13:12:32 +00:00
Deepesh Garg
5e5937d6d0 fix: Remove free items
(cherry picked from commit 0581000990)
2022-12-08 13:12:31 +00:00
Deepesh Garg
033b2a4825 chore: Add POS Invoices
(cherry picked from commit 5f821b93a5)
2022-12-08 13:12:31 +00:00
Deepesh Garg
c726c16702 fix: Reapply pricing rule on qty change
(cherry picked from commit b741ae143c)
2022-12-08 13:12:30 +00:00
Deepesh Garg
f5205a5b5d fix: Buying and selling check in pricing rule
(cherry picked from commit f54838ab56)
2022-12-08 13:12:30 +00:00
Deepesh Garg
b0cccaff01 Merge pull request #33266 from frappe/mergify/bp/version-14-hotfix/pr-33227
fix: add translation variable index (backport #33227)
2022-12-08 18:06:37 +05:30
Deepesh Garg
05056327e7 Merge pull request #33270 from frappe/mergify/bp/version-14-hotfix/pr-33269
fix(ecommerce): remove query parameters from referrer (backport #33269)
2022-12-08 18:06:22 +05:30
Sabu Siyad
40621b99c8 fix(ecommerce): remove query parameters from referer
inclusion of query parameters results in logic failure

example:
- logic check if referrer is `all-products`
- `http://shop.example/all-products` -> `all-products`, valid outcome
- `http://shop.example/all-products?start=1` -> `all-products?start=1`,
  invalid outcome

Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit b6bd408f19)
2022-12-08 11:42:24 +00:00
barredterra
ef933a8231 fix: add translation variable order
(cherry picked from commit 748c74ba52)
2022-12-08 09:47:56 +00:00
Deepesh Garg
8467b2eb25 Merge pull request #33264 from frappe/mergify/bp/version-14-hotfix/pr-33254
fix: index error on customer master (backport #33254)
2022-12-08 15:15:42 +05:30
ruthra kumar
02cc618a1f fix: index error on customer master
(cherry picked from commit cf1e3dc8ea)
2022-12-08 07:23:13 +00:00
Rohit Waghchaure
c5a54d7912 fix: total value in Warehouse Wise Stock Balance
(cherry picked from commit f598da7c81)
2022-12-08 04:43:59 +00:00
anandbaburajan
bb66b64b94 chore: styling 2022-12-08 01:35:10 +05:30
Anand Baburajan
c35e352b3b Merge branch 'version-14-hotfix' into handle_post_depr_entries_fail 2022-12-08 01:29:43 +05:30
anandbaburajan
b661f5758a fix: handle_post_depr_entries_fail, show error alert and send email 2022-12-08 01:00:57 +05:30
Sagar Sharma
162ecdca75 Merge pull request #33256 from frappe/mergify/bp/version-14-hotfix/pr-33255
fix: order status in `Production Planning Report` (backport #33255)
2022-12-08 00:04:01 +05:30
s-aga-r
a657db66b4 fix: order status in Production Planning Report
(cherry picked from commit 632c08f7e0)
2022-12-07 18:06:54 +00:00
Frappe PR Bot
1e351a9e0b chore(release): Bumped to Version 14.10.0
# [14.10.0](https://github.com/frappe/erpnext/compare/v14.9.0...v14.10.0) (2022-12-06)

### Bug Fixes

* add company filter in RFQ Items ([7c1595e](7c1595e2c2))
* Allow item rate udpates for non-stock invoices ([0307656](030765618b))
* Bundle item rates ([82cdf49](82cdf49d32))
* data import mandatory account_head, charge_type ([653cb9f](653cb9fc3b))
* default clear repost logs ([e039a14](e039a14f6f))
* Due date for month end payment term ([9b40b7f](9b40b7f240))
* Error on making stock entry from material request ([701ccc3](701ccc36c8))
* key error on p/l and balance sheet reports on foreign currency ([23a0a53](23a0a5337e))
* key error while filtering on date range and different currency ([08bca7d](08bca7d252))
* **lint:** trailing whitespace ([fae941c](fae941c4e3))
* non empty FG batch picked while completing work order ([e5e6b5d](e5e6b5d81c))
* **pos:** partial return amount update ([91920f4](91920f4d84))
* reload currency exchange settings ([5b5a85e](5b5a85ee3b))
* replace sql code with fields list in get_cached_value ([e18d0ec](e18d0eca3c))
* Tax withholding net total for PI in reports ([f87c3c6](f87c3c6157))
* test case ([39680ed](39680ed28b))
* type error on Sales Pipeline Analytics ([3af2b9b](3af2b9b423))
* use is_last_day_of_the_month in test_scrap_asset ([fc175e2](fc175e2b1f))
* **UX:** Alert on change of item rate in Stock Entry ([b2da76f](b2da76f02c))

### Features

* warehouse wise stock balance ([7027fda](7027fdae39))
2022-12-06 14:37:42 +00:00
Deepesh Garg
8f97b07463 Merge pull request #33233 from frappe/version-14-hotfix
chore: release v14
2022-12-06 20:06:17 +05:30
Deepesh Garg
e5cd4195d9 Merge pull request #33238 from frappe/mergify/bp/version-14-hotfix/pr-33192
fix: Bundle item rates (backport #33192)
2022-12-06 18:57:08 +05:30
Deepesh Garg
8a17680e75 Merge pull request #33239 from frappe/mergify/bp/version-14-hotfix/pr-33146
fix: reload Currency Exchange Settings in patch (backport #33146)
2022-12-06 18:56:52 +05:30
rohitwaghchaure
bc5523318c Merge pull request #33240 from frappe/mergify/bp/version-14-hotfix/pr-33236
feat: warehouse wise stock balance (backport #33236)
2022-12-06 18:03:36 +05:30
Rohit Waghchaure
7027fdae39 feat: warehouse wise stock balance
(cherry picked from commit 861aa9e08a)
2022-12-06 12:29:23 +00:00
barredterra
5b5a85ee3b fix: reload currency exchange settings
(cherry picked from commit 06e094b5fc)
2022-12-06 12:09:03 +00:00
Deepesh Garg
98bb446e98 chore: Update tests
(cherry picked from commit b1242bc56c)
2022-12-06 12:08:06 +00:00
Deepesh Garg
076027a68c chore: Consider bundle qty as well
(cherry picked from commit e5566b31d5)
2022-12-06 12:08:06 +00:00
Deepesh Garg
82cdf49d32 fix: Bundle item rates
(cherry picked from commit 826f45ad60)
2022-12-06 12:08:05 +00:00
Deepesh Garg
cc0f9d4ed5 Merge pull request #33235 from frappe/mergify/bp/version-14-hotfix/pr-33191
fix: key error while filtering on date range and reporting on foreign currency (backport #33191)
2022-12-06 17:36:18 +05:30
ruthra kumar
23a0a5337e fix: key error on p/l and balance sheet reports on foreign currency
(cherry picked from commit a6794c3606)
2022-12-06 16:55:03 +05:30
ruthra kumar
e18d0eca3c fix: replace sql code with fields list in get_cached_value
(cherry picked from commit 19db7e2989)
2022-12-06 16:55:00 +05:30
ruthra kumar
08bca7d252 fix: key error while filtering on date range and different currency
(cherry picked from commit 9b8d6fe411)
2022-12-06 10:14:01 +00:00
Deepesh Garg
ee74c555d5 Merge pull request #33230 from frappe/mergify/bp/version-14-hotfix/pr-33219
fix: Allow item rate updates for non-stock invoices (backport #33219)
2022-12-06 12:30:41 +05:30
Deepesh Garg
030765618b fix: Allow item rate udpates for non-stock invoices
(cherry picked from commit ef9d126254)
2022-12-06 03:43:16 +00:00
rohitwaghchaure
cea7a32abc Merge pull request #33225 from frappe/mergify/bp/version-14-hotfix/pr-33224
fix: non empty FG batch picked while completing work order (backport #33224)
2022-12-05 23:59:07 +05:30
Rohit Waghchaure
e5e6b5d81c fix: non empty FG batch picked while completing work order
(cherry picked from commit 713330cbf6)
2022-12-05 15:00:15 +00:00
ruthra kumar
60f5611fb9 Merge pull request #33223 from frappe/mergify/bp/version-14-hotfix/pr-33222
fix: data import mandatory account_head, charge_type (backport #33222)
2022-12-05 17:56:27 +05:30
ruthra kumar
653cb9fc3b fix: data import mandatory account_head, charge_type
(cherry picked from commit 3814db02eb)
2022-12-05 11:27:34 +00:00
Sagar Sharma
5bdec0b512 Merge pull request #33205 from frappe/mergify/bp/version-14-hotfix/pr-33199
refactor: remove `balance` from `Warehouse Tree` (backport #33199)
2022-12-02 18:27:07 +05:30
s-aga-r
bcbeaea05c refactor: remove balance from Warehouse Tree
(cherry picked from commit 3ce8386ca3)
2022-12-02 08:55:05 +00:00
Deepesh Garg
251440dfec Merge pull request #33203 from frappe/mergify/bp/version-14-hotfix/pr-33193
fix: clear repost logs using Log Settings (backport #33193)
2022-12-02 14:23:29 +05:30
Rohit Waghchaure
39680ed28b fix: test case
(cherry picked from commit 2cce6f2a34)
2022-12-02 08:26:50 +00:00
Rohit Waghchaure
e039a14f6f fix: default clear repost logs
(cherry picked from commit 5949a7ecff)
2022-12-02 08:26:49 +00:00
Deepesh Garg
a05bf0a7ca Merge pull request #33201 from frappe/mergify/bp/version-14-hotfix/pr-33195
fix: type error on Sales Pipeline Analytics (backport #33195)
2022-12-02 13:13:44 +05:30
ruthra kumar
3af2b9b423 fix: type error on Sales Pipeline Analytics
(cherry picked from commit 4856e750f9)
2022-12-02 04:41:21 +00:00
Deepesh Garg
d7306d2ec4 Merge pull request #33197 from frappe/mergify/bp/version-14-hotfix/pr-33183
fix: Due date for month end payment term (backport #33183)
2022-12-02 10:09:55 +05:30
Sagar Sharma
ffa4deac26 Merge pull request #33196 from frappe/mergify/bp/version-14-hotfix/pr-33182
fix: Error on making stock entry from material request (backport #33182)
2022-12-01 21:37:39 +05:30
Sagar Sharma
a80f8ed2f8 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-33182 2022-12-01 19:56:55 +05:30
Sagar Sharma
1214b93e07 Merge pull request #33198 from frappe/mergify/bp/version-14-hotfix/pr-33170
fix(UX): Alert on change of item rate in Stock Entry (backport #33170)
2022-12-01 19:56:16 +05:30
Deepesh Garg
b2da76f02c fix(UX): Alert on change of item rate in Stock Entry
(cherry picked from commit 4bd9289d7d)
2022-12-01 12:47:39 +00:00
Deepesh Garg
9b40b7f240 fix: Due date for month end payment term
(cherry picked from commit bfb81ef56f)
2022-12-01 12:46:55 +00:00
Deepesh Garg
701ccc36c8 fix: Error on making stock entry from material request
(cherry picked from commit 64e5a79a91)
2022-12-01 12:46:12 +00:00
Deepesh Garg
dfd43141e3 Merge pull request #33188 from frappe/mergify/bp/version-14-hotfix/pr-33091
fix(pos): partial return amount update (backport #33091)
2022-12-01 16:17:29 +05:30
Deepesh Garg
6debf39ee8 Merge pull request #33189 from AnandBaburajan/asset_last_day_test_bug_14_htfx
fix: use is_last_day_of_the_month in test_scrap_asset (backport #33185)
2022-12-01 16:17:01 +05:30
anandbaburajan
fc175e2b1f fix: use is_last_day_of_the_month in test_scrap_asset 2022-12-01 13:01:23 +05:30
Sabu Siyad
fae941c4e3 fix(lint): trailing whitespace
Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit c5edbe2e2f)
2022-12-01 06:12:26 +00:00
Sabu Siyad
91920f4d84 fix(pos): partial return amount update
Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit a378619c9a)
2022-12-01 06:12:25 +00:00
Sagar Sharma
6957e2a85c Merge pull request #33175 from frappe/mergify/bp/version-14-hotfix/pr-33174
fix: add company filter in RFQ Items (backport #33174)
2022-11-30 12:25:57 +05:30
s-aga-r
7c1595e2c2 fix: add company filter in RFQ Items
(cherry picked from commit ca0485a503)
2022-11-30 05:07:06 +00:00
Deepesh Garg
6878536a57 Merge pull request #33168 from frappe/mergify/bp/version-14-hotfix/pr-33162
fix: Tax withholding net total for PI in reports (backport #33162)
2022-11-29 19:23:16 +05:30
Deepesh Garg
f87c3c6157 fix: Tax withholding net total for PI in reports
(cherry picked from commit 3eb1ed19a1)
2022-11-29 13:21:16 +00:00
Frappe PR Bot
7d63bcbeb6 chore(release): Bumped to Version 14.9.0
# [14.9.0](https://github.com/frappe/erpnext/compare/v14.8.0...v14.9.0) (2022-11-29)

### Bug Fixes

* `production_item` filter in `Job Card Summary Report` ([c9f4f60](c9f4f60425))
* `Work Order` filter typo in `Job Card Summary Report` ([b157193](b1571932d0))
* Auto repeat date validations ([2aada1a](2aada1a0d9))
* check for session user rather than owner ([c9c7222](c9c7222ded))
* company name with `,` in `Job Card Summary Report` ([9c6d020](9c6d020e49))
* company name with `,` in `Work Order Summary Report` ([bc649b3](bc649b371f))
* create rounding gl entry for PCV during gle post processing ([fd4bcd9](fd4bcd9f7f))
* Debit and Credit not equal while submitting PI containing asset item ([c11a31b](c11a31b390))
* disbursable amount on currrent security price ([5edaf83](5edaf83733))
* Dispatch address display ([ef687e2](ef687e22b8))
* incorrect balance qty ([f92b501](f92b5011da))
* job card for quantity UX ([59e2ab7](59e2ab702f))
* MR Item `description` and `item_name` gets reset on `qty` change ([85d108b](85d108b810))
* only show serial no batch selector only once ([8d0f715](8d0f715087))
* opportunity list doesn't show assigned user (backport [#33110](https://github.com/frappe/erpnext/issues/33110)) ([#33131](https://github.com/frappe/erpnext/issues/33131)) ([0ba2a4d](0ba2a4d084))
* **pos:** filter on customer groups ([c1ae5b0](c1ae5b0af5))
* **pos:** warehouse should be in company ([c03ec80](c03ec80d1a))
* precision in asset test_scrap_asset ([0fe5e9a](0fe5e9a9d1))
* production plan UX ([4607590](46075901ba))
* remove duplicate schema ([cdd13cd](cdd13cd95f))
* remove obsolete comment ([978924a](978924a7e4))
* reposting error `AttributeError: 'datetime.timedelta' object has no attribute 'replace'` ([4b0c9b6](4b0c9b6115))
* reset `voucher_type` and `voucher_no` if `based_on` is set to `Item and Warehouse` ([e530f0b](e530f0b2fb))
* UX for inventory dimension ([f1dd4d0](f1dd4d0449))
* **ux:** Action buttons in Bank Reconciliation ([93b8cc3](93b8cc3042))
* validation msg in stock entry ([65ac84e](65ac84e020))
* Valuation Rate column UX in stock ledger report ([5c065e8](5c065e8a64))

### Features

* add connections to Incoterm doctype ([89b9a06](89b9a06204))
* add doctype Incoterm ([b711931](b7119318a6))
* add german translations for incoterm titles ([f7988de](f7988dea1b))
* add incoterm to purchasing transactions ([88346b1](88346b17e9))
* add incoterm to sales transactions ([fcfe0cb](fcfe0cb9e9))
* create Incoterm records after install ([93e029d](93e029df91))
* create incoterms and migrate shipments ([014896a](014896a595))
* german tax templates ([5652af0](5652af04ba))
* item wise tds calculation for purchase order ([5f8f574](5f8f574e20))
* item wise tds calculation for purchase order. ([2bd8bd2](2bd8bd224b))
* item wise tds in purchase order ([ba36435](ba3643514e))
* make Material Request for sub-assembly items ([5fc4dfa](5fc4dfaad6))
* **pos:** invoice: fitler warehouse by company ([c379baf](c379baf7a2))
* validate repost item valuation against accounts freeze date ([04f50ea](04f50ea76a))
2022-11-29 13:19:34 +00:00
Deepesh Garg
9fc8acf707 Merge pull request #33163 from frappe/version-14-hotfix
chore: release v14
2022-11-29 18:48:14 +05:30
Sagar Sharma
f2f06aaa56 Merge pull request #33159 from frappe/mergify/bp/version-14-hotfix/pr-33136
fix: reset `voucher_type` and `voucher_no` if `based_on` is set to `Transaction` (backport #33136)
2022-11-29 13:24:53 +05:30
s-aga-r
5728300f03 chore: make posting_date and posting_time read-only if based_on is set to Transaction
(cherry picked from commit 4e10352b48)
2022-11-29 06:44:35 +00:00
s-aga-r
e530f0b2fb fix: reset voucher_type and voucher_no if based_on is set to Item and Warehouse
(cherry picked from commit eeec008547)
2022-11-29 06:44:35 +00:00
rohitwaghchaure
8ebf34629d Merge pull request #33158 from frappe/mergify/bp/version-14-hotfix/pr-33013
fix: validate repost item valuation against accounts freeze date (backport #33013)
2022-11-29 12:06:29 +05:30
Sagar Sharma
72351e38f2 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-33013 2022-11-29 11:16:53 +05:30
Deepesh Garg
6fa81089d6 Merge pull request #33152 from frappe/mergify/bp/version-14-hotfix/pr-33143
fix: Auto repeat date validations (backport #33143)
2022-11-29 11:07:46 +05:30
Deepesh Garg
fb6791abe3 Merge pull request #33153 from frappe/mergify/bp/version-14-hotfix/pr-33115
fix: remove product schema block from additional info section on item template (backport #33115)
2022-11-29 11:07:23 +05:30
Deepesh Garg
bf833c4f09 Merge pull request #33151 from frappe/mergify/bp/version-14-hotfix/pr-33138
fix(ux): Action buttons in Bank Reconciliation (backport #33138)
2022-11-29 11:06:48 +05:30
Deepesh Garg
5848147a92 Merge pull request #33155 from frappe/mergify/bp/version-14-hotfix/pr-33098
fix(pos): warehouse selection (backport #33098)
2022-11-29 11:06:21 +05:30
Deepesh Garg
150319d0cb Merge pull request #33156 from frappe/mergify/bp/version-14-hotfix/pr-33116
fix: only show serial no batch selector only once (backport #33116)
2022-11-29 11:06:08 +05:30
Deepesh Garg
b9ff172e13 Merge pull request #33154 from frappe/mergify/bp/version-14-hotfix/pr-33112
fix(pos): filter on customer groups (backport #33112)
2022-11-29 11:05:54 +05:30
Dany Robert
5854f1791c chore: pre-commit
(cherry picked from commit 88a0aa4077)
2022-11-29 05:11:39 +00:00
Dany Robert
c9c7222ded fix: check for session user rather than owner
(cherry picked from commit b482e3876d)
2022-11-29 05:11:39 +00:00
Dany Robert
68d9161a66 chore: pre-commit
(cherry picked from commit be15419bd5)
2022-11-29 05:11:38 +00:00
Dany Robert
04f50ea76a feat: validate repost item valuation against accounts freeze date
(cherry picked from commit 61f05132db)
2022-11-29 05:11:38 +00:00
rohitwaghchaure
4928058ed8 Merge pull request #33149 from frappe/mergify/bp/version-14-hotfix/pr-33144
fix: incorrect balance qty (backport #33144)
2022-11-29 10:41:36 +05:30
Shariq Ansari
8d0f715087 fix: only show serial no batch selector only once
(cherry picked from commit 0f87d329d6)
2022-11-29 04:51:19 +00:00
Sabu Siyad
c379baf7a2 feat(pos): invoice: fitler warehouse by company
Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit 4ad0e2ed7e)
2022-11-29 04:46:19 +00:00
Sabu Siyad
c03ec80d1a fix(pos): warehouse should be in company
Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit 95a620a30d)
2022-11-29 04:46:19 +00:00
Sabu Siyad
c1ae5b0af5 fix(pos): filter on customer groups
Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit cc63415887)
2022-11-29 04:26:25 +00:00
ruthra kumar
cdd13cd95f fix: remove duplicate schema
(cherry picked from commit 2c18a95115)
2022-11-29 04:06:25 +00:00
Deepesh Garg
5abcb478d0 chore: Update condition
(cherry picked from commit 6a47fb6c9e)
2022-11-29 03:59:09 +00:00
Deepesh Garg
2aada1a0d9 fix: Auto repeat date validations
(cherry picked from commit fa15221455)
2022-11-29 03:59:09 +00:00
Deepesh Garg
e093c32d06 Merge pull request #33128 from frappe/mergify/bp/version-14-hotfix/pr-33022
feat: Incoterms in buying and selling (backport #33022)
2022-11-29 09:28:59 +05:30
Deepesh Garg
93b8cc3042 fix(ux): Action buttons in Bank Reconciliation
(cherry picked from commit 6ebe8ad60d)
2022-11-29 03:54:02 +00:00
Rohit Waghchaure
93ec57dd44 test: test case for serialized batched item
(cherry picked from commit b606a9684b)
2022-11-29 03:18:53 +00:00
Rohit Waghchaure
f92b5011da fix: incorrect balance qty
(cherry picked from commit b2105a8be7)
2022-11-29 03:18:53 +00:00
Raffael Meyer
7477bb96c8 chore: resolve merge conflict 2022-11-28 18:51:40 +01:00
Deepesh Garg
6c3fbf03f9 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-33022 2022-11-28 23:06:23 +05:30
Deepesh Garg
0d8112af76 Merge pull request #33133 from frappe/mergify/bp/version-14-hotfix/pr-33129
chore: Supplier invoice no field description (backport #33129)
2022-11-28 22:48:45 +05:30
Deepesh Garg
088c168f96 Merge pull request #33142 from frappe/mergify/bp/version-14-hotfix/pr-33107
feat: german tax templates (backport #33107)
2022-11-28 22:48:20 +05:30
Sagar Sharma
ae26e550d0 Merge pull request #33140 from frappe/mergify/bp/version-14-hotfix/pr-33139
fix: reposting error `AttributeError: 'datetime.timedelta' object has no attribute 'replace'` (backport #33139)
2022-11-28 22:06:21 +05:30
barredterra
5652af04ba feat: german tax templates
(cherry picked from commit 7fd2639e68)
2022-11-28 16:25:02 +00:00
s-aga-r
4b0c9b6115 fix: reposting error AttributeError: 'datetime.timedelta' object has no attribute 'replace'
(cherry picked from commit eeda264eb6)
2022-11-28 16:01:39 +00:00
s-aga-r
65ac84e020 fix: validation msg in stock entry
(cherry picked from commit ba77da0874)
2022-11-28 16:01:39 +00:00
rohitwaghchaure
648a017eda Merge pull request #33137 from frappe/mergify/bp/version-14-hotfix/pr-33135
feat: make Material Request for sub-assembly items (backport #33135)
2022-11-28 18:32:54 +05:30
Rohit Waghchaure
5fc4dfaad6 feat: make Material Request for sub-assembly items
(cherry picked from commit e02f35c8ff)
2022-11-28 11:24:31 +00:00
Deepesh Garg
6e3ad109d2 chore: Supplier invoice no field description
(cherry picked from commit 4f2ece34df)
2022-11-28 07:36:10 +00:00
mergify[bot]
0ba2a4d084 fix: opportunity list doesn't show assigned user (backport #33110) (#33131)
fix: opportunity list doesn't show assigned user (#33110)

Because `db_update` is performed `_assign` property is not updated and
hence lead -> opportunity conversion makes it disappear from list view.

Steps to reproduce:

1. Create lead
2. Assign anyone
3. Create opportunity from lead.
4. Form view shows assigned user, list view wont.

(cherry picked from commit 63b9795d41)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-11-28 11:19:32 +05:30
barredterra
21deb02d81 chore: resolve merge conflicts 2022-11-27 16:30:19 +01:00
Raffael Meyer
978924a7e4 fix: remove obsolete comment
(cherry picked from commit 491857b3c8)
2022-11-27 15:24:20 +00:00
barredterra
89b9a06204 feat: add connections to Incoterm doctype
(cherry picked from commit a5966b6f84)
2022-11-27 15:24:19 +00:00
barredterra
f7988dea1b feat: add german translations for incoterm titles
(cherry picked from commit ffd287d5a6)
2022-11-27 15:24:19 +00:00
barredterra
88346b17e9 feat: add incoterm to purchasing transactions
(cherry picked from commit 77105306f2)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
2022-11-27 15:24:18 +00:00
barredterra
fcfe0cb9e9 feat: add incoterm to sales transactions
(cherry picked from commit 029f22c549)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.json
2022-11-27 15:24:17 +00:00
barredterra
93e029df91 feat: create Incoterm records after install
(cherry picked from commit ce83f02f24)
2022-11-27 15:24:16 +00:00
barredterra
014896a595 feat: create incoterms and migrate shipments
(cherry picked from commit d2563ee973)

# Conflicts:
#	erpnext/patches.txt
2022-11-27 15:24:16 +00:00
barredterra
b7119318a6 feat: add doctype Incoterm
(cherry picked from commit 1a1bfc8db9)
2022-11-27 15:24:15 +00:00
Deepesh Garg
956b0520d7 Merge pull request #33113 from frappe/mergify/bp/version-14-hotfix/pr-33111
fix: Loan disbursable amount on current security price (backport #33111)
2022-11-27 20:50:09 +05:30
rohitwaghchaure
f365e6b4a2 Merge pull request #33127 from frappe/mergify/bp/version-14-hotfix/pr-33118
fix: production plan UX (backport #33118)
2022-11-27 18:47:39 +05:30
Sagar Sharma
9533a64f6a Merge pull request #33123 from frappe/mergify/bp/version-14-hotfix/pr-33120
fix: `Work Order Summary` and `Job Card Summary` Report (backport #33120)
2022-11-27 10:27:37 +05:30
Rohit Waghchaure
46075901ba fix: production plan UX
(cherry picked from commit 8cb7112e72)
2022-11-27 03:17:28 +00:00
s-aga-r
c9f4f60425 fix: production_item filter in Job Card Summary Report
(cherry picked from commit ef7fd670fc)
2022-11-26 16:24:52 +00:00
s-aga-r
9c6d020e49 fix: company name with , in Job Card Summary Report
(cherry picked from commit 481149814e)
2022-11-26 16:24:52 +00:00
s-aga-r
b1571932d0 fix: Work Order filter typo in Job Card Summary Report
(cherry picked from commit 2e4f3e9317)
2022-11-26 16:24:51 +00:00
s-aga-r
bc649b371f fix: company name with , in Work Order Summary Report
(cherry picked from commit 87b39f045c)
2022-11-26 16:24:50 +00:00
Sagar Sharma
6e5fd55ed4 Merge pull request #33108 from frappe/mergify/bp/version-14-hotfix/pr-33090
fix: MR Item `item_name` and `description` gets reset on `qty` change (backport #33090)
2022-11-26 10:07:50 +05:30
Abhinav Raut
5edaf83733 fix: disbursable amount on currrent security price
(cherry picked from commit fe87c27acd)
2022-11-25 09:48:42 +00:00
s-aga-r
85d108b810 fix: MR Item description and item_name gets reset on qty change
(cherry picked from commit df0fee2312)
2022-11-25 05:49:50 +00:00
Deepesh Garg
ae6ad1e47d Merge pull request #33096 from frappe/mergify/bp/version-14-hotfix/pr-33092
fix: Debit and Credit not equal while submitting PI containing asset item (backport #33092)
2022-11-24 21:22:44 +05:30
Deepesh Garg
98d5cb30d1 Merge pull request #33106 from frappe/mergify/bp/version-14-hotfix/pr-33103
fix: job card "Qty to Manufacture" UX (backport #33103)
2022-11-24 21:22:28 +05:30
Deepesh Garg
8cd2539755 Merge pull request #33104 from frappe/mergify/bp/version-14-hotfix/pr-33100
fix: Dispatch address display (backport #33100)
2022-11-24 21:22:02 +05:30
Rohit Waghchaure
59e2ab702f fix: job card for quantity UX
(cherry picked from commit 87d37e90a2)
2022-11-24 13:54:59 +00:00
Deepesh Garg
ef687e22b8 fix: Dispatch address display
(cherry picked from commit 104fdcb9f9)
2022-11-24 12:31:13 +00:00
Deepesh Garg
517e40e1b8 Merge pull request #33099 from frappe/mergify/bp/version-14-hotfix/pr-33097
fix: precision in asset test_scrap_asset (backport #33097)
2022-11-24 16:58:04 +05:30
anandbaburajan
0fe5e9a9d1 fix: precision in asset test_scrap_asset
(cherry picked from commit 0e726609f1)
2022-11-24 10:44:31 +00:00
Deepesh Garg
c11a31b390 fix: Debit and Credit not equal while submitting PI containing asset item
(cherry picked from commit dc8d635120)
2022-11-24 09:14:06 +00:00
Deepesh Garg
82e41a2721 Merge pull request #33089 from frappe/mergify/bp/version-14-hotfix/pr-33088
fix: Valuation Rate column UX in stock ledger report (backport #33088)
2022-11-23 18:22:15 +05:30
Rohit Waghchaure
5c065e8a64 fix: Valuation Rate column UX in stock ledger report
(cherry picked from commit be19e4f621)
2022-11-23 12:00:49 +00:00
rohitwaghchaure
188b18dc5b Merge pull request #33083 from frappe/mergify/bp/version-14-hotfix/pr-33077
fix: UX for inventory dimension (backport #33077)
2022-11-23 12:33:44 +05:30
Deepesh Garg
5d7c4c182a Merge pull request #33085 from frappe/mergify/bp/version-14-hotfix/pr-33062
fix: create rounding gl entry for PCV during gle post processing (backport #33062)
2022-11-23 11:50:26 +05:30
Deepesh Garg
798717b12b Merge pull request #33082 from frappe/mergify/bp/version-14-hotfix/pr-33063
feat: item wise tds in purchase order (backport #33063)
2022-11-23 11:47:54 +05:30
Deepesh Garg
7a9f384b18 chore: resolve conflicts 2022-11-23 10:58:47 +05:30
Nabin Hait
fd4bcd9f7f fix: create rounding gl entry for PCV during gle post processing
(cherry picked from commit 022d8d5d79)
2022-11-23 05:07:29 +00:00
Rohit Waghchaure
f1dd4d0449 fix: UX for inventory dimension
(cherry picked from commit 0a69523940)
2022-11-23 04:24:36 +00:00
niralisatapara
5f8f574e20 feat: item wise tds calculation for purchase order
(cherry picked from commit 0fdde2e5c0)

# Conflicts:
#	erpnext/patches.txt
2022-11-23 04:22:46 +00:00
niralisatapara
2bd8bd224b feat: item wise tds calculation for purchase order.
(cherry picked from commit 46e8cdf31a)
2022-11-23 04:22:45 +00:00
niralisatapara
ba3643514e feat: item wise tds in purchase order
(cherry picked from commit b9d0b4e2d3)
2022-11-23 04:22:45 +00:00
Frappe PR Bot
df743aec29 chore(release): Bumped to Version 14.8.0
# [14.8.0](https://github.com/frappe/erpnext/compare/v14.7.0...v14.8.0) (2022-11-22)

### Bug Fixes

* Accounting Dimension filtering for Sales and Purchase Report ([b782209](b78220957b))
* add missing commas and brackets ([ecd4eab](ecd4eab2da))
* always send account currency in response ([f2fde83](f2fde8327d))
* Bulk payment generation against invoices ([57b00e3](57b00e3b16))
* cast POS query inputs to integers  (backport [#32975](https://github.com/frappe/erpnext/issues/32975)) ([#32977](https://github.com/frappe/erpnext/issues/32977)) ([55e1592](55e1592b70))
* don't set `rejected-qty` in return SCR ([4de02dc](4de02dc258))
* Don't show payment button for invoices on hold ([7487acd](7487acdeb6))
* hide reject-fields in return SCR ([71d6f2a](71d6f2a490))
* incorrect currency in Exchange rate revaluation ([a26470a](a26470a65f))
* Internal Transfer Material Request cycle and tracking fixed till purchase receipt ([eaf0950](eaf09503a9))
* link to brand doctype. ([b428307](b428307e9f))
* linters failing ([24aafb3](24aafb3866))
* make `is_internal_supplier` read-only ([caef140](caef140a9b))
* minor change ([ac3120b](ac3120b6f9))
* minor issue fixed ([c356d2c](c356d2cabd))
* naming ([a198a55](a198a55d2d))
* Opening journal entry templates ([6aada76](6aada76297))
* **pos:** item selector image border radius ([aaed4ab](aaed4ab958))
* precision in asset tests ([444f241](444f241263))
* **realtime:** Restrict updates to only last modified or current user ([#33034](https://github.com/frappe/erpnext/issues/33034)) ([9e8a835](9e8a8356e9))
* Remove unnecessary filters from Journal Entry ([387665d](387665d221))
* test case added for MR internal Transfer ([2a892f5](2a892f5c52))
* test case updated for mr ([6ddf273](6ddf27380f))
* Timesheet timer button ([53cf6b8](53cf6b8c89))
* update advace paid in SO/PO in account currency ([14235f2](14235f24b2))
* use `list()` on self mutating iteration ([eb968d7](eb968d7f02))
* Viewing account ledger from party master ([da2dfcc](da2dfcc10b))

### Features

* Workstation Type for BOM ([8323775](8323775282))
2022-11-22 16:00:31 +00:00
Deepesh Garg
9bb079d238 Merge pull request #33076 from frappe/version-14-hotfix
chore: release v14
2022-11-22 21:28:58 +05:30
Deepesh Garg
084d81025c Merge pull request #33078 from frappe/mergify/bp/version-14-hotfix/pr-33072
chore: Rearrange supplier invoice section in Purchase Invoice (backport #33072)
2022-11-22 20:41:10 +05:30
Deepesh Garg
995ad90b5a Merge pull request #33079 from frappe/mergify/bp/version-14-hotfix/pr-33068
fix: Don't show payment button for invoices on hold (backport #33068)
2022-11-22 20:40:53 +05:30
Deepesh Garg
f71f907b31 Merge pull request #33080 from frappe/mergify/bp/version-14-hotfix/pr-33069
fix: Remove unnecessary filters from Journal Entry (backport #33069)
2022-11-22 20:40:34 +05:30
Deepesh Garg
387665d221 fix: Remove unnecessary filters from Journal Entry
(cherry picked from commit cd88a53533)
2022-11-22 14:46:02 +00:00
Deepesh Garg
7487acdeb6 fix: Don't show payment button for invoices on hold
(cherry picked from commit 1b9e83251f)
2022-11-22 14:45:39 +00:00
Deepesh Garg
54317b56ea chore: Rearrange supplier invoice section in Purchase Invoice
(cherry picked from commit e96be712b8)
2022-11-22 14:45:05 +00:00
ruthra kumar
a2012cb710 Merge pull request #33073 from frappe/mergify/bp/version-14-hotfix/pr-33071
fix: advance paid updated in account currency for SO/PO (backport #33071)
2022-11-22 14:27:06 +05:30
ruthra kumar
48a3b3f6f3 test: fix test case for SO/PO advance amount
(cherry picked from commit 541cf153f7)
2022-11-22 08:15:57 +00:00
ruthra kumar
14235f24b2 fix: update advace paid in SO/PO in account currency
(cherry picked from commit bf76b85dfd)
2022-11-22 08:15:56 +00:00
Deepesh Garg
622c5837cf Merge pull request #33056 from frappe/mergify/bp/version-14-hotfix/pr-33051
fix: Timesheet timer button (backport #33051)
2022-11-21 14:04:47 +05:30
Deepesh Garg
db0b4d5966 Merge pull request #33055 from frappe/mergify/bp/version-14-hotfix/pr-33052
fix: Viewing account ledger from party master (backport #33052)
2022-11-21 12:49:28 +05:30
Deepesh Garg
53cf6b8c89 fix: Timesheet timer button
(cherry picked from commit 64802d1220)
2022-11-21 05:45:35 +00:00
Deepesh Garg
da2dfcc10b fix: Viewing account ledger from party master
(cherry picked from commit 15e74c5d7b)
2022-11-21 05:45:08 +00:00
Deepesh Garg
8215469b5e Merge pull request #33044 from frappe/mergify/bp/version-14-hotfix/pr-32958
fix: link `Item Price` brand to `Brand` doctype. (backport #32958)
2022-11-20 18:52:26 +05:30
Devin Slauenwhite
a198a55d2d fix: naming
(cherry picked from commit 3a35651441)
2022-11-19 13:45:19 +00:00
Devin Slauenwhite
b428307e9f fix: link to brand doctype.
(cherry picked from commit cee069d426)
2022-11-19 13:45:19 +00:00
Deepesh Garg
5456fec4d5 Merge pull request #33042 from frappe/mergify/bp/version-14-hotfix/pr-33032
fix: Accounting Dimension filtering for Sales and Purchase Report (backport #33032)
2022-11-19 18:52:45 +05:30
Deepesh Garg
3ee3f8e38e Merge pull request #33043 from frappe/mergify/bp/version-14-hotfix/pr-32999
fix: incorrect currency in Exchange rate revaluation (backport #32999)
2022-11-19 18:52:27 +05:30
Deepesh Garg
7bad53104b Merge pull request #33001 from frappe/mergify/bp/version-14-hotfix/pr-32994
chore(patch): remove reload_doc from post model sync update_exchange_rate_settings patch (backport #32994)
2022-11-19 18:46:27 +05:30
ruthra kumar
f2fde8327d fix: always send account currency in response
(cherry picked from commit 5caaccc94b)
2022-11-19 13:00:42 +00:00
ruthra kumar
a26470a65f fix: incorrect currency in Exchange rate revaluation
(cherry picked from commit 68b04e2577)
2022-11-19 13:00:42 +00:00
Deepesh Garg
44dbdba6a0 Merge pull request #33035 from frappe/mergify/bp/version-14-hotfix/pr-33034
fix(realtime): Restrict updates to only last modified or current user (backport #33034)
2022-11-19 18:22:07 +05:30
Deepesh Garg
b78220957b fix: Accounting Dimension filtering for Sales and Purchase Report
(cherry picked from commit 8b394afaa9)
2022-11-19 12:50:39 +00:00
gavin
9e8a8356e9 fix(realtime): Restrict updates to only last modified or current user (#33034)
(cherry picked from commit dd2493a541)
2022-11-18 11:48:47 +00:00
Deepesh Garg
f2283546b5 Merge pull request #33031 from frappe/mergify/bp/version-14-hotfix/pr-33014
fix: Bulk payment generation against invoices (backport #33014)
2022-11-18 16:51:54 +05:30
Faris Ansari
b1215f8ccf Merge pull request #33030 from frappe/mergify/bp/version-14-hotfix/pr-32986 2022-11-18 16:32:45 +05:30
Sagar Sharma
b403c7fdca Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32986 2022-11-18 16:11:51 +05:30
Sagar Sharma
59c35d9f88 Merge pull request #33029 from frappe/mergify/bp/version-14-hotfix/pr-32905
fix: Internal Transfer Material Request cycle and tracking fixed till purchase receipt (backport #32905)
2022-11-18 15:12:28 +05:30
Deepesh Garg
57b00e3b16 fix: Bulk payment generation against invoices
(cherry picked from commit 2dfe849c7d)
2022-11-18 09:41:01 +00:00
Deepesh Garg
a30747b723 Merge pull request #33017 from frappe/mergify/bp/version-14-hotfix/pr-33009
fix(pos): item selector image border radius (backport #33009)
2022-11-18 15:09:47 +05:30
Deepesh Garg
6d22305b9f Merge pull request #33018 from frappe/mergify/bp/version-14-hotfix/pr-33003
fix: precision in asset tests (backport #33003)
2022-11-18 15:09:04 +05:30
s-aga-r
71d6f2a490 fix: hide reject-fields in return SCR
(cherry picked from commit 7dd7617ec7)
2022-11-18 09:31:11 +00:00
s-aga-r
4de02dc258 fix: don't set rejected-qty in return SCR
(cherry picked from commit 8a73e963ce)
2022-11-18 09:31:11 +00:00
s-aga-r
0c73280a9b chore: linters
(cherry picked from commit 12d7b7e9c2)
2022-11-18 07:46:49 +00:00
Vishal
660e3fa081 chore: minor fix
(cherry picked from commit e5dfd53e6f)
2022-11-18 07:46:49 +00:00
Vishal
ac3120b6f9 fix: minor change
(cherry picked from commit ba6189d054)
2022-11-18 07:46:49 +00:00
Vishal
6ddf27380f fix: test case updated for mr
(cherry picked from commit 343b414b40)
2022-11-18 07:46:48 +00:00
Vishal
2a892f5c52 fix: test case added for MR internal Transfer
(cherry picked from commit 89aabdaaaa)
2022-11-18 07:46:48 +00:00
Vishal
c356d2cabd fix: minor issue fixed
(cherry picked from commit d86afddb60)
2022-11-18 07:46:48 +00:00
Vishal
eaf09503a9 fix: Internal Transfer Material Request cycle and tracking fixed till purchase receipt
(cherry picked from commit 71412f6877)
2022-11-18 07:46:47 +00:00
Anand Baburajan
d0ccc858ad Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-33003 2022-11-18 12:05:22 +05:30
Sagar Sharma
f10d6105c5 Merge pull request #33023 from frappe/mergify/bp/version-14-hotfix/pr-33019
fix: use `list()` on self mutating iteration (backport #33019)
2022-11-18 10:59:58 +05:30
Sabu Siyad
eb968d7f02 fix: use list() on self mutating iteration
https://github.com/frappe/erpnext/issues/30325

Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit 546c809cbe)
2022-11-18 04:55:43 +00:00
anandbaburajan
ecd4eab2da fix: add missing commas and brackets
(cherry picked from commit 218da1217a)
2022-11-17 12:22:41 +00:00
anandbaburajan
444f241263 fix: precision in asset tests
(cherry picked from commit b5e5d3b3af)
2022-11-17 12:22:41 +00:00
Sabu Siyad
aaed4ab958 fix(pos): item selector image border radius
Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit 2f4940cc26)
2022-11-17 12:03:22 +00:00
Ankush Menat
00558af873 chore: typo 2022-11-17 14:24:59 +05:30
Sagar Sharma
0378bb9702 Merge pull request #33010 from frappe/mergify/bp/version-14-hotfix/pr-33006
fix: make `is_internal_supplier` read-only in PO (backport #33006)
2022-11-17 14:23:17 +05:30
s-aga-r
caef140a9b fix: make is_internal_supplier read-only
(cherry picked from commit 5efbc2cbf8)
2022-11-17 08:40:41 +00:00
mergify[bot]
4c0b5ceb9e refactor: search queries (backport #33004) (#33007)
refactor: search queries (#33004)

- guard clauses for readability
- use values or format

(cherry picked from commit 34e4903ed7)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-11-17 13:06:46 +05:30
Ankush Menat
1db83247ce chore: hardcode doctype 2022-11-17 12:01:11 +05:30
Ritwik Puri
9a737afb77 chore(patch): remove reload_doc from post model sync update_exchange_rate_settings patch (#32994)
[skip ci]

(cherry picked from commit b03b568e6c)
2022-11-17 06:30:33 +00:00
Deepesh Garg
4a86b20e62 Merge pull request #32996 from frappe/mergify/bp/version-14-hotfix/pr-32983
fix: Opening journal entry templates (backport #32983)
2022-11-17 11:16:34 +05:30
Sagar Sharma
f70a028970 Merge pull request #32997 from frappe/mergify/bp/version-14-hotfix/pr-32911
feat: Workstation Type for BOM (backport #32911)
2022-11-17 10:59:45 +05:30
Rohit Waghchaure
24aafb3866 fix: linters failing
(cherry picked from commit ffa30127e7)
2022-11-16 18:31:29 +00:00
Rohit Waghchaure
bb337455b9 test: test case to check workstation type
(cherry picked from commit 7bd06e6fbc)
2022-11-16 18:31:28 +00:00
Rohit Waghchaure
8323775282 feat: Workstation Type for BOM
(cherry picked from commit 105c272816)
2022-11-16 18:31:25 +00:00
Deepesh Garg
6aada76297 fix: Opening journal entry templates
(cherry picked from commit 33b61aef5a)
2022-11-16 15:13:08 +00:00
Deepesh Garg
2d8332e004 Merge pull request #32990 from frappe/mergify/bp/version-14-hotfix/pr-32989
ci: fix flake8 URL (backport #32989)
2022-11-16 17:05:11 +05:30
Deepesh Garg
b473da8f66 ci: fix flake8 URL
(cherry picked from commit e81bec5fc9)
2022-11-16 10:56:22 +00:00
mergify[bot]
55e1592b70 fix: cast POS query inputs to integers (backport #32975) (#32977)
fix: cast POS query inputs to integers  (#32975)

fix: cast POS query inputs to integers
(cherry picked from commit c013db6ea1)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-11-15 18:50:51 +05:30
Frappe PR Bot
964abce057 chore(release): Bumped to Version 14.7.0
# [14.7.0](https://github.com/frappe/erpnext/compare/v14.6.0...v14.7.0) (2022-11-15)

### Bug Fixes

* add translate function to valitate company msg in chart of accounts importer ([8de4430](8de4430662))
* check type for reference name ([a305793](a30579393e))
* don't set WIP Warehouse if  is checked in WO ([f923183](f923183b64))
* GP incorrect buying amount if no upd on SI and Delivery Note ([2d8f00a](2d8f00afad))
* incorrect fix of conversion factor in PP ([c48d00a](c48d00ad77))
* Label for applicable dimension table ([eb4f8e4](eb4f8e4bd8))
* Maintain same rate between Quotation and Sales Order ([6c155d2](6c155d2825))
* Project filter in timesheet ([37bed12](37bed12df4))
* Purchase Receipt timeout error ([0d5b726](0d5b7269d4))
* repayment schedule regeneration ([2f5033b](2f5033b70f))
* set `WIP Warehouse` in Job Card ([c294652](c294652dab))
* set stock UOM in args to ensure item price is fetched ([a4187b9](a4187b9d8f))
* test cases ([071ee5d](071ee5d81c))
* **ux:** Tab break in Customer and Supplier form ([eeaa932](eeaa9329f6))
* Write Off section visibility for non POS Invoices ([07badbc](07badbc0f2))

### Features

* Repost Payment Ledger entries for vouchers ([de59b50](de59b50407))

### Reverts

* Revert "fix: get `consumed_qty` based on `received_qty` in SCR" ([7fd6c43](7fd6c43752))
* Revert "fix: set `received_qty` before_validate SCR" ([0ecb44d](0ecb44d40c))
2022-11-15 12:59:04 +00:00
Deepesh Garg
c310c8a4b0 Merge pull request #32972 from frappe/version-14-hotfix
chore: release v14
2022-11-15 18:17:10 +05:30
Deepesh Garg
d7340f54cf Merge pull request #32969 from frappe/mergify/bp/version-14-hotfix/pr-32953
chore(payment_entry): Remove dead validations (backport #32953)
2022-11-15 16:32:54 +05:30
Deepesh Garg
19f3d86a12 Merge pull request #32966 from frappe/mergify/bp/version-14-hotfix/pr-32962
fix: Write Off section visibility for non POS Invoices (backport #32962)
2022-11-15 16:31:49 +05:30
Sagar Sharma
48dbf47e76 Merge pull request #32974 from frappe/mergify/bp/version-14-hotfix/pr-32971
Revert "fix: get `consumed_qty` based on `received_qty` in SCR" (backport #32971)
2022-11-15 15:59:45 +05:30
s-aga-r
f10cceb261 test: fix test cases for supplied-items consumed_qty
(cherry picked from commit 369db4eacc)
2022-11-15 09:48:02 +00:00
s-aga-r
7fd6c43752 Revert "fix: get consumed_qty based on received_qty in SCR"
This reverts commit 70c9b8dc50.

(cherry picked from commit 01f56c621c)
2022-11-15 09:48:02 +00:00
s-aga-r
0ecb44d40c Revert "fix: set received_qty before_validate SCR"
This reverts commit c447dfaa9c.

(cherry picked from commit 3706a9b4dc)
2022-11-15 09:48:02 +00:00
Gavin D'souza
30d1491257 chore(payment_entry): Remove dead validations
(cherry picked from commit e1ecc9a819)
2022-11-15 08:34:35 +00:00
Deepesh Garg
ca96c24c8d chore: Resolve conflicts 2022-11-15 13:57:44 +05:30
Deepesh Garg
07badbc0f2 fix: Write Off section visibility for non POS Invoices
(cherry picked from commit 9f5d613c78)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.json
2022-11-15 07:31:58 +00:00
Deepesh Garg
51b3fda2b6 Merge pull request #32960 from frappe/mergify/bp/version-14-hotfix/pr-32956
fix: Label for applicable dimension table (backport #32956)
2022-11-15 13:01:23 +05:30
rohitwaghchaure
d9820af4f0 Merge pull request #32963 from frappe/mergify/bp/version-14-hotfix/pr-32947
fix: incorrect fix of conversion factor in PP (backport #32947)
2022-11-15 11:38:07 +05:30
Rohit Waghchaure
c48d00ad77 fix: incorrect fix of conversion factor in PP
(cherry picked from commit 490b0e3cdf)
2022-11-15 05:01:36 +00:00
Deepesh Garg
eb4f8e4bd8 fix: Label for applicable dimension table
(cherry picked from commit 8c13f70fc5)
2022-11-15 03:55:20 +00:00
Sagar Sharma
5c5cd7bff5 Merge pull request #32948 from frappe/mergify/bp/version-14-hotfix/pr-32937
refactor: rewrite `job_card.py` queries in QB (backport #32937)
2022-11-14 12:22:56 +05:30
s-aga-r
f886577abb refactor: rewrite job_card.py queries in QB
(cherry picked from commit 7df2921d38)
2022-11-14 05:56:38 +00:00
Deepesh Garg
bad4dccf88 Merge pull request #32944 from frappe/mergify/bp/version-14-hotfix/pr-32938
chore: Remove raw SQL query (backport #32938)
2022-11-14 10:43:50 +05:30
Sagar Vora
a30579393e fix: check type for reference name
(cherry picked from commit b06345af46)
2022-11-13 15:12:10 +00:00
Deepesh Garg
3614584a2f chore: Remove qb doc reference
(cherry picked from commit 4b9921782b)
2022-11-13 15:12:10 +00:00
Deepesh Garg
8a01da3b9e chore: Remove raw SQL query
(cherry picked from commit 42a59d5c17)
2022-11-13 15:12:10 +00:00
Deepesh Garg
94087e4e3a Merge pull request #32941 from frappe/mergify/bp/version-14-hotfix/pr-32866
fix: incorrect buying amount on Gross Profit (backport #32866)
2022-11-13 19:47:57 +05:30
ruthra kumar
a24f6a5ac7 test: buying amount of invoices
1. Invoice with unset `update_stock`, with and without Delivery Notes

(cherry picked from commit 2c8b0b17a7)
2022-11-13 13:46:08 +00:00
ruthra kumar
2d8f00afad fix: GP incorrect buying amount if no upd on SI and Delivery Note
(cherry picked from commit e4d16c31da)
2022-11-13 13:46:08 +00:00
Sagar Sharma
9e47371801 Merge pull request #32935 from frappe/mergify/bp/version-14-hotfix/pr-32913
fix: set stock UOM in args to ensure item price is fetched (backport #32913)
2022-11-12 12:04:26 +05:30
Sagar Vora
a4187b9d8f fix: set stock UOM in args to ensure item price is fetched
(cherry picked from commit 57038c3969)
2022-11-12 04:39:25 +00:00
Deepesh Garg
3dde050c15 Merge pull request #32932 from frappe/mergify/bp/version-14-hotfix/pr-32878
fix: repayment schedule regeneration (backport #32878)
2022-11-11 15:15:52 +05:30
Abhinav Raut
2f5033b70f fix: repayment schedule regeneration
(cherry picked from commit d6ab2b3b87)
2022-11-11 08:53:59 +00:00
Deepesh Garg
de68674933 Merge pull request #32927 from frappe/mergify/bp/version-14-hotfix/pr-32880
fix: add translate function to valitate company msg in chart of accounts importer (backport #32880)
2022-11-11 14:21:53 +05:30
Deepesh Garg
04cf3d1c5d Merge pull request #32926 from frappe/mergify/bp/version-14-hotfix/pr-32923
fix: Maintain same rate between Quotation and Sales Order (backport #32923)
2022-11-11 14:21:38 +05:30
rohitwaghchaure
eac1f47b6f Merge pull request #32928 from frappe/mergify/bp/version-14-hotfix/pr-32895
fix: Purchase Receipt timeout error (backport #32895)
2022-11-11 10:52:52 +05:30
Rohit Waghchaure
071ee5d81c fix: test cases
(cherry picked from commit 7278387879)
2022-11-10 17:13:36 +00:00
Rohit Waghchaure
0d5b7269d4 fix: Purchase Receipt timeout error
(cherry picked from commit 4082149f0e)
2022-11-10 17:13:35 +00:00
Ernesto Ruiz
8de4430662 fix: add translate function to valitate company msg in chart of accounts importer
(cherry picked from commit 637c08d189)
2022-11-10 14:38:22 +00:00
Deepesh Garg
6c155d2825 fix: Maintain same rate between Quotation and Sales Order
(cherry picked from commit 362ec7b673)
2022-11-10 14:23:54 +00:00
Deepesh Garg
6f61685510 Merge pull request #32924 from frappe/mergify/bp/version-14-hotfix/pr-32912
fix(ux): Tab break in Customer and Supplier form (backport #32912)
2022-11-10 19:51:27 +05:30
Sagar Sharma
883355adc4 Merge pull request #32919 from frappe/mergify/bp/version-14-hotfix/pr-32918
fix: WO Skip Material Transfer to WIP Warehouse (backport #32918)
2022-11-10 18:42:36 +05:30
Nabin Hait
eeaa9329f6 fix(ux): Tab break in Customer and Supplier form
(cherry picked from commit fb7ee301b5)
2022-11-10 13:01:14 +00:00
Sagar Sharma
c294652dab fix: set WIP Warehouse in Job Card
(cherry picked from commit e7fa2e08ad)
2022-11-10 11:42:53 +00:00
Sagar Sharma
f923183b64 fix: don't set WIP Warehouse if is checked in WO
(cherry picked from commit 9730cd0aec)
2022-11-10 11:42:53 +00:00
Deepesh Garg
f2a1596369 Merge pull request #32909 from frappe/mergify/bp/version-14-hotfix/pr-32742
feat: Tool to repost PLE manually (backport #32742)
2022-11-10 15:41:22 +05:30
ruthra kumar
7a3e3af0b5 chore: CI fix 2022-11-10 14:17:00 +05:30
mergify[bot]
f8b7cfa6dd refactor: Remove usage of deprecated methods (backport #32914) (#32915)
* refactor: Remove usage of deprecated methods (#32914)

Warn: Just used regex to replace all usage.
```regex
s/frappe.db.set(\(.*\),\(.*\),\(.*\))/\1.db_set(\2, \3)/g
```

Required after: https://github.com/frappe/frappe/pull/18815

(cherry picked from commit 7e1742956c)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.py

* chore: conflicts

* style: black


Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-11-10 11:09:13 +05:30
ruthra kumar
de59b50407 feat: Repost Payment Ledger entries for vouchers
primarily intended to manually correct PLE entries for vouchers
affected by Item Value repost-https://github.com/frappe/erpnext/pull/32567

(cherry picked from commit 0448c0fa36)
2022-11-09 08:57:23 +00:00
ruthra kumar
a399e2d765 refactor: split delete gl utility function into two
(cherry picked from commit 9209ec59c2)
2022-11-09 08:57:23 +00:00
Deepesh Garg
17ccc0e56c Merge pull request #32891 from frappe/mergify/bp/version-14-hotfix/pr-32883
fix: Project filter in timesheet (backport #32883)
2022-11-08 21:44:59 +05:30
Sagar Sharma
5e6a9833c5 Merge pull request #32898 from frappe/mergify/bp/version-14-hotfix/pr-32888
chore: link SCR Return in SCR Dashboard (backport #32888)
2022-11-08 21:38:27 +05:30
Sagar Sharma
02bb523210 chore: link SCR Return in SCR Dashboard
(cherry picked from commit 47248251e2)
2022-11-08 16:07:34 +00:00
Frappe PR Bot
e917212849 chore(release): Bumped to Version 14.6.0
# [14.6.0](https://github.com/frappe/erpnext/compare/v14.5.1...v14.6.0) (2022-11-08)

### Bug Fixes

* `Material Consumption` option in case of `Skip Transfer to WIP` in WO ([8c856cd](8c856cd5fc))
* add translate function to name of chart labels in budget_variance_report.py ([16f364d](16f364da37))
* add translate function to name of chart labels in deferred_revenue_and_expense.py ([b8caa58](b8caa587d2))
* add translate function to period in  stock_analytics.py ([b0c06d5](b0c06d5a04))
* add translate function to period in sales_analytics.py ([e681f06](e681f06883))
* add translate function to string on budget_variance_report.js to match the variance  word translated ([595aaad](595aaad99d))
* Auto advance allocation against partial invoices ([b7763d9](b7763d953a))
* auto increment qty if item table has no items ([d8e403b](d8e403bf5d))
* conflicts ([ab87a95](ab87a950e5))
* correct linters ([8f6f9a4](8f6f9a429a))
* correct linters ([440e208](440e20859f))
* correct linters ([5acc9be](5acc9be5c9))
* Create POS Opening Entry POS Profile filter. ([60af9c0](60af9c0516))
* Disable tax included prices for internal transfers ([#32794](https://github.com/frappe/erpnext/issues/32794)) ([6838e5e](6838e5ea3b))
* for asset's purchase_date, if bill_date is set, use that instead of posting_date ([01a1c96](01a1c96314))
* get `consumed_qty` based on `received_qty` in SCR ([ea9a502](ea9a50278d))
* Increase columns width in Warehouse wise Item Balance Age and Value ([0b09c31](0b09c31cb0))
* linter ([af60c8f](af60c8f759))
* make `BOM` required in SCR Item ([3f79a05](3f79a057e4))
* make `consumed_qty` editable when backflush based on Material Transfer ([2c5a8c4](2c5a8c43f6))
* make `consumed_qty` read-only in SCR Supplied Items ([68229f0](68229f06d1))
* map `BOM` while mapping the return SCR ([e629cba](e629cba2b7))
* mysql syntax issue ([4d9bbd4](4d9bbd4c9c))
* not able to select customer / supplier ([6989cdf](6989cdf4f2))
* refactor code for better translatable string ([2dc24f2](2dc24f22ea))
* refactor code for better translatable string in stock_ageing.py ([0ead516](0ead51642f))
* rename test method ([97445d9](97445d9516))
* Scan Barcode UX ([1944f4d](1944f4df4d))
* set `received_qty` before_validate SCR ([e316558](e316558286))
* test cases ([0feec4c](0feec4ca8a))
* trailing whitespace ([31bada9](31bada9205))
* update advance paid in SO/PO from Payment Ledger ([a561432](a561432908))
* use `flt` instead of `cint` in `get_batch_no` ([6510464](6510464482))

### Features

* Item Wise TDS Calculation ([b9fb104](b9fb1045d7))

### Performance Improvements

* use `get_cached_value` instead of `db.get_value` in controllers ([#32776](https://github.com/frappe/erpnext/issues/32776)) ([34ca17a](34ca17ab11))
2022-11-08 12:15:30 +00:00
Deepesh Garg
4657f8e9ed Merge pull request #32893 from frappe/version-14-hotfix
chore: release v14
2022-11-08 17:43:43 +05:30
Deepesh Garg
19b3152e32 chore: Resolve conflicts 2022-11-08 17:42:29 +05:30
Deepesh Garg
6163a052c8 chore: Linting Issues
(cherry picked from commit 7b5cf6978e)

# Conflicts:
#	erpnext/manufacturing/doctype/workstation/workstation.py
2022-11-08 09:26:03 +00:00
Deepesh Garg
37bed12df4 fix: Project filter in timesheet
(cherry picked from commit 2b65b22aa2)
2022-11-08 09:26:02 +00:00
Sagar Sharma
1426de0530 Merge pull request #32887 from frappe/mergify/bp/version-14-hotfix/pr-32886
chore: remove `debugger` from `stock_entry_list.js` (backport #32886)
2022-11-08 12:14:22 +05:30
Sagar Sharma
beef0510ee chore: remove debugger from stock_entry_list.js
(cherry picked from commit 84ab100d86)
2022-11-08 06:40:55 +00:00
Sagar Sharma
bacd7ecb1d Merge pull request #32884 from frappe/mergify/bp/version-14-hotfix/pr-32877
fix: make `consumed_qty` read-only in SCR Supplied Items (backport #32877)
2022-11-08 09:51:16 +05:30
Sagar Sharma
af60c8f759 fix: linter
(cherry picked from commit 5e8a22be24)
2022-11-07 23:05:58 +05:30
Sagar Sharma
2c5a8c43f6 fix: make consumed_qty editable when backflush based on Material Transfer
(cherry picked from commit bf4b012cec)
2022-11-07 17:29:45 +00:00
Sagar Sharma
68229f06d1 fix: make consumed_qty read-only in SCR Supplied Items
(cherry picked from commit f8d2e276a5)
2022-11-07 17:29:45 +00:00
Deepesh Garg
cc92e6965a Merge pull request #32864 from frappe/mergify/bp/version-14-hotfix/pr-32846
fix: add german translations (backport #32846)
2022-11-07 18:43:06 +05:30
Raffael Meyer
85f98bb51a Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32846 2022-11-07 13:34:28 +01:00
barredterra
8e00e62616 chore: resolve merge conflicts 2022-11-07 13:31:54 +01:00
Deepesh Garg
401979bbe5 Merge pull request #32875 from frappe/mergify/bp/version-14-hotfix/pr-32874
fix: Increase columns width in Warehouse wise Item Balance Age and Value (backport #32874)
2022-11-07 15:41:05 +05:30
Nihantra C. Patel
0b09c31cb0 fix: Increase columns width in Warehouse wise Item Balance Age and Value
(cherry picked from commit 8355c1092c)
2022-11-07 08:05:38 +00:00
Deepesh Garg
c2da8cf7cd Merge pull request #32870 from frappe/mergify/bp/version-14-hotfix/pr-32776
perf: use `get_cached_value` instead of `db.get_value` in controllers (backport #32776)
2022-11-07 13:30:15 +05:30
Deepesh Garg
d36c135103 Merge pull request #32872 from frappe/mergify/bp/version-14-hotfix/pr-32802
fix: `Material Consumption` option in case of `Skip Transfer to WIP` in WO (backport #32802)
2022-11-07 10:16:10 +05:30
Sagar Sharma
8c856cd5fc fix: Material Consumption option in case of Skip Transfer to WIP in WO
(cherry picked from commit 8ea6983734)
2022-11-07 04:06:34 +00:00
Daizy Modi
34ca17ab11 perf: use get_cached_value instead of db.get_value in controllers (#32776)
(cherry picked from commit 4efc947f14)
2022-11-07 03:52:39 +00:00
Sagar Sharma
3d2e8c7fb3 Merge pull request #32868 from frappe/mergify/bp/version-14-hotfix/pr-32867
fix: get `consumed_qty` based on `received_qty` in SCR (backport #32867)
2022-11-06 17:04:34 +05:30
Sagar Sharma
8f78be8525 test: add test case for consumed-qty
(cherry picked from commit 4d8da4420e)
2022-11-06 10:48:35 +00:00
Sagar Sharma
ea9a50278d fix: get consumed_qty based on received_qty in SCR
(cherry picked from commit 70c9b8dc50)
2022-11-06 10:48:34 +00:00
Sagar Sharma
e316558286 fix: set received_qty before_validate SCR
(cherry picked from commit c447dfaa9c)
2022-11-06 10:48:34 +00:00
Deepesh Garg
b9fb1045d7 feat: Item Wise TDS Calculation 2022-11-06 11:50:20 +05:30
Raffael Meyer
e276a5ba83 chore: add german translations (#32846)
Mostly for balance sheet

(cherry picked from commit d2b6490bca)

# Conflicts:
#	erpnext/translations/de.csv
2022-11-06 04:53:21 +00:00
Deepesh Garg
1a0f123c8c Merge pull request #32859 from frappe/mergify/bp/version-14-hotfix/pr-32794
fix: Disable tax included prices for internal transfers (backport #32794)
2022-11-05 21:16:44 +05:30
Deepesh Garg
6838e5ea3b fix: Disable tax included prices for internal transfers (#32794)
* fix: Disable tax-included prices for internal transfers

(cherry picked from commit 8d30ebb12b)
2022-11-05 15:22:07 +00:00
Deepesh Garg
41a5905a75 Merge pull request #32856 from frappe/mergify/bp/version-14-hotfix/pr-32847
fix: Create POS Opening Entry POS Profile filter. (backport #32847)
2022-11-05 20:51:49 +05:30
Sagar Sharma
eb6b267001 Merge pull request #32858 from frappe/mergify/bp/version-14-hotfix/pr-32850
fix: wrong consumed items in SCR return (backport #32850)
2022-11-05 20:12:54 +05:30
Sagar Sharma
0856e65700 test: fix test case
(cherry picked from commit 324bfa9fde)
2022-11-05 11:53:50 +00:00
Sagar Sharma
3f79a057e4 fix: make BOM required in SCR Item
(cherry picked from commit 760c26e9c0)
2022-11-05 11:53:50 +00:00
Sagar Sharma
bd7435ce1e test: add test case
(cherry picked from commit 761e9df1bf)
2022-11-05 11:53:50 +00:00
Sagar Sharma
97445d9516 fix: rename test method
(cherry picked from commit 611d827e0b)
2022-11-05 11:53:49 +00:00
Sagar Sharma
e629cba2b7 fix: map BOM while mapping the return SCR
(cherry picked from commit 54072ec9cd)
2022-11-05 11:53:49 +00:00
Deepesh Garg
cc8a184666 Merge pull request #32855 from frappe/mergify/bp/version-14-hotfix/pr-32844
fix: Auto advance allocation against partial invoices (backport #32844)
2022-11-05 16:59:03 +05:30
Maharshi Patel
60af9c0516 fix: Create POS Opening Entry POS Profile filter.
pos_profile_query was variable instead of function.

(cherry picked from commit 1328a45f2a)
2022-11-05 11:15:32 +00:00
Deepesh Garg
c3b2629412 test: Check parital payment allocation
(cherry picked from commit 428971f127)
2022-11-05 10:58:42 +00:00
Deepesh Garg
b7763d953a fix: Auto advance allocation against partial invoices
(cherry picked from commit 181df2fe63)
2022-11-05 10:58:42 +00:00
Sagar Sharma
3bd024ca8f Merge pull request #32831 from bhavesh95863/patch-2
fix: mysql syntax issue
2022-11-05 11:30:14 +05:30
Sagar Sharma
d443925b1e Merge branch 'version-14-hotfix' into patch-2 2022-11-05 10:29:11 +05:30
Sagar Sharma
2f145f9912 refactor: rewrite query in QB 2022-11-05 10:28:06 +05:30
rohitwaghchaure
d9147c1975 Merge pull request #32841 from frappe/mergify/bp/version-14-hotfix/pr-32799
fix: Scan Barcode UX (backport #32799)
2022-11-04 12:09:36 +05:30
rohitwaghchaure
31bada9205 fix: trailing whitespace 2022-11-04 11:28:41 +05:30
rohitwaghchaure
ab87a950e5 fix: conflicts 2022-11-04 11:21:39 +05:30
Rohit Waghchaure
d8e403bf5d fix: auto increment qty if item table has no items
(cherry picked from commit e5b19e3f70)
2022-11-04 05:36:09 +00:00
Rohit Waghchaure
1944f4df4d fix: Scan Barcode UX
(cherry picked from commit e1f9ba78e5)

# Conflicts:
#	erpnext/public/js/utils/barcode_scanner.js
2022-11-04 05:36:09 +00:00
Deepesh Garg
7e15c4789d Merge pull request #32840 from frappe/mergify/bp/version-14-hotfix/pr-32712
chore: add translation  function to Bank Reconciliation Tool-related files (backport #32712)
2022-11-04 08:33:44 +05:30
Ernesto Ruiz
e334b7dfee chore: add translation function to Bank Reconciliation Tool related files
chore: add translation  function to Bank Reconciliation Tool related files
(cherry picked from commit ad0dd693ac)
2022-11-03 19:36:56 +00:00
Frappe PR Bot
3967773fbe chore(release): Bumped to Version 14.5.1
## [14.5.1](https://github.com/frappe/erpnext/compare/v14.5.0...v14.5.1) (2022-11-03)

### Bug Fixes

* not able to select customer / supplier ([dd4dbd4](dd4dbd4b00))
2022-11-03 08:07:36 +00:00
Deepesh Garg
074c75252a Merge pull request #32835 from frappe/mergify/bp/version-14/pr-32833
fix: not able to select customer / supplier (backport #32832) (backport #32833)
2022-11-03 13:35:52 +05:30
Rohit Waghchaure
dd4dbd4b00 fix: not able to select customer / supplier
(cherry picked from commit b0fc568c80)
(cherry picked from commit 6989cdf4f2)
2022-11-03 06:53:41 +00:00
rohitwaghchaure
2d2a126510 Merge pull request #32833 from frappe/mergify/bp/version-14-hotfix/pr-32832
fix: not able to select customer / supplier (backport #32832)
2022-11-03 12:22:41 +05:30
Deepesh Garg
a10ea5efc9 Merge pull request #32830 from frappe/mergify/bp/version-14-hotfix/pr-32773
fix: for asset's purchase_date, if bill_date is set, use that instead of posting_date (backport #32773)
2022-11-03 12:07:35 +05:30
Rohit Waghchaure
6989cdf4f2 fix: not able to select customer / supplier
(cherry picked from commit b0fc568c80)
2022-11-03 06:25:53 +00:00
Anand Baburajan
f5534d7db3 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32773 2022-11-03 11:53:55 +05:30
Bhavesh Maheshwari
4d9bbd4c9c fix: mysql syntax issue 2022-11-03 10:59:20 +05:30
Deepesh Garg
7a7b1d33c3 Merge pull request #32829 from frappe/mergify/bp/version-14-hotfix/pr-32713
fix: add missing translation function on report related documents (backport #32713)
2022-11-03 10:29:00 +05:30
anandbaburajan
01a1c96314 fix: for asset's purchase_date, if bill_date is set, use that instead of posting_date
(cherry picked from commit f322c608cf)
2022-11-03 04:22:14 +00:00
Ernesto Ruiz
8f6f9a429a fix: correct linters
(cherry picked from commit 4c7fa9482d)
2022-11-03 04:17:23 +00:00
Ernesto Ruiz
440e20859f fix: correct linters
(cherry picked from commit 9c529c61bb)
2022-11-03 04:17:22 +00:00
Ernesto Ruiz
5acc9be5c9 fix: correct linters
(cherry picked from commit b7b53b5857)
2022-11-03 04:17:22 +00:00
Ernesto Ruiz
595aaad99d fix: add translate function to string on budget_variance_report.js to match the variance word translated
(cherry picked from commit 2012bdf4bd)
2022-11-03 04:17:22 +00:00
Ernesto Ruiz
16f364da37 fix: add translate function to name of chart labels in budget_variance_report.py
(cherry picked from commit 48ed6381b3)
2022-11-03 04:17:21 +00:00
Ernesto Ruiz
e681f06883 fix: add translate function to period in sales_analytics.py
(cherry picked from commit 083a78135c)
2022-11-03 04:17:21 +00:00
Ernesto Ruiz
b0c06d5a04 fix: add translate function to period in stock_analytics.py
(cherry picked from commit c1e608d9ef)
2022-11-03 04:17:20 +00:00
Ernesto Ruiz
0ead51642f fix: refactor code for better translatable string in stock_ageing.py
(cherry picked from commit 71a0ae2e59)
2022-11-03 04:17:20 +00:00
Ernesto Ruiz
2dc24f22ea fix: refactor code for better translatable string
(cherry picked from commit a671652ab2)
2022-11-03 04:17:20 +00:00
Ernesto Ruiz
b8caa587d2 fix: add translate function to name of chart labels in deferred_revenue_and_expense.py
(cherry picked from commit a963618b08)
2022-11-03 04:17:19 +00:00
ruthra kumar
b17761c276 Merge pull request #32822 from frappe/mergify/bp/version-14-hotfix/pr-32816
fix: update advance paid in SO/PO from Payment Ledger (backport #32816)
2022-11-02 19:31:33 +05:30
Sagar Sharma
d8c0a147db Merge pull request #32820 from frappe/mergify/bp/version-14-hotfix/pr-32788
fix: use `flt` instead of `cint` in `get_batch_no` (backport #32788)
2022-11-02 19:11:08 +05:30
Sagar Sharma
611dcc11d2 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32788 2022-11-02 17:49:26 +05:30
Sagar Sharma
75d347d757 Merge pull request #32823 from frappe/mergify/bp/version-14-hotfix/pr-32800
fix: test cases (backport #32800)
2022-11-02 17:49:01 +05:30
Rohit Waghchaure
d3fbe3074d test: run tmate
(cherry picked from commit 3f2728e3f7)
2022-11-02 11:44:05 +00:00
Rohit Waghchaure
0feec4ca8a fix: test cases
(cherry picked from commit ddd1b4be3f)
2022-11-02 11:44:05 +00:00
ruthra kumar
cf32e1905c test: SO advance paid on Payment submission and cancellation
(cherry picked from commit 721ac6b847)
2022-11-02 10:59:47 +00:00
ruthra kumar
87dc812a4b test: PO advance paid on payment submission and cancellation
(cherry picked from commit 1a0a8ac7e2)
2022-11-02 10:59:46 +00:00
ruthra kumar
388cf5113b test: refactor use @change_settings decorator when possible
(cherry picked from commit 81d791eea0)
2022-11-02 10:59:46 +00:00
ruthra kumar
a561432908 fix: update advance paid in SO/PO from Payment Ledger
(cherry picked from commit 4487065b67)
2022-11-02 10:59:45 +00:00
Sagar Sharma
6510464482 fix: use flt instead of cint in get_batch_no
(cherry picked from commit 9fb3fb4c83)
2022-11-02 10:25:26 +00:00
Frappe PR Bot
ce5dbf891a chore(release): Bumped to Version 14.5.0
# [14.5.0](https://github.com/frappe/erpnext/compare/v14.4.0...v14.5.0) (2022-11-01)

### Bug Fixes

* add `Sales Order` reference in Material Request Dashboard ([fc63892](fc6389280c))
* Add condition for discount section collapse ([953f78d](953f78d6a9))
* Budget validation for main cost center ([89a1c83](89a1c83431))
* Clear invoice table post importing invoices ([6eafff8](6eafff8694))
* Company bank account filter in Bank Clearance ([797512c](797512ca13))
* Curreny in SOA print for multi-currency party ([195500c](195500cb32))
* duplicate custom fields for inventory dimension ([1152ac3](1152ac3ff1))
* Filter fixes in Accounts Payable report ([29197dc](29197dcd7f))
* Issues while cancel/amending Purchase Invoice with TDS enabled ([74a6479](74a6479f70))
* key error in filter access ([6114241](6114241ff2))
* Mode of payment for returns in POS Sales Invoice ([a260426](a260426dd4))
* Pass project to stock entry items ([4035873](4035873295))
* pro_rata_amount calculation in assets tests ([d1b2786](d1b2786f24))
* Reference due date field type in Journal Entry Accounts table ([faf25c0](faf25c0b95))
* Reset advance paid amount on Oreder cancel and amend ([34bd783](34bd7837e2))
* Total Sales amount update in project via Sales Order ([d742e6d](d742e6d56b))

### Features

* additional filters on Payment terms report ([a03ec0a](a03ec0afb3))
* **pricing rule:** free qty rounding and recursion qty ([#32577](https://github.com/frappe/erpnext/issues/32577)) ([9b66020](9b66020fc7))
2022-11-01 17:19:41 +00:00
Deepesh Garg
fd36ee0fda Merge pull request #32793 from frappe/version-14-hotfix
chore: release v14
2022-11-01 22:48:17 +05:30
Deepesh Garg
d68fa0eff2 Merge pull request #32807 from frappe/mergify/bp/version-14-hotfix/pr-32779
fix: Mode of payment for returns in POS Sales Invoice (backport #32779)
2022-11-01 22:12:11 +05:30
Deepesh Garg
3f72156ea9 chore: Update tests
(cherry picked from commit 5b74161195)
2022-11-01 16:00:18 +00:00
Deepesh Garg
a260426dd4 fix: Mode of payment for returns in POS Sales Invoice
(cherry picked from commit 06e8e28531)
2022-11-01 16:00:18 +00:00
Deepesh Garg
148dc37d92 Merge pull request #32804 from frappe/mergify/bp/version-14-hotfix/pr-32801
fix: Issues while cancel/amending Purchase Invoice with TDS enabled (backport #32801)
2022-11-01 21:29:17 +05:30
Deepesh Garg
74a6479f70 fix: Issues while cancel/amending Purchase Invoice with TDS enabled
(cherry picked from commit f7c9258770)
2022-11-01 15:19:10 +00:00
ruthra kumar
f2f1c160f8 Merge pull request #32797 from frappe/mergify/bp/version-14-hotfix/pr-32577
feat(pricing rule): free qty rounding and recursion qty (backport #32577)
2022-11-01 17:09:46 +05:30
Dany Robert
9b66020fc7 feat(pricing rule): free qty rounding and recursion qty (#32577)
Option to specify recursion start qty and repeating qty

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 1d83fb20d6)
2022-11-01 11:12:44 +00:00
Deepesh Garg
6af43ba40d Merge pull request #32795 from frappe/mergify/bp/version-14-hotfix/pr-32790
fix: pro_rata_amount calculation in assets tests (backport #32790)
2022-11-01 16:19:49 +05:30
Anand Baburajan
bd531eb898 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32790 2022-11-01 15:21:29 +05:30
Deepesh Garg
15f4812108 Merge pull request #32782 from frappe/mergify/bp/version-14-hotfix/pr-32768
fix: Budget validation for main cost center (backport #32768)
2022-11-01 15:21:16 +05:30
anandbaburajan
4c5b688e0d chore: empty commit to try fixing stuck test
(cherry picked from commit 672fbd3849)
2022-11-01 09:48:04 +00:00
anandbaburajan
d1b2786f24 fix: pro_rata_amount calculation in assets tests
(cherry picked from commit 65e855bfff)
2022-11-01 09:48:04 +00:00
rohitwaghchaure
2eb01aae27 Merge pull request #32783 from frappe/mergify/bp/version-14-hotfix/pr-32730
fix: duplicate custom fields for inventory dimension (backport #32730)
2022-10-31 23:06:29 +05:30
Rohit Waghchaure
1152ac3ff1 fix: duplicate custom fields for inventory dimension
(cherry picked from commit 45ededbed5)
2022-10-31 16:56:17 +00:00
Deepesh Garg
89a1c83431 fix: Budget validation for main cost center
(cherry picked from commit 4e26d42d17)
2022-10-31 16:49:31 +00:00
Deepesh Garg
2a1a61238a Merge pull request #32780 from frappe/mergify/bp/version-14-hotfix/pr-32777
fix: Reset advance paid amount on Order cancel and amend (backport #32777)
2022-10-31 22:07:54 +05:30
Deepesh Garg
34bd7837e2 fix: Reset advance paid amount on Oreder cancel and amend
(cherry picked from commit 92f37ca111)
2022-10-31 16:09:27 +00:00
Deepesh Garg
f66a6693f4 Merge pull request #32761 from frappe/mergify/bp/version-14-hotfix/pr-32759
Pass project to stock entry items (backport #32759)
2022-10-30 09:29:03 +05:30
Hossein Yousefian
4035873295 fix: Pass project to stock entry items
fix: Pass project to stock entry items
(cherry picked from commit 54c2ffc36b)
2022-10-29 16:55:25 +00:00
Deepesh Garg
4a86efedfc Merge pull request #32752 from frappe/mergify/bp/version-14-hotfix/pr-32744
refactor: additional filters on Payment Terms status report (backport #32744)
2022-10-29 17:12:17 +05:30
Sagar Sharma
b7cbc804b2 Merge pull request #32756 from frappe/mergify/bp/version-14-hotfix/pr-32754
fix: add `Sales Order` reference in Material Request Dashboard (backport #32754)
2022-10-29 13:49:16 +05:30
Sagar Sharma
fc6389280c fix: add Sales Order reference in Material Request Dashboard
(cherry picked from commit 15ebf4a0cf)
2022-10-29 07:07:25 +00:00
ruthra kumar
6dbb4a3b0d test: due date filter on Payment Terms report
(cherry picked from commit fed39a53cb)
2022-10-29 05:40:16 +00:00
ruthra kumar
6114241ff2 fix: key error in filter access
(cherry picked from commit 4765f937ea)
2022-10-29 05:40:16 +00:00
ruthra kumar
a03ec0afb3 feat: additional filters on Payment terms report
Filter on Status and Due dates

(cherry picked from commit aadb6b1772)
2022-10-29 05:40:15 +00:00
Deepesh Garg
db5d74b7dc Merge pull request #32748 from frappe/mergify/bp/version-14-hotfix/pr-32722
fix: Reference due date field type in Journal Entry Accounts table (backport #32722)
2022-10-29 11:00:01 +05:30
Deepesh Garg
ad6e0f3af7 Merge pull request #32746 from frappe/mergify/bp/version-14-hotfix/pr-32699
fix: Curreny in SOA print for multi-currency party (backport #32699)
2022-10-29 10:59:49 +05:30
Deepesh Garg
abcf30aaa3 Merge pull request #32745 from frappe/mergify/bp/version-14-hotfix/pr-32692
fix: Clear invoice table post importing invoices (backport #32692)
2022-10-29 10:59:35 +05:30
Deepesh Garg
cc9c876007 Merge pull request #32747 from frappe/mergify/bp/version-14-hotfix/pr-32718
fix: Total Sales amount update in project via Sales Order (backport #32718)
2022-10-29 10:59:10 +05:30
Sagar Sharma
199e77faef Merge pull request #32750 from frappe/mergify/bp/version-14-hotfix/pr-32662
refactor: rewrite stock reports queries in qb (backport #32662)
2022-10-28 22:48:03 +05:30
Sagar Sharma
98428f0bce refactor: rewrite Itemwise Recommended Reorder Level Report queries in QB
(cherry picked from commit 40bd121593)
2022-10-28 15:36:01 +00:00
Sagar Sharma
a4b99a34cb refactor: rewrite Product Bundle Balance Report queries in QB
(cherry picked from commit cde785f1bb)
2022-10-28 15:36:01 +00:00
Sagar Sharma
c4587d8caa refactor: rewrite Stock Ledger Report queries in QB
(cherry picked from commit feaa2dbba8)
2022-10-28 15:36:01 +00:00
Deepesh Garg
faf25c0b95 fix: Reference due date field type in Journal Entry Accounts table
(cherry picked from commit e7caa48e2f)
2022-10-28 15:26:29 +00:00
Deepesh Garg
d742e6d56b fix: Total Sales amount update in project via Sales Order
(cherry picked from commit 6063c4e3c0)
2022-10-28 15:16:42 +00:00
Deepesh Garg
3f0b03c0a4 chore: Use account currency as fallback
(cherry picked from commit a18a715bb4)
2022-10-28 15:12:34 +00:00
Deepesh Garg
195500cb32 fix: Curreny in SOA print for multi-currency party
(cherry picked from commit 49ee873655)
2022-10-28 15:12:34 +00:00
Deepesh Garg
6eafff8694 fix: Clear invoice table post importing invoices
(cherry picked from commit 267e7c3a90)
2022-10-28 15:11:41 +00:00
Deepesh Garg
36f2b65401 Merge pull request #32739 from frappe/mergify/bp/version-14-hotfix/pr-32716
fix: Company bank account filter in Bank Clearance (backport #32716)
2022-10-28 17:19:49 +05:30
Sagar Sharma
f082c9e797 Merge pull request #32740 from frappe/mergify/bp/version-14-hotfix/pr-32738
fix: Added Material Request Reference in Purchase Recipt Dashboard for Tracking (backport #32738)
2022-10-28 16:06:44 +05:30
Vishal
0ab69c0e32 chore: minor linting issue fixed
(cherry picked from commit e8c0157017)
2022-10-28 08:54:44 +00:00
Vishal
de3996e411 chore: Added Material Request Reference in Purchase Recipt Dashboard for Tracking
(cherry picked from commit a04c44fe34)
2022-10-28 08:54:44 +00:00
Deepesh Garg
797512ca13 fix: Company bank account filter in Bank Clearance
(cherry picked from commit f9f78c1086)
2022-10-28 07:24:35 +00:00
Deepesh Garg
d39ec5ef5f Merge pull request #32737 from frappe/mergify/bp/version-14-hotfix/pr-32717
fix: Add condition for discount section collapse (backport #32717)
2022-10-28 11:55:37 +05:30
Deepesh Garg
2dae93c0a1 Merge pull request #32736 from frappe/mergify/bp/version-14-hotfix/pr-32724
fix: Filter fixes in Accounts Payable report (backport #32724)
2022-10-28 11:55:24 +05:30
Deepesh Garg
953f78d6a9 fix: Add condition for discount section collapse
(cherry picked from commit 4cd65027c4)
2022-10-28 05:55:06 +00:00
Deepesh Garg
29197dcd7f fix: Filter fixes in Accounts Payable report
(cherry picked from commit a5a73ba857)
2022-10-28 05:54:25 +00:00
Frappe PR Bot
123d720616 chore(release): Bumped to Version 14.4.0
# [14.4.0](https://github.com/frappe/erpnext/compare/v14.3.1...v14.4.0) (2022-10-26)

### Bug Fixes

* Advance paid amount in orders (backport [#32642](https://github.com/frappe/erpnext/issues/32642)) ([#32648](https://github.com/frappe/erpnext/issues/32648)) ([8a88105](8a88105aed))
* allow to create Sales Order from expired Quotation ([#32641](https://github.com/frappe/erpnext/issues/32641)) ([ccc58f4](ccc58f48e3))
* Billing Address for inter-company purchase docs ([f8934fa](f8934faa73))
* BOM cost update message ([e539579](e539579fb4))
* dont update item info twice ([8876904](887690449d))
* incorrect qty in material request ([da538a3](da538a37ad))
* number of months subscription plan ([fff9e76](fff9e76718))
* overlap error not raised for job card in case of workstation with production capacity ([ed2a093](ed2a093e49))
* party type and party mandatory on updating outstanding ([9a5e238](9a5e238702))
* searchfield not working for cuctsomer, supplier as per customize form ([fb1c307](fb1c30718b))
* unset contact details ([d7a65b1](d7a65b1d41))

### Features

* Basic Payment Ledger report ([5cb9f7b](5cb9f7b3a4))
* Repayment schedule types for term loans ([6ce32fd](6ce32fd5a9))

### Performance Improvements

* cache barcode scan result (backport [#32629](https://github.com/frappe/erpnext/issues/32629)) ([#32672](https://github.com/frappe/erpnext/issues/32672)) ([3300856](3300856fb4))
2022-10-26 05:09:19 +00:00
Deepesh Garg
1c95c67f58 Merge pull request #32707 from frappe/version-14-hotfix
chore: release v14
2022-10-26 10:37:46 +05:30
rohitwaghchaure
753b2edebf Merge pull request #32698 from frappe/mergify/bp/version-14-hotfix/pr-32693
fix: Search field not working for customer, supplier (backport #32693)
2022-10-24 23:14:37 +05:30
Rohit Waghchaure
f50b485225 test: added test case to validate seachfields for customer, supplier
(cherry picked from commit 5f84993bae)
2022-10-24 11:42:16 +00:00
Rohit Waghchaure
fb1c30718b fix: searchfield not working for cuctsomer, supplier as per customize form
(cherry picked from commit 46d148defd)
2022-10-24 11:42:15 +00:00
Deepesh Garg
2705de084f Merge pull request #32689 from frappe/mergify/bp/version-14-hotfix/pr-32424
feat: Repayment schedule types for term loans (backport #32424)
2022-10-23 23:06:58 +05:30
Deepesh Garg
a0ace27f56 chore: resolve conflicts 2022-10-23 19:43:02 +05:30
Deepesh Garg
2348c42c79 chore: Update tests
(cherry picked from commit e59b147a62)
2022-10-23 14:08:36 +00:00
Deepesh Garg
1b3a0be0f1 chore: Add repayment date on option
(cherry picked from commit ef0cb17faf)
2022-10-23 14:08:35 +00:00
Deepesh Garg
b9bf5666bc chore: label post save
(cherry picked from commit bf7a51791a)
2022-10-23 14:08:34 +00:00
Deepesh Garg
25e87641b6 chore: Add patch to update repayment schedule type in loan documents
(cherry picked from commit 679b5ed551)

# Conflicts:
#	erpnext/patches.txt
2022-10-23 14:08:34 +00:00
Deepesh Garg
8550bbde27 chore: Update labels as per repayment type
(cherry picked from commit 2ddee50f27)
2022-10-23 14:08:32 +00:00
Deepesh Garg
7398cbdf12 chore: Remove print statements
(cherry picked from commit 3466461eb3)
2022-10-23 14:08:32 +00:00
Deepesh Garg
6ce32fd5a9 feat: Repayment schedule types for term loans
(cherry picked from commit 76c6ccab5d)
2022-10-23 14:08:32 +00:00
Deepesh Garg
18904456f3 Merge pull request #32686 from frappe/mergify/bp/version-14-hotfix/pr-32650
fix: unset contact details (backport #32650)
2022-10-23 18:32:04 +05:30
barredterra
d7a65b1d41 fix: unset contact details
(cherry picked from commit 23f0bb45b0)
2022-10-23 12:51:49 +00:00
ruthra kumar
eb6db59adf Merge pull request #32679 from frappe/mergify/bp/version-14-hotfix/pr-32635
fix: Integrity Error on PLE while submitting sales invoice (backport #32635)
2022-10-21 12:05:46 +05:30
ruthra kumar
fb2b2edf7e Merge pull request #32678 from frappe/mergify/bp/version-14-hotfix/pr-32651
feat: Payment Ledger report (backport #32651)
2022-10-21 11:56:09 +05:30
ruthra kumar
c2f8f64d1e test: use payable account in tax and to trigger party validation
(cherry picked from commit 8f42e7f703)
2022-10-21 06:07:09 +00:00
ruthra kumar
9a5e238702 fix: party type and party mandatory on updating outstanding
(cherry picked from commit 43b80683eb)
2022-10-21 06:07:09 +00:00
ruthra kumar
77f4c666ee test: invoice outstandings and payments
(cherry picked from commit 6e55b419a6)
2022-10-21 05:56:17 +00:00
ruthra kumar
5cb9f7b3a4 feat: Basic Payment Ledger report
(cherry picked from commit 8f60f0a0cf)
2022-10-21 05:56:17 +00:00
Ankush Menat
e1fc67c730 chore: disable coverage reporting on stable branches 2022-10-20 19:15:50 +05:30
Deepesh Garg
99d410ab75 Merge pull request #32673 from frappe/mergify/bp/version-14-hotfix/pr-32551
fix: number of months subscription plan (backport #32551)
2022-10-20 19:06:54 +05:30
Deepesh Garg
54de569251 Merge pull request #32655 from frappe/mergify/bp/version-14-hotfix/pr-32641
fix: allow to create Sales Order from expired Quotation (backport #32641)
2022-10-20 17:34:04 +05:30
Deepesh Garg
cab3f39f95 chore: Linting issues
(cherry picked from commit 1ca472cc8a)
2022-10-20 11:55:04 +00:00
codezart
fff9e76718 fix: number of months subscription plan
(cherry picked from commit 2d30b36cca)
2022-10-20 11:55:04 +00:00
Deepesh Garg
dbbebd2a73 Merge pull request #32663 from frappe/mergify/bp/version-14-hotfix/pr-32659
fix: Billing Address for inter-company purchase docs (backport #32659)
2022-10-20 17:21:24 +05:30
rohitwaghchaure
9bf101a234 Merge pull request #32669 from frappe/mergify/bp/version-14-hotfix/pr-32667
fix: BOM cost update message (backport #32667)
2022-10-20 16:53:09 +05:30
Ankush Menat
887690449d fix: dont update item info twice
[skip ci]
2022-10-20 16:19:40 +05:30
mergify[bot]
3300856fb4 perf: cache barcode scan result (backport #32629) (#32672)
perf: cache barcode scan result (#32629)

* perf: cache barcode scan result

* feat: BarcodeScanResult type

* fix: use safe `get_value` `set_value`

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
(cherry picked from commit b88e850d55)

Co-authored-by: Devin Slauenwhite <devin.slauenwhite@gmail.com>
2022-10-20 15:57:21 +05:30
Rohit Waghchaure
e539579fb4 fix: BOM cost update message
(cherry picked from commit 9cfe527492)
2022-10-20 09:08:31 +00:00
Deepesh Garg
f8934faa73 fix: Billing Address for inter-company purchase docs
(cherry picked from commit 796f2d3c09)
2022-10-20 06:29:32 +00:00
rohitwaghchaure
2c9845f8cb Merge pull request #32660 from frappe/mergify/bp/version-14-hotfix/pr-32654
fix: incorrect qty in material request created from PP (backport #32654)
2022-10-20 11:58:57 +05:30
Rohit Waghchaure
92b9d3dc6d test: validate qty and purchase uom in material request which is created from PP
(cherry picked from commit 4d5ef721f7)
2022-10-20 04:30:08 +00:00
Rohit Waghchaure
da538a37ad fix: incorrect qty in material request
(cherry picked from commit ad278b2007)
2022-10-20 04:30:08 +00:00
rohitwaghchaure
d6bf85f8bb Merge pull request #32652 from frappe/mergify/bp/version-14-hotfix/pr-32645
fix: overlap error not raised for job card in case of workstation with production capacity (backport #32645)
2022-10-20 09:58:25 +05:30
mergify[bot]
c3024af296 feat(report):added account wise redirection (backport #32529) (#32657)
feat(report): added account wise redirection

* feat(report):added account wise redirection

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit c52b41d311)

Co-authored-by: FinByz Tech Pvt. Ltd <info@finbyz.tech>
2022-10-20 09:39:11 +05:30
Raffael Meyer
ccc58f48e3 fix: allow to create Sales Order from expired Quotation (#32641)
(cherry picked from commit 4ad3002861)
2022-10-19 16:37:53 +00:00
Rohit Waghchaure
ed2a093e49 fix: overlap error not raised for job card in case of workstation with production capacity
(cherry picked from commit 8b2165e0d1)
2022-10-19 11:35:38 +00:00
mergify[bot]
8a88105aed fix: Advance paid amount in orders (backport #32642) (#32648)
fix: Advance paid amount in orders (#32642)

(cherry picked from commit 430492152f)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2022-10-19 15:41:57 +05:30
Frappe PR Bot
9703771b75 chore(release): Bumped to Version 14.3.1
## [14.3.1](https://github.com/frappe/erpnext/compare/v14.3.0...v14.3.1) (2022-10-18)

### Bug Fixes

* `Brand Defaults` filters ([cb0c4b5](cb0c4b5664))
* add project settings to projects workspace (backport [#32568](https://github.com/frappe/erpnext/issues/32568)) ([#32600](https://github.com/frappe/erpnext/issues/32600)) ([af4dafd](af4dafdc64))
* delete old ple's on item value repost ([62cabdf](62cabdf792))
* don't try to update youtube data if disabled in settings (backport [#32588](https://github.com/frappe/erpnext/issues/32588)) ([#32589](https://github.com/frappe/erpnext/issues/32589)) ([ed85683](ed85683fea))
* group warehouse filter not working for Batchwise Balance history report ([faedd85](faedd85b66))
* Ignore linked purchase invoice on cancel ([cc938fb](cc938fb028))
* linter ([831f60f](831f60f439))
* Party account for multi-order invoices ([eaea846](eaea8469fc))
* pricing rule item code UOM apply & conversions (backport [#32566](https://github.com/frappe/erpnext/issues/32566)) ([#32637](https://github.com/frappe/erpnext/issues/32637)) ([ffd82f3](ffd82f3302))
* Renamed Dashboard tab label to Connections ([dac5989](dac5989d72))
* Renamed Notes section to Comments ([9e94dd9](9e94dd9203))
* type-cast while saving an item (backport [#32549](https://github.com/frappe/erpnext/issues/32549)) ([#32578](https://github.com/frappe/erpnext/issues/32578)) ([829a0ff](829a0ff827))
2022-10-18 18:03:17 +00:00
Deepesh Garg
bd62a1d2d3 Merge pull request #32633 from frappe/version-14-hotfix
chore: release v14
2022-10-18 23:31:52 +05:30
mergify[bot]
ffd82f3302 fix: pricing rule item code UOM apply & conversions (backport #32566) (#32637)
fix: pricing rule for non stock UOM and conversions

* fix: pricing rule for non stock UOM and conversions

(cherry picked from commit 96b4211ea1)

Co-authored-by: Maharshi Patel <39730881+maharshivpatel@users.noreply.github.com>
2022-10-18 23:01:08 +05:30
Deepesh Garg
8c658638b4 Merge pull request #32621 from frappe/mergify/bp/version-14-hotfix/pr-32598
refactor: split ple creation function into two (backport #32598)
2022-10-18 15:11:51 +05:30
Sagar Sharma
064e364b4f Merge pull request #32632 from frappe/mergify/bp/version-14-hotfix/pr-32520
refactor: rewrite stock reports queries in qb (backport #32520)
2022-10-18 14:59:18 +05:30
Sagar Sharma
831f60f439 fix: linter 2022-10-18 14:27:56 +05:30
Sagar Sharma
469813d3e1 chore: conflicts 2022-10-18 14:18:44 +05:30
Sagar Sharma
656008dd66 refactor: rewrite Warehouse wise Item Balance Age and Value Report queries in QB
(cherry picked from commit 8103856a41)
2022-10-18 08:22:56 +00:00
Sagar Sharma
362bf5fc19 refactor: rewrite Total Stock Summary Report queries in QB
(cherry picked from commit 7c759b193c)
2022-10-18 08:22:56 +00:00
Sagar Sharma
8af90b2421 refactor: rewrite Supplier-Wise Sales Analytics Report queries in QB
(cherry picked from commit d3c073dc25)
2022-10-18 08:22:55 +00:00
Sagar Sharma
6903fb68d3 refactor: rewrite Stock Projected Qty Report queries in QB
(cherry picked from commit c18f13a45b)
2022-10-18 08:22:55 +00:00
Sagar Sharma
907a41a8da refactor: rewrite Item Prices Report queries in QB
(cherry picked from commit e312d17eae)
2022-10-18 08:22:55 +00:00
Sagar Sharma
e62fdf4af0 refactor: rewrite Delayed Item Report queries in QB
(cherry picked from commit bb59346651)
2022-10-18 08:22:55 +00:00
Sagar Sharma
720370537f refactor: rewrite Batch-Wise Balance History Report queries in QB
(cherry picked from commit 1c1f991d2f)

# Conflicts:
#	erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py
2022-10-18 08:22:54 +00:00
Sagar Sharma
5a85c2d661 refactor: rewrite Batch Item Expiry Status Report queries in QB
(cherry picked from commit 2c9d9577e3)
2022-10-18 08:22:54 +00:00
Sagar Sharma
64e9a25347 Merge pull request #32630 from frappe/mergify/bp/version-14-hotfix/pr-32527
refactor: rewrite buying reports queries in qb (backport #32527)
2022-10-18 10:47:47 +05:30
Sagar Sharma
2191f8a488 refactor: rewrite Procurement Tracker Report queries in QB
(cherry picked from commit e78a706994)
2022-10-18 04:37:03 +00:00
Sagar Sharma
1fbbaa8fcf refactor: rewrite Supplier Quotation Comparison Report queries in QB
(cherry picked from commit a14b9c7bac)
2022-10-18 04:37:02 +00:00
Sagar Sharma
fbb641936e refactor: rewrite Purchase Order Analysis Report queries in QB
(cherry picked from commit a5b3f8cae9)
2022-10-18 04:37:02 +00:00
Deepesh Garg
891a4afb5f Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32598 2022-10-18 10:00:46 +05:30
Deepesh Garg
01c5fbdbfb Merge pull request #32623 from frappe/mergify/bp/version-14-hotfix/pr-32622
fix: Ignore linked purchase invoice on cancel (backport #32622)
2022-10-18 09:12:48 +05:30
Deepesh Garg
cc938fb028 fix: Ignore linked purchase invoice on cancel
(cherry picked from commit faadf78332)
2022-10-17 14:08:50 +00:00
Deepesh Garg
9bcec15ca4 Merge pull request #32619 from frappe/mergify/bp/version-14-hotfix/pr-32618
test: lead creation and deletion restricted to dummy company (backport #32618)
2022-10-17 19:37:36 +05:30
ruthra kumar
a88ac4016a refactor: split ple creation function into two
refactor create_payment_ledger_entry function into 2.
one for generating ple map and one for DB entry creation

(cherry picked from commit 9b50221bf0)
2022-10-17 13:16:20 +00:00
rohitwaghchaure
0654f303bb Merge pull request #32615 from frappe/mergify/bp/version-14-hotfix/pr-32613
fix: group warehouse filter not working for Batch-wise Balance history report (backport #32613)
2022-10-17 18:04:09 +05:30
ruthra kumar
98e7b2dd25 test: lead creation and deletion restricted to dummy company
(cherry picked from commit ced8d2a537)
2022-10-17 11:42:33 +00:00
Rohit Waghchaure
1ee0d990e5 chore: seperate function to apply filter for warehouse in case of QB
(cherry picked from commit 2481574a28)
2022-10-17 09:43:30 +00:00
Rohit Waghchaure
faedd85b66 fix: group warehouse filter not working for Batchwise Balance history report
(cherry picked from commit 6381e75fa5)
2022-10-17 09:43:29 +00:00
Deepesh Garg
2db1da0c8a Merge pull request #32612 from frappe/mergify/bp/version-14-hotfix/pr-32607
chore: Remove HRMS related code (backport #32607)
2022-10-17 14:53:39 +05:30
Deepesh Garg
d9519f24aa chore: Remove HRMS related code (#32607)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
(cherry picked from commit dc3fe85921)
2022-10-17 06:09:25 +00:00
Deepesh Garg
a260c594c1 Merge pull request #32608 from frappe/mergify/bp/version-14-hotfix/pr-32591
fix: Renamed Notes section to Comments (backport #32591)
2022-10-15 18:26:00 +05:30
Nabin Hait
dac5989d72 fix: Renamed Dashboard tab label to Connections
(cherry picked from commit f561d8f689)
2022-10-15 12:13:35 +00:00
Nabin Hait
9e94dd9203 fix: Renamed Notes section to Comments
(cherry picked from commit 56a4a77398)
2022-10-15 12:13:35 +00:00
Deepesh Garg
794167aa36 Merge pull request #32606 from frappe/mergify/bp/version-14-hotfix/pr-32594
fix: Party account for multi-order invoices (backport #32594)
2022-10-15 17:41:14 +05:30
Deepesh Garg
eaea8469fc fix: Party account for multi-order invoices
(cherry picked from commit fd49503ba2)
2022-10-15 11:29:42 +00:00
mergify[bot]
af4dafdc64 fix: add project settings to projects workspace (backport #32568) (#32600)
Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2022-10-14 18:01:43 +05:30
ruthra kumar
a012c55c81 Merge pull request #32592 from frappe/mergify/bp/version-14-hotfix/pr-32567
fix: deduplicate Payment Ledger on Item value repost (backport #32567)
2022-10-13 15:28:57 +05:30
mergify[bot]
6a89cb57b0 chore: drop dead code (backport #32595) (#32596)
chore: drop dead code (#32595)

[skip ci]

(cherry picked from commit 50e9698932)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-10-13 15:27:17 +05:30
ruthra kumar
3c457e2638 test: dedeplication on payment ledger upon repost
(cherry picked from commit eb819368aa)
2022-10-13 08:32:51 +00:00
ruthra kumar
62cabdf792 fix: delete old ple's on item value repost
(cherry picked from commit 65992304bc)
2022-10-13 08:32:51 +00:00
mergify[bot]
ed85683fea fix: don't try to update youtube data if disabled in settings (backport #32588) (#32589)
fix: don't try to update youtube data if disabled in settings (#32588)

fix: cast value from db

[skip ci]

(cherry picked from commit e543dca6a0)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2022-10-13 11:55:36 +05:30
mergify[bot]
829a0ff827 fix: type-cast while saving an item (backport #32549) (#32578)
fix: type-cast while saving an item (#32549)

(cherry picked from commit 43037d893d)

Co-authored-by: Rohan <Alchez@users.noreply.github.com>
2022-10-13 11:54:22 +05:30
Sagar Sharma
0674d42c96 Merge pull request #32586 from frappe/mergify/bp/version-14-hotfix/pr-32576
fix: `Brand Defaults` filters (backport #32576)
2022-10-12 19:25:32 +05:30
Sagar Sharma
cb0c4b5664 fix: Brand Defaults filters
(cherry picked from commit 7da32c7db3)
2022-10-12 13:53:35 +00:00
Frappe PR Bot
36b9926527 chore(release): Bumped to Version 14.3.0
# [14.3.0](https://github.com/frappe/erpnext/compare/v14.2.3...v14.3.0) (2022-10-12)

### Bug Fixes

* consider outgoingrate while valuation rate calculate ([423c019](423c0190e2))
* consider sales rate as incoming rate for transit warehouse in purchase flow ([948b231](948b231e92))
* Do not add tax withheld vouchers post tax withheding in one document ([bd8e61b](bd8e61b2dc))
* Explicitly update modified (backport [#32519](https://github.com/frappe/erpnext/issues/32519)) ([#32575](https://github.com/frappe/erpnext/issues/32575)) ([154904e](154904e960))
* Hanlde rounding loss for internal transfer ([8eda2db](8eda2dbdf8))
* Incoming rate precision fixes for intra company transfer ([b653f43](b653f43b70))
* make readings status mandatory in Quality Inspection ([50d790c](50d790c919))
* minor cleanup ([236a5f3](236a5f37c7))
* more fields reordering related to Tab Break ([db4fbc9](db4fbc9e58))
* PO cancel post advance payment cancel against PO ([bda25c4](bda25c4d5d))
* removed unnecessary imports ([31782d6](31782d6f71))
* set Quality Inspection status based on readings status ([e25db8b](e25db8b1b5))
* single column indexes (backport [#32425](https://github.com/frappe/erpnext/issues/32425)) ([#32513](https://github.com/frappe/erpnext/issues/32513)) ([2f1b8af](2f1b8af13c))
* Tax withholding related fixes ([d5f6938](d5f693806b))
* test case ([0b26131](0b26131b65))
* **test:** `test_rejected_qi_validation` ([943e619](943e6192cc))
* TooManyWritesError during reposting of stock ([73742ff](73742ff565))
* unlink payment on invoice cancellation ([8ba503b](8ba503bf0e))
* use naming_series in budget ([0a24859](0a24859c9c))
* value error on pos submit ([4b65dd7](4b65dd7f2a))

### Features

* **JE:** trigger account field when fetched from template ([17dd1ab](17dd1abb34)), closes [#32409](https://github.com/frappe/erpnext/issues/32409)
* provision to return non consumed components against the work order ([d0f3818](d0f3818060))
* Tab Break in Material Request ([79151be](79151be8ce))
* Tab Break in Purchase Invoice ([89314d4](89314d4171))
* Tab Break in Purchase Order ([5a8329a](5a8329add1))
* Tab Break in Purchase Receipt ([b092791](b092791ac8))
* Tab Break in Quotation ([b0a9f79](b0a9f79e18))
* Tab Break in Sales Order, Delivery Note, Sales Invoice and Purchase Order ([31cd96b](31cd96bc89))
* Tab Break in Supplier Quotation ([22ad3ad](22ad3ad6f3))
2022-10-12 12:21:48 +00:00
Deepesh Garg
d38071eb20 Merge pull request #32560 from frappe/version-14-hotfix
chore: release v14
2022-10-12 17:50:12 +05:30
Deepesh Garg
c4b39c7c1c Merge branch 'version-14' into version-14-hotfix 2022-10-12 17:19:33 +05:30
Deepesh Garg
c83c645ab0 Merge pull request #32579 from frappe/mergify/bp/version-14-hotfix/pr-32563
fix: consider sales rate as incoming rate for transit warehouse in purchase flow (backport #32563)
2022-10-12 17:16:36 +05:30
Deepesh Garg
eab24b8366 Merge pull request #32582 from frappe/mergify/bp/version-14-hotfix/pr-32272
fix: Incoming rate precision fixes for intra company transfer (backport #32272)
2022-10-12 17:05:18 +05:30
rohitwaghchaure
31782d6f71 fix: removed unnecessary imports 2022-10-12 16:34:48 +05:30
Deepesh Garg
2494ccc0a2 chore: check only for inter-company transfers
(cherry picked from commit 9aa5e20ef7)
2022-10-12 10:54:33 +00:00
Deepesh Garg
108720b9c3 chore: fix precision condition
(cherry picked from commit 49601558c6)
2022-10-12 10:54:33 +00:00
Deepesh Garg
4f3e209009 chore: Use proper accounts
(cherry picked from commit 1c05c004cd)
2022-10-12 10:54:33 +00:00
Deepesh Garg
23b18a5e38 chore: Increase precision for other doc fields
(cherry picked from commit c8d2181498)
2022-10-12 10:54:33 +00:00
Deepesh Garg
b386b8c634 chore: GL Entries for SLE diff
(cherry picked from commit df2a0e265b)
2022-10-12 10:54:32 +00:00
Deepesh Garg
49221d47c2 test: Internal tranfer precision loss test
(cherry picked from commit dc20b21fb5)
2022-10-12 10:54:32 +00:00
Deepesh Garg
09e9675653 chore: Increase incoming_rate field precision to 6
(cherry picked from commit b31c3bd35d)
2022-10-12 10:54:32 +00:00
Deepesh Garg
8eda2dbdf8 fix: Hanlde rounding loss for internal transfer
(cherry picked from commit 6e47fd54a0)
2022-10-12 10:54:32 +00:00
Deepesh Garg
b653f43b70 fix: Incoming rate precision fixes for intra company transfer
(cherry picked from commit 083309c056)
2022-10-12 10:54:31 +00:00
Rohit Waghchaure
0b26131b65 fix: test case
(cherry picked from commit 98bf8e1304)
2022-10-12 10:51:00 +00:00
Rohit Waghchaure
423c0190e2 fix: consider outgoingrate while valuation rate calculate
(cherry picked from commit 3266e54e33)
2022-10-12 10:51:00 +00:00
Rohit Waghchaure
948b231e92 fix: consider sales rate as incoming rate for transit warehouse in purchase flow
(cherry picked from commit 683a47f7a1)
2022-10-12 10:50:59 +00:00
Deepesh Garg
23aca6663f Merge pull request #32565 from frappe/mergify/bp/version-14-hotfix/pr-32408
feat: Tab Breaks in all Sales and Purchase cycle transactions (backport #32408)
2022-10-12 14:13:38 +05:30
Deepesh Garg
6c85bdd735 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32408 2022-10-12 13:04:01 +05:30
mergify[bot]
154904e960 fix: Explicitly update modified (backport #32519) (#32575)
fix: Explicitly update modified (#32519)

* fix: Explicitly update modified

required after https://github.com/frappe/frappe/pull/18301

* chore: fix broken translations

(cherry picked from commit 8376fbc982)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-10-12 12:59:06 +05:30
mergify[bot]
03db8b2f5f ci: disable orchestrator (backport #32571) (#32572)
* ci: disable orchestrator (#32571)

(cherry picked from commit 6ce3ce758c)

* chore: correct build count

* chore: no cov

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-10-12 12:14:48 +05:30
Nabin Hait
236a5f37c7 fix: minor cleanup
(cherry picked from commit e71c417f7e)
2022-10-11 10:33:30 +00:00
Nabin Hait
db4fbc9e58 fix: more fields reordering related to Tab Break
(cherry picked from commit 5389a35798)
2022-10-11 10:33:30 +00:00
Nabin Hait
89314d4171 feat: Tab Break in Purchase Invoice
(cherry picked from commit aaf3c2b329)
2022-10-11 10:33:30 +00:00
Nabin Hait
b092791ac8 feat: Tab Break in Purchase Receipt
(cherry picked from commit 35f836c4b7)
2022-10-11 10:33:30 +00:00
Nabin Hait
22ad3ad6f3 feat: Tab Break in Supplier Quotation
(cherry picked from commit 3d9263bf86)
2022-10-11 10:33:29 +00:00
Nabin Hait
79151be8ce feat: Tab Break in Material Request
(cherry picked from commit 2172c5034a)
2022-10-11 10:33:29 +00:00
Nabin Hait
5a8329add1 feat: Tab Break in Purchase Order
(cherry picked from commit 10a25603ac)
2022-10-11 10:33:29 +00:00
Nabin Hait
b0a9f79e18 feat: Tab Break in Quotation
(cherry picked from commit 7546562139)
2022-10-11 10:33:28 +00:00
Nabin Hait
31cd96bc89 feat: Tab Break in Sales Order, Delivery Note, Sales Invoice and Purchase Order
(cherry picked from commit f6613e1e4c)
2022-10-11 10:33:27 +00:00
ruthra kumar
db563483cb Merge pull request #32558 from frappe/mergify/bp/version-14-hotfix/pr-32557
fix: Value error on validation of POS invoices with Serial Nos (backport #32557)
2022-10-11 15:36:36 +05:30
ruthra kumar
6fa1b892f7 test: value error on serial no validation on pos
(cherry picked from commit 9e2bd10d03)
2022-10-11 09:13:36 +00:00
ruthra kumar
4b65dd7f2a fix: value error on pos submit
(cherry picked from commit 4b908ebcd6)
2022-10-11 09:13:35 +00:00
Deepesh Garg
62296c85cd Merge pull request #32543 from frappe/mergify/bp/version-14-hotfix/pr-32497
chore: set `Quality Inspection` status based on readings status (backport #32497)
2022-10-11 14:02:58 +05:30
ruthra kumar
a71be4e99a Merge pull request #32550 from frappe/mergify/bp/version-14-hotfix/pr-32548
fix: allow deletion of cancelled Invoices once payments are unlinked (backport #32548)
2022-10-11 13:47:57 +05:30
Ankush Menat
c9002526b9 chore: update codeowners 2022-10-11 12:33:51 +05:30
Deepesh Garg
b9b08e4d5e Merge pull request #32555 from frappe/mergify/bp/version-14-hotfix/pr-32554
fix: use naming_series in budget (backport #32554)
2022-10-11 11:51:51 +05:30
Sagar Sharma
3c0bca3d74 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32497 2022-10-11 11:45:19 +05:30
Anand Baburajan
27509e2141 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32554 2022-10-11 11:06:44 +05:30
rohitwaghchaure
52dd967b0d Merge pull request #32542 from frappe/mergify/bp/version-14-hotfix/pr-32393
feat: provision to return non consumed components against the work order (backport #32393)
2022-10-11 10:39:18 +05:30
Deepesh Garg
9601e47ae4 Merge pull request #32540 from frappe/mergify/bp/version-14-hotfix/pr-32536
fix: PO cancel post advance payment cancel against PO (backport #32536)
2022-10-11 10:17:10 +05:30
anandbaburajan
0a24859c9c fix: use naming_series in budget
(cherry picked from commit e4d7d8c42d)
2022-10-11 04:46:10 +00:00
ruthra kumar
998367cedc test: update ple on payment unlink for SI's and SO's
(cherry picked from commit 143f905838)
2022-10-10 11:12:38 +00:00
ruthra kumar
8ba503bf0e fix: unlink payment on invoice cancellation
(cherry picked from commit 537d953f4c)
2022-10-10 11:12:38 +00:00
Sagar Sharma
943e6192cc fix(test): test_rejected_qi_validation
(cherry picked from commit 4992e4a2b8)
2022-10-10 05:20:45 +00:00
Sagar Sharma
91b0e7ddbd test: add test cases for Quality Inspection status
(cherry picked from commit fcc1272d42)
2022-10-10 05:20:45 +00:00
Sagar Sharma
e25db8b1b5 fix: set Quality Inspection status based on readings status
(cherry picked from commit 2657ece2cd)
2022-10-10 05:20:44 +00:00
Sagar Sharma
50d790c919 fix: make readings status mandatory in Quality Inspection
(cherry picked from commit d7c3b7633a)
2022-10-10 05:20:44 +00:00
Sagar Sharma
8a4c07a7e8 chore: add Manual Inspection field in Quality Inspection DocType
(cherry picked from commit 39707757a6)
2022-10-10 05:20:44 +00:00
Rohit Waghchaure
d0f3818060 feat: provision to return non consumed components against the work order
(cherry picked from commit d59ed24e6c)
2022-10-10 03:39:25 +00:00
Deepesh Garg
bda25c4d5d fix: PO cancel post advance payment cancel against PO
(cherry picked from commit d806e32030)
2022-10-09 13:06:06 +00:00
Frappe PR Bot
f70103dac6 chore(release): Bumped to Version 14.2.3
## [14.2.3](https://github.com/frappe/erpnext/compare/v14.2.2...v14.2.3) (2022-10-07)

### Bug Fixes

* Do not add tax withheld vouchers post tax withheding in one document ([6060072](6060072d22))
* Tax withholding related fixes ([a226fcf](a226fcf898))
2022-10-07 12:40:22 +00:00
Deepesh Garg
a519d68826 Merge pull request #32525 from frappe/mergify/bp/version-14/pr-32522
fix: Tax withholding related fixes (backport #32522)
2022-10-07 18:08:51 +05:30
Deepesh Garg
49cedca8de Merge pull request #32524 from frappe/mergify/bp/version-14-hotfix/pr-32522
fix: Tax withholding related fixes (backport #32522)
2022-10-07 18:08:39 +05:30
Deepesh Garg
6060072d22 fix: Do not add tax withheld vouchers post tax withheding in one document
(cherry picked from commit 781d160c68)
2022-10-07 12:03:29 +00:00
Deepesh Garg
a226fcf898 fix: Tax withholding related fixes
(cherry picked from commit abf5b6be3e)
2022-10-07 12:03:29 +00:00
Deepesh Garg
bd8e61b2dc fix: Do not add tax withheld vouchers post tax withheding in one document
(cherry picked from commit 781d160c68)
2022-10-07 11:03:40 +00:00
Deepesh Garg
d5f693806b fix: Tax withholding related fixes
(cherry picked from commit abf5b6be3e)
2022-10-07 11:03:40 +00:00
mergify[bot]
5f6bbd4929 chore: drop stale demo page (backport #32515) (#32516)
chore: drop stale demo page (#32515)

(cherry picked from commit 07c4a74838)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-10-06 13:03:29 +05:30
mergify[bot]
2f1b8af13c fix: single column indexes (backport #32425) (#32513)
fix: single column indexes (#32425)

refactor: move single column indexes to doctypes
(cherry picked from commit 8d1db0ea3d)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-10-06 11:37:43 +05:30
Deepesh Garg
3d6a37ea04 Merge pull request #32510 from frappe/mergify/bp/version-14-hotfix/pr-32385
chore: update fr translation (backport #32385)
2022-10-06 09:03:20 +05:30
HENRY Florian
3caf905019 chore: update fr translation (#32385)
(cherry picked from commit 0e4017cbe5)
2022-10-05 17:20:04 +00:00
Deepesh Garg
4941b6e280 Merge pull request #32501 from frappe/mergify/bp/version-14-hotfix/pr-32491
refactor: remove duplicate entries on remarks migration patch (backport #32491)
2022-10-05 18:16:51 +05:30
Deepesh Garg
a02ddc92ef Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32491 2022-10-05 17:30:25 +05:30
Deepesh Garg
6017f6790e Merge pull request #32503 from frappe/mergify/bp/version-14-hotfix/pr-32499
fix: TooManyWritesError during reposting of stock (backport #32499)
2022-10-05 17:29:56 +05:30
Deepesh Garg
3daff104c3 Merge pull request #32505 from frappe/mergify/bp/version-14-hotfix/pr-32478
feat(JE): trigger account field when fetched from template (backport #32478)
2022-10-05 17:28:49 +05:30
Dany Robert
17dd1abb34 feat(JE): trigger account field when fetched from template
Closes #32409

(cherry picked from commit c35adcf5a1)
2022-10-05 10:38:41 +00:00
Rohit Waghchaure
73742ff565 fix: TooManyWritesError during reposting of stock
(cherry picked from commit aaabba9b1e)
2022-10-05 10:36:18 +00:00
ruthra kumar
70e990c4f3 refactor: remove duplicate entries on remarks migration patch
(cherry picked from commit 518ab93e03)
2022-10-05 10:35:06 +00:00
Frappe PR Bot
217e407371 chore(release): Bumped to Version 14.2.2
## [14.2.2](https://github.com/frappe/erpnext/compare/v14.2.1...v14.2.2) (2022-10-04)

### Bug Fixes

* (bulk transaction) key error and better error logging (backport [#32445](https://github.com/frappe/erpnext/issues/32445)) ([#32463](https://github.com/frappe/erpnext/issues/32463)) ([7a80385](7a8038500d))
* add non-stock item filter for `fg_item` in PO ([11f9279](11f92797b9))
* add validation for non-stock item in SCR ([793fa18](793fa18225))
* asset requiring maintenance sold status and added test [v14-hotfix] ([c0a141b](c0a141bfcd))
* asset tests ([6710337](671033755f))
* calculate depreciation properly on asset sale entry and scrap entry ([f5f13c4](f5f13c4611))
* Create accounting dimension fields in asset capitalization ([9ec0d10](9ec0d104a5))
* Disbursement Account in patch to update old loans ([0973989](097398914e))
* don't allow to update `Maintain Stock` if the item has a `BOM` ([e5d1f59](e5d1f59d96))
* fetch swift_number in payment_request ([f09222a](f09222a9e5))
* fix restore asset value after depreciation ([8605245](86052450a5))
* fixes query builder order by issue in postgres (backport [#32441](https://github.com/frappe/erpnext/issues/32441)) ([#32465](https://github.com/frappe/erpnext/issues/32465)) ([8851826](8851826a57))
* Incorrect TCS amount deducted in Sales Invoice ([4d51d73](4d51d73797))
* Item details fetching on making transaction from item dashboard ([db60299](db60299cf3))
* not able to return sold expired batches ([9c56a5f](9c56a5ff7c))
* payment request make bank field Link instead of Read Only ([c8c0f34](c8c0f345d7))
* pick list picked-qty for batch item ([32107c4](32107c4a79))
* refactor asset capitilization ([bad3b33](bad3b330f4))
* searchfields as per customize form not working for Item ([f167abb](f167abbbfd))
* show `Make Purchase Invoice` button based on permission ([fd86876](fd86876a0e))
* supplied items added twice in Stock Entry ([d91ac5e](d91ac5e549))
* test_scrap_asset ([fd232d1](fd232d1db7))
* typo in sales_register's filter mode_of_payment (backport [#32371](https://github.com/frappe/erpnext/issues/32371)) ([#32446](https://github.com/frappe/erpnext/issues/32446)) ([1918b5c](1918b5c4b0))
* update with new Frappe color. fix [#32455](https://github.com/frappe/erpnext/issues/32455) ([#32456](https://github.com/frappe/erpnext/issues/32456)) ([3e7582f](3e7582f55b))

### Reverts

* Revert "fix: fetch swift_number in payment_request" ([d3c151f](d3c151f32b))
2022-10-04 12:13:08 +00:00
Deepesh Garg
90607becb8 Merge pull request #32493 from frappe/version-14-hotfix
chore: release v14
2022-10-04 17:41:32 +05:30
mergify[bot]
d6888bc8c8 refactor(UI): clean up portal pages (backport #29018) (#32489)
refactor(UI): clean up portal pages (#29018)

* refactor: list view for portal pages

* refactor: add align center class

* refactor: change footer btn class(primary)

* refactor: add order style page

* refactor: import order page in website

* refactor: remove table elements

* fix: preview image height

* fix: make string translatable

* refactor: change font variables

* refactor: order preview bg white

* refactor: center align items

* fix: breadcrumb padding

* refactor: make preview image rounded

* refactor: add condition for image container

* refactor: change alignment for mobile view

* fix: make footer button secondary

* refactor: clean code

* refactor: code indentantion

* refactor: remove space

* fix: Payment section cleanup

Co-authored-by: Summayya <frappe@Summayyas-MacBook-Air.local>
Co-authored-by: Marica <maricadsouza221197@gmail.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit da43a5e371)

Co-authored-by: Summayya Hashmani <58825865+sumaiya2908@users.noreply.github.com>
2022-10-04 10:21:50 +05:30
rohitwaghchaure
063f206b9b Merge pull request #32469 from frappe/mergify/bp/version-14-hotfix/pr-32466
fix: not able to return sold expired batches (backport #32466)
2022-10-04 07:34:09 +05:30
mergify[bot]
7a8038500d fix: (bulk transaction) key error and better error logging (backport #32445) (#32463)
fix: (bulk transaction) key error and better error logging (#32445)

* fix: (bulk transaction) key error and better error logging

* chore: pre-commit

* chore: linter - missing comma

(cherry picked from commit 91055151ce)

Co-authored-by: Dany Robert <danyrt@wahni.com>
2022-10-03 17:45:51 +05:30
mergify[bot]
8851826a57 fix: fixes query builder order by issue in postgres (backport #32441) (#32465)
fix: fixes query builder order by issue in postgres (#32441)

* fix: fixes query builder order by issue in postgres

* fix: linter

(cherry picked from commit 69efd2ee24)

Co-authored-by: Shridhar Patil <shridhar.p@zerodha.com>
2022-10-03 16:25:23 +05:30
Sagar Sharma
2a82f16680 Merge pull request #32473 from frappe/mergify/bp/version-14-hotfix/pr-32472
fix: pick list picked-qty for batch item (backport #32472)
2022-10-03 15:24:14 +05:30
Sagar Sharma
32107c4a79 fix: pick list picked-qty for batch item
(cherry picked from commit ba02209f1d)
2022-10-03 09:16:37 +00:00
Deepesh Garg
bbc7559380 Merge pull request #32468 from frappe/mergify/bp/version-14-hotfix/pr-32394
fix: fetch swift number in payment request from bank doctype (backport #32394)
2022-10-03 14:29:06 +05:30
Rohit Waghchaure
9c56a5ff7c fix: not able to return sold expired batches
(cherry picked from commit 0b1727cf79)
2022-10-03 07:45:46 +00:00
Maharshi Patel
c8c0f345d7 fix: payment request make bank field Link instead of Read Only
(cherry picked from commit dc8d49260c)
2022-10-03 07:26:38 +00:00
Maharshi Patel
d3c151f32b Revert "fix: fetch swift_number in payment_request"
This reverts commit f42a8e4e03.

(cherry picked from commit 9245d3b5cd)
2022-10-03 07:26:38 +00:00
Maharshi Patel
f09222a9e5 fix: fetch swift_number in payment_request
There isn't direct link between payment_request and bank so swift_number wasn't fetched using Fetch form. I fixed it by fetching swift_number on_change of bank_account.

(cherry picked from commit f42a8e4e03)
2022-10-03 07:26:38 +00:00
Deepesh Garg
ba80ba07f1 Merge pull request #32461 from frappe/mergify/bp/version-14-hotfix/pr-32456
fix: update with new Frappe color. fix #32455 (backport #32456)
2022-10-03 09:14:57 +05:30
Deepesh Garg
34845b7630 Merge pull request #32459 from frappe/mergify/bp/version-14-hotfix/pr-32454
fix: test_scrap_asset not working on end of month (backport #32454)
2022-10-03 09:04:01 +05:30
Deepesh Garg
ecfa64f22e Merge pull request #32460 from AnandBaburajan/fix_asset_sold_status_v14
fix: status of assets with maintenance_required changing back to 'Partially Depreciated' some time after being sold (backport #32405)
2022-10-03 08:58:40 +05:30
Muvuk
3e7582f55b fix: update with new Frappe color. fix #32455 (#32456)
* Update with new Frappe color.

* refactor: use css variables

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
(cherry picked from commit 73e5a7d671)
2022-10-02 17:02:02 +00:00
Anand Baburajan
6f571218bf Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32454 2022-10-02 19:14:00 +05:30
Anand Baburajan
8ab2f2f925 Merge branch 'version-14-hotfix' into fix_asset_sold_status_v14 2022-10-02 18:31:04 +05:30
Deepesh Garg
2d34761057 Merge pull request #32429 from frappe/mergify/bp/version-14-hotfix/pr-32420
patch: Create accounting dimension fields in asset capitalization (backport #32420)
2022-10-02 18:28:06 +05:30
anandbaburajan
c0a141bfcd fix: asset requiring maintenance sold status and added test [v14-hotfix] 2022-10-02 18:27:37 +05:30
anandbaburajan
fd232d1db7 fix: test_scrap_asset
(cherry picked from commit 47bd4be71b)
2022-10-02 12:15:55 +00:00
Deepesh Garg
df9147f2e5 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32420 2022-10-02 17:45:30 +05:30
Sagar Sharma
8e68219c5b Merge pull request #32440 from frappe/mergify/bp/version-14-hotfix/pr-32428
fix: don't allow to update `Maintain Stock` if the item has a `BOM` (backport #32428)
2022-10-02 12:07:28 +05:30
Sagar Sharma
060ce45572 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32428 2022-10-01 14:32:18 +05:30
Sagar Sharma
432da7d1d1 Merge pull request #32444 from frappe/mergify/bp/version-14-hotfix/pr-32439
fix: add non-stock item filter for `fg_item` in PO (backport #32439)
2022-10-01 14:32:02 +05:30
Sagar Sharma
9318d9a7fc Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32439 2022-10-01 14:31:49 +05:30
Deepesh Garg
faca06d6c3 Merge pull request #32433 from frappe/mergify/bp/version-14-hotfix/pr-32368
chore: remove discount accounting logic from PI and PI Item (backport #32368)
2022-10-01 12:05:10 +05:30
mergify[bot]
1918b5c4b0 fix: typo in sales_register's filter mode_of_payment (backport #32371) (#32446)
fix: typo in sales_register's filter mode_of_payment (#32371)
2022-10-01 12:04:16 +05:30
Deepesh Garg
444f3b5397 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32368 2022-10-01 11:10:03 +05:30
Deepesh Garg
3736f4ecb8 Merge pull request #32430 from frappe/mergify/bp/version-14-hotfix/pr-32402
fix: Item details fetching on making transaction from item dashboard (backport #32402)
2022-10-01 11:03:08 +05:30
Deepesh Garg
5fe2079dcc Merge pull request #32434 from frappe/mergify/bp/version-14-hotfix/pr-32412
fix: Incorrect TCS amount deducted in Sales Invoice (backport #32412)
2022-10-01 11:01:28 +05:30
Sagar Sharma
11f92797b9 fix: add non-stock item filter for fg_item in PO
(cherry picked from commit f95ed7dca2)
2022-09-30 18:29:54 +00:00
Sagar Sharma
17996efbc7 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32428 2022-09-30 23:57:49 +05:30
Sagar Sharma
c2bed24c31 Merge pull request #32438 from frappe/mergify/bp/version-14-hotfix/pr-32436
fix: add validation for non-stock item in SCR (backport #32436)
2022-09-30 23:57:30 +05:30
Sagar Sharma
e5d1f59d96 fix: don't allow to update Maintain Stock if the item has a BOM
(cherry picked from commit 6d0842465b)
2022-09-30 13:39:11 +00:00
Sagar Sharma
793fa18225 fix: add validation for non-stock item in SCR
(cherry picked from commit fa2290657a)
2022-09-30 11:23:50 +00:00
Deepesh Garg
f7ec00ef49 chore: Remove print statements
(cherry picked from commit bff3cd9068)
2022-09-30 10:35:58 +00:00
Deepesh Garg
4d51d73797 fix: Incorrect TCS amount deducted in Sales Invoice
(cherry picked from commit 08443c6421)
2022-09-30 10:35:57 +00:00
ruthra kumar
7a096231fb chore: clean up purchase invoice and purchase invoice item
1. remove discount accounting related fields from purchase invoice and
purchase invoice item
2. clean buying settings doctype

(cherry picked from commit 21095502b9)
2022-09-30 10:29:17 +00:00
Deepesh Garg
db60299cf3 fix: Item details fetching on making transaction from item dashboard
(cherry picked from commit 0439e41a44)
2022-09-30 10:27:15 +00:00
Nabin Hait
9ec0d104a5 fix: Create accounting dimension fields in asset capitalization
(cherry picked from commit fe891aa488)
2022-09-30 10:26:33 +00:00
Sagar Sharma
7243089027 Merge pull request #32418 from frappe/mergify/bp/version-14-hotfix/pr-32404
fix(ux): show `Make Purchase Invoice` button based on permission (backport #32404)
2022-09-29 17:16:25 +05:30
rohitwaghchaure
5aa9c4fd07 Merge pull request #32417 from frappe/mergify/bp/version-14-hotfix/pr-32414
fix: searchfields as per customize form not working for Item (backport #32414)
2022-09-29 15:45:10 +05:30
Sagar Sharma
fd86876a0e fix: show Make Purchase Invoice button based on permission
(cherry picked from commit 80080a3d7b)
2022-09-29 09:26:36 +00:00
Rohit Waghchaure
3f0a3b702d test: added test case
(cherry picked from commit 3656f7d06f)
2022-09-29 09:22:44 +00:00
Rohit Waghchaure
f167abbbfd fix: searchfields as per customize form not working for Item
(cherry picked from commit fd889fd29a)
2022-09-29 09:22:44 +00:00
Nabin Hait
5015f38a8d Merge pull request #32398 from frappe/mergify/bp/version-14-hotfix/pr-32226
fix: calculate depreciation properly on asset sale entry and scrap entry (backport #32226)
2022-09-29 12:34:42 +05:30
anandbaburajan
381231257b chore: fix merge conflicts 2022-09-29 11:59:53 +05:30
Anand Baburajan
f4648ed610 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32226 2022-09-28 22:24:03 +05:30
Sagar Sharma
51fcb3c666 Merge pull request #32407 from frappe/mergify/bp/version-14-hotfix/pr-32406
fix: supplied items added twice in Stock Entry (backport #32406)
2022-09-28 21:44:59 +05:30
Sagar Sharma
7b11da2373 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32406 2022-09-28 21:44:50 +05:30
Deepesh Garg
5c0446d9fc Merge pull request #32411 from frappe/mergify/bp/version-14-hotfix/pr-32403
fix: Disbursement Account in patch to update old loans (backport #32403)
2022-09-28 20:14:01 +05:30
Deepesh Garg
097398914e fix: Disbursement Account in patch to update old loans
(cherry picked from commit be623ce8e8)
2022-09-28 14:07:00 +00:00
Sagar Sharma
d91ac5e549 fix: supplied items added twice in Stock Entry
(cherry picked from commit ac7409bbf3)
2022-09-28 12:20:55 +00:00
Frappe PR Bot
9c915ceeb2 chore(release): Bumped to Version 14.2.1
## [14.2.1](https://github.com/frappe/erpnext/compare/v14.2.0...v14.2.1) (2022-09-28)

### Bug Fixes

* `For Quantity` error msg in `Stock Entry` ([4b6e1f4](4b6e1f4892))
* Add return against indexes for POS Invoice ([3abe4a1](3abe4a16af))
* Add return against indexes for POS Invoice ([32ad36a](32ad36ad0f))
* Add strings to translate function ([2eeff8a](2eeff8a00b))
* add translate function to strings ([f5a3f8b](f5a3f8b486))
* add translate function to strings ([e464de3](e464de3c5d))
* allow to return expired batches using purchase return ([305eb02](305eb02bfc))
* consider overproduction percentage for WO finish button ([4a29c7f](4a29c7fafb))
* difference amount calculation on payment reconciliation ([b389740](b3897406b0))
* get amount in words for debit note ([7554ac9](7554ac9569))
* item_code key error in production plan ([4e31448](4e31448e3d))
* Move subscription process to hourly long quque ([b2f280d](b2f280dee6))
* opening entry causing discepancy between stock and trial balance ([2fd0291](2fd0291afb))
* POS only validate QTY if is_stock_item ([29c4a32](29c4a32c33))
* POS properly validate stock for bundle products ([6b55a01](6b55a01834))
* Reduce font size for Process Statement of accounts print/pdf ([bcfa9b8](bcfa9b8593))
* report chart field type ([931aa62](931aa62072))
* Scrap Asset Accounting Dimensions (backport [#31949](https://github.com/frappe/erpnext/issues/31949)) ([#32376](https://github.com/frappe/erpnext/issues/32376)) ([a28ae4d](a28ae4d653))
* total value in all keys ([24234d5](24234d584d))
* typo on opportunity summary by sales stage report ([a403e72](a403e729d6))
2022-09-28 09:49:04 +00:00
Deepesh Garg
4b8dd1fab6 Merge pull request #32375 from frappe/version-14-hotfix
chore: release v14
2022-09-28 15:17:26 +05:30
Deepesh Garg
fc581464b8 Merge pull request #32396 from frappe/mergify/bp/version-14-hotfix/pr-32379
fix: POS only validate QTY if is_stock_item (backport #32379)
2022-09-28 14:47:41 +05:30
anandbaburajan
b3b7650ac8 chore: add blank lines
(cherry picked from commit c6a7de0e54)

# Conflicts:
#	erpnext/assets/doctype/asset/depreciation.py
2022-09-28 08:59:43 +00:00
anandbaburajan
86052450a5 fix: fix restore asset value after depreciation
(cherry picked from commit 43a3400221)
2022-09-28 08:59:42 +00:00
anandbaburajan
bad3b330f4 fix: refactor asset capitilization
(cherry picked from commit 5a8b28c194)
2022-09-28 08:59:42 +00:00
anandbaburajan
671033755f fix: asset tests
(cherry picked from commit 11ac20e5ee)
2022-09-28 08:59:41 +00:00
anandbaburajan
f5f13c4611 fix: calculate depreciation properly on asset sale entry and scrap entry
(cherry picked from commit ff5cad1cd6)

# Conflicts:
#	erpnext/assets/doctype/asset/depreciation.py
2022-09-28 08:59:41 +00:00
Maharshi Patel
6b55a01834 fix: POS properly validate stock for bundle products
Stock availability was not calculated properly for Product Bundle with non stock item so i have added logic to properly calculate that as well.

(cherry picked from commit e392ea1104)
2022-09-28 08:16:23 +00:00
Maharshi Patel
29c4a32c33 fix: POS only validate QTY if is_stock_item
POS invoice raised " Item not available " validation error even though item is non_stock.

(cherry picked from commit e39e088f18)
2022-09-28 08:16:22 +00:00
Deepesh Garg
c9c203a5eb Merge pull request #32383 from frappe/mergify/bp/version-14-hotfix/pr-32378
fix: Add return against indexes for POS Invoice (backport #32378)
2022-09-28 10:54:44 +05:30
Deepesh Garg
261aac8e26 Merge pull request #32387 from frappe/mergify/bp/version-14-hotfix/pr-32382
fix: Move subscription process to hourly long queue (backport #32382)
2022-09-28 08:09:26 +05:30
Deepesh Garg
b2f280dee6 fix: Move subscription process to hourly long quque
(cherry picked from commit 82a2f31ada)
2022-09-27 18:09:50 +00:00
Deepesh Garg
3abe4a16af fix: Add return against indexes for POS Invoice
(cherry picked from commit cbfe28286a)
2022-09-27 16:52:39 +00:00
Deepesh Garg
32ad36ad0f fix: Add return against indexes for POS Invoice
(cherry picked from commit 1f6205e1ea)
2022-09-27 16:52:38 +00:00
Sagar Sharma
e98c0ab924 Merge pull request #32380 from frappe/mergify/bp/version-14-hotfix/pr-32377
fix: consider overproduction percentage for WO finish button (backport #32377)
2022-09-27 20:18:25 +05:30
Sagar Sharma
4a29c7fafb fix: consider overproduction percentage for WO finish button
(cherry picked from commit 05392e0918)
2022-09-27 12:15:20 +00:00
Sagar Sharma
4b6e1f4892 fix: For Quantity error msg in Stock Entry
(cherry picked from commit 9049db41ae)
2022-09-27 12:15:19 +00:00
mergify[bot]
a28ae4d653 fix: Scrap Asset Accounting Dimensions (backport #31949) (#32376)
fix: Scrap Asset Accounting Dimensions (#31949)

* fix: Scrap Asset Accounting Dimensions

(cherry picked from commit c760ca2323)

Co-authored-by: Maharshi Patel <39730881+maharshivpatel@users.noreply.github.com>
2022-09-27 17:07:38 +05:30
rohitwaghchaure
11be30d68e Merge pull request #32372 from frappe/mergify/bp/version-14-hotfix/pr-32370
fix: Not allowing to return expired batches using purchase return (backport #32370)
2022-09-27 14:58:51 +05:30
Rohit Waghchaure
305eb02bfc fix: allow to return expired batches using purchase return
(cherry picked from commit a4a86ee23f)
2022-09-27 08:51:01 +00:00
rohitwaghchaure
1184fa3313 Merge pull request #32365 from frappe/mergify/bp/version-14-hotfix/pr-32339
fix: opening entry causing discrepancy between stock and trial balance (backport #32339)
2022-09-27 10:56:04 +05:30
Rohit Waghchaure
2fd0291afb fix: opening entry causing discepancy between stock and trial balance
(cherry picked from commit bc3ab45af2)
2022-09-26 15:03:25 +00:00
rohitwaghchaure
959fdcd841 Merge pull request #32364 from frappe/mergify/bp/version-14-hotfix/pr-32049
Allow Item Templates in Work Order Items (backport #32049)
2022-09-26 20:33:21 +05:30
Dhananjay Palshikar
a83e36b801 Allow Item Templates in Work Order Items
Item Variants can be a part of the items tables, however, when BOM items are fetched to be a part of the Work Order items, item variants were being filtered out.
The filtering out does not serve a purpose. Having Item variants in BOMs allows for template like behaviour.

(cherry picked from commit 75396c02d2)
2022-09-26 14:58:05 +00:00
rohitwaghchaure
37d0721f36 Merge pull request #32359 from frappe/mergify/bp/version-14-hotfix/pr-32347
refactor: rewrite `Incorrect Stock Value Report` queries in `QB` (backport #32347)
2022-09-26 20:24:58 +05:30
Deepesh Garg
408f2bda82 Merge pull request #32361 from frappe/mergify/bp/version-14-hotfix/pr-32146
fix: report chart fieldtype (backport #32146)
2022-09-26 18:36:33 +05:30
Deepesh Garg
ddf4d02c7d Merge pull request #32356 from frappe/mergify/bp/version-14-hotfix/pr-32276
fix: add some strings to translate function (backport #32276)
2022-09-26 18:33:32 +05:30
Sagar Sharma
2f5276b794 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32347 2022-09-26 18:18:29 +05:30
Sagar Sharma
e708a33684 Merge pull request #32357 from frappe/mergify/bp/version-14-hotfix/pr-32346
refactor: rewrite `Item Price Stock Report` queries in `QB` (backport #32346)
2022-09-26 18:18:12 +05:30
hendrik
931aa62072 fix: report chart field type
* fix: report chart field type

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit f41d1500b0)
2022-09-26 12:18:17 +00:00
Sagar Sharma
8c6ddb6721 refactor: rewrite Incorrect Stock Value Report queries in QB
(cherry picked from commit b93331e844)
2022-09-26 11:40:00 +00:00
Sagar Sharma
f1d774034c refactor: rewrite Item Price Stock Report queries in QB
(cherry picked from commit 22299d2382)
2022-09-26 11:39:04 +00:00
Deepesh Garg
4a1de87822 Merge pull request #32354 from frappe/mergify/bp/version-14-hotfix/pr-32336
fix: typo on opportunity summary by sales stage report (backport #32336)
2022-09-26 16:58:58 +05:30
Ernesto Ruiz
f5a3f8b486 fix: add translate function to strings
(cherry picked from commit 94199b7867)
2022-09-26 11:09:49 +00:00
Ernesto Ruiz
e464de3c5d fix: add translate function to strings
(cherry picked from commit aa49ec815a)
2022-09-26 11:09:48 +00:00
Ernesto Ruiz
2eeff8a00b fix: Add strings to translate function
(cherry picked from commit 9decebe6e1)
2022-09-26 11:09:48 +00:00
Ernesto Ruiz
a403e729d6 fix: typo on opportunity summary by sales stage report
(cherry picked from commit c4919cf5ec)
2022-09-26 11:08:18 +00:00
ruthra kumar
1c32bf23d7 Merge pull request #32351 from frappe/mergify/bp/version-14-hotfix/pr-32310
fix: total value in all keys (backport #32310)
2022-09-26 12:05:20 +05:30
Ankush Menat
e599b61ac5 chore: drop 1 runner from stable branch 2022-09-26 11:37:14 +05:30
nishibakabeer
24234d584d fix: total value in all keys
Gross and net profit report showing wrong values in monthly quarterly and half yearly filters which is the total value
@ruthra-kumar added in develop branch as suggested ( https://github.com/frappe/erpnext/pull/32020)

(cherry picked from commit 6919f389aa)
2022-09-26 06:03:33 +00:00
ruthra kumar
a69881e8e5 Merge pull request #32349 from frappe/mergify/bp/version-14-hotfix/pr-32303
fix: difference amount calculation and popup on payment reconciliation (backport #32303)
2022-09-26 11:15:43 +05:30
ruthra kumar
b3897406b0 fix: difference amount calculation on payment reconciliation
(cherry picked from commit 122d5f2729)
2022-09-26 04:57:57 +00:00
Deepesh Garg
0136d58d59 Merge pull request #32334 from frappe/mergify/bp/version-14-hotfix/pr-32117
fix: Reduce font size for Process Statement of accounts print/pdf (backport #32117)
2022-09-25 17:21:10 +05:30
Sagar Sharma
3a74ac9194 Merge pull request #32337 from frappe/mergify/bp/version-14-hotfix/pr-32324
refactor: rewrite `Production Planning Report` queries in `QB` (backport #32324)
2022-09-23 10:37:54 +05:30
Sagar Sharma
21a4556f99 refactor: rewrite Production Planning Report queries in QB
(cherry picked from commit 8417b9b99c)
2022-09-23 04:20:22 +00:00
Deepesh Garg
bcfa9b8593 fix: Reduce font size for Process Statement of accounts print/pdf
(cherry picked from commit 6bfd193b0d)
2022-09-22 19:39:17 +00:00
Sagar Sharma
f2dd547451 Merge pull request #32327 from s-aga-r/backport/v14-h/32309
fix: item_code key error in production plan (backport #32309)
2022-09-22 18:32:21 +05:30
Rohit Waghchaure
4e31448e3d fix: item_code key error in production plan 2022-09-22 18:07:20 +05:30
Sagar Sharma
d5d31060c4 Merge pull request #32317 from s-aga-r/backport/v14-h/32304
refactor: rewrite `Exponential Smoothing Forecasting` queries in `QB` (backport #32304)
2022-09-22 01:32:10 +05:30
Sagar Sharma
f5c517d08d refactor: rewrite Exponential Smoothing Forecasting queries in QB 2022-09-21 21:31:37 +05:30
Deepesh Garg
8d5131ef8f Merge pull request #32300 from frappe/mergify/bp/version-14-hotfix/pr-32296
fix: get amount in words for debit note (backport #32296)
2022-09-21 13:07:25 +05:30
Sagar Sharma
0e7c0144cb Merge pull request #32306 from s-aga-r/backport/14/refactor/report/exponential-smoothing-forecasting
refactor: rewrite `BOM Variance Report` queries in `QB` (backport #32297)
2022-09-21 11:51:22 +05:30
Sagar Sharma
d54bf6d91c refactor: rewrite BOM Variance Report queries in QB 2022-09-21 11:16:45 +05:30
Frappe PR Bot
c50d6c5e74 chore(release): Bumped to Version 14.2.0
# [14.2.0](https://github.com/frappe/erpnext/compare/v14.1.2...v14.2.0) (2022-09-20)

### Bug Fixes

* `po_detail` or `sco_rm_detail` not getting set while while mapping SE ([ff210c7](ff210c73eb))
* `sco_rm_detail` in Stock Entry ([a15f0d4](a15f0d427c))
* abbreviation issue on renaming cost center ([f752822](f752822bb3))
* Add child table for tax withheld vouchers ([e807662](e8076629fa))
* always set default expense account in company ([3b79e24](3b79e24c7e))
* **Asset Capitalization:** Hide source items section if table is empty ([003cfe2](003cfe2717))
* **Asset Capitalization:** Reverse depreciation on cancel ([85d1a23](85d1a237ce))
* **Asset Capitalization:** update code for changes in depreciation logic ([dc3c27f](dc3c27fd1b))
* **Asset Capitalization:** validation edge cases ([c311b8e](c311b8ea4f))
* **Asset Captalization:** run_serially on posting_date changed ([132b517](132b517584))
* **Asset:** On Depreciation reversal, remove Journal Entry reference ([e832944](e832944dfe))
* consider posting time for internal transfer PO ([f370c7b](f370c7b50b))
* correct sql output format in CRM patch (backport [#32213](https://github.com/frappe/erpnext/issues/32213)) ([#32215](https://github.com/frappe/erpnext/issues/32215)) ([64aad88](64aad88684))
* create dunning from sales invoice ([17ea6cc](17ea6cc5a5))
* Depreciation posting date only when calculate depreciation is checked ([4939153](4939153f8c))
* disable cwip in asset repair tests ([5cab0aa](5cab0aa1d7))
* fetch description only if empty on the payment schedule ([8876631](887663129e))
* Fetch vouchers to show in Invoice ([f759c29](f759c29d55))
* incorrect gl if tax on multi currency payment entry ([dcfc11d](dcfc11df7a))
* make `po_detail` or `sco_rm_detail` mandatory for SE `Send to Subcontractor` ([908944b](908944b68b))
* merge conflict ([cd613c6](cd613c6033))
* No permission to read doctype ([442f54a](442f54a988))
* Parent Level project linkning on creating PO from project ([cbaffb4](cbaffb4858))
* pending accrual entries ([b9a2499](b9a249918a))
* production plan pending-qty ([5f3caf6](5f3caf6975))
* remove no_copy for ignore_pricing_rule ([c000319](c0003195b8))
* suggestion threshold label and rule was not working for other items with min and max amount ([436b7e3](436b7e3b70))
* TDS deduction via journal entry ([eba46da](eba46dae6c))
* test cases ([f126e88](f126e88e5e))
* test cases ([153ef5f](153ef5f164))
* unknown column error while updating value of maintain-stock in item master ([38488c1](38488c13e6))
* use default supplier currency if default supplier is enabled ([c98413c](c98413c981))
* warehouse filter in `BOM Stock Calculated Report` ([ed9a896](ed9a896f72))

### Features

* Asset Capitalization ([38c3107](38c31077c9))
* Asset Capitalization Form ([6c74896](6c748966e7))
* **Asset Capitalization:** Accounting Fields ([702b5c3](702b5c32c1))
* **Asset Capitalization:** Finance Book field in Asset Row ([3b9bc8e](3b9bc8e4ef))
* **Asset Capitalization:** Submission and Cancellation ([7a5d75b](7a5d75b68d))
2022-09-20 18:31:07 +00:00
Deepesh Garg
08daa237f2 Merge pull request #32292 from frappe/version-14-hotfix
chore: release v14
2022-09-20 23:59:35 +05:30
Sagar Sharma
85cda4a995 Merge pull request #32301 from frappe/mergify/bp/version-14-hotfix/pr-32295
refactor: rewrite `BOM Stock Report` queries in `QB` (backport #32295)
2022-09-20 23:09:25 +05:30
Sagar Sharma
ed9a896f72 fix: warehouse filter in BOM Stock Calculated Report
(cherry picked from commit 390ce5719d)
2022-09-20 17:37:19 +00:00
Sagar Sharma
181dccd8d8 refactor: rewrite BOM Stock Report queries in QB
(cherry picked from commit 8fd7c04920)
2022-09-20 17:37:18 +00:00
ruthra kumar
7554ac9569 fix: get amount in words for debit note
(cherry picked from commit 70f6484d9d)
2022-09-20 12:44:03 +00:00
Deepesh Garg
fcd46aa243 Merge pull request #32294 from frappe/mergify/bp/version-14-hotfix/pr-32284
fix: remove no_copy for ignore_pricing_rule (backport #32284)
2022-09-20 17:16:12 +05:30
Deepesh Garg
d62b983057 chore: Resolve conflicts 2022-09-20 16:45:23 +05:30
Deepesh Garg
b0131a8a80 Merge pull request #32288 from frappe/mergify/bp/version-14-hotfix/pr-32204
fix(UX): More predictable tax withholding application in invoices (backport #32204)
2022-09-20 16:38:44 +05:30
Maharshi Patel
c0003195b8 fix: remove no_copy for ignore_pricing_rule
(cherry picked from commit 8c5b420aea)
2022-09-20 10:50:22 +00:00
Deepesh Garg
957fc440fd Merge pull request #32290 from frappe/mergify/bp/version-14-hotfix/pr-32264
fix: Depreciation posting date only when calculate depreciation is checked (backport #32264)
2022-09-20 15:00:19 +05:30
Deepesh Garg
4939153f8c fix: Depreciation posting date only when calculate depreciation is checked
(cherry picked from commit fac82cf69b)
2022-09-20 09:18:22 +00:00
Deepesh Garg
302f2d10e2 chore: fix tests
(cherry picked from commit 9aa1f84d45)
2022-09-20 09:06:40 +00:00
Deepesh Garg
eba46dae6c fix: TDS deduction via journal entry
(cherry picked from commit 36d0906ea2)
2022-09-20 09:06:40 +00:00
Deepesh Garg
27fdd41a6e test: Add tests
(cherry picked from commit b6184ce471)
2022-09-20 09:06:40 +00:00
Deepesh Garg
f759c29d55 fix: Fetch vouchers to show in Invoice
(cherry picked from commit 3fb1595a4e)
2022-09-20 09:06:40 +00:00
Deepesh Garg
e8076629fa fix: Add child table for tax withheld vouchers
(cherry picked from commit 246c1a9380)
2022-09-20 09:06:39 +00:00
Sagar Sharma
77678ecfeb Merge pull request #32285 from frappe/mergify/bp/version-14-hotfix/pr-32280
refactor: rewrite `Item Shortage Report` queries in QB (backport #32280)
2022-09-20 11:43:55 +05:30
Sagar Sharma
273ed40cfb test: add test cases for Item Shortage Report
(cherry picked from commit 3dc754cac2)
2022-09-20 05:45:04 +00:00
Sagar Sharma
a56b5ed8e5 refactor: rewrite Item Shortage Report queries in QB
(cherry picked from commit f0a78aa559)
2022-09-20 05:45:03 +00:00
ruthra kumar
d7d75be0d7 Merge pull request #32283 from frappe/mergify/bp/version-14-hotfix/pr-32217
fix: incorrect gl if tax on multi currency payment entry (backport #32217)
2022-09-20 11:10:25 +05:30
ruthra kumar
5ba5b7bf51 test: gl entries of payments with advance tax
(cherry picked from commit 5bd5dd7262)
2022-09-20 04:31:10 +00:00
ruthra kumar
dcfc11df7a fix: incorrect gl if tax on multi currency payment entry
(cherry picked from commit f0ae77b23b)
2022-09-20 04:31:10 +00:00
Deepesh Garg
f14b577766 Merge pull request #32278 from frappe/mergify/bp/version-14-hotfix/pr-32235
fix: fetch description only if empty on the payment schedule (backport #32235)
2022-09-20 09:54:17 +05:30
Maharshi Patel
887663129e fix: fetch description only if empty on the payment schedule
added fetch_if_empty on description field of payment_schedule.

(cherry picked from commit f4b64686ae)
2022-09-20 03:44:29 +00:00
Sagar Sharma
327256a516 Merge pull request #32275 from frappe/mergify/bp/version-14-hotfix/pr-32274
fix: `po_detail` or `sco_rm_detail` not getting set while while mapping SE (backport #32274)
2022-09-19 19:46:43 +05:30
Sagar Sharma
ff210c73eb fix: po_detail or sco_rm_detail not getting set while while mapping SE
(cherry picked from commit 3a9c08e7c9)
2022-09-19 13:49:43 +00:00
ruthra kumar
a85dd86832 Merge pull request #32270 from frappe/mergify/bp/version-14-hotfix/pr-32251
fix: use default supplier currency if default supplier is enabled (backport #32251)
2022-09-19 14:04:16 +05:30
ruthra kumar
c98413c981 fix: use default supplier currency if default supplier is enabled
(cherry picked from commit 77fdc37cb7)
2022-09-19 07:33:18 +00:00
Deepesh Garg
198d19b920 Merge pull request #32246 from frappe/mergify/bp/version-14-hotfix/pr-32238
fix: suggestion threshold label and rule was not working for other item with min and max amount (backport #32238)
2022-09-19 10:10:55 +05:30
Deepesh Garg
5a2e286de6 Merge pull request #32255 from frappe/mergify/bp/version-14-hotfix/pr-32244
fix: Parent Level project linkning on creating PO from project (backport #32244)
2022-09-18 19:41:45 +05:30
Sagar Sharma
24ccebc633 Merge pull request #32260 from frappe/mergify/bp/version-14-hotfix/pr-32250
fix: make `po_detail` or `sco_rm_detail` mandatory for SE Send to Subcontractor (backport #32250)
2022-09-18 15:58:48 +05:30
Sagar Sharma
908944b68b fix: make po_detail or sco_rm_detail mandatory for SE Send to Subcontractor
(cherry picked from commit b90875575c)
2022-09-18 09:24:48 +00:00
Deepesh Garg
cbaffb4858 fix: Parent Level project linkning on creating PO from project
(cherry picked from commit 93e134aab0)
2022-09-17 15:00:33 +00:00
Sagar Sharma
7dcb8bb674 Merge pull request #32248 from frappe/mergify/bp/version-14-hotfix/pr-32247
fix: add SCO supplied item reference while mapping the Stock Entry (backport #32247)
2022-09-17 16:09:15 +05:30
Sagar Sharma
a15f0d427c fix: sco_rm_detail in Stock Entry
(cherry picked from commit 2f97370b8e)
2022-09-17 10:12:48 +00:00
Rohit Waghchaure
436b7e3b70 fix: suggestion threshold label and rule was not working for other items with min and max amount
(cherry picked from commit f5bd3fa952)
2022-09-17 06:42:22 +00:00
Sagar Sharma
075d456417 Merge pull request #32240 from frappe/mergify/bp/version-14-hotfix/pr-32236
fix: production plan pending-qty (backport #32236)
2022-09-16 21:31:57 +05:30
Sagar Sharma
ff78906361 test: update test case for production plan pending-qty
(cherry picked from commit bd6af7c613)
2022-09-16 13:00:32 +00:00
Sagar Sharma
5f3caf6975 fix: production plan pending-qty
(cherry picked from commit 5be7d42dfd)
2022-09-16 13:00:31 +00:00
Sagar Sharma
5c09b28d62 Merge pull request #32234 from frappe/mergify/bp/version-14-hotfix/pr-32233
refactor: rewrite Production Plan queries in QB (backport #32233)
2022-09-16 13:57:26 +05:30
Sagar Sharma
b700a0be1f refactor: rewrite Production Plan queries in QB
(cherry picked from commit b8cf3b4c77)
2022-09-16 08:00:08 +00:00
Nabin Hait
cceadcec33 Merge pull request #32231 from frappe/mergify/bp/version-14-hotfix/pr-32225
fix: create dunning from sales invoice (backport #32225)
2022-09-16 13:06:45 +05:30
Nabin Hait
22372e69eb Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-32225 2022-09-16 12:17:14 +05:30
Nabin Hait
88c446b0bf Merge pull request #32232 from nabinhait/asset-repair-test-fix1
fix: disable cwip in asset repair tests
2022-09-16 12:17:01 +05:30
Nabin Hait
5cab0aa1d7 fix: disable cwip in asset repair tests 2022-09-16 11:44:25 +05:30
Nabin Hait
569b4c256a Merge pull request #32230 from frappe/mergify/bp/version-14-hotfix/pr-32219
fix: No permission to read doctype (backport #32219)
2022-09-16 11:37:09 +05:30
Nabin Hait
17ea6cc5a5 fix: create dunning from sales invoice
(cherry picked from commit 29db084dc3)
2022-09-16 05:35:51 +00:00
Nabin Hait
442f54a988 fix: No permission to read doctype
(cherry picked from commit c0da948a4e)
2022-09-16 05:35:29 +00:00
Deepesh Garg
c07e61953a Merge pull request #32228 from frappe/mergify/bp/version-14-hotfix/pr-32222
fix: abbreviation issue on renaming cost center (backport #32222)
2022-09-16 11:03:14 +05:30
Nabin Hait
2102b83bd9 Merge pull request #32229 from frappe/mergify/bp/version-14-hotfix/pr-32221
fix: consider posting time for internal transfer PO (backport #32221)
2022-09-16 09:39:33 +05:30
Rohit Waghchaure
f370c7b50b fix: consider posting time for internal transfer PO
(cherry picked from commit cb763938dc)
2022-09-16 04:08:04 +00:00
Nabin Hait
f752822bb3 fix: abbreviation issue on renaming cost center
(cherry picked from commit af21a11e1e)
2022-09-16 04:07:44 +00:00
Nabin Hait
af5fb78fe2 Merge pull request #32201 from nabinhait/SaiFi0102-asset-capitalization-v14
feat: Asset Capitalization
2022-09-16 09:34:52 +05:30
Sagar Sharma
85cf30cfa8 Merge branch 'version-14-hotfix' into SaiFi0102-asset-capitalization-v14 2022-09-15 08:17:37 +05:30
Frappe PR Bot
14e5f239ac chore(release): Bumped to Version 14.1.2
## [14.1.2](https://github.com/frappe/erpnext/compare/v14.1.1...v14.1.2) (2022-09-14)

### Bug Fixes

* correct sql output format in CRM patch (backport [#32213](https://github.com/frappe/erpnext/issues/32213)) ([#32214](https://github.com/frappe/erpnext/issues/32214)) ([fed2353](fed23536dc))
2022-09-14 13:52:36 +00:00
mergify[bot]
64aad88684 fix: correct sql output format in CRM patch (backport #32213) (#32215)
fix: correct sql output format in CRM patch (#32213)

(cherry picked from commit 97977cdb4b)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-09-14 19:21:40 +05:30
mergify[bot]
fed23536dc fix: correct sql output format in CRM patch (backport #32213) (#32214)
fix: correct sql output format in CRM patch (#32213)

(cherry picked from commit 97977cdb4b)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-09-14 19:21:04 +05:30
Nabin Hait
f126e88e5e fix: test cases 2022-09-14 18:31:15 +05:30
Nabin Hait
3f8c701083 Merge branch 'SaiFi0102-asset-capitalization-v14' of https://github.com/nabinhait/erpnext into SaiFi0102-asset-capitalization-v14 2022-09-14 17:21:57 +05:30
Nabin Hait
153ef5f164 fix: test cases 2022-09-14 17:20:19 +05:30
Deepesh Garg
cbdc46b89e Merge pull request #32210 from frappe/mergify/bp/version-14-hotfix/pr-32208
fix: Loans pending accrual entries (backport #32208)
2022-09-14 15:34:22 +05:30
Abhinav Raut
b9a249918a fix: pending accrual entries
(cherry picked from commit f2209045f8)
2022-09-14 08:45:47 +00:00
Nabin Hait
fb99d3f1b9 Merge branch 'version-14-hotfix' into SaiFi0102-asset-capitalization-v14 2022-09-14 12:56:47 +05:30
Nabin Hait
3b79e24c7e fix: always set default expense account in company 2022-09-14 12:55:49 +05:30
Sagar Sharma
97b462538a Merge pull request #32206 from frappe/mergify/bp/version-14-hotfix/pr-32205
fix: unknown column error while updating value of maintain-stock in item master (backport #32205)
2022-09-14 11:09:05 +05:30
Sagar Sharma
2fe72af359 test: add test case for item master maintain-stock
(cherry picked from commit bf1fa014f4)
2022-09-14 02:44:55 +00:00
Sagar Sharma
38488c13e6 fix: unknown column error while updating value of maintain-stock in item master
(cherry picked from commit 7b878ea3d8)
2022-09-14 02:44:54 +00:00
Frappe PR Bot
740c17c231 chore(release): Bumped to Version 14.1.1
## [14.1.1](https://github.com/frappe/erpnext/compare/v14.1.0...v14.1.1) (2022-09-13)

### Bug Fixes

* AD not getting copied from SCO while creating a Material Transfer ([#32109](https://github.com/frappe/erpnext/issues/32109)) ([09d8fa4](09d8fa4b5d)), closes [#32106](https://github.com/frappe/erpnext/issues/32106)
* add missing warehouse filter in BOM Stock Calculated report ([4e09203](4e09203ddc))
* conflict ([a408722](a408722983))
* consider Stock Entry purpose while getting total supplied qty ([5af0062](5af006278e))
* customer code max characters limit issue ([#32177](https://github.com/frappe/erpnext/issues/32177)) ([93e5100](93e510023a))
* delete linked payment ledger entries no source doc deletion ([ccd0449](ccd0449006))
* drop old notes column from lead and prospect ([ded6e7f](ded6e7f544))
* **Employee:** shorter tab titles (backport [#32192](https://github.com/frappe/erpnext/issues/32192)) ([#32193](https://github.com/frappe/erpnext/issues/32193)) ([027e66f](027e66f637))
* hide "Return of Components" button in closed SCO (backport [#32130](https://github.com/frappe/erpnext/issues/32130)) ([#32131](https://github.com/frappe/erpnext/issues/32131)) ([7840fed](7840fed7a5))
* import error on bank statement import ([467ee97](467ee97938))
* internal transfer flow ([4bac0da](4bac0daf9b))
* inventory dimension filter's label not showing in the reort ([2d2eef6](2d2eef6b29))
* item wise sales register taxes and charges ([53f235b](53f235b630))
* Migrate old lead notes as per the new format ([28b1d4e](28b1d4e2a3))
* option to start reposting from repost item valuation ([6483195](64831952d5))
* pick_list - picked qty getting set to 1 ([3c3ab89](3c3ab897d5))
* promotional scheme min and max amount configuration ([702c16e](702c16eac4))
* QR Code multi currency issue ([d14a9a1](d14a9a1e89))
* Rate for internal PI have non stock UOM items ([c06e241](c06e241fbc))
* remove EmployeeBoardingController (backport [#32139](https://github.com/frappe/erpnext/issues/32139)) ([#32191](https://github.com/frappe/erpnext/issues/32191)) ([944b8a0](944b8a0ed7))
* remove multiple call to ple creation ([a2285d5](a2285d5e5e))
* reposting not working for internal transferred purchase receipt ([7ce6729](7ce6729100))
* require barcode item barcode ([#32111](https://github.com/frappe/erpnext/issues/32111)) ([404668f](404668fcc9)), closes [#31957](https://github.com/frappe/erpnext/issues/31957)
* required_qty in BOM Stock Calculated report ([af883be](af883be065))
* SCO Supplied Items returned-qty ([4568648](4568648d8c))
* Set filter condition and spell in AR ([174c750](174c7503c9))
* status filter for Subcontracting Order in Stock Entry ([844f120](844f120a56))
* Subcontracting Receipt GL Entries (backport [#31918](https://github.com/frappe/erpnext/issues/31918)) ([#32124](https://github.com/frappe/erpnext/issues/32124)) ([f2ab220](f2ab220ce3))
* **UX:** make Item attachments public by default (backport [#32196](https://github.com/frappe/erpnext/issues/32196)) ([#32197](https://github.com/frappe/erpnext/issues/32197)) ([2c4867c](2c4867cc98))
* validate Subcontracting Order in Stock Entry ([d3cc9d4](d3cc9d4fa6))

### Performance Improvements

* lesser SQL queries and no validation ([7bb5f6e](7bb5f6eb23))
2022-09-13 12:13:00 +00:00
Deepesh Garg
5f4b214217 Merge pull request #32199 from frappe/version-14-hotfix
chore: release v14
2022-09-13 17:41:02 +05:30
Deepesh Garg
5b04bebc0a Merge pull request #32198 from frappe/mergify/bp/version-14-hotfix/pr-32190
fix: item wise sales register taxes and charges (backport #32190)
2022-09-13 16:30:59 +05:30
Nabin Hait
38c31077c9 feat: Asset Capitalization
- manual selection of entry type
- GLE cleanup with smaller functions
- GLE considering periodical inventory
- test cases
2022-09-13 16:21:06 +05:30
Nabin Hait
cd613c6033 fix: merge conflict 2022-09-13 16:20:42 +05:30
Deepesh Garg
2e1fb5255e Merge pull request #32195 from frappe/mergify/bp/version-14-hotfix/pr-32091
fix: Migrate old lead notes as per the new format (backport #32091)
2022-09-13 14:41:35 +05:30
Deepesh Garg
9fd8fffb28 Merge pull request #32166 from frappe/mergify/bp/version-14-hotfix/pr-32144
fix: Rate for internal PI have non stock UOM items (backport #32144)
2022-09-13 14:40:31 +05:30
Maharshi Patel
53f235b630 fix: item wise sales register taxes and charges
i have added separate column for other charges. Instead of adding all values to tax_total, it checks if account_type is tax, and then only it adds to total_tax otherwise it adds to the total_other_charges.

(cherry picked from commit 62163ab3d3)
2022-09-13 08:26:13 +00:00
mergify[bot]
2c4867cc98 fix(UX): make Item attachments public by default (backport #32196) (#32197)
fix(UX): make Item attachments public by default (#32196)

(cherry picked from commit fffc245922)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-09-13 13:41:58 +05:30
Deepesh Garg
dda057d257 chore: Resolve conflicts 2022-09-13 13:40:36 +05:30
Nabin Hait
ded6e7f544 fix: drop old notes column from lead and prospect
(cherry picked from commit 4b13452022)
2022-09-13 06:51:27 +00:00
Nabin Hait
7bb5f6eb23 perf: lesser SQL queries and no validation
Co-authored-by: Sagar Vora <sagar@resilient.tech>
(cherry picked from commit 2a100abef1)
2022-09-13 06:51:27 +00:00
Nabin Hait
28b1d4e2a3 fix: Migrate old lead notes as per the new format
(cherry picked from commit 3abd00f3bb)
2022-09-13 06:51:26 +00:00
mergify[bot]
027e66f637 fix(Employee): shorter tab titles (backport #32192) (#32193)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2022-09-13 10:36:12 +05:30
mergify[bot]
944b8a0ed7 fix: remove EmployeeBoardingController (backport #32139) (#32191)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2022-09-13 09:50:36 +05:30
rohitwaghchaure
95da66a201 Merge pull request #32183 from frappe/mergify/bp/version-14-hotfix/pr-32181
fix: promotional scheme min and max amount configuration (backport #32181)
2022-09-13 08:36:54 +05:30
Sagar Sharma
9fbf507877 Merge pull request #32189 from frappe/mergify/bp/version-14-hotfix/pr-32179
fix: pick_list - picked qty getting set to 1 (backport #32179)
2022-09-12 22:42:58 +05:30
Ahmad
3c3ab897d5 fix: pick_list - picked qty getting set to 1
(cherry picked from commit 3256e2b8b7)
2022-09-12 16:50:28 +00:00
Sagar Sharma
60b914b2a6 Merge pull request #32185 from frappe/mergify/bp/version-14-hotfix/pr-32150
refactor: BOM Stock Calculated report, fix required-qty (backport #32150)
2022-09-12 19:49:01 +05:30
Sagar Sharma
581c5cbc38 test: add test cases for BOM Stock Calculated report
(cherry picked from commit e1a98c1ff7)
2022-09-12 13:52:05 +00:00
Sagar Sharma
4e09203ddc fix: add missing warehouse filter in BOM Stock Calculated report
(cherry picked from commit 7a968a5f0d)
2022-09-12 13:52:05 +00:00
Sagar Sharma
af883be065 fix: required_qty in BOM Stock Calculated report
(cherry picked from commit 56192daabf)
2022-09-12 13:52:05 +00:00
Sagar Sharma
08f5f81fa8 refactor: BOM Stock Calculated report
(cherry picked from commit 723fa9eebc)
2022-09-12 13:52:05 +00:00
Rohit Waghchaure
702c16eac4 fix: promotional scheme min and max amount configuration
(cherry picked from commit a8fd92ddc1)
2022-09-12 13:01:02 +00:00
rohitwaghchaure
82440e3124 Merge pull request #32180 from frappe/mergify/bp/version-14-hotfix/pr-32177
fix: customer code max characters limit issue (backport #32177)
2022-09-12 18:28:39 +05:30
rohitwaghchaure
93e510023a fix: customer code max characters limit issue (#32177)
(cherry picked from commit 8f787c08a2)
2022-09-12 11:19:42 +00:00
ruthra kumar
0bc61b3b16 Merge pull request #32176 from frappe/mergify/bp/version-14-hotfix/pr-32175
fix: Set filter condition and spell in AR (backport #32175)
2022-09-12 16:01:41 +05:30
Nihantra C. Patel
174c7503c9 fix: Set filter condition and spell in AR
(cherry picked from commit e2b4ae13fa)
2022-09-12 09:31:27 +00:00
mergify[bot]
3083b4c218 chore: correct license text for GPLv3 (backport #32170) (#32171)
chore: correct license text for GPLv3 (#32170)

[skip ci]

(cherry picked from commit a30f38481d)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-09-12 13:57:49 +05:30
Deepesh Garg
c06e241fbc fix: Rate for internal PI have non stock UOM items
(cherry picked from commit 0f655e4430)

# Conflicts:
#	erpnext/controllers/buying_controller.py
2022-09-12 03:40:43 +00:00
Sagar Sharma
a9e9dad66a Merge pull request #32162 from frappe/mergify/bp/version-14-hotfix/pr-32161
refactor: rewrite Process Loss Report queries in QB (backport #32161)
2022-09-11 20:06:52 +05:30
Sagar Sharma
86e5f362e3 refactor: rewrite Process Loss Report queries in QB
(cherry picked from commit 5245928648)
2022-09-11 14:18:22 +00:00
ruthra kumar
7cc98181ec Merge pull request #32157 from frappe/mergify/bp/version-14-hotfix/pr-32137
refactor(minor): delete linked payment ledger entries on source doc deletion (backport #32137)
2022-09-11 13:41:12 +05:30
ruthra kumar
1ea778a77b Merge pull request #32158 from frappe/mergify/bp/version-14-hotfix/pr-32156
fix: remove duplicate call to ple creation (backport #32156)
2022-09-11 12:43:45 +05:30
ruthra kumar
a2285d5e5e fix: remove multiple call to ple creation
(cherry picked from commit 4adc372f9a)
2022-09-11 06:51:50 +00:00
ruthra kumar
ccd0449006 fix: delete linked payment ledger entries no source doc deletion
(cherry picked from commit 70313df531)
2022-09-11 06:37:22 +00:00
Sagar Sharma
793ee83f39 Merge pull request #32154 from frappe/mergify/bp/version-14-hotfix/pr-32153
refactor: rewrite Work Order Stock Report queries in QB (backport #32153)
2022-09-10 17:16:44 +05:30
Sagar Sharma
9203217678 refactor: rewrite Work Order Stock Report queries in QB
(cherry picked from commit d4c4dddfc3)
2022-09-10 11:21:27 +00:00
rohitwaghchaure
3c1c50f171 Merge pull request #32141 from frappe/mergify/bp/version-14-hotfix/pr-32135
fix: reposting not working for internal transferred purchase receipt (backport #32135)
2022-09-10 16:40:51 +05:30
rohitwaghchaure
a408722983 fix: conflict 2022-09-09 22:44:10 +05:30
Deepesh Garg
16502b30a0 Merge pull request #32148 from frappe/mergify/bp/version-14-hotfix/pr-32110
fix: error on bank statement import (backport #32110)
2022-09-09 17:16:58 +05:30
Sagar Sharma
61a1b2b42b Merge pull request #32147 from frappe/mergify/bp/version-14-hotfix/pr-32145
fix: validate Subcontracting Order Status in Stock Entry (backport #32145)
2022-09-09 17:06:28 +05:30
ruthra kumar
467ee97938 fix: import error on bank statement import
Name collision between frameworks file importer's internal log and
doctype fieldname - import_log.

Frameworks internal log overrode, doctypes field which caused failure
in basic fieldtype validation.

(cherry picked from commit a6fbb80b94)
2022-09-09 09:31:25 +00:00
Sagar Sharma
d3cc9d4fa6 fix: validate Subcontracting Order in Stock Entry
(cherry picked from commit 9a3dcb9ad1)
2022-09-09 09:26:08 +00:00
Sagar Sharma
844f120a56 fix: status filter for Subcontracting Order in Stock Entry
(cherry picked from commit 30909a9b79)
2022-09-09 09:26:08 +00:00
Sagar Sharma
8be12f0858 Merge pull request #32143 from frappe/mergify/bp/version-14-hotfix/pr-32102
fix: consider Stock Entry purpose while getting total supplied qty (backport #32102)
2022-09-09 12:35:47 +05:30
Sagar Sharma
5af006278e fix: consider Stock Entry purpose while getting total supplied qty
(cherry picked from commit 2f00413864)
2022-09-09 06:44:26 +00:00
Rohit Waghchaure
7ce6729100 fix: reposting not working for internal transferred purchase receipt
(cherry picked from commit a03b4ce213)

# Conflicts:
#	erpnext/stock/stock_ledger.py
2022-09-09 04:01:23 +00:00
Sagar Sharma
c4c43bc550 Merge pull request #32134 from frappe/mergify/bp/version-14-hotfix/pr-32128
fix: SCO Supplied Items returned-qty (backport #32128)
2022-09-08 19:59:23 +05:30
Sagar Sharma
62741bf744 test: add test case for returned-qty
(cherry picked from commit aea7188304)
2022-09-08 13:31:38 +00:00
Sagar Sharma
4568648d8c fix: SCO Supplied Items returned-qty
(cherry picked from commit ccb2889cac)
2022-09-08 13:31:38 +00:00
mergify[bot]
7840fed7a5 fix: hide "Return of Components" button in closed SCO (backport #32130) (#32131)
fix: hide "Return of Components" button in closed SCO (#32130)

(cherry picked from commit 3585daab95)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-09-08 18:25:27 +05:30
Sagar Sharma
f2ab220ce3 fix: Subcontracting Receipt GL Entries (backport #31918) (#32124)
fix: Subcontracting Receipt GL Entries
2022-09-08 11:18:00 +05:30
rohitwaghchaure
9b6dd7e71f Merge pull request #32120 from rohitwaghchaure/backport-provision-to-manual-reposting
fix: option to start reposting from repost item valuation
2022-09-07 18:05:38 +05:30
Rohit Waghchaure
64831952d5 fix: option to start reposting from repost item valuation 2022-09-07 18:04:43 +05:30
rohitwaghchaure
d53fd8c592 Merge pull request #32119 from rohitwaghchaure/backport-fixed-label-not-showing-for-filter
fix: inventory dimension filter's label not showing in the reort
2022-09-07 18:03:51 +05:30
Rohit Waghchaure
2d2eef6b29 fix: inventory dimension filter's label not showing in the reort 2022-09-07 18:02:41 +05:30
rohitwaghchaure
c313c37006 Merge pull request #32114 from rohitwaghchaure/backport-fixed-internal-transfer-flow
fix: backport fixed internal transfer flow
2022-09-07 15:44:01 +05:30
Rohit Waghchaure
a00bc2967e test: added test case for internal transfer 2022-09-07 14:29:21 +05:30
Rohit Waghchaure
4bac0daf9b fix: internal transfer flow 2022-09-07 14:29:15 +05:30
Sagar Sharma
404668fcc9 fix: require barcode item barcode (#32111)
fix: require barcode item barcode. (#31957)

* fix: require barcode item barcode.

* fix: make supplier mandatory in Item Supplier DocType

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>

Co-authored-by: Devin Slauenwhite <devin.slauenwhite@gmail.com>
2022-09-07 14:24:12 +05:30
Sagar Sharma
09d8fa4b5d fix: AD not getting copied from SCO while creating a Material Transfer (#32109)
fix: AD not getting copied from SCO while creating a Material Transfer (#32106)
2022-09-07 12:42:12 +05:30
Deepesh Garg
354aaae587 Merge pull request #32088 from frappe/mergify/bp/version-14-hotfix/pr-32086
fix: QR Code multi currency issue (backport #32086)
2022-09-07 07:46:41 +05:30
Frappe PR Bot
7235c3f88f chore(release): Bumped to Version 14.1.0
# [14.1.0](https://github.com/frappe/erpnext/compare/v14.0.3...v14.1.0) (2022-09-06)

### Bug Fixes

* **Appointment:** create lead notes as child table ([00a73c7](00a73c7a57))
* fetch from parent not working for custom field ([76ae4d8](76ae4d87ca))
* force delete old report docs (backport [#32026](https://github.com/frappe/erpnext/issues/32026)) ([#32027](https://github.com/frappe/erpnext/issues/32027)) ([0e9a1fb](0e9a1fb40e))
* include payment against PO in AR/AP report ([4bbd0ec](4bbd0ec985))
* incorrect import parameter for cancel PDA ([f55881a](f55881aef8))
* key error on consolidated financial report ([4409f11](4409f11282))
* KSA VAT report multi currency amount issue ([b96526e](b96526eefd))
* Loan Interest accruals for 0 rated loans ([1b9082e](1b9082e07b))
* Naming series in Journal Entry Template ([5520c6b](5520c6b2f3))
* not able to make variant item ([f871dd4](f871dd4ef6))
* **pos:** error while consolidating pos invoices ([319ee41](319ee41403))
* remove spaces and order import ([055556b](055556b7f1))
* upgrade process to version-14 when currency opportunity wass not set ([4cb685a](4cb685a326))
* validate available qty for consumption in SCR ([26536da](26536da74b))

### Features

* better Item Price list view ([#31954](https://github.com/frappe/erpnext/issues/31954)) ([784fb47](784fb47197))
* tabbed view for Employee form ([#31940](https://github.com/frappe/erpnext/issues/31940)) ([#32095](https://github.com/frappe/erpnext/issues/32095)) ([3c688df](3c688dfa6d))
* two new filters for gross profit ([60fa421](60fa421409))
2022-09-06 16:04:45 +00:00
Deepesh Garg
15733c14e8 Merge pull request #32101 from frappe/version-14-hotfix
chore: version-14 weekly release
2022-09-06 21:31:39 +05:30
rohitwaghchaure
22b2386aa1 Merge pull request #32097 from rohitwaghchaure/backport-fixed-fetch-from-parent
fix: fetch from parent
2022-09-06 12:59:37 +05:30
Rohit Waghchaure
6ab0637b0b test: test cases for PI and DN 2022-09-06 11:54:56 +05:30
Rohit Waghchaure
76ae4d87ca fix: fetch from parent not working for custom field 2022-09-06 11:54:48 +05:30
Rucha Mahabal
3c688dfa6d feat: tabbed view for Employee form (#31940) (#32095) 2022-09-06 11:04:13 +05:30
Sagar Sharma
8b8d054ded Merge pull request #32090 from frappe/mergify/bp/version-14-hotfix/pr-32082
fix: validate available qty for consumption in SCR (backport #32082)
2022-09-05 14:49:35 +05:30
Sagar Sharma
121ec83562 refactor(test): test_update_reserved_qty_for_subcontracting
(cherry picked from commit a349b58306)
2022-09-05 08:50:29 +00:00
Sagar Sharma
26536da74b fix: validate available qty for consumption in SCR
(cherry picked from commit 4a7add2169)
2022-09-05 08:50:28 +00:00
Nabin Hait
f605564094 Merge pull request #32087 from frappe/mergify/bp/version-14-hotfix/pr-32061
fix(Appointment): create lead notes as child table (backport #32061)
2022-09-05 12:56:00 +05:30
hamzaali15
d14a9a1e89 fix: QR Code multi currency issue
When try to scan qr code on app it is showing correct values for multi currencies because it is not getting base amount

(cherry picked from commit b10a2b87b6)
2022-09-05 07:13:08 +00:00
Sagar Vora
b7e8fbe43f test: dont create lead manually, add coverage for notes
(cherry picked from commit 875ff15109)
2022-09-05 06:56:48 +00:00
Sagar Vora
00a73c7a57 fix(Appointment): create lead notes as child table
(cherry picked from commit 58e553151e)
2022-09-05 06:56:47 +00:00
Deepesh Garg
edb100274b Merge pull request #32080 from frappe/mergify/bp/version-14-hotfix/pr-31982
fix: upgrade process to version-14 when currency opportunity was not set (backport #31982)
2022-09-04 22:39:01 +05:30
Deepesh Garg
6976316ada chore: fix message
(cherry picked from commit 118b0c0f86)
2022-09-04 13:34:32 +00:00
Florian HENRY
357f74a580 chore: better text
(cherry picked from commit d19b664ba9)
2022-09-04 13:34:32 +00:00
Florian HENRY
aedd0397b8 chore: remove debug
(cherry picked from commit ac66538651)
2022-09-04 13:34:32 +00:00
Florian HENRY
4cb685a326 fix: upgrade process to version-14 when currency opportunity wass not set
(cherry picked from commit 9d02fbadb4)
2022-09-04 13:34:31 +00:00
Deepesh Garg
afcc0cbccd Merge pull request #32079 from frappe/mergify/bp/version-14-hotfix/pr-31954
feat: better Item Price list view (backport #31954)
2022-09-04 18:15:25 +05:30
Deepesh Garg
29bca45b1e Merge pull request #32077 from frappe/mergify/bp/version-14-hotfix/pr-32045
fix: Naming series in Journal Entry Template (backport #32045)
2022-09-04 18:14:56 +05:30
HENRY Florian
784fb47197 feat: better Item Price list view (#31954)
* feat: better Item Price list view

(cherry picked from commit 86395c6adb)
2022-09-04 12:39:04 +00:00
Solufyin
5520c6b2f3 fix: Naming series in Journal Entry Template
(cherry picked from commit 2085626390)
2022-09-04 11:05:07 +00:00
Deepesh Garg
f873547447 Merge pull request #32074 from frappe/mergify/bp/version-14-hotfix/pr-31850
feat: two new filters for gross profit (backport #31850)
2022-09-04 16:21:54 +05:30
Deepesh Garg
d65d2f617d Merge pull request #32071 from frappe/mergify/bp/version-14-hotfix/pr-32053
fix: KSA VAT report multi currency amount issue (backport #32053)
2022-09-04 15:58:50 +05:30
Deepesh Garg
0438433a4f chore: Linting Issues
(cherry picked from commit ad8d0efa29)
2022-09-04 10:27:23 +00:00
hrzzz
055556b7f1 fix: remove spaces and order import
(cherry picked from commit 3ef551872a)
2022-09-04 10:27:23 +00:00
hrzzz
60fa421409 feat: two new filters for gross profit
(cherry picked from commit 27891ecb77)
2022-09-04 10:27:23 +00:00
Deepesh Garg
dd2fd12d5f Merge pull request #32073 from frappe/mergify/bp/version-14-hotfix/pr-31822
fix(pos): error while consolidating pos invoices (backport #31822)
2022-09-04 15:57:09 +05:30
Saqib Ansari
319ee41403 fix(pos): error while consolidating pos invoices
(cherry picked from commit 33762dbbac)
2022-09-04 07:56:31 +00:00
hamzaali15
b96526eefd fix: KSA VAT report multi currency amount issue
In KSA VAT report amount is not showing correctly for multi currencies because net_amount field is fetched instead of base_net_amount

(cherry picked from commit 56d8962e40)
2022-09-04 07:43:32 +00:00
rohitwaghchaure
78a992c086 Merge pull request #32066 from frappe/mergify/bp/version-14-hotfix/pr-32065
fix: not able to make variant item (backport #32065)
2022-09-03 11:53:48 +05:30
Rohit Waghchaure
f871dd4ef6 fix: not able to make variant item
(cherry picked from commit 92b0f9cd7e)
2022-09-03 06:23:27 +00:00
ruthra kumar
79ecf7751f Merge pull request #32060 from frappe/mergify/bp/version-14-hotfix/pr-32054
fix: type error on cancellation of Process Deferred Accounting (backport #32054)
2022-09-02 17:10:34 +05:30
ruthra kumar
4698dba402 test: pda document submission and cancellation
(cherry picked from commit 1c385541fa)
2022-09-02 11:15:32 +00:00
ruthra kumar
f55881aef8 fix: incorrect import parameter for cancel PDA
(cherry picked from commit 08f2e4edc3)
2022-09-02 11:15:31 +00:00
ruthra kumar
f1b2ba5a84 Merge pull request #32058 from frappe/mergify/bp/version-14-hotfix/pr-32052
fix: key error on consolidated financial report (backport #32052)
2022-09-02 16:41:08 +05:30
ruthra kumar
4409f11282 fix: key error on consolidated financial report
accounts with same name but different account number will throw key
error on consolidated report

(cherry picked from commit 6e8395cccd)
2022-09-02 10:46:42 +00:00
ruthra kumar
84865a8421 Merge pull request #32055 from frappe/mergify/bp/version-14-hotfix/pr-31942
fix: include payment against PO in AR/AP report (backport #31942)
2022-09-02 14:58:25 +05:30
ruthra kumar
d9632e8138 test: payments against so/po will show up as outstanding amount
1. Class will use FrappeTestCase fixture
2. setup and teardown methods are introduced
3. test for payments against SO

(cherry picked from commit 36f5883dda)
2022-09-02 08:15:36 +00:00
ruthra kumar
4bbd0ec985 fix: include payment against PO in AR/AP report
(cherry picked from commit fdd167cac1)
2022-09-02 08:15:36 +00:00
mergify[bot]
92f8f0ec74 chore: set BOM as default value for Backflush Raw Materials of Subcontract Based On (backport #32048) (#32050)
chore: set BOM as default value for Backflush Raw Materials of Subcontract Based On (#32048)

chore: set BOM as default value for Backflush Raw Materials of Subcontract Based On in Buying Settings
(cherry picked from commit 68907ca783)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-09-02 09:10:17 +05:30
Deepesh Garg
aea484be1f Merge pull request #32032 from frappe/mergify/bp/version-14-hotfix/pr-32030
fix: Loan Interest accruals for 0 rated loans (backport #32030)
2022-08-31 21:04:38 +05:30
Deepesh Garg
52fc10d00c chore: Add check for principal amount
(cherry picked from commit a76d3827ec)
2022-08-30 15:47:11 +00:00
Deepesh Garg
1b9082e07b fix: Loan Interest accruals for 0 rated loans
(cherry picked from commit eefc9b7172)
2022-08-30 15:47:11 +00:00
mergify[bot]
0e9a1fb40e fix: force delete old report docs (backport #32026) (#32027)
fix: force delete old report docs (#32026)

(cherry picked from commit ffa3071d36)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-08-30 15:46:08 +05:30
Frappe PR Bot
32abf67c80 chore(release): Bumped to Version 14.0.3
## [14.0.3](https://github.com/frappe/erpnext/compare/v14.0.2...v14.0.3) (2022-08-30)

### Bug Fixes

* AD not getting copied from SCO while creating a SE (backport [#32004](https://github.com/frappe/erpnext/issues/32004)) ([#32007](https://github.com/frappe/erpnext/issues/32007)) ([cee867f](cee867f941))
* Add docstatus filter for voucher_no in Repost Item Valuation ([309da96](309da96442))
* add validation for PO in Stock Entry (backport [#31974](https://github.com/frappe/erpnext/issues/31974)) ([#31975](https://github.com/frappe/erpnext/issues/31975)) ([4d8ced6](4d8ced6c87))
* default supplier not set in the PP ([4cf9fb0](4cf9fb08e1))
* display amount in account currency if party is supplied ([15915d7](15915d7053))
* Explicitly commit "log_error" since its getting called during GET request (backport [#31952](https://github.com/frappe/erpnext/issues/31952)) ([#31953](https://github.com/frappe/erpnext/issues/31953)) ([362976f](362976fa42))
* gl entries for asset repair ([f0f7afa](f0f7afa669))
* lost quotation not to expired ([8717235](8717235a34))
* material request connection on work order ([193502c](193502ce03))
* **patch:** update sla doctype directly (backport [#32014](https://github.com/frappe/erpnext/issues/32014)) ([#32015](https://github.com/frappe/erpnext/issues/32015)) ([1b5a1cb](1b5a1cbaad))
* permissions for Task Type ([#32016](https://github.com/frappe/erpnext/issues/32016)) ([7ca1beb](7ca1beb15d))
* Purchase Order creation from Sales Order ([39ff0cc](39ff0cc6d8))
* Purposes not set ([94ebfa7](94ebfa765c))
* restrict party types to Supplier/Customer for AR/AP report ([c407d1e](c407d1e51a))
* Rounded total for cash and non trade discount invoices ([6c4fcd8](6c4fcd80c6))
* Route condition set for stock ledger (backport [#31935](https://github.com/frappe/erpnext/issues/31935)) ([#31945](https://github.com/frappe/erpnext/issues/31945)) ([a7d23ab](a7d23abc2f))
2022-08-30 09:24:00 +00:00
Deepesh Garg
52b42e9492 Merge pull request #32025 from frappe/version-14-hotfix
chore: weekly version-14 release
2022-08-30 14:52:11 +05:30
Deepesh Garg
77ac7f06d4 Merge pull request #32021 from frappe/mergify/bp/version-14-hotfix/pr-32005
fix: lost quotation not to expired (backport #32005)
2022-08-30 11:08:40 +05:30
MOHAMMED NIYAS
8717235a34 fix: lost quotation not to expired
(cherry picked from commit 69ffef8c0e)
2022-08-30 05:03:44 +00:00
Deepesh Garg
670426f428 Merge pull request #32017 from frappe/mergify/bp/version-14-hotfix/pr-32016
fix: permissions for Task Type (backport #32016)
2022-08-30 08:38:14 +05:30
mergify[bot]
1b5a1cbaad fix(patch): update sla doctype directly (backport #32014) (#32015)
fix(patch): update sla doctype directly (#32014)

fix: update sla doctype directly
(cherry picked from commit 2d41704424)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-08-29 22:17:39 +05:30
Raffael Meyer
7ca1beb15d fix: permissions for Task Type (#32016)
(cherry picked from commit 73f4d5931d)
2022-08-29 16:27:00 +00:00
ruthra kumar
c660db145b Merge pull request #32013 from frappe/mergify/bp/version-14-hotfix/pr-32009
refactor: readd remarks field to payment ledger (backport #32009)
2022-08-29 20:21:43 +05:30
ruthra kumar
0aaf9c4f05 chore: add remarks migration to patches.txt
(cherry picked from commit d522f13d55)
2022-08-29 19:52:33 +05:30
ruthra kumar
b3b0272ec9 chore: patch for migrating remarks to payment ledger
(cherry picked from commit 3a6b095ed4)
2022-08-29 14:19:46 +00:00
ruthra kumar
f7898b4954 refactor: re-add remarks field to payment ledger and AR/AP report
(cherry picked from commit 5782c4469a)
2022-08-29 14:19:46 +00:00
Deepesh Garg
b067eae38c Merge pull request #32008 from frappe/mergify/bp/version-14-hotfix/pr-32006
fix: Rounded total for cash and non trade discount invoices (backport #32006)
2022-08-29 17:46:14 +05:30
mergify[bot]
cee867f941 fix: AD not getting copied from SCO while creating a SE (backport #32004) (#32007)
fix: AD not getting copied from SCO while creating a SE (#32004)

(cherry picked from commit 9dbaaa33f5)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-29 15:50:22 +05:30
Deepesh Garg
6c4fcd80c6 fix: Rounded total for cash and non trade discount invoices
(cherry picked from commit 318da16b99)
2022-08-29 10:06:08 +00:00
Deepesh Garg
11657effa5 Merge pull request #31970 from frappe/mergify/bp/version-14-hotfix/pr-31955
chore: update french translation (backport #31955)
2022-08-28 11:32:54 +05:30
Deepesh Garg
d3b7942f32 Merge pull request #31979 from frappe/mergify/bp/version-14-hotfix/pr-31977
fix: restrict party types to Supplier/Customer for AR/AP report (backport #31977)
2022-08-28 11:25:00 +05:30
mergify[bot]
f407c972d1 chore: allow return of components in SCO (backport #31994) (#31995)
chore: allow return of components in SCO (#31994)

chore: allow return of components in sco
(cherry picked from commit af5cbc881f)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-26 23:15:20 +05:30
Deepesh Garg
0b72295fa2 Merge pull request #31990 from frappe/mergify/bp/version-14-hotfix/pr-31988
chore: remove precision on discount_percentage of Sales Invoice Item (backport #31988)
2022-08-26 18:09:26 +05:30
Deepesh Garg
204b6c0272 Merge pull request #31973 from frappe/mergify/bp/version-14-hotfix/pr-31943
fix: gl entries for asset repair (backport #31943)
2022-08-26 17:34:57 +05:30
Deepesh Garg
1118e25b6d Merge pull request #31985 from frappe/mergify/bp/version-14-hotfix/pr-31984
fix: Purchase Order creation from Sales Order (backport #31984)
2022-08-26 16:05:01 +05:30
ruthra kumar
9b9df70632 chore: remove precision on discount_percentage of Sales Invoice Item
(cherry picked from commit c42fef541a)
2022-08-26 10:34:50 +00:00
Solufyin
39ff0cc6d8 fix: Purchase Order creation from Sales Order
(cherry picked from commit bd4b4ddd8b)
2022-08-26 06:31:51 +00:00
ruthra kumar
c407d1e51a fix: restrict party types to Supplier/Customer for AR/AP report
(cherry picked from commit 6aa8fd0f7b)
2022-08-25 10:50:46 +00:00
mergify[bot]
4d8ced6c87 fix: add validation for PO in Stock Entry (backport #31974) (#31975)
fix: add validation for PO in Stock Entry (#31974)

(cherry picked from commit 8566832dd5)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-25 15:29:48 +05:30
Deepesh Garg
4f832678cf chore: fix against account
(cherry picked from commit c1f6dd46d1)
2022-08-25 07:55:08 +00:00
Nabin Hait
f0f7afa669 fix: gl entries for asset repair
(cherry picked from commit b4a2eb2e65)
2022-08-25 07:55:08 +00:00
Florian HENRY
cb6cbf7818 chore: update fr translation
(cherry picked from commit 299da5d596)
2022-08-25 07:37:06 +00:00
Florian HENRY
3aec1175df chore: update fr translation
(cherry picked from commit 1f6f2747d4)
2022-08-25 07:37:06 +00:00
Florian HENRY
c645995ae3 chore: update french translation
(cherry picked from commit 264f98af14)
2022-08-25 07:37:05 +00:00
rohitwaghchaure
f772c17f3f Merge pull request #31969 from frappe/mergify/bp/version-14-hotfix/pr-31967
fix: material request connection on work order (backport #31967)
2022-08-25 12:30:25 +05:30
Rohit Waghchaure
193502ce03 fix: material request connection on work order
(cherry picked from commit 9ab10def49)
2022-08-25 06:59:56 +00:00
rohitwaghchaure
abd637a238 Merge pull request #31968 from frappe/mergify/bp/version-14-hotfix/pr-31966
fix: default supplier not set in the PP (backport #31966)
2022-08-25 12:26:47 +05:30
Rohit Waghchaure
4cf9fb08e1 fix: default supplier not set in the PP
(cherry picked from commit 5fd468d9ec)
2022-08-25 06:55:46 +00:00
Deepesh Garg
e4ca20654f Merge pull request #31964 from frappe/mergify/bp/version-14-hotfix/pr-31909
fix: Add docstatus filter for voucher_no in Repost Item Valuation (backport #31909)
2022-08-25 11:25:02 +05:30
Deepesh Garg
bc873939eb Merge pull request #31959 from frappe/mergify/bp/version-14-hotfix/pr-31934
refactor: disable discount accounting on Buying module(PI) (backport #31934)
2022-08-25 11:06:58 +05:30
Deepesh Garg
c6d3e9f432 Merge pull request #31958 from frappe/mergify/bp/version-14-hotfix/pr-31950
fix: display amount in account currency if party is supplied (backport #31950)
2022-08-25 11:06:42 +05:30
rohitwaghchaure
54f4504df6 Merge pull request #31963 from frappe/mergify/bp/version-14-hotfix/pr-31951
fix: Purposes not set in Maintenance Visit (backport #31951)
2022-08-25 10:50:50 +05:30
Sagar Sharma
309da96442 fix: Add docstatus filter for voucher_no in Repost Item Valuation
(cherry picked from commit 520306dc87)
2022-08-25 05:20:26 +00:00
Rohit Waghchaure
94ebfa765c fix: Purposes not set
(cherry picked from commit f9a7b31b5b)
2022-08-25 05:19:53 +00:00
ruthra kumar
2577747c5c test: remove discount accounting tests
(cherry picked from commit 277ef04b60)
2022-08-25 05:04:46 +00:00
ruthra kumar
fb387426d6 refactor: disable discount accounting on Buying module(PI)
(cherry picked from commit a956e20f29)
2022-08-25 05:04:46 +00:00
ruthra kumar
15915d7053 fix: display amount in account currency if party is supplied
(cherry picked from commit e5b04d54ff)
2022-08-25 05:04:27 +00:00
mergify[bot]
362976fa42 fix: Explicitly commit "log_error" since its getting called during GET request (backport #31952) (#31953)
fix: Explicitly commit "log_error" since its getting called during GET request (#31952)

(cherry picked from commit 122f1c0ced)

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
2022-08-24 18:26:08 +05:30
mergify[bot]
a7d23abc2f fix: Route condition set for stock ledger (backport #31935) (#31945)
fix: Route condition set for stock ledger (#31935)

(cherry picked from commit 0e26df331c)

Co-authored-by: Solufyin <34390782+Solufyin@users.noreply.github.com>
2022-08-24 13:30:25 +05:30
mergify[bot]
4b609322ba chore: add Work Order test dependencies (backport #31936) (#31937)
chore: add Work Order test dependencies (#31936)

(cherry picked from commit fe73d55f70)

Co-authored-by: HENRY Florian <florian.henry@open-concept.pro>
2022-08-23 16:09:26 +05:30
Frappe PR Bot
5778f227ee chore(release): Bumped to Version 14.0.2
## [14.0.2](https://github.com/frappe/erpnext/compare/v14.0.1...v14.0.2) (2022-08-23)

### Bug Fixes

* additional-cost in items table ([da69cc5](da69cc5477))
* base_amount and exchange_rate in additional-cost table ([d48487a](d48487ada2))
* Cash and non trade discount calculation ([b6d2de2](b6d2de2cc1))
* don't allow to create SCR directly (backport [#31924](https://github.com/frappe/erpnext/issues/31924)) ([#31926](https://github.com/frappe/erpnext/issues/31926)) ([0bfb774](0bfb774bdf))
* incorrect buying amount in Gross Profit rpt ([981add9](981add9b6f))
* incorrect tax amt due to different exchange rate in PR and PI ([a767326](a76732613e))
* limited options for no-of-employees in crm ([735a608](735a60807a))
* make rate field read-only in subcontracting receipt item (backport [#31905](https://github.com/frappe/erpnext/issues/31905)) ([#31906](https://github.com/frappe/erpnext/issues/31906)) ([6be77d5](6be77d5729))
* map old data as per new options of no-of-employees ([35e9bfc](35e9bfca38))
* **pos:** edge case while closing pos ([#31892](https://github.com/frappe/erpnext/issues/31892)) ([200a971](200a971743))
* process loan interest accrual ([66e5202](66e5202642))
* recalculate rate of items based on "Recalculate Rate" checkbox ([9e60dd3](9e60dd32e8))
* TDS calculation for advance payment ([78b39d6](78b39d6ca4))
* term loan interest calculation ([8fdbbf3](8fdbbf374d))
* test "test_pending_and_received_qty" ([e099e10](e099e10c8e))
* Test cases ([3afb625](3afb625ff8))
* Unable to make payment entry against Fees using education app ([1aa96de](1aa96defda))

### Performance Improvements

* use `create_custom_fields` ([#31853](https://github.com/frappe/erpnext/issues/31853)) ([6656d23](6656d23e45))
2022-08-23 05:28:37 +00:00
Deepesh Garg
7ac75aab1a Merge pull request #31932 from frappe/version-14-hotfix
chore: weekly version 14 release
2022-08-23 10:57:10 +05:30
Deepesh Garg
e831b6e054 Merge pull request #31930 from frappe/mergify/bp/version-14-hotfix/pr-31910
fix: Cash and non trade discount calculation (backport #31910)
2022-08-23 10:36:15 +05:30
Deepesh Garg
856a64b77c chore: Linting issues
(cherry picked from commit 1cb7ae16ab)
2022-08-23 04:49:57 +00:00
Deepesh Garg
3afb625ff8 fix: Test cases
(cherry picked from commit ae3dce0cbd)
2022-08-23 04:49:57 +00:00
Deepesh Garg
b6d2de2cc1 fix: Cash and non trade discount calculation
(cherry picked from commit 3b15966cc9)
2022-08-23 04:49:57 +00:00
mergify[bot]
0bfb774bdf fix: don't allow to create SCR directly (backport #31924) (#31926)
fix: don't allow to create SCR directly (#31924)

(cherry picked from commit bf5c43322a)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-22 18:38:21 +05:30
Deepesh Garg
d7a8db04a1 Merge pull request #31916 from frappe/mergify/bp/version-14-hotfix/pr-31856
fix: incorrect tax amt due to different exchange rate in PR and PI (backport #31856)
2022-08-22 10:57:53 +05:30
Deepesh Garg
2d5ae811d2 Merge pull request #31917 from frappe/mergify/bp/version-14-hotfix/pr-31871
fix: incorrect buying amount in Gross Profit rpt (backport #31871)
2022-08-22 10:56:47 +05:30
Deepesh Garg
be9607e27b Merge pull request #31915 from frappe/mergify/bp/version-14-hotfix/pr-31894
fix: TDS calculation for advance payment (backport #31894)
2022-08-22 10:32:04 +05:30
Deepesh Garg
fd45a7afbe Merge pull request #31818 from frappe/mergify/bp/version-14-hotfix/pr-31816
fix: limited options for no-of-employees in the crm documents (backport #31816)
2022-08-22 10:31:06 +05:30
Deepesh Garg
0c73af6ee2 Merge pull request #31809 from frappe/mergify/bp/version-14-hotfix/pr-31801
Tds report (backport #31801)
2022-08-22 10:30:42 +05:30
ruthra kumar
981add9b6f fix: incorrect buying amount in Gross Profit rpt
(cherry picked from commit 967dd398e7)
2022-08-22 05:00:26 +00:00
Deepesh Garg
8f5736c500 Merge pull request #31832 from frappe/mergify/bp/version-14-hotfix/pr-31830
fix: Unable to make payment entry against Fees using education app (backport #31830)
2022-08-22 10:29:26 +05:30
Deepesh Garg
052f7c3345 Merge pull request #31827 from frappe/mergify/bp/version-14-hotfix/pr-31799
fix: process loan interest accrual (backport #31799)
2022-08-22 10:28:50 +05:30
Deepesh Garg
fa4a40812c Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-31816 2022-08-22 09:09:16 +05:30
ruthra kumar
a76732613e fix: incorrect tax amt due to different exchange rate in PR and PI
(cherry picked from commit 5fd0770372)
2022-08-22 03:38:43 +00:00
Deepesh Garg
dd602989a8 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-31801 2022-08-22 09:00:36 +05:30
Maharshi Patel
78b39d6ca4 fix: TDS calculation for advance payment
"against_voucher": ["is", "not set"] was used in query due to which if TDS was added on "advance" payment vouchers and then reconciled against purchase invoice. it will not find those vouchers and consider this as first-time threshold due to which it will calculate Tax for all transactions.

(cherry picked from commit a452143782)
2022-08-22 03:30:04 +00:00
Deepesh Garg
77fa64e100 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-31799 2022-08-22 08:59:57 +05:30
Deepesh Garg
ac04fc60ef Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-31830 2022-08-22 08:59:31 +05:30
mergify[bot]
6be77d5729 fix: make rate field read-only in subcontracting receipt item (backport #31905) (#31906)
fix: make rate field read-only in subcontracting receipt item (#31905)

(cherry picked from commit 588ca68171)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-20 19:28:21 +05:30
Sagar Sharma
37e5b93e2d Merge pull request #31900 from frappe/mergify/bp/version-14-hotfix/pr-31899
fix: repost item valuation for subcontracting receipt  (backport #31899)
2022-08-19 22:41:28 +05:30
Sagar Sharma
19d29d1861 chore: add option for "Subcontracting Receipt" in "Voucher Type"
(cherry picked from commit f92f3e0208)
2022-08-19 16:31:53 +00:00
Sagar Sharma
0db912998a chore: allow subcontracting receipt backdated entry
(cherry picked from commit f8c11847bb)
2022-08-19 16:31:53 +00:00
mergify[bot]
200a971743 fix(pos): edge case while closing pos (#31892) 2022-08-19 17:11:13 +05:30
Sagar Sharma
c0f0986539 Merge pull request #31897 from frappe/mergify/bp/version-14-hotfix/pr-31890
fix: additional-costs in SCO and SCR (backport #31890)
2022-08-19 15:58:06 +05:30
Sagar Sharma
376293326b chore: conflicts 2022-08-19 15:30:50 +05:30
Sagar Sharma
9a29e3c9f2 chore: add test for additional-cost
(cherry picked from commit c247cf728c)
2022-08-19 09:56:52 +00:00
Sagar Sharma
e099e10c8e fix: test "test_pending_and_received_qty"
(cherry picked from commit addd7347d8)
2022-08-19 09:56:52 +00:00
Sagar Sharma
3b222339b8 chore: add additional-cost table in SCR
(cherry picked from commit 256b4245d5)

# Conflicts:
#	erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json
2022-08-19 09:56:51 +00:00
Sagar Sharma
9e60dd32e8 fix: recalculate rate of items based on "Recalculate Rate" checkbox
(cherry picked from commit 2fc6833684)
2022-08-19 09:56:51 +00:00
Sagar Sharma
7ff5414571 chore: move "set_missing_values_in_additional_costs" from SCO to SC"
(cherry picked from commit ea82fe5bc2)
2022-08-19 09:56:50 +00:00
Sagar Sharma
d48487ada2 fix: base_amount and exchange_rate in additional-cost table
(cherry picked from commit eabd3135f0)
2022-08-19 09:56:50 +00:00
Sagar Sharma
da69cc5477 fix: additional-cost in items table
(cherry picked from commit d7ed4093d8)
2022-08-19 09:56:50 +00:00
Sagar Vora
b2a720d847 Merge pull request #31891 from frappe/mergify/bp/version-14-hotfix/pr-31853
perf: use `create_custom_fields` (backport #31853)
2022-08-18 15:57:59 +00:00
Sagar Vora
6656d23e45 perf: use create_custom_fields (#31853)
* perf: use `create_custom_fields`

* fix: default must be a string

(cherry picked from commit aafb735283)
2022-08-18 15:31:42 +00:00
mergify[bot]
ae5c05081d chore: remove unwanted field "provisional_expense_account" from SCR (backport #31847) (#31886)
chore: remove unwanted field "provisional_expense_account" from SCR (#31847)

(cherry picked from commit 7e88eb549f)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-18 17:41:01 +05:30
Frappe PR Bot
028e939cca chore(release): Bumped to Version 14.0.1
## [14.0.1](https://github.com/frappe/erpnext/compare/v14.0.0...v14.0.1) (2022-08-18)

### Bug Fixes

* add asset repair to accounting dimension list ([65bb1d8](65bb1d8cc2))
* Add dimension section in subcontracting doctypes (backport [#31849](https://github.com/frappe/erpnext/issues/31849)) ([#31877](https://github.com/frappe/erpnext/issues/31877)) ([50ad612](50ad612453))
* check item_code in all rows of po_items (backport [#31741](https://github.com/frappe/erpnext/issues/31741)) ([#31842](https://github.com/frappe/erpnext/issues/31842)) ([82f1dd2](82f1dd268d))
* contact search in request for quotation (backport [#31828](https://github.com/frappe/erpnext/issues/31828)) ([#31840](https://github.com/frappe/erpnext/issues/31840)) ([74664a3](74664a34c0))
* delete custom fields on deletion of inventory dimension ([354a9d6](354a9d6169))
* **ecommerce:** remove query to non-existing field (backport [#31771](https://github.com/frappe/erpnext/issues/31771)) ([#31773](https://github.com/frappe/erpnext/issues/31773)) ([8737c10](8737c10ce4))
* getting error to show sales invoice group or print rep… (backport [#31756](https://github.com/frappe/erpnext/issues/31756)) ([#31767](https://github.com/frappe/erpnext/issues/31767)) ([53b9d61](53b9d61c46))
* incorrect produced-qty in production-plan-item (backport [#31706](https://github.com/frappe/erpnext/issues/31706)) ([#31861](https://github.com/frappe/erpnext/issues/31861)) ([010a0ca](010a0ca0a9))
* incorrect rate in BOM exploded items (backport [#31513](https://github.com/frappe/erpnext/issues/31513)) ([#31864](https://github.com/frappe/erpnext/issues/31864)) ([abe1894](abe18945a6))
* intercompany SO throws exception ([1d1f12f](1d1f12f949))
* linter (backport [#31763](https://github.com/frappe/erpnext/issues/31763)) ([#31766](https://github.com/frappe/erpnext/issues/31766)) ([3092131](3092131913))
* Make expense account editable in Purchase Receipt Item (backport [#31730](https://github.com/frappe/erpnext/issues/31730)) ([#31878](https://github.com/frappe/erpnext/issues/31878)) ([b637d4d](b637d4d5f1))
* Make expense account editable in Subcontracting Receipt Item (backport [#31848](https://github.com/frappe/erpnext/issues/31848)) ([#31870](https://github.com/frappe/erpnext/issues/31870)) ([aa5aaa1](aa5aaa113e))
* not able to issue expired batches ([ce5fc5b](ce5fc5b457))
* posting_date of linked vouchers should not affect outstanding ([0faa7b0](0faa7b0432))
* **projects:** Add missing comma ([623f56a](623f56a95c))
* set `billing_address` for purchases in `get_party_details` ([5a28ba8](5a28ba8537))
* set `company_address` for purchases in `party.js` ([4c82533](4c82533239))
* specify allowed doctype in queries (backport [#31761](https://github.com/frappe/erpnext/issues/31761)) ([#31764](https://github.com/frappe/erpnext/issues/31764)) ([6dce122](6dce122825))
* Transit filter for Default Target Warehouse in SE (backport [#31839](https://github.com/frappe/erpnext/issues/31839)) ([#31873](https://github.com/frappe/erpnext/issues/31873)) ([04d3571](04d3571dd9))
2022-08-18 08:30:58 +00:00
Deepesh Garg
216cb9b07b Merge pull request #31881 from frappe/version-14-hotfix
chore: weekly version-14 release
2022-08-18 13:59:28 +05:30
mergify[bot]
50ad612453 fix: Add dimension section in subcontracting doctypes (backport #31849) (#31877)
* fix: Add dimension section in subcontracting doctypes (#31849)

(cherry picked from commit 8704ca783d)

# Conflicts:
#	erpnext/patches.txt

* chore: conflicts

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-18 12:04:07 +05:30
Deepesh Garg
6b71af9008 Merge pull request #31883 from frappe/mergify/bp/version-14-hotfix/pr-31875
fix(projects): Add missing comma (backport #31875)
2022-08-18 11:20:55 +05:30
Deepesh Garg
3c8412efdb Merge pull request #31796 from frappe/mergify/bp/version-14-hotfix/pr-31737
fix: incorrect invoice outstanding in reconciliation tool (backport #31737)
2022-08-18 11:20:26 +05:30
Aditya Hase
623f56a95c fix(projects): Add missing comma
Added with https://github.com/frappe/erpnext/pull/31360

(cherry picked from commit d38778e400)
2022-08-18 05:49:58 +00:00
mergify[bot]
b637d4d5f1 fix: Make expense account editable in Purchase Receipt Item (backport #31730) (#31878)
fix: Make expense account editable in Purchase Receipt Item (#31730)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
(cherry picked from commit 1a6508972e)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2022-08-18 11:16:15 +05:30
rohitwaghchaure
601bc64618 Merge pull request #31869 from frappe/mergify/bp/version-14-hotfix/pr-31860
fix: delete custom fields on deletion of inventory dimension (backport #31860)
2022-08-17 21:45:57 +05:30
mergify[bot]
04d3571dd9 fix: Transit filter for Default Target Warehouse in SE (backport #31839) (#31873)
fix: Transit filter for Default Target Warehouse in SE (#31839)

(cherry picked from commit f1a612245c)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-17 17:26:15 +05:30
mergify[bot]
aa5aaa113e fix: Make expense account editable in Subcontracting Receipt Item (backport #31848) (#31870)
fix: Make expense account editable in Subcontracting Receipt Item (#31848)

(cherry picked from commit 2d04e71412)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-17 16:31:18 +05:30
Rohit Waghchaure
354a9d6169 fix: delete custom fields on deletion of inventory dimension
(cherry picked from commit 0b39a0123e)
2022-08-17 10:14:14 +00:00
rohitwaghchaure
c7e2217c92 Merge pull request #31867 from frappe/mergify/bp/version-14-hotfix/pr-31863
fix: not able to issue expired batches (backport #31863)
2022-08-17 15:43:32 +05:30
Rohit Waghchaure
ce5fc5b457 fix: not able to issue expired batches
(cherry picked from commit 795c94384a)
2022-08-17 09:16:57 +00:00
mergify[bot]
abe18945a6 fix: incorrect rate in BOM exploded items (backport #31513) (#31864)
fix: incorrect rate in BOM exploded items (#31513)

(cherry picked from commit 313625c349)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-17 14:37:40 +05:30
mergify[bot]
010a0ca0a9 fix: incorrect produced-qty in production-plan-item (backport #31706) (#31861)
fix: incorrect produced-qty in production-plan-item (#31706)

(cherry picked from commit 538cd6fdcf)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-17 13:46:33 +05:30
mergify[bot]
74664a34c0 fix: contact search in request for quotation (backport #31828) (#31840)
fix: contact search in request for quotation (#31828)

(cherry picked from commit e5e88bb9f1)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-15 12:19:59 +05:30
mergify[bot]
82f1dd268d fix: check item_code in all rows of po_items (backport #31741) (#31842)
fix: check item_code in all rows of po_items (#31741)

fix: check the item code in each row of PO items
(cherry picked from commit 0047e18a9b)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-14 16:00:54 +05:30
Deepesh Garg
1aa96defda fix: Unable to make payment entry against Fees using education app
(cherry picked from commit 79ac50d0f7)
2022-08-11 15:17:42 +00:00
Abhinav Raut
8fdbbf374d fix: term loan interest calculation
(cherry picked from commit 534d7ce64b)
2022-08-11 10:18:24 +00:00
Abhinav Raut
66e5202642 fix: process loan interest accrual
(cherry picked from commit 9ef8d5c5c3)
2022-08-11 10:18:24 +00:00
Nabin Hait
35e9bfca38 fix: map old data as per new options of no-of-employees
(cherry picked from commit 909945c0ac)
2022-08-09 15:18:25 +00:00
Nabin Hait
735a60807a fix: limited options for no-of-employees in crm
(cherry picked from commit 7ecd67605f)
2022-08-09 15:18:25 +00:00
mergify[bot]
c3fd802351 refactor: use browser native lazy loading (backport #31814) (#31815)
refactor: use browser native lazy loading (#31814)

(cherry picked from commit 08d7c48dc7)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-08-09 18:51:27 +05:30
Deepesh Garg
6046f8bc5e Merge pull request #31798 from frappe/mergify/bp/version-14-hotfix/pr-31779
Bug add accouting dimension in asset repair (backport #31779)
2022-08-09 17:58:35 +05:30
Akash Krishna
d7db8ed12e Tds report (#31801)
* fix: TDS Computation Summary Report not loading, too many values to unpack

(cherry picked from commit 32b30bc5de)
2022-08-09 12:12:33 +00:00
Sagar Vora
adcd21724b Merge pull request #31793 from frappe/mergify/bp/version-14-hotfix/pr-31733
fix: set `billing_address` for purchases in `get_party_details` (backport #31733)
2022-08-08 12:09:43 +00:00
ruthra kumar
04bdff736b chore: patch for creating existing dimensions in asset repair
(cherry picked from commit 80f508c4b1)
2022-08-08 11:10:25 +00:00
ruthra kumar
65bb1d8cc2 fix: add asset repair to accounting dimension list
(cherry picked from commit 452584c4bd)
2022-08-08 11:10:25 +00:00
Deepesh Garg
ebf766cf62 Merge pull request #31794 from frappe/mergify/bp/version-14-hotfix/pr-31777
fix: intercompany SO created from Purchase Order throws exception (backport #31777)
2022-08-08 16:36:46 +05:30
ruthra kumar
80bf47170f test: posting_date should not affect outstanding amount calculation
(cherry picked from commit ef312b8fc4)
2022-08-08 10:59:05 +00:00
ruthra kumar
0faa7b0432 fix: posting_date of linked vouchers should not affect outstanding
posting_date filter should not be applied for linked vouchers.

(cherry picked from commit 5f1562c5b2)
2022-08-08 10:59:05 +00:00
ruthra kumar
1d1f12f949 fix: intercompany SO throws exception
(cherry picked from commit af0a353b79)
2022-08-08 10:36:55 +00:00
Sagar Vora
4c82533239 fix: set company_address for purchases in party.js
(cherry picked from commit d05082987f)
2022-08-08 07:31:44 +00:00
Sagar Vora
5a28ba8537 fix: set billing_address for purchases in get_party_details
(cherry picked from commit a3625b3817)
2022-08-08 07:31:44 +00:00
mergify[bot]
8737c10ce4 fix(ecommerce): remove query to non-existing field (backport #31771) (#31773)
fix(ecommerce): remove query to non-existing field (#31771)

(cherry picked from commit 17b9bfd249)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-08-03 16:49:16 +05:30
Ankush Menat
2defb89962 ci: fix automated release regex (#31770)
[skip ci]
2022-08-03 16:15:32 +05:30
mergify[bot]
53b9d61c46 fix: getting error to show sales invoice group or print rep… (backport #31756) (#31767)
fix: getting error to show sales invoice group or print rep… (#31756)

fix: formatter getting error to show sales invoice group or print report.

1 - When I view the Gross Profit report in Sales Invoice mode, the table is all broken.
Error on browser console:
TypeError: Cannot read properties of undefined (reading 'indent')

2 - When I try to print, no matter the Group (Sales Invoice, Item Code, Item Group...) nothing happens. in browser log console I have the following error:
TypeError: Cannot read properties of undefined (reading 'content')

i fixed both errors and all working perfectly.

(cherry picked from commit ea88451875)

Co-authored-by: HarryPaulo <paulo_fabris@hotmail.com>
2022-08-03 11:22:54 +05:30
mergify[bot]
3092131913 fix: linter (backport #31763) (#31766)
fix: linter (#31763)

(cherry picked from commit 9c580dde39)

Co-authored-by: Devin Slauenwhite <devin.slauenwhite@gmail.com>
2022-08-03 11:17:44 +05:30
mergify[bot]
6dce122825 fix: specify allowed doctype in queries (backport #31761) (#31764)
fix: specify allowed doctype in queries (#31761)

(cherry picked from commit 9baa222976)

Co-authored-by: Sagar Vora <sagar@resilient.tech>
2022-08-03 11:16:41 +05:30
Ankush Menat
248cc48842 ci: setup releases for v14 (#31759)
[skip ci]
2022-08-02 12:11:36 +05:30
Deepesh Garg
ebd8f2f45b chore: verison bump and change log 2022-08-01 22:29:34 +05:30
Ankush Menat
bb00d38dd7 Merge branch 'develop' into asset-capitalization 2021-11-30 19:32:11 +05:30
Saif Ur Rehman
06aead0470 chore: isort 2021-11-10 13:45:40 +05:00
Saif Ur Rehman
cdb1800087 chore: remove unused import 2021-11-09 12:35:01 +05:00
Saif Ur Rehman
13f8edd43f Merge remote-tracking branch 'upstream/develop' into asset-capitalization
# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.py
2021-11-09 12:17:17 +05:00
Saif Ur Rehman
85d1a237ce fix(Asset Capitalization): Reverse depreciation on cancel 2021-11-04 14:15:47 +05:00
Saif Ur Rehman
dc3c27fd1b fix(Asset Capitalization): update code for changes in depreciation logic 2021-11-04 13:47:33 +05:00
Saif Ur Rehman
2d9da22721 Merge branch 'develop' of https://github.com/frappe/erpnext into asset-capitalization
# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.py
#	erpnext/assets/doctype/asset/test_asset.py
#	erpnext/assets/workspace/assets/assets.json
2021-11-04 12:48:33 +05:00
Saif Ur Rehman
86a6293e62 test(Asset Capitalization): unit tests 2021-09-16 23:24:46 +05:00
Saif Ur Rehman
c311b8ea4f fix(Asset Capitalization): validation edge cases 2021-09-16 23:23:22 +05:00
Saif Ur Rehman
e832944dfe fix(Asset): On Depreciation reversal, remove Journal Entry reference 2021-09-16 23:22:31 +05:00
Saif Ur Rehman
003cfe2717 fix(Asset Capitalization): Hide source items section if table is empty 2021-09-16 23:21:09 +05:00
Saif Ur Rehman
132b517584 fix(Asset Captalization): run_serially on posting_date changed 2021-09-16 23:20:36 +05:00
Saif Ur Rehman
d173e06e69 chore(Asset Capitalization): isort linting 2021-09-14 15:13:35 +05:00
Saif Ur Rehman
9ae0380a96 chore(Asset Capitalization): isort linting 2021-09-14 15:09:58 +05:00
Saif Ur Rehman
8873ef7b67 chore(Asset Capitalization): isort linting 2021-09-14 15:05:39 +05:00
Saif Ur Rehman
dc24a657fd chore(Asset Capitalization): linting 2021-09-14 12:40:17 +05:00
Saif Ur Rehman
8c54be7e99 chore(Asset Capitalization): linting 2021-09-14 12:30:40 +05:00
Saif Ur Rehman
7a5d75b68d feat(Asset Capitalization): Submission and Cancellation 2021-09-13 23:01:52 +05:00
Saif Ur Rehman
3b9bc8e4ef feat(Asset Capitalization): Finance Book field in Asset Row 2021-09-12 14:28:14 +05:00
Saif Ur Rehman
702b5c32c1 feat(Asset Capitalization): Accounting Fields 2021-09-08 16:36:07 +05:00
Saif Ur Rehman
6c748966e7 feat: Asset Capitalization Form 2021-09-06 17:27:47 +05:00
756 changed files with 37798 additions and 14890 deletions

View File

@@ -66,7 +66,8 @@ ignore =
F841,
E713,
E712,
B023
B023,
B028
max-line-length = 200

View File

@@ -3,52 +3,71 @@ import requests
from urllib.parse import urlparse
docs_repos = [
"frappe_docs",
"erpnext_documentation",
WEBSITE_REPOS = [
"erpnext_com",
"frappe_io",
]
DOCUMENTATION_DOMAINS = [
"docs.erpnext.com",
"frappeframework.com",
]
def uri_validator(x):
result = urlparse(x)
return all([result.scheme, result.netloc, result.path])
def docs_link_exists(body):
for line in body.splitlines():
for word in line.split():
if word.startswith('http') and uri_validator(word):
parsed_url = urlparse(word)
if parsed_url.netloc == "github.com":
parts = parsed_url.path.split('/')
if len(parts) == 5 and parts[1] == "frappe" and parts[2] in docs_repos:
return True
elif parsed_url.netloc == "docs.erpnext.com":
return True
def is_valid_url(url: str) -> bool:
parts = urlparse(url)
return all((parts.scheme, parts.netloc, parts.path))
def is_documentation_link(word: str) -> bool:
if not word.startswith("http") or not is_valid_url(word):
return False
parsed_url = urlparse(word)
if parsed_url.netloc in DOCUMENTATION_DOMAINS:
return True
if parsed_url.netloc == "github.com":
parts = parsed_url.path.split("/")
if len(parts) == 5 and parts[1] == "frappe" and parts[2] in WEBSITE_REPOS:
return True
return False
def contains_documentation_link(body: str) -> bool:
return any(
is_documentation_link(word)
for line in body.splitlines()
for word in line.split()
)
def check_pull_request(number: str) -> "tuple[int, str]":
response = requests.get(f"https://api.github.com/repos/frappe/erpnext/pulls/{number}")
if not response.ok:
return 1, "Pull Request Not Found! ⚠️"
payload = response.json()
title = (payload.get("title") or "").lower().strip()
head_sha = (payload.get("head") or {}).get("sha")
body = (payload.get("body") or "").lower()
if (
not title.startswith("feat")
or not head_sha
or "no-docs" in body
or "backport" in body
):
return 0, "Skipping documentation checks... 🏃"
if contains_documentation_link(body):
return 0, "Documentation Link Found. You're Awesome! 🎉"
return 1, "Documentation Link Not Found! ⚠️"
if __name__ == "__main__":
pr = sys.argv[1]
response = requests.get("https://api.github.com/repos/frappe/erpnext/pulls/{}".format(pr))
if response.ok:
payload = response.json()
title = (payload.get("title") or "").lower().strip()
head_sha = (payload.get("head") or {}).get("sha")
body = (payload.get("body") or "").lower()
if (title.startswith("feat")
and head_sha
and "no-docs" not in body
and "backport" not in body
):
if docs_link_exists(body):
print("Documentation Link Found. You're Awesome! 🎉")
else:
print("Documentation Link Not Found! ⚠️")
sys.exit(1)
else:
print("Skipping documentation checks... 🏃")
exit_code, message = check_pull_request(sys.argv[1])
print(message)
sys.exit(exit_code)

View File

@@ -8,8 +8,9 @@ sudo apt update && sudo apt install redis-server libcups2-dev
pip install frappe-bench
githubbranch=${GITHUB_BASE_REF:-${GITHUB_REF##*/}}
frappeuser=${FRAPPE_USER:-"frappe"}
frappebranch=${FRAPPE_BRANCH:-${GITHUB_BASE_REF:-${GITHUB_REF##*/}}}
frappebranch=${FRAPPE_BRANCH:-$githubbranch}
git clone "https://github.com/${frappeuser}/frappe" --branch "${frappebranch}" --depth 1
bench init --skip-assets --frappe-path ~/frappe --python "$(which python)" frappe-bench
@@ -56,7 +57,7 @@ sed -i 's/schedule:/# schedule:/g' Procfile
sed -i 's/socketio:/# socketio:/g' Procfile
sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile
bench get-app payments
bench get-app payments --branch ${githubbranch%"-hotfix"}
bench get-app erpnext "${GITHUB_WORKSPACE}"
if [ "$TYPE" == "server" ]; then bench setup requirements --dev; fi

View File

@@ -11,6 +11,6 @@
"root_login": "root",
"root_password": "travis",
"host_name": "http://test_site:8000",
"install_apps": ["erpnext"],
"install_apps": ["payments", "erpnext"],
"throttle_user_limit": 100
}

View File

@@ -2,7 +2,7 @@ name: Generate Semantic Release
on:
push:
branches:
- version-13
- version-14
jobs:
release:
name: Release
@@ -13,10 +13,12 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js v14
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14
node-version: 18
- name: Setup dependencies
run: |
npm install @semantic-release/git @semantic-release/exec --no-save
@@ -28,4 +30,4 @@ jobs:
GIT_AUTHOR_EMAIL: "developers@frappe.io"
GIT_COMMITTER_NAME: "Frappe PR Bot"
GIT_COMMITTER_EMAIL: "developers@frappe.io"
run: npx semantic-release
run: npx semantic-release

View File

@@ -39,7 +39,7 @@ jobs:
fail-fast: false
matrix:
container: [1, 2, 3, 4]
container: [1, 2, 3]
name: Python Unit Tests
@@ -120,32 +120,7 @@ jobs:
FRAPPE_BRANCH: ${{ github.event.inputs.branch }}
- name: Run Tests
run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --use-orchestrator --with-coverage
run: 'cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --total-builds 3 --build-number ${{ matrix.container }}'
env:
TYPE: server
CI_BUILD_ID: ${{ github.run_id }}
ORCHESTRATOR_URL: http://test-orchestrator.frappe.io
- name: Upload coverage data
uses: actions/upload-artifact@v3
with:
name: coverage-${{ matrix.container }}
path: /home/runner/frappe-bench/sites/coverage.xml
coverage:
name: Coverage Wrap Up
needs: test
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Upload coverage data
uses: codecov/codecov-action@v2
with:
name: MariaDB
fail_ci_if_error: true
verbose: true

View File

@@ -16,8 +16,8 @@ repos:
- id: check-merge-conflict
- id: check-ast
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies: [
@@ -32,8 +32,8 @@ repos:
- id: black
additional_dependencies: ['click==8.0.4']
- repo: https://github.com/timothycrosley/isort
rev: 5.9.1
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
exclude: ".*setup.py$"

View File

@@ -1,5 +1,5 @@
{
"branches": ["version-13"],
"branches": ["version-14"],
"plugins": [
"@semantic-release/commit-analyzer", {
"preset": "angular",
@@ -10,7 +10,7 @@
"@semantic-release/release-notes-generator",
[
"@semantic-release/exec", {
"prepareCmd": 'sed -ir "s/[0-9]*\.[0-9]*\.[0-9]*/${nextRelease.version}/" erpnext/__init__.py'
"prepareCmd": 'sed -ir -E "s/\"[0-9]+\.[0-9]+\.[0-9]+\"/\"${nextRelease.version}\"/" erpnext/__init__.py'
}
],
[
@@ -21,4 +21,4 @@
],
"@semantic-release/github"
]
}
}

View File

@@ -3,30 +3,23 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
erpnext/accounts/ @nextchamp-saqib @deepeshgarg007 @ruthra-kumar
erpnext/assets/ @nextchamp-saqib @deepeshgarg007 @ruthra-kumar
erpnext/loan_management/ @nextchamp-saqib @deepeshgarg007
erpnext/regional @nextchamp-saqib @deepeshgarg007 @ruthra-kumar
erpnext/selling @nextchamp-saqib @deepeshgarg007 @ruthra-kumar
erpnext/support/ @nextchamp-saqib @deepeshgarg007
pos* @nextchamp-saqib
erpnext/accounts/ @deepeshgarg007 @ruthra-kumar
erpnext/assets/ @anandbaburajan @deepeshgarg007
erpnext/loan_management/ @deepeshgarg007
erpnext/regional @deepeshgarg007 @ruthra-kumar
erpnext/selling @deepeshgarg007 @ruthra-kumar
erpnext/support/ @deepeshgarg007
pos*
erpnext/buying/ @marination @rohitwaghchaure @s-aga-r
erpnext/e_commerce/ @marination
erpnext/maintenance/ @marination @rohitwaghchaure @s-aga-r
erpnext/manufacturing/ @marination @rohitwaghchaure @s-aga-r
erpnext/portal/ @marination
erpnext/quality_management/ @marination @rohitwaghchaure @s-aga-r
erpnext/shopping_cart/ @marination
erpnext/stock/ @marination @rohitwaghchaure @s-aga-r
erpnext/buying/ @rohitwaghchaure @s-aga-r
erpnext/maintenance/ @rohitwaghchaure @s-aga-r
erpnext/manufacturing/ @rohitwaghchaure @s-aga-r
erpnext/quality_management/ @rohitwaghchaure @s-aga-r
erpnext/stock/ @rohitwaghchaure @s-aga-r
erpnext/subcontracting @rohitwaghchaure @s-aga-r
erpnext/crm/ @NagariaHussain
erpnext/education/ @rutwikhdev
erpnext/projects/ @ruchamahabal
erpnext/controllers/ @deepeshgarg007 @rohitwaghchaure
erpnext/patches/ @deepeshgarg007
erpnext/controllers/ @deepeshgarg007 @nextchamp-saqib @rohitwaghchaure @marination
erpnext/patches/ @deepeshgarg007 @nextchamp-saqib @marination
erpnext/public/ @nextchamp-saqib @marination
.github/ @ankush
pyproject.toml @gavindsouza @ankush
.github/ @deepeshgarg007
pyproject.toml @ankush

View File

@@ -82,6 +82,8 @@ GNU/General Public License (see [license.txt](license.txt))
The ERPNext code is licensed as GNU General Public License (v3) and the Documentation is licensed as Creative Commons (CC-BY-SA-3.0) and the copyright is owned by Frappe Technologies Pvt Ltd (Frappe) and Contributors.
By contributing to ERPNext, you agree that your contributions will be licensed under its GNU General Public License (v3).
## Logo and Trademark Policy
Please read our [Logo and Trademark Policy](TRADEMARK_POLICY.md).

View File

@@ -1,8 +1,9 @@
import functools
import inspect
import frappe
__version__ = "14.0.0-dev"
__version__ = "14.25.1"
def get_default_company(user=None):
@@ -120,12 +121,14 @@ def get_region(company=None):
You can also set global company flag in `frappe.flags.company`
"""
if company or frappe.flags.company:
return frappe.get_cached_value("Company", company or frappe.flags.company, "country")
elif frappe.flags.country:
return frappe.flags.country
else:
return frappe.get_system_settings("country")
if not company:
company = frappe.local.flags.company
if company:
return frappe.get_cached_value("Company", company, "country")
return frappe.flags.country or frappe.get_system_settings("country")
def allow_regional(fn):
@@ -136,6 +139,7 @@ def allow_regional(fn):
def myfunction():
pass"""
@functools.wraps(fn)
def caller(*args, **kwargs):
overrides = frappe.get_hooks("regional_overrides", {}).get(get_region())
function_path = f"{inspect.getmodule(fn).__name__}.{fn.__name__}"

View File

@@ -378,7 +378,7 @@ def book_deferred_income_or_expense(doc, deferred_process, posting_date=None):
return
# check if books nor frozen till endate:
if accounts_frozen_upto and (end_date) <= getdate(accounts_frozen_upto):
if accounts_frozen_upto and getdate(end_date) <= getdate(accounts_frozen_upto):
end_date = get_last_day(add_days(accounts_frozen_upto, 1))
if via_journal_entry:

View File

@@ -18,7 +18,6 @@
"root_type",
"report_type",
"account_currency",
"inter_company_account",
"column_break1",
"parent_account",
"account_type",
@@ -34,15 +33,11 @@
{
"fieldname": "properties",
"fieldtype": "Section Break",
"oldfieldtype": "Section Break",
"show_days": 1,
"show_seconds": 1
"oldfieldtype": "Section Break"
},
{
"fieldname": "column_break0",
"fieldtype": "Column Break",
"show_days": 1,
"show_seconds": 1,
"width": "50%"
},
{
@@ -53,9 +48,7 @@
"no_copy": 1,
"oldfieldname": "account_name",
"oldfieldtype": "Data",
"reqd": 1,
"show_days": 1,
"show_seconds": 1
"reqd": 1
},
{
"fieldname": "account_number",
@@ -63,17 +56,13 @@
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Account Number",
"read_only": 1,
"show_days": 1,
"show_seconds": 1
"read_only": 1
},
{
"default": "0",
"fieldname": "is_group",
"fieldtype": "Check",
"label": "Is Group",
"show_days": 1,
"show_seconds": 1
"label": "Is Group"
},
{
"fieldname": "company",
@@ -85,9 +74,7 @@
"options": "Company",
"read_only": 1,
"remember_last_selected_value": 1,
"reqd": 1,
"show_days": 1,
"show_seconds": 1
"reqd": 1
},
{
"fieldname": "root_type",
@@ -95,9 +82,7 @@
"in_standard_filter": 1,
"label": "Root Type",
"options": "\nAsset\nLiability\nIncome\nExpense\nEquity",
"read_only": 1,
"show_days": 1,
"show_seconds": 1
"read_only": 1
},
{
"fieldname": "report_type",
@@ -105,32 +90,18 @@
"in_standard_filter": 1,
"label": "Report Type",
"options": "\nBalance Sheet\nProfit and Loss",
"read_only": 1,
"show_days": 1,
"show_seconds": 1
"read_only": 1
},
{
"depends_on": "eval:doc.is_group==0",
"fieldname": "account_currency",
"fieldtype": "Link",
"label": "Currency",
"options": "Currency",
"show_days": 1,
"show_seconds": 1
},
{
"default": "0",
"fieldname": "inter_company_account",
"fieldtype": "Check",
"label": "Inter Company Account",
"show_days": 1,
"show_seconds": 1
"options": "Currency"
},
{
"fieldname": "column_break1",
"fieldtype": "Column Break",
"show_days": 1,
"show_seconds": 1,
"width": "50%"
},
{
@@ -142,9 +113,7 @@
"oldfieldtype": "Link",
"options": "Account",
"reqd": 1,
"search_index": 1,
"show_days": 1,
"show_seconds": 1
"search_index": 1
},
{
"description": "Setting Account Type helps in selecting this Account in transactions.",
@@ -154,9 +123,7 @@
"label": "Account Type",
"oldfieldname": "account_type",
"oldfieldtype": "Select",
"options": "\nAccumulated Depreciation\nAsset Received But Not Billed\nBank\nCash\nChargeable\nCapital Work in Progress\nCost of Goods Sold\nDepreciation\nEquity\nExpense Account\nExpenses Included In Asset Valuation\nExpenses Included In Valuation\nFixed Asset\nIncome Account\nPayable\nReceivable\nRound Off\nStock\nStock Adjustment\nStock Received But Not Billed\nService Received But Not Billed\nTax\nTemporary",
"show_days": 1,
"show_seconds": 1
"options": "\nAccumulated Depreciation\nAsset Received But Not Billed\nBank\nCash\nChargeable\nCapital Work in Progress\nCost of Goods Sold\nDepreciation\nEquity\nExpense Account\nExpenses Included In Asset Valuation\nExpenses Included In Valuation\nFixed Asset\nIncome Account\nPayable\nReceivable\nRound Off\nStock\nStock Adjustment\nStock Received But Not Billed\nService Received But Not Billed\nTax\nTemporary"
},
{
"description": "Rate at which this tax is applied",
@@ -164,9 +131,7 @@
"fieldtype": "Float",
"label": "Rate",
"oldfieldname": "tax_rate",
"oldfieldtype": "Currency",
"show_days": 1,
"show_seconds": 1
"oldfieldtype": "Currency"
},
{
"description": "If the account is frozen, entries are allowed to restricted users.",
@@ -175,17 +140,13 @@
"label": "Frozen",
"oldfieldname": "freeze_account",
"oldfieldtype": "Select",
"options": "No\nYes",
"show_days": 1,
"show_seconds": 1
"options": "No\nYes"
},
{
"fieldname": "balance_must_be",
"fieldtype": "Select",
"label": "Balance must be",
"options": "\nDebit\nCredit",
"show_days": 1,
"show_seconds": 1
"options": "\nDebit\nCredit"
},
{
"fieldname": "lft",
@@ -194,9 +155,7 @@
"label": "Lft",
"print_hide": 1,
"read_only": 1,
"search_index": 1,
"show_days": 1,
"show_seconds": 1
"search_index": 1
},
{
"fieldname": "rgt",
@@ -205,9 +164,7 @@
"label": "Rgt",
"print_hide": 1,
"read_only": 1,
"search_index": 1,
"show_days": 1,
"show_seconds": 1
"search_index": 1
},
{
"fieldname": "old_parent",
@@ -215,33 +172,27 @@
"hidden": 1,
"label": "Old Parent",
"print_hide": 1,
"read_only": 1,
"show_days": 1,
"show_seconds": 1
"read_only": 1
},
{
"default": "0",
"depends_on": "eval:(doc.report_type == 'Profit and Loss' && !doc.is_group)",
"fieldname": "include_in_gross",
"fieldtype": "Check",
"label": "Include in gross",
"show_days": 1,
"show_seconds": 1
"label": "Include in gross"
},
{
"default": "0",
"fieldname": "disabled",
"fieldtype": "Check",
"label": "Disable",
"show_days": 1,
"show_seconds": 1
"label": "Disable"
}
],
"icon": "fa fa-money",
"idx": 1,
"is_tree": 1,
"links": [],
"modified": "2020-06-11 15:15:54.338622",
"modified": "2023-04-11 16:08:46.983677",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Account",
@@ -301,5 +252,6 @@
"show_name_in_global_search": 1,
"sort_field": "modified",
"sort_order": "ASC",
"states": [],
"track_changes": 1
}

View File

@@ -37,7 +37,7 @@ class Account(NestedSet):
def autoname(self):
from erpnext.accounts.utils import get_autoname_with_number
self.name = get_autoname_with_number(self.account_number, self.account_name, None, self.company)
self.name = get_autoname_with_number(self.account_number, self.account_name, self.company)
def validate(self):
from erpnext.accounts.utils import validate_field_number
@@ -201,8 +201,11 @@ class Account(NestedSet):
)
def validate_account_currency(self):
self.currency_explicitly_specified = True
if not self.account_currency:
self.account_currency = frappe.get_cached_value("Company", self.company, "default_currency")
self.currency_explicitly_specified = False
gl_currency = frappe.db.get_value("GL Entry", {"account": self.name}, "account_currency")
@@ -248,8 +251,10 @@ class Account(NestedSet):
{
"company": company,
# parent account's currency should be passed down to child account's curreny
# if it is None, it picks it up from default company currency, which might be unintended
"account_currency": erpnext.get_company_currency(company),
# if currency explicitly specified by user, child will inherit. else, default currency will be used.
"account_currency": self.account_currency
if self.currency_explicitly_specified
else erpnext.get_company_currency(company),
"parent_account": parent_acc_name_map[company],
}
)
@@ -393,7 +398,13 @@ def update_account_number(name, account_name, account_number=None, from_descenda
if ancestors and not allow_independent_account_creation:
for ancestor in ancestors:
if frappe.db.get_value("Account", {"account_name": old_acc_name, "company": ancestor}, "name"):
old_name = frappe.db.get_value(
"Account",
{"account_number": old_acc_number, "account_name": old_acc_name, "company": ancestor},
"name",
)
if old_name:
# same account in parent company exists
allow_child_account_creation = _("Allow Account Creation Against Child Company")

View File

@@ -29,6 +29,7 @@ def create_charts(
"root_type",
"is_group",
"tax_rate",
"account_currency",
]:
account_number = cstr(child.get("account_number")).strip()
@@ -95,7 +96,17 @@ def identify_is_group(child):
is_group = child.get("is_group")
elif len(
set(child.keys())
- set(["account_name", "account_type", "root_type", "is_group", "tax_rate", "account_number"])
- set(
[
"account_name",
"account_type",
"root_type",
"is_group",
"tax_rate",
"account_number",
"account_currency",
]
)
):
is_group = 1
else:
@@ -185,6 +196,7 @@ def get_account_tree_from_existing_company(existing_company):
"root_type",
"tax_rate",
"account_number",
"account_currency",
],
order_by="lft, rgt",
)
@@ -267,6 +279,7 @@ def build_tree_from_json(chart_template, chart_data=None, from_coa_importer=Fals
"root_type",
"is_group",
"tax_rate",
"account_currency",
]:
continue

View File

@@ -1,38 +1,38 @@
{
"country_code": "de",
"name": "SKR03 mit Kontonummern",
"tree": {
"Aktiva": {
"is_group": 1,
"country_code": "de",
"name": "SKR03 mit Kontonummern",
"tree": {
"Aktiva": {
"is_group": 1,
"root_type": "Asset",
"A - Anlagevermögen": {
"is_group": 1,
"EDV-Software": {
"account_number": "0027",
"account_type": "Fixed Asset"
},
"Gesch\u00e4ftsausstattung": {
"account_number": "0410",
"account_type": "Fixed Asset"
},
"B\u00fcroeinrichtung": {
"account_number": "0420",
"account_type": "Fixed Asset"
},
"Darlehen": {
"account_number": "0565"
},
"Maschinen": {
"account_number": "0210",
"account_type": "Fixed Asset"
},
"Betriebsausstattung": {
"account_number": "0400",
"account_type": "Fixed Asset"
},
"Ladeneinrichtung": {
"account_number": "0430",
"account_type": "Fixed Asset"
"A - Anlagevermögen": {
"is_group": 1,
"EDV-Software": {
"account_number": "0027",
"account_type": "Fixed Asset"
},
"Geschäftsausstattung": {
"account_number": "0410",
"account_type": "Fixed Asset"
},
"Büroeinrichtung": {
"account_number": "0420",
"account_type": "Fixed Asset"
},
"Darlehen": {
"account_number": "0565"
},
"Maschinen": {
"account_number": "0210",
"account_type": "Fixed Asset"
},
"Betriebsausstattung": {
"account_number": "0400",
"account_type": "Fixed Asset"
},
"Ladeneinrichtung": {
"account_number": "0430",
"account_type": "Fixed Asset"
},
"Accumulated Depreciation": {
"account_type": "Accumulated Depreciation"
@@ -60,36 +60,46 @@
"Durchlaufende Posten": {
"account_number": "1590"
},
"Gewinnermittlung \u00a74/3 nicht Ergebniswirksam": {
"Verrechnungskonto Gewinnermittlung § 4 Abs. 3 EStG, nicht ergebniswirksam": {
"account_number": "1371"
},
"Abziehbare Vorsteuer": {
"account_type": "Tax",
"is_group": 1,
"Abziehbare Vorsteuer 7%": {
"account_number": "1571"
"Abziehbare Vorsteuer 7 %": {
"account_number": "1571",
"account_type": "Tax",
"tax_rate": 7.0
},
"Abziehbare Vorsteuer 19%": {
"account_number": "1576"
"Abziehbare Vorsteuer 19 %": {
"account_number": "1576",
"account_type": "Tax",
"tax_rate": 19.0
},
"Abziehbare Vorsteuer nach \u00a713b UStG 19%": {
"account_number": "1577"
},
"Leistungen \u00a713b UStG 19% Vorsteuer, 19% Umsatzsteuer": {
"account_number": "3120"
"Abziehbare Vorsteuer nach § 13b UStG 19 %": {
"account_number": "1577",
"account_type": "Tax",
"tax_rate": 19.0
}
}
},
"III. Wertpapiere": {
"is_group": 1
"is_group": 1,
"Anteile an verbundenen Unternehmen (Umlaufvermögen)": {
"account_number": "1340"
},
"Anteile an herrschender oder mit Mehrheit beteiligter Gesellschaft": {
"account_number": "1344"
},
"Sonstige Wertpapiere": {
"account_number": "1348"
}
},
"IV. Kassenbestand, Bundesbankguthaben, Guthaben bei Kreditinstituten und Schecks.": {
"is_group": 1,
"Kasse": {
"account_type": "Cash",
"is_group": 1,
"account_type": "Cash",
"Kasse": {
"is_group": 1,
"account_number": "1000",
"account_type": "Cash"
}
@@ -111,21 +121,21 @@
"C - Rechnungsabgrenzungsposten": {
"is_group": 1,
"Aktive Rechnungsabgrenzung": {
"account_number": "0980"
"account_number": "0980"
}
},
"D - Aktive latente Steuern": {
"is_group": 1,
"Aktive latente Steuern": {
"account_number": "0983"
"account_number": "0983"
}
},
"E - Aktiver Unterschiedsbetrag aus der Vermögensverrechnung": {
"is_group": 1
}
},
"Passiva": {
"is_group": 1,
},
"Passiva": {
"is_group": 1,
"root_type": "Liability",
"A. Eigenkapital": {
"is_group": 1,
@@ -200,26 +210,32 @@
},
"Umsatzsteuer": {
"is_group": 1,
"account_type": "Tax",
"Umsatzsteuer 7%": {
"account_number": "1771"
"Umsatzsteuer 7 %": {
"account_number": "1771",
"account_type": "Tax",
"tax_rate": 7.0
},
"Umsatzsteuer 19%": {
"account_number": "1776"
"Umsatzsteuer 19 %": {
"account_number": "1776",
"account_type": "Tax",
"tax_rate": 19.0
},
"Umsatzsteuer-Vorauszahlung": {
"account_number": "1780"
"account_number": "1780",
"account_type": "Tax"
},
"Umsatzsteuer-Vorauszahlung 1/11": {
"account_number": "1781"
},
"Umsatzsteuer \u00a7 13b UStG 19%": {
"account_number": "1787"
"Umsatzsteuer nach § 13b UStG 19 %": {
"account_number": "1787",
"account_type": "Tax",
"tax_rate": 19.0
},
"Umsatzsteuer Vorjahr": {
"account_number": "1790"
},
"Umsatzsteuer fr\u00fchere Jahre": {
"Umsatzsteuer frühere Jahre": {
"account_number": "1791"
}
}
@@ -234,44 +250,56 @@
"E. Passive latente Steuern": {
"is_group": 1
}
},
"Erl\u00f6se u. Ertr\u00e4ge 2/8": {
"is_group": 1,
"root_type": "Income",
"Erl\u00f6skonten 8": {
},
"Erlöse u. Erträge 2/8": {
"is_group": 1,
"root_type": "Income",
"Erlöskonten 8": {
"is_group": 1,
"Erl\u00f6se": {
"account_number": "8200",
"account_type": "Income Account"
},
"Erl\u00f6se USt. 19%": {
"account_number": "8400",
"account_type": "Income Account"
},
"Erl\u00f6se USt. 7%": {
"account_number": "8300",
"account_type": "Income Account"
}
},
"Ertragskonten 2": {
"is_group": 1,
"sonstige Zinsen und \u00e4hnliche Ertr\u00e4ge": {
"account_number": "2650",
"account_type": "Income Account"
},
"Au\u00dferordentliche Ertr\u00e4ge": {
"account_number": "2500",
"account_type": "Income Account"
},
"Sonstige Ertr\u00e4ge": {
"account_number": "2700",
"account_type": "Income Account"
}
}
},
"Aufwendungen 2/4": {
"is_group": 1,
"Erlöse": {
"account_number": "8200",
"account_type": "Income Account"
},
"Erlöse USt. 19 %": {
"account_number": "8400",
"account_type": "Income Account"
},
"Erlöse USt. 7 %": {
"account_number": "8300",
"account_type": "Income Account"
}
},
"Ertragskonten 2": {
"is_group": 1,
"sonstige Zinsen und ähnliche Erträge": {
"account_number": "2650",
"account_type": "Income Account"
},
"Außerordentliche Erträge": {
"account_number": "2500",
"account_type": "Income Account"
},
"Sonstige Erträge": {
"account_number": "2700",
"account_type": "Income Account"
}
}
},
"Aufwendungen 2/4": {
"is_group": 1,
"root_type": "Expense",
"Fremdleistungen": {
"account_number": "3100",
"account_type": "Expense Account"
},
"Fremdleistungen ohne Vorsteuer": {
"account_number": "3109",
"account_type": "Expense Account"
},
"Bauleistungen eines im Inland ansässigen Unternehmers 19 % Vorsteuer und 19 % Umsatzsteuer": {
"account_number": "3120",
"account_type": "Expense Account"
},
"Wareneingang": {
"account_number": "3200"
},
@@ -298,234 +326,234 @@
"Gegenkonto 4996-4998": {
"account_number": "4999"
},
"Abschreibungen": {
"is_group": 1,
"Abschreibungen": {
"is_group": 1,
"Abschreibungen auf Sachanlagen (ohne AfA auf Kfz und Gebäude)": {
"account_number": "4830",
"account_type": "Accumulated Depreciation"
"account_number": "4830",
"account_type": "Accumulated Depreciation"
},
"Abschreibungen auf Gebäude": {
"account_number": "4831",
"account_type": "Depreciation"
"account_number": "4831",
"account_type": "Depreciation"
},
"Abschreibungen auf Kfz": {
"account_number": "4832",
"account_type": "Depreciation"
"account_number": "4832",
"account_type": "Depreciation"
},
"Sofortabschreibung GWG": {
"account_number": "4855",
"account_type": "Expense Account"
"account_number": "4855",
"account_type": "Expense Account"
}
},
"Kfz-Kosten": {
"is_group": 1,
"Kfz-Steuer": {
"account_number": "4510",
"account_type": "Expense Account"
},
"Kfz-Versicherungen": {
"account_number": "4520",
"account_type": "Expense Account"
},
"laufende Kfz-Betriebskosten": {
"account_number": "4530",
"account_type": "Expense Account"
},
"Kfz-Reparaturen": {
"account_number": "4540",
"account_type": "Expense Account"
},
"Fremdfahrzeuge": {
"account_number": "4570",
"account_type": "Expense Account"
},
"sonstige Kfz-Kosten": {
"account_number": "4580",
"account_type": "Expense Account"
}
},
"Personalkosten": {
"is_group": 1,
"Geh\u00e4lter": {
"account_number": "4120",
"account_type": "Expense Account"
},
"gesetzliche soziale Aufwendungen": {
"account_number": "4130",
"account_type": "Expense Account"
},
"Aufwendungen f\u00fcr Altersvorsorge": {
"account_number": "4165",
"account_type": "Expense Account"
},
"Verm\u00f6genswirksame Leistungen": {
"account_number": "4170",
"account_type": "Expense Account"
},
"Aushilfsl\u00f6hne": {
"account_number": "4190",
"account_type": "Expense Account"
}
},
"Raumkosten": {
"is_group": 1,
"Miete und Nebenkosten": {
"account_number": "4210",
"account_type": "Expense Account"
},
"Gas, Wasser, Strom (Verwaltung, Vertrieb)": {
"account_number": "4240",
"account_type": "Expense Account"
},
"Reinigung": {
"account_number": "4250",
"account_type": "Expense Account"
}
},
"Reparatur/Instandhaltung": {
"is_group": 1,
"Reparatur u. Instandh. von Anlagen/Maschinen u. Betriebs- u. Gesch\u00e4ftsausst.": {
"account_number": "4805",
"account_type": "Expense Account"
}
},
"Versicherungsbeitr\u00e4ge": {
"is_group": 1,
"Versicherungen": {
"account_number": "4360",
"account_type": "Expense Account"
},
"Beitr\u00e4ge": {
"account_number": "4380",
"account_type": "Expense Account"
},
"sonstige Ausgaben": {
"account_number": "4390",
"account_type": "Expense Account"
},
"steuerlich abzugsf\u00e4hige Versp\u00e4tungszuschl\u00e4ge und Zwangsgelder": {
"account_number": "4396",
"account_type": "Expense Account"
}
},
"Werbe-/Reisekosten": {
"is_group": 1,
"Werbekosten": {
"account_number": "4610",
"account_type": "Expense Account"
},
"Aufmerksamkeiten": {
"account_number": "4653",
"account_type": "Expense Account"
},
"nicht abzugsf\u00e4hige Betriebsausg. aus Werbe-, Repr\u00e4s.- u. Reisekosten": {
"account_number": "4665",
"account_type": "Expense Account"
},
"Reisekosten Unternehmer": {
"account_number": "4670",
"account_type": "Expense Account"
}
},
"verschiedene Kosten": {
"is_group": 1,
"Porto": {
"account_number": "4910",
"account_type": "Expense Account"
},
"Telekom": {
"account_number": "4920",
"account_type": "Expense Account"
},
"Mobilfunk D2": {
"account_number": "4921",
"account_type": "Expense Account"
},
"Internet": {
"account_number": "4922",
"account_type": "Expense Account"
},
"B\u00fcrobedarf": {
"account_number": "4930",
"account_type": "Expense Account"
},
"Zeitschriften, B\u00fccher": {
"account_number": "4940",
"account_type": "Expense Account"
},
"Fortbildungskosten": {
"account_number": "4945",
"account_type": "Expense Account"
},
"Buchf\u00fchrungskosten": {
"account_number": "4955",
"account_type": "Expense Account"
},
"Abschlu\u00df- u. Pr\u00fcfungskosten": {
"account_number": "4957",
"account_type": "Expense Account"
},
"Nebenkosten des Geldverkehrs": {
"account_number": "4970",
"account_type": "Expense Account"
},
"Werkzeuge und Kleinger\u00e4te": {
"account_number": "4985",
"account_type": "Expense Account"
}
},
"Zinsaufwendungen": {
"is_group": 1,
"Zinsaufwendungen f\u00fcr kurzfristige Verbindlichkeiten": {
"account_number": "2110",
"account_type": "Expense Account"
},
"Zinsaufwendungen f\u00fcr KFZ Finanzierung": {
"account_number": "2121",
"account_type": "Expense Account"
}
}
},
"Anfangsbestand 9": {
"is_group": 1,
"root_type": "Equity",
"Saldenvortragskonten": {
"is_group": 1,
"Saldenvortrag Sachkonten": {
"account_number": "9000"
},
"Saldenvortr\u00e4ge Debitoren": {
"account_number": "9008"
},
"Saldenvortr\u00e4ge Kreditoren": {
"account_number": "9009"
}
}
},
"Privatkonten 1": {
"is_group": 1,
"root_type": "Equity",
"Privatentnahmen/-einlagen": {
"is_group": 1,
"Privatentnahme allgemein": {
"account_number": "1800"
},
"Privatsteuern": {
"account_number": "1810"
},
"Sonderausgaben beschr\u00e4nkt abzugsf\u00e4hig": {
"account_number": "1820"
},
"Sonderausgaben unbeschr\u00e4nkt abzugsf\u00e4hig": {
"account_number": "1830"
},
"Au\u00dfergew\u00f6hnliche Belastungen": {
"account_number": "1850"
},
"Privateinlagen": {
"account_number": "1890"
}
}
}
}
},
"Kfz-Kosten": {
"is_group": 1,
"Kfz-Steuer": {
"account_number": "4510",
"account_type": "Expense Account"
},
"Kfz-Versicherungen": {
"account_number": "4520",
"account_type": "Expense Account"
},
"laufende Kfz-Betriebskosten": {
"account_number": "4530",
"account_type": "Expense Account"
},
"Kfz-Reparaturen": {
"account_number": "4540",
"account_type": "Expense Account"
},
"Fremdfahrzeuge": {
"account_number": "4570",
"account_type": "Expense Account"
},
"sonstige Kfz-Kosten": {
"account_number": "4580",
"account_type": "Expense Account"
}
},
"Personalkosten": {
"is_group": 1,
"Gehälter": {
"account_number": "4120",
"account_type": "Expense Account"
},
"gesetzliche soziale Aufwendungen": {
"account_number": "4130",
"account_type": "Expense Account"
},
"Aufwendungen für Altersvorsorge": {
"account_number": "4165",
"account_type": "Expense Account"
},
"Vermögenswirksame Leistungen": {
"account_number": "4170",
"account_type": "Expense Account"
},
"Aushilfslöhne": {
"account_number": "4190",
"account_type": "Expense Account"
}
},
"Raumkosten": {
"is_group": 1,
"Miete und Nebenkosten": {
"account_number": "4210",
"account_type": "Expense Account"
},
"Gas, Wasser, Strom (Verwaltung, Vertrieb)": {
"account_number": "4240",
"account_type": "Expense Account"
},
"Reinigung": {
"account_number": "4250",
"account_type": "Expense Account"
}
},
"Reparatur/Instandhaltung": {
"is_group": 1,
"Reparaturen und Instandhaltungen von anderen Anlagen und Betriebs- und Geschäftsausstattung": {
"account_number": "4805",
"account_type": "Expense Account"
}
},
"Versicherungsbeiträge": {
"is_group": 1,
"Versicherungen": {
"account_number": "4360",
"account_type": "Expense Account"
},
"Beiträge": {
"account_number": "4380",
"account_type": "Expense Account"
},
"sonstige Ausgaben": {
"account_number": "4390",
"account_type": "Expense Account"
},
"steuerlich abzugsfähige Verspätungszuschläge und Zwangsgelder": {
"account_number": "4396",
"account_type": "Expense Account"
}
},
"Werbe-/Reisekosten": {
"is_group": 1,
"Werbekosten": {
"account_number": "4610",
"account_type": "Expense Account"
},
"Aufmerksamkeiten": {
"account_number": "4653",
"account_type": "Expense Account"
},
"nicht abzugsfähige Betriebsausg. aus Werbe-, Repräs.- u. Reisekosten": {
"account_number": "4665",
"account_type": "Expense Account"
},
"Reisekosten Unternehmer": {
"account_number": "4670",
"account_type": "Expense Account"
}
},
"verschiedene Kosten": {
"is_group": 1,
"Porto": {
"account_number": "4910",
"account_type": "Expense Account"
},
"Telekom": {
"account_number": "4920",
"account_type": "Expense Account"
},
"Mobilfunk D2": {
"account_number": "4921",
"account_type": "Expense Account"
},
"Internet": {
"account_number": "4922",
"account_type": "Expense Account"
},
"Bürobedarf": {
"account_number": "4930",
"account_type": "Expense Account"
},
"Zeitschriften, Bücher": {
"account_number": "4940",
"account_type": "Expense Account"
},
"Fortbildungskosten": {
"account_number": "4945",
"account_type": "Expense Account"
},
"Buchführungskosten": {
"account_number": "4955",
"account_type": "Expense Account"
},
"Abschluß- u. Prüfungskosten": {
"account_number": "4957",
"account_type": "Expense Account"
},
"Nebenkosten des Geldverkehrs": {
"account_number": "4970",
"account_type": "Expense Account"
},
"Werkzeuge und Kleingeräte": {
"account_number": "4985",
"account_type": "Expense Account"
}
},
"Zinsaufwendungen": {
"is_group": 1,
"Zinsaufwendungen für kurzfristige Verbindlichkeiten": {
"account_number": "2110",
"account_type": "Expense Account"
},
"Zinsaufwendungen für KFZ Finanzierung": {
"account_number": "2121",
"account_type": "Expense Account"
}
}
},
"Anfangsbestand 9": {
"is_group": 1,
"root_type": "Equity",
"Saldenvortragskonten": {
"is_group": 1,
"Saldenvortrag Sachkonten": {
"account_number": "9000"
},
"Saldenvorträge Debitoren": {
"account_number": "9008"
},
"Saldenvorträge Kreditoren": {
"account_number": "9009"
}
}
},
"Privatkonten 1": {
"is_group": 1,
"root_type": "Equity",
"Privatentnahmen/-einlagen": {
"is_group": 1,
"Privatentnahme allgemein": {
"account_number": "1800"
},
"Privatsteuern": {
"account_number": "1810"
},
"Sonderausgaben beschränkt abzugsfähig": {
"account_number": "1820"
},
"Sonderausgaben unbeschränkt abzugsfähig": {
"account_number": "1830"
},
"Außergewöhnliche Belastungen": {
"account_number": "1850"
},
"Privateinlagen": {
"account_number": "1890"
}
}
}
}
}

View File

@@ -5,10 +5,13 @@
import unittest
import frappe
from frappe.test_runner import make_test_records
from erpnext.accounts.doctype.account.account import merge_account, update_account_number
from erpnext.stock import get_company_default_inventory_account, get_warehouse_account
test_dependencies = ["Company"]
class TestAccount(unittest.TestCase):
def test_rename_account(self):
@@ -188,6 +191,58 @@ class TestAccount(unittest.TestCase):
frappe.delete_doc("Account", "1234 - Test Rename Sync Account - _TC4")
frappe.delete_doc("Account", "1234 - Test Rename Sync Account - _TC5")
def test_account_currency_sync(self):
"""
In a parent->child company setup, child should inherit parent account currency if explicitly specified.
"""
make_test_records("Company")
frappe.local.flags.pop("ignore_root_company_validation", None)
def create_bank_account():
acc = frappe.new_doc("Account")
acc.account_name = "_Test Bank JPY"
acc.parent_account = "Temporary Accounts - _TC6"
acc.company = "_Test Company 6"
return acc
acc = create_bank_account()
# Explicitly set currency
acc.account_currency = "JPY"
acc.insert()
self.assertTrue(
frappe.db.exists(
{
"doctype": "Account",
"account_name": "_Test Bank JPY",
"account_currency": "JPY",
"company": "_Test Company 7",
}
)
)
frappe.delete_doc("Account", "_Test Bank JPY - _TC6")
frappe.delete_doc("Account", "_Test Bank JPY - _TC7")
acc = create_bank_account()
# default currency is used
acc.insert()
self.assertTrue(
frappe.db.exists(
{
"doctype": "Account",
"account_name": "_Test Bank JPY",
"account_currency": "USD",
"company": "_Test Company 7",
}
)
)
frappe.delete_doc("Account", "_Test Bank JPY - _TC6")
frappe.delete_doc("Account", "_Test Bank JPY - _TC7")
def test_child_company_account_rename_sync(self):
frappe.local.flags.pop("ignore_root_company_validation", None)
@@ -297,7 +352,7 @@ def _make_test_records(verbose=None):
# fixed asset depreciation
["_Test Fixed Asset", "Current Assets", 0, "Fixed Asset", None],
["_Test Accumulated Depreciations", "Current Assets", 0, "Accumulated Depreciation", None],
["_Test Depreciations", "Expenses", 0, None, None],
["_Test Depreciations", "Expenses", 0, "Depreciation", None],
["_Test Gain/Loss on Asset Disposal", "Expenses", 0, None, None],
# Receivable / Payable Account
["_Test Receivable", "Current Assets", 0, "Receivable", None],

View File

@@ -3,10 +3,6 @@
frappe.ui.form.on('Accounting Dimension Filter', {
refresh: function(frm, cdt, cdn) {
if (frm.doc.accounting_dimension) {
frm.set_df_property('dimensions', 'label', frm.doc.accounting_dimension, cdn, 'dimension_value');
}
let help_content =
`<table class="table table-bordered" style="background-color: var(--scrollbar-track-color);">
<tr><td>
@@ -68,6 +64,7 @@ frappe.ui.form.on('Accounting Dimension Filter', {
frm.clear_table("dimensions");
let row = frm.add_child("dimensions");
row.accounting_dimension = frm.doc.accounting_dimension;
frm.fields_dict["dimensions"].grid.update_docfield_property("dimension_value", "label", frm.doc.accounting_dimension);
frm.refresh_field("dimensions");
frm.trigger('setup_filters');
},

View File

@@ -19,6 +19,8 @@
"column_break_17",
"enable_common_party_accounting",
"allow_multi_currency_invoices_against_single_party_account",
"journals_section",
"merge_similar_account_heads",
"report_setting_section",
"use_custom_cash_flow",
"deferred_accounting_settings_section",
@@ -31,12 +33,15 @@
"determine_address_tax_category_from",
"column_break_19",
"add_taxes_from_item_tax_template",
"book_tax_discount_loss",
"print_settings",
"show_inclusive_tax_in_print",
"column_break_12",
"show_payment_schedule_in_print",
"currency_exchange_section",
"allow_stale",
"section_break_jpd0",
"auto_reconcile_payments",
"stale_days",
"invoicing_settings_tab",
"accounts_transactions_settings_section",
@@ -91,7 +96,7 @@
},
{
"default": "0",
"description": "Enabling ensure each Sales Invoice has a unique value in Supplier Invoice No. field",
"description": "Enabling ensure each Purchase Invoice has a unique value in Supplier Invoice No. field",
"fieldname": "check_supplier_invoice_uniqueness",
"fieldtype": "Check",
"label": "Check Supplier Invoice Number Uniqueness"
@@ -167,11 +172,6 @@
"fieldtype": "Int",
"label": "Stale Days"
},
{
"fieldname": "report_settings_sb",
"fieldtype": "Section Break",
"label": "Report Settings"
},
{
"default": "0",
"description": "Only select this if you have set up the Cash Flow Mapper documents",
@@ -181,6 +181,7 @@
},
{
"default": "0",
"description": "Payment Terms from orders will be fetched into the invoices as is",
"fieldname": "automatically_fetch_payment_terms",
"fieldtype": "Check",
"label": "Automatically Fetch Payment Terms from Order"
@@ -347,6 +348,36 @@
"fieldname": "allow_multi_currency_invoices_against_single_party_account",
"fieldtype": "Check",
"label": "Allow multi-currency invoices against single party account "
},
{
"default": "0",
"description": "Split Early Payment Discount Loss into Income and Tax Loss",
"fieldname": "book_tax_discount_loss",
"fieldtype": "Check",
"label": "Book Tax Loss on Early Payment Discount"
},
{
"fieldname": "journals_section",
"fieldtype": "Section Break",
"label": "Journals"
},
{
"default": "0",
"description": "Rows with Same Account heads will be merged on Ledger",
"fieldname": "merge_similar_account_heads",
"fieldtype": "Check",
"label": "Merge Similar Account Heads"
},
{
"fieldname": "section_break_jpd0",
"fieldtype": "Section Break",
"label": "Payment Reconciliations"
},
{
"default": "0",
"fieldname": "auto_reconcile_payments",
"fieldtype": "Check",
"label": "Auto Reconcile Payments"
}
],
"icon": "icon-cog",
@@ -354,7 +385,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2022-07-11 13:37:50.605141",
"modified": "2023-04-21 13:11:37.130743",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",

View File

@@ -118,6 +118,10 @@ erpnext.integrations.refreshPlaidLink = class refreshPlaidLink {
}
plaid_success(token, response) {
frappe.show_alert({ message: __('Plaid Link Updated'), indicator: 'green' });
frappe.xcall('erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.update_bank_account_ids', {
response: response,
}).then(() => {
frappe.show_alert({ message: __('Plaid Link Updated'), indicator: 'green' });
});
}
};

View File

@@ -4,6 +4,23 @@
frappe.ui.form.on("Bank Clearance", {
setup: function(frm) {
frm.add_fetch("account", "account_currency", "account_currency");
frm.set_query("account", function() {
return {
"filters": {
"account_type": ["in",["Bank","Cash"]],
"is_group": 0,
}
};
});
frm.set_query("bank_account", function () {
return {
filters: {
'is_company_account': 1
},
};
});
},
onload: function(frm) {
@@ -12,14 +29,7 @@ frappe.ui.form.on("Bank Clearance", {
locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]: "";
frm.set_value("account", default_bank_account);
frm.set_query("account", function() {
return {
"filters": {
"account_type": ["in",["Bank","Cash"]],
"is_group": 0
}
};
});
frm.set_value("from_date", frappe.datetime.month_start());
frm.set_value("to_date", frappe.datetime.month_end());
@@ -27,6 +37,11 @@ frappe.ui.form.on("Bank Clearance", {
refresh: function(frm) {
frm.disable_save();
frm.add_custom_button(__('Get Payment Entries'), () =>
frm.trigger("get_payment_entries")
);
frm.change_custom_button_type('Get Payment Entries', null, 'primary');
},
update_clearance_date: function(frm) {
@@ -36,22 +51,30 @@ frappe.ui.form.on("Bank Clearance", {
callback: function(r, rt) {
frm.refresh_field("payment_entries");
frm.refresh_fields();
if (!frm.doc.payment_entries.length) {
frm.change_custom_button_type('Get Payment Entries', null, 'primary');
frm.change_custom_button_type('Update Clearance Date', null, 'default');
}
}
});
},
get_payment_entries: function(frm) {
return frappe.call({
method: "get_payment_entries",
doc: frm.doc,
callback: function(r, rt) {
frm.refresh_field("payment_entries");
frm.refresh_fields();
$(frm.fields_dict.payment_entries.wrapper).find("[data-fieldname=amount]").each(function(i,v){
if (i !=0){
$(v).addClass("text-right")
}
})
if (frm.doc.payment_entries.length) {
frm.add_custom_button(__('Update Clearance Date'), () =>
frm.trigger("update_clearance_date")
);
frm.change_custom_button_type('Get Payment Entries', null, 'default');
frm.change_custom_button_type('Update Clearance Date', null, 'primary');
}
}
});
}

View File

@@ -1,4 +1,5 @@
{
"actions": [],
"allow_copy": 1,
"creation": "2013-01-10 16:34:05",
"doctype": "DocType",
@@ -13,11 +14,8 @@
"bank_account",
"include_reconciled_entries",
"include_pos_transactions",
"get_payment_entries",
"section_break_10",
"payment_entries",
"update_clearance_date",
"total_amount"
"payment_entries"
],
"fields": [
{
@@ -76,11 +74,6 @@
"fieldtype": "Check",
"label": "Include POS Transactions"
},
{
"fieldname": "get_payment_entries",
"fieldtype": "Button",
"label": "Get Payment Entries"
},
{
"fieldname": "section_break_10",
"fieldtype": "Section Break"
@@ -91,25 +84,14 @@
"fieldtype": "Table",
"label": "Payment Entries",
"options": "Bank Clearance Detail"
},
{
"fieldname": "update_clearance_date",
"fieldtype": "Button",
"label": "Update Clearance Date"
},
{
"fieldname": "total_amount",
"fieldtype": "Currency",
"label": "Total Amount",
"options": "account_currency",
"read_only": 1
}
],
"hide_toolbar": 1,
"icon": "fa fa-check",
"idx": 1,
"issingle": 1,
"modified": "2020-04-06 16:12:06.628008",
"links": [],
"modified": "2022-11-28 17:24:13.008692",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Clearance",
@@ -126,5 +108,6 @@
"quick_entry": 1,
"read_only": 1,
"sort_field": "modified",
"sort_order": "ASC"
"sort_order": "ASC",
"states": []
}

View File

@@ -56,7 +56,7 @@ class BankClearance(Document):
select
"Payment Entry" as payment_document, name as payment_entry,
reference_no as cheque_number, reference_date as cheque_date,
if(paid_from=%(account)s, paid_amount, 0) as credit,
if(paid_from=%(account)s, paid_amount + total_taxes_and_charges, 0) as credit,
if(paid_from=%(account)s, 0, received_amount) as debit,
posting_date, ifnull(party,if(paid_from=%(account)s,paid_to,paid_from)) as against_account, clearance_date,
if(paid_to=%(account)s, paid_to_account_currency, paid_from_account_currency) as account_currency
@@ -81,7 +81,7 @@ class BankClearance(Document):
loan_disbursement = frappe.qb.DocType("Loan Disbursement")
loan_disbursements = (
query = (
frappe.qb.from_(loan_disbursement)
.select(
ConstantColumn("Loan Disbursement").as_("payment_document"),
@@ -90,17 +90,22 @@ class BankClearance(Document):
ConstantColumn(0).as_("debit"),
loan_disbursement.reference_number.as_("cheque_number"),
loan_disbursement.reference_date.as_("cheque_date"),
loan_disbursement.clearance_date.as_("clearance_date"),
loan_disbursement.disbursement_date.as_("posting_date"),
loan_disbursement.applicant.as_("against_account"),
)
.where(loan_disbursement.docstatus == 1)
.where(loan_disbursement.disbursement_date >= self.from_date)
.where(loan_disbursement.disbursement_date <= self.to_date)
.where(loan_disbursement.clearance_date.isnull())
.where(loan_disbursement.disbursement_account.isin([self.bank_account, self.account]))
.orderby(loan_disbursement.disbursement_date)
.orderby(loan_disbursement.name, frappe.qb.desc)
).run(as_dict=1)
.orderby(loan_disbursement.name, order=frappe.qb.desc)
)
if not self.include_reconciled_entries:
query = query.where(loan_disbursement.clearance_date.isnull())
loan_disbursements = query.run(as_dict=1)
loan_repayment = frappe.qb.DocType("Loan Repayment")
@@ -113,20 +118,25 @@ class BankClearance(Document):
ConstantColumn(0).as_("credit"),
loan_repayment.reference_number.as_("cheque_number"),
loan_repayment.reference_date.as_("cheque_date"),
loan_repayment.clearance_date.as_("clearance_date"),
loan_repayment.applicant.as_("against_account"),
loan_repayment.posting_date,
)
.where(loan_repayment.docstatus == 1)
.where(loan_repayment.clearance_date.isnull())
.where(loan_repayment.posting_date >= self.from_date)
.where(loan_repayment.posting_date <= self.to_date)
.where(loan_repayment.payment_account.isin([self.bank_account, self.account]))
)
if not self.include_reconciled_entries:
query = query.where(loan_repayment.clearance_date.isnull())
if frappe.db.has_column("Loan Repayment", "repay_from_salary"):
query = query.where((loan_repayment.repay_from_salary == 0))
query = query.orderby(loan_repayment.posting_date).orderby(loan_repayment.name, frappe.qb.desc)
query = query.orderby(loan_repayment.posting_date).orderby(
loan_repayment.name, order=frappe.qb.desc
)
loan_repayments = query.run(as_dict=True)
@@ -177,7 +187,6 @@ class BankClearance(Document):
)
self.set("payment_entries", [])
self.total_amount = 0.0
default_currency = erpnext.get_default_currency()
for d in entries:
@@ -196,7 +205,6 @@ class BankClearance(Document):
d.pop("debit")
d.pop("account_currency")
row.update(d)
self.total_amount += flt(amount)
@frappe.whitelist()
def update_clearance_date(self):

View File

@@ -43,20 +43,13 @@ frappe.ui.form.on('Bank Guarantee', {
reference_docname: function(frm) {
if (frm.doc.reference_docname && frm.doc.reference_doctype) {
let fields_to_fetch = ["grand_total"];
let party_field = frm.doc.reference_doctype == "Sales Order" ? "customer" : "supplier";
if (frm.doc.reference_doctype == "Sales Order") {
fields_to_fetch.push("project");
}
fields_to_fetch.push(party_field);
frappe.call({
method: "erpnext.accounts.doctype.bank_guarantee.bank_guarantee.get_vouchar_detials",
method: "erpnext.accounts.doctype.bank_guarantee.bank_guarantee.get_voucher_details",
args: {
"column_list": fields_to_fetch,
"doctype": frm.doc.reference_doctype,
"docname": frm.doc.reference_docname
"bank_guarantee_type": frm.doc.bg_type,
"reference_name": frm.doc.reference_docname
},
callback: function(r) {
if (r.message) {

View File

@@ -2,11 +2,8 @@
# For license information, please see license.txt
import json
import frappe
from frappe import _
from frappe.desk.search import sanitize_searchfield
from frappe.model.document import Document
@@ -25,14 +22,18 @@ class BankGuarantee(Document):
@frappe.whitelist()
def get_vouchar_detials(column_list, doctype, docname):
column_list = json.loads(column_list)
for col in column_list:
sanitize_searchfield(col)
return frappe.db.sql(
""" select {columns} from `tab{doctype}` where name=%s""".format(
columns=", ".join(column_list), doctype=doctype
),
docname,
as_dict=1,
)[0]
def get_voucher_details(bank_guarantee_type: str, reference_name: str):
if not isinstance(reference_name, str):
raise TypeError("reference_name must be a string")
fields_to_fetch = ["grand_total"]
if bank_guarantee_type == "Receiving":
doctype = "Sales Order"
fields_to_fetch.append("customer")
fields_to_fetch.append("project")
else:
doctype = "Purchase Order"
fields_to_fetch.append("supplier")
return frappe.db.get_value(doctype, reference_name, fields_to_fetch, as_dict=True)

View File

@@ -12,19 +12,36 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
},
};
});
let no_bank_transactions_text =
`<div class="text-muted text-center">${__("No Matching Bank Transactions Found")}</div>`
set_field_options("no_bank_transactions", no_bank_transactions_text);
},
onload: function (frm) {
// Set default filter dates
today = frappe.datetime.get_today()
frm.doc.bank_statement_from_date = frappe.datetime.add_months(today, -1);
frm.doc.bank_statement_to_date = today;
frm.trigger('bank_account');
},
filter_by_reference_date: function (frm) {
if (frm.doc.filter_by_reference_date) {
frm.set_value("bank_statement_from_date", "");
frm.set_value("bank_statement_to_date", "");
} else {
frm.set_value("from_reference_date", "");
frm.set_value("to_reference_date", "");
}
},
refresh: function (frm) {
frm.disable_save();
frappe.require("bank-reconciliation-tool.bundle.js", () =>
frm.trigger("make_reconciliation_tool")
);
frm.upload_statement_button = frm.page.set_secondary_action(
__("Upload Bank Statement"),
() =>
frm.add_custom_button(__("Upload Bank Statement"), () =>
frappe.call({
method:
"erpnext.accounts.doctype.bank_statement_import.bank_statement_import.upload_bank_statement",
@@ -46,10 +63,26 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
},
})
);
},
after_save: function (frm) {
frm.trigger("make_reconciliation_tool");
frm.add_custom_button(__('Auto Reconcile'), function() {
frappe.call({
method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.auto_reconcile_vouchers",
args: {
bank_account: frm.doc.bank_account,
from_date: frm.doc.bank_statement_from_date,
to_date: frm.doc.bank_statement_to_date,
filter_by_reference_date: frm.doc.filter_by_reference_date,
from_reference_date: frm.doc.from_reference_date,
to_reference_date: frm.doc.to_reference_date,
},
})
});
frm.add_custom_button(__('Get Unreconciled Entries'), function() {
frm.trigger("make_reconciliation_tool");
});
frm.change_custom_button_type('Get Unreconciled Entries', null, 'primary');
},
bank_account: function (frm) {
@@ -63,7 +96,7 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
r.account,
"account_currency",
(r) => {
frm.currency = r.account_currency;
frm.doc.account_currency = r.account_currency;
frm.trigger("render_chart");
}
);
@@ -129,19 +162,19 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
}
},
render_chart: frappe.utils.debounce((frm) => {
render_chart(frm) {
frm.cards_manager = new erpnext.accounts.bank_reconciliation.NumberCardManager(
{
$reconciliation_tool_cards: frm.get_field(
"reconciliation_tool_cards"
).$wrapper,
bank_statement_closing_balance:
frm.doc.bank_statement_closing_balance,
frm.doc.bank_statement_closing_balance,
cleared_balance: frm.cleared_balance,
currency: frm.currency,
currency: frm.doc.account_currency,
}
);
}, 500),
},
render(frm) {
if (frm.doc.bank_account) {
@@ -157,6 +190,9 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
).$wrapper,
bank_statement_from_date: frm.doc.bank_statement_from_date,
bank_statement_to_date: frm.doc.bank_statement_to_date,
filter_by_reference_date: frm.doc.filter_by_reference_date,
from_reference_date: frm.doc.from_reference_date,
to_reference_date: frm.doc.to_reference_date,
bank_statement_closing_balance:
frm.doc.bank_statement_closing_balance,
cards_manager: frm.cards_manager,

View File

@@ -10,7 +10,11 @@
"column_break_1",
"bank_statement_from_date",
"bank_statement_to_date",
"from_reference_date",
"to_reference_date",
"filter_by_reference_date",
"column_break_2",
"account_currency",
"account_opening_balance",
"bank_statement_closing_balance",
"section_break_1",
@@ -36,13 +40,13 @@
"fieldtype": "Column Break"
},
{
"depends_on": "eval: doc.bank_account",
"depends_on": "eval: doc.bank_account && !doc.filter_by_reference_date",
"fieldname": "bank_statement_from_date",
"fieldtype": "Date",
"label": "From Date"
},
{
"depends_on": "eval: doc.bank_statement_from_date",
"depends_on": "eval: doc.bank_account && !doc.filter_by_reference_date",
"fieldname": "bank_statement_to_date",
"fieldtype": "Date",
"label": "To Date"
@@ -56,7 +60,7 @@
"fieldname": "account_opening_balance",
"fieldtype": "Currency",
"label": "Account Opening Balance",
"options": "Currency",
"options": "account_currency",
"read_only": 1
},
{
@@ -64,7 +68,7 @@
"fieldname": "bank_statement_closing_balance",
"fieldtype": "Currency",
"label": "Closing Balance",
"options": "Currency"
"options": "account_currency"
},
{
"fieldname": "section_break_1",
@@ -83,13 +87,38 @@
"fieldname": "no_bank_transactions",
"fieldtype": "HTML",
"options": "<div class=\"text-muted text-center\">No Matching Bank Transactions Found</div>"
},
{
"depends_on": "eval:doc.filter_by_reference_date",
"fieldname": "from_reference_date",
"fieldtype": "Date",
"label": "From Reference Date"
},
{
"depends_on": "eval:doc.filter_by_reference_date",
"fieldname": "to_reference_date",
"fieldtype": "Date",
"label": "To Reference Date"
},
{
"default": "0",
"fieldname": "filter_by_reference_date",
"fieldtype": "Check",
"label": "Filter by Reference Date"
},
{
"fieldname": "account_currency",
"fieldtype": "Link",
"hidden": 1,
"label": "Account Currency",
"options": "Currency"
}
],
"hide_toolbar": 1,
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2021-04-21 11:13:49.831769",
"modified": "2023-03-07 11:02:24.535714",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Reconciliation Tool",
@@ -108,5 +137,6 @@
],
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC"
"sort_order": "DESC",
"states": []
}

View File

@@ -8,9 +8,9 @@ import frappe
from frappe import _
from frappe.model.document import Document
from frappe.query_builder.custom import ConstantColumn
from frappe.utils import flt
from frappe.utils import cint, flt
from erpnext.accounts.doctype.bank_transaction.bank_transaction import get_paid_amount
from erpnext.accounts.doctype.bank_transaction.bank_transaction import get_total_allocated_amount
from erpnext.accounts.report.bank_reconciliation_statement.bank_reconciliation_statement import (
get_amounts_not_reflected_in_system,
get_entries,
@@ -28,7 +28,7 @@ def get_bank_transactions(bank_account, from_date=None, to_date=None):
filters = []
filters.append(["bank_account", "=", bank_account])
filters.append(["docstatus", "=", 1])
filters.append(["unallocated_amount", ">", 0])
filters.append(["unallocated_amount", ">", 0.0])
if to_date:
filters.append(["date", "<=", to_date])
if from_date:
@@ -50,6 +50,7 @@ def get_bank_transactions(bank_account, from_date=None, to_date=None):
"party",
],
filters=filters,
order_by="date",
)
return transactions
@@ -65,7 +66,7 @@ def get_account_balance(bank_account, till_date):
balance_as_per_system = get_balance_on(filters["account"], filters["report_date"])
total_debit, total_credit = 0, 0
total_debit, total_credit = 0.0, 0.0
for d in data:
total_debit += flt(d.debit)
total_credit += flt(d.credit)
@@ -144,10 +145,8 @@ def create_journal_entry_bts(
accounts.append(
{
"account": second_account,
"credit_in_account_currency": bank_transaction.deposit if bank_transaction.deposit > 0 else 0,
"debit_in_account_currency": bank_transaction.withdrawal
if bank_transaction.withdrawal > 0
else 0,
"credit_in_account_currency": bank_transaction.deposit,
"debit_in_account_currency": bank_transaction.withdrawal,
"party_type": party_type,
"party": party,
}
@@ -157,10 +156,8 @@ def create_journal_entry_bts(
{
"account": company_account,
"bank_account": bank_transaction.bank_account,
"credit_in_account_currency": bank_transaction.withdrawal
if bank_transaction.withdrawal > 0
else 0,
"debit_in_account_currency": bank_transaction.deposit if bank_transaction.deposit > 0 else 0,
"credit_in_account_currency": bank_transaction.withdrawal,
"debit_in_account_currency": bank_transaction.deposit,
}
)
@@ -184,16 +181,22 @@ def create_journal_entry_bts(
journal_entry.insert()
journal_entry.submit()
if bank_transaction.deposit > 0:
if bank_transaction.deposit > 0.0:
paid_amount = bank_transaction.deposit
else:
paid_amount = bank_transaction.withdrawal
vouchers = json.dumps(
[{"payment_doctype": "Journal Entry", "payment_name": journal_entry.name, "amount": paid_amount}]
[
{
"payment_doctype": "Journal Entry",
"payment_name": journal_entry.name,
"amount": paid_amount,
}
]
)
return reconcile_vouchers(bank_transaction.name, vouchers)
return reconcile_vouchers(bank_transaction_name, vouchers)
@frappe.whitelist()
@@ -217,7 +220,7 @@ def create_payment_entry_bts(
as_dict=True,
)[0]
paid_amount = bank_transaction.unallocated_amount
payment_type = "Receive" if bank_transaction.deposit > 0 else "Pay"
payment_type = "Receive" if bank_transaction.deposit > 0.0 else "Pay"
company_account = frappe.get_value("Bank Account", bank_transaction.bank_account, "account")
company = frappe.get_value("Account", company_account, "company")
@@ -256,9 +259,89 @@ def create_payment_entry_bts(
payment_entry.submit()
vouchers = json.dumps(
[{"payment_doctype": "Payment Entry", "payment_name": payment_entry.name, "amount": paid_amount}]
[
{
"payment_doctype": "Payment Entry",
"payment_name": payment_entry.name,
"amount": paid_amount,
}
]
)
return reconcile_vouchers(bank_transaction.name, vouchers)
return reconcile_vouchers(bank_transaction_name, vouchers)
@frappe.whitelist()
def auto_reconcile_vouchers(
bank_account,
from_date=None,
to_date=None,
filter_by_reference_date=None,
from_reference_date=None,
to_reference_date=None,
):
frappe.flags.auto_reconcile_vouchers = True
document_types = ["payment_entry", "journal_entry"]
bank_transactions = get_bank_transactions(bank_account)
matched_transaction = []
for transaction in bank_transactions:
linked_payments = get_linked_payments(
transaction.name,
document_types,
from_date,
to_date,
filter_by_reference_date,
from_reference_date,
to_reference_date,
)
vouchers = []
for r in linked_payments:
vouchers.append(
{
"payment_doctype": r[1],
"payment_name": r[2],
"amount": r[4],
}
)
transaction = frappe.get_doc("Bank Transaction", transaction.name)
account = frappe.db.get_value("Bank Account", transaction.bank_account, "account")
matched_trans = 0
for voucher in vouchers:
gl_entry = frappe.db.get_value(
"GL Entry",
dict(
account=account, voucher_type=voucher["payment_doctype"], voucher_no=voucher["payment_name"]
),
["credit", "debit"],
as_dict=1,
)
gl_amount, transaction_amount = (
(gl_entry.credit, transaction.deposit)
if gl_entry.credit > 0
else (gl_entry.debit, transaction.withdrawal)
)
allocated_amount = gl_amount if gl_amount >= transaction_amount else transaction_amount
transaction.append(
"payment_entries",
{
"payment_document": voucher["payment_doctype"],
"payment_entry": voucher["payment_name"],
"allocated_amount": allocated_amount,
},
)
matched_transaction.append(str(transaction.name))
transaction.save()
transaction.update_allocations()
matched_transaction_len = len(set(matched_transaction))
if matched_transaction_len == 0:
frappe.msgprint(_("No matching references found for auto reconciliation"))
elif matched_transaction_len == 1:
frappe.msgprint(_("{0} transaction is reconcilied").format(matched_transaction_len))
else:
frappe.msgprint(_("{0} transactions are reconcilied").format(matched_transaction_len))
frappe.flags.auto_reconcile_vouchers = False
return frappe.get_doc("Bank Transaction", transaction.name)
@frappe.whitelist()
@@ -266,80 +349,88 @@ def reconcile_vouchers(bank_transaction_name, vouchers):
# updated clear date of all the vouchers based on the bank transaction
vouchers = json.loads(vouchers)
transaction = frappe.get_doc("Bank Transaction", bank_transaction_name)
company_account = frappe.db.get_value("Bank Account", transaction.bank_account, "account")
if transaction.unallocated_amount == 0:
frappe.throw(_("This bank transaction is already fully reconciled"))
total_amount = 0
for voucher in vouchers:
voucher["payment_entry"] = frappe.get_doc(voucher["payment_doctype"], voucher["payment_name"])
total_amount += get_paid_amount(
frappe._dict(
{
"payment_document": voucher["payment_doctype"],
"payment_entry": voucher["payment_name"],
}
),
transaction.currency,
company_account,
)
if total_amount > transaction.unallocated_amount:
frappe.throw(
_(
"The sum total of amounts of all selected vouchers should be less than the unallocated amount of the bank transaction"
)
)
account = frappe.db.get_value("Bank Account", transaction.bank_account, "account")
for voucher in vouchers:
gl_entry = frappe.db.get_value(
"GL Entry",
dict(
account=account, voucher_type=voucher["payment_doctype"], voucher_no=voucher["payment_name"]
),
["credit", "debit"],
as_dict=1,
)
gl_amount, transaction_amount = (
(gl_entry.credit, transaction.deposit)
if gl_entry.credit > 0
else (gl_entry.debit, transaction.withdrawal)
)
allocated_amount = gl_amount if gl_amount >= transaction_amount else transaction_amount
transaction.append(
"payment_entries",
{
"payment_document": voucher["payment_entry"].doctype,
"payment_entry": voucher["payment_entry"].name,
"allocated_amount": allocated_amount,
},
)
transaction.save()
transaction.update_allocations()
transaction.add_payment_entries(vouchers)
return frappe.get_doc("Bank Transaction", bank_transaction_name)
@frappe.whitelist()
def get_linked_payments(bank_transaction_name, document_types=None):
def get_linked_payments(
bank_transaction_name,
document_types=None,
from_date=None,
to_date=None,
filter_by_reference_date=None,
from_reference_date=None,
to_reference_date=None,
):
# get all matching payments for a bank transaction
transaction = frappe.get_doc("Bank Transaction", bank_transaction_name)
bank_account = frappe.db.get_values(
"Bank Account", transaction.bank_account, ["account", "company"], as_dict=True
)[0]
(account, company) = (bank_account.account, bank_account.company)
matching = check_matching(account, company, transaction, document_types)
return matching
(gl_account, company) = (bank_account.account, bank_account.company)
matching = check_matching(
gl_account,
company,
transaction,
document_types,
from_date,
to_date,
filter_by_reference_date,
from_reference_date,
to_reference_date,
)
return subtract_allocations(gl_account, matching)
def check_matching(bank_account, company, transaction, document_types):
def subtract_allocations(gl_account, vouchers):
"Look up & subtract any existing Bank Transaction allocations"
copied = []
for voucher in vouchers:
rows = get_total_allocated_amount(voucher[1], voucher[2])
amount = None
for row in rows:
if row["gl_account"] == gl_account:
amount = row["total"]
break
if amount:
l = list(voucher)
l[3] -= amount
copied.append(tuple(l))
else:
copied.append(voucher)
return copied
def check_matching(
bank_account,
company,
transaction,
document_types,
from_date,
to_date,
filter_by_reference_date,
from_reference_date,
to_reference_date,
):
exact_match = True if "exact_match" in document_types else False
# combine all types of vouchers
subquery = get_queries(bank_account, company, transaction, document_types)
subquery = get_queries(
bank_account,
company,
transaction,
document_types,
from_date,
to_date,
filter_by_reference_date,
from_reference_date,
to_reference_date,
exact_match,
)
filters = {
"amount": transaction.unallocated_amount,
"payment_type": "Receive" if transaction.deposit > 0 else "Pay",
"payment_type": "Receive" if transaction.deposit > 0.0 else "Pay",
"reference_no": transaction.reference_number,
"party_type": transaction.party_type,
"party": transaction.party,
@@ -348,7 +439,9 @@ def check_matching(bank_account, company, transaction, document_types):
matching_vouchers = []
matching_vouchers.extend(get_loan_vouchers(bank_account, transaction, document_types, filters))
matching_vouchers.extend(
get_loan_vouchers(bank_account, transaction, document_types, filters, exact_match)
)
for query in subquery:
matching_vouchers.extend(
@@ -357,14 +450,23 @@ def check_matching(bank_account, company, transaction, document_types):
filters,
)
)
return sorted(matching_vouchers, key=lambda x: x[0], reverse=True) if matching_vouchers else []
def get_queries(bank_account, company, transaction, document_types):
def get_queries(
bank_account,
company,
transaction,
document_types,
from_date,
to_date,
filter_by_reference_date,
from_reference_date,
to_reference_date,
exact_match,
):
# get queries to get matching vouchers
amount_condition = "=" if "exact_match" in document_types else "<="
account_from_to = "paid_to" if transaction.deposit > 0 else "paid_from"
account_from_to = "paid_to" if transaction.deposit > 0.0 else "paid_from"
queries = []
# get matching queries from all the apps
@@ -375,8 +477,13 @@ def get_queries(bank_account, company, transaction, document_types):
company,
transaction,
document_types,
amount_condition,
exact_match,
account_from_to,
from_date,
to_date,
filter_by_reference_date,
from_reference_date,
to_reference_date,
)
or []
)
@@ -385,43 +492,106 @@ def get_queries(bank_account, company, transaction, document_types):
def get_matching_queries(
bank_account, company, transaction, document_types, amount_condition, account_from_to
bank_account,
company,
transaction,
document_types,
exact_match,
account_from_to,
from_date,
to_date,
filter_by_reference_date,
from_reference_date,
to_reference_date,
):
queries = []
if "payment_entry" in document_types:
pe_amount_matching = get_pe_matching_query(amount_condition, account_from_to, transaction)
queries.extend([pe_amount_matching])
query = get_pe_matching_query(
exact_match,
account_from_to,
transaction,
from_date,
to_date,
filter_by_reference_date,
from_reference_date,
to_reference_date,
)
queries.append(query)
if "journal_entry" in document_types:
je_amount_matching = get_je_matching_query(amount_condition, transaction)
queries.extend([je_amount_matching])
query = get_je_matching_query(
exact_match,
transaction,
from_date,
to_date,
filter_by_reference_date,
from_reference_date,
to_reference_date,
)
queries.append(query)
if transaction.deposit > 0 and "sales_invoice" in document_types:
si_amount_matching = get_si_matching_query(amount_condition)
queries.extend([si_amount_matching])
if transaction.deposit > 0.0 and "sales_invoice" in document_types:
query = get_si_matching_query(exact_match)
queries.append(query)
if transaction.withdrawal > 0:
if transaction.withdrawal > 0.0:
if "purchase_invoice" in document_types:
pi_amount_matching = get_pi_matching_query(amount_condition)
queries.extend([pi_amount_matching])
query = get_pi_matching_query(exact_match)
queries.append(query)
if "bank_transaction" in document_types:
query = get_bt_matching_query(exact_match, transaction)
queries.append(query)
return queries
def get_loan_vouchers(bank_account, transaction, document_types, filters):
def get_loan_vouchers(bank_account, transaction, document_types, filters, exact_match):
vouchers = []
amount_condition = True if "exact_match" in document_types else False
if transaction.withdrawal > 0 and "loan_disbursement" in document_types:
vouchers.extend(get_ld_matching_query(bank_account, amount_condition, filters))
if transaction.withdrawal > 0.0 and "loan_disbursement" in document_types:
vouchers.extend(get_ld_matching_query(bank_account, exact_match, filters))
if transaction.deposit > 0 and "loan_repayment" in document_types:
vouchers.extend(get_lr_matching_query(bank_account, amount_condition, filters))
if transaction.deposit > 0.0 and "loan_repayment" in document_types:
vouchers.extend(get_lr_matching_query(bank_account, exact_match, filters))
return vouchers
def get_ld_matching_query(bank_account, amount_condition, filters):
def get_bt_matching_query(exact_match, transaction):
# get matching bank transaction query
# find bank transactions in the same bank account with opposite sign
# same bank account must have same company and currency
field = "deposit" if transaction.withdrawal > 0.0 else "withdrawal"
return f"""
SELECT
(CASE WHEN reference_number = %(reference_no)s THEN 1 ELSE 0 END
+ CASE WHEN {field} = %(amount)s THEN 1 ELSE 0 END
+ CASE WHEN ( party_type = %(party_type)s AND party = %(party)s ) THEN 1 ELSE 0 END
+ CASE WHEN unallocated_amount = %(amount)s THEN 1 ELSE 0 END
+ 1) AS rank,
'Bank Transaction' AS doctype,
name,
unallocated_amount AS paid_amount,
reference_number AS reference_no,
date AS reference_date,
party,
party_type,
date AS posting_date,
currency
FROM
`tabBank Transaction`
WHERE
status != 'Reconciled'
AND name != '{transaction.name}'
AND bank_account = '{transaction.bank_account}'
AND {field} {'= %(amount)s' if exact_match else '> 0.0'}
"""
def get_ld_matching_query(bank_account, exact_match, filters):
loan_disbursement = frappe.qb.DocType("Loan Disbursement")
matching_reference = loan_disbursement.reference_number == filters.get("reference_number")
matching_party = loan_disbursement.applicant_type == filters.get(
@@ -449,17 +619,17 @@ def get_ld_matching_query(bank_account, amount_condition, filters):
.where(loan_disbursement.disbursement_account == bank_account)
)
if amount_condition:
if exact_match:
query.where(loan_disbursement.disbursed_amount == filters.get("amount"))
else:
query.where(loan_disbursement.disbursed_amount <= filters.get("amount"))
query.where(loan_disbursement.disbursed_amount > 0.0)
vouchers = query.run(as_list=True)
return vouchers
def get_lr_matching_query(bank_account, amount_condition, filters):
def get_lr_matching_query(bank_account, exact_match, filters):
loan_repayment = frappe.qb.DocType("Loan Repayment")
matching_reference = loan_repayment.reference_number == filters.get("reference_number")
matching_party = loan_repayment.applicant_type == filters.get(
@@ -490,88 +660,129 @@ def get_lr_matching_query(bank_account, amount_condition, filters):
if frappe.db.has_column("Loan Repayment", "repay_from_salary"):
query = query.where((loan_repayment.repay_from_salary == 0))
if amount_condition:
if exact_match:
query.where(loan_repayment.amount_paid == filters.get("amount"))
else:
query.where(loan_repayment.amount_paid <= filters.get("amount"))
query.where(loan_repayment.amount_paid > 0.0)
vouchers = query.run()
return vouchers
def get_pe_matching_query(amount_condition, account_from_to, transaction):
def get_pe_matching_query(
exact_match,
account_from_to,
transaction,
from_date,
to_date,
filter_by_reference_date,
from_reference_date,
to_reference_date,
):
# get matching payment entries query
if transaction.deposit > 0:
if transaction.deposit > 0.0:
currency_field = "paid_to_account_currency as currency"
else:
currency_field = "paid_from_account_currency as currency"
filter_by_date = f"AND posting_date between '{from_date}' and '{to_date}'"
order_by = " posting_date"
filter_by_reference_no = ""
if cint(filter_by_reference_date):
filter_by_date = f"AND reference_date between '{from_reference_date}' and '{to_reference_date}'"
order_by = " reference_date"
if frappe.flags.auto_reconcile_vouchers == True:
filter_by_reference_no = f"AND reference_no = '{transaction.reference_number}'"
return f"""
SELECT
(CASE WHEN reference_no=%(reference_no)s THEN 1 ELSE 0 END
+ CASE WHEN (party_type = %(party_type)s AND party = %(party)s ) THEN 1 ELSE 0 END
+ 1 ) AS rank,
'Payment Entry' as doctype,
name,
paid_amount,
reference_no,
reference_date,
party,
party_type,
posting_date,
{currency_field}
FROM
`tabPayment Entry`
WHERE
paid_amount {amount_condition} %(amount)s
AND docstatus = 1
AND payment_type IN (%(payment_type)s, 'Internal Transfer')
AND ifnull(clearance_date, '') = ""
AND {account_from_to} = %(bank_account)s
SELECT
(CASE WHEN reference_no=%(reference_no)s THEN 1 ELSE 0 END
+ CASE WHEN (party_type = %(party_type)s AND party = %(party)s ) THEN 1 ELSE 0 END
+ CASE WHEN paid_amount = %(amount)s THEN 1 ELSE 0 END
+ 1 ) AS rank,
'Payment Entry' as doctype,
name,
paid_amount,
reference_no,
reference_date,
party,
party_type,
posting_date,
{currency_field}
FROM
`tabPayment Entry`
WHERE
docstatus = 1
AND payment_type IN (%(payment_type)s, 'Internal Transfer')
AND ifnull(clearance_date, '') = ""
AND {account_from_to} = %(bank_account)s
AND paid_amount {'= %(amount)s' if exact_match else '> 0.0'}
{filter_by_date}
{filter_by_reference_no}
order by{order_by}
"""
def get_je_matching_query(amount_condition, transaction):
def get_je_matching_query(
exact_match,
transaction,
from_date,
to_date,
filter_by_reference_date,
from_reference_date,
to_reference_date,
):
# get matching journal entry query
# We have mapping at the bank level
# So one bank could have both types of bank accounts like asset and liability
# So cr_or_dr should be judged only on basis of withdrawal and deposit and not account type
cr_or_dr = "credit" if transaction.withdrawal > 0 else "debit"
cr_or_dr = "credit" if transaction.withdrawal > 0.0 else "debit"
filter_by_date = f"AND je.posting_date between '{from_date}' and '{to_date}'"
order_by = " je.posting_date"
filter_by_reference_no = ""
if cint(filter_by_reference_date):
filter_by_date = f"AND je.cheque_date between '{from_reference_date}' and '{to_reference_date}'"
order_by = " je.cheque_date"
if frappe.flags.auto_reconcile_vouchers == True:
filter_by_reference_no = f"AND je.cheque_no = '{transaction.reference_number}'"
return f"""
SELECT
(CASE WHEN je.cheque_no=%(reference_no)s THEN 1 ELSE 0 END
+ CASE WHEN jea.{cr_or_dr}_in_account_currency = %(amount)s THEN 1 ELSE 0 END
+ 1) AS rank ,
'Journal Entry' as doctype,
'Journal Entry' AS doctype,
je.name,
jea.{cr_or_dr}_in_account_currency as paid_amount,
je.cheque_no as reference_no,
je.cheque_date as reference_date,
je.pay_to_recd_from as party,
jea.{cr_or_dr}_in_account_currency AS paid_amount,
je.cheque_no AS reference_no,
je.cheque_date AS reference_date,
je.pay_to_recd_from AS party,
jea.party_type,
je.posting_date,
jea.account_currency as currency
jea.account_currency AS currency
FROM
`tabJournal Entry Account` as jea
`tabJournal Entry Account` AS jea
JOIN
`tabJournal Entry` as je
`tabJournal Entry` AS je
ON
jea.parent = je.name
WHERE
(je.clearance_date is null or je.clearance_date='0000-00-00')
je.docstatus = 1
AND je.voucher_type NOT IN ('Opening Entry')
AND (je.clearance_date IS NULL OR je.clearance_date='0000-00-00')
AND jea.account = %(bank_account)s
AND jea.{cr_or_dr}_in_account_currency {amount_condition} %(amount)s
AND jea.{cr_or_dr}_in_account_currency {'= %(amount)s' if exact_match else '> 0.0'}
AND je.docstatus = 1
{filter_by_date}
{filter_by_reference_no}
order by {order_by}
"""
def get_si_matching_query(amount_condition):
# get matchin sales invoice query
def get_si_matching_query(exact_match):
# get matching sales invoice query
return f"""
SELECT
( CASE WHEN si.customer = %(party)s THEN 1 ELSE 0 END
( CASE WHEN si.customer = %(party)s THEN 1 ELSE 0 END
+ CASE WHEN sip.amount = %(amount)s THEN 1 ELSE 0 END
+ 1 ) AS rank,
'Sales Invoice' as doctype,
si.name,
@@ -589,18 +800,20 @@ def get_si_matching_query(amount_condition):
`tabSales Invoice` as si
ON
sip.parent = si.name
WHERE (sip.clearance_date is null or sip.clearance_date='0000-00-00')
WHERE
si.docstatus = 1
AND (sip.clearance_date is null or sip.clearance_date='0000-00-00')
AND sip.account = %(bank_account)s
AND sip.amount {amount_condition} %(amount)s
AND si.docstatus = 1
AND sip.amount {'= %(amount)s' if exact_match else '> 0.0'}
"""
def get_pi_matching_query(amount_condition):
# get matching purchase invoice query
def get_pi_matching_query(exact_match):
# get matching purchase invoice query when they are also used as payment entries (is_paid)
return f"""
SELECT
( CASE WHEN supplier = %(party)s THEN 1 ELSE 0 END
+ CASE WHEN paid_amount = %(amount)s THEN 1 ELSE 0 END
+ 1 ) AS rank,
'Purchase Invoice' as doctype,
name,
@@ -614,9 +827,9 @@ def get_pi_matching_query(amount_condition):
FROM
`tabPurchase Invoice`
WHERE
paid_amount {amount_condition} %(amount)s
AND docstatus = 1
docstatus = 1
AND is_paid = 1
AND ifnull(clearance_date, '') = ""
AND cash_bank_account = %(bank_account)s
AND cash_bank_account = %(bank_account)s
AND paid_amount {'= %(amount)s' if exact_match else '> 0.0'}
"""

View File

@@ -100,7 +100,7 @@ frappe.ui.form.on("Bank Statement Import", {
if (frm.doc.status.includes("Success")) {
frm.add_custom_button(
__("Go to {0} List", [frm.doc.reference_doctype]),
__("Go to {0} List", [__(frm.doc.reference_doctype)]),
() => frappe.set_route("List", frm.doc.reference_doctype)
);
}
@@ -141,7 +141,7 @@ frappe.ui.form.on("Bank Statement Import", {
},
show_import_status(frm) {
let import_log = JSON.parse(frm.doc.import_log || "[]");
let import_log = JSON.parse(frm.doc.statement_import_log || "[]");
let successful_records = import_log.filter((log) => log.success);
let failed_records = import_log.filter((log) => !log.success);
if (successful_records.length === 0) return;
@@ -309,7 +309,7 @@ frappe.ui.form.on("Bank Statement Import", {
// method: 'frappe.core.doctype.data_import.data_import.get_preview_from_template',
show_import_preview(frm, preview_data) {
let import_log = JSON.parse(frm.doc.import_log || "[]");
let import_log = JSON.parse(frm.doc.statement_import_log || "[]");
if (
frm.import_preview &&
@@ -439,7 +439,7 @@ frappe.ui.form.on("Bank Statement Import", {
},
show_import_log(frm) {
let import_log = JSON.parse(frm.doc.import_log || "[]");
let import_log = JSON.parse(frm.doc.statement_import_log || "[]");
let logs = import_log;
frm.toggle_display("import_log", false);
frm.toggle_display("import_log_section", logs.length > 0);

View File

@@ -24,7 +24,7 @@
"section_import_preview",
"import_preview",
"import_log_section",
"import_log",
"statement_import_log",
"show_failed_logs",
"import_log_preview",
"reference_doctype",
@@ -90,12 +90,6 @@
"options": "JSON",
"read_only": 1
},
{
"fieldname": "import_log",
"fieldtype": "Code",
"label": "Import Log",
"options": "JSON"
},
{
"fieldname": "import_log_section",
"fieldtype": "Section Break",
@@ -198,11 +192,17 @@
{
"fieldname": "column_break_4",
"fieldtype": "Column Break"
},
{
"fieldname": "statement_import_log",
"fieldtype": "Code",
"label": "Statement Import Log",
"options": "JSON"
}
],
"hide_toolbar": 1,
"links": [],
"modified": "2021-05-12 14:17:37.777246",
"modified": "2022-09-07 11:11:40.293317",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Statement Import",

View File

@@ -12,8 +12,13 @@ frappe.ui.form.on("Bank Transaction", {
};
});
},
bank_account: function(frm) {
refresh(frm) {
frm.add_custom_button(__('Unreconcile Transaction'), () => {
frm.call('remove_payment_entries')
.then( () => frm.refresh() );
});
},
bank_account: function (frm) {
set_bank_statement_filter(frm);
},
@@ -34,6 +39,7 @@ frappe.ui.form.on("Bank Transaction", {
"Journal Entry",
"Sales Invoice",
"Purchase Invoice",
"Bank Transaction",
];
}
});
@@ -49,7 +55,7 @@ const update_clearance_date = (frm, cdt, cdn) => {
frappe
.xcall(
"erpnext.accounts.doctype.bank_transaction.bank_transaction.unclear_reference_payment",
{ doctype: cdt, docname: cdn }
{ doctype: cdt, docname: cdn, bt_name: frm.doc.name }
)
.then((e) => {
if (e == "success") {

View File

@@ -20,9 +20,11 @@
"currency",
"section_break_10",
"description",
"section_break_14",
"reference_number",
"column_break_10",
"transaction_id",
"transaction_type",
"section_break_14",
"payment_entries",
"section_break_18",
"allocated_amount",
@@ -190,11 +192,21 @@
"label": "Withdrawal",
"oldfieldname": "credit",
"options": "currency"
},
{
"fieldname": "column_break_10",
"fieldtype": "Column Break"
},
{
"fieldname": "transaction_type",
"fieldtype": "Data",
"label": "Transaction Type",
"length": 50
}
],
"is_submittable": 1,
"links": [],
"modified": "2022-03-21 19:05:04.208222",
"modified": "2022-05-29 18:36:50.475964",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Transaction",
@@ -248,4 +260,4 @@
"states": [],
"title_field": "bank_account",
"track_changes": 1
}
}

View File

@@ -1,9 +1,6 @@
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from functools import reduce
import frappe
from frappe.utils import flt
@@ -18,72 +15,135 @@ class BankTransaction(StatusUpdater):
self.clear_linked_payment_entries()
self.set_status()
_saving_flag = False
# nosemgrep: frappe-semgrep-rules.rules.frappe-modifying-but-not-comitting
def on_update_after_submit(self):
self.update_allocations()
self.clear_linked_payment_entries()
self.set_status(update=True)
"Run on save(). Avoid recursion caused by multiple saves"
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):
self.clear_linked_payment_entries(for_cancel=True)
self.set_status(update=True)
def update_allocations(self):
"The doctype does not allow modifications after submission, so write to the db direct"
if self.payment_entries:
allocated_amount = reduce(
lambda x, y: flt(x) + flt(y), [x.allocated_amount for x in self.payment_entries]
)
allocated_amount = sum(p.allocated_amount for p in self.payment_entries)
else:
allocated_amount = 0
allocated_amount = 0.0
if allocated_amount:
frappe.db.set_value(self.doctype, self.name, "allocated_amount", flt(allocated_amount))
frappe.db.set_value(
self.doctype,
self.name,
"unallocated_amount",
abs(flt(self.withdrawal) - flt(self.deposit)) - flt(allocated_amount),
)
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)
else:
frappe.db.set_value(self.doctype, self.name, "allocated_amount", 0)
frappe.db.set_value(
self.doctype, self.name, "unallocated_amount", abs(flt(self.withdrawal) - flt(self.deposit))
)
def add_payment_entries(self, vouchers):
"Add the vouchers with zero allocation. Save() will perform the allocations and clearance"
if 0.0 >= self.unallocated_amount:
frappe.throw(frappe._("Bank Transaction {0} is already fully reconciled").format(self.name))
amount = self.deposit or self.withdrawal
if amount == self.allocated_amount:
frappe.db.set_value(self.doctype, self.name, "status", "Reconciled")
added = False
for voucher in vouchers:
# Can't add same voucher twice
found = False
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_entry": voucher["payment_name"],
"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):
"""Refactored from bank reconciliation tool.
Non-zero allocations must be amended/cleared manually
Get the bank transaction amount (b) and remove as we allocate
For each payment_entry if allocated_amount == 0:
- get the amount already allocated against all transactions (t), need latest date
- get the voucher amount (from gl) (v)
- allocate (a = v - t)
- a = 0: should already be cleared, so clear & remove payment_entry
- 0 < a <= u: allocate a & clear
- 0 < a, a > u: allocate u
- 0 > a: Error: already over-allocated
- 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
for payment_entry in self.payment_entries:
if payment_entry.allocated_amount == 0.0:
unallocated_amount, should_clear, latest_transaction = get_clearance_details(
self, payment_entry
)
if 0.0 == unallocated_amount:
if should_clear:
latest_transaction.clear_linked_payment_entry(payment_entry)
self.db_delete_payment_entry(payment_entry)
elif remaining_amount <= 0.0:
self.db_delete_payment_entry(payment_entry)
elif 0.0 < unallocated_amount and unallocated_amount <= remaining_amount:
payment_entry.db_set("allocated_amount", unallocated_amount)
remaining_amount -= unallocated_amount
if should_clear:
latest_transaction.clear_linked_payment_entry(payment_entry)
elif 0.0 < unallocated_amount and unallocated_amount > remaining_amount:
payment_entry.db_set("allocated_amount", remaining_amount)
remaining_amount = 0.0
elif 0.0 > unallocated_amount:
self.db_delete_payment_entry(payment_entry)
frappe.throw(frappe._("Voucher {0} is over-allocated by {1}").format(unallocated_amount))
self.reload()
def clear_linked_payment_entries(self, for_cancel=False):
def db_delete_payment_entry(self, payment_entry):
frappe.db.delete("Bank Transaction Payments", {"name": payment_entry.name})
@frappe.whitelist()
def remove_payment_entries(self):
for payment_entry in self.payment_entries:
if payment_entry.payment_document == "Sales Invoice":
self.clear_sales_invoice(payment_entry, for_cancel=for_cancel)
elif payment_entry.payment_document in get_doctypes_for_bank_reconciliation():
self.clear_simple_entry(payment_entry, for_cancel=for_cancel)
self.remove_payment_entry(payment_entry)
# runs on_update_after_submit
self.save()
def clear_simple_entry(self, payment_entry, for_cancel=False):
if payment_entry.payment_document == "Payment Entry":
if (
frappe.db.get_value("Payment Entry", payment_entry.payment_entry, "payment_type")
== "Internal Transfer"
):
if len(get_reconciled_bank_transactions(payment_entry)) < 2:
return
def remove_payment_entry(self, payment_entry):
"Clear payment entry and clearance"
self.clear_linked_payment_entry(payment_entry, for_cancel=True)
self.remove(payment_entry)
clearance_date = self.date if not for_cancel else None
frappe.db.set_value(
payment_entry.payment_document, payment_entry.payment_entry, "clearance_date", clearance_date
)
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_sales_invoice(self, payment_entry, for_cancel=False):
clearance_date = self.date if not for_cancel else None
frappe.db.set_value(
"Sales Invoice Payment",
dict(parenttype=payment_entry.payment_document, parent=payment_entry.payment_entry),
"clearance_date",
clearance_date,
def clear_linked_payment_entry(self, payment_entry, for_cancel=False):
clearance_date = None if for_cancel else self.date
set_voucher_clearance(
payment_entry.payment_document, payment_entry.payment_entry, clearance_date, self
)
@@ -93,38 +153,114 @@ def get_doctypes_for_bank_reconciliation():
return frappe.get_hooks("bank_reconciliation_doctypes")
def get_reconciled_bank_transactions(payment_entry):
reconciled_bank_transactions = frappe.get_all(
"Bank Transaction Payments",
filters={"payment_entry": payment_entry.payment_entry},
fields=["parent"],
def get_clearance_details(transaction, payment_entry):
"""
There should only be one bank gle for a voucher.
Could be none for a Bank Transaction.
But if a JE, could affect two banks.
Should only clear the voucher if all bank gles are allocated.
"""
gl_bank_account = frappe.db.get_value("Bank Account", transaction.bank_account, "account")
gles = get_related_bank_gl_entries(payment_entry.payment_document, payment_entry.payment_entry)
bt_allocations = get_total_allocated_amount(
payment_entry.payment_document, payment_entry.payment_entry
)
return reconciled_bank_transactions
unallocated_amount = min(
transaction.unallocated_amount,
get_paid_amount(payment_entry, transaction.currency, gl_bank_account),
)
unmatched_gles = len(gles)
latest_transaction = transaction
for gle in gles:
if gle["gl_account"] == gl_bank_account:
if gle["amount"] <= 0.0:
frappe.throw(
frappe._("Voucher {0} value is broken: {1}").format(
payment_entry.payment_entry, gle["amount"]
)
)
unmatched_gles -= 1
unallocated_amount = gle["amount"]
for a in bt_allocations:
if a["gl_account"] == gle["gl_account"]:
unallocated_amount = gle["amount"] - a["total"]
if frappe.utils.getdate(transaction.date) < a["latest_date"]:
latest_transaction = frappe.get_doc("Bank Transaction", a["latest_name"])
else:
# Must be a Journal Entry affecting more than one bank
for a in bt_allocations:
if a["gl_account"] == gle["gl_account"] and a["total"] == gle["amount"]:
unmatched_gles -= 1
return unallocated_amount, unmatched_gles == 0, latest_transaction
def get_total_allocated_amount(payment_entry):
return frappe.db.sql(
def get_related_bank_gl_entries(doctype, docname):
# nosemgrep: frappe-semgrep-rules.rules.frappe-using-db-sql
result = frappe.db.sql(
"""
SELECT
SUM(btp.allocated_amount) as allocated_amount,
bt.name
ABS(gle.credit_in_account_currency - gle.debit_in_account_currency) AS amount,
gle.account AS gl_account
FROM
`tabBank Transaction Payments` as btp
`tabGL Entry` gle
LEFT JOIN
`tabBank Transaction` bt ON bt.name=btp.parent
`tabAccount` ac ON ac.name=gle.account
WHERE
btp.payment_document = %s
AND
btp.payment_entry = %s
AND
bt.docstatus = 1""",
(payment_entry.payment_document, payment_entry.payment_entry),
ac.account_type = 'Bank'
AND gle.voucher_type = %(doctype)s
AND gle.voucher_no = %(docname)s
AND is_cancelled = 0
""",
dict(doctype=doctype, docname=docname),
as_dict=True,
)
return result
def get_paid_amount(payment_entry, currency, bank_account):
def get_total_allocated_amount(doctype, docname):
"""
Gets the sum of allocations for a voucher on each bank GL account
along with the latest bank transaction name & date
NOTE: query may also include just saved vouchers/payments but with zero allocated_amount
"""
# nosemgrep: frappe-semgrep-rules.rules.frappe-using-db-sql
result = frappe.db.sql(
"""
SELECT total, latest_name, latest_date, gl_account FROM (
SELECT
ROW_NUMBER() OVER w AS rownum,
SUM(btp.allocated_amount) OVER(PARTITION BY ba.account) AS total,
FIRST_VALUE(bt.name) OVER w AS latest_name,
FIRST_VALUE(bt.date) OVER w AS latest_date,
ba.account AS gl_account
FROM
`tabBank Transaction Payments` btp
LEFT JOIN `tabBank Transaction` bt ON bt.name=btp.parent
LEFT JOIN `tabBank Account` ba ON ba.name=bt.bank_account
WHERE
btp.payment_document = %(doctype)s
AND btp.payment_entry = %(docname)s
AND bt.docstatus = 1
WINDOW w AS (PARTITION BY ba.account ORDER BY bt.date desc)
) temp
WHERE
rownum = 1
""",
dict(doctype=doctype, docname=docname),
as_dict=True,
)
for row in result:
# Why is this *sometimes* a byte string?
if isinstance(row["latest_name"], bytes):
row["latest_name"] = row["latest_name"].decode()
row["latest_date"] = frappe.utils.getdate(row["latest_date"])
return result
def get_paid_amount(payment_entry, currency, gl_bank_account):
if payment_entry.payment_document in ["Payment Entry", "Sales Invoice", "Purchase Invoice"]:
paid_amount_field = "paid_amount"
@@ -137,7 +273,7 @@ def get_paid_amount(payment_entry, currency, bank_account):
)
elif doc.payment_type == "Pay":
paid_amount_field = (
"paid_amount" if doc.paid_to_account_currency == currency else "base_paid_amount"
"paid_amount" if doc.paid_from_account_currency == currency else "base_paid_amount"
)
return frappe.db.get_value(
@@ -145,10 +281,13 @@ def get_paid_amount(payment_entry, currency, bank_account):
)
elif payment_entry.payment_document == "Journal Entry":
return frappe.db.get_value(
"Journal Entry Account",
{"parent": payment_entry.payment_entry, "account": bank_account},
"sum(credit_in_account_currency)",
return abs(
frappe.db.get_value(
"Journal Entry Account",
{"parent": payment_entry.payment_entry, "account": gl_bank_account},
"sum(debit_in_account_currency-credit_in_account_currency)",
)
or 0
)
elif payment_entry.payment_document == "Expense Claim":
@@ -166,6 +305,12 @@ def get_paid_amount(payment_entry, currency, bank_account):
payment_entry.payment_document, payment_entry.payment_entry, "amount_paid"
)
elif payment_entry.payment_document == "Bank Transaction":
dep, wth = frappe.db.get_value(
"Bank Transaction", payment_entry.payment_entry, ("deposit", "withdrawal")
)
return abs(flt(wth) - flt(dep))
else:
frappe.throw(
"Please reconcile {0}: {1} manually".format(
@@ -174,18 +319,55 @@ def get_paid_amount(payment_entry, currency, bank_account):
)
@frappe.whitelist()
def unclear_reference_payment(doctype, docname):
if frappe.db.exists(doctype, docname):
doc = frappe.get_doc(doctype, docname)
if doctype == "Sales Invoice":
frappe.db.set_value(
"Sales Invoice Payment",
dict(parenttype=doc.payment_document, parent=doc.payment_entry),
"clearance_date",
None,
)
else:
frappe.db.set_value(doc.payment_document, doc.payment_entry, "clearance_date", None)
def set_voucher_clearance(doctype, docname, clearance_date, self):
if doctype in [
"Payment Entry",
"Journal Entry",
"Purchase Invoice",
"Expense Claim",
"Loan Repayment",
"Loan Disbursement",
]:
if (
doctype == "Payment Entry"
and frappe.db.get_value("Payment Entry", docname, "payment_type") == "Internal Transfer"
and len(get_reconciled_bank_transactions(doctype, docname)) < 2
):
return
frappe.db.set_value(doctype, docname, "clearance_date", clearance_date)
return doc.payment_entry
elif doctype == "Sales Invoice":
frappe.db.set_value(
"Sales Invoice Payment",
dict(parenttype=doctype, parent=docname),
"clearance_date",
clearance_date,
)
elif doctype == "Bank Transaction":
# For when a second bank transaction has fixed another, e.g. refund
bt = frappe.get_doc(doctype, docname)
if clearance_date:
vouchers = [{"payment_doctype": "Bank Transaction", "payment_name": self.name}]
bt.add_payment_entries(vouchers)
else:
for pe in bt.payment_entries:
if pe.payment_document == self.doctype and pe.payment_entry == self.name:
bt.remove(pe)
bt.save()
break
def get_reconciled_bank_transactions(doctype, docname):
return frappe.get_all(
"Bank Transaction Payments",
filters={"payment_document": doctype, "payment_entry": docname},
pluck="parent",
)
@frappe.whitelist()
def unclear_reference_payment(doctype, docname, bt_name):
bt = frappe.get_doc("Bank Transaction", bt_name)
set_voucher_clearance(doctype, docname, None, bt)
return docname

View File

@@ -5,6 +5,7 @@ import json
import unittest
import frappe
from frappe import utils
from frappe.tests.utils import FrappeTestCase
from erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool import (
@@ -40,7 +41,12 @@ class TestBankTransaction(FrappeTestCase):
"Bank Transaction",
dict(description="Re 95282925234 FE/000002917 AT171513000281183046 Conrad Electronic"),
)
linked_payments = get_linked_payments(bank_transaction.name, ["payment_entry", "exact_match"])
linked_payments = get_linked_payments(
bank_transaction.name,
["payment_entry", "exact_match"],
from_date=bank_transaction.date,
to_date=utils.today(),
)
self.assertTrue(linked_payments[0][6] == "Conrad Electronic")
# This test validates a simple reconciliation leading to the clearance of the bank transaction and the payment
@@ -81,7 +87,12 @@ class TestBankTransaction(FrappeTestCase):
"Bank Transaction",
dict(description="Auszahlung Karte MC/000002916 AUTOMAT 698769 K002 27.10. 14:07"),
)
linked_payments = get_linked_payments(bank_transaction.name, ["payment_entry", "exact_match"])
linked_payments = get_linked_payments(
bank_transaction.name,
["payment_entry", "exact_match"],
from_date=bank_transaction.date,
to_date=utils.today(),
)
self.assertTrue(linked_payments[0][3])
# Check error if already reconciled

View File

@@ -1,6 +1,7 @@
{
"actions": [],
"allow_import": 1,
"autoname": "naming_series:",
"creation": "2016-05-16 11:42:29.632528",
"doctype": "DocType",
"editable_grid": 1,
@@ -9,6 +10,7 @@
"budget_against",
"company",
"cost_center",
"naming_series",
"project",
"fiscal_year",
"column_break_3",
@@ -190,15 +192,26 @@
"label": "Budget Accounts",
"options": "Budget Account",
"reqd": 1
},
{
"fieldname": "naming_series",
"fieldtype": "Data",
"hidden": 1,
"label": "Series",
"no_copy": 1,
"print_hide": 1,
"read_only": 1,
"set_only_once": 1
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2020-10-06 15:13:54.055854",
"modified": "2022-10-10 22:14:36.361509",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Budget",
"naming_rule": "By \"Naming Series\" field",
"owner": "Administrator",
"permissions": [
{
@@ -220,5 +233,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -5,7 +5,6 @@
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.model.naming import make_autoname
from frappe.utils import add_months, flt, fmt_money, get_last_day, getdate
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
@@ -23,11 +22,6 @@ class DuplicateBudgetError(frappe.ValidationError):
class Budget(Document):
def autoname(self):
self.name = make_autoname(
self.get(frappe.scrub(self.budget_against)) + "/" + self.fiscal_year + "/.###"
)
def validate(self):
if not self.get(frappe.scrub(self.budget_against)):
frappe.throw(_("{0} is mandatory").format(self.budget_against))
@@ -109,8 +103,11 @@ class Budget(Document):
):
self.applicable_on_booking_actual_expenses = 1
def before_naming(self):
self.naming_series = f"{{{frappe.scrub(self.budget_against)}}}./.{self.fiscal_year}/.###"
def validate_expense_against_budget(args):
def validate_expense_against_budget(args, expense_amount=0):
args = frappe._dict(args)
if args.get("company") and not args.fiscal_year:
@@ -178,15 +175,20 @@ def validate_expense_against_budget(args):
) # nosec
if budget_records:
validate_budget_records(args, budget_records)
validate_budget_records(args, budget_records, expense_amount)
def validate_budget_records(args, budget_records):
def validate_budget_records(args, budget_records, expense_amount):
for budget in budget_records:
if flt(budget.budget_amount):
amount = get_amount(args, budget)
amount = expense_amount or get_amount(args, budget)
yearly_action, monthly_action = get_actions(args, budget)
if yearly_action in ("Stop", "Warn"):
compare_expense_with_budget(
args, flt(budget.budget_amount), _("Annual"), yearly_action, budget.budget_against, amount
)
if monthly_action in ["Stop", "Warn"]:
budget_amount = get_accumulated_monthly_budget(
budget.monthly_distribution, args.posting_date, args.fiscal_year, budget.budget_amount
@@ -198,28 +200,28 @@ def validate_budget_records(args, budget_records):
args, budget_amount, _("Accumulated Monthly"), monthly_action, budget.budget_against, amount
)
if (
yearly_action in ("Stop", "Warn")
and monthly_action != "Stop"
and yearly_action != monthly_action
):
compare_expense_with_budget(
args, flt(budget.budget_amount), _("Annual"), yearly_action, budget.budget_against, amount
)
def compare_expense_with_budget(args, budget_amount, action_for, action, budget_against, amount=0):
actual_expense = amount or get_actual_expense(args)
if actual_expense > budget_amount:
diff = actual_expense - budget_amount
actual_expense = get_actual_expense(args)
total_expense = actual_expense + amount
if total_expense > budget_amount:
if actual_expense > budget_amount:
error_tense = _("is already")
diff = actual_expense - budget_amount
else:
error_tense = _("will be")
diff = total_expense - budget_amount
currency = frappe.get_cached_value("Company", args.company, "default_currency")
msg = _("{0} Budget for Account {1} against {2} {3} is {4}. It will exceed by {5}").format(
msg = _("{0} Budget for Account {1} against {2} {3} is {4}. It {5} exceed by {6}").format(
_(action_for),
frappe.bold(args.account),
args.budget_against_field,
frappe.unscrub(args.budget_against_field),
frappe.bold(budget_against),
frappe.bold(fmt_money(budget_amount, currency=currency)),
error_tense,
frappe.bold(fmt_money(diff, currency=currency)),
)
@@ -230,9 +232,9 @@ def compare_expense_with_budget(args, budget_amount, action_for, action, budget_
action = "Warn"
if action == "Stop":
frappe.throw(msg, BudgetError)
frappe.throw(msg, BudgetError, title=_("Budget Exceeded"))
else:
frappe.msgprint(msg, indicator="orange")
frappe.msgprint(msg, indicator="orange", title=_("Budget Exceeded"))
def get_actions(args, budget):
@@ -354,7 +356,9 @@ def get_actual_expense(args):
"""
select sum(gle.debit) - sum(gle.credit)
from `tabGL Entry` gle
where gle.account=%(account)s
where
is_cancelled = 0
and gle.account=%(account)s
{condition1}
and gle.fiscal_year=%(fiscal_year)s
and gle.company=%(company)s

View File

@@ -334,6 +334,39 @@ class TestBudget(unittest.TestCase):
budget.cancel()
jv.cancel()
def test_monthly_budget_against_main_cost_center(self):
from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
from erpnext.accounts.doctype.cost_center_allocation.test_cost_center_allocation import (
create_cost_center_allocation,
)
cost_centers = [
"Main Budget Cost Center 1",
"Sub Budget Cost Center 1",
"Sub Budget Cost Center 2",
]
for cc in cost_centers:
create_cost_center(cost_center_name=cc, company="_Test Company")
create_cost_center_allocation(
"_Test Company",
"Main Budget Cost Center 1 - _TC",
{"Sub Budget Cost Center 1 - _TC": 60, "Sub Budget Cost Center 2 - _TC": 40},
)
make_budget(budget_against="Cost Center", cost_center="Main Budget Cost Center 1 - _TC")
jv = make_journal_entry(
"_Test Account Cost for Goods Sold - _TC",
"_Test Bank - _TC",
400000,
"Main Budget Cost Center 1 - _TC",
posting_date=nowdate(),
)
self.assertRaises(BudgetError, jv.submit)
def set_total_expense_zero(posting_date, budget_against_field=None, budget_against_CC=None):
if budget_against_field == "project":

View File

@@ -36,7 +36,7 @@ def validate_columns(data):
no_of_columns = max([len(d) for d in data])
if no_of_columns > 7:
if no_of_columns > 8:
frappe.throw(
_("More columns found than expected. Please compare the uploaded file with standard template"),
title=(_("Wrong Template")),
@@ -52,7 +52,7 @@ def validate_company(company):
if parent_company and (not allow_account_creation_against_child_company):
msg = _("{} is a child company.").format(frappe.bold(company)) + " "
msg += _("Please import accounts against parent company or enable {} in company master.").format(
frappe.bold("Allow Account Creation Against Child Company")
frappe.bold(_("Allow Account Creation Against Child Company"))
)
frappe.throw(msg, title=_("Wrong Company"))
@@ -233,6 +233,7 @@ def build_forest(data):
is_group,
account_type,
root_type,
account_currency,
) = i
if not account_name:
@@ -253,6 +254,8 @@ def build_forest(data):
charts_map[account_name]["account_type"] = account_type
if root_type:
charts_map[account_name]["root_type"] = root_type
if account_currency:
charts_map[account_name]["account_currency"] = account_currency
path = return_parent(data, account_name)[::-1]
paths.append(path) # List of path is created
line_no += 1
@@ -315,20 +318,21 @@ def get_template(template_type):
"Is Group",
"Account Type",
"Root Type",
"Account Currency",
]
writer = UnicodeWriter()
writer.writerow(fields)
if template_type == "Blank Template":
for root_type in get_root_types():
writer.writerow(["", "", "", 1, "", root_type])
writer.writerow(["", "", "", "", 1, "", root_type])
for account in get_mandatory_group_accounts():
writer.writerow(["", "", "", 1, account, "Asset"])
writer.writerow(["", "", "", "", 1, account, "Asset"])
for account_type in get_mandatory_account_types():
writer.writerow(
["", "", "", 0, account_type.get("account_type"), account_type.get("root_type")]
["", "", "", "", 0, account_type.get("account_type"), account_type.get("root_type")]
)
else:
writer = get_sample_template(writer)
@@ -485,6 +489,10 @@ def set_default_accounts(company):
"default_payable_account": frappe.db.get_value(
"Account", {"company": company.name, "account_type": "Payable", "is_group": 0}
),
"default_provisional_account": frappe.db.get_value(
"Account",
{"company": company.name, "account_type": "Service Received But Not Billed", "is_group": 0},
),
}
)

View File

@@ -16,7 +16,7 @@ class CostCenter(NestedSet):
from erpnext.accounts.utils import get_autoname_with_number
self.name = get_autoname_with_number(
self.cost_center_number, self.cost_center_name, None, self.company
self.cost_center_number, self.cost_center_name, self.company
)
def validate(self):

View File

@@ -28,9 +28,14 @@ class InvalidDateError(frappe.ValidationError):
class CostCenterAllocation(Document):
def __init__(self, *args, **kwargs):
super(CostCenterAllocation, self).__init__(*args, **kwargs)
self._skip_from_date_validation = False
def validate(self):
self.validate_total_allocation_percentage()
self.validate_from_date_based_on_existing_gle()
if not self._skip_from_date_validation:
self.validate_from_date_based_on_existing_gle()
self.validate_backdated_allocation()
self.validate_main_cost_center()
self.validate_child_cost_centers()

View File

@@ -40,7 +40,7 @@ class Dunning(AccountsController):
def on_cancel(self):
if self.dunning_amount:
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry")
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry", "Payment Ledger Entry")
make_reverse_gl_entries(voucher_type=self.doctype, voucher_no=self.name)
def make_gl_entries(self):

View File

@@ -26,7 +26,7 @@ frappe.ui.form.on('Exchange Rate Revaluation', {
doc: frm.doc,
callback: function(r) {
if (r.message) {
frm.add_custom_button(__('Journal Entry'), function() {
frm.add_custom_button(__('Journal Entries'), function() {
return frm.events.make_jv(frm);
}, __('Create'));
}
@@ -35,10 +35,11 @@ frappe.ui.form.on('Exchange Rate Revaluation', {
}
},
get_entries: function(frm) {
get_entries: function(frm, account) {
frappe.call({
method: "get_accounts_data",
doc: cur_frm.doc,
account: account,
callback: function(r){
frappe.model.clear_table(frm.doc, "accounts");
if(r.message) {
@@ -57,7 +58,6 @@ frappe.ui.form.on('Exchange Rate Revaluation', {
let total_gain_loss = 0;
frm.doc.accounts.forEach((d) => {
d.gain_loss = flt(d.new_balance_in_base_currency, precision("new_balance_in_base_currency", d)) - flt(d.balance_in_base_currency, precision("balance_in_base_currency", d));
total_gain_loss += flt(d.gain_loss, precision("gain_loss", d));
});
@@ -66,13 +66,19 @@ frappe.ui.form.on('Exchange Rate Revaluation', {
},
make_jv : function(frm) {
let revaluation_journal = null;
let zero_balance_journal = null;
frappe.call({
method: "make_jv_entry",
method: "make_jv_entries",
doc: frm.doc,
freeze: true,
freeze_message: "Making Journal Entries...",
callback: function(r){
if (r.message) {
var doc = frappe.model.sync(r.message)[0];
frappe.set_route("Form", doc.doctype, doc.name);
let response = r.message;
if(response['revaluation_jv'] || response['zero_balance_jv']) {
frappe.msgprint(__("Journals have been created"));
}
}
}
});

View File

@@ -1,389 +1,160 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 0,
"autoname": "ACC-ERR-.YYYY.-.#####",
"beta": 0,
"creation": "2018-04-13 18:25:55.943587",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"actions": [],
"allow_import": 1,
"autoname": "ACC-ERR-.YYYY.-.#####",
"creation": "2018-04-13 18:25:55.943587",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"posting_date",
"column_break_2",
"company",
"section_break_4",
"get_entries",
"accounts",
"section_break_6",
"gain_loss_unbooked",
"gain_loss_booked",
"column_break_10",
"total_gain_loss",
"amended_from"
],
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Today",
"fieldname": "posting_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Posting Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"default": "Today",
"fieldname": "posting_date",
"fieldtype": "Date",
"in_list_view": 1,
"label": "Posting Date",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "column_break_2",
"fieldtype": "Column Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"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
},
"fieldname": "company",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Company",
"options": "Company",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_4",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "section_break_4",
"fieldtype": "Section Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "get_entries",
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Get Entries",
"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
},
"fieldname": "get_entries",
"fieldtype": "Button",
"label": "Get Entries"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "accounts",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Exchange Rate Revaluation Account",
"length": 0,
"no_copy": 1,
"options": "Exchange Rate Revaluation Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "accounts",
"fieldtype": "Table",
"label": "Exchange Rate Revaluation Account",
"no_copy": 1,
"options": "Exchange Rate Revaluation Account",
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_6",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "section_break_6",
"fieldtype": "Section Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "total_gain_loss",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Total Gain/Loss",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
"fieldname": "amended_from",
"fieldtype": "Link",
"label": "Amended From",
"no_copy": 1,
"options": "Exchange Rate Revaluation",
"print_hide": 1,
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Amended From",
"length": 0,
"no_copy": 1,
"options": "Exchange Rate Revaluation",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"fieldname": "gain_loss_unbooked",
"fieldtype": "Currency",
"label": "Gain/Loss from Revaluation",
"options": "Company:company:default_currency",
"read_only": 1
},
{
"description": "Gain/Loss accumulated in foreign currency account. Accounts with '0' balance in either Base or Account currency",
"fieldname": "gain_loss_booked",
"fieldtype": "Currency",
"label": "Gain/Loss already booked",
"options": "Company:company:default_currency",
"read_only": 1
},
{
"fieldname": "total_gain_loss",
"fieldtype": "Currency",
"label": "Total Gain/Loss",
"options": "Company:company:default_currency",
"read_only": 1
},
{
"fieldname": "column_break_10",
"fieldtype": "Column Break"
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-08-21 16:15:34.660715",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Exchange Rate Revaluation",
"name_case": "",
"owner": "Administrator",
],
"is_submittable": 1,
"links": [],
"modified": "2022-12-29 19:38:24.416529",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Exchange Rate Revaluation",
"naming_rule": "Expression (old style)",
"owner": "Administrator",
"permissions": [
{
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"submit": 1,
"write": 1
},
},
{
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"share": 1,
"submit": 1,
"write": 1
},
},
{
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"share": 1,
"submit": 1,
"write": 1
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0,
"track_views": 0
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -3,10 +3,12 @@
import frappe
from frappe import _
from frappe import _, qb
from frappe.model.document import Document
from frappe.model.meta import get_field_precision
from frappe.utils import flt
from frappe.query_builder import Criterion, Order
from frappe.query_builder.functions import NullIf, Sum
from frappe.utils import flt, get_link_to_form
import erpnext
from erpnext.accounts.doctype.journal_entry.journal_entry import get_balance_on
@@ -19,11 +21,25 @@ class ExchangeRateRevaluation(Document):
def set_total_gain_loss(self):
total_gain_loss = 0
gain_loss_booked = 0
gain_loss_unbooked = 0
for d in self.accounts:
d.gain_loss = flt(
d.new_balance_in_base_currency, d.precision("new_balance_in_base_currency")
) - flt(d.balance_in_base_currency, d.precision("balance_in_base_currency"))
if not d.zero_balance:
d.gain_loss = flt(
d.new_balance_in_base_currency, d.precision("new_balance_in_base_currency")
) - flt(d.balance_in_base_currency, d.precision("balance_in_base_currency"))
if d.zero_balance:
gain_loss_booked += flt(d.gain_loss, d.precision("gain_loss"))
else:
gain_loss_unbooked += flt(d.gain_loss, d.precision("gain_loss"))
total_gain_loss += flt(d.gain_loss, d.precision("gain_loss"))
self.gain_loss_booked = gain_loss_booked
self.gain_loss_unbooked = gain_loss_unbooked
self.total_gain_loss = flt(total_gain_loss, self.precision("total_gain_loss"))
def validate_mandatory(self):
@@ -35,98 +51,205 @@ class ExchangeRateRevaluation(Document):
@frappe.whitelist()
def check_journal_entry_condition(self):
total_debit = frappe.db.get_value(
"Journal Entry Account",
{"reference_type": "Exchange Rate Revaluation", "reference_name": self.name, "docstatus": 1},
"sum(debit) as sum",
exchange_gain_loss_account = self.get_for_unrealized_gain_loss_account()
jea = qb.DocType("Journal Entry Account")
journals = (
qb.from_(jea)
.select(jea.parent)
.distinct()
.where(
(jea.reference_type == "Exchange Rate Revaluation")
& (jea.reference_name == self.name)
& (jea.docstatus == 1)
)
.run()
)
total_amt = 0
for d in self.accounts:
total_amt = total_amt + d.new_balance_in_base_currency
if journals:
gle = qb.DocType("GL Entry")
total_amt = (
qb.from_(gle)
.select((Sum(gle.credit) - Sum(gle.debit)).as_("total_amount"))
.where(
(gle.voucher_type == "Journal Entry")
& (gle.voucher_no.isin(journals))
& (gle.account == exchange_gain_loss_account)
& (gle.is_cancelled == 0)
)
.run()
)
if total_amt != total_debit:
return True
if total_amt and total_amt[0][0] != self.total_gain_loss:
return True
else:
return False
return False
return True
@frappe.whitelist()
def get_accounts_data(self, account=None):
accounts = []
def get_accounts_data(self):
self.validate_mandatory()
company_currency = erpnext.get_company_currency(self.company)
account_details = self.get_account_balance_from_gle(
company=self.company, posting_date=self.posting_date, account=None, party_type=None, party=None
)
accounts_with_new_balance = self.calculate_new_account_balance(
self.company, self.posting_date, account_details
)
if not accounts_with_new_balance:
self.throw_invalid_response_message(account_details)
return accounts_with_new_balance
@staticmethod
def get_account_balance_from_gle(company, posting_date, account, party_type, party):
account_details = []
if company and posting_date:
company_currency = erpnext.get_company_currency(company)
acc = qb.DocType("Account")
if account:
accounts = [account]
else:
res = (
qb.from_(acc)
.select(acc.name)
.where(
(acc.is_group == 0)
& (acc.report_type == "Balance Sheet")
& (acc.root_type.isin(["Asset", "Liability", "Equity"]))
& (acc.account_type != "Stock")
& (acc.company == company)
& (acc.account_currency != company_currency)
)
.orderby(acc.name)
.run(as_list=True)
)
accounts = [x[0] for x in res]
if accounts:
having_clause = (qb.Field("balance") != qb.Field("balance_in_account_currency")) & (
(qb.Field("balance_in_account_currency") != 0) | (qb.Field("balance") != 0)
)
gle = qb.DocType("GL Entry")
# conditions
conditions = []
conditions.append(gle.account.isin(accounts))
conditions.append(gle.posting_date.lte(posting_date))
conditions.append(gle.is_cancelled == 0)
if party_type:
conditions.append(gle.party_type == party_type)
if party:
conditions.append(gle.party == party)
account_details = (
qb.from_(gle)
.select(
gle.account,
gle.party_type,
gle.party,
gle.account_currency,
(Sum(gle.debit_in_account_currency) - Sum(gle.credit_in_account_currency)).as_(
"balance_in_account_currency"
),
(Sum(gle.debit) - Sum(gle.credit)).as_("balance"),
(Sum(gle.debit) - Sum(gle.credit) == 0)
^ (Sum(gle.debit_in_account_currency) - Sum(gle.credit_in_account_currency) == 0).as_(
"zero_balance"
),
)
.where(Criterion.all(conditions))
.groupby(gle.account, NullIf(gle.party_type, ""), NullIf(gle.party, ""))
.having(having_clause)
.orderby(gle.account)
.run(as_dict=True)
)
return account_details
@staticmethod
def calculate_new_account_balance(company, posting_date, account_details):
accounts = []
company_currency = erpnext.get_company_currency(company)
precision = get_field_precision(
frappe.get_meta("Exchange Rate Revaluation Account").get_field("new_balance_in_base_currency"),
company_currency,
)
account_details = self.get_accounts_from_gle()
for d in account_details:
current_exchange_rate = (
d.balance / d.balance_in_account_currency if d.balance_in_account_currency else 0
)
new_exchange_rate = get_exchange_rate(d.account_currency, company_currency, self.posting_date)
new_balance_in_base_currency = flt(d.balance_in_account_currency * new_exchange_rate)
gain_loss = flt(new_balance_in_base_currency, precision) - flt(d.balance, precision)
if gain_loss:
accounts.append(
{
"account": d.account,
"party_type": d.party_type,
"party": d.party,
"account_currency": d.account_currency,
"balance_in_base_currency": d.balance,
"balance_in_account_currency": d.balance_in_account_currency,
"current_exchange_rate": current_exchange_rate,
"new_exchange_rate": new_exchange_rate,
"new_balance_in_base_currency": new_balance_in_base_currency,
}
if account_details:
# Handle Accounts with balance in both Account/Base Currency
for d in [x for x in account_details if not x.zero_balance]:
current_exchange_rate = (
d.balance / d.balance_in_account_currency if d.balance_in_account_currency else 0
)
new_exchange_rate = get_exchange_rate(d.account_currency, company_currency, posting_date)
new_balance_in_base_currency = flt(d.balance_in_account_currency * new_exchange_rate)
gain_loss = flt(new_balance_in_base_currency, precision) - flt(d.balance, precision)
if gain_loss:
accounts.append(
{
"account": d.account,
"party_type": d.party_type,
"party": d.party,
"account_currency": d.account_currency,
"balance_in_base_currency": d.balance,
"balance_in_account_currency": d.balance_in_account_currency,
"zero_balance": d.zero_balance,
"current_exchange_rate": current_exchange_rate,
"new_exchange_rate": new_exchange_rate,
"new_balance_in_base_currency": new_balance_in_base_currency,
"new_balance_in_account_currency": d.balance_in_account_currency,
"gain_loss": gain_loss,
}
)
if not accounts:
self.throw_invalid_response_message(account_details)
# Handle Accounts with '0' balance in Account/Base Currency
for d in [x for x in account_details if x.zero_balance]:
if d.balance != 0:
current_exchange_rate = new_exchange_rate = 0
new_balance_in_account_currency = 0 # this will be '0'
new_balance_in_base_currency = 0 # this will be '0'
gain_loss = flt(new_balance_in_base_currency, precision) - flt(d.balance, precision)
else:
new_exchange_rate = 0
new_balance_in_base_currency = 0
new_balance_in_account_currency = 0
current_exchange_rate = calculate_exchange_rate_using_last_gle(
company, d.account, d.party_type, d.party
)
gain_loss = new_balance_in_account_currency - (
current_exchange_rate * d.balance_in_account_currency
)
if gain_loss:
accounts.append(
{
"account": d.account,
"party_type": d.party_type,
"party": d.party,
"account_currency": d.account_currency,
"balance_in_base_currency": d.balance,
"balance_in_account_currency": d.balance_in_account_currency,
"zero_balance": d.zero_balance,
"current_exchange_rate": current_exchange_rate,
"new_exchange_rate": new_exchange_rate,
"new_balance_in_base_currency": new_balance_in_base_currency,
"new_balance_in_account_currency": new_balance_in_account_currency,
"gain_loss": gain_loss,
}
)
return accounts
def get_accounts_from_gle(self):
company_currency = erpnext.get_company_currency(self.company)
accounts = frappe.db.sql_list(
"""
select name
from tabAccount
where is_group = 0
and report_type = 'Balance Sheet'
and root_type in ('Asset', 'Liability', 'Equity')
and account_type != 'Stock'
and company=%s
and account_currency != %s
order by name""",
(self.company, company_currency),
)
account_details = []
if accounts:
account_details = frappe.db.sql(
"""
select
account, party_type, party, account_currency,
sum(debit_in_account_currency) - sum(credit_in_account_currency) as balance_in_account_currency,
sum(debit) - sum(credit) as balance
from `tabGL Entry`
where account in (%s)
and posting_date <= %s
and is_cancelled = 0
group by account, NULLIF(party_type,''), NULLIF(party,'')
having sum(debit) != sum(credit)
order by account
"""
% (", ".join(["%s"] * len(accounts)), "%s"),
tuple(accounts + [self.posting_date]),
as_dict=1,
)
return account_details
def throw_invalid_response_message(self, account_details):
if account_details:
message = _("No outstanding invoices require exchange rate revaluation")
@@ -134,11 +257,7 @@ class ExchangeRateRevaluation(Document):
message = _("No outstanding invoices found")
frappe.msgprint(message)
@frappe.whitelist()
def make_jv_entry(self):
if self.total_gain_loss == 0:
return
def get_for_unrealized_gain_loss_account(self):
unrealized_exchange_gain_loss_account = frappe.get_cached_value(
"Company", self.company, "unrealized_exchange_gain_loss_account"
)
@@ -146,6 +265,130 @@ class ExchangeRateRevaluation(Document):
frappe.throw(
_("Please set Unrealized Exchange Gain/Loss Account in Company {0}").format(self.company)
)
return unrealized_exchange_gain_loss_account
@frappe.whitelist()
def make_jv_entries(self):
zero_balance_jv = self.make_jv_for_zero_balance()
if zero_balance_jv:
frappe.msgprint(
f"Zero Balance Journal: {get_link_to_form('Journal Entry', zero_balance_jv.name)}"
)
revaluation_jv = self.make_jv_for_revaluation()
if revaluation_jv:
frappe.msgprint(
f"Revaluation Journal: {get_link_to_form('Journal Entry', revaluation_jv.name)}"
)
return {
"revaluation_jv": revaluation_jv.name if revaluation_jv else None,
"zero_balance_jv": zero_balance_jv.name if zero_balance_jv else None,
}
def make_jv_for_zero_balance(self):
if self.gain_loss_booked == 0:
return
accounts = [x for x in self.accounts if x.zero_balance]
if not accounts:
return
unrealized_exchange_gain_loss_account = self.get_for_unrealized_gain_loss_account()
journal_entry = frappe.new_doc("Journal Entry")
journal_entry.voucher_type = "Exchange Gain Or Loss"
journal_entry.company = self.company
journal_entry.posting_date = self.posting_date
journal_entry.multi_currency = 1
journal_entry_accounts = []
for d in accounts:
journal_account = frappe._dict(
{
"account": d.get("account"),
"party_type": d.get("party_type"),
"party": d.get("party"),
"account_currency": d.get("account_currency"),
"balance": flt(
d.get("balance_in_account_currency"), d.precision("balance_in_account_currency")
),
"exchange_rate": 0,
"cost_center": erpnext.get_default_cost_center(self.company),
"reference_type": "Exchange Rate Revaluation",
"reference_name": self.name,
}
)
# Account Currency has balance
if d.get("balance_in_account_currency") and not d.get("new_balance_in_account_currency"):
dr_or_cr = (
"credit_in_account_currency"
if d.get("balance_in_account_currency") > 0
else "debit_in_account_currency"
)
reverse_dr_or_cr = (
"debit_in_account_currency"
if dr_or_cr == "credit_in_account_currency"
else "credit_in_account_currency"
)
journal_account.update(
{
dr_or_cr: flt(
abs(d.get("balance_in_account_currency")), d.precision("balance_in_account_currency")
),
reverse_dr_or_cr: 0,
"debit": 0,
"credit": 0,
}
)
elif d.get("balance_in_base_currency") and not d.get("new_balance_in_base_currency"):
# Base currency has balance
dr_or_cr = "credit" if d.get("balance_in_base_currency") > 0 else "debit"
reverse_dr_or_cr = "debit" if dr_or_cr == "credit" else "credit"
journal_account.update(
{
dr_or_cr: flt(
abs(d.get("balance_in_base_currency")), d.precision("balance_in_base_currency")
),
reverse_dr_or_cr: 0,
"debit_in_account_currency": 0,
"credit_in_account_currency": 0,
}
)
journal_entry_accounts.append(journal_account)
journal_entry_accounts.append(
{
"account": unrealized_exchange_gain_loss_account,
"balance": get_balance_on(unrealized_exchange_gain_loss_account),
"debit": abs(self.gain_loss_booked) if self.gain_loss_booked < 0 else 0,
"credit": abs(self.gain_loss_booked) if self.gain_loss_booked > 0 else 0,
"debit_in_account_currency": abs(self.gain_loss_booked) if self.gain_loss_booked < 0 else 0,
"credit_in_account_currency": self.gain_loss_booked if self.gain_loss_booked > 0 else 0,
"cost_center": erpnext.get_default_cost_center(self.company),
"exchange_rate": 1,
"reference_type": "Exchange Rate Revaluation",
"reference_name": self.name,
}
)
journal_entry.set("accounts", journal_entry_accounts)
journal_entry.set_total_debit_credit()
journal_entry.save()
return journal_entry
def make_jv_for_revaluation(self):
if self.gain_loss_unbooked == 0:
return
accounts = [x for x in self.accounts if not x.zero_balance]
if not accounts:
return
unrealized_exchange_gain_loss_account = self.get_for_unrealized_gain_loss_account()
journal_entry = frappe.new_doc("Journal Entry")
journal_entry.voucher_type = "Exchange Rate Revaluation"
@@ -154,7 +397,10 @@ class ExchangeRateRevaluation(Document):
journal_entry.multi_currency = 1
journal_entry_accounts = []
for d in self.accounts:
for d in accounts:
if not flt(d.get("balance_in_account_currency"), d.precision("balance_in_account_currency")):
continue
dr_or_cr = (
"debit_in_account_currency"
if d.get("balance_in_account_currency") > 0
@@ -179,6 +425,7 @@ class ExchangeRateRevaluation(Document):
dr_or_cr: flt(
abs(d.get("balance_in_account_currency")), d.precision("balance_in_account_currency")
),
"cost_center": erpnext.get_default_cost_center(self.company),
"exchange_rate": flt(d.get("new_exchange_rate"), d.precision("new_exchange_rate")),
"reference_type": "Exchange Rate Revaluation",
"reference_name": self.name,
@@ -196,59 +443,123 @@ class ExchangeRateRevaluation(Document):
reverse_dr_or_cr: flt(
abs(d.get("balance_in_account_currency")), d.precision("balance_in_account_currency")
),
"cost_center": erpnext.get_default_cost_center(self.company),
"exchange_rate": flt(d.get("current_exchange_rate"), d.precision("current_exchange_rate")),
"reference_type": "Exchange Rate Revaluation",
"reference_name": self.name,
}
)
journal_entry_accounts.append(
{
"account": unrealized_exchange_gain_loss_account,
"balance": get_balance_on(unrealized_exchange_gain_loss_account),
"debit_in_account_currency": abs(self.total_gain_loss) if self.total_gain_loss < 0 else 0,
"credit_in_account_currency": self.total_gain_loss if self.total_gain_loss > 0 else 0,
"exchange_rate": 1,
"reference_type": "Exchange Rate Revaluation",
"reference_name": self.name,
}
)
journal_entry.set("accounts", journal_entry_accounts)
journal_entry.set_amounts_in_company_currency()
journal_entry.set_total_debit_credit()
return journal_entry.as_dict()
self.gain_loss_unbooked += journal_entry.difference - self.gain_loss_unbooked
journal_entry.append(
"accounts",
{
"account": unrealized_exchange_gain_loss_account,
"balance": get_balance_on(unrealized_exchange_gain_loss_account),
"debit_in_account_currency": abs(self.gain_loss_unbooked)
if self.gain_loss_unbooked < 0
else 0,
"credit_in_account_currency": self.gain_loss_unbooked if self.gain_loss_unbooked > 0 else 0,
"cost_center": erpnext.get_default_cost_center(self.company),
"exchange_rate": 1,
"reference_type": "Exchange Rate Revaluation",
"reference_name": self.name,
},
)
journal_entry.set_amounts_in_company_currency()
journal_entry.set_total_debit_credit()
journal_entry.save()
return journal_entry
def calculate_exchange_rate_using_last_gle(company, account, party_type, party):
"""
Use last GL entry to calculate exchange rate
"""
last_exchange_rate = None
if company and account:
gl = qb.DocType("GL Entry")
# build conditions
conditions = []
conditions.append(gl.company == company)
conditions.append(gl.account == account)
conditions.append(gl.is_cancelled == 0)
conditions.append((gl.debit > 0) | (gl.credit > 0))
conditions.append((gl.debit_in_account_currency > 0) | (gl.credit_in_account_currency > 0))
if party_type:
conditions.append(gl.party_type == party_type)
if party:
conditions.append(gl.party == party)
voucher_type, voucher_no = (
qb.from_(gl)
.select(gl.voucher_type, gl.voucher_no)
.where(Criterion.all(conditions))
.orderby(gl.posting_date, order=Order.desc)
.limit(1)
.run()[0]
)
last_exchange_rate = (
qb.from_(gl)
.select((gl.debit - gl.credit) / (gl.debit_in_account_currency - gl.credit_in_account_currency))
.where(
(gl.voucher_type == voucher_type) & (gl.voucher_no == voucher_no) & (gl.account == account)
)
.orderby(gl.posting_date, order=Order.desc)
.limit(1)
.run()[0][0]
)
return last_exchange_rate
@frappe.whitelist()
def get_account_details(account, company, posting_date, party_type=None, party=None):
account_currency, account_type = frappe.db.get_value(
def get_account_details(company, posting_date, account, party_type=None, party=None):
if not (company and posting_date):
frappe.throw(_("Company and Posting Date is mandatory"))
account_currency, account_type = frappe.get_cached_value(
"Account", account, ["account_currency", "account_type"]
)
if account_type in ["Receivable", "Payable"] and not (party_type and party):
frappe.throw(_("Party Type and Party is mandatory for {0} account").format(account_type))
account_details = {}
company_currency = erpnext.get_company_currency(company)
balance = get_balance_on(
account, date=posting_date, party_type=party_type, party=party, in_account_currency=False
account_details = {
"account_currency": account_currency,
}
account_balance = ExchangeRateRevaluation.get_account_balance_from_gle(
company=company, posting_date=posting_date, account=account, party_type=party_type, party=party
)
if balance:
balance_in_account_currency = get_balance_on(
account, date=posting_date, party_type=party_type, party=party
if account_balance and (
account_balance[0].balance or account_balance[0].balance_in_account_currency
):
account_with_new_balance = ExchangeRateRevaluation.calculate_new_account_balance(
company, posting_date, account_balance
)
current_exchange_rate = (
balance / balance_in_account_currency if balance_in_account_currency else 0
row = account_with_new_balance[0]
account_details.update(
{
"balance_in_base_currency": row["balance_in_base_currency"],
"balance_in_account_currency": row["balance_in_account_currency"],
"current_exchange_rate": row["current_exchange_rate"],
"new_exchange_rate": row["new_exchange_rate"],
"new_balance_in_base_currency": row["new_balance_in_base_currency"],
"new_balance_in_account_currency": row["new_balance_in_account_currency"],
"zero_balance": row["zero_balance"],
"gain_loss": row["gain_loss"],
}
)
new_exchange_rate = get_exchange_rate(account_currency, company_currency, posting_date)
new_balance_in_base_currency = balance_in_account_currency * new_exchange_rate
account_details = {
"account_currency": account_currency,
"balance_in_base_currency": balance,
"balance_in_account_currency": balance_in_account_currency,
"current_exchange_rate": current_exchange_rate,
"new_exchange_rate": new_exchange_rate,
"new_balance_in_base_currency": new_balance_in_base_currency,
}
return account_details

View File

@@ -1,475 +1,161 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"actions": [],
"creation": "2018-04-13 18:30:06.110433",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"account",
"party_type",
"party",
"column_break_2",
"account_currency",
"account_balances",
"balance_in_account_currency",
"column_break_46yz",
"new_balance_in_account_currency",
"balances",
"current_exchange_rate",
"column_break_xown",
"new_exchange_rate",
"column_break_9",
"balance_in_base_currency",
"column_break_ukce",
"new_balance_in_base_currency",
"section_break_ngrs",
"gain_loss",
"zero_balance"
],
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "party_type",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Party Type",
"length": 0,
"no_copy": 0,
"options": "DocType",
"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
"options": "DocType"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "party",
"fieldtype": "Dynamic Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Party",
"length": 0,
"no_copy": 0,
"options": "party_type",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"options": "party_type"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"fieldtype": "Column Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "account_currency",
"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": "Account Currency",
"length": 0,
"no_copy": 0,
"options": "Currency",
"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
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "balance_in_account_currency",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Balance In Account Currency",
"length": 0,
"no_copy": 0,
"options": "account_currency",
"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
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "balances",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
"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
"fieldtype": "Section Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "current_exchange_rate",
"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": "Current Exchange Rate",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "balance_in_base_currency",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Balance In Base Currency",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"options": "Company:company:default_currency",
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "column_break_9",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"fieldtype": "Section Break"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "new_exchange_rate",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "New Exchange Rate",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "new_balance_in_base_currency",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "New Balance In Base Currency",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"options": "Company:company:default_currency",
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "gain_loss",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Gain/Loss",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"options": "Company:company:default_currency",
"read_only": 1
},
{
"default": "0",
"description": "This Account has '0' balance in either Base Currency or Account Currency",
"fieldname": "zero_balance",
"fieldtype": "Check",
"label": "Zero Balance"
},
{
"fieldname": "new_balance_in_account_currency",
"fieldtype": "Currency",
"label": "New Balance In Account Currency",
"options": "account_currency",
"read_only": 1
},
{
"fieldname": "account_balances",
"fieldtype": "Section Break"
},
{
"fieldname": "column_break_46yz",
"fieldtype": "Column Break"
},
{
"fieldname": "column_break_xown",
"fieldtype": "Column Break"
},
{
"fieldname": "column_break_ukce",
"fieldtype": "Column Break"
},
{
"fieldname": "section_break_ngrs",
"fieldtype": "Section Break"
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2019-06-26 18:57:51.762345",
"links": [],
"modified": "2022-12-29 19:38:52.915295",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Exchange Rate Revaluation Account",
"name_case": "",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0,
"track_views": 0
"states": [],
"track_changes": 1
}

View File

@@ -169,5 +169,6 @@ def auto_create_fiscal_year():
def get_from_and_to_date(fiscal_year):
fields = ["year_start_date as from_date", "year_end_date as to_date"]
return frappe.db.get_value("Fiscal Year", fiscal_year, fields, as_dict=1)
fields = ["year_start_date", "year_end_date"]
cached_results = frappe.get_cached_value("Fiscal Year", fiscal_year, fields, as_dict=1)
return dict(from_date=cached_results.year_start_date, to_date=cached_results.year_end_date)

View File

@@ -95,7 +95,15 @@ class GLEntry(Document):
)
# Zero value transaction is not allowed
if not (flt(self.debit, self.precision("debit")) or flt(self.credit, self.precision("credit"))):
if not (
flt(self.debit, self.precision("debit"))
or flt(self.credit, self.precision("credit"))
or (
self.voucher_type == "Journal Entry"
and frappe.get_cached_value("Journal Entry", self.voucher_no, "voucher_type")
== "Exchange Gain Or Loss"
)
):
frappe.throw(
_("{0} {1}: Either debit or credit amount is required for {2}").format(
self.voucher_type, self.voucher_no, self.account
@@ -366,7 +374,7 @@ def update_outstanding_amt(
if against_voucher_type in ["Sales Invoice", "Purchase Invoice", "Fees"]:
ref_doc = frappe.get_doc(against_voucher_type, against_voucher)
# Didn't use db_set for optimisation purpose
# Didn't use db_set for optimization purpose
ref_doc.outstanding_amount = bal
frappe.db.set_value(against_voucher_type, against_voucher, "outstanding_amount", bal)

View File

@@ -8,7 +8,7 @@ frappe.provide("erpnext.journal_entry");
frappe.ui.form.on("Journal Entry", {
setup: function(frm) {
frm.add_fetch("bank_account", "account", "account");
frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice'];
frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice', 'Journal Entry', "Repost Payment Ledger", 'Asset', 'Asset Movement'];
},
refresh: function(frm) {
@@ -173,8 +173,8 @@ frappe.ui.form.on("Journal Entry", {
var update_jv_details = function(doc, r) {
$.each(r, function(i, d) {
var row = frappe.model.add_child(doc, "Journal Entry Account", "accounts");
row.account = d.account;
row.balance = d.balance;
frappe.model.set_value(row.doctype, row.name, "account", d.account)
frappe.model.set_value(row.doctype, row.name, "balance", d.balance)
});
refresh_field("accounts");
}
@@ -253,9 +253,6 @@ erpnext.accounts.JournalEntry = class JournalEntry extends frappe.ui.form.Contro
var party_account_field = jvd.reference_type==="Sales Invoice" ? "debit_to": "credit_to";
out.filters.push([jvd.reference_type, party_account_field, "=", jvd.account]);
if (in_list(['Debit Note', 'Credit Note'], doc.voucher_type)) {
out.filters.push([jvd.reference_type, "is_return", "=", 1]);
}
}
if(in_list(["Sales Order", "Purchase Order"], jvd.reference_type)) {
@@ -312,8 +309,7 @@ erpnext.accounts.JournalEntry = class JournalEntry extends frappe.ui.form.Contro
}
}
get_outstanding(doctype, docname, company, child, due_date) {
var me = this;
get_outstanding(doctype, docname, company, child) {
var args = {
"doctype": doctype,
"docname": docname,

View File

@@ -88,7 +88,7 @@
"label": "Entry Type",
"oldfieldname": "voucher_type",
"oldfieldtype": "Select",
"options": "Journal Entry\nInter Company Journal Entry\nBank Entry\nCash Entry\nCredit Card Entry\nDebit Note\nCredit Note\nContra Entry\nExcise Entry\nWrite Off Entry\nOpening Entry\nDepreciation Entry\nExchange Rate Revaluation\nDeferred Revenue\nDeferred Expense",
"options": "Journal Entry\nInter Company Journal Entry\nBank Entry\nCash Entry\nCredit Card Entry\nDebit Note\nCredit Note\nContra Entry\nExcise Entry\nWrite Off Entry\nOpening Entry\nDepreciation Entry\nExchange Rate Revaluation\nExchange Gain Or Loss\nDeferred Revenue\nDeferred Expense",
"reqd": 1,
"search_index": 1
},
@@ -539,7 +539,7 @@
"idx": 176,
"is_submittable": 1,
"links": [],
"modified": "2022-06-23 22:01:32.348337",
"modified": "2023-03-01 14:58:59.286591",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry",

View File

@@ -51,7 +51,7 @@ class JournalEntry(AccountsController):
self.validate_multi_currency()
self.set_amounts_in_company_currency()
self.validate_debit_credit_amount()
self.set_total_debit_credit()
# Do not validate while importing via data import
if not frappe.flags.in_import:
self.validate_total_debit_and_credit()
@@ -69,6 +69,7 @@ class JournalEntry(AccountsController):
self.validate_empty_accounts_table()
self.set_account_and_party_balance()
self.validate_inter_company_accounts()
self.validate_depr_entry_voucher_type()
if self.docstatus == 0:
self.apply_tax_withholding()
@@ -81,6 +82,7 @@ class JournalEntry(AccountsController):
self.check_credit_limit()
self.make_gl_entries()
self.update_advance_paid()
self.update_asset_value()
self.update_inter_company_jv()
self.update_invoice_discounting()
@@ -88,7 +90,13 @@ class JournalEntry(AccountsController):
from erpnext.accounts.utils import unlink_ref_doc_from_payment_entries
unlink_ref_doc_from_payment_entries(self)
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry", "Payment Ledger Entry")
self.ignore_linked_doctypes = (
"GL Entry",
"Stock Ledger Entry",
"Payment Ledger Entry",
"Repost Payment Ledger",
"Repost Payment Ledger Items",
)
self.make_gl_entries(1)
self.update_advance_paid()
self.unlink_advance_entry_reference()
@@ -123,6 +131,13 @@ class JournalEntry(AccountsController):
if self.total_credit != doc.total_debit or self.total_debit != doc.total_credit:
frappe.throw(_("Total Credit/ Debit Amount should be same as linked Journal Entry"))
def validate_depr_entry_voucher_type(self):
if (
any(d.account_type == "Depreciation" for d in self.get("accounts"))
and self.voucher_type != "Depreciation Entry"
):
frappe.throw(_("Journal Entry type should be set as Depreciation Entry for asset depreciation"))
def validate_stock_accounts(self):
stock_accounts = get_stock_accounts(self.company, self.doctype, self.name)
for account in stock_accounts:
@@ -184,7 +199,9 @@ class JournalEntry(AccountsController):
}
)
tax_withholding_details = get_party_tax_withholding_details(inv, self.tax_withholding_category)
tax_withholding_details, advance_taxes, voucher_wise_amount = get_party_tax_withholding_details(
inv, self.tax_withholding_category
)
if not tax_withholding_details:
return
@@ -223,6 +240,34 @@ class JournalEntry(AccountsController):
for d in to_remove:
self.remove(d)
def update_asset_value(self):
if self.flags.planned_depr_entry or self.voucher_type != "Depreciation Entry":
return
for d in self.get("accounts"):
if (
d.reference_type == "Asset"
and d.reference_name
and d.account_type == "Depreciation"
and d.debit
):
asset = frappe.get_doc("Asset", d.reference_name)
if asset.calculate_depreciation:
fb_idx = 1
if self.finance_book:
for fb_row in asset.get("finance_books"):
if fb_row.finance_book == self.finance_book:
fb_idx = fb_row.idx
break
fb_row = asset.get("finance_books")[fb_idx - 1]
fb_row.value_after_depreciation -= d.debit
fb_row.db_update()
else:
asset.db_set("value_after_depreciation", asset.value_after_depreciation - d.debit)
asset.set_status()
def update_inter_company_jv(self):
if (
self.voucher_type == "Inter Company Journal Entry"
@@ -281,19 +326,38 @@ class JournalEntry(AccountsController):
d.db_update()
def unlink_asset_reference(self):
if self.voucher_type != "Depreciation Entry":
return
for d in self.get("accounts"):
if d.reference_type == "Asset" and d.reference_name:
if (
d.reference_type == "Asset"
and d.reference_name
and d.account_type == "Depreciation"
and d.debit
):
asset = frappe.get_doc("Asset", d.reference_name)
for s in asset.get("schedules"):
if s.journal_entry == self.name:
s.db_set("journal_entry", None)
idx = cint(s.finance_book_id) or 1
finance_books = asset.get("finance_books")[idx - 1]
finance_books.value_after_depreciation += s.depreciation_amount
finance_books.db_update()
asset.set_status()
if asset.calculate_depreciation:
fb_idx = None
for s in asset.get("schedules"):
if s.journal_entry == self.name:
s.db_set("journal_entry", None)
fb_idx = cint(s.finance_book_id) or 1
break
if not fb_idx:
fb_idx = 1
if self.finance_book:
for fb_row in asset.get("finance_books"):
if fb_row.finance_book == self.finance_book:
fb_idx = fb_row.idx
break
fb_row = asset.get("finance_books")[fb_idx - 1]
fb_row.value_after_depreciation += d.debit
fb_row.db_update()
else:
asset.db_set("value_after_depreciation", asset.value_after_depreciation + d.debit)
asset.set_status()
def unlink_inter_company_jv(self):
if (
@@ -590,28 +654,29 @@ class JournalEntry(AccountsController):
d.against_account = frappe.db.get_value(d.reference_type, d.reference_name, field)
else:
for d in self.get("accounts"):
if flt(d.debit > 0):
if flt(d.debit) > 0:
accounts_debited.append(d.party or d.account)
if flt(d.credit) > 0:
accounts_credited.append(d.party or d.account)
for d in self.get("accounts"):
if flt(d.debit > 0):
if flt(d.debit) > 0:
d.against_account = ", ".join(list(set(accounts_credited)))
if flt(d.credit > 0):
if flt(d.credit) > 0:
d.against_account = ", ".join(list(set(accounts_debited)))
def validate_debit_credit_amount(self):
for d in self.get("accounts"):
if not flt(d.debit) and not flt(d.credit):
frappe.throw(_("Row {0}: Both Debit and Credit values cannot be zero").format(d.idx))
if not (self.voucher_type == "Exchange Gain Or Loss" and self.multi_currency):
for d in self.get("accounts"):
if not flt(d.debit) and not flt(d.credit):
frappe.throw(_("Row {0}: Both Debit and Credit values cannot be zero").format(d.idx))
def validate_total_debit_and_credit(self):
self.set_total_debit_credit()
if self.difference:
frappe.throw(
_("Total Debit must be equal to Total Credit. The difference is {0}").format(self.difference)
)
if not (self.voucher_type == "Exchange Gain Or Loss" and self.multi_currency):
if self.difference:
frappe.throw(
_("Total Debit must be equal to Total Credit. The difference is {0}").format(self.difference)
)
def set_total_debit_credit(self):
self.total_debit, self.total_credit, self.difference = 0, 0, 0
@@ -649,16 +714,17 @@ class JournalEntry(AccountsController):
self.set_exchange_rate()
def set_amounts_in_company_currency(self):
for d in self.get("accounts"):
d.debit_in_account_currency = flt(
d.debit_in_account_currency, d.precision("debit_in_account_currency")
)
d.credit_in_account_currency = flt(
d.credit_in_account_currency, d.precision("credit_in_account_currency")
)
if not (self.voucher_type == "Exchange Gain Or Loss" and self.multi_currency):
for d in self.get("accounts"):
d.debit_in_account_currency = flt(
d.debit_in_account_currency, d.precision("debit_in_account_currency")
)
d.credit_in_account_currency = flt(
d.credit_in_account_currency, d.precision("credit_in_account_currency")
)
d.debit = flt(d.debit_in_account_currency * flt(d.exchange_rate), d.precision("debit"))
d.credit = flt(d.credit_in_account_currency * flt(d.exchange_rate), d.precision("credit"))
d.debit = flt(d.debit_in_account_currency * flt(d.exchange_rate), d.precision("debit"))
d.credit = flt(d.credit_in_account_currency * flt(d.exchange_rate), d.precision("credit"))
def set_exchange_rate(self):
for d in self.get("accounts"):
@@ -757,7 +823,7 @@ class JournalEntry(AccountsController):
pay_to_recd_from = d.party
if pay_to_recd_from and pay_to_recd_from == d.party:
party_amount += d.debit_in_account_currency or d.credit_in_account_currency
party_amount += flt(d.debit_in_account_currency) or flt(d.credit_in_account_currency)
party_account_currency = d.account_currency
elif frappe.db.get_value("Account", d.account, "account_type") in ["Bank", "Cash"]:
@@ -787,7 +853,7 @@ class JournalEntry(AccountsController):
def build_gl_map(self):
gl_map = []
for d in self.get("accounts"):
if d.debit or d.credit:
if d.debit or d.credit or (self.voucher_type == "Exchange Gain Or Loss"):
r = [d.user_remark, self.remark]
r = [x for x in r if x]
remarks = "\n".join(r)
@@ -825,6 +891,8 @@ class JournalEntry(AccountsController):
def make_gl_entries(self, cancel=0, adv_adj=0):
from erpnext.accounts.general_ledger import make_gl_entries
merge_entries = frappe.db.get_single_value("Accounts Settings", "merge_similar_account_heads")
gl_map = self.build_gl_map()
if self.voucher_type in ("Deferred Revenue", "Deferred Expense"):
update_outstanding = "No"
@@ -832,10 +900,16 @@ class JournalEntry(AccountsController):
update_outstanding = "Yes"
if gl_map:
make_gl_entries(gl_map, cancel=cancel, adv_adj=adv_adj, update_outstanding=update_outstanding)
make_gl_entries(
gl_map,
cancel=cancel,
adv_adj=adv_adj,
merge_entries=merge_entries,
update_outstanding=update_outstanding,
)
@frappe.whitelist()
def get_balance(self):
def get_balance(self, difference_account=None):
if not self.get("accounts"):
msgprint(_("'Entries' cannot be empty"), raise_exception=True)
else:
@@ -850,7 +924,13 @@ class JournalEntry(AccountsController):
blank_row = d
if not blank_row:
blank_row = self.append("accounts", {})
blank_row = self.append(
"accounts",
{
"account": difference_account,
"cost_center": erpnext.get_default_cost_center(self.company),
},
)
blank_row.exchange_rate = 1
if diff > 0:
@@ -1208,6 +1288,7 @@ def get_outstanding(args):
args = json.loads(args)
company_currency = erpnext.get_company_currency(args.get("company"))
due_date = None
if args.get("doctype") == "Journal Entry":
condition = " and party=%(party)s" if args.get("party") else ""
@@ -1232,10 +1313,12 @@ def get_outstanding(args):
invoice = frappe.db.get_value(
args["doctype"],
args["docname"],
["outstanding_amount", "conversion_rate", scrub(party_type)],
["outstanding_amount", "conversion_rate", scrub(party_type), "due_date"],
as_dict=1,
)
due_date = invoice.get("due_date")
exchange_rate = (
invoice.conversion_rate if (args.get("account_currency") != company_currency) else 1
)
@@ -1258,6 +1341,7 @@ def get_outstanding(args):
"exchange_rate": exchange_rate,
"party_type": party_type,
"party": invoice.get(scrub(party_type)),
"reference_due_date": due_date,
}

View File

@@ -287,10 +287,6 @@ class TestJournalEntry(unittest.TestCase):
jv.submit()
def test_inter_company_jv(self):
frappe.db.set_value("Account", "Sales Expenses - _TC", "inter_company_account", 1)
frappe.db.set_value("Account", "Buildings - _TC", "inter_company_account", 1)
frappe.db.set_value("Account", "Sales Expenses - _TC1", "inter_company_account", 1)
frappe.db.set_value("Account", "Buildings - _TC1", "inter_company_account", 1)
jv = make_journal_entry(
"Sales Expenses - _TC",
"Buildings - _TC",

View File

@@ -202,6 +202,7 @@
"fieldname": "reference_type",
"fieldtype": "Select",
"label": "Reference Type",
"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"
},
{
@@ -209,13 +210,15 @@
"fieldtype": "Dynamic Link",
"in_list_view": 1,
"label": "Reference Name",
"no_copy": 1,
"options": "reference_type"
},
{
"depends_on": "eval:doc.reference_type&&!in_list(doc.reference_type, ['Expense Claim', 'Asset', 'Employee Loan', 'Employee Advance'])",
"fieldname": "reference_due_date",
"fieldtype": "Select",
"label": "Reference Due Date"
"fieldtype": "Date",
"label": "Reference Due Date",
"no_copy": 1
},
{
"fieldname": "project",
@@ -274,19 +277,22 @@
"fieldname": "reference_detail_no",
"fieldtype": "Data",
"hidden": 1,
"label": "Reference Detail No"
"label": "Reference Detail No",
"no_copy": 1
}
],
"idx": 1,
"istable": 1,
"links": [],
"modified": "2021-08-30 21:27:32.200299",
"modified": "2022-10-26 20:03:10.906259",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry Account",
"naming_rule": "Random",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -2,7 +2,22 @@
// For license information, please see license.txt
frappe.ui.form.on("Journal Entry Template", {
setup: function(frm) {
onload: function(frm) {
if(frm.is_new()) {
frappe.call({
type: "GET",
method: "erpnext.accounts.doctype.journal_entry_template.journal_entry_template.get_naming_series",
callback: function(r){
if(r.message) {
frm.set_df_property("naming_series", "options", r.message.split("\n"));
frm.set_value("naming_series", r.message.split("\n")[0]);
frm.refresh_field("naming_series");
}
}
});
}
},
refresh: function(frm) {
frappe.model.set_default_values(frm.doc);
frm.set_query("account" ,"accounts", function(){
@@ -19,18 +34,6 @@ frappe.ui.form.on("Journal Entry Template", {
return { filters: filters };
});
frappe.call({
type: "GET",
method: "erpnext.accounts.doctype.journal_entry_template.journal_entry_template.get_naming_series",
callback: function(r){
if(r.message){
frm.set_df_property("naming_series", "options", r.message.split("\n"));
frm.set_value("naming_series", r.message.split("\n")[0]);
frm.refresh_field("naming_series");
}
}
});
},
voucher_type: function(frm) {
var add_accounts = function(doc, r) {
@@ -45,21 +48,6 @@ frappe.ui.form.on("Journal Entry Template", {
frm.trigger("clear_child");
switch(frm.doc.voucher_type){
case "Opening Entry":
frm.set_value("is_opening", "Yes");
frappe.call({
type:"GET",
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_opening_accounts",
args: {
"company": frm.doc.company
},
callback: function(r) {
if(r.message) {
add_accounts(frm.doc, r.message);
}
}
});
break;
case "Bank Entry":
case "Cash Entry":
frappe.call({

View File

@@ -20,15 +20,14 @@ frappe.ui.form.on('Opening Invoice Creation Tool', {
frm.dashboard.reset();
frm.doc.import_in_progress = true;
}
if (data.user != frappe.session.user) return;
if (data.count == data.total) {
setTimeout((title) => {
setTimeout(() => {
frm.doc.import_in_progress = false;
frm.clear_table("invoices");
frm.refresh_fields();
frm.page.clear_indicator();
frm.dashboard.hide_progress(title);
frappe.msgprint(__("Opening {0} Invoice created", [frm.doc.invoice_type]));
frm.dashboard.hide_progress();
frappe.msgprint(__("Opening {0} Invoices created", [frm.doc.invoice_type]));
}, 1500, data.title);
return;
}
@@ -51,13 +50,6 @@ frappe.ui.form.on('Opening Invoice Creation Tool', {
method: "make_invoices",
freeze: 1,
freeze_message: __("Creating {0} Invoice", [frm.doc.invoice_type]),
callback: function(r) {
if (r.message.length == 1) {
frappe.msgprint(__("{0} Invoice created successfully.", [frm.doc.invoice_type]));
} else if (r.message.length < 50) {
frappe.msgprint(__("{0} Invoices created successfully.", [frm.doc.invoice_type]));
}
}
});
});

View File

@@ -257,17 +257,15 @@ def start_import(invoices):
def publish(index, total, doctype):
if total < 50:
return
frappe.publish_realtime(
"opening_invoice_creation_progress",
dict(
title=_("Opening Invoice Creation In Progress"),
message=_("Creating {} out of {} {}").format(index + 1, total, doctype),
user=frappe.session.user,
count=index + 1,
total=total,
),
user=frappe.session.user,
)

View File

@@ -7,7 +7,7 @@ cur_frm.cscript.tax_table = "Advance Taxes and Charges";
frappe.ui.form.on('Payment Entry', {
onload: function(frm) {
frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice'];
frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice', "Repost Payment Ledger"];
if(frm.doc.__islocal) {
if (!frm.doc.paid_from) frm.set_value("paid_from_account_currency", null);
@@ -245,8 +245,6 @@ frappe.ui.form.on('Payment Entry', {
frm.set_currency_labels(["total_amount", "outstanding_amount", "allocated_amount"],
party_account_currency, "references");
frm.set_currency_labels(["amount"], company_currency, "deductions");
cur_frm.set_df_property("source_exchange_rate", "description",
("1 " + frm.doc.paid_from_account_currency + " = [?] " + company_currency));
@@ -907,7 +905,7 @@ frappe.ui.form.on('Payment Entry', {
function(d) { return flt(d.amount) }));
frm.set_value("difference_amount", difference_amount - total_deductions +
frm.doc.base_total_taxes_and_charges);
flt(frm.doc.base_total_taxes_and_charges));
frm.events.hide_unhide_fields(frm);
},
@@ -973,29 +971,48 @@ frappe.ui.form.on('Payment Entry', {
},
callback: function(r, rt) {
if(r.message) {
var write_off_row = $.map(frm.doc["deductions"] || [], function(t) {
const write_off_row = $.map(frm.doc["deductions"] || [], function(t) {
return t.account==r.message[account] ? t : null; });
var row = [];
var difference_amount = flt(frm.doc.difference_amount,
const difference_amount = flt(frm.doc.difference_amount,
precision("difference_amount"));
if (!write_off_row.length && difference_amount) {
row = frm.add_child("deductions");
row.account = r.message[account];
row.cost_center = r.message["cost_center"];
} else {
row = write_off_row[0];
}
const add_deductions = (details) => {
let row = null;
if (!write_off_row.length && difference_amount) {
row = frm.add_child("deductions");
row.account = details[account];
row.cost_center = details["cost_center"];
} else {
row = write_off_row[0];
}
if (row) {
row.amount = flt(row.amount) + difference_amount;
} else {
frappe.msgprint(__("No gain or loss in the exchange rate"))
}
if (row) {
row.amount = flt(row.amount) + difference_amount;
} else {
frappe.msgprint(__("No gain or loss in the exchange rate"))
}
refresh_field("deductions");
};
refresh_field("deductions");
if (!r.message[account]) {
frappe.prompt({
label: __("Please Specify Account"),
fieldname: account,
fieldtype: "Link",
options: "Account",
get_query: () => ({
filters: {
company: frm.doc.company,
}
})
}, (values) => {
const details = Object.assign({}, r.message, values);
add_deductions(details);
}, __(frappe.unscrub(account)));
} else {
add_deductions(r.message);
}
frm.events.set_unallocated_amount(frm);
}
@@ -1091,7 +1108,7 @@ frappe.ui.form.on('Payment Entry', {
$.each(tax_fields, function(i, fieldname) { tax[fieldname] = 0.0; });
frm.doc.paid_amount_after_tax = frm.doc.paid_amount;
frm.doc.paid_amount_after_tax = frm.doc.base_paid_amount;
});
},
@@ -1182,7 +1199,7 @@ frappe.ui.form.on('Payment Entry', {
}
cumulated_tax_fraction += tax.tax_fraction_for_current_item;
frm.doc.paid_amount_after_tax = flt(frm.doc.paid_amount/(1+cumulated_tax_fraction))
frm.doc.paid_amount_after_tax = flt(frm.doc.base_paid_amount/(1+cumulated_tax_fraction))
});
},
@@ -1214,6 +1231,7 @@ frappe.ui.form.on('Payment Entry', {
frm.doc.total_taxes_and_charges = 0.0;
frm.doc.base_total_taxes_and_charges = 0.0;
let company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
let actual_tax_dict = {};
// maintain actual tax rate based on idx
@@ -1234,8 +1252,8 @@ frappe.ui.form.on('Payment Entry', {
}
}
tax.tax_amount = current_tax_amount;
tax.base_tax_amount = tax.tax_amount * frm.doc.source_exchange_rate;
// tax accounts are only in company currency
tax.base_tax_amount = current_tax_amount;
current_tax_amount *= (tax.add_deduct_tax == "Deduct") ? -1.0 : 1.0;
if(i==0) {
@@ -1244,9 +1262,29 @@ frappe.ui.form.on('Payment Entry', {
tax.total = flt(frm.doc["taxes"][i-1].total + current_tax_amount, precision("total", tax));
}
tax.base_total = tax.total * frm.doc.source_exchange_rate;
frm.doc.total_taxes_and_charges += current_tax_amount;
frm.doc.base_total_taxes_and_charges += current_tax_amount * frm.doc.source_exchange_rate;
// tac accounts are only in company currency
tax.base_total = tax.total
// calculate total taxes and base total taxes
if(frm.doc.payment_type == "Pay") {
// tax accounts only have company currency
if(tax.currency != frm.doc.paid_to_account_currency) {
//total_taxes_and_charges has the target currency. so using target conversion rate
frm.doc.total_taxes_and_charges += flt(current_tax_amount / frm.doc.target_exchange_rate);
} else {
frm.doc.total_taxes_and_charges += current_tax_amount;
}
} else if(frm.doc.payment_type == "Receive") {
if(tax.currency != frm.doc.paid_from_account_currency) {
//total_taxes_and_charges has the target currency. so using source conversion rate
frm.doc.total_taxes_and_charges += flt(current_tax_amount / frm.doc.source_exchange_rate);
} else {
frm.doc.total_taxes_and_charges += current_tax_amount;
}
}
frm.doc.base_total_taxes_and_charges += tax.base_tax_amount;
frm.refresh_field('taxes');
frm.refresh_field('total_taxes_and_charges');

View File

@@ -239,7 +239,7 @@
"depends_on": "paid_from",
"fieldname": "paid_from_account_currency",
"fieldtype": "Link",
"label": "Account Currency",
"label": "Account Currency (From)",
"options": "Currency",
"print_hide": 1,
"read_only": 1,
@@ -249,7 +249,7 @@
"depends_on": "paid_from",
"fieldname": "paid_from_account_balance",
"fieldtype": "Currency",
"label": "Account Balance",
"label": "Account Balance (From)",
"options": "paid_from_account_currency",
"print_hide": 1,
"read_only": 1
@@ -272,7 +272,7 @@
"depends_on": "paid_to",
"fieldname": "paid_to_account_currency",
"fieldtype": "Link",
"label": "Account Currency",
"label": "Account Currency (To)",
"options": "Currency",
"print_hide": 1,
"read_only": 1,
@@ -282,7 +282,7 @@
"depends_on": "paid_to",
"fieldname": "paid_to_account_balance",
"fieldtype": "Currency",
"label": "Account Balance",
"label": "Account Balance (To)",
"options": "paid_to_account_currency",
"print_hide": 1,
"read_only": 1
@@ -304,7 +304,8 @@
{
"fieldname": "source_exchange_rate",
"fieldtype": "Float",
"label": "Exchange Rate",
"label": "Source Exchange Rate",
"precision": "9",
"print_hide": 1,
"reqd": 1
},
@@ -333,7 +334,8 @@
{
"fieldname": "target_exchange_rate",
"fieldtype": "Float",
"label": "Exchange Rate",
"label": "Target Exchange Rate",
"precision": "9",
"print_hide": 1,
"reqd": 1
},
@@ -631,14 +633,14 @@
"depends_on": "eval:doc.party_type == 'Supplier'",
"fieldname": "purchase_taxes_and_charges_template",
"fieldtype": "Link",
"label": "Taxes and Charges Template",
"label": "Purchase Taxes and Charges Template",
"options": "Purchase Taxes and Charges Template"
},
{
"depends_on": "eval: doc.party_type == 'Customer'",
"fieldname": "sales_taxes_and_charges_template",
"fieldtype": "Link",
"label": "Taxes and Charges Template",
"label": "Sales Taxes and Charges Template",
"options": "Sales Taxes and Charges Template"
},
{
@@ -731,7 +733,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2022-02-23 20:08:39.559814",
"modified": "2023-02-14 04:52:30.478523",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry",

View File

@@ -60,9 +60,9 @@ class PaymentEntry(AccountsController):
def validate(self):
self.setup_party_account_field()
self.set_missing_values()
self.set_missing_ref_details()
self.validate_payment_type()
self.validate_party_details()
self.validate_bank_accounts()
self.set_exchange_rate()
self.validate_mandatory()
self.validate_reference_documents()
@@ -93,7 +93,13 @@ class PaymentEntry(AccountsController):
self.set_status()
def on_cancel(self):
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry", "Payment Ledger Entry")
self.ignore_linked_doctypes = (
"GL Entry",
"Stock Ledger Entry",
"Payment Ledger Entry",
"Repost Payment Ledger",
"Repost Payment Ledger Items",
)
self.make_gl_entries(cancel=1)
self.update_outstanding_amounts()
self.update_advance_paid()
@@ -181,7 +187,11 @@ class PaymentEntry(AccountsController):
frappe.throw(_("Party is mandatory"))
_party_name = "title" if self.party_type == "Shareholder" else self.party_type.lower() + "_name"
self.party_name = frappe.db.get_value(self.party_type, self.party, _party_name)
if frappe.db.has_column(self.party_type, _party_name):
self.party_name = frappe.db.get_value(self.party_type, self.party, _party_name)
else:
self.party_name = frappe.db.get_value(self.party_type, self.party, "name")
if self.party:
if not self.party_balance:
@@ -210,11 +220,16 @@ class PaymentEntry(AccountsController):
else self.paid_to_account_currency
)
self.set_missing_ref_details()
def set_missing_ref_details(self, force=False):
def set_missing_ref_details(
self, force: bool = False, update_ref_details_only_for: list | None = None
) -> None:
for d in self.get("references"):
if d.allocated_amount:
if update_ref_details_only_for and (
not (d.reference_doctype, d.reference_name) in update_ref_details_only_for
):
continue
ref_details = get_reference_details(
d.reference_doctype, d.reference_name, self.party_account_currency
)
@@ -239,29 +254,12 @@ class PaymentEntry(AccountsController):
if not frappe.db.exists(self.party_type, self.party):
frappe.throw(_("Invalid {0}: {1}").format(self.party_type, self.party))
if self.party_account and self.party_type in ("Customer", "Supplier"):
self.validate_account_type(
self.party_account, [erpnext.get_party_account_type(self.party_type)]
)
def validate_bank_accounts(self):
if self.payment_type in ("Pay", "Internal Transfer"):
self.validate_account_type(self.paid_from, ["Bank", "Cash"])
if self.payment_type in ("Receive", "Internal Transfer"):
self.validate_account_type(self.paid_to, ["Bank", "Cash"])
def validate_account_type(self, account, account_types):
account_type = frappe.db.get_value("Account", account, "account_type")
# if account_type not in account_types:
# frappe.throw(_("Account Type for {0} must be {1}").format(account, comma_or(account_types)))
def set_exchange_rate(self, ref_doc=None):
self.set_source_exchange_rate(ref_doc)
self.set_target_exchange_rate(ref_doc)
def set_source_exchange_rate(self, ref_doc=None):
if self.paid_from and not self.source_exchange_rate:
if self.paid_from:
if self.paid_from_account_currency == self.company_currency:
self.source_exchange_rate = 1
else:
@@ -295,6 +293,9 @@ class PaymentEntry(AccountsController):
def validate_reference_documents(self):
valid_reference_doctypes = self.get_valid_reference_doctypes()
if not valid_reference_doctypes:
return
for d in self.get("references"):
if not d.allocated_amount:
continue
@@ -362,7 +363,7 @@ class PaymentEntry(AccountsController):
if not d.allocated_amount:
continue
if d.reference_doctype in ("Sales Invoice", "Purchase Invoice", "Fees"):
if d.reference_doctype in ("Sales Invoice", "Purchase Invoice"):
outstanding_amount, is_return = frappe.get_cached_value(
d.reference_doctype, d.reference_name, ["outstanding_amount", "is_return"]
)
@@ -421,7 +422,7 @@ class PaymentEntry(AccountsController):
for ref in self.get("references"):
if ref.payment_term and ref.reference_name:
key = (ref.payment_term, ref.reference_name)
key = (ref.payment_term, ref.reference_name, ref.reference_doctype)
invoice_payment_amount_map.setdefault(key, 0.0)
invoice_payment_amount_map[key] += ref.allocated_amount
@@ -429,20 +430,37 @@ class PaymentEntry(AccountsController):
payment_schedule = frappe.get_all(
"Payment Schedule",
filters={"parent": ref.reference_name},
fields=["paid_amount", "payment_amount", "payment_term", "discount", "outstanding"],
fields=[
"paid_amount",
"payment_amount",
"payment_term",
"discount",
"outstanding",
"discount_type",
],
)
for term in payment_schedule:
invoice_key = (term.payment_term, ref.reference_name)
invoice_key = (term.payment_term, ref.reference_name, ref.reference_doctype)
invoice_paid_amount_map.setdefault(invoice_key, {})
invoice_paid_amount_map[invoice_key]["outstanding"] = term.outstanding
invoice_paid_amount_map[invoice_key]["discounted_amt"] = ref.total_amount * (
term.discount / 100
)
if not (term.discount_type and term.discount):
continue
if term.discount_type == "Percentage":
invoice_paid_amount_map[invoice_key]["discounted_amt"] = ref.total_amount * (
term.discount / 100
)
else:
invoice_paid_amount_map[invoice_key]["discounted_amt"] = term.discount
for idx, (key, allocated_amount) in enumerate(invoice_payment_amount_map.items(), 1):
if not invoice_paid_amount_map.get(key):
frappe.throw(_("Payment term {0} not used in {1}").format(key[0], key[1]))
allocated_amount = self.get_allocated_amount_in_transaction_currency(
allocated_amount, key[2], key[1]
)
outstanding = flt(invoice_paid_amount_map.get(key, {}).get("outstanding"))
discounted_amt = flt(invoice_paid_amount_map.get(key, {}).get("discounted_amt"))
@@ -477,6 +495,33 @@ class PaymentEntry(AccountsController):
(allocated_amount - discounted_amt, discounted_amt, allocated_amount, key[1], key[0]),
)
def get_allocated_amount_in_transaction_currency(
self, allocated_amount, reference_doctype, reference_docname
):
"""
Payment Entry could be in base currency while reference's payment schedule
is always in transaction currency.
E.g.
* SI with base=INR and currency=USD
* SI with payment schedule in USD
* PE in INR (accounting done in base currency)
"""
ref_currency, ref_exchange_rate = frappe.db.get_value(
reference_doctype, reference_docname, ["currency", "conversion_rate"]
)
is_single_currency = self.paid_from_account_currency == self.paid_to_account_currency
# PE in different currency
reference_is_multi_currency = self.paid_from_account_currency != ref_currency
if not (is_single_currency and reference_is_multi_currency):
return allocated_amount
allocated_amount = flt(
allocated_amount / ref_exchange_rate, self.precision("total_allocated_amount")
)
return allocated_amount
def set_status(self):
if self.docstatus == 2:
self.status = "Cancelled"
@@ -609,6 +654,28 @@ class PaymentEntry(AccountsController):
self.precision("base_received_amount"),
)
def calculate_base_allocated_amount_for_reference(self, d) -> float:
base_allocated_amount = 0
if d.reference_doctype in frappe.get_hooks("advance_payment_doctypes"):
# When referencing Sales/Purchase Order, use the source/target exchange rate depending on payment type.
# This is so there are no Exchange Gain/Loss generated for such doctypes
exchange_rate = 1
if self.payment_type == "Receive":
exchange_rate = self.source_exchange_rate
elif self.payment_type == "Pay":
exchange_rate = self.target_exchange_rate
base_allocated_amount += flt(
flt(d.allocated_amount) * flt(exchange_rate), self.precision("base_paid_amount")
)
else:
base_allocated_amount += flt(
flt(d.allocated_amount) * flt(d.exchange_rate), self.precision("base_paid_amount")
)
return base_allocated_amount
def set_total_allocated_amount(self):
if self.payment_type == "Internal Transfer":
return
@@ -617,9 +684,7 @@ class PaymentEntry(AccountsController):
for d in self.get("references"):
if d.allocated_amount:
total_allocated_amount += flt(d.allocated_amount)
base_total_allocated_amount += flt(
flt(d.allocated_amount) * flt(d.exchange_rate), self.precision("base_paid_amount")
)
base_total_allocated_amount += self.calculate_base_allocated_amount_for_reference(d)
self.total_allocated_amount = abs(total_allocated_amount)
self.base_total_allocated_amount = abs(base_total_allocated_amount)
@@ -633,7 +698,7 @@ class PaymentEntry(AccountsController):
self.payment_type == "Receive"
and self.base_total_allocated_amount < self.base_received_amount + total_deductions
and self.total_allocated_amount
< self.paid_amount + (total_deductions / self.source_exchange_rate)
< flt(self.paid_amount) + (total_deductions / self.source_exchange_rate)
):
self.unallocated_amount = (
self.base_received_amount + total_deductions - self.base_total_allocated_amount
@@ -643,7 +708,7 @@ class PaymentEntry(AccountsController):
self.payment_type == "Pay"
and self.base_total_allocated_amount < (self.base_paid_amount - total_deductions)
and self.total_allocated_amount
< self.received_amount + (total_deductions / self.target_exchange_rate)
< flt(self.received_amount) + (total_deductions / self.target_exchange_rate)
):
self.unallocated_amount = (
self.base_paid_amount - (total_deductions + self.base_total_allocated_amount)
@@ -695,35 +760,34 @@ class PaymentEntry(AccountsController):
)
def validate_payment_against_negative_invoice(self):
if (self.payment_type == "Pay" and self.party_type == "Customer") or (
self.payment_type == "Receive" and self.party_type == "Supplier"
if (self.payment_type != "Pay" or self.party_type != "Customer") and (
self.payment_type != "Receive" or self.party_type != "Supplier"
):
return
total_negative_outstanding = sum(
abs(flt(d.outstanding_amount)) for d in self.get("references") if flt(d.outstanding_amount) < 0
total_negative_outstanding = sum(
abs(flt(d.outstanding_amount)) for d in self.get("references") if flt(d.outstanding_amount) < 0
)
paid_amount = self.paid_amount if self.payment_type == "Receive" else self.received_amount
additional_charges = sum(flt(d.amount) for d in self.deductions)
if not total_negative_outstanding:
if self.party_type == "Customer":
msg = _("Cannot pay to Customer without any negative outstanding invoice")
else:
msg = _("Cannot receive from Supplier without any negative outstanding invoice")
frappe.throw(msg, InvalidPaymentEntry)
elif paid_amount - additional_charges > total_negative_outstanding:
frappe.throw(
_("Paid Amount cannot be greater than total negative outstanding amount {0}").format(
total_negative_outstanding
),
InvalidPaymentEntry,
)
paid_amount = self.paid_amount if self.payment_type == "Receive" else self.received_amount
additional_charges = sum([flt(d.amount) for d in self.deductions])
if not total_negative_outstanding:
frappe.throw(
_("Cannot {0} {1} {2} without any negative outstanding invoice").format(
_(self.payment_type),
(_("to") if self.party_type == "Customer" else _("from")),
self.party_type,
),
InvalidPaymentEntry,
)
elif paid_amount - additional_charges > total_negative_outstanding:
frappe.throw(
_("Paid Amount cannot be greater than total negative outstanding amount {0}").format(
total_negative_outstanding
),
InvalidPaymentEntry,
)
def set_title(self):
if frappe.flags.in_import and self.title:
# do not set title dynamically if title exists during data import.
@@ -837,9 +901,7 @@ class PaymentEntry(AccountsController):
}
)
allocated_amount_in_company_currency = flt(
flt(d.allocated_amount) * flt(d.exchange_rate), self.precision("paid_amount")
)
allocated_amount_in_company_currency = self.calculate_base_allocated_amount_for_reference(d)
gle.update(
{
@@ -933,6 +995,13 @@ class PaymentEntry(AccountsController):
)
if not d.included_in_paid_amount:
if get_account_currency(payment_account) != self.company_currency:
if self.payment_type == "Receive":
exchange_rate = self.target_exchange_rate
elif self.payment_type in ["Pay", "Internal Transfer"]:
exchange_rate = self.source_exchange_rate
base_tax_amount = flt((tax_amount / exchange_rate), self.precision("paid_amount"))
gl_entries.append(
self.get_gl_dict(
{
@@ -981,7 +1050,9 @@ class PaymentEntry(AccountsController):
if self.payment_type in ("Receive", "Pay") and self.party:
for d in self.get("references"):
if d.allocated_amount and d.reference_doctype in frappe.get_hooks("advance_payment_doctypes"):
frappe.get_doc(d.reference_doctype, d.reference_name).set_total_advance_paid()
frappe.get_doc(
d.reference_doctype, d.reference_name, for_update=True
).set_total_advance_paid()
def on_recurring(self, reference_doc, auto_repeat_doc):
self.reference_no = reference_doc.name
@@ -1026,7 +1097,7 @@ class PaymentEntry(AccountsController):
for fieldname in tax_fields:
tax.set(fieldname, 0.0)
self.paid_amount_after_tax = self.paid_amount
self.paid_amount_after_tax = self.base_paid_amount
def determine_exclusive_rate(self):
if not any(cint(tax.included_in_paid_amount) for tax in self.get("taxes")):
@@ -1045,7 +1116,7 @@ class PaymentEntry(AccountsController):
cumulated_tax_fraction += tax.tax_fraction_for_current_item
self.paid_amount_after_tax = flt(self.paid_amount / (1 + cumulated_tax_fraction))
self.paid_amount_after_tax = flt(self.base_paid_amount / (1 + cumulated_tax_fraction))
def calculate_taxes(self):
self.total_taxes_and_charges = 0.0
@@ -1068,7 +1139,7 @@ class PaymentEntry(AccountsController):
current_tax_amount += actual_tax_dict[tax.idx]
tax.tax_amount = current_tax_amount
tax.base_tax_amount = tax.tax_amount * self.source_exchange_rate
tax.base_tax_amount = current_tax_amount
if tax.add_deduct_tax == "Deduct":
current_tax_amount *= -1.0
@@ -1082,14 +1153,20 @@ class PaymentEntry(AccountsController):
self.get("taxes")[i - 1].total + current_tax_amount, self.precision("total", tax)
)
tax.base_total = tax.total * self.source_exchange_rate
tax.base_total = tax.total
if self.payment_type == "Pay":
self.base_total_taxes_and_charges += flt(current_tax_amount / self.source_exchange_rate)
self.total_taxes_and_charges += flt(current_tax_amount / self.target_exchange_rate)
else:
self.base_total_taxes_and_charges += flt(current_tax_amount / self.target_exchange_rate)
self.total_taxes_and_charges += flt(current_tax_amount / self.source_exchange_rate)
if tax.currency != self.paid_to_account_currency:
self.total_taxes_and_charges += flt(current_tax_amount / self.target_exchange_rate)
else:
self.total_taxes_and_charges += current_tax_amount
elif self.payment_type == "Receive":
if tax.currency != self.paid_from_account_currency:
self.total_taxes_and_charges += flt(current_tax_amount / self.source_exchange_rate)
else:
self.total_taxes_and_charges += current_tax_amount
self.base_total_taxes_and_charges += tax.base_tax_amount
if self.get("taxes"):
self.paid_amount_after_tax = self.get("taxes")[-1].base_total
@@ -1184,6 +1261,8 @@ def get_outstanding_reference_documents(args):
ple = qb.DocType("Payment Ledger Entry")
common_filter = []
accounting_dimensions_filter = []
posting_and_due_date = []
# confirm that Supplier is not blocked
if args.get("party_type") == "Supplier":
@@ -1200,7 +1279,7 @@ def get_outstanding_reference_documents(args):
party_account_currency = get_account_currency(args.get("party_account"))
company_currency = frappe.get_cached_value("Company", args.get("company"), "default_currency")
# Get positive outstanding sales /purchase invoices/ Fees
# Get positive outstanding sales /purchase invoices
condition = ""
if args.get("voucher_type") and args.get("voucher_no"):
condition = " and voucher_type={0} and voucher_no={1}".format(
@@ -1212,7 +1291,7 @@ def get_outstanding_reference_documents(args):
# Add cost center condition
if args.get("cost_center"):
condition += " and cost_center='%s'" % args.get("cost_center")
common_filter.append(ple.cost_center == args.get("cost_center"))
accounting_dimensions_filter.append(ple.cost_center == args.get("cost_center"))
date_fields_dict = {
"posting_date": ["from_posting_date", "to_posting_date"],
@@ -1224,7 +1303,7 @@ def get_outstanding_reference_documents(args):
condition += " and {0} between '{1}' and '{2}'".format(
fieldname, args.get(date_fields[0]), args.get(date_fields[1])
)
common_filter.append(ple[fieldname][args.get(date_fields[0]) : args.get(date_fields[1])])
posting_and_due_date.append(ple[fieldname][args.get(date_fields[0]) : args.get(date_fields[1])])
if args.get("company"):
condition += " and company = {0}".format(frappe.db.escape(args.get("company")))
@@ -1235,8 +1314,10 @@ def get_outstanding_reference_documents(args):
args.get("party"),
args.get("party_account"),
common_filter=common_filter,
posting_date=posting_and_due_date,
min_outstanding=args.get("outstanding_amt_greater_than"),
max_outstanding=args.get("outstanding_amt_less_than"),
accounting_dimensions=accounting_dimensions_filter,
)
outstanding_invoices = split_invoices_based_on_payment_terms(outstanding_invoices)
@@ -1537,17 +1618,7 @@ def get_account_details(account, date, cost_center=None):
@frappe.whitelist()
def get_company_defaults(company):
fields = ["write_off_account", "exchange_gain_loss_account", "cost_center"]
ret = frappe.get_cached_value("Company", company, fields, as_dict=1)
for fieldname in fields:
if not ret[fieldname]:
frappe.throw(
_("Please set default {0} in Company {1}").format(
frappe.get_meta("Company").get_label(fieldname), company
)
)
return ret
return frappe.get_cached_value("Company", company, fields, as_dict=1)
def get_outstanding_on_journal_entry(name):
@@ -1595,10 +1666,11 @@ def get_reference_details(reference_doctype, reference_name, party_account_curre
elif reference_doctype != "Journal Entry":
if not total_amount:
if party_account_currency == company_currency:
total_amount = ref_doc.base_grand_total
# for handling cases that don't have multi-currency (base field)
total_amount = ref_doc.get("grand_total") or ref_doc.get("base_grand_total")
exchange_rate = 1
else:
total_amount = ref_doc.grand_total
total_amount = ref_doc.get("grand_total")
if not exchange_rate:
# Get the exchange rate from the original ref doc
# or get it based on the posting date of the ref doc.
@@ -1609,7 +1681,7 @@ def get_reference_details(reference_doctype, reference_name, party_account_curre
if reference_doctype in ("Sales Invoice", "Purchase Invoice"):
outstanding_amount = ref_doc.get("outstanding_amount")
else:
outstanding_amount = flt(total_amount) - flt(ref_doc.advance_paid)
outstanding_amount = flt(total_amount) - flt(ref_doc.get("advance_paid"))
else:
# Get the exchange rate based on the posting date of the ref doc.
@@ -1627,16 +1699,33 @@ def get_reference_details(reference_doctype, reference_name, party_account_curre
@frappe.whitelist()
def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=None):
def get_payment_entry(
dt,
dn,
party_amount=None,
bank_account=None,
bank_amount=None,
party_type=None,
payment_type=None,
reference_date=None,
):
reference_doc = None
doc = frappe.get_doc(dt, dn)
if dt in ("Sales Order", "Purchase Order") and flt(doc.per_billed, 2) > 0:
over_billing_allowance = frappe.db.get_single_value("Accounts Settings", "over_billing_allowance")
if dt in ("Sales Order", "Purchase Order") and flt(doc.per_billed, 2) >= (
100.0 + over_billing_allowance
):
frappe.throw(_("Can only make payment against unbilled {0}").format(dt))
party_type = set_party_type(dt)
if not party_type:
party_type = set_party_type(dt)
party_account = set_party_account(dt, dn, doc, party_type)
party_account_currency = set_party_account_currency(dt, party_account, doc)
payment_type = set_payment_type(dt, doc)
if not payment_type:
payment_type = set_payment_type(dt, doc)
grand_total, outstanding_amount = set_grand_total_and_outstanding_amount(
party_amount, dt, party_account_currency, doc
)
@@ -1644,12 +1733,20 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
# bank or cash
bank = get_bank_cash_account(doc, bank_account)
# if default bank or cash account is not set in company master and party has default company bank account, fetch it
if party_type in ["Customer", "Supplier"] and not bank:
party_bank_account = get_party_bank_account(party_type, doc.get(scrub(party_type)))
if party_bank_account:
account = frappe.db.get_value("Bank Account", party_bank_account, "account")
bank = get_bank_cash_account(doc, account)
paid_amount, received_amount = set_paid_amount_and_received_amount(
dt, party_account_currency, bank, outstanding_amount, payment_type, bank_amount, doc
)
paid_amount, received_amount, discount_amount = apply_early_payment_discount(
paid_amount, received_amount, doc
reference_date = getdate(reference_date)
paid_amount, received_amount, discount_amount, valid_discounts = apply_early_payment_discount(
paid_amount, received_amount, doc, party_account_currency, reference_date
)
pe = frappe.new_doc("Payment Entry")
@@ -1657,6 +1754,7 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
pe.company = doc.company
pe.cost_center = doc.get("cost_center")
pe.posting_date = nowdate()
pe.reference_date = reference_date
pe.mode_of_payment = doc.get("mode_of_payment")
pe.party_type = party_type
pe.party = doc.get(scrub(party_type))
@@ -1690,14 +1788,19 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
if doc.doctype == "Purchase Invoice" and doc.invoice_is_blocked():
frappe.msgprint(_("{0} is on hold till {1}").format(doc.name, doc.release_date))
else:
if doc.doctype in ("Sales Invoice", "Purchase Invoice") and frappe.get_value(
if doc.doctype in (
"Sales Invoice",
"Purchase Invoice",
"Purchase Order",
"Sales Order",
) and frappe.get_cached_value(
"Payment Terms Template",
{"name": doc.payment_terms_template},
"allocate_payment_based_on_payment_terms",
):
for reference in get_reference_as_per_payment_terms(
doc.payment_schedule, dt, dn, doc, grand_total, outstanding_amount
doc.payment_schedule, dt, dn, doc, grand_total, outstanding_amount, party_account_currency
):
pe.append("references", reference)
else:
@@ -1742,24 +1845,40 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
pe.setup_party_account_field()
pe.set_missing_values()
pe.set_missing_ref_details()
update_accounting_dimensions(pe, doc)
if party_account and bank:
pe.set_exchange_rate(ref_doc=reference_doc)
pe.set_amounts()
if discount_amount:
pe.set_gain_or_loss(
account_details={
"account": frappe.get_cached_value("Company", pe.company, "default_discount_account"),
"cost_center": pe.cost_center
or frappe.get_cached_value("Company", pe.company, "cost_center"),
"amount": discount_amount * (-1 if payment_type == "Pay" else 1),
}
base_total_discount_loss = 0
if frappe.db.get_single_value("Accounts Settings", "book_tax_discount_loss"):
base_total_discount_loss = split_early_payment_discount_loss(pe, doc, valid_discounts)
set_pending_discount_loss(
pe, doc, discount_amount, base_total_discount_loss, party_account_currency
)
pe.set_difference_amount()
pe.set_difference_amount()
return pe
def update_accounting_dimensions(pe, doc):
"""
Updates accounting dimensions in Payment Entry based on the accounting dimensions in the reference document
"""
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
get_accounting_dimensions,
)
for dimension in get_accounting_dimensions():
pe.set(dimension, doc.get(dimension))
def get_bank_cash_account(doc, bank_account):
bank = get_default_bank_cash_account(
doc.company, "Bank", mode_of_payment=doc.get("mode_of_payment"), account=bank_account
@@ -1786,8 +1905,6 @@ def set_party_account(dt, dn, doc, party_type):
party_account = get_party_account_based_on_invoice_discounting(dn) or doc.debit_to
elif dt == "Purchase Invoice":
party_account = doc.credit_to
elif dt == "Fees":
party_account = doc.receivable_account
else:
party_account = get_party_account(party_type, doc.get(party_type.lower()), doc.company)
return party_account
@@ -1803,8 +1920,7 @@ def set_party_account_currency(dt, party_account, doc):
def set_payment_type(dt, doc):
if (
dt == "Sales Order"
or (dt in ("Sales Invoice", "Fees", "Dunning") and doc.outstanding_amount > 0)
dt == "Sales Order" or (dt in ("Sales Invoice", "Dunning") and doc.outstanding_amount > 0)
) or (dt == "Purchase Invoice" and doc.outstanding_amount < 0):
payment_type = "Receive"
else:
@@ -1822,18 +1938,15 @@ def set_grand_total_and_outstanding_amount(party_amount, dt, party_account_curre
else:
grand_total = doc.rounded_total or doc.grand_total
outstanding_amount = doc.outstanding_amount
elif dt == "Fees":
grand_total = doc.grand_total
outstanding_amount = doc.outstanding_amount
elif dt == "Dunning":
grand_total = doc.grand_total
outstanding_amount = doc.grand_total
else:
if party_account_currency == doc.company_currency:
grand_total = flt(doc.get("base_rounded_total") or doc.base_grand_total)
grand_total = flt(doc.get("base_rounded_total") or doc.get("base_grand_total"))
else:
grand_total = flt(doc.get("rounded_total") or doc.grand_total)
outstanding_amount = grand_total - flt(doc.advance_paid)
grand_total = flt(doc.get("rounded_total") or doc.get("grand_total"))
outstanding_amount = doc.get("outstanding_amount") or (grand_total - flt(doc.advance_paid))
return grand_total, outstanding_amount
@@ -1843,37 +1956,53 @@ def set_paid_amount_and_received_amount(
paid_amount = received_amount = 0
if party_account_currency == bank.account_currency:
paid_amount = received_amount = abs(outstanding_amount)
elif payment_type == "Receive":
paid_amount = abs(outstanding_amount)
if bank_amount:
received_amount = bank_amount
else:
received_amount = paid_amount * doc.get("conversion_rate", 1)
else:
received_amount = abs(outstanding_amount)
if bank_amount:
paid_amount = bank_amount
company_currency = frappe.get_cached_value("Company", doc.get("company"), "default_currency")
if payment_type == "Receive":
paid_amount = abs(outstanding_amount)
if bank_amount:
received_amount = bank_amount
else:
if company_currency != bank.account_currency:
received_amount = paid_amount / doc.get("conversion_rate", 1)
else:
received_amount = paid_amount * doc.get("conversion_rate", 1)
else:
# if party account currency and bank currency is different then populate paid amount as well
paid_amount = received_amount * doc.get("conversion_rate", 1)
received_amount = abs(outstanding_amount)
if bank_amount:
paid_amount = bank_amount
else:
if company_currency != bank.account_currency:
paid_amount = received_amount / doc.get("conversion_rate", 1)
else:
# if party account currency and bank currency is different then populate paid amount as well
paid_amount = received_amount * doc.get("conversion_rate", 1)
return paid_amount, received_amount
def apply_early_payment_discount(paid_amount, received_amount, doc):
def apply_early_payment_discount(
paid_amount, received_amount, doc, party_account_currency, reference_date
):
total_discount = 0
valid_discounts = []
eligible_for_payments = ["Sales Order", "Sales Invoice", "Purchase Order", "Purchase Invoice"]
has_payment_schedule = hasattr(doc, "payment_schedule") and doc.payment_schedule
is_multi_currency = party_account_currency != doc.company_currency
if doc.doctype in eligible_for_payments and has_payment_schedule:
for term in doc.payment_schedule:
if not term.discounted_amount and term.discount and getdate(nowdate()) <= term.discount_date:
if not term.discounted_amount and term.discount and reference_date <= term.discount_date:
if term.discount_type == "Percentage":
discount_amount = flt(doc.get("grand_total")) * (term.discount / 100)
grand_total = doc.get("grand_total") if is_multi_currency else doc.get("base_grand_total")
discount_amount = flt(grand_total) * (term.discount / 100)
else:
discount_amount = term.discount
discount_amount_in_foreign_currency = discount_amount * doc.get("conversion_rate", 1)
# if accounting is done in the same currency, paid_amount = received_amount
conversion_rate = doc.get("conversion_rate", 1) if is_multi_currency else 1
discount_amount_in_foreign_currency = discount_amount * conversion_rate
if doc.doctype == "Sales Invoice":
paid_amount -= discount_amount
@@ -1882,23 +2011,151 @@ def apply_early_payment_discount(paid_amount, received_amount, doc):
received_amount -= discount_amount
paid_amount -= discount_amount_in_foreign_currency
valid_discounts.append({"type": term.discount_type, "discount": term.discount})
total_discount += discount_amount
if total_discount:
money = frappe.utils.fmt_money(total_discount, currency=doc.get("currency"))
currency = doc.get("currency") if is_multi_currency else doc.company_currency
money = frappe.utils.fmt_money(total_discount, currency=currency)
frappe.msgprint(_("Discount of {} applied as per Payment Term").format(money), alert=1)
return paid_amount, received_amount, total_discount
return paid_amount, received_amount, total_discount, valid_discounts
def set_pending_discount_loss(
pe, doc, discount_amount, base_total_discount_loss, party_account_currency
):
# If multi-currency, get base discount amount to adjust with base currency deductions/losses
if party_account_currency != doc.company_currency:
discount_amount = discount_amount * doc.get("conversion_rate", 1)
# Avoid considering miniscule losses
discount_amount = flt(discount_amount - base_total_discount_loss, doc.precision("grand_total"))
# Set base discount amount (discount loss/pending rounding loss) in deductions
if discount_amount > 0.0:
positive_negative = -1 if pe.payment_type == "Pay" else 1
# If tax loss booking is enabled, pending loss will be rounding loss.
# Otherwise it will be the total discount loss.
book_tax_loss = frappe.db.get_single_value("Accounts Settings", "book_tax_discount_loss")
account_type = "round_off_account" if book_tax_loss else "default_discount_account"
pe.set_gain_or_loss(
account_details={
"account": frappe.get_cached_value("Company", pe.company, account_type),
"cost_center": pe.cost_center or frappe.get_cached_value("Company", pe.company, "cost_center"),
"amount": discount_amount * positive_negative,
}
)
def split_early_payment_discount_loss(pe, doc, valid_discounts) -> float:
"""Split early payment discount into Income Loss & Tax Loss."""
total_discount_percent = get_total_discount_percent(doc, valid_discounts)
if not total_discount_percent:
return 0.0
base_loss_on_income = add_income_discount_loss(pe, doc, total_discount_percent)
base_loss_on_taxes = add_tax_discount_loss(pe, doc, total_discount_percent)
# Round off total loss rather than individual losses to reduce rounding error
return flt(base_loss_on_income + base_loss_on_taxes, doc.precision("grand_total"))
def get_total_discount_percent(doc, valid_discounts) -> float:
"""Get total percentage and amount discount applied as a percentage."""
total_discount_percent = (
sum(
discount.get("discount") for discount in valid_discounts if discount.get("type") == "Percentage"
)
or 0.0
)
# Operate in percentages only as it makes the income & tax split easier
total_discount_amount = (
sum(discount.get("discount") for discount in valid_discounts if discount.get("type") == "Amount")
or 0.0
)
if total_discount_amount:
discount_percentage = (total_discount_amount / doc.get("grand_total")) * 100
total_discount_percent += discount_percentage
return total_discount_percent
return total_discount_percent
def add_income_discount_loss(pe, doc, total_discount_percent) -> float:
"""Add loss on income discount in base currency."""
precision = doc.precision("total")
base_loss_on_income = doc.get("base_total") * (total_discount_percent / 100)
pe.append(
"deductions",
{
"account": frappe.get_cached_value("Company", pe.company, "default_discount_account"),
"cost_center": pe.cost_center or frappe.get_cached_value("Company", pe.company, "cost_center"),
"amount": flt(base_loss_on_income, precision),
},
)
return base_loss_on_income # Return loss without rounding
def add_tax_discount_loss(pe, doc, total_discount_percentage) -> float:
"""Add loss on tax discount in base currency."""
tax_discount_loss = {}
base_total_tax_loss = 0
precision = doc.precision("tax_amount_after_discount_amount", "taxes")
# The same account head could be used more than once
for tax in doc.get("taxes", []):
base_tax_loss = tax.get("base_tax_amount_after_discount_amount") * (
total_discount_percentage / 100
)
account = tax.get("account_head")
if not tax_discount_loss.get(account):
tax_discount_loss[account] = base_tax_loss
else:
tax_discount_loss[account] += base_tax_loss
for account, loss in tax_discount_loss.items():
base_total_tax_loss += loss
if loss == 0.0:
continue
pe.append(
"deductions",
{
"account": account,
"cost_center": pe.cost_center or frappe.get_cached_value("Company", pe.company, "cost_center"),
"amount": flt(loss, precision),
},
)
return base_total_tax_loss # Return loss without rounding
def get_reference_as_per_payment_terms(
payment_schedule, dt, dn, doc, grand_total, outstanding_amount
payment_schedule, dt, dn, doc, grand_total, outstanding_amount, party_account_currency
):
references = []
is_multi_currency_acc = (doc.currency != doc.company_currency) and (
party_account_currency != doc.company_currency
)
for payment_term in payment_schedule:
payment_term_outstanding = flt(
payment_term.payment_amount - payment_term.paid_amount, payment_term.precision("payment_amount")
)
if not is_multi_currency_acc:
# If accounting is done in company currency for multi-currency transaction
payment_term_outstanding = flt(
payment_term_outstanding * doc.get("conversion_rate"), payment_term.precision("payment_amount")
)
if payment_term_outstanding:
references.append(

View File

@@ -4,7 +4,8 @@
import unittest
import frappe
from frappe.tests.utils import FrappeTestCase
from frappe import qb
from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import flt, nowdate
from erpnext.accounts.doctype.payment_entry.payment_entry import (
@@ -50,6 +51,38 @@ class TestPaymentEntry(FrappeTestCase):
so_advance_paid = frappe.db.get_value("Sales Order", so.name, "advance_paid")
self.assertEqual(so_advance_paid, 0)
def test_payment_against_sales_order_usd_to_inr(self):
so = make_sales_order(
customer="_Test Customer USD", currency="USD", qty=1, rate=100, do_not_submit=True
)
so.conversion_rate = 50
so.submit()
pe = get_payment_entry("Sales Order", so.name)
pe.source_exchange_rate = 55
pe.received_amount = 5500
pe.insert()
pe.submit()
# there should be no difference amount
pe.reload()
self.assertEqual(pe.difference_amount, 0)
self.assertEqual(pe.deductions, [])
expected_gle = dict(
(d[0], d)
for d in [["_Test Receivable USD - _TC", 0, 5500, so.name], ["Cash - _TC", 5500.0, 0, None]]
)
self.validate_gl_entries(pe.name, expected_gle)
so_advance_paid = frappe.db.get_value("Sales Order", so.name, "advance_paid")
self.assertEqual(so_advance_paid, 100)
pe.cancel()
so_advance_paid = frappe.db.get_value("Sales Order", so.name, "advance_paid")
self.assertEqual(so_advance_paid, 0)
def test_payment_entry_for_blocked_supplier_invoice(self):
supplier = frappe.get_doc("Supplier", "_Test Supplier")
supplier.on_hold = 1
@@ -255,10 +288,25 @@ class TestPaymentEntry(FrappeTestCase):
},
)
si.save()
si.submit()
frappe.db.set_single_value("Accounts Settings", "book_tax_discount_loss", 1)
pe_with_tax_loss = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Cash - _TC")
self.assertEqual(pe_with_tax_loss.references[0].payment_term, "30 Credit Days with 10% Discount")
self.assertEqual(pe_with_tax_loss.references[0].allocated_amount, 236.0)
self.assertEqual(pe_with_tax_loss.paid_amount, 212.4)
self.assertEqual(pe_with_tax_loss.deductions[0].amount, 20.0) # Loss on Income
self.assertEqual(pe_with_tax_loss.deductions[1].amount, 3.6) # Loss on Tax
self.assertEqual(pe_with_tax_loss.deductions[1].account, "_Test Account Service Tax - _TC")
frappe.db.set_single_value("Accounts Settings", "book_tax_discount_loss", 0)
pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Cash - _TC")
self.assertEqual(pe.references[0].allocated_amount, 236.0)
self.assertEqual(pe.paid_amount, 212.4)
self.assertEqual(pe.deductions[0].amount, 23.6)
pe.submit()
si.load_from_db()
@@ -268,6 +316,190 @@ class TestPaymentEntry(FrappeTestCase):
self.assertEqual(si.payment_schedule[0].outstanding, 0)
self.assertEqual(si.payment_schedule[0].discounted_amount, 23.6)
def test_payment_entry_against_payment_terms_with_discount_amount(self):
si = create_sales_invoice(do_not_save=1, qty=1, rate=200)
si.payment_terms_template = "Test Discount Amount Template"
create_payment_terms_template_with_discount(
name="30 Credit Days with Rs.50 Discount",
discount_type="Amount",
discount=50,
template_name="Test Discount Amount Template",
)
frappe.db.set_value("Company", si.company, "default_discount_account", "Write Off - _TC")
si.append(
"taxes",
{
"charge_type": "On Net Total",
"account_head": "_Test Account Service Tax - _TC",
"cost_center": "_Test Cost Center - _TC",
"description": "Service Tax",
"rate": 18,
},
)
si.save()
si.submit()
# Set reference date past discount cut off date
pe_1 = get_payment_entry(
"Sales Invoice",
si.name,
bank_account="_Test Cash - _TC",
reference_date=frappe.utils.add_days(si.posting_date, 2),
)
self.assertEqual(pe_1.paid_amount, 236.0) # discount not applied
# Test if tax loss is booked on enabling configuration
frappe.db.set_single_value("Accounts Settings", "book_tax_discount_loss", 1)
pe_with_tax_loss = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Cash - _TC")
self.assertEqual(pe_with_tax_loss.deductions[0].amount, 42.37) # Loss on Income
self.assertEqual(pe_with_tax_loss.deductions[1].amount, 7.63) # Loss on Tax
self.assertEqual(pe_with_tax_loss.deductions[1].account, "_Test Account Service Tax - _TC")
frappe.db.set_single_value("Accounts Settings", "book_tax_discount_loss", 0)
pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Cash - _TC")
self.assertEqual(pe.references[0].allocated_amount, 236.0)
self.assertEqual(pe.paid_amount, 186)
self.assertEqual(pe.deductions[0].amount, 50.0)
pe.submit()
si.load_from_db()
self.assertEqual(si.payment_schedule[0].payment_amount, 236.0)
self.assertEqual(si.payment_schedule[0].paid_amount, 186)
self.assertEqual(si.payment_schedule[0].outstanding, 0)
self.assertEqual(si.payment_schedule[0].discounted_amount, 50)
@change_settings(
"Accounts Settings",
{
"allow_multi_currency_invoices_against_single_party_account": 1,
"book_tax_discount_loss": 1,
},
)
def test_payment_entry_multicurrency_si_with_base_currency_accounting_early_payment_discount(
self,
):
"""
1. Multi-currency SI with single currency accounting (company currency)
2. PE with early payment discount
3. Test if Paid Amount is calculated in company currency
4. Test if deductions are calculated in company currency
SI is in USD to document agreed amounts that are in USD, but the accounting is in base currency.
"""
si = create_sales_invoice(
customer="_Test Customer",
currency="USD",
conversion_rate=50,
do_not_save=1,
)
create_payment_terms_template_with_discount()
si.payment_terms_template = "Test Discount Template"
frappe.db.set_value("Company", si.company, "default_discount_account", "Write Off - _TC")
si.save()
si.submit()
pe = get_payment_entry(
"Sales Invoice",
si.name,
bank_account="_Test Bank - _TC",
)
pe.reference_no = si.name
pe.reference_date = nowdate()
# Early payment discount loss on income
self.assertEqual(pe.paid_amount, 4500.0) # Amount in company currency
self.assertEqual(pe.received_amount, 4500.0)
self.assertEqual(pe.deductions[0].amount, 500.0)
self.assertEqual(pe.deductions[0].account, "Write Off - _TC")
self.assertEqual(pe.difference_amount, 0.0)
pe.insert()
pe.submit()
expected_gle = dict(
(d[0], d)
for d in [
["Debtors - _TC", 0, 5000, si.name],
["_Test Bank - _TC", 4500, 0, None],
["Write Off - _TC", 500.0, 0, None],
]
)
self.validate_gl_entries(pe.name, expected_gle)
outstanding_amount = flt(frappe.db.get_value("Sales Invoice", si.name, "outstanding_amount"))
self.assertEqual(outstanding_amount, 0)
def test_payment_entry_multicurrency_accounting_si_with_early_payment_discount(self):
"""
1. Multi-currency SI with multi-currency accounting
2. PE with early payment discount and also exchange loss
3. Test if Paid Amount is calculated in transaction currency
4. Test if deductions are calculated in base/company currency
5. Test if exchange loss is reflected in difference
"""
si = create_sales_invoice(
customer="_Test Customer USD",
debit_to="_Test Receivable USD - _TC",
currency="USD",
conversion_rate=50,
do_not_save=1,
)
create_payment_terms_template_with_discount()
si.payment_terms_template = "Test Discount Template"
frappe.db.set_value("Company", si.company, "default_discount_account", "Write Off - _TC")
si.save()
si.submit()
pe = get_payment_entry(
"Sales Invoice", si.name, bank_account="_Test Bank - _TC", bank_amount=4700
)
pe.reference_no = si.name
pe.reference_date = nowdate()
# Early payment discount loss on income
self.assertEqual(pe.paid_amount, 90.0)
self.assertEqual(pe.received_amount, 4200.0) # 5000 - 500 (discount) - 300 (exchange loss)
self.assertEqual(pe.deductions[0].amount, 500.0)
self.assertEqual(pe.deductions[0].account, "Write Off - _TC")
# Exchange loss
self.assertEqual(pe.difference_amount, 300.0)
pe.append(
"deductions",
{
"account": "_Test Exchange Gain/Loss - _TC",
"cost_center": "_Test Cost Center - _TC",
"amount": 300.0,
},
)
pe.insert()
pe.submit()
self.assertEqual(pe.difference_amount, 0.0)
expected_gle = dict(
(d[0], d)
for d in [
["_Test Receivable USD - _TC", 0, 5000, si.name],
["_Test Bank - _TC", 4200, 0, None],
["Write Off - _TC", 500.0, 0, None],
["_Test Exchange Gain/Loss - _TC", 300.0, 0, None],
]
)
self.validate_gl_entries(pe.name, expected_gle)
outstanding_amount = flt(frappe.db.get_value("Sales Invoice", si.name, "outstanding_amount"))
self.assertEqual(outstanding_amount, 0)
def test_payment_against_purchase_invoice_to_check_status(self):
pi = make_purchase_invoice(
supplier="_Test Supplier USD",
@@ -722,6 +954,46 @@ class TestPaymentEntry(FrappeTestCase):
flt(payment_entry.total_taxes_and_charges, 2), flt(10 / payment_entry.target_exchange_rate, 2)
)
def test_gl_of_multi_currency_payment_with_taxes(self):
payment_entry = create_payment_entry(
party="_Test Supplier USD", paid_to="_Test Payable USD - _TC", save=True
)
payment_entry.append(
"taxes",
{
"account_head": "_Test Account Service Tax - _TC",
"charge_type": "Actual",
"tax_amount": 100,
"add_deduct_tax": "Add",
"description": "Test",
},
)
payment_entry.target_exchange_rate = 80
payment_entry.received_amount = 12.5
payment_entry = payment_entry.submit()
gle = qb.DocType("GL Entry")
gl_entries = (
qb.from_(gle)
.select(
gle.account,
gle.debit,
gle.credit,
gle.debit_in_account_currency,
gle.credit_in_account_currency,
)
.orderby(gle.account)
.where(gle.voucher_no == payment_entry.name)
.run()
)
expected_gl_entries = (
("_Test Account Service Tax - _TC", 100.0, 0.0, 100.0, 0.0),
("_Test Bank - _TC", 0.0, 1100.0, 0.0, 1100.0),
("_Test Payable USD - _TC", 1000.0, 0.0, 12.5, 0),
)
self.assertEqual(gl_entries, expected_gl_entries)
def test_payment_entry_against_onhold_purchase_invoice(self):
pi = make_purchase_invoice()
@@ -798,24 +1070,27 @@ def create_payment_terms_template():
).insert()
def create_payment_terms_template_with_discount():
def create_payment_terms_template_with_discount(
name=None, discount_type=None, discount=None, template_name=None
):
create_payment_term(name or "30 Credit Days with 10% Discount")
template_name = template_name or "Test Discount Template"
create_payment_term("30 Credit Days with 10% Discount")
if not frappe.db.exists("Payment Terms Template", "Test Discount Template"):
payment_term_template = frappe.get_doc(
if not frappe.db.exists("Payment Terms Template", template_name):
frappe.get_doc(
{
"doctype": "Payment Terms Template",
"template_name": "Test Discount Template",
"template_name": template_name,
"allocate_payment_based_on_payment_terms": 1,
"terms": [
{
"doctype": "Payment Terms Template Detail",
"payment_term": "30 Credit Days with 10% Discount",
"payment_term": name or "30 Credit Days with 10% Discount",
"invoice_portion": 100,
"credit_days_based_on": "Day(s) after invoice date",
"credit_days": 2,
"discount": 10,
"discount_type": discount_type or "Percentage",
"discount": discount or 10,
"discount_validity_based_on": "Day(s) after invoice date",
"discount_validity": 1,
}

View File

@@ -3,6 +3,7 @@
"creation": "2016-06-15 15:56:30.815503",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"account",
"cost_center",
@@ -17,9 +18,7 @@
"in_list_view": 1,
"label": "Account",
"options": "Account",
"reqd": 1,
"show_days": 1,
"show_seconds": 1
"reqd": 1
},
{
"fieldname": "cost_center",
@@ -28,37 +27,30 @@
"label": "Cost Center",
"options": "Cost Center",
"print_hide": 1,
"reqd": 1,
"show_days": 1,
"show_seconds": 1
"reqd": 1
},
{
"fieldname": "amount",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Amount",
"reqd": 1,
"show_days": 1,
"show_seconds": 1
"label": "Amount (Company Currency)",
"options": "Company:company:default_currency",
"reqd": 1
},
{
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"show_days": 1,
"show_seconds": 1
"fieldtype": "Column Break"
},
{
"fieldname": "description",
"fieldtype": "Small Text",
"label": "Description",
"show_days": 1,
"show_seconds": 1
"label": "Description"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2020-09-12 20:38:08.110674",
"modified": "2023-03-06 07:11:57.739619",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry Deduction",
@@ -66,5 +58,6 @@
"permissions": [],
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC"
"sort_order": "DESC",
"states": []
}

View File

@@ -25,7 +25,8 @@
"in_list_view": 1,
"label": "Type",
"options": "DocType",
"reqd": 1
"reqd": 1,
"search_index": 1
},
{
"columns": 2,
@@ -35,7 +36,8 @@
"in_list_view": 1,
"label": "Name",
"options": "reference_doctype",
"reqd": 1
"reqd": 1,
"search_index": 1
},
{
"fieldname": "due_date",
@@ -104,7 +106,7 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2021-09-26 17:06:55.597389",
"modified": "2022-12-12 12:31:44.919895",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry Reference",
@@ -113,5 +115,6 @@
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -3,6 +3,7 @@
frappe.ui.form.on('Payment Gateway Account', {
refresh(frm) {
erpnext.utils.check_payments_app();
if(!frm.doc.__islocal) {
frm.set_df_property('payment_gateway', 'read_only', 1);
}

View File

@@ -22,7 +22,8 @@
"amount",
"account_currency",
"amount_in_account_currency",
"delinked"
"delinked",
"remarks"
],
"fields": [
{
@@ -136,12 +137,17 @@
"fieldtype": "Link",
"label": "Finance Book",
"options": "Finance Book"
},
{
"fieldname": "remarks",
"fieldtype": "Text",
"label": "Remarks"
}
],
"in_create": 1,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-07-11 09:13:54.379168",
"modified": "2022-08-22 15:32:56.629430",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Ledger Entry",

View File

@@ -3,12 +3,13 @@
import frappe
from frappe import qb
from frappe.tests.utils import FrappeTestCase
from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import nowdate
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_payment_entry
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.stock.doctype.item.test_item import create_item
@@ -127,6 +128,25 @@ class TestPaymentLedgerEntry(FrappeTestCase):
payment.posting_date = posting_date
return payment
def create_sales_order(
self, qty=1, rate=100, posting_date=nowdate(), do_not_save=False, do_not_submit=False
):
so = make_sales_order(
company=self.company,
transaction_date=posting_date,
customer=self.customer,
item_code=self.item,
cost_center=self.cost_center,
warehouse=self.warehouse,
debit_to=self.debit_to,
currency="INR",
qty=qty,
rate=100,
do_not_save=do_not_save,
do_not_submit=do_not_submit,
)
return so
def clear_old_entries(self):
doctype_list = [
"GL Entry",
@@ -406,3 +426,89 @@ class TestPaymentLedgerEntry(FrappeTestCase):
]
self.assertEqual(pl_entries_for_crnote[0], expected_values[0])
self.assertEqual(pl_entries_for_crnote[1], expected_values[1])
@change_settings(
"Accounts Settings",
{"unlink_payment_on_cancellation_of_invoice": 1, "delete_linked_ledger_entries": 1},
)
def test_multi_payment_unlink_on_invoice_cancellation(self):
transaction_date = nowdate()
amount = 100
si = self.create_sales_invoice(qty=1, rate=amount, posting_date=transaction_date)
for amt in [40, 40, 20]:
# payment 1
pe = get_payment_entry(si.doctype, si.name)
pe.paid_amount = amt
pe.get("references")[0].allocated_amount = amt
pe = pe.save().submit()
si.reload()
si.cancel()
entries = frappe.db.get_list(
"Payment Ledger Entry",
filters={"against_voucher_type": si.doctype, "against_voucher_no": si.name, "delinked": 0},
)
self.assertEqual(entries, [])
# with references removed, deletion should be possible
si.delete()
self.assertRaises(frappe.DoesNotExistError, frappe.get_doc, si.doctype, si.name)
@change_settings(
"Accounts Settings",
{"unlink_payment_on_cancellation_of_invoice": 1, "delete_linked_ledger_entries": 1},
)
def test_multi_je_unlink_on_invoice_cancellation(self):
transaction_date = nowdate()
amount = 100
si = self.create_sales_invoice(qty=1, rate=amount, posting_date=transaction_date)
# multiple JE's against invoice
for amt in [40, 40, 20]:
je1 = self.create_journal_entry(
self.income_account, self.debit_to, amt, posting_date=transaction_date
)
je1.get("accounts")[1].party_type = "Customer"
je1.get("accounts")[1].party = self.customer
je1.get("accounts")[1].reference_type = si.doctype
je1.get("accounts")[1].reference_name = si.name
je1 = je1.save().submit()
si.reload()
si.cancel()
entries = frappe.db.get_list(
"Payment Ledger Entry",
filters={"against_voucher_type": si.doctype, "against_voucher_no": si.name, "delinked": 0},
)
self.assertEqual(entries, [])
# with references removed, deletion should be possible
si.delete()
self.assertRaises(frappe.DoesNotExistError, frappe.get_doc, si.doctype, si.name)
@change_settings(
"Accounts Settings",
{"unlink_payment_on_cancellation_of_invoice": 1, "delete_linked_ledger_entries": 1},
)
def test_advance_payment_unlink_on_order_cancellation(self):
transaction_date = nowdate()
amount = 100
so = self.create_sales_order(qty=1, rate=amount, posting_date=transaction_date).save().submit()
pe = get_payment_entry(so.doctype, so.name).save().submit()
so.reload()
so.cancel()
entries = frappe.db.get_list(
"Payment Ledger Entry",
filters={"against_voucher_type": so.doctype, "against_voucher_no": so.name, "delinked": 0},
)
self.assertEqual(entries, [])
# with references removed, deletion should be possible
so.delete()
self.assertRaises(frappe.DoesNotExistError, frappe.get_doc, so.doctype, so.name)

View File

@@ -82,6 +82,32 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
this.frm.change_custom_button_type('Get Unreconciled Entries', null, 'default');
this.frm.change_custom_button_type('Allocate', null, 'default');
}
// check for any running reconciliation jobs
if (this.frm.doc.receivable_payable_account) {
frappe.db.get_single_value("Accounts Settings", "auto_reconcile_payments").then((enabled) => {
if(enabled) {
this.frm.call({
'method': "erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.is_any_doc_running",
"args": {
for_filter: {
company: this.frm.doc.company,
party_type: this.frm.doc.party_type,
party: this.frm.doc.party,
receivable_payable_account: this.frm.doc.receivable_payable_account
}
}
}).then(r => {
if (r.message) {
let doc_link = frappe.utils.get_form_link("Process Payment Reconciliation", r.message, true);
let msg = __("Payment Reconciliation Job: {0} is running for this party. Can't reconcile now.", [doc_link]);
this.frm.dashboard.add_comment(msg, "yellow");
}
});
}
});
}
}
company() {
@@ -170,7 +196,7 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
}
reconcile() {
var show_dialog = this.frm.doc.allocation.filter(d => d.difference_amount && !d.difference_account);
var show_dialog = this.frm.doc.allocation.filter(d => d.difference_amount);
if (show_dialog && show_dialog.length) {
@@ -179,8 +205,12 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
title: __("Select Difference Account"),
fields: [
{
fieldname: "allocation", fieldtype: "Table", label: __("Allocation"),
data: this.data, in_place_edit: true,
fieldname: "allocation",
fieldtype: "Table",
label: __("Allocation"),
data: this.data,
in_place_edit: true,
cannot_add_rows: true,
get_data: () => {
return this.data;
},
@@ -218,6 +248,10 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
read_only: 1
}]
},
{
fieldtype: 'HTML',
options: "<b> New Journal Entry will be posted for the difference amount </b>"
}
],
primary_action: () => {
const args = dialog.get_values()["allocation"];
@@ -234,7 +268,7 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
});
this.frm.doc.allocation.forEach(d => {
if (d.difference_amount && !d.difference_account) {
if (d.difference_amount) {
dialog.fields_dict.allocation.df.data.push({
'docname': d.name,
'reference_name': d.reference_name,
@@ -264,4 +298,32 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
}
};
frappe.ui.form.on('Payment Reconciliation Allocation', {
allocated_amount: function(frm, cdt, cdn) {
let row = locals[cdt][cdn];
// filter invoice
let invoice = frm.doc.invoices.filter((x) => (x.invoice_number == row.invoice_number));
// filter payment
let payment = frm.doc.payments.filter((x) => (x.reference_name == row.reference_name));
frm.call({
doc: frm.doc,
method: 'calculate_difference_on_allocation_change',
args: {
payment_entry: payment,
invoice: invoice,
allocated_amount: row.allocated_amount
},
callback: (r) => {
if (r.message) {
row.difference_amount = r.message;
frm.refresh();
}
}
});
}
});
extend_cscript(cur_frm.cscript, new erpnext.accounts.PaymentReconciliationController({frm: cur_frm}));

View File

@@ -7,9 +7,12 @@ from frappe import _, msgprint, qb
from frappe.model.document import Document
from frappe.query_builder.custom import ConstantColumn
from frappe.query_builder.functions import IfNull
from frappe.utils import flt, getdate, nowdate, today
from frappe.utils import flt, get_link_to_form, getdate, nowdate, today
import erpnext
from erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation import (
is_any_doc_running,
)
from erpnext.accounts.utils import (
QueryPaymentLedger,
get_outstanding_invoices,
@@ -22,6 +25,8 @@ class PaymentReconciliation(Document):
def __init__(self, *args, **kwargs):
super(PaymentReconciliation, self).__init__(*args, **kwargs)
self.common_filter_conditions = []
self.accounting_dimension_filter_conditions = []
self.ple_posting_date_filter = []
@frappe.whitelist()
def get_unreconciled_entries(self):
@@ -67,6 +72,10 @@ class PaymentReconciliation(Document):
def get_jv_entries(self):
condition = self.get_conditions()
if self.get("cost_center"):
condition += f" and t2.cost_center = '{self.cost_center}' "
dr_or_cr = (
"credit_in_account_currency"
if erpnext.get_party_account_type(self.party_type) == "Receivable"
@@ -77,12 +86,13 @@ class PaymentReconciliation(Document):
"t2.against_account like %(bank_cash_account)s" if self.bank_cash_account else "1=1"
)
# nosemgrep
journal_entries = frappe.db.sql(
"""
select
"Journal Entry" as reference_type, t1.name as reference_name,
t1.posting_date, t1.remark as remarks, t2.name as reference_row,
{dr_or_cr} as amount, t2.is_advance,
{dr_or_cr} as amount, t2.is_advance, t2.exchange_rate,
t2.account_currency as currency
from
`tabJournal Entry` t1, `tabJournal Entry Account` t2
@@ -150,6 +160,7 @@ class PaymentReconciliation(Document):
return_outstanding = ple_query.get_voucher_outstandings(
vouchers=return_invoices,
common_filter=self.common_filter_conditions,
posting_date=self.ple_posting_date_filter,
min_outstanding=-(self.minimum_payment_amount) if self.minimum_payment_amount else None,
max_outstanding=-(self.maximum_payment_amount) if self.maximum_payment_amount else None,
get_payments=True,
@@ -187,8 +198,10 @@ class PaymentReconciliation(Document):
self.party,
self.receivable_payable_account,
common_filter=self.common_filter_conditions,
posting_date=self.ple_posting_date_filter,
min_outstanding=self.minimum_invoice_amount if self.minimum_invoice_amount else None,
max_outstanding=self.maximum_invoice_amount if self.maximum_invoice_amount else None,
accounting_dimensions=self.accounting_dimension_filter_conditions,
)
if self.invoice_limit:
@@ -209,9 +222,38 @@ class PaymentReconciliation(Document):
inv.currency = entry.get("currency")
inv.outstanding_amount = flt(entry.get("outstanding_amount"))
def get_difference_amount(self, payment_entry, invoice, allocated_amount):
difference_amount = 0
if frappe.get_cached_value(
"Account", self.receivable_payable_account, "account_currency"
) != frappe.get_cached_value("Company", self.company, "default_currency"):
if invoice.get("exchange_rate") and payment_entry.get("exchange_rate", 1) != invoice.get(
"exchange_rate", 1
):
allocated_amount_in_ref_rate = payment_entry.get("exchange_rate", 1) * allocated_amount
allocated_amount_in_inv_rate = invoice.get("exchange_rate", 1) * allocated_amount
difference_amount = allocated_amount_in_ref_rate - allocated_amount_in_inv_rate
return difference_amount
@frappe.whitelist()
def calculate_difference_on_allocation_change(self, payment_entry, invoice, allocated_amount):
invoice_exchange_map = self.get_invoice_exchange_map(invoice, payment_entry)
invoice[0]["exchange_rate"] = invoice_exchange_map.get(invoice[0].get("invoice_number"))
new_difference_amount = self.get_difference_amount(
payment_entry[0], invoice[0], allocated_amount
)
return new_difference_amount
@frappe.whitelist()
def allocate_entries(self, args):
self.validate_entries()
invoice_exchange_map = self.get_invoice_exchange_map(args.get("invoices"), args.get("payments"))
default_exchange_gain_loss_account = frappe.get_cached_value(
"Company", self.company, "exchange_gain_loss_account"
)
entries = []
for pay in args.get("payments"):
pay.update({"unreconciled_amount": pay.get("amount")})
@@ -224,12 +266,22 @@ class PaymentReconciliation(Document):
res = self.get_allocated_entry(pay, inv, pay["amount"])
inv["outstanding_amount"] = flt(inv.get("outstanding_amount")) - flt(pay.get("amount"))
pay["amount"] = 0
inv["exchange_rate"] = invoice_exchange_map.get(inv.get("invoice_number"))
if pay.get("reference_type") in ["Sales Invoice", "Purchase Invoice"]:
pay["exchange_rate"] = invoice_exchange_map.get(pay.get("reference_name"))
res.difference_amount = self.get_difference_amount(pay, inv, res["allocated_amount"])
res.difference_account = default_exchange_gain_loss_account
res.exchange_rate = inv.get("exchange_rate")
if pay.get("amount") == 0:
entries.append(res)
break
elif inv.get("outstanding_amount") == 0:
entries.append(res)
continue
else:
break
@@ -251,12 +303,11 @@ class PaymentReconciliation(Document):
"amount": pay.get("amount"),
"allocated_amount": allocated_amount,
"difference_amount": pay.get("difference_amount"),
"currency": inv.get("currency"),
}
)
@frappe.whitelist()
def reconcile(self):
self.validate_allocation()
def reconcile_allocations(self, skip_ref_details_update_for_pe=False):
dr_or_cr = (
"credit_in_account_currency"
if erpnext.get_party_account_type(self.party_type) == "Receivable"
@@ -273,17 +324,95 @@ class PaymentReconciliation(Document):
else:
reconciled_entry = entry_list
reconciled_entry.append(self.get_payment_details(row, dr_or_cr))
payment_details = self.get_payment_details(row, dr_or_cr)
reconciled_entry.append(payment_details)
if payment_details.difference_amount:
self.make_difference_entry(payment_details)
if entry_list:
reconcile_against_document(entry_list)
reconcile_against_document(entry_list, skip_ref_details_update_for_pe)
if dr_or_cr_notes:
reconcile_dr_cr_note(dr_or_cr_notes, self.company)
@frappe.whitelist()
def reconcile(self):
if frappe.db.get_single_value("Accounts Settings", "auto_reconcile_payments"):
running_doc = is_any_doc_running(
dict(
company=self.company,
party_type=self.party_type,
party=self.party,
receivable_payable_account=self.receivable_payable_account,
)
)
if running_doc:
frappe.throw(
_("A Reconciliation Job {0} is running for the same filters. Cannot reconcile now").format(
get_link_to_form("Auto Reconcile", running_doc)
)
)
return
self.validate_allocation()
self.reconcile_allocations()
msgprint(_("Successfully Reconciled"))
self.get_unreconciled_entries()
def make_difference_entry(self, row):
journal_entry = frappe.new_doc("Journal Entry")
journal_entry.voucher_type = "Exchange Gain Or Loss"
journal_entry.company = self.company
journal_entry.posting_date = nowdate()
journal_entry.multi_currency = 1
party_account_currency = frappe.get_cached_value(
"Account", self.receivable_payable_account, "account_currency"
)
difference_account_currency = frappe.get_cached_value(
"Account", row.difference_account, "account_currency"
)
# Account Currency has balance
dr_or_cr = "debit" if self.party_type == "Customer" else "credit"
reverse_dr_or_cr = "debit" if dr_or_cr == "credit" else "credit"
journal_account = frappe._dict(
{
"account": self.receivable_payable_account,
"party_type": self.party_type,
"party": self.party,
"account_currency": party_account_currency,
"exchange_rate": 0,
"cost_center": erpnext.get_default_cost_center(self.company),
"reference_type": row.against_voucher_type,
"reference_name": row.against_voucher,
dr_or_cr: flt(row.difference_amount),
dr_or_cr + "_in_account_currency": 0,
}
)
journal_entry.append("accounts", journal_account)
journal_account = frappe._dict(
{
"account": row.difference_account,
"account_currency": difference_account_currency,
"exchange_rate": 1,
"cost_center": erpnext.get_default_cost_center(self.company),
reverse_dr_or_cr + "_in_account_currency": flt(row.difference_amount),
reverse_dr_or_cr: flt(row.difference_amount),
}
)
journal_entry.append("accounts", journal_account)
journal_entry.save()
journal_entry.submit()
def get_payment_details(self, row, dr_or_cr):
return frappe._dict(
{
@@ -293,6 +422,7 @@ class PaymentReconciliation(Document):
"against_voucher_type": row.get("invoice_type"),
"against_voucher": row.get("invoice_number"),
"account": self.receivable_payable_account,
"exchange_rate": row.get("exchange_rate"),
"party_type": self.party_type,
"party": self.party,
"is_advance": row.get("is_advance"),
@@ -317,6 +447,49 @@ class PaymentReconciliation(Document):
if not self.get("payments"):
frappe.throw(_("No records found in the Payments table"))
def get_invoice_exchange_map(self, invoices, payments):
sales_invoices = [
d.get("invoice_number") for d in invoices if d.get("invoice_type") == "Sales Invoice"
]
sales_invoices.extend(
[d.get("reference_name") for d in payments if d.get("reference_type") == "Sales Invoice"]
)
purchase_invoices = [
d.get("invoice_number") for d in invoices if d.get("invoice_type") == "Purchase Invoice"
]
purchase_invoices.extend(
[d.get("reference_name") for d in payments if d.get("reference_type") == "Purchase Invoice"]
)
invoice_exchange_map = frappe._dict()
if sales_invoices:
sales_invoice_map = frappe._dict(
frappe.db.get_all(
"Sales Invoice",
filters={"name": ("in", sales_invoices)},
fields=["name", "conversion_rate"],
as_list=1,
)
)
invoice_exchange_map.update(sales_invoice_map)
if purchase_invoices:
purchase_invoice_map = frappe._dict(
frappe.db.get_all(
"Purchase Invoice",
filters={"name": ("in", purchase_invoices)},
fields=["name", "conversion_rate"],
as_list=1,
)
)
invoice_exchange_map.update(purchase_invoice_map)
return invoice_exchange_map
def validate_allocation(self):
unreconciled_invoices = frappe._dict()
@@ -350,24 +523,26 @@ class PaymentReconciliation(Document):
def build_qb_filter_conditions(self, get_invoices=False, get_return_invoices=False):
self.common_filter_conditions.clear()
self.accounting_dimension_filter_conditions.clear()
self.ple_posting_date_filter.clear()
ple = qb.DocType("Payment Ledger Entry")
self.common_filter_conditions.append(ple.company == self.company)
if self.get("cost_center") and (get_invoices or get_return_invoices):
self.common_filter_conditions.append(ple.cost_center == self.cost_center)
self.accounting_dimension_filter_conditions.append(ple.cost_center == self.cost_center)
if get_invoices:
if self.from_invoice_date:
self.common_filter_conditions.append(ple.posting_date.gte(self.from_invoice_date))
self.ple_posting_date_filter.append(ple.posting_date.gte(self.from_invoice_date))
if self.to_invoice_date:
self.common_filter_conditions.append(ple.posting_date.lte(self.to_invoice_date))
self.ple_posting_date_filter.append(ple.posting_date.lte(self.to_invoice_date))
elif get_return_invoices:
if self.from_payment_date:
self.common_filter_conditions.append(ple.posting_date.gte(self.from_payment_date))
self.ple_posting_date_filter.append(ple.posting_date.gte(self.from_payment_date))
if self.to_payment_date:
self.common_filter_conditions.append(ple.posting_date.lte(self.to_payment_date))
self.ple_posting_date_filter.append(ple.posting_date.lte(self.to_payment_date))
def get_conditions(self, get_payments=False):
condition = " and company = '{0}' ".format(self.company)

View File

@@ -5,9 +5,11 @@ import unittest
import frappe
from frappe import qb
from frappe.tests.utils import FrappeTestCase
from frappe.utils import add_days, nowdate
from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import add_days, flt, nowdate
from erpnext import get_default_cost_center
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_payment_entry
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.party import get_party_account
@@ -20,6 +22,7 @@ class TestPaymentReconciliation(FrappeTestCase):
self.create_item()
self.create_customer()
self.create_account()
self.create_cost_center()
self.clear_old_entries()
def tearDown(self):
@@ -72,33 +75,11 @@ class TestPaymentReconciliation(FrappeTestCase):
self.item = item if isinstance(item, str) else item.item_code
def create_customer(self):
if frappe.db.exists("Customer", "_Test PR Customer"):
self.customer = "_Test PR Customer"
else:
customer = frappe.new_doc("Customer")
customer.customer_name = "_Test PR Customer"
customer.type = "Individual"
customer.save()
self.customer = customer.name
if frappe.db.exists("Customer", "_Test PR Customer 2"):
self.customer2 = "_Test PR Customer 2"
else:
customer = frappe.new_doc("Customer")
customer.customer_name = "_Test PR Customer 2"
customer.type = "Individual"
customer.save()
self.customer2 = customer.name
if frappe.db.exists("Customer", "_Test PR Customer 3"):
self.customer3 = "_Test PR Customer 3"
else:
customer = frappe.new_doc("Customer")
customer.customer_name = "_Test PR Customer 3"
customer.type = "Individual"
customer.default_currency = "EUR"
customer.save()
self.customer3 = customer.name
self.customer = make_customer("_Test PR Customer")
self.customer2 = make_customer("_Test PR Customer 2")
self.customer3 = make_customer("_Test PR Customer 3", "EUR")
self.customer4 = make_customer("_Test PR Customer 4", "EUR")
self.customer5 = make_customer("_Test PR Customer 5", "EUR")
def create_account(self):
account_name = "Debtors EUR"
@@ -216,6 +197,22 @@ class TestPaymentReconciliation(FrappeTestCase):
)
return je
def create_cost_center(self):
# Setup cost center
cc_name = "Sub"
self.main_cc = frappe.get_doc("Cost Center", get_default_cost_center(self.company))
cc_exists = frappe.db.get_list("Cost Center", filters={"cost_center_name": cc_name})
if cc_exists:
self.sub_cc = frappe.get_doc("Cost Center", cc_exists[0].name)
else:
sub_cc = frappe.new_doc("Cost Center")
sub_cc.cost_center_name = "Sub"
sub_cc.parent_cost_center = self.main_cc.parent_cost_center
sub_cc.company = self.main_cc.company
self.sub_cc = sub_cc.save()
def test_filter_min_max(self):
# check filter condition minimum and maximum amount
self.create_sales_invoice(qty=1, rate=300)
@@ -283,6 +280,41 @@ class TestPaymentReconciliation(FrappeTestCase):
self.assertEqual(len(pr.get("invoices")), 2)
self.assertEqual(len(pr.get("payments")), 2)
def test_filter_posting_date_case2(self):
"""
Posting date should not affect outstanding amount calculation
"""
from_date = add_days(nowdate(), -30)
to_date = nowdate()
self.create_payment_entry(amount=25, posting_date=from_date).submit()
self.create_sales_invoice(rate=25, qty=1, posting_date=to_date)
pr = self.create_payment_reconciliation()
pr.from_invoice_date = pr.from_payment_date = from_date
pr.to_invoice_date = pr.to_payment_date = to_date
pr.get_unreconciled_entries()
self.assertEqual(len(pr.invoices), 1)
self.assertEqual(len(pr.payments), 1)
invoices = [x.as_dict() for x in pr.invoices]
payments = [x.as_dict() for x in pr.payments]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
pr.reconcile()
pr.get_unreconciled_entries()
self.assertEqual(len(pr.invoices), 0)
self.assertEqual(len(pr.payments), 0)
pr.from_invoice_date = pr.from_payment_date = to_date
pr.to_invoice_date = pr.to_payment_date = to_date
pr.get_unreconciled_entries()
self.assertEqual(len(pr.invoices), 0)
def test_filter_invoice_limit(self):
# check filter condition - invoice limit
transaction_date = nowdate()
@@ -317,6 +349,11 @@ class TestPaymentReconciliation(FrappeTestCase):
invoices = [x.as_dict() for x in pr.get("invoices")]
payments = [x.as_dict() for x in pr.get("payments")]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
# Difference amount should not be calculated for base currency accounts
for row in pr.allocation:
self.assertEqual(flt(row.get("difference_amount")), 0.0)
pr.reconcile()
si.reload()
@@ -358,6 +395,11 @@ class TestPaymentReconciliation(FrappeTestCase):
invoices = [x.as_dict() for x in pr.get("invoices")]
payments = [x.as_dict() for x in pr.get("payments")]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
# Difference amount should not be calculated for base currency accounts
for row in pr.allocation:
self.assertEqual(flt(row.get("difference_amount")), 0.0)
pr.reconcile()
# check PR tool output
@@ -382,6 +424,11 @@ class TestPaymentReconciliation(FrappeTestCase):
invoices = [x.as_dict() for x in pr.get("invoices")]
payments = [x.as_dict() for x in pr.get("payments")]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
# Difference amount should not be calculated for base currency accounts
for row in pr.allocation:
self.assertEqual(flt(row.get("difference_amount")), 0.0)
pr.reconcile()
# assert outstanding
@@ -418,6 +465,11 @@ class TestPaymentReconciliation(FrappeTestCase):
invoices = [x.as_dict() for x in pr.get("invoices")]
payments = [x.as_dict() for x in pr.get("payments")]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
# Difference amount should not be calculated for base currency accounts
for row in pr.allocation:
self.assertEqual(flt(row.get("difference_amount")), 0.0)
pr.reconcile()
self.assertEqual(pr.get("invoices"), [])
@@ -441,6 +493,11 @@ class TestPaymentReconciliation(FrappeTestCase):
invoices = [x.as_dict() for x in pr.get("invoices")]
payments = [x.as_dict() for x in pr.get("payments")]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
# Cr Note and Invoice are of the same currency. There shouldn't any difference amount.
for row in pr.allocation:
self.assertEqual(flt(row.get("difference_amount")), 0.0)
pr.reconcile()
pr.get_unreconciled_entries()
@@ -474,6 +531,11 @@ class TestPaymentReconciliation(FrappeTestCase):
payments = [x.as_dict() for x in pr.get("payments")]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
pr.allocation[0].allocated_amount = allocated_amount
# Cr Note and Invoice are of the same currency. There shouldn't any difference amount.
for row in pr.allocation:
self.assertEqual(flt(row.get("difference_amount")), 0.0)
pr.reconcile()
# assert outstanding
@@ -543,3 +605,301 @@ class TestPaymentReconciliation(FrappeTestCase):
self.assertEqual(len(pr.payments), 1)
self.assertEqual(pr.payments[0].amount, amount)
self.assertEqual(pr.payments[0].currency, "EUR")
def test_difference_amount_via_journal_entry(self):
# Make Sale Invoice
si = self.create_sales_invoice(
qty=1, rate=100, posting_date=nowdate(), do_not_save=True, do_not_submit=True
)
si.customer = self.customer4
si.currency = "EUR"
si.conversion_rate = 85
si.debit_to = self.debtors_eur
si.save().submit()
# Make payment using Journal Entry
je1 = self.create_journal_entry("HDFC - _PR", self.debtors_eur, 100, nowdate())
je1.multi_currency = 1
je1.accounts[0].exchange_rate = 1
je1.accounts[0].credit_in_account_currency = 0
je1.accounts[0].credit = 0
je1.accounts[0].debit_in_account_currency = 8000
je1.accounts[0].debit = 8000
je1.accounts[1].party_type = "Customer"
je1.accounts[1].party = self.customer4
je1.accounts[1].exchange_rate = 80
je1.accounts[1].credit_in_account_currency = 100
je1.accounts[1].credit = 8000
je1.accounts[1].debit_in_account_currency = 0
je1.accounts[1].debit = 0
je1.save()
je1.submit()
je2 = self.create_journal_entry("HDFC - _PR", self.debtors_eur, 200, nowdate())
je2.multi_currency = 1
je2.accounts[0].exchange_rate = 1
je2.accounts[0].credit_in_account_currency = 0
je2.accounts[0].credit = 0
je2.accounts[0].debit_in_account_currency = 16000
je2.accounts[0].debit = 16000
je2.accounts[1].party_type = "Customer"
je2.accounts[1].party = self.customer4
je2.accounts[1].exchange_rate = 80
je2.accounts[1].credit_in_account_currency = 200
je1.accounts[1].credit = 16000
je1.accounts[1].debit_in_account_currency = 0
je1.accounts[1].debit = 0
je2.save()
je2.submit()
pr = self.create_payment_reconciliation()
pr.party = self.customer4
pr.receivable_payable_account = self.debtors_eur
pr.get_unreconciled_entries()
self.assertEqual(len(pr.invoices), 1)
self.assertEqual(len(pr.payments), 2)
# Test exact payment allocation
invoices = [x.as_dict() for x in pr.invoices]
payments = [pr.payments[0].as_dict()]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
self.assertEqual(pr.allocation[0].allocated_amount, 100)
self.assertEqual(pr.allocation[0].difference_amount, -500)
# Test partial payment allocation (with excess payment entry)
pr.set("allocation", [])
pr.get_unreconciled_entries()
invoices = [x.as_dict() for x in pr.invoices]
payments = [pr.payments[1].as_dict()]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
pr.allocation[0].difference_account = "Exchange Gain/Loss - _PR"
self.assertEqual(pr.allocation[0].allocated_amount, 100)
self.assertEqual(pr.allocation[0].difference_amount, -500)
# Check if difference journal entry gets generated for difference amount after reconciliation
pr.reconcile()
total_debit_amount = frappe.db.get_all(
"Journal Entry Account",
{"account": self.debtors_eur, "docstatus": 1, "reference_name": si.name},
"sum(debit) as amount",
group_by="reference_name",
)[0].amount
self.assertEqual(flt(total_debit_amount, 2), -500)
def test_difference_amount_via_payment_entry(self):
# Make Sale Invoice
si = self.create_sales_invoice(
qty=1, rate=100, posting_date=nowdate(), do_not_save=True, do_not_submit=True
)
si.customer = self.customer5
si.currency = "EUR"
si.conversion_rate = 85
si.debit_to = self.debtors_eur
si.save().submit()
# Make payment using Payment Entry
pe1 = create_payment_entry(
company=self.company,
payment_type="Receive",
party_type="Customer",
party=self.customer5,
paid_from=self.debtors_eur,
paid_to=self.bank,
paid_amount=100,
)
pe1.source_exchange_rate = 80
pe1.received_amount = 8000
pe1.save()
pe1.submit()
pe2 = create_payment_entry(
company=self.company,
payment_type="Receive",
party_type="Customer",
party=self.customer5,
paid_from=self.debtors_eur,
paid_to=self.bank,
paid_amount=200,
)
pe2.source_exchange_rate = 80
pe2.received_amount = 16000
pe2.save()
pe2.submit()
pr = self.create_payment_reconciliation()
pr.party = self.customer5
pr.receivable_payable_account = self.debtors_eur
pr.get_unreconciled_entries()
self.assertEqual(len(pr.invoices), 1)
self.assertEqual(len(pr.payments), 2)
invoices = [x.as_dict() for x in pr.invoices]
payments = [pr.payments[0].as_dict()]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
self.assertEqual(pr.allocation[0].allocated_amount, 100)
self.assertEqual(pr.allocation[0].difference_amount, -500)
pr.set("allocation", [])
pr.get_unreconciled_entries()
invoices = [x.as_dict() for x in pr.invoices]
payments = [pr.payments[1].as_dict()]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
self.assertEqual(pr.allocation[0].allocated_amount, 100)
self.assertEqual(pr.allocation[0].difference_amount, -500)
def test_differing_cost_center_on_invoice_and_payment(self):
"""
Cost Center filter should not affect outstanding amount calculation
"""
si = self.create_sales_invoice(qty=1, rate=100, do_not_submit=True)
si.cost_center = self.main_cc.name
si.submit()
pr = get_payment_entry(si.doctype, si.name)
pr.cost_center = self.sub_cc.name
pr = pr.save().submit()
pr = self.create_payment_reconciliation()
pr.cost_center = self.main_cc.name
pr.get_unreconciled_entries()
# check PR tool output
self.assertEqual(len(pr.get("invoices")), 0)
self.assertEqual(len(pr.get("payments")), 0)
def test_cost_center_filter_on_vouchers(self):
"""
Test Cost Center filter is applied on Invoices, Payment Entries and Journals
"""
transaction_date = nowdate()
rate = 100
# 'Main - PR' Cost Center
si1 = self.create_sales_invoice(
qty=1, rate=rate, posting_date=transaction_date, do_not_submit=True
)
si1.cost_center = self.main_cc.name
si1.submit()
pe1 = self.create_payment_entry(posting_date=transaction_date, amount=rate)
pe1.cost_center = self.main_cc.name
pe1 = pe1.save().submit()
je1 = self.create_journal_entry(self.bank, self.debit_to, 100, transaction_date)
je1.accounts[0].cost_center = self.main_cc.name
je1.accounts[1].cost_center = self.main_cc.name
je1.accounts[1].party_type = "Customer"
je1.accounts[1].party = self.customer
je1 = je1.save().submit()
# 'Sub - PR' Cost Center
si2 = self.create_sales_invoice(
qty=1, rate=rate, posting_date=transaction_date, do_not_submit=True
)
si2.cost_center = self.sub_cc.name
si2.submit()
pe2 = self.create_payment_entry(posting_date=transaction_date, amount=rate)
pe2.cost_center = self.sub_cc.name
pe2 = pe2.save().submit()
je2 = self.create_journal_entry(self.bank, self.debit_to, 100, transaction_date)
je2.accounts[0].cost_center = self.sub_cc.name
je2.accounts[1].cost_center = self.sub_cc.name
je2.accounts[1].party_type = "Customer"
je2.accounts[1].party = self.customer
je2 = je2.save().submit()
pr = self.create_payment_reconciliation()
pr.cost_center = self.main_cc.name
pr.get_unreconciled_entries()
# check PR tool output
self.assertEqual(len(pr.get("invoices")), 1)
self.assertEqual(pr.get("invoices")[0].get("invoice_number"), si1.name)
self.assertEqual(len(pr.get("payments")), 2)
payment_vouchers = [x.get("reference_name") for x in pr.get("payments")]
self.assertCountEqual(payment_vouchers, [pe1.name, je1.name])
# Change cost center
pr.cost_center = self.sub_cc.name
pr.get_unreconciled_entries()
# check PR tool output
self.assertEqual(len(pr.get("invoices")), 1)
self.assertEqual(pr.get("invoices")[0].get("invoice_number"), si2.name)
self.assertEqual(len(pr.get("payments")), 2)
payment_vouchers = [x.get("reference_name") for x in pr.get("payments")]
self.assertCountEqual(payment_vouchers, [je2.name, pe2.name])
@change_settings(
"Accounts Settings",
{
"allow_multi_currency_invoices_against_single_party_account": 1,
},
)
def test_no_difference_amount_for_base_currency_accounts(self):
# Make Sale Invoice
si = self.create_sales_invoice(
qty=1, rate=1, posting_date=nowdate(), do_not_save=True, do_not_submit=True
)
si.customer = self.customer
si.currency = "EUR"
si.conversion_rate = 85
si.debit_to = self.debit_to
si.save().submit()
# Make payment using Payment Entry
pe1 = create_payment_entry(
company=self.company,
payment_type="Receive",
party_type="Customer",
party=self.customer,
paid_from=self.debit_to,
paid_to=self.bank,
paid_amount=100,
)
pe1.save()
pe1.submit()
pr = self.create_payment_reconciliation()
pr.party = self.customer
pr.receivable_payable_account = self.debit_to
pr.get_unreconciled_entries()
self.assertEqual(len(pr.invoices), 1)
self.assertEqual(len(pr.payments), 1)
invoices = [x.as_dict() for x in pr.invoices]
payments = [pr.payments[0].as_dict()]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
self.assertEqual(pr.allocation[0].allocated_amount, 85)
self.assertEqual(pr.allocation[0].difference_amount, 0)
def make_customer(customer_name, currency=None):
if not frappe.db.exists("Customer", customer_name):
customer = frappe.new_doc("Customer")
customer.customer_name = customer_name
customer.type = "Individual"
if currency:
customer.default_currency = currency
customer.save()
return customer.name
else:
return customer_name

View File

@@ -20,7 +20,9 @@
"section_break_5",
"difference_amount",
"column_break_7",
"difference_account"
"difference_account",
"exchange_rate",
"currency"
],
"fields": [
{
@@ -37,7 +39,7 @@
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Allocated Amount",
"options": "Currency",
"options": "currency",
"reqd": 1
},
{
@@ -112,7 +114,7 @@
"fieldtype": "Currency",
"hidden": 1,
"label": "Unreconciled Amount",
"options": "Currency",
"options": "currency",
"read_only": 1
},
{
@@ -120,7 +122,7 @@
"fieldtype": "Currency",
"hidden": 1,
"label": "Amount",
"options": "Currency",
"options": "currency",
"read_only": 1
},
{
@@ -129,11 +131,24 @@
"hidden": 1,
"label": "Reference Row",
"read_only": 1
},
{
"fieldname": "currency",
"fieldtype": "Link",
"hidden": 1,
"label": "Currency",
"options": "Currency"
},
{
"fieldname": "exchange_rate",
"fieldtype": "Float",
"label": "Exchange Rate",
"read_only": 1
}
],
"istable": 1,
"links": [],
"modified": "2021-10-06 11:48:59.616562",
"modified": "2022-12-24 21:01:14.882747",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation Allocation",
@@ -141,5 +156,6 @@
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -11,7 +11,8 @@
"col_break1",
"amount",
"outstanding_amount",
"currency"
"currency",
"exchange_rate"
],
"fields": [
{
@@ -62,11 +63,17 @@
"hidden": 1,
"label": "Currency",
"options": "Currency"
},
{
"fieldname": "exchange_rate",
"fieldtype": "Float",
"hidden": 1,
"label": "Exchange Rate"
}
],
"istable": 1,
"links": [],
"modified": "2021-08-24 22:42:40.923179",
"modified": "2022-11-08 18:18:02.502149",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation Invoice",
@@ -75,5 +82,6 @@
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -15,7 +15,8 @@
"difference_amount",
"sec_break1",
"remark",
"currency"
"currency",
"exchange_rate"
],
"fields": [
{
@@ -91,11 +92,17 @@
"label": "Difference Amount",
"options": "currency",
"read_only": 1
},
{
"fieldname": "exchange_rate",
"fieldtype": "Float",
"hidden": 1,
"label": "Exchange Rate"
}
],
"istable": 1,
"links": [],
"modified": "2021-08-30 10:51:48.140062",
"modified": "2022-11-08 18:18:36.268760",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation Payment",
@@ -103,5 +110,6 @@
"permissions": [],
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC"
"sort_order": "DESC",
"states": []
}

View File

@@ -42,7 +42,7 @@ frappe.ui.form.on("Payment Request", "refresh", function(frm) {
});
}
if(!frm.doc.payment_gateway_account && frm.doc.status == "Initiated") {
if((!frm.doc.payment_gateway_account || frm.doc.payment_request_type == "Outward") && frm.doc.status == "Initiated") {
frm.add_custom_button(__('Create Payment Entry'), function(){
frappe.call({
method: "erpnext.accounts.doctype.payment_request.payment_request.make_payment_entry",

View File

@@ -32,6 +32,10 @@
"iban",
"branch_code",
"swift_number",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"project",
"recipient_and_message",
"print_format",
"email_to",
@@ -186,8 +190,10 @@
{
"fetch_from": "bank_account.bank",
"fieldname": "bank",
"fieldtype": "Read Only",
"label": "Bank"
"fieldtype": "Link",
"label": "Bank",
"options": "Bank",
"read_only": 1
},
{
"fetch_from": "bank_account.bank_account_no",
@@ -360,16 +366,39 @@
"label": "Payment Channel",
"options": "\nEmail\nPhone",
"read_only": 1
},
{
"collapsible": 1,
"fieldname": "accounting_dimensions_section",
"fieldtype": "Section Break",
"label": "Accounting Dimensions"
},
{
"fieldname": "cost_center",
"fieldtype": "Link",
"label": "Cost Center",
"options": "Cost Center"
},
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
},
{
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
"options": "Project"
}
],
"in_create": 1,
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2020-09-18 12:24:14.178853",
"modified": "2022-12-21 16:56:40.115737",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Request",
"naming_rule": "By \"Naming Series\" field",
"owner": "Administrator",
"permissions": [
{
@@ -401,5 +430,6 @@
}
],
"sort_field": "modified",
"sort_order": "DESC"
"sort_order": "DESC",
"states": []
}

View File

@@ -9,8 +9,10 @@ from frappe import _
from frappe.model.document import Document
from frappe.utils import flt, get_url, nowdate
from frappe.utils.background_jobs import enqueue
from payments.utils import get_payment_gateway_controller
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
get_accounting_dimensions,
)
from erpnext.accounts.doctype.payment_entry.payment_entry import (
get_company_defaults,
get_payment_entry,
@@ -19,6 +21,14 @@ from erpnext.accounts.doctype.subscription_plan.subscription_plan import get_pla
from erpnext.accounts.party import get_party_account, get_party_bank_account
from erpnext.accounts.utils import get_account_currency
from erpnext.erpnext_integrations.stripe_integration import create_stripe_subscription
from erpnext.utilities import payment_app_import_guard
def _get_payment_gateway_controller(*args, **kwargs):
with payment_app_import_guard():
from payments.utils import get_payment_gateway_controller
return get_payment_gateway_controller(*args, **kwargs)
class PaymentRequest(Document):
@@ -35,21 +45,20 @@ class PaymentRequest(Document):
frappe.throw(_("To create a Payment Request reference document is required"))
def validate_payment_request_amount(self):
existing_payment_request_amount = get_existing_payment_request_amount(
self.reference_doctype, self.reference_name
existing_payment_request_amount = flt(
get_existing_payment_request_amount(self.reference_doctype, self.reference_name)
)
if existing_payment_request_amount:
ref_doc = frappe.get_doc(self.reference_doctype, self.reference_name)
if hasattr(ref_doc, "order_type") and getattr(ref_doc, "order_type") != "Shopping Cart":
ref_amount = get_amount(ref_doc, self.payment_account)
ref_doc = frappe.get_doc(self.reference_doctype, self.reference_name)
if not hasattr(ref_doc, "order_type") or getattr(ref_doc, "order_type") != "Shopping Cart":
ref_amount = get_amount(ref_doc, self.payment_account)
if existing_payment_request_amount + flt(self.grand_total) > ref_amount:
frappe.throw(
_("Total Payment Request amount cannot be greater than {0} amount").format(
self.reference_doctype
)
if existing_payment_request_amount + flt(self.grand_total) > ref_amount:
frappe.throw(
_("Total Payment Request amount cannot be greater than {0} amount").format(
self.reference_doctype
)
)
def validate_currency(self):
ref_doc = frappe.get_doc(self.reference_doctype, self.reference_name)
@@ -107,7 +116,7 @@ class PaymentRequest(Document):
self.request_phone_payment()
def request_phone_payment(self):
controller = get_payment_gateway_controller(self.payment_gateway)
controller = _get_payment_gateway_controller(self.payment_gateway)
request_amount = self.get_request_amount()
payment_record = dict(
@@ -156,7 +165,7 @@ class PaymentRequest(Document):
def payment_gateway_validation(self):
try:
controller = get_payment_gateway_controller(self.payment_gateway)
controller = _get_payment_gateway_controller(self.payment_gateway)
if hasattr(controller, "on_payment_request_submission"):
return controller.on_payment_request_submission(self)
else:
@@ -189,7 +198,7 @@ class PaymentRequest(Document):
)
data.update({"company": frappe.defaults.get_defaults().company})
controller = get_payment_gateway_controller(self.payment_gateway)
controller = _get_payment_gateway_controller(self.payment_gateway)
controller.validate_transaction_currency(self.currency)
if hasattr(controller, "validate_minimum_transaction_amount"):
@@ -254,6 +263,7 @@ class PaymentRequest(Document):
payment_entry.update(
{
"mode_of_payment": self.mode_of_payment,
"reference_no": self.name,
"reference_date": nowdate(),
"remarks": "Payment Entry against {0} {1} via Payment Request {2}".format(
@@ -262,6 +272,17 @@ class PaymentRequest(Document):
}
)
# Update dimensions
payment_entry.update(
{
"cost_center": self.get("cost_center"),
"project": self.get("project"),
}
)
for dimension in get_accounting_dimensions():
payment_entry.update({dimension: self.get(dimension)})
if payment_entry.difference_amount:
company_details = get_company_defaults(ref_doc.company)
@@ -403,25 +424,22 @@ def make_payment_request(**args):
else ""
)
existing_payment_request = None
if args.order_type == "Shopping Cart":
existing_payment_request = frappe.db.get_value(
"Payment Request",
{"reference_doctype": args.dt, "reference_name": args.dn, "docstatus": ("!=", 2)},
)
draft_payment_request = frappe.db.get_value(
"Payment Request",
{"reference_doctype": args.dt, "reference_name": args.dn, "docstatus": 0},
)
if existing_payment_request:
existing_payment_request_amount = get_existing_payment_request_amount(args.dt, args.dn)
if existing_payment_request_amount:
grand_total -= existing_payment_request_amount
if draft_payment_request:
frappe.db.set_value(
"Payment Request", existing_payment_request, "grand_total", grand_total, update_modified=False
"Payment Request", draft_payment_request, "grand_total", grand_total, update_modified=False
)
pr = frappe.get_doc("Payment Request", existing_payment_request)
pr = frappe.get_doc("Payment Request", draft_payment_request)
else:
if args.order_type != "Shopping Cart":
existing_payment_request_amount = get_existing_payment_request_amount(args.dt, args.dn)
if existing_payment_request_amount:
grand_total -= existing_payment_request_amount
pr = frappe.new_doc("Payment Request")
pr.update(
{
@@ -444,6 +462,17 @@ def make_payment_request(**args):
}
)
# Update dimensions
pr.update(
{
"cost_center": ref_doc.get("cost_center"),
"project": ref_doc.get("project"),
}
)
for dimension in get_accounting_dimensions():
pr.update({dimension: ref_doc.get(dimension)})
if args.order_type == "Shopping Cart" or args.mute_email:
pr.flags.mute_email = True
@@ -466,26 +495,28 @@ def get_amount(ref_doc, payment_account=None):
"""get amount based on doctype"""
dt = ref_doc.doctype
if dt in ["Sales Order", "Purchase Order"]:
grand_total = flt(ref_doc.grand_total) - flt(ref_doc.advance_paid)
grand_total = flt(ref_doc.rounded_total) or flt(ref_doc.grand_total)
elif dt in ["Sales Invoice", "Purchase Invoice"]:
if ref_doc.party_account_currency == ref_doc.currency:
grand_total = flt(ref_doc.outstanding_amount)
else:
grand_total = flt(ref_doc.outstanding_amount) / ref_doc.conversion_rate
if not ref_doc.get("is_pos"):
if ref_doc.party_account_currency == ref_doc.currency:
grand_total = flt(ref_doc.outstanding_amount)
else:
grand_total = flt(ref_doc.outstanding_amount) / ref_doc.conversion_rate
elif dt == "Sales Invoice":
for pay in ref_doc.payments:
if pay.type == "Phone" and pay.account == payment_account:
grand_total = pay.amount
break
elif dt == "POS Invoice":
for pay in ref_doc.payments:
if pay.type == "Phone" and pay.account == payment_account:
grand_total = pay.amount
break
elif dt == "Fees":
grand_total = ref_doc.outstanding_amount
if grand_total > 0:
return grand_total
else:
frappe.throw(_("Payment Entry is already created"))

View File

@@ -6,6 +6,7 @@ import unittest
import frappe
from erpnext.accounts.doctype.payment_request.payment_request import make_payment_request
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.setup.utils import get_exchange_rate
@@ -45,7 +46,10 @@ class TestPaymentRequest(unittest.TestCase):
frappe.get_doc(method).insert(ignore_permissions=True)
def test_payment_request_linkings(self):
so_inr = make_sales_order(currency="INR")
so_inr = make_sales_order(currency="INR", do_not_save=True)
so_inr.disable_rounded_total = 1
so_inr.save()
pr = make_payment_request(
dt="Sales Order",
dn=so_inr.name,
@@ -71,6 +75,29 @@ class TestPaymentRequest(unittest.TestCase):
self.assertEqual(pr.reference_name, si_usd.name)
self.assertEqual(pr.currency, "USD")
def test_payment_entry_against_purchase_invoice(self):
si_usd = make_purchase_invoice(
customer="_Test Supplier USD",
debit_to="_Test Payable USD - _TC",
currency="USD",
conversion_rate=50,
)
pr = make_payment_request(
dt="Purchase Invoice",
dn=si_usd.name,
recipient_id="user@example.com",
mute_email=1,
payment_gateway_account="_Test Gateway - USD",
submit_doc=1,
return_doc=1,
)
pe = pr.create_payment_entry()
pr.load_from_db()
self.assertEqual(pr.status, "Paid")
def test_payment_entry(self):
frappe.db.set_value(
"Company", "_Test Company", "exchange_gain_loss_account", "_Test Exchange Gain/Loss - _TC"

View File

@@ -39,6 +39,7 @@
{
"columns": 2,
"fetch_from": "payment_term.description",
"fetch_if_empty": 1,
"fieldname": "description",
"fieldtype": "Small Text",
"in_list_view": 1,
@@ -159,7 +160,7 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2021-04-28 05:41:35.084233",
"modified": "2022-09-16 13:57:06.382859",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Schedule",
@@ -168,5 +169,6 @@
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -5,7 +5,7 @@
import unittest
import frappe
from frappe.utils import today
from frappe.utils import add_months, today
from erpnext.accounts.doctype.finance_book.test_finance_book import create_finance_book
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
@@ -176,6 +176,23 @@ class TestPeriodClosingVoucher(unittest.TestCase):
)
self.assertSequenceEqual(pcv_gle, expected_gle)
warehouse = frappe.db.get_value("Warehouse", {"company": company}, "name")
repost_doc = frappe.get_doc(
{
"doctype": "Repost Item Valuation",
"company": company,
"posting_date": "2020-03-15",
"based_on": "Item and Warehouse",
"item_code": "Test Item 1",
"warehouse": warehouse,
}
)
self.assertRaises(frappe.ValidationError, repost_doc.save)
repost_doc.posting_date = add_months(today(), 13)
repost_doc.save()
def make_period_closing_voucher(self, submit=True):
surplus_account = create_account()

View File

@@ -25,7 +25,7 @@ frappe.ui.form.on('POS Closing Entry', {
frappe.realtime.on('closing_process_complete', async function(data) {
await frm.reload_doc();
if (frm.doc.status == 'Failed' && frm.doc.error_message && data.user == frappe.session.user) {
if (frm.doc.status == 'Failed' && frm.doc.error_message) {
frappe.msgprint({
title: __('POS Closing Failed'),
message: frm.doc.error_message,
@@ -36,6 +36,15 @@ frappe.ui.form.on('POS Closing Entry', {
});
set_html_data(frm);
if (frm.doc.docstatus == 1) {
if (!frm.doc.posting_date) {
frm.set_value("posting_date", frappe.datetime.nowdate());
}
if (!frm.doc.posting_time) {
frm.set_value("posting_time", frappe.datetime.now_time());
}
}
},
refresh: function(frm) {

View File

@@ -11,6 +11,7 @@
"period_end_date",
"column_break_3",
"posting_date",
"posting_time",
"pos_opening_entry",
"status",
"section_break_5",
@@ -51,7 +52,6 @@
"fieldtype": "Datetime",
"in_list_view": 1,
"label": "Period End Date",
"read_only": 1,
"reqd": 1
},
{
@@ -219,6 +219,13 @@
"fieldtype": "Small Text",
"label": "Error",
"read_only": 1
},
{
"fieldname": "posting_time",
"fieldtype": "Time",
"label": "Posting Time",
"no_copy": 1,
"reqd": 1
}
],
"is_submittable": 1,
@@ -228,10 +235,11 @@
"link_fieldname": "pos_closing_entry"
}
],
"modified": "2021-10-20 16:19:25.340565",
"modified": "2022-08-01 11:37:14.991228",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Closing Entry",
"naming_rule": "Expression (old style)",
"owner": "Administrator",
"permissions": [
{
@@ -278,5 +286,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -15,11 +15,30 @@ from erpnext.controllers.status_updater import StatusUpdater
class POSClosingEntry(StatusUpdater):
def validate(self):
self.posting_date = self.posting_date or frappe.utils.nowdate()
self.posting_time = self.posting_time or frappe.utils.nowtime()
if frappe.db.get_value("POS Opening Entry", self.pos_opening_entry, "status") != "Open":
frappe.throw(_("Selected POS Opening Entry should be open."), title=_("Invalid Opening Entry"))
self.validate_duplicate_pos_invoices()
self.validate_pos_invoices()
def validate_duplicate_pos_invoices(self):
pos_occurences = {}
for idx, inv in enumerate(self.pos_transactions, 1):
pos_occurences.setdefault(inv.pos_invoice, []).append(idx)
error_list = []
for key, value in pos_occurences.items():
if len(value) > 1:
error_list.append(
_("{} is added multiple times on rows: {}".format(frappe.bold(key), frappe.bold(value)))
)
if error_list:
frappe.throw(error_list, title=_("Duplicate POS Invoices found"), as_list=True)
def validate_pos_invoices(self):
invalid_rows = []
for d in self.pos_transactions:

View File

@@ -5,6 +5,8 @@
frappe.provide("erpnext.accounts");
erpnext.selling.POSInvoiceController = class POSInvoiceController extends erpnext.selling.SellingController {
settings = {};
setup(doc) {
this.setup_posting_date_time_check();
super.setup(doc);
@@ -12,21 +14,37 @@ erpnext.selling.POSInvoiceController = class POSInvoiceController extends erpnex
company() {
erpnext.accounts.dimensions.update_dimension(this.frm, this.frm.doctype);
this.frm.set_value("set_warehouse", "");
this.frm.set_value("taxes_and_charges", "");
}
onload(doc) {
super.onload();
this.frm.ignore_doctypes_on_cancel_all = ['POS Invoice Merge Log', 'POS Closing Entry'];
if(doc.__islocal && doc.is_pos && frappe.get_route_str() !== 'point-of-sale') {
this.frm.script_manager.trigger("is_pos");
this.frm.refresh_fields();
}
this.frm.set_query("set_warehouse", function(doc) {
return {
filters: {
company: doc.company ? doc.company : '',
}
}
});
erpnext.accounts.dimensions.setup_dimension_filters(this.frm, this.frm.doctype);
}
onload_post_render(frm) {
this.pos_profile(frm);
}
refresh(doc) {
super.refresh();
if (doc.docstatus == 1 && !doc.is_return) {
this.frm.add_custom_button(__('Return'), this.make_sales_return, __('Create'));
this.frm.page.set_inner_btn_group_as_primary(__('Create'));
@@ -36,6 +54,18 @@ erpnext.selling.POSInvoiceController = class POSInvoiceController extends erpnex
this.frm.return_print_format = "Sales Invoice Return";
this.frm.set_value('consolidated_invoice', '');
}
this.frm.set_query("customer", (function () {
const customer_groups = this.settings?.customer_groups;
if (!customer_groups?.length) return {};
return {
filters: {
customer_group: ["in", customer_groups],
}
}
}).bind(this));
}
is_pos() {
@@ -82,12 +112,32 @@ erpnext.selling.POSInvoiceController = class POSInvoiceController extends erpnex
party_type: "Customer",
account: this.frm.doc.debit_to,
price_list: this.frm.doc.selling_price_list,
pos_profile: pos_profile
pos_profile: pos_profile,
company_address: this.frm.doc.company_address
}, () => {
this.apply_pricing_rule();
});
}
pos_profile(frm) {
if (!frm.pos_profile || frm.pos_profile == '') {
this.update_customer_groups_settings([]);
return;
}
frappe.call({
method: "erpnext.selling.page.point_of_sale.point_of_sale.get_pos_profile_data",
args: { "pos_profile": frm.pos_profile },
callback: ({ message: profile }) => {
this.update_customer_groups_settings(profile?.customer_groups);
},
});
}
update_customer_groups_settings(customer_groups) {
this.settings.customer_groups = customer_groups?.map((group) => group.name)
}
amount(){
this.write_off_outstanding_amount_automatically()
}

View File

@@ -343,7 +343,8 @@
"no_copy": 1,
"options": "POS Invoice",
"print_hide": 1,
"read_only": 1
"read_only": 1,
"search_index": 1
},
{
"default": "0",
@@ -1553,7 +1554,7 @@
"icon": "fa fa-file-text",
"is_submittable": 1,
"links": [],
"modified": "2022-03-22 13:00:24.166684",
"modified": "2022-09-30 03:49:50.455199",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice",

View File

@@ -161,7 +161,7 @@ class POSInvoice(SalesInvoice):
bold_item_name = frappe.bold(item.item_name)
bold_extra_batch_qty_needed = frappe.bold(
abs(available_batch_qty - reserved_batch_qty - item.qty)
abs(available_batch_qty - reserved_batch_qty - item.stock_qty)
)
bold_invalid_batch_no = frappe.bold(item.batch_no)
@@ -172,7 +172,7 @@ class POSInvoice(SalesInvoice):
).format(item.idx, bold_invalid_batch_no, bold_item_name),
title=_("Item Unavailable"),
)
elif (available_batch_qty - reserved_batch_qty - item.qty) < 0:
elif (available_batch_qty - reserved_batch_qty - item.stock_qty) < 0:
frappe.throw(
_(
"Row #{}: Batch No. {} of item {} has less than required stock available, {} more required"
@@ -239,14 +239,14 @@ class POSInvoice(SalesInvoice):
frappe.bold(d.warehouse),
frappe.bold(d.qty),
)
if flt(available_stock) <= 0:
if is_stock_item and flt(available_stock) <= 0:
frappe.throw(
_("Row #{}: Item Code: {} is not available under warehouse {}.").format(
d.idx, item_code, warehouse
),
title=_("Item Unavailable"),
)
elif flt(available_stock) < flt(d.qty):
elif is_stock_item and flt(available_stock) < flt(d.stock_qty):
frappe.throw(
_(
"Row #{}: Stock quantity not enough for Item Code: {} under warehouse {}. Available quantity {}."
@@ -632,11 +632,12 @@ def get_stock_availability(item_code, warehouse):
pos_sales_qty = get_pos_reserved_qty(item_code, warehouse)
return bin_qty - pos_sales_qty, is_stock_item
else:
is_stock_item = False
is_stock_item = True
if frappe.db.exists("Product Bundle", item_code):
return get_bundle_availability(item_code, warehouse), is_stock_item
else:
# Is a service item
is_stock_item = False
# Is a service item or non_stock item
return 0, is_stock_item
@@ -649,8 +650,10 @@ def get_bundle_availability(bundle_item_code, warehouse):
item_pos_reserved_qty = get_pos_reserved_qty(item.item_code, warehouse)
available_qty = item_bin_qty - item_pos_reserved_qty
max_available_bundles = available_qty / item.qty
if bundle_bin_qty > max_available_bundles:
max_available_bundles = available_qty / item.stock_qty
if bundle_bin_qty > max_available_bundles and frappe.get_value(
"Item", item.item_code, "is_stock_item"
):
bundle_bin_qty = max_available_bundles
pos_sales_qty = get_pos_reserved_qty(bundle_item_code, warehouse)
@@ -671,7 +674,7 @@ def get_bin_qty(item_code, warehouse):
def get_pos_reserved_qty(item_code, warehouse):
reserved_qty = frappe.db.sql(
"""select sum(p_item.qty) as qty
"""select sum(p_item.stock_qty) as qty
from `tabPOS Invoice` p, `tabPOS Invoice Item` p_item
where p.name = p_item.parent
and ifnull(p.consolidated_invoice, '') = ''

View File

@@ -495,6 +495,67 @@ class TestPOSInvoice(unittest.TestCase):
self.assertRaises(frappe.ValidationError, pos.submit)
def test_value_error_on_serial_no_validation(self):
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item
se = make_serialized_item(
company="_Test Company",
target_warehouse="Stores - _TC",
cost_center="Main - _TC",
expense_account="Cost of Goods Sold - _TC",
)
serial_nos = se.get("items")[0].serial_no
# make a pos invoice
pos = create_pos_invoice(
company="_Test Company",
debit_to="Debtors - _TC",
account_for_change_amount="Cash - _TC",
warehouse="Stores - _TC",
income_account="Sales - _TC",
expense_account="Cost of Goods Sold - _TC",
cost_center="Main - _TC",
item=se.get("items")[0].item_code,
rate=1000,
qty=1,
do_not_save=1,
)
pos.get("items")[0].has_serial_no = 1
pos.get("items")[0].serial_no = serial_nos.split("\n")[0]
pos.set("payments", [])
pos.append(
"payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 1000, "default": 1}
)
pos = pos.save().submit()
# make a return
pos_return = make_sales_return(pos.name)
pos_return.paid_amount = pos_return.grand_total
pos_return.save()
pos_return.submit()
# set docstatus to 2 for pos to trigger this issue
frappe.db.set_value("POS Invoice", pos.name, "docstatus", 2)
pos2 = create_pos_invoice(
company="_Test Company",
debit_to="Debtors - _TC",
account_for_change_amount="Cash - _TC",
warehouse="Stores - _TC",
income_account="Sales - _TC",
expense_account="Cost of Goods Sold - _TC",
cost_center="Main - _TC",
item=se.get("items")[0].item_code,
rate=1000,
qty=1,
do_not_save=1,
)
pos2.get("items")[0].has_serial_no = 1
pos2.get("items")[0].serial_no = serial_nos.split("\n")[0]
# Value error should not be triggered on validation
pos2.save()
def test_loyalty_points(self):
from erpnext.accounts.doctype.loyalty_program.loyalty_program import (
get_loyalty_program_details_with_points,

View File

@@ -8,6 +8,7 @@
"engine": "InnoDB",
"field_order": [
"barcode",
"has_item_scanned",
"item_code",
"col_break1",
"item_name",
@@ -808,11 +809,19 @@
"fieldtype": "Check",
"label": "Grant Commission",
"read_only": 1
},
{
"default": "0",
"depends_on": "barcode",
"fieldname": "has_item_scanned",
"fieldtype": "Check",
"label": "Has Item Scanned",
"read_only": 1
}
],
"istable": 1,
"links": [],
"modified": "2021-10-05 12:23:47.506290",
"modified": "2022-11-02 12:52:39.125295",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice Item",
@@ -820,5 +829,6 @@
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC"
"sort_order": "DESC",
"states": []
}

View File

@@ -6,6 +6,7 @@
"engine": "InnoDB",
"field_order": [
"posting_date",
"posting_time",
"merge_invoices_based_on",
"column_break_3",
"pos_closing_entry",
@@ -105,12 +106,19 @@
"label": "Customer Group",
"mandatory_depends_on": "eval:doc.merge_invoices_based_on == 'Customer Group'",
"options": "Customer Group"
},
{
"fieldname": "posting_time",
"fieldtype": "Time",
"label": "Posting Time",
"no_copy": 1,
"reqd": 1
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2021-09-14 11:17:19.001142",
"modified": "2022-08-01 11:36:42.456429",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice Merge Log",
@@ -173,5 +181,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -9,7 +9,7 @@ from frappe import _
from frappe.core.page.background_jobs.background_jobs import get_info
from frappe.model.document import Document
from frappe.model.mapper import map_child_doc, map_doc
from frappe.utils import cint, flt, getdate, nowdate
from frappe.utils import cint, flt, get_time, getdate, nowdate, nowtime
from frappe.utils.background_jobs import enqueue
from frappe.utils.scheduler import is_scheduler_inactive
@@ -18,6 +18,22 @@ class POSInvoiceMergeLog(Document):
def validate(self):
self.validate_customer()
self.validate_pos_invoice_status()
self.validate_duplicate_pos_invoices()
def validate_duplicate_pos_invoices(self):
pos_occurences = {}
for idx, inv in enumerate(self.pos_invoices, 1):
pos_occurences.setdefault(inv.pos_invoice, []).append(idx)
error_list = []
for key, value in pos_occurences.items():
if len(value) > 1:
error_list.append(
_("{} is added multiple times on rows: {}".format(frappe.bold(key), frappe.bold(value)))
)
if error_list:
frappe.throw(error_list, title=_("Duplicate POS Invoices found"), as_list=True)
def validate_customer(self):
if self.merge_invoices_based_on == "Customer Group":
@@ -99,6 +115,7 @@ class POSInvoiceMergeLog(Document):
sales_invoice.is_consolidated = 1
sales_invoice.set_posting_time = 1
sales_invoice.posting_date = getdate(self.posting_date)
sales_invoice.posting_time = get_time(self.posting_time)
sales_invoice.save()
sales_invoice.submit()
@@ -115,6 +132,7 @@ class POSInvoiceMergeLog(Document):
credit_note.is_consolidated = 1
credit_note.set_posting_time = 1
credit_note.posting_date = getdate(self.posting_date)
credit_note.posting_time = get_time(self.posting_time)
# TODO: return could be against multiple sales invoice which could also have been consolidated?
# credit_note.return_against = self.consolidated_invoice
credit_note.save()
@@ -402,6 +420,9 @@ def create_merge_logs(invoice_by_customer, closing_entry=None):
merge_log.posting_date = (
getdate(closing_entry.get("posting_date")) if closing_entry else nowdate()
)
merge_log.posting_time = (
get_time(closing_entry.get("posting_time")) if closing_entry else nowtime()
)
merge_log.customer = customer
merge_log.pos_closing_entry = closing_entry.get("name") if closing_entry else None
@@ -421,12 +442,14 @@ def create_merge_logs(invoice_by_customer, closing_entry=None):
if closing_entry:
closing_entry.set_status(update=True, status="Failed")
if type(error_message) == list:
error_message = frappe.json.dumps(error_message)
closing_entry.db_set("error_message", error_message)
raise
finally:
frappe.db.commit()
frappe.publish_realtime("closing_process_complete", {"user": frappe.session.user})
frappe.publish_realtime("closing_process_complete", user=frappe.session.user)
def cancel_merge_logs(merge_logs, closing_entry=None):
@@ -453,7 +476,7 @@ def cancel_merge_logs(merge_logs, closing_entry=None):
finally:
frappe.db.commit()
frappe.publish_realtime("closing_process_complete", {"user": frappe.session.user})
frappe.publish_realtime("closing_process_complete", user=frappe.session.user)
def enqueue_job(job, **kwargs):

View File

@@ -43,6 +43,7 @@
"currency",
"write_off_account",
"write_off_cost_center",
"write_off_limit",
"account_for_change_amount",
"disable_rounded_total",
"column_break_23",
@@ -360,6 +361,14 @@
"fieldtype": "Check",
"label": "Validate Stock on Save"
},
{
"default": "1",
"description": "Auto write off precision loss while consolidation",
"fieldname": "write_off_limit",
"fieldtype": "Currency",
"label": "Write Off Limit",
"reqd": 1
},
{
"default": "0",
"description": "If enabled, the consolidated invoices will have rounded total disabled",
@@ -393,7 +402,7 @@
"link_fieldname": "pos_profile"
}
],
"modified": "2022-07-21 11:16:46.911173",
"modified": "2022-08-10 12:57:06.241439",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Profile",

View File

@@ -52,7 +52,10 @@
"free_item_rate",
"column_break_42",
"free_item_uom",
"round_free_qty",
"is_recursive",
"recurse_for",
"apply_recursion_over",
"section_break_23",
"valid_from",
"valid_upto",
@@ -176,7 +179,7 @@
},
{
"collapsible": 1,
"depends_on": "eval:doc.apply_on != 'Transaction'",
"depends_on": "eval:doc.apply_on != 'Transaction' && !doc.mixed_conditions",
"fieldname": "section_break_18",
"fieldtype": "Section Break",
"label": "Discount on Other Item"
@@ -297,12 +300,12 @@
{
"fieldname": "min_qty",
"fieldtype": "Float",
"label": "Min Qty"
"label": "Min Qty (As Per Stock UOM)"
},
{
"fieldname": "max_qty",
"fieldtype": "Float",
"label": "Max Qty"
"label": "Max Qty (As Per Stock UOM)"
},
{
"fieldname": "column_break_21",
@@ -469,7 +472,7 @@
"description": "If rate is zero them item will be treated as \"Free Item\"",
"fieldname": "free_item_rate",
"fieldtype": "Currency",
"label": "Rate"
"label": "Free Item Rate"
},
{
"collapsible": 1,
@@ -481,7 +484,7 @@
"description": "System will notify to increase or decrease quantity or amount ",
"fieldname": "threshold_percentage",
"fieldtype": "Percent",
"label": "Threshold for Suggestion"
"label": "Threshold for Suggestion (In Percentage)"
},
{
"description": "Higher the number, higher the priority",
@@ -578,15 +581,38 @@
"fieldtype": "Select",
"label": "Naming Series",
"options": "PRLE-.####"
},
{
"default": "0",
"fieldname": "round_free_qty",
"fieldtype": "Check",
"label": "Round Free Qty"
},
{
"depends_on": "is_recursive",
"description": "Give free item for every N quantity",
"fieldname": "recurse_for",
"fieldtype": "Float",
"label": "Recurse Every (As Per Transaction UOM)",
"mandatory_depends_on": "is_recursive"
},
{
"default": "0",
"depends_on": "is_recursive",
"description": "Qty for which recursion isn't applicable.",
"fieldname": "apply_recursion_over",
"fieldtype": "Float",
"label": "Apply Recursion Over (As Per Transaction UOM)"
}
],
"icon": "fa fa-gift",
"idx": 1,
"links": [],
"modified": "2021-08-06 15:10:04.219321",
"modified": "2023-02-14 04:53:34.887358",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pricing Rule",
"naming_rule": "By \"Naming Series\" field",
"owner": "Administrator",
"permissions": [
{
@@ -642,5 +668,6 @@
"show_name_in_global_search": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"title_field": "title"
}
}

View File

@@ -24,6 +24,7 @@ class PricingRule(Document):
self.validate_applicable_for_selling_or_buying()
self.validate_min_max_amt()
self.validate_min_max_qty()
self.validate_recursion()
self.cleanup_fields_value()
self.validate_rate_or_discount()
self.validate_max_discount()
@@ -109,6 +110,18 @@ class PricingRule(Document):
if self.min_amt and self.max_amt and flt(self.min_amt) > flt(self.max_amt):
throw(_("Min Amt can not be greater than Max Amt"))
def validate_recursion(self):
if self.price_or_product_discount != "Product":
return
if self.free_item or self.same_item:
if flt(self.recurse_for) <= 0:
self.recurse_for = 1
if self.is_recursive:
if flt(self.apply_recursion_over) > flt(self.min_qty):
throw(_("Min Qty should be greater than Recurse Over Qty"))
if flt(self.apply_recursion_over) < 0:
throw(_("Recurse Over Qty cannot be less than 0"))
def cleanup_fields_value(self):
for logic_field in ["apply_on", "applicable_for", "rate_or_discount"]:
fieldname = frappe.scrub(self.get(logic_field) or "")
@@ -243,7 +256,7 @@ def apply_pricing_rule(args, doc=None):
for item in item_list:
args_copy = copy.deepcopy(args)
args_copy.update(item)
data = get_pricing_rule_for_item(args_copy, item.get("price_list_rate"), doc=doc)
data = get_pricing_rule_for_item(args_copy, doc=doc)
out.append(data)
if (
@@ -268,7 +281,19 @@ def get_serial_no_for_item(args):
return item_details
def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=False):
def update_pricing_rule_uom(pricing_rule, args):
child_doc = {"Item Code": "items", "Item Group": "item_groups", "Brand": "brands"}.get(
pricing_rule.apply_on
)
apply_on_field = frappe.scrub(pricing_rule.apply_on)
for row in pricing_rule.get(child_doc):
if row.get(apply_on_field) == args.get(apply_on_field):
pricing_rule.uom = row.uom
def get_pricing_rule_for_item(args, doc=None, for_validate=False):
from erpnext.accounts.doctype.pricing_rule.utils import (
get_applied_pricing_rules,
get_pricing_rule_items,
@@ -324,7 +349,8 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa
if isinstance(pricing_rule, str):
pricing_rule = frappe.get_cached_doc("Pricing Rule", pricing_rule)
pricing_rule.apply_rule_on_other_items = get_pricing_rule_items(pricing_rule)
update_pricing_rule_uom(pricing_rule, args)
pricing_rule.apply_rule_on_other_items = get_pricing_rule_items(pricing_rule) or []
if pricing_rule.get("suggestion"):
continue
@@ -337,7 +363,6 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa
if pricing_rule.mixed_conditions or pricing_rule.apply_rule_on_other:
item_details.update(
{
"apply_rule_on_other_items": json.dumps(pricing_rule.apply_rule_on_other_items),
"price_or_product_discount": pricing_rule.price_or_product_discount,
"apply_rule_on": (
frappe.scrub(pricing_rule.apply_rule_on_other)
@@ -347,6 +372,9 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa
}
)
if pricing_rule.apply_rule_on_other_items:
item_details["apply_rule_on_other_items"] = json.dumps(pricing_rule.apply_rule_on_other_items)
if pricing_rule.coupon_code_based == 1 and args.coupon_code == None:
return item_details
@@ -438,12 +466,15 @@ def apply_price_discount_rule(pricing_rule, item_details, args):
if pricing_rule.currency == args.currency:
pricing_rule_rate = pricing_rule.rate
# TODO https://github.com/frappe/erpnext/pull/23636 solve this in some other way.
if pricing_rule_rate:
is_blank_uom = pricing_rule.get("uom") != args.get("uom")
# Override already set price list rate (from item price)
# if pricing_rule_rate > 0
item_details.update(
{
"price_list_rate": pricing_rule_rate * args.get("conversion_factor", 1),
"price_list_rate": pricing_rule_rate
* (args.get("conversion_factor", 1) if is_blank_uom else 1),
}
)
item_details.update({"discount_percentage": 0.0})
@@ -492,7 +523,7 @@ def remove_pricing_rule_for_item(pricing_rules, item_details, item_code=None, ra
)
if pricing_rule.get("mixed_conditions") or pricing_rule.get("apply_rule_on_other"):
items = get_pricing_rule_items(pricing_rule)
items = get_pricing_rule_items(pricing_rule, other_items=True)
item_details.apply_on = (
frappe.scrub(pricing_rule.apply_rule_on_other)
if pricing_rule.apply_rule_on_other

View File

@@ -595,6 +595,121 @@ class TestPricingRule(unittest.TestCase):
frappe.get_doc("Item Price", {"item_code": "Water Flask"}).delete()
item.delete()
def test_item_price_with_blank_uom_pricing_rule(self):
properties = {
"item_code": "Item Blank UOM",
"stock_uom": "Nos",
"sales_uom": "Box",
"uoms": [dict(uom="Box", conversion_factor=10)],
}
item = make_item(properties=properties)
make_item_price("Item Blank UOM", "_Test Price List", 100)
pricing_rule_record = {
"doctype": "Pricing Rule",
"title": "_Test Item Blank UOM Rule",
"apply_on": "Item Code",
"items": [
{
"item_code": "Item Blank UOM",
}
],
"selling": 1,
"currency": "INR",
"rate_or_discount": "Rate",
"rate": 101,
"company": "_Test Company",
}
rule = frappe.get_doc(pricing_rule_record)
rule.insert()
si = create_sales_invoice(
do_not_save=True, item_code="Item Blank UOM", uom="Box", conversion_factor=10
)
si.selling_price_list = "_Test Price List"
si.save()
# If UOM is blank consider it as stock UOM and apply pricing_rule on all UOM.
# rate is 101, Selling UOM is Box that have conversion_factor of 10 so 101 * 10 = 1010
self.assertEqual(si.items[0].price_list_rate, 1010)
self.assertEqual(si.items[0].rate, 1010)
si.delete()
si = create_sales_invoice(do_not_save=True, item_code="Item Blank UOM", uom="Nos")
si.selling_price_list = "_Test Price List"
si.save()
# UOM is blank so consider it as stock UOM and apply pricing_rule on all UOM.
# rate is 101, Selling UOM is Nos that have conversion_factor of 1 so 101 * 1 = 101
self.assertEqual(si.items[0].price_list_rate, 101)
self.assertEqual(si.items[0].rate, 101)
si.delete()
rule.delete()
frappe.get_doc("Item Price", {"item_code": "Item Blank UOM"}).delete()
item.delete()
def test_item_price_with_selling_uom_pricing_rule(self):
properties = {
"item_code": "Item UOM other than Stock",
"stock_uom": "Nos",
"sales_uom": "Box",
"uoms": [dict(uom="Box", conversion_factor=10)],
}
item = make_item(properties=properties)
make_item_price("Item UOM other than Stock", "_Test Price List", 100)
pricing_rule_record = {
"doctype": "Pricing Rule",
"title": "_Test Item UOM other than Stock Rule",
"apply_on": "Item Code",
"items": [
{
"item_code": "Item UOM other than Stock",
"uom": "Box",
}
],
"selling": 1,
"currency": "INR",
"rate_or_discount": "Rate",
"rate": 101,
"company": "_Test Company",
}
rule = frappe.get_doc(pricing_rule_record)
rule.insert()
si = create_sales_invoice(
do_not_save=True, item_code="Item UOM other than Stock", uom="Box", conversion_factor=10
)
si.selling_price_list = "_Test Price List"
si.save()
# UOM is Box so apply pricing_rule only on Box UOM.
# Selling UOM is Box and as both UOM are same no need to multiply by conversion_factor.
self.assertEqual(si.items[0].price_list_rate, 101)
self.assertEqual(si.items[0].rate, 101)
si.delete()
si = create_sales_invoice(do_not_save=True, item_code="Item UOM other than Stock", uom="Nos")
si.selling_price_list = "_Test Price List"
si.save()
# UOM is Box so pricing_rule won't apply as selling_uom is Nos.
# As Pricing Rule is not applied price of 100 will be fetched from Item Price List.
self.assertEqual(si.items[0].price_list_rate, 100)
self.assertEqual(si.items[0].rate, 100)
si.delete()
rule.delete()
frappe.get_doc("Item Price", {"item_code": "Item UOM other than Stock"}).delete()
item.delete()
def test_pricing_rule_for_different_currency(self):
make_item("Test Sanitizer Item")
@@ -766,6 +881,107 @@ class TestPricingRule(unittest.TestCase):
frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule with Min Qty - 1")
frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule with Min Qty - 2")
def test_pricing_rule_for_other_items_cond_with_amount(self):
item = make_item("Water Flask New")
other_item = make_item("Other Water Flask New")
make_item_price(item.name, "_Test Price List", 100)
make_item_price(other_item.name, "_Test Price List", 100)
pricing_rule_record = {
"doctype": "Pricing Rule",
"title": "_Test Water Flask Rule",
"apply_on": "Item Code",
"apply_rule_on_other": "Item Code",
"price_or_product_discount": "Price",
"rate_or_discount": "Discount Percentage",
"other_item_code": other_item.name,
"items": [
{
"item_code": item.name,
}
],
"selling": 1,
"currency": "INR",
"min_amt": 200,
"discount_percentage": 10,
"company": "_Test Company",
}
rule = frappe.get_doc(pricing_rule_record)
rule.insert()
si = create_sales_invoice(do_not_save=True, item_code=item.name)
si.append(
"items",
{
"item_code": other_item.name,
"item_name": other_item.item_name,
"description": other_item.description,
"stock_uom": other_item.stock_uom,
"uom": other_item.stock_uom,
"cost_center": si.items[0].cost_center,
"expense_account": si.items[0].expense_account,
"warehouse": si.items[0].warehouse,
"conversion_factor": 1,
"qty": 1,
},
)
si.selling_price_list = "_Test Price List"
si.save()
self.assertEqual(si.items[0].discount_percentage, 0)
self.assertEqual(si.items[1].discount_percentage, 0)
si.items[0].qty = 2
si.save()
self.assertEqual(si.items[0].discount_percentage, 0)
self.assertEqual(si.items[0].stock_qty, 2)
self.assertEqual(si.items[0].amount, 200)
self.assertEqual(si.items[0].price_list_rate, 100)
self.assertEqual(si.items[1].discount_percentage, 10)
si.delete()
rule.delete()
def test_pricing_rule_for_product_free_item_rounded_qty_and_recursion(self):
frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule")
test_record = {
"doctype": "Pricing Rule",
"title": "_Test Pricing Rule",
"apply_on": "Item Code",
"currency": "USD",
"items": [
{
"item_code": "_Test Item",
}
],
"selling": 1,
"rate": 0,
"min_qty": 3,
"max_qty": 7,
"price_or_product_discount": "Product",
"same_item": 1,
"free_qty": 1,
"round_free_qty": 1,
"is_recursive": 1,
"recurse_for": 2,
"company": "_Test Company",
}
frappe.get_doc(test_record.copy()).insert()
# With pricing rule
so = make_sales_order(item_code="_Test Item", qty=5)
so.load_from_db()
self.assertEqual(so.items[1].is_free_item, 1)
self.assertEqual(so.items[1].item_code, "_Test Item")
self.assertEqual(so.items[1].qty, 2)
so = make_sales_order(item_code="_Test Item", qty=7)
so.load_from_db()
self.assertEqual(so.items[1].is_free_item, 1)
self.assertEqual(so.items[1].item_code, "_Test Item")
self.assertEqual(so.items[1].qty, 4)
test_dependencies = ["Campaign"]
@@ -781,7 +997,7 @@ def make_pricing_rule(**args):
"apply_on": args.apply_on or "Item Code",
"applicable_for": args.applicable_for,
"selling": args.selling or 0,
"currency": "USD",
"currency": "INR",
"apply_discount_on_rate": args.apply_discount_on_rate or 0,
"buying": args.buying or 0,
"min_qty": args.min_qty or 0.0,

View File

@@ -111,6 +111,12 @@ def _get_pricing_rules(apply_on, args, values):
)
if apply_on_field == "item_code":
if args.get("uom", None):
item_conditions += (
" and ({child_doc}.uom='{item_uom}' or IFNULL({child_doc}.uom, '')='')".format(
child_doc=child_doc, item_uom=args.get("uom")
)
)
if "variant_of" not in args:
args.variant_of = frappe.get_cached_value("Item", args.item_code, "variant_of")
@@ -238,6 +244,22 @@ def get_other_conditions(conditions, values, args):
and ifnull(`tabPricing Rule`.valid_upto, '2500-12-31')"""
values["transaction_date"] = args.get("transaction_date")
if args.get("doctype") in [
"Quotation",
"Quotation Item",
"Sales Order",
"Sales Order Item",
"Delivery Note",
"Delivery Note Item",
"Sales Invoice",
"Sales Invoice Item",
"POS Invoice",
"POS Invoice Item",
]:
conditions += """ and ifnull(`tabPricing Rule`.selling, 0) = 1"""
else:
conditions += """ and ifnull(`tabPricing Rule`.buying, 0) = 1"""
return conditions
@@ -252,12 +274,6 @@ def filter_pricing_rules(args, pricing_rules, doc=None):
stock_qty = flt(args.get("stock_qty"))
amount = flt(args.get("price_list_rate")) * flt(args.get("qty"))
if pricing_rules[0].apply_rule_on_other:
field = frappe.scrub(pricing_rules[0].apply_rule_on_other)
if field and pricing_rules[0].get("other_" + field) != args.get(field):
return
pr_doc = frappe.get_cached_doc("Pricing Rule", pricing_rules[0].name)
if pricing_rules[0].mixed_conditions and doc:
@@ -274,7 +290,7 @@ def filter_pricing_rules(args, pricing_rules, doc=None):
amount += data[1]
if pricing_rules[0].apply_rule_on_other and not pricing_rules[0].mixed_conditions and doc:
pricing_rules = get_qty_and_rate_for_other_item(doc, pr_doc, pricing_rules) or []
pricing_rules = get_qty_and_rate_for_other_item(doc, pr_doc, pricing_rules, args) or []
else:
pricing_rules = filter_pricing_rules_for_qty_amount(stock_qty, amount, pricing_rules, args)
@@ -352,16 +368,14 @@ def validate_quantity_and_amount_for_suggestion(args, qty, amount, item_code, tr
if fieldname:
msg = _(
"If you {0} {1} quantities of the item {2}, the scheme {3} will be applied on the item."
).format(
type_of_transaction, args.get(fieldname), bold(item_code), bold(args.rule_description)
)
).format(type_of_transaction, args.get(fieldname), bold(item_code), bold(args.title))
if fieldname in ["min_amt", "max_amt"]:
msg = _("If you {0} {1} worth item {2}, the scheme {3} will be applied on the item.").format(
type_of_transaction,
fmt_money(args.get(fieldname), currency=args.get("currency")),
bold(item_code),
bold(args.rule_description),
bold(args.title),
)
frappe.msgprint(msg)
@@ -454,17 +468,29 @@ def get_qty_and_rate_for_mixed_conditions(doc, pr_doc, args):
return sum_qty, sum_amt, items
def get_qty_and_rate_for_other_item(doc, pr_doc, pricing_rules):
items = get_pricing_rule_items(pr_doc)
def get_qty_and_rate_for_other_item(doc, pr_doc, pricing_rules, row_item):
other_items = get_pricing_rule_items(pr_doc, other_items=True)
pricing_rule_apply_on = apply_on_table.get(pr_doc.get("apply_on"))
apply_on = frappe.scrub(pr_doc.get("apply_on"))
items = []
for d in pr_doc.get(pricing_rule_apply_on):
if apply_on == "item_group":
items.extend(get_child_item_groups(d.get(apply_on)))
else:
items.append(d.get(apply_on))
for row in doc.items:
if row.get(frappe.scrub(pr_doc.apply_rule_on_other)) in items:
pricing_rules = filter_pricing_rules_for_qty_amount(
row.get("stock_qty"), row.get("amount"), pricing_rules, row
)
if row.get(apply_on) in items:
if not row.get("qty"):
continue
stock_qty = row.get("qty") * (row.get("conversion_factor") or 1.0)
amount = stock_qty * (row.get("price_list_rate") or row.get("rate"))
pricing_rules = filter_pricing_rules_for_qty_amount(stock_qty, amount, pricing_rules, row)
if pricing_rules and pricing_rules[0]:
pricing_rules[0].apply_rule_on_other_items = items
pricing_rules[0].apply_rule_on_other_items = other_items
return pricing_rules
@@ -617,9 +643,13 @@ def get_product_discount_rule(pricing_rule, item_details, args=None, doc=None):
qty = pricing_rule.free_qty or 1
if pricing_rule.is_recursive:
transaction_qty = args.get("qty") if args else doc.total_qty
transaction_qty = (
args.get("qty") if args else doc.total_qty
) - pricing_rule.apply_recursion_over
if transaction_qty:
qty = flt(transaction_qty) * qty
qty = flt(transaction_qty) * qty / pricing_rule.recurse_for
if pricing_rule.round_free_qty:
qty = round(qty)
free_item_data_args = {
"item_code": free_item,
@@ -649,30 +679,40 @@ def get_product_discount_rule(pricing_rule, item_details, args=None, doc=None):
item_details.free_item_data.append(free_item_data_args)
def apply_pricing_rule_for_free_items(doc, pricing_rule_args, set_missing_values=False):
def apply_pricing_rule_for_free_items(doc, pricing_rule_args):
if pricing_rule_args:
items = tuple((d.item_code, d.pricing_rules) for d in doc.items if d.is_free_item)
args = {(d["item_code"], d["pricing_rules"]): d for d in pricing_rule_args}
for args in pricing_rule_args:
if not items or (args.get("item_code"), args.get("pricing_rules")) not in items:
doc.append("items", args)
for item in doc.items:
if not item.is_free_item:
continue
free_item_data = args.get((item.item_code, item.pricing_rules))
if free_item_data:
free_item_data.pop("item_name")
free_item_data.pop("description")
item.update(free_item_data)
args.pop((item.item_code, item.pricing_rules))
for free_item in args.values():
doc.append("items", free_item)
def get_pricing_rule_items(pr_doc):
def get_pricing_rule_items(pr_doc, other_items=False) -> list:
apply_on_data = []
apply_on = frappe.scrub(pr_doc.get("apply_on"))
pricing_rule_apply_on = apply_on_table.get(pr_doc.get("apply_on"))
for d in pr_doc.get(pricing_rule_apply_on):
if apply_on == "item_group":
apply_on_data.extend(get_child_item_groups(d.get(apply_on)))
else:
apply_on_data.append(d.get(apply_on))
if pr_doc.apply_rule_on_other:
if pr_doc.apply_rule_on_other and other_items:
apply_on = frappe.scrub(pr_doc.apply_rule_on_other)
apply_on_data.append(pr_doc.get("other_" + apply_on))
else:
for d in pr_doc.get(pricing_rule_apply_on):
if apply_on == "item_group":
apply_on_data.extend(get_child_item_groups(d.get(apply_on)))
else:
apply_on_data.append(d.get(apply_on))
return list(set(apply_on_data))

View File

@@ -34,4 +34,4 @@ class ProcessDeferredAccounting(Document):
filters={"against_voucher_type": self.doctype, "against_voucher": self.name},
)
make_gl_entries(gl_entries=gl_entries, cancel=1)
make_gl_entries(gl_map=gl_entries, cancel=1)

View File

@@ -57,3 +57,16 @@ class TestProcessDeferredAccounting(unittest.TestCase):
]
check_gl_entries(self, si.name, expected_gle, "2019-01-10")
def test_pda_submission_and_cancellation(self):
pda = frappe.get_doc(
dict(
doctype="Process Deferred Accounting",
posting_date="2019-01-01",
start_date="2019-01-01",
end_date="2019-01-31",
type="Income",
)
)
pda.submit()
pda.cancel()

View File

@@ -0,0 +1,130 @@
// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on("Process Payment Reconciliation", {
onload: function(frm) {
// set queries
frm.set_query("party_type", function() {
return {
"filters": {
"name": ["in", Object.keys(frappe.boot.party_account_types)],
}
}
});
frm.set_query('receivable_payable_account', function(doc) {
return {
filters: {
"company": doc.company,
"is_group": 0,
"account_type": frappe.boot.party_account_types[doc.party_type]
}
};
});
frm.set_query('cost_center', function(doc) {
return {
filters: {
"company": doc.company,
"is_group": 0,
}
};
});
frm.set_query('bank_cash_account', function(doc) {
return {
filters:[
['Account', 'company', '=', doc.company],
['Account', 'is_group', '=', 0],
['Account', 'account_type', 'in', ['Bank', 'Cash']]
]
};
});
},
refresh: function(frm) {
if (frm.doc.docstatus==1 && ['Queued', 'Paused'].find(x => x == frm.doc.status)) {
let execute_btn = __("Start / Resume")
frm.add_custom_button(execute_btn, () => {
frm.call({
method: 'erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.trigger_job_for_doc',
args: {
docname: frm.doc.name
}
}).then(r => {
if(!r.exc) {
frappe.show_alert(__("Job Started"));
frm.reload_doc();
}
});
});
}
if (frm.doc.docstatus==1 && ['Completed', 'Running', 'Paused', 'Partially Reconciled'].find(x => x == frm.doc.status)) {
frm.call({
'method': "erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.get_reconciled_count",
args: {
"docname": frm.docname,
}
}).then(r => {
if (r.message) {
let progress = 0;
let description = "";
if (r.message.processed) {
progress = (r.message.processed/r.message.total) * 100;
description = r.message.processed + "/" + r.message.total + " processed";
} else if (r.message.total == 0 && frm.doc.status == "Completed") {
progress = 100;
}
frm.dashboard.add_progress('Reconciliation Progress', progress, description);
}
})
}
if (frm.doc.docstatus==1 && frm.doc.status == 'Running') {
let execute_btn = __("Pause")
frm.add_custom_button(execute_btn, () => {
frm.call({
'method': "erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.pause_job_for_doc",
args: {
"docname": frm.docname,
}
}).then(r => {
if (!r.exc) {
frappe.show_alert(__("Job Paused"));
frm.reload_doc()
}
});
});
}
},
company(frm) {
frm.set_value('party', '');
frm.set_value('receivable_payable_account', '');
},
party_type(frm) {
frm.set_value('party', '');
},
party(frm) {
frm.set_value('receivable_payable_account', '');
if (!frm.doc.receivable_payable_account && frm.doc.party_type && frm.doc.party) {
return frappe.call({
method: "erpnext.accounts.party.get_party_account",
args: {
company: frm.doc.company,
party_type: frm.doc.party_type,
party: frm.doc.party
},
callback: (r) => {
if (!r.exc && r.message) {
frm.set_value("receivable_payable_account", r.message);
}
frm.refresh();
}
});
}
}
});

View File

@@ -0,0 +1,173 @@
{
"actions": [],
"autoname": "format:ACC-PPR-{#####}",
"beta": 1,
"creation": "2023-03-30 21:28:39.793927",
"default_view": "List",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"company",
"party_type",
"column_break_io6c",
"party",
"receivable_payable_account",
"filter_section",
"from_invoice_date",
"to_invoice_date",
"column_break_kegk",
"from_payment_date",
"to_payment_date",
"column_break_uj04",
"cost_center",
"bank_cash_account",
"section_break_2n02",
"status",
"error_log",
"section_break_a8yx",
"amended_from"
],
"fields": [
{
"allow_on_submit": 1,
"fieldname": "status",
"fieldtype": "Select",
"label": "Status",
"options": "\nQueued\nRunning\nPaused\nCompleted\nPartially Reconciled\nFailed\nCancelled",
"read_only": 1
},
{
"fieldname": "company",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Company",
"options": "Company",
"reqd": 1
},
{
"fieldname": "party_type",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Party Type",
"options": "DocType",
"reqd": 1
},
{
"fieldname": "column_break_io6c",
"fieldtype": "Column Break"
},
{
"fieldname": "party",
"fieldtype": "Dynamic Link",
"in_list_view": 1,
"label": "Party",
"options": "party_type",
"reqd": 1
},
{
"fieldname": "receivable_payable_account",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Receivable/Payable Account",
"options": "Account",
"reqd": 1
},
{
"fieldname": "filter_section",
"fieldtype": "Section Break",
"label": "Filters"
},
{
"fieldname": "from_invoice_date",
"fieldtype": "Date",
"label": "From Invoice Date"
},
{
"fieldname": "to_invoice_date",
"fieldtype": "Date",
"label": "To Invoice Date"
},
{
"fieldname": "column_break_kegk",
"fieldtype": "Column Break"
},
{
"fieldname": "from_payment_date",
"fieldtype": "Date",
"label": "From Payment Date"
},
{
"fieldname": "to_payment_date",
"fieldtype": "Date",
"label": "To Payment Date"
},
{
"fieldname": "column_break_uj04",
"fieldtype": "Column Break"
},
{
"fieldname": "cost_center",
"fieldtype": "Link",
"label": "Cost Center",
"options": "Cost Center"
},
{
"fieldname": "bank_cash_account",
"fieldtype": "Link",
"label": "Bank/Cash Account",
"options": "Account"
},
{
"fieldname": "section_break_2n02",
"fieldtype": "Section Break",
"label": "Status"
},
{
"depends_on": "eval:doc.error_log",
"fieldname": "error_log",
"fieldtype": "Long Text",
"label": "Error Log"
},
{
"fieldname": "amended_from",
"fieldtype": "Link",
"label": "Amended From",
"no_copy": 1,
"options": "Process Payment Reconciliation",
"print_hide": 1,
"read_only": 1
},
{
"fieldname": "section_break_a8yx",
"fieldtype": "Section Break"
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2023-04-21 17:19:30.912953",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Payment Reconciliation",
"naming_rule": "Expression",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"title_field": "company"
}

View File

@@ -0,0 +1,503 @@
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _, qb
from frappe.model.document import Document
from frappe.utils import get_link_to_form
from frappe.utils.scheduler import is_scheduler_inactive
class ProcessPaymentReconciliation(Document):
def validate(self):
self.validate_receivable_payable_account()
self.validate_bank_cash_account()
def validate_receivable_payable_account(self):
if self.receivable_payable_account:
if self.company != frappe.db.get_value("Account", self.receivable_payable_account, "company"):
frappe.throw(
_("Receivable/Payable Account: {0} doesn't belong to company {1}").format(
frappe.bold(self.receivable_payable_account), frappe.bold(self.company)
)
)
def validate_bank_cash_account(self):
if self.bank_cash_account:
if self.company != frappe.db.get_value("Account", self.bank_cash_account, "company"):
frappe.throw(
_("Bank/Cash Account {0} doesn't belong to company {1}").format(
frappe.bold(self.bank_cash_account), frappe.bold(self.company)
)
)
def before_save(self):
self.status = ""
self.error_log = ""
def on_submit(self):
self.db_set("status", "Queued")
self.db_set("error_log", None)
def on_cancel(self):
self.db_set("status", "Cancelled")
log = frappe.db.get_value(
"Process Payment Reconciliation Log", filters={"process_pr": self.name}
)
if log:
frappe.db.set_value("Process Payment Reconciliation Log", log, "status", "Cancelled")
@frappe.whitelist()
def get_reconciled_count(docname: str | None = None) -> float:
current_status = {}
if docname:
reconcile_log = frappe.db.get_value(
"Process Payment Reconciliation Log", filters={"process_pr": docname}, fieldname="name"
)
if reconcile_log:
res = frappe.get_all(
"Process Payment Reconciliation Log",
filters={"name": reconcile_log},
fields=["reconciled_entries", "total_allocations"],
as_list=1,
)
current_status["processed"], current_status["total"] = res[0]
return current_status
def get_pr_instance(doc: str):
process_payment_reconciliation = frappe.get_doc("Process Payment Reconciliation", doc)
pr = frappe.get_doc("Payment Reconciliation")
fields = [
"company",
"party_type",
"party",
"receivable_payable_account",
"from_invoice_date",
"to_invoice_date",
"from_payment_date",
"to_payment_date",
]
d = {}
for field in fields:
d[field] = process_payment_reconciliation.get(field)
pr.update(d)
pr.invoice_limit = 1000
pr.payment_limit = 1000
return pr
def is_job_running(job_name: str) -> bool:
jobs = frappe.db.get_all("RQ Job", filters={"status": ["in", ["started", "queued"]]})
for x in jobs:
if x.job_name == job_name:
return True
return False
@frappe.whitelist()
def pause_job_for_doc(docname: str | None = None):
if docname:
frappe.db.set_value("Process Payment Reconciliation", docname, "status", "Paused")
log = frappe.db.get_value("Process Payment Reconciliation Log", filters={"process_pr": docname})
if log:
frappe.db.set_value("Process Payment Reconciliation Log", log, "status", "Paused")
@frappe.whitelist()
def trigger_job_for_doc(docname: str | None = None):
"""
Trigger background job
"""
if not docname:
return
if not frappe.db.get_single_value("Accounts Settings", "auto_reconcile_payments"):
frappe.throw(
_("Auto Reconciliation of Payments has been disabled. Enable it through {0}").format(
get_link_to_form("Accounts Settings", "Accounts Settings")
)
)
return
if not is_scheduler_inactive():
if frappe.db.get_value("Process Payment Reconciliation", docname, "status") == "Queued":
frappe.db.set_value("Process Payment Reconciliation", docname, "status", "Running")
job_name = f"start_processing_{docname}"
if not is_job_running(job_name):
job = frappe.enqueue(
method="erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.reconcile_based_on_filters",
queue="long",
is_async=True,
job_name=job_name,
enqueue_after_commit=True,
doc=docname,
)
elif frappe.db.get_value("Process Payment Reconciliation", docname, "status") == "Paused":
frappe.db.set_value("Process Payment Reconciliation", docname, "status", "Running")
log = frappe.db.get_value("Process Payment Reconciliation Log", filters={"process_pr": docname})
if log:
frappe.db.set_value("Process Payment Reconciliation Log", log, "status", "Running")
# Resume tasks for running doc
job_name = f"start_processing_{docname}"
if not is_job_running(job_name):
job = frappe.enqueue(
method="erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.reconcile_based_on_filters",
queue="long",
is_async=True,
job_name=job_name,
doc=docname,
)
else:
frappe.msgprint(_("Scheduler is Inactive. Can't trigger job now."))
def trigger_reconciliation_for_queued_docs():
"""
Will be called from Cron Job
Fetch queued docs and start reconciliation process for each one
"""
if not frappe.db.get_single_value("Accounts Settings", "auto_reconcile_payments"):
frappe.msgprint(
_("Auto Reconciliation of Payments has been disabled. Enable it through {0}").format(
get_link_to_form("Accounts Settings", "Accounts Settings")
)
)
return
if not is_scheduler_inactive():
# Get all queued documents
all_queued = frappe.db.get_all(
"Process Payment Reconciliation",
filters={"docstatus": 1, "status": "Queued"},
order_by="creation desc",
as_list=1,
)
docs_to_trigger = []
unique_filters = set()
queue_size = 5
fields = ["company", "party_type", "party", "receivable_payable_account"]
def get_filters_as_tuple(fields, doc):
filters = ()
for x in fields:
filters += tuple(doc.get(x))
return filters
for x in all_queued:
doc = frappe.get_doc("Process Payment Reconciliation", x)
filters = get_filters_as_tuple(fields, doc)
if filters not in unique_filters:
unique_filters.add(filters)
docs_to_trigger.append(doc.name)
if len(docs_to_trigger) == queue_size:
break
# trigger reconcilation process for queue_size unique filters
for doc in docs_to_trigger:
trigger_job_for_doc(doc)
else:
frappe.msgprint(_("Scheduler is Inactive. Can't trigger jobs now."))
def reconcile_based_on_filters(doc: None | str = None) -> None:
"""
Identify current state of document and execute next tasks in background
"""
if doc:
log = frappe.db.get_value("Process Payment Reconciliation Log", filters={"process_pr": doc})
if not log:
log = frappe.new_doc("Process Payment Reconciliation Log")
log.process_pr = doc
log.status = "Running"
log = log.save()
job_name = f"process_{doc}_fetch_and_allocate"
if not is_job_running(job_name):
job = frappe.enqueue(
method="erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.fetch_and_allocate",
queue="long",
timeout="3600",
is_async=True,
job_name=job_name,
enqueue_after_commit=True,
doc=doc,
)
else:
res = frappe.get_all(
"Process Payment Reconciliation Log",
filters={"name": log},
fields=["allocated", "reconciled"],
as_list=1,
)
allocated, reconciled = res[0]
if not allocated:
job_name = f"process__{doc}_fetch_and_allocate"
if not is_job_running(job_name):
job = frappe.enqueue(
method="erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.fetch_and_allocate",
queue="long",
timeout="3600",
is_async=True,
job_name=job_name,
enqueue_after_commit=True,
doc=doc,
)
elif not reconciled:
allocation = get_next_allocation(log)
if allocation:
reconcile_job_name = (
f"process_{doc}_reconcile_allocation_{allocation[0].idx}_{allocation[-1].idx}"
)
else:
reconcile_job_name = f"process_{doc}_reconcile"
if not is_job_running(reconcile_job_name):
job = frappe.enqueue(
method="erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.reconcile",
queue="long",
timeout="3600",
is_async=True,
job_name=reconcile_job_name,
enqueue_after_commit=True,
doc=doc,
)
elif reconciled:
frappe.db.set_value("Process Payment Reconciliation", doc, "status", "Completed")
def get_next_allocation(log: str) -> list:
if log:
allocations = []
next = frappe.db.get_all(
"Process Payment Reconciliation Log Allocations",
filters={"parent": log, "reconciled": 0},
fields=["reference_type", "reference_name"],
order_by="idx",
limit=1,
)
if next:
allocations = frappe.db.get_all(
"Process Payment Reconciliation Log Allocations",
filters={
"parent": log,
"reconciled": 0,
"reference_type": next[0].reference_type,
"reference_name": next[0].reference_name,
},
fields=["*"],
order_by="idx",
)
return allocations
return []
def fetch_and_allocate(doc: str) -> None:
"""
Fetch Invoices and Payments based on filters applied. FIFO ordering is used for allocation.
"""
if doc:
log = frappe.db.get_value("Process Payment Reconciliation Log", filters={"process_pr": doc})
if log:
if not frappe.db.get_value("Process Payment Reconciliation Log", log, "allocated"):
reconcile_log = frappe.get_doc("Process Payment Reconciliation Log", log)
pr = get_pr_instance(doc)
pr.get_unreconciled_entries()
if len(pr.invoices) > 0 and len(pr.payments) > 0:
invoices = [x.as_dict() for x in pr.invoices]
payments = [x.as_dict() for x in pr.payments]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
for x in pr.get("allocation"):
reconcile_log.append(
"allocations",
x.as_dict().update(
{
"parenttype": "Process Payment Reconciliation Log",
"parent": reconcile_log.name,
"name": None,
"reconciled": False,
}
),
)
reconcile_log.allocated = True
reconcile_log.total_allocations = len(reconcile_log.get("allocations"))
reconcile_log.reconciled_entries = 0
reconcile_log.save()
# generate reconcile job name
allocation = get_next_allocation(log)
if allocation:
reconcile_job_name = (
f"process_{doc}_reconcile_allocation_{allocation[0].idx}_{allocation[-1].idx}"
)
else:
reconcile_job_name = f"process_{doc}_reconcile"
if not is_job_running(reconcile_job_name):
job = frappe.enqueue(
method="erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.reconcile",
queue="long",
timeout="3600",
is_async=True,
job_name=reconcile_job_name,
enqueue_after_commit=True,
doc=doc,
)
def reconcile(doc: None | str = None) -> None:
if doc:
log = frappe.db.get_value("Process Payment Reconciliation Log", filters={"process_pr": doc})
if log:
res = frappe.get_all(
"Process Payment Reconciliation Log",
filters={"name": log},
fields=["reconciled_entries", "total_allocations"],
as_list=1,
limit=1,
)
reconciled_entries, total_allocations = res[0]
if reconciled_entries != total_allocations:
try:
# Fetch next allocation
allocations = get_next_allocation(log)
pr = get_pr_instance(doc)
# pass allocation to PR instance
for x in allocations:
pr.append("allocation", x)
# reconcile
pr.reconcile_allocations(skip_ref_details_update_for_pe=True)
# If Payment Entry, update details only for newly linked references
# This is for performance
if allocations[0].reference_type == "Payment Entry":
references = [(x.invoice_type, x.invoice_number) for x in allocations]
pe = frappe.get_doc(allocations[0].reference_type, allocations[0].reference_name)
pe.flags.ignore_validate_update_after_submit = True
pe.set_missing_ref_details(update_ref_details_only_for=references)
pe.save()
# Update reconciled flag
allocation_names = [x.name for x in allocations]
ppa = qb.DocType("Process Payment Reconciliation Log Allocations")
qb.update(ppa).set(ppa.reconciled, True).where(ppa.name.isin(allocation_names)).run()
# Update reconciled count
reconciled_count = frappe.db.count(
"Process Payment Reconciliation Log Allocations", filters={"parent": log, "reconciled": True}
)
frappe.db.set_value(
"Process Payment Reconciliation Log", log, "reconciled_entries", reconciled_count
)
except Exception as err:
# Update the parent doc about the exception
frappe.db.rollback()
traceback = frappe.get_traceback()
if traceback:
message = "Traceback: <br>" + traceback
frappe.db.set_value("Process Payment Reconciliation Log", log, "error_log", message)
frappe.db.set_value(
"Process Payment Reconciliation",
doc,
"error_log",
message,
)
if reconciled_entries and total_allocations and reconciled_entries < total_allocations:
frappe.db.set_value(
"Process Payment Reconciliation Log", log, "status", "Partially Reconciled"
)
frappe.db.set_value(
"Process Payment Reconciliation",
doc,
"status",
"Partially Reconciled",
)
else:
frappe.db.set_value("Process Payment Reconciliation Log", log, "status", "Failed")
frappe.db.set_value(
"Process Payment Reconciliation",
doc,
"status",
"Failed",
)
finally:
if reconciled_entries == total_allocations:
frappe.db.set_value("Process Payment Reconciliation Log", log, "status", "Reconciled")
frappe.db.set_value("Process Payment Reconciliation Log", log, "reconciled", True)
frappe.db.set_value("Process Payment Reconciliation", doc, "status", "Completed")
else:
if not (frappe.db.get_value("Process Payment Reconciliation", doc, "status") == "Paused"):
# trigger next batch in job
# generate reconcile job name
allocation = get_next_allocation(log)
if allocation:
reconcile_job_name = (
f"process_{doc}_reconcile_allocation_{allocation[0].idx}_{allocation[-1].idx}"
)
else:
reconcile_job_name = f"process_{doc}_reconcile"
if not is_job_running(reconcile_job_name):
job = frappe.enqueue(
method="erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.reconcile",
queue="long",
timeout="3600",
is_async=True,
job_name=reconcile_job_name,
enqueue_after_commit=True,
doc=doc,
)
else:
frappe.db.set_value("Process Payment Reconciliation Log", log, "status", "Reconciled")
frappe.db.set_value("Process Payment Reconciliation Log", log, "reconciled", True)
frappe.db.set_value("Process Payment Reconciliation", doc, "status", "Completed")
@frappe.whitelist()
def is_any_doc_running(for_filter: str | dict | None = None) -> str | None:
running_doc = None
if for_filter:
if type(for_filter) == str:
for_filter = frappe.json.loads(for_filter)
running_doc = frappe.db.get_value(
"Process Payment Reconciliation",
filters={
"docstatus": 1,
"status": ["in", ["Running", "Paused"]],
"company": for_filter.get("company"),
"party_type": for_filter.get("party_type"),
"party": for_filter.get("party"),
"receivable_payable_account": for_filter.get("receivable_payable_account"),
},
fieldname="name",
)
else:
running_doc = frappe.db.get_value(
"Process Payment Reconciliation", filters={"docstatus": 1, "status": "Running"}
)
return running_doc

View File

@@ -0,0 +1,15 @@
from frappe import _
def get_data():
return {
"fieldname": "process_pr",
"transactions": [
{
"label": _("Reconciliation Logs"),
"items": [
"Process Payment Reconciliation Log",
],
},
],
}

View File

@@ -0,0 +1,15 @@
frappe.listview_settings['Process Payment Reconciliation'] = {
add_fields: ["status"],
get_indicator: function(doc) {
let colors = {
'Queued': 'orange',
'Paused': 'orange',
'Completed': 'green',
'Partially Reconciled': 'orange',
'Running': 'blue',
'Failed': 'red',
};
let status = doc.status;
return [__(status), colors[status], 'status,=,'+status];
},
};

View File

@@ -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 TestProcessPaymentReconciliation(FrappeTestCase):
pass

Some files were not shown because too many files have changed in this diff Show More