Compare commits

...

707 Commits

Author SHA1 Message Date
Frappe PR Bot
6e479f918d chore(release): Bumped to Version 14.57.0
# [14.57.0](https://github.com/frappe/erpnext/compare/v14.56.0...v14.57.0) (2023-12-27)

### Bug Fixes

* allow to set rate manually for service item in BOM ([#38880](https://github.com/frappe/erpnext/issues/38880)) ([c2f692a](c2f692a4e4))
* display all item rate stop messages ([226d0e0](226d0e0196))
* do not reset the basic rate for the material receipt stock entry ([#38896](https://github.com/frappe/erpnext/issues/38896)) ([98bfcc4](98bfcc4c75))
* first name error on customer creation ([#38927](https://github.com/frappe/erpnext/issues/38927)) ([28f052d](28f052d586))
* german translations for Lost Quotations ([#38435](https://github.com/frappe/erpnext/issues/38435)) ([81b5e6c](81b5e6c5f1))
* groups for current accounts in German CoAs ([39aa36e](39aa36e44b))
* incorrect price list in customer-wise item price report ([7577706](7577706a9d))
* min order qty optional in production plan (backport [#38956](https://github.com/frappe/erpnext/issues/38956)) ([#38957](https://github.com/frappe/erpnext/issues/38957)) ([f6f2712](f6f2712db0))
* remove rows with zero consumed qty ([f2f4100](f2f410093a))
* reposting not fixing valuation rate for sales return using movin… ([#38895](https://github.com/frappe/erpnext/issues/38895)) ([3a668bb](3a668bbe96))
* reset the incoming rate on changing of the warehouse ([#38909](https://github.com/frappe/erpnext/issues/38909)) ([2770ca1](2770ca1b65))
* skip jvs against bank accounts ([98198d3](98198d35ea))
* **test:** expect account currency when party account is specified. ([30cb218](30cb218638))
* unset discount amount from coupon discounts ([87e8dd0](87e8dd0d63))
* use party account currency when party account is specified ([d9e0d55](d9e0d55b88))
* **ux:** make PR and PI Item rate field readonly based on `Maintain Same Rate` (backport [#38942](https://github.com/frappe/erpnext/issues/38942)) ([#38943](https://github.com/frappe/erpnext/issues/38943)) ([1eee203](1eee203f7f))

### Features

* in_party_currency option for AR/AP reports ([3c717db](3c717db3fd))
* total_asset_cost field (backport [#38879](https://github.com/frappe/erpnext/issues/38879)) ([#38886](https://github.com/frappe/erpnext/issues/38886)) ([8169c7d](8169c7de0d))

### Performance Improvements

* Drop unused/duplicate/sub-optimal indexes (backport [#38884](https://github.com/frappe/erpnext/issues/38884)) ([#38912](https://github.com/frappe/erpnext/issues/38912)) ([b254a72](b254a72d41))
* use estimated rows instead of actual rows (backport [#38830](https://github.com/frappe/erpnext/issues/38830)) ([#38875](https://github.com/frappe/erpnext/issues/38875)) ([4d1ccd9](4d1ccd9e27))
2023-12-27 08:40:26 +00:00
rohitwaghchaure
8e8d0ad9aa Merge pull request #38953 from frappe/version-14-hotfix
chore: release v14
2023-12-27 14:09:17 +05:30
rohitwaghchaure
400c78c600 Merge branch 'version-14' into version-14-hotfix 2023-12-27 10:24:01 +05:30
mergify[bot]
f6f2712db0 fix: min order qty optional in production plan (backport #38956) (#38957)
* fix: min order qty optional in production plan (#38956)

* fix: min order qty optional in production plan

* fix: test cases

(cherry picked from commit b09c9354fb)

# Conflicts:
#	erpnext/manufacturing/doctype/bom/bom.json
#	erpnext/manufacturing/doctype/production_plan/production_plan.py

* chore: fix conflicts

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-26 21:59:09 +05:30
mergify[bot]
1eee203f7f fix(ux): make PR and PI Item rate field readonly based on Maintain Same Rate (backport #38942) (#38943)
* fix(ux): make PI Item rate field editable

(cherry picked from commit eb5bb9f9a9)

* fix(ux): make PI Item rate field readonly based on `Maintain Same Rate`

(cherry picked from commit cb9114442b)

* fix(ux): make PR Item rate field readonly based on `Maintain Same Rate`

(cherry picked from commit b1ba210332)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-26 14:45:54 +05:30
ruthra kumar
ec337a1c9f Merge pull request #38945 from frappe/mergify/bp/version-14-hotfix/pr-38891
fix: incorrect price list in customer-wise item price report (backport #38891)
2023-12-26 12:16:52 +05:30
ruthra kumar
7577706a9d fix: incorrect price list in customer-wise item price report
(cherry picked from commit 9a00edb031)
2023-12-26 06:17:45 +00:00
mergify[bot]
81b5e6c5f1 fix: german translations for Lost Quotations (#38435)
* fix: german translations for Lost Quotations (#38435)

(cherry picked from commit 5952cfa673)

# Conflicts:
#	erpnext/translations/de.csv

* chore: resolve conflicts

---------

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-12-24 16:24:31 +05:30
ruthra kumar
28f052d586 fix: first name error on customer creation (#38927)
fix: error on customer creation
2023-12-24 16:12:13 +05:30
s-aga-r
2eac618bba Merge pull request #38892 from s-aga-r/FIX-6565
fix: remove rows with zero consumed qty
2023-12-22 15:58:09 +05:30
Deepesh Garg
6f6de13813 Merge pull request #38815 from frappe/mergify/bp/version-14-hotfix/pr-38803
fix: groups for current accounts in German CoAs (#38803)
2023-12-22 08:40:28 +05:30
Deepesh Garg
be1a269f9f Merge pull request #38857 from frappe/revert-38422-mergify/bp/version-14-hotfix/pr-38250
Revert "fix: unset discount amount based on coupon code (backport #38250)"
2023-12-22 08:40:07 +05:30
Deepesh Garg
0d70be56d2 Merge pull request #38370 from pps190/backport/version-14-hotfix/38289
fix: display all item rate stop messages (#38289)
2023-12-22 08:38:19 +05:30
Deepesh Garg
50655821c1 Merge pull request #38770 from frappe/mergify/bp/version-14-hotfix/pr-38767
fix: skip JVs against bank accounts in tax report (#38767)
2023-12-22 08:37:41 +05:30
mergify[bot]
b254a72d41 perf: Drop unused/duplicate/sub-optimal indexes (backport #38884) (#38912)
* perf: Drop unused/duplicate/sub-optimal indexes (#38884)

* ci: enable more checks

* perf: Drop unused/duplicate indexes

(cherry picked from commit 787333896c)

# Conflicts:
#	erpnext/accounts/doctype/gl_entry/gl_entry.json
#	erpnext/patches.txt

* chore: conflicts

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-12-21 21:40:59 +05:30
rohitwaghchaure
2770ca1b65 fix: reset the incoming rate on changing of the warehouse (#38909) 2023-12-21 18:49:36 +05:30
mergify[bot]
0d7cb1a9be chore: additional_asset_cost field (backport #38904) (backport #38905) (#38908)
chore: additional_asset_cost field (backport #38904) (#38905)

* chore: additional_asset_cost field (#38904)

(cherry picked from commit 283763dfb2)

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

* chore: resolve conflicts in asset.py

---------

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-12-21 17:12:01 +05:30
Frappe PR Bot
3abb91b2c4 chore(release): Bumped to Version 14.56.0
# [14.56.0](https://github.com/frappe/erpnext/compare/v14.55.2...v14.56.0) (2023-12-21)

### Features

* total_asset_cost field (backport [#38879](https://github.com/frappe/erpnext/issues/38879)) (backport [#38886](https://github.com/frappe/erpnext/issues/38886)) ([#38907](https://github.com/frappe/erpnext/issues/38907)) ([a63b8df](a63b8df867))
2023-12-21 11:41:51 +00:00
mergify[bot]
a63b8df867 feat: total_asset_cost field (backport #38879) (backport #38886) (#38907)
feat: total_asset_cost field (backport #38879) (#38886)

* feat: total_asset_cost field (#38879)

(cherry picked from commit d370c60a6c)

# Conflicts:
#	erpnext/assets/doctype/asset/asset.json
#	erpnext/assets/doctype/asset/asset.py
#	erpnext/patches.txt

* chore: resolve conflicts in asset.json

* chore: resolve conflicts in asset.py

* chore: resolve conflicts in patches.txt

---------

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-12-21 17:10:04 +05:30
mergify[bot]
3b9feffc00 chore: additional_asset_cost field (backport #38904) (#38905)
* chore: additional_asset_cost field (#38904)

(cherry picked from commit 283763dfb2)

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

* chore: resolve conflicts in asset.py

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-12-21 16:56:32 +05:30
Frappe PR Bot
0c13cb829c chore(release): Bumped to Version 14.55.2
## [14.55.2](https://github.com/frappe/erpnext/compare/v14.55.1...v14.55.2) (2023-12-21)

### Bug Fixes

* reposting not fixing valuation rate for sales return using movin… (backport [#38895](https://github.com/frappe/erpnext/issues/38895)) ([#38900](https://github.com/frappe/erpnext/issues/38900)) ([8aba707](8aba707b6a))
2023-12-21 10:05:58 +00:00
mergify[bot]
8aba707b6a fix: reposting not fixing valuation rate for sales return using movin… (backport #38895) (#38900)
fix: reposting not fixing valuation rate for sales return using movin… (#38895)

fix: reposting not fixing valuation rate for sales return using moving average method
(cherry picked from commit 3a668bbe96)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-21 15:34:49 +05:30
rohitwaghchaure
98bfcc4c75 fix: do not reset the basic rate for the material receipt stock entry (#38896) 2023-12-21 14:13:55 +05:30
rohitwaghchaure
3a668bbe96 fix: reposting not fixing valuation rate for sales return using movin… (#38895)
fix: reposting not fixing valuation rate for sales return using moving average method
2023-12-21 14:13:34 +05:30
s-aga-r
f2f410093a fix: remove rows with zero consumed qty 2023-12-21 11:03:18 +05:30
mergify[bot]
8169c7de0d feat: total_asset_cost field (backport #38879) (#38886)
* feat: total_asset_cost field (#38879)

(cherry picked from commit d370c60a6c)

# Conflicts:
#	erpnext/assets/doctype/asset/asset.json
#	erpnext/assets/doctype/asset/asset.py
#	erpnext/patches.txt

* chore: resolve conflicts in asset.json

* chore: resolve conflicts in asset.py

* chore: resolve conflicts in patches.txt

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-12-20 22:57:37 +05:30
Frappe PR Bot
eefac19cc8 chore(release): Bumped to Version 14.55.1
## [14.55.1](https://github.com/frappe/erpnext/compare/v14.55.0...v14.55.1) (2023-12-20)

### Bug Fixes

* allow to set rate manually for service item in BOM (backport [#38880](https://github.com/frappe/erpnext/issues/38880)) ([#38881](https://github.com/frappe/erpnext/issues/38881)) ([afc0491](afc049154d))
2023-12-20 13:06:21 +00:00
mergify[bot]
afc049154d fix: allow to set rate manually for service item in BOM (backport #38880) (#38881)
fix: allow to set rate manually for service item in BOM (#38880)

(cherry picked from commit c2f692a4e4)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-20 18:34:31 +05:30
mergify[bot]
4d1ccd9e27 perf: use estimated rows instead of actual rows (backport #38830) (#38875)
* perf: use estimated rows instead of actual rows (#38830)

(cherry picked from commit 9983283f95)

# Conflicts:
#	erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py

* chore: conflicts

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-12-20 18:17:41 +05:30
Deepesh Garg
c48c8b8ddb Merge pull request #38858 from GursheenK/unset-discount-amt-coupon-code
fix: unset discount amount for removed coupons
2023-12-20 18:17:20 +05:30
rohitwaghchaure
c2f692a4e4 fix: allow to set rate manually for service item in BOM (#38880) 2023-12-20 17:53:48 +05:30
ruthra kumar
d94b5a318d Merge pull request #38872 from frappe/mergify/bp/version-14-hotfix/pr-38838
fix: use party account currency when party account is specified (backport #38838)
2023-12-20 13:09:17 +05:30
Devin Slauenwhite
30cb218638 fix(test): expect account currency when party account is specified.
(cherry picked from commit a09241e3c7)
2023-12-20 07:05:27 +00:00
Devin Slauenwhite
d9e0d55b88 fix: use party account currency when party account is specified
(cherry picked from commit c7b961ffa2)
2023-12-20 07:05:26 +00:00
ruthra kumar
1e9b4e2403 Merge pull request #38800 from pps190/backport/version-14-hotfix/37746
feat: in_party_currency option for AR/AP reports (backport #37746)
2023-12-20 12:25:35 +05:30
Frappe PR Bot
8657ba374a chore(release): Bumped to Version 14.55.0
# [14.55.0](https://github.com/frappe/erpnext/compare/v14.54.2...v14.55.0) (2023-12-20)

### Bug Fixes

* close PO on SCO close (backport [#38667](https://github.com/frappe/erpnext/issues/38667)) ([#38680](https://github.com/frappe/erpnext/issues/38680)) ([22b442d](22b442d593))
* **customer:** contact creation for companies ([#38055](https://github.com/frappe/erpnext/issues/38055)) ([ed9b38b](ed9b38bc8d))
* **customer:** quick form and integration fixes ([#37386](https://github.com/frappe/erpnext/issues/37386)) ([6ed7c66](6ed7c6610a))
* error while filtering on name on reconciliation tool ([30b6321](30b6321fd5))
* fetch exc rate of multi currency journals ([bf585de](bf585de558))
* fetch item_tax_template values if fields with fetch_from exisit ([24ae45c](24ae45ce84))
* get customers for leaderboard ([9dfe342](9dfe342838))
* get items for leaderboard ([812b301](812b301aab))
* get sales partner for leaderboard ([c63f873](c63f873a6f))
* get sales person for leaderboard ([df93447](df93447d30))
* get suppliers for leaderboard ([7477ff3](7477ff3b5c))
* if not budget then don't validate ([#38861](https://github.com/frappe/erpnext/issues/38861)) ([d375164](d375164100))
* incoming rate for sales return with Moving Average valuation method ([#38849](https://github.com/frappe/erpnext/issues/38849)) ([7fdac62](7fdac62393))
* incorrect limit ([#38818](https://github.com/frappe/erpnext/issues/38818)) ([e18dc5c](e18dc5cea3))
* Init internal child table values ([d593f81](d593f81a16))
* item variant with manufacturer ([#38845](https://github.com/frappe/erpnext/issues/38845)) ([e0c8ff1](e0c8ff10da))
* not able to cancel SCR with Batch ([#38817](https://github.com/frappe/erpnext/issues/38817)) ([fb5090f](fb5090fd3f))
* not able to make inter-company po from so ([#38826](https://github.com/frappe/erpnext/issues/38826)) ([23042df](23042dfc3c))
* on closed unreserved the production plan qty ([#38848](https://github.com/frappe/erpnext/issues/38848)) ([2184e8e](2184e8ef58))
* Reset SLA on issue doesn't work (backport [#38789](https://github.com/frappe/erpnext/issues/38789)) ([#38790](https://github.com/frappe/erpnext/issues/38790)) ([942f34a](942f34a734))
* supplier removed on selection of item (backport [#38712](https://github.com/frappe/erpnext/issues/38712)) ([#38732](https://github.com/frappe/erpnext/issues/38732)) ([dda95ea](dda95ea892))
* timezone aware SLA banner (backport [#38745](https://github.com/frappe/erpnext/issues/38745)) ([#38746](https://github.com/frappe/erpnext/issues/38746)) ([73d525e](73d525e84d))
* **ux:** don't override Item Name and Description in MR (backport [#38720](https://github.com/frappe/erpnext/issues/38720)) ([#38762](https://github.com/frappe/erpnext/issues/38762)) ([f7bfbd8](f7bfbd82dd))
* validation error on reconciling PE to Journals as Invoice ([9836205](9836205725))
* wrong currency in Stock Balance report (backport [#38778](https://github.com/frappe/erpnext/issues/38778)) ([#38779](https://github.com/frappe/erpnext/issues/38779)) ([e05b23c](e05b23c388))
* wrong paid and cn amount on pos invoice ([77da0da](77da0da945))

### Features

* **RFQ:** special properties in print preview (backport [#38725](https://github.com/frappe/erpnext/issues/38725)) ([#38726](https://github.com/frappe/erpnext/issues/38726)) ([2290750](229075048b))
* set lead name from email ([1469ca7](1469ca7d0b))

### Performance Improvements

* index `return_against` on delivery note (backport [#38827](https://github.com/frappe/erpnext/issues/38827)) ([#38831](https://github.com/frappe/erpnext/issues/38831)) ([4114760](4114760efd))
2023-12-20 04:46:08 +00:00
Deepesh Garg
3a8b7e9b96 Merge pull request #38852 from frappe/version-14-hotfix
chore: release v14
2023-12-20 10:14:59 +05:30
mergify[bot]
22b442d593 fix: close PO on SCO close (backport #38667) (#38680)
fix: close PO on SCO close

(cherry picked from commit b023e5d6b3)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-20 09:14:54 +05:30
mergify[bot]
f7bfbd82dd fix(ux): don't override Item Name and Description in MR (backport #38720) (#38762)
fix(ux): don't override Item Name and Description in MR

(cherry picked from commit 726ac6bda1)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-20 09:14:03 +05:30
rohitwaghchaure
d375164100 fix: if not budget then don't validate (#38861) 2023-12-19 18:19:20 +05:30
rohitwaghchaure
7fdac62393 fix: incoming rate for sales return with Moving Average valuation method (#38849) 2023-12-19 18:01:50 +05:30
rohitwaghchaure
2184e8ef58 fix: on closed unreserved the production plan qty (#38848) 2023-12-19 17:20:41 +05:30
Gursheen Anand
87e8dd0d63 fix: unset discount amount from coupon discounts 2023-12-19 15:56:59 +05:30
rohitwaghchaure
857843bc29 chore: fix test case (#38856) 2023-12-19 15:54:29 +05:30
Gursheen Kaur Anand
37a18299d0 Revert "fix: unset discount amount based on coupon code (backport #38250)" 2023-12-19 15:35:35 +05:30
rohitwaghchaure
e0c8ff10da fix: item variant with manufacturer (#38845) 2023-12-19 12:45:08 +05:30
ruthra kumar
61b02ec75c Merge pull request #38843 from frappe/mergify/bp/version-14-hotfix/pr-38797
fix: wrong paid and cn amount on pos invoice (backport #38797)
2023-12-19 11:33:25 +05:30
Dany Robert
939b7f7cbf test: partial payment for pos invoice
(cherry picked from commit 8772628912)
2023-12-19 05:33:10 +00:00
Dany Robert
77da0da945 fix: wrong paid and cn amount on pos invoice
(cherry picked from commit 5cb5e09dbb)
2023-12-19 05:33:09 +00:00
Devin Slauenwhite
226d0e0196 fix: display all item rate stop messages 2023-12-18 14:14:29 -05:00
mergify[bot]
4114760efd perf: index return_against on delivery note (backport #38827) (#38831)
* perf: index `return_against` on delivery note (#38827)

There's a multi-column index but that's useful IFF all parts of column
are part of query.

return against on it's own is VERY unique because it's a primary key, we
don't need a multi-column index here.

(cherry picked from commit 8d79365e0d)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/purchase_receipt.json

* chore: conflict

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-12-18 18:10:54 +05:30
rohitwaghchaure
23042dfc3c fix: not able to make inter-company po from so (#38826) 2023-12-18 17:44:17 +05:30
ruthra kumar
9216a852d4 Merge pull request #38824 from frappe/mergify/bp/version-14-hotfix/pr-38820
refactor: ignore ERR journals in Statment of Accounts (backport #38820)
2023-12-18 16:24:57 +05:30
ruthra kumar
6478c80359 refactor: ignore ERR journals in Statment of Accounts
(cherry picked from commit 39ef75e2d0)
2023-12-18 15:59:59 +05:30
rohitwaghchaure
e18dc5cea3 fix: incorrect limit (#38818) 2023-12-18 15:59:56 +05:30
rohitwaghchaure
fb5090fd3f fix: not able to cancel SCR with Batch (#38817) 2023-12-18 14:11:36 +05:30
barredterra
39aa36e44b fix: groups for current accounts in German CoAs
(cherry picked from commit 259f313af7)
2023-12-17 18:24:10 +00:00
Deepesh Garg
20a764a4a3 Merge pull request #38809 from vorasmit/fetch-item-taxes-v14
fix: fetch item_tax_template values if fields with fetch_from exisit (#38284)
2023-12-17 18:51:22 +05:30
Smit Vora
24ae45ce84 fix: fetch item_tax_template values if fields with fetch_from exisit 2023-12-17 14:03:37 +05:30
Deepesh Garg
a14e7f0e84 Merge pull request #38751 from frappe/mergify/bp/version-14-hotfix/pr-38505
feat: set lead name from email (#38505)
2023-12-16 22:29:43 +05:30
Devin Slauenwhite
7eee573fcb fixup! feat: in_party_currency option for AR/AP reports
fix: merge conflict typo
2023-12-16 16:29:01 +00:00
Richard Case
0894022695 chore: update tests 2023-12-16 16:15:00 +00:00
Richard Case
3c717db3fd feat: in_party_currency option for AR/AP reports 2023-12-16 16:14:44 +00:00
mergify[bot]
942f34a734 fix: Reset SLA on issue doesn't work (backport #38789) (#38790)
fix: Reset SLA on issue doesn't work (#38789)

This was broken since last refactor where it was spun off to work with
all types of doctypes but client side code was never adapted.

(cherry picked from commit fa1c7b663c)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-12-15 22:02:29 +05:30
Raffael Meyer
4821919695 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-38505 2023-12-15 15:15:37 +01:00
Deepesh Garg
34549b62bd Merge pull request #38782 from frappe/mergify/bp/version-14-hotfix/pr-38691
fix: Init internal child table values (#38691)
2023-12-15 18:48:10 +05:30
Deepesh Garg
d593f81a16 fix: Init internal child table values
(cherry picked from commit 2588970d55)
2023-12-15 12:45:51 +00:00
mergify[bot]
e05b23c388 fix: wrong currency in Stock Balance report (backport #38778) (#38779)
fix: wrong currency in Stock Balance report

(cherry picked from commit 5a83a16e60)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-15 15:32:50 +05:30
ruthra kumar
d4c131b153 Merge pull request #38774 from frappe/mergify/bp/version-14-hotfix/pr-38766
fix: validation error on reconciling PE to Journals as Invoice (backport #38766)
2023-12-15 14:41:43 +05:30
ruthra kumar
9836205725 fix: validation error on reconciling PE to Journals as Invoice
With the same exchange rate on Journal Entry and Payment Entry,
reconcilition should not post exc gain/loss journal and should not
throw validation error

(cherry picked from commit 5eeb650dfd)
2023-12-15 13:20:38 +05:30
Gursheen Anand
98198d35ea fix: skip jvs against bank accounts
(cherry picked from commit f7b2380ec1)
2023-12-15 07:29:14 +00:00
Deepesh Garg
12cd7a7083 Merge pull request #38674 from frappe/mergify/bp/version-14-hotfix/pr-38672
fix: get data for leaderboard (#38672)
2023-12-15 10:15:41 +05:30
Deepesh Garg
e539152c6b Merge pull request #38753 from barredterra/contact-from-customer-creation
fix: address and contact from customer creation (backport #38055, #37386, #38060)
2023-12-15 10:14:58 +05:30
David Arnold
6ed7c6610a fix(customer): quick form and integration fixes (#37386) 2023-12-14 16:50:20 +01:00
barredterra
d6d717c315 test: parse full name 2023-12-14 16:47:46 +01:00
barredterra
935e23449f refactor: parse full name 2023-12-14 16:47:36 +01:00
David Arnold
ed9b38bc8d fix(customer): contact creation for companies (#38055) 2023-12-14 16:47:15 +01:00
Raffael Meyer
2c52f2ce13 chore: resolve conflicts 2023-12-14 13:51:47 +01:00
barredterra
1469ca7d0b feat: set lead name from email
(cherry picked from commit ceeb724acc)

# Conflicts:
#	erpnext/crm/doctype/lead/lead.json
2023-12-14 12:49:40 +00:00
mergify[bot]
73d525e84d fix: timezone aware SLA banner (backport #38745) (#38746)
fix: timezone aware SLA banner (#38745)

(cherry picked from commit eaf86a6461)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-12-14 15:59:19 +05:30
ruthra kumar
f6c611d026 Merge pull request #38744 from ruthra-kumar/filter_error_on_reconciliation_tool
fix: error while filtering on name on reconciliation tool
2023-12-14 15:10:12 +05:30
ruthra kumar
30b6321fd5 fix: error while filtering on name on reconciliation tool 2023-12-14 14:28:20 +05:30
Frappe PR Bot
20a26c3dd4 chore(release): Bumped to Version 14.54.2
## [14.54.2](https://github.com/frappe/erpnext/compare/v14.54.1...v14.54.2) (2023-12-14)

### Bug Fixes

* fetch exc rate of multi currency journals ([cdef0bd](cdef0bd503))
2023-12-14 06:20:30 +00:00
ruthra kumar
d975eccaab Merge pull request #38741 from frappe/mergify/bp/version-14/pr-38717
fix: fetch exc rate of multi currency journals on reconciliation (backport #38717)
2023-12-14 11:49:20 +05:30
ruthra kumar
cdef0bd503 fix: fetch exc rate of multi currency journals
(cherry picked from commit 1b3ba25220)
2023-12-14 06:00:23 +00:00
ruthra kumar
a714114cd9 Merge pull request #38736 from frappe/mergify/bp/version-14-hotfix/pr-38717
fix: fetch exc rate of multi currency journals on reconciliation (backport #38717)
2023-12-14 09:59:44 +05:30
ruthra kumar
bf585de558 fix: fetch exc rate of multi currency journals
(cherry picked from commit 1b3ba25220)
2023-12-14 04:06:43 +00:00
Frappe PR Bot
b7fd24074d chore(release): Bumped to Version 14.54.1
## [14.54.1](https://github.com/frappe/erpnext/compare/v14.54.0...v14.54.1) (2023-12-13)

### Bug Fixes

* supplier removed on selection of item (backport [#38712](https://github.com/frappe/erpnext/issues/38712)) (backport [#38732](https://github.com/frappe/erpnext/issues/38732)) ([#38735](https://github.com/frappe/erpnext/issues/38735)) ([d53a9f6](d53a9f6530))
2023-12-13 19:09:56 +00:00
mergify[bot]
d53a9f6530 fix: supplier removed on selection of item (backport #38712) (backport #38732) (#38735)
fix: supplier removed on selection of item (backport #38712) (#38732)

fix: supplier removed on selection of item (#38712)

(cherry picked from commit db24e24882)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
(cherry picked from commit dda95ea892)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-12-14 00:38:47 +05:30
mergify[bot]
dda95ea892 fix: supplier removed on selection of item (backport #38712) (#38732)
fix: supplier removed on selection of item (#38712)

(cherry picked from commit db24e24882)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-13 19:05:52 +00:00
mergify[bot]
4908d03a88 Revert "fix(ux): don't update qty blindly" (backport #38728) (backport #38729) (#38733)
Revert "fix(ux): don't update qty blindly" (backport #38728) (#38729)

Revert "fix(ux): don't update qty blindly" (#38728)

(cherry picked from commit 6851c5042f)

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-12-14 00:30:36 +05:30
mergify[bot]
229075048b feat(RFQ): special properties in print preview (backport #38725) (#38726)
feat: RFQ print preview

(cherry picked from commit 27f05145ae)

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
2023-12-14 00:10:58 +05:30
mergify[bot]
0d49dd3648 Revert "fix(ux): don't update qty blindly" (backport #38728) (#38729)
Revert "fix(ux): don't update qty blindly" (#38728)

(cherry picked from commit 6851c5042f)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-12-13 23:16:26 +05:30
Frappe PR Bot
214861d68f chore(release): Bumped to Version 14.54.0
# [14.54.0](https://github.com/frappe/erpnext/compare/v14.53.0...v14.54.0) (2023-12-12)

### Bug Fixes

* 1st row depr. sch. value of asset put to less than 180 days acc. to I.T. S. 32 ([#38697](https://github.com/frappe/erpnext/issues/38697)) ([753a1b5](753a1b511d))
* calc monthly_repayment_amount correctly in regenerate_repayment_schedule ([#38636](https://github.com/frappe/erpnext/issues/38636)) ([008400d](008400d287))
* format only if searched text contain link value text ([b28deaa](b28deaae2c))
* limit end date to current date ([cbe15e1](cbe15e159a))
* typo in unittest ([#38673](https://github.com/frappe/erpnext/issues/38673)) ([c87a3c7](c87a3c7793))
* **ux:** don't update qty blindly (backport [#38608](https://github.com/frappe/erpnext/issues/38608)) ([#38638](https://github.com/frappe/erpnext/issues/38638)) ([29cd474](29cd474f44))

### Features

* add employee number to client user bootinfo (backport [#38477](https://github.com/frappe/erpnext/issues/38477)) ([#38602](https://github.com/frappe/erpnext/issues/38602)) ([c2a137f](c2a137f0fb))

### Reverts

* Revert "refactor: bank transaction (backport #38182)" (#38653) ([7813efa](7813efad35)), closes [#38182](https://github.com/frappe/erpnext/issues/38182) [#38653](https://github.com/frappe/erpnext/issues/38653) [#38182](https://github.com/frappe/erpnext/issues/38182)
2023-12-12 16:12:27 +00:00
Deepesh Garg
e7b96209cd Merge pull request #38689 from frappe/version-14-hotfix
chore: release v14
2023-12-12 21:40:16 +05:30
Anand Baburajan
753a1b511d fix: 1st row depr. sch. value of asset put to less than 180 days acc. to I.T. S. 32 (#38697)
fix: 1st row value of asset put to less than 180 days acc. to IT S. 32
2023-12-12 20:53:44 +05:30
ruthra kumar
6715dd6167 Merge pull request #38677 from frappe/mergify/bp/version-14-hotfix/pr-38673
fix: typo in unittest (backport #38673)
2023-12-12 17:35:16 +05:30
ruthra kumar
a061798a6f Merge pull request #38686 from frappe/mergify/bp/version-14-hotfix/pr-38685
refactor: add `get_list` for virtual child doctypes (backport #38685)
2023-12-12 15:24:56 +05:30
ruthra kumar
fa79a7cdab refactor: add get_list for virtual child doctypes
(cherry picked from commit 15c90551b6)
2023-12-12 14:51:41 +05:30
ruthra kumar
6884aac2a0 Merge pull request #38683 from frappe/mergify/bp/version-14-hotfix/pr-38679
refactor(test): repost utility deletion flag test (backport #38679)
2023-12-12 13:33:17 +05:30
ruthra kumar
e61a12b4cb refactor(test): update repost settings before test case
(cherry picked from commit acb6e8e120)
2023-12-12 07:16:49 +00:00
ruthra kumar
4542a12787 refactor: increase limit and remove explicit call to start_repost
(cherry picked from commit ccff588563)
2023-12-12 07:16:49 +00:00
ruthra kumar
f0408c89ce refactor: remove explicit commit on repost
(cherry picked from commit a97b3db749)
2023-12-12 07:16:48 +00:00
ruthra kumar
7c080bd60c refactor(test): repost utility deletion flag test
(cherry picked from commit cc15f695b4)
2023-12-12 07:16:48 +00:00
Raffael Meyer
c87a3c7793 fix: typo in unittest (#38673)
(cherry picked from commit 6ad298adfc)
2023-12-12 04:26:10 +00:00
barredterra
038a30feb0 chore: deprecate unused method
(cherry picked from commit 956c3c50a0)
2023-12-12 04:24:39 +00:00
barredterra
c63f873a6f fix: get sales partner for leaderboard
(cherry picked from commit 40c1acc961)
2023-12-12 04:24:39 +00:00
barredterra
df93447d30 fix: get sales person for leaderboard
(cherry picked from commit 7babfd4ac4)
2023-12-12 04:24:39 +00:00
barredterra
7477ff3b5c fix: get suppliers for leaderboard
(cherry picked from commit 65df4b6aa8)
2023-12-12 04:24:38 +00:00
barredterra
812b301aab fix: get items for leaderboard
(cherry picked from commit 2721ee3a8d)
2023-12-12 04:24:38 +00:00
barredterra
9dfe342838 fix: get customers for leaderboard
(cherry picked from commit 137b5a6108)
2023-12-12 04:24:38 +00:00
Deepesh Garg
7813efad35 Revert "refactor: bank transaction (backport #38182)" (#38653)
Revert "refactor: bank transaction (#38182)"

This reverts commit a4b5fc8100.
2023-12-10 16:29:27 +05:30
mergify[bot]
29cd474f44 fix(ux): don't update qty blindly (backport #38608) (#38638)
fix(ux): don't update qty blindly

(cherry picked from commit 0156339f34)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-08 17:59:46 +05:30
Anand Baburajan
008400d287 fix: calc monthly_repayment_amount correctly in regenerate_repayment_schedule (#38636) 2023-12-08 16:34:29 +05:30
Shariq Ansari
4b9d9c0df4 Merge pull request #38626 from frappe/mergify/bp/version-14-hotfix/pr-38623
fix: format only if searched text contain link value text (backport #38623)
2023-12-07 20:51:16 +05:30
Shariq Ansari
b28deaae2c fix: format only if searched text contain link value text
(cherry picked from commit 08ed3cd313)
2023-12-07 15:17:48 +00:00
Ankush Menat
4e6b8ead8f chore: remove unused cache=True
(cherry picked from commit 6a47a2ceaf)
2023-12-06 20:55:35 +05:30
mergify[bot]
c2a137f0fb feat: add employee number to client user bootinfo (backport #38477) (#38602)
feat: add employee number to client user bootinfo (#38477)

(cherry picked from commit 525f656cc1)

Co-authored-by: Richard Case <110036763+casesolved-co-uk@users.noreply.github.com>
2023-12-06 20:55:06 +05:30
Deepesh Garg
f6fcb7ee26 Merge pull request #38571 from frappe/mergify/bp/version-14-hotfix/pr-38556
fix(minor): financial statements period end date (#38556)
2023-12-06 13:45:45 +05:30
Frappe PR Bot
973d06d96f chore(release): Bumped to Version 14.53.0
# [14.53.0](https://github.com/frappe/erpnext/compare/v14.52.1...v14.53.0) (2023-12-05)

### Bug Fixes

* `OperationalError` while selecting Serial No in `Warranty Claim` (backport [#38394](https://github.com/frappe/erpnext/issues/38394)) ([#38413](https://github.com/frappe/erpnext/issues/38413)) ([49296cd](49296cd5cb))
* better overlap logic for job card (backport [#38432](https://github.com/frappe/erpnext/issues/38432)) ([#38521](https://github.com/frappe/erpnext/issues/38521)) ([6db63c9](6db63c971e))
* consider the `Valuation Method` while picking incorrect SLE (backport [#38592](https://github.com/frappe/erpnext/issues/38592)) ([#38594](https://github.com/frappe/erpnext/issues/38594)) ([01b2a1f](01b2a1ffeb))
* debit credit mismatch in multi-currecy asset purchase receipt ([#38342](https://github.com/frappe/erpnext/issues/38342)) ([fd6a23c](fd6a23cf41))
* don't consider cancelled entries ([#38401](https://github.com/frappe/erpnext/issues/38401)) ([9345334](9345334196))
* don't show non-stock items in Stock Analytics report (backport [#38543](https://github.com/frappe/erpnext/issues/38543)) ([#38544](https://github.com/frappe/erpnext/issues/38544)) ([2e333e6](2e333e6802))
* don't update previous doc on rate change (backport [#38493](https://github.com/frappe/erpnext/issues/38493)) ([#38523](https://github.com/frappe/erpnext/issues/38523)) ([b88c7d6](b88c7d63de))
* exclude `invoice_doctypes` from party advance ([1042d4c](1042d4cfeb))
* exploded items in Subcontracting Receipt (backport [#38441](https://github.com/frappe/erpnext/issues/38441)) ([#38444](https://github.com/frappe/erpnext/issues/38444)) ([2908d96](2908d966b6))
* get dynamic link with parenttype contact ([12d3cda](12d3cda2d9))
* incorrect customer outstanding amount ([#38475](https://github.com/frappe/erpnext/issues/38475)) ([c07723d](c07723d49d))
* incorrect material request quantity in Production Plan (backport [#38566](https://github.com/frappe/erpnext/issues/38566)) ([#38578](https://github.com/frappe/erpnext/issues/38578)) ([70965ef](70965efd94))
* incorrect ordered qty for Subcontracting Order ([#38415](https://github.com/frappe/erpnext/issues/38415)) ([8e37087](8e370876cc))
* incorrect requested quantity for the subcontracting order (backport [#38455](https://github.com/frappe/erpnext/issues/38455)) ([#38471](https://github.com/frappe/erpnext/issues/38471)) ([497049b](497049b3fd))
* item group filter in sales person wise report ([eee9062](eee9062814))
* make create button translatable ([#38165](https://github.com/frappe/erpnext/issues/38165)) ([c71b31e](c71b31e3b8))
* no fstring in translation ([#38381](https://github.com/frappe/erpnext/issues/38381)) ([cec2574](cec25740ea))
* **pe:** show split alert only on splitting ([8d6d74c](8d6d74c237))
* **regional:** use net figures for sales calc ([#38260](https://github.com/frappe/erpnext/issues/38260)) ([d337533](d337533907))
* remove hardcoded, implicit rounding loss allowance ([419943a](419943a9d9))
* set cwip account before asset tests ([ecde1d5](ecde1d58b5))
* show item name as title instead of item group in BOM (backport [#38478](https://github.com/frappe/erpnext/issues/38478)) ([#38480](https://github.com/frappe/erpnext/issues/38480)) ([0df52d2](0df52d2c4f))
* SO ordered qty on PO item removal ([#38378](https://github.com/frappe/erpnext/issues/38378)) ([b7fe163](b7fe163de5))
* sql error while filtering on finance book in GL ([25ec1fc](25ec1fce61))
* unset discount amount based on coupon code ([7fa97fa](7fa97fa7b5))
* use `docstatus` instead of `status` (backport [#38439](https://github.com/frappe/erpnext/issues/38439)) ([#38442](https://github.com/frappe/erpnext/issues/38442)) ([2dc4b02](2dc4b02fc8))
* use predefined onload property `load_after_mapping` (backport [#38209](https://github.com/frappe/erpnext/issues/38209)) ([#38518](https://github.com/frappe/erpnext/issues/38518)) ([9f23b7e](9f23b7e46f))
* **ux:** make valuation field read only when it can't be modified (backport [#38450](https://github.com/frappe/erpnext/issues/38450)) ([#38463](https://github.com/frappe/erpnext/issues/38463)) ([bec7fb5](bec7fb5493))
* validate finance_books table length in asset ([#38584](https://github.com/frappe/erpnext/issues/38584)) ([14b908f](14b908f8ab))

### Features

* `Company` filter in `Stock Ledger Variance` report (backport [#38553](https://github.com/frappe/erpnext/issues/38553)) ([#38573](https://github.com/frappe/erpnext/issues/38573)) ([6c89f35](6c89f351f4))
* shift depreciation for assets [v14] [backport of [#38327](https://github.com/frappe/erpnext/issues/38327)] ([#38404](https://github.com/frappe/erpnext/issues/38404)) ([d8c3935](d8c3935e64))
2023-12-05 17:17:12 +00:00
Deepesh Garg
37bf57cf75 Merge pull request #38589 from frappe/version-14-hotfix
chore: release v14
2023-12-05 22:45:16 +05:30
Deepesh Garg
8d4c38f6b9 Merge branch 'version-14' into version-14-hotfix 2023-12-05 22:01:50 +05:30
mergify[bot]
01b2a1ffeb fix: consider the Valuation Method while picking incorrect SLE (backport #38592) (#38594)
* fix: incorrect SLE for `Moving Average` valuation method

(cherry picked from commit 8beec58670)

* feat: add `Valuation Method` column in `Stock Ledger Variance` report

(cherry picked from commit 16c297c2ec)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-05 18:13:59 +05:30
ruthra kumar
b858d1ceeb Merge pull request #38585 from frappe/mergify/bp/version-14-hotfix/pr-38580
fix: sql error while filtering on finance book in GL (backport #38580)
2023-12-05 15:07:07 +05:30
Sherin KR
14b908f8ab fix: validate finance_books table length in asset (#38584) 2023-12-05 14:44:59 +05:30
ruthra kumar
25ec1fce61 fix: sql error while filtering on finance book in GL
(cherry picked from commit b1d9f3132d)
2023-12-05 09:11:39 +00:00
mergify[bot]
70965efd94 fix: incorrect material request quantity in Production Plan (backport #38566) (#38578)
fix: incorrect material request quantity in Production Plan (#38566)

(cherry picked from commit aaa9036eca)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-05 14:24:54 +05:30
Karol Walczysko
9f43e9e668 Fix: Asset JS fieldname depreciation_schedule to schedules in make_schedules_editable function. (#38583)
Fix fieldname depreciation_schedule to schedules

Renames the depreciation_schedule fieldname to schedules in the make_schedules_editable function.
2023-12-05 14:22:23 +05:30
ruthra kumar
47ef075759 Merge pull request #38576 from frappe/mergify/bp/version-14-hotfix/pr-38570
refactor: ignore unreconcile doc on PI cancel/delete (backport #38570)
2023-12-05 13:52:22 +05:30
ruthra kumar
4544727654 refactor: ingore on JE cancel as well
(cherry picked from commit 1a5d56977e)
2023-12-05 13:32:10 +05:30
mergify[bot]
6c89f351f4 feat: Company filter in Stock Ledger Variance report (backport #38553) (#38573)
feat: `Company` filter in `Stock Ledger Variance` report

(cherry picked from commit fb3421fcce)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-05 12:33:14 +05:30
ruthra kumar
35c06fabc5 refactor: ignore unreconcile doc on PI cancel/delete
(cherry picked from commit 4ca84eadb6)
2023-12-05 06:34:13 +00:00
Gursheen Anand
cbe15e159a fix: limit end date to current date
(cherry picked from commit ab6e92aae1)
2023-12-05 05:54:12 +00:00
Shariq Ansari
3411814ee3 Merge pull request #38563 from frappe/mergify/bp/version-14-hotfix/pr-38562
fix: get dynamic link with parenttype contact (backport #38562)
2023-12-04 19:22:28 +05:30
Shariq Ansari
12d3cda2d9 fix: get dynamic link with parenttype contact
(cherry picked from commit 3d7ad71b22)
2023-12-04 13:51:13 +00:00
ruthra kumar
efc6a8a044 Merge pull request #38546 from frappe/mergify/bp/version-14-hotfix/pr-38283
chore: move reconciliation cleanup patch to pre-model sync (backport #38283)
2023-12-04 14:33:44 +05:30
ruthra kumar
0d913a6401 Merge pull request #38549 from frappe/mergify/bp/version-14-hotfix/pr-38475
fix: incorrect customer outstanding amount (backport #38475)
2023-12-04 13:58:16 +05:30
ruthra kumar
2e3a860a46 chore: resolve conflict 2023-12-04 13:43:41 +05:30
NIYAZ RAZAK
c07723d49d fix: incorrect customer outstanding amount (#38475)
* fix: incorrect customer outstanding amount

* chore: resolve linting error

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 3df1d75bdd)
2023-12-04 08:10:42 +00:00
ruthra kumar
7551ba3851 chore: move reconciliation cleanup patch to pre-model
(cherry picked from commit f258ab5e98)

# Conflicts:
#	erpnext/patches.txt
2023-12-04 07:33:38 +00:00
ruthra kumar
67f149ee06 Merge pull request #38541 from frappe/mergify/bp/version-14-hotfix/pr-38148
refactor: convert Payment Reconciliation to virtual doctype (backport #38148)
2023-12-04 13:01:49 +05:30
ruthra kumar
d27e588672 chore: resolve conflicts 2023-12-04 12:21:19 +05:30
mergify[bot]
2e333e6802 fix: don't show non-stock items in Stock Analytics report (backport #38543) (#38544)
* fix(ux): stock-item filter for Item Code field

(cherry picked from commit ccdcb7dfcc)

* fix: don't show non-stock items in Stock Analytics report

(cherry picked from commit 01aadbef85)

* fix: `linter`

(cherry picked from commit 15fff84bb5)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-04 12:18:31 +05:30
ruthra kumar
59773acdd2 chore: clear singles table and reconciliation related tables
(cherry picked from commit f31002636b)

# Conflicts:
#	erpnext/patches.txt
2023-12-04 06:31:05 +00:00
ruthra kumar
454d789232 chore: remove reconciliation defaults from patch
(cherry picked from commit b5dd0c8630)

# Conflicts:
#	erpnext/patches.txt
2023-12-04 06:31:04 +00:00
ruthra kumar
c349c89ae3 refactor: virtual doctype methods
(cherry picked from commit 9c7b19e0b7)
2023-12-04 06:31:04 +00:00
ruthra kumar
36dc7bd55e refactor: convert payment reconciliation tool to virtual doctype
(cherry picked from commit 3a51a3f37e)

# Conflicts:
#	erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.json
2023-12-04 06:31:03 +00:00
ruthra kumar
5a8bf7bf7d Merge pull request #38539 from frappe/mergify/bp/version-14-hotfix/pr-38220
fix: exclude `invoice_doctypes` from party advance (backport #38220)
2023-12-04 11:19:24 +05:30
Dany Robert
1042d4cfeb fix: exclude invoice_doctypes from party advance
(cherry picked from commit f34ffc2062)
2023-12-04 05:31:28 +00:00
mergify[bot]
9f23b7e46f fix: use predefined onload property load_after_mapping (backport #38209) (#38518)
Co-authored-by: Sagar Vora <sagar@resilient.tech>
fix: use predefined onload property `load_after_mapping` (#38209)
2023-12-04 09:52:16 +05:30
mergify[bot]
b7fe163de5 fix: SO ordered qty on PO item removal (#38378)
* fix: SO ordered qty on PO item removal (#38378)

* fix: update ordered_qty for SO when PO items removed

* refactor: use cached value

---------

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

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.py

* chore: resolve conflicts

---------

Co-authored-by: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com>
2023-12-04 09:35:51 +05:30
ruthra kumar
8c9f4c8700 Merge pull request #38527 from frappe/mergify/bp/version-14-hotfix/pr-38525
fix: multiple minor fixes in report and Exchange Rate Revaluation (backport #38525)
2023-12-03 17:04:10 +05:30
ruthra kumar
419943a9d9 fix: remove hardcoded, implicit rounding loss allowance
(cherry picked from commit 64266c4d38)
2023-12-03 11:14:13 +00:00
ruthra kumar
eee9062814 fix: item group filter in sales person wise report
(cherry picked from commit f4d418ea6d)
2023-12-03 11:14:12 +00:00
mergify[bot]
6db63c971e fix: better overlap logic for job card (backport #38432) (#38521)
* fix: better overlap logic for job card (#38432)

(cherry picked from commit 74eab91042)

# Conflicts:
#	erpnext/manufacturing/doctype/job_card/job_card.py

* chore: fix conflicts

* chore: fixed existing_time_logs not defined

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-03 15:15:30 +05:30
mergify[bot]
b88c7d63de fix: don't update previous doc on rate change (backport #38493) (#38523)
fix: don't update previous doc on rate change

(cherry picked from commit 68f5dd3e7b)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-03 14:02:59 +05:30
mergify[bot]
9345334196 fix: don't consider cancelled entries (#38401)
* fix: don't consider cancelled entries

(cherry picked from commit adfcdb3b65)

* refactor: get outstanding journal entry using query builder

(cherry picked from commit ff27cccff4)

---------

Co-authored-by: Devin Slauenwhite <devin.slauenwhite@gmail.com>
2023-12-02 20:06:48 +05:30
Deepesh Garg
ae285f3417 Merge pull request #38422 from frappe/mergify/bp/version-14-hotfix/pr-38250
fix: unset discount amount based on coupon code (#38250)
2023-12-02 19:42:24 +05:30
mergify[bot]
b813964ee3 chore: changed sort_order to DESC for customer (backport #38498) (#38500)
chore: changed sort_order to DESC for customer (#38498)

(cherry picked from commit 6bc40373f2)

Co-authored-by: Sherin KR <sherinkrply@gmail.com>
2023-12-01 19:09:20 +05:30
ruthra kumar
3f311fcc1e Merge pull request #38485 from frappe/mergify/bp/version-14-hotfix/pr-38440
fix(pe): show split alert only on splitting (backport #38440)
2023-12-01 13:25:47 +05:30
Dany Robert
8d6d74c237 fix(pe): show split alert only on splitting
(cherry picked from commit 96b13c59c1)
2023-12-01 07:10:29 +00:00
mergify[bot]
0df52d2c4f fix: show item name as title instead of item group in BOM (backport #38478) (#38480)
fix: show item name as title instead of item group in BOM (#38478)

Item fields in BOM used to show Item Group when Items were set to show title as link fields. Now they show Item Name instead

(cherry picked from commit 3a66aefd2c)

Co-authored-by: Gughan Ravikumar <gughanrk@gmail.com>
2023-12-01 11:32:49 +05:30
mergify[bot]
497049b3fd fix: incorrect requested quantity for the subcontracting order (backport #38455) (#38471)
* fix: incorrect requested quantity for the subcontracting order

(cherry picked from commit 691e3bb24f)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.py
#	erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order.py
#	erpnext/subcontracting/doctype/subcontracting_order_item/subcontracting_order_item.json
#	erpnext/subcontracting/doctype/subcontracting_order_service_item/subcontracting_order_service_item.json

* chore: fix conflicts

* chore: fix conflicts

* chore: fix conflicts

* chore: fix conflicts

---------

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
2023-11-30 20:53:52 +05:30
mergify[bot]
bec7fb5493 fix(ux): make valuation field read only when it can't be modified (backport #38450) (#38463)
* fix(ux): make `basic_rate` field read-only based on purpose

(cherry picked from commit abc7d30024)

* fix(ux): make PR `rate` field read-only having PO ref

(cherry picked from commit ae294ee470)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json

* fix(ux): make PI `rate` field read-only having PR ref

(cherry picked from commit 3d4156cc7d)

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-11-30 17:32:58 +05:30
Frappe PR Bot
7b6f25cb9e chore(release): Bumped to Version 14.52.1
## [14.52.1](https://github.com/frappe/erpnext/compare/v14.52.0...v14.52.1) (2023-11-30)

### Bug Fixes

* use flt on outstanding on AR/AP summary report ([161b0da](161b0da29a))
2023-11-30 11:36:02 +00:00
ruthra kumar
865288976c Merge pull request #38459 from frappe/mergify/bp/version-14/pr-38457
fix: use flt on outstanding on AR/AP summary report (backport #38457)
2023-11-30 17:04:42 +05:30
ruthra kumar
00347cdc8e Merge pull request #38460 from frappe/mergify/bp/version-14-hotfix/pr-38457
refactor: use flt on outstanding on AR/AP summary report (backport #38457)
2023-11-30 16:52:15 +05:30
ruthra kumar
161b0da29a fix: use flt on outstanding on AR/AP summary report
(cherry picked from commit e4bdd3a28d)
2023-11-30 16:43:58 +05:30
ruthra kumar
b7556f9b30 refactor: use flt on outstanding on AR/AP summary report
(cherry picked from commit e4bdd3a28d)
2023-11-30 16:28:13 +05:30
Gursheen Kaur Anand
2b570ed68c Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-38250 2023-11-30 14:15:12 +05:30
ruthra kumar
d82a123cf8 Merge pull request #38447 from frappe/mergify/bp/version-14-hotfix/pr-38446
refactor: pass on filter to up front outstanding query as well (backport #38446)
2023-11-30 13:18:43 +05:30
ruthra kumar
e8ea6022f0 refactor: pass on filter to upfront outstanding query as well
(cherry picked from commit cfd3230c75)
2023-11-30 07:26:29 +00:00
mergify[bot]
2908d966b6 fix: exploded items in Subcontracting Receipt (backport #38441) (#38444)
* fix: exploded items in Subcontracting Receipt

(cherry picked from commit 62b4a263f8)

# Conflicts:
#	erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-11-30 12:15:52 +05:30
mergify[bot]
2dc4b02fc8 fix: use docstatus instead of status (backport #38439) (#38442)
fix: use `docstatus` instead of `status`

(cherry picked from commit 1423b38d50)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-11-30 12:11:53 +05:30
Deepesh Garg
f9f65a53fb Merge pull request #38430 from frappe/mergify/bp/version-14-hotfix/pr-38429
fix(minor): set capital WIP account before asset tests (#38429)
2023-11-30 08:14:58 +05:30
Gursheen Anand
ecde1d58b5 fix: set cwip account before asset tests
(cherry picked from commit ef8e4191cd)
2023-11-29 13:21:46 +00:00
Gursheen Anand
7fa97fa7b5 fix: unset discount amount based on coupon code
(cherry picked from commit 6518582ed3)

# Conflicts:
#	erpnext/public/js/utils/sales_common.js
2023-11-29 10:25:18 +00:00
rohitwaghchaure
72db68dd39 Merge pull request #38410 from frappe/mergify/bp/version-14-hotfix/pr-38165
fix: make create button translatable (backport #38165)
2023-11-29 13:04:34 +05:30
rohitwaghchaure
d0224cecac Merge pull request #38418 from frappe/mergify/bp/version-14-hotfix/pr-38415
fix: incorrect ordered qty for Subcontracting Order (backport #38415)
2023-11-29 13:03:04 +05:30
mergify[bot]
49296cd5cb fix: OperationalError while selecting Serial No in Warranty Claim (backport #38394) (#38413)
* refactor: use arrow function

(cherry picked from commit 1763824e5f)

* refactor: use DocType `Fetch From` instead of `frm.add_fetch`

(cherry picked from commit 01044ca8e9)

# Conflicts:
#	erpnext/support/doctype/warranty_claim/warranty_claim.json

* refactor: use `frm.set_query` to add filters

(cherry picked from commit 640dfab827)

* refactor: don't use `cur_frm`

(cherry picked from commit 9fadf5f426)

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-11-29 12:27:03 +05:30
s-aga-r
55e4951445 chore: conflicts 2023-11-29 12:25:16 +05:30
rohitwaghchaure
8e370876cc fix: incorrect ordered qty for Subcontracting Order (#38415)
(cherry picked from commit fddf341f44)

# Conflicts:
#	erpnext/controllers/tests/test_subcontracting_controller.py
2023-11-29 06:52:34 +00:00
Patrick Eissler
c71b31e3b8 fix: make create button translatable (#38165)
* fix: make all create buttons translatable

* style: use double quotes

---------

Co-authored-by: PatrickDenis-stack <77415730+PatrickDenis-stack@users.noreply.github.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
(cherry picked from commit 8e4b591ea2)
2023-11-29 04:53:26 +00:00
Deepesh Garg
44b11750d3 chore: v14 patch release (#38408)
* feat: shift depreciation for assets [v14] [backport of #38327] (#38404)

feat: shift depreciation for assets

* fix: no fstring in translation (#38381)

fix: no fstring in translation (#38381)

(cherry picked from commit 8f00481c5f)

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

* fix: debit credit mismatch in multi-currecy asset purchase receipt (#38342)

fix: debit credit mismatch in multi-currecy asset purchase receipt (#38342)

* fix: Debit credit mimatch in multicurrecy asset purchase receipt

* test: multi currency purchase receipt

* chore: update init files

* test: roolback

(cherry picked from commit add238c892)

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

* fix(regional): use net figures for sales calc (#38260)

fix(regional): use net figures for sales calc (#38260)

(cherry picked from commit 663bb8726c)

Co-authored-by: Dany Robert <danyrt@wahni.com>

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Dany Robert <danyrt@wahni.com>
2023-11-29 10:20:53 +05:30
mergify[bot]
d337533907 fix(regional): use net figures for sales calc (#38260)
fix(regional): use net figures for sales calc (#38260)

(cherry picked from commit 663bb8726c)

Co-authored-by: Dany Robert <danyrt@wahni.com>
2023-11-29 09:09:08 +05:30
mergify[bot]
fd6a23cf41 fix: debit credit mismatch in multi-currecy asset purchase receipt (#38342)
fix: debit credit mismatch in multi-currecy asset purchase receipt (#38342)

* fix: Debit credit mimatch in multicurrecy asset purchase receipt

* test: multi currency purchase receipt

* chore: update init files

* test: roolback

(cherry picked from commit add238c892)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-11-29 09:07:42 +05:30
mergify[bot]
cec25740ea fix: no fstring in translation (#38381)
fix: no fstring in translation (#38381)

(cherry picked from commit 8f00481c5f)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-11-29 09:06:04 +05:30
Frappe PR Bot
9170ffc371 chore(release): Bumped to Version 14.52.0
# [14.52.0](https://github.com/frappe/erpnext/compare/v14.51.0...v14.52.0) (2023-11-29)

### Features

* shift depreciation for assets [v14] [backport of [#38327](https://github.com/frappe/erpnext/issues/38327)] ([#38404](https://github.com/frappe/erpnext/issues/38404)) ([53d083a](53d083a121))
2023-11-29 00:48:28 +00:00
Anand Baburajan
6c805fff15 Merge pull request #38405 from frappe/mergify/bp/version-14/pr-38404
feat: shift depreciation for assets [v14] [backport of #38327] (backport #38404)
2023-11-29 06:16:47 +05:30
Anand Baburajan
53d083a121 feat: shift depreciation for assets [v14] [backport of #38327] (#38404)
feat: shift depreciation for assets
(cherry picked from commit d8c3935e64)
2023-11-29 00:46:14 +00:00
Anand Baburajan
d8c3935e64 feat: shift depreciation for assets [v14] [backport of #38327] (#38404)
feat: shift depreciation for assets
2023-11-29 06:15:22 +05:30
Frappe PR Bot
47d37aa628 chore(release): Bumped to Version 14.51.0
# [14.51.0](https://github.com/frappe/erpnext/compare/v14.50.0...v14.51.0) (2023-11-28)

### Bug Fixes

* Alert message and make sure invoice due dates are different for effective test ([0813f02](0813f02ca5))
* allow on submit for child table fields ([d72fbe9](d72fbe9125))
* annual income and expenses in digest ([7dce68b](7dce68bdcc))
* check reposting settings before allowing editable si ([f777d24](f777d24679))
* condition in other bundle utils ([e96ef73](e96ef7338e))
* create contact if existing customer doesn't have contact ([bb2aa90](bb2aa904b2))
* do not set repost flag without validating voucher ([3ad6d08](3ad6d0890a))
* filter bundle items based on disabled check ([8a3a068](8a3a0688ba))
* fiscal year using future date ([b0aa4ef](b0aa4efd3d))
* has_product_bundle util to only check for enabled bundles ([fd19ac5](fd19ac55e3))
* job card overlap validation (backport [#38345](https://github.com/frappe/erpnext/issues/38345)) ([#38347](https://github.com/frappe/erpnext/issues/38347)) ([9cf8955](9cf8955d24))
* Merge conflicts ([e7183e3](e7183e3ea9))
* Negative Qty and Rates in SO/PO ([#38253](https://github.com/frappe/erpnext/issues/38253)) ([50f3b01](50f3b01eb7))
* Payment Reco Issue and chart of account importer ([730a3bb](730a3bb7ce))
* Re-add no.of rows split in alert message ([fb19e7f](fb19e7f15e))
* **regional:** item wise tax calc issue ([0448d56](0448d56a4f))
* Server Error while creating Product Bundle (backport [#38377](https://github.com/frappe/erpnext/issues/38377)) ([#38379](https://github.com/frappe/erpnext/issues/38379)) ([ca6a788](ca6a78882c))
* skip disabled bundles for non-report utils ([445e9c9](445e9c9041))
* skip fixed assets in parent ([5dcd806](5dcd806176))
* stock availability not showing ([#38382](https://github.com/frappe/erpnext/issues/38382)) ([3929cc3](3929cc30ca))
* validation for existing bundles ([ae960e7](ae960e735a))

### Features

* add disabled field in product bundle ([8d5efc9](8d5efc901d))
* new Report "Lost Quotations" ([#38309](https://github.com/frappe/erpnext/issues/38309)) ([1773e31](1773e31499))
2023-11-28 16:24:55 +00:00
rohitwaghchaure
6260241c55 Merge pull request #38384 from frappe/version-14-hotfix
chore: release v14
2023-11-28 21:53:33 +05:30
Shariq Ansari
6871331ff3 Merge pull request #38399 from frappe/mergify/bp/version-14-hotfix/pr-38398
fix(CRM): create contact if existing customer doesn't have contact (backport #38398)
2023-11-28 20:45:08 +05:30
Shariq Ansari
bb2aa904b2 fix: create contact if existing customer doesn't have contact
(cherry picked from commit 23b0b8ba36)
2023-11-28 14:19:59 +00:00
mergify[bot]
e490bd7785 refactor(Translations): prisoner exchange with HRMS (backport #37376) (#37403)
* refactor: migrate translations to HRMS

* chore: resolve conflicts

* style: remove whitespace

To make the linter happy

---------

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
2023-11-28 17:50:28 +05:30
mergify[bot]
ca6a78882c fix: Server Error while creating Product Bundle (backport #38377) (#38379)
* fix: product bundle search input

(cherry picked from commit 729fc738af)

* fix: don't select all fields

(cherry picked from commit 8c3713b649)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-11-28 15:26:36 +05:30
Raffael Meyer
321ac4c5f0 style: remove whitespace (#38388)
To make the linter happy
2023-11-28 15:22:35 +05:30
rohitwaghchaure
3929cc30ca fix: stock availability not showing (#38382)
fix: stock availability now showing
2023-11-28 15:16:35 +05:30
mergify[bot]
25f67923ea chore: fix flaky test case (backport #38369) (#38372)
chore: fix flaky test case (#38369)

(cherry picked from commit ad3634be7c)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-11-28 08:36:46 +05:30
ruthra kumar
5dc7faba0c Merge pull request #38358 from frappe/mergify/bp/version-14-hotfix/pr-38354
refactor: handle rounding loss on AR/AP reports (backport #38354)
2023-11-27 12:16:27 +05:30
ruthra kumar
2aa9171027 refactor: handle rounding loss on AR/AP reports
(cherry picked from commit 592ce45da7)
2023-11-27 06:22:44 +00:00
mergify[bot]
730a3bb7ce fix: Payment Reco Issue and chart of account importer
fix: Payment Reco Issue and chart of account importer
2023-11-27 10:30:46 +05:30
ruthra kumar
e9a2b002d8 Merge pull request #38355 from frappe/mergify/bp/version-14-hotfix/pr-38081
fix: check reposting ledger settings before setting repost flag (backport #38081)
2023-11-27 09:28:59 +05:30
ruthra kumar
faf025454f chore: resolve conflict 2023-11-27 09:08:23 +05:30
Marica
50f3b01eb7 fix: Negative Qty and Rates in SO/PO (#38253)
* fix: Don't allow negative qty in SO/PO

* fix: Type casting for safe comparisons

* fix: Grammar in error message

* fix: Negative rates should be allowed via Update Items in SO/PO

* fix: Use `non_negative` property in docfield & emove code validation
2023-11-27 09:06:27 +05:30
Gursheen Anand
f777d24679 fix: check reposting settings before allowing editable si
(cherry picked from commit 894ae1fe0f)
2023-11-27 03:35:38 +00:00
Gursheen Anand
d72fbe9125 fix: allow on submit for child table fields
(cherry picked from commit 5fae2f6d57)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
2023-11-27 03:35:37 +00:00
Gursheen Anand
3ad6d0890a fix: do not set repost flag without validating voucher
(cherry picked from commit ad5edbb1de)
2023-11-27 03:35:37 +00:00
Gursheen Anand
776c884403 refactor: validate reposting settings for editables inv
(cherry picked from commit 780b827adc)
2023-11-27 03:35:37 +00:00
mergify[bot]
a4b5fc8100 refactor: bank transaction (#38182)
refactor: bank transaction (#38182)

(cherry picked from commit 5426b93387)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-11-26 18:58:04 +05:30
Deepesh Garg
b0547b5619 Merge pull request #38074 from frappe/mergify/bp/version-14-hotfix/pr-37859
fix: `split_invoices_based_on_payment_terms` (#37859)
2023-11-26 18:15:11 +05:30
mergify[bot]
9cf8955d24 fix: job card overlap validation (backport #38345) (#38347)
* fix: job card overlap validation (#38345)

(cherry picked from commit d8245cef72)

# Conflicts:
#	erpnext/manufacturing/doctype/job_card/job_card.py

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-11-26 17:44:02 +05:30
Deepesh Garg
f7c820ffad Merge pull request #38331 from frappe/mergify/bp/version-14-hotfix/pr-38309
feat: new Report "Lost Quotations" (#38309)
2023-11-25 17:36:27 +05:30
Raffael Meyer
1773e31499 feat: new Report "Lost Quotations" (#38309)
(cherry picked from commit 477d9fa87e)
2023-11-24 21:27:50 +00:00
Deepesh Garg
466d0849e8 Merge pull request #38313 from frappe/mergify/bp/version-14-hotfix/pr-36797
fix(regional): item wise tax calc issue (#36797)
2023-11-24 16:31:03 +05:30
Deepesh Garg
28b6afcb10 Merge pull request #38315 from frappe/mergify/bp/version-14-hotfix/pr-38269
fix: skip fixed assets in product bundle (#38269)
2023-11-24 16:30:05 +05:30
Deepesh Garg
bdde30a456 Merge pull request #38324 from frappe/mergify/bp/version-14-hotfix/pr-38273
fix: annual income and expenses in email digest (#38273)
2023-11-24 16:29:16 +05:30
Gursheen Kaur Anand
aea169d4d4 chore: resolve conflicts 2023-11-24 15:30:19 +05:30
Gursheen Anand
b0aa4efd3d fix: fiscal year using future date
(cherry picked from commit 728cc9f725)
2023-11-24 09:51:29 +00:00
Gursheen Anand
7dce68bdcc fix: annual income and expenses in digest
(cherry picked from commit 52305e3000)

# Conflicts:
#	erpnext/accounts/utils.py
2023-11-24 09:51:29 +00:00
Frappe PR Bot
436ba6f244 chore(release): Bumped to Version 14.50.0
# [14.50.0](https://github.com/frappe/erpnext/compare/v14.49.0...v14.50.0) (2023-11-24)

### Bug Fixes

* don't depreciate non-depreciable assets on scrapping [v14] ([#38294](https://github.com/frappe/erpnext/issues/38294)) ([5261aba](5261aba81f))
* partial cancel of gle and ple (backport [#35609](https://github.com/frappe/erpnext/issues/35609)) ([80bc235](80bc235d6e))
* patch - Duplicate entry quality inspection parameter (backport [#38262](https://github.com/frappe/erpnext/issues/38262)) ([#38263](https://github.com/frappe/erpnext/issues/38263)) ([756f08b](756f08b9ba))
* Supplier `Primary Contact` (backport [#38268](https://github.com/frappe/erpnext/issues/38268)) ([#38285](https://github.com/frappe/erpnext/issues/38285)) ([f170cb9](f170cb9214))

### Features

* add Bank Transaction to connections in Journal and Payment Entry ([#38297](https://github.com/frappe/erpnext/issues/38297)) ([06c6da5](06c6da5c0d))

### Performance Improvements

* optimize total_purchase_cost update ([a88d322](a88d322e4f))
2023-11-24 08:47:31 +00:00
ruthra kumar
79ded4bf19 Merge pull request #38320 from ruthra-kumar/version-14
chore: release v14
2023-11-24 14:16:16 +05:30
ruthra kumar
5af23e760c Merge branch 'version-14-hotfix' into version-14 2023-11-24 13:26:25 +05:30
ruthra kumar
7601861f21 Merge pull request #38318 from frappe/mergify/bp/version-14-hotfix/pr-38298
perf: optimize update_purchase_cost method  (backport #38298)
2023-11-24 12:20:57 +05:30
ruthra kumar
1d1af26f7a chore: resolve conflict 2023-11-24 11:54:55 +05:30
ruthra kumar
47093bebd3 refactor: update project costing based on frequency
(cherry picked from commit dd016e6ced)
2023-11-24 06:20:04 +00:00
ruthra kumar
205d971253 refactor: make update_project_cost optional through Buying Settings
(cherry picked from commit 0fe6dcd742)
2023-11-24 06:20:04 +00:00
ruthra kumar
49a787b1a8 refactor: provide UI button to recalculate when needed
(cherry picked from commit bcbe6c4a53)

# Conflicts:
#	erpnext/projects/doctype/project/project.py
2023-11-24 06:20:04 +00:00
ruthra kumar
a88d322e4f perf: optimize total_purchase_cost update
(cherry picked from commit aa17110bde)
2023-11-24 06:20:02 +00:00
Deepesh Garg
dfdaad0111 Merge pull request #38300 from frappe/mergify/bp/version-14-hotfix/pr-38297
feat: add Bank Transaction to connections in Journal and Payment Entry (#38297)
2023-11-24 10:06:59 +05:30
ruthra kumar
d80e8c6b15 Merge pull request #38311 from frappe/mergify/bp/version-14-hotfix/pr-38296
chore: index to speed up basic submit/cancel functions on purchase invoice (backport #38296)
2023-11-24 10:04:59 +05:30
Gursheen Anand
d7d5317b0e chore: linting issues
(cherry picked from commit 1657337887)
2023-11-24 04:30:38 +00:00
Gursheen Anand
445e9c9041 fix: skip disabled bundles for non-report utils
(cherry picked from commit 362f377f61)
2023-11-24 04:30:38 +00:00
Gursheen Anand
e96ef7338e fix: condition in other bundle utils
(cherry picked from commit 8bdb61cb87)
2023-11-24 04:30:38 +00:00
Gursheen Anand
ae960e735a fix: validation for existing bundles
(cherry picked from commit 67f43d37df)
2023-11-24 04:30:38 +00:00
Gursheen Anand
fd19ac55e3 fix: has_product_bundle util to only check for enabled bundles
(cherry picked from commit 3543f86c63)
2023-11-24 04:30:38 +00:00
Gursheen Anand
8a3a0688ba fix: filter bundle items based on disabled check
(cherry picked from commit 874774fe6c)
2023-11-24 04:30:37 +00:00
Gursheen Anand
8d5efc901d feat: add disabled field in product bundle
(cherry picked from commit ee76af7681)
2023-11-24 04:30:37 +00:00
Gursheen Anand
5dcd806176 fix: skip fixed assets in parent
(cherry picked from commit f9713eeb56)
2023-11-24 04:30:36 +00:00
Dany Robert
0448d56a4f fix(regional): item wise tax calc issue
(cherry picked from commit 89ddf3272e)
2023-11-24 04:28:23 +00:00
ruthra kumar
f74132b0be chore: speed up Purchase Invoice cancellation
(cherry picked from commit 1efff268b0)
2023-11-24 04:16:22 +00:00
ruthra kumar
6353deacf0 chore: index to speed up queries on JE child table reference
(cherry picked from commit 24fcd67f8b)
2023-11-24 04:16:21 +00:00
mergify[bot]
756f08b9ba fix: patch - Duplicate entry quality inspection parameter (backport #38262) (#38263)
fix: patch - Duplicate entry quality inspection parameter (#38262)

(cherry picked from commit 0ca7527f7a)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-11-23 22:39:14 +05:30
Raffael Meyer
2293696ab4 chore: resolve conflicts 2023-11-23 15:10:29 +01:00
Raffael Meyer
06c6da5c0d feat: add Bank Transaction to connections in Journal and Payment Entry (#38297)
* feat(Payment Entry): Bank Transaction connection

* feat(Journal Entry): Bank Transaction connection

(cherry picked from commit 3be345e605)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.json
2023-11-23 13:03:38 +00:00
Anand Baburajan
5261aba81f fix: don't depreciate non-depreciable assets on scrapping [v14] (#38294)
fix: don't depreciate non-depreciable assets on scrapping
2023-11-23 14:15:40 +05:30
mergify[bot]
f170cb9214 fix: Supplier Primary Contact (backport #38268) (#38285)
fix: Supplier `Primary Contact`

(cherry picked from commit 627165dc7c)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-11-23 11:45:57 +05:30
ruthra kumar
8055773425 Merge pull request #38281 from frappe/mergify/bp/version-14-hotfix/pr-38258
refactor: rename 'Unreconcile Payments' doctype to singular 'Unreconcile Payment' (backport #38258)
2023-11-23 11:09:11 +05:30
ruthra kumar
82fa58d4e3 chore: update new unreconcile doctype name in JS and PY files
(cherry picked from commit 74f9e34182)
2023-11-23 05:09:23 +00:00
ruthra kumar
57c6d616e6 chore: rename 'unreconcile payments' to 'unreconcile payment'
(cherry picked from commit 9006c9b747)
2023-11-23 05:09:23 +00:00
ruthra kumar
639512a7c2 Merge pull request #38279 from frappe/mergify/bp/version-14-hotfix/pr-38257
refactor: optmize outstanding amount query (backport #38257)
2023-11-23 10:16:11 +05:30
ruthra kumar
ac13e7362c refactor: optimize outstanding vouchers query
(cherry picked from commit 8b04c1d4f6)
2023-11-23 04:12:42 +00:00
Marica
1e7dfd3071 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-37859 2023-11-22 20:51:30 +05:30
marination
e7183e3ea9 fix: Merge conflicts 2023-11-22 16:16:37 +01:00
ruthra kumar
c4e57040b7 Merge pull request #38205 from vorasmit/partial-cancel
fix: partial cancel of gle and ple (backport #35609)
2023-11-22 10:27:05 +05:30
Smit Vora
c1a7d614a2 test: partial cancel for gl entries reversal 2023-11-22 10:07:38 +05:30
Frappe PR Bot
7392f9c662 chore(release): Bumped to Version 14.49.0
# [14.49.0](https://github.com/frappe/erpnext/compare/v14.48.1...v14.49.0) (2023-11-22)

### Bug Fixes

* add revaluation journal filter in Payable report ([d0698b3](d0698b32bb))
* attributes were mandatory for manufacturers ([430980a](430980a836))
* duplicate field in `Closing Stock Balance` ([#38105](https://github.com/frappe/erpnext/issues/38105)) ([1f16c47](1f16c47a2c))
* incorrect incoming rate for serial and batch items in standalone debit note ([#38121](https://github.com/frappe/erpnext/issues/38121)) ([9a34518](9a34518e54))
* pass check permission in render_address ([1ccd5e4](1ccd5e4ff5))
* payment entry rounding error ([49735bc](49735bc120))
* remove ESS role when not mapped to employee (backport [#37867](https://github.com/frappe/erpnext/issues/37867)) ([#38132](https://github.com/frappe/erpnext/issues/38132)) ([bc01007](bc01007c16))
* round `unreconciled_amount` before asserting ([392ee2e](392ee2e0fd))
* set asset's valuation_rate according to asset quantity (backport [#38254](https://github.com/frappe/erpnext/issues/38254)) ([#38255](https://github.com/frappe/erpnext/issues/38255)) ([00def82](00def82843))
* set default asset quantity as 1 [v14] ([#38224](https://github.com/frappe/erpnext/issues/38224)) ([3daf6f8](3daf6f822a))
* show party values when naming by is not naming series ([dd76695](dd76695d3a))
* Supplier Quotation fields ([#37963](https://github.com/frappe/erpnext/issues/37963)) ([883eaee](883eaee014))
* test case for rounded total with cash disc ([9b5185a](9b5185adc9))
* **Timesheet:** reset billing hours equal to hours if they exceed actual hours (backport [#38134](https://github.com/frappe/erpnext/issues/38134)) ([#38152](https://github.com/frappe/erpnext/issues/38152)) ([c7c751e](c7c751ecd0))
* **Timesheet:** warn user if billing hours > actual hours instead of resetting  (backport [#38239](https://github.com/frappe/erpnext/issues/38239)) ([#38240](https://github.com/frappe/erpnext/issues/38240)) ([e08f114](e08f1145c9))
* update modified timestamp ([2849e0d](2849e0daed))
* valuation rate in report Item Prices ([#38161](https://github.com/frappe/erpnext/issues/38161)) ([a70696e](a70696ea77))
* wrong round off and rounded total ([296433a](296433a1dd))

### Features

* add `Supplier Delivery Note` field in SCR (backport [#38127](https://github.com/frappe/erpnext/issues/38127)) ([#38155](https://github.com/frappe/erpnext/issues/38155)) ([8d4a19c](8d4a19cecf))
* Add accounting dimensions to Supplier Quotation ([51e33e1](51e33e1556))
* virtual parent doctype ([8dbf2ce](8dbf2ced79))
2023-11-22 04:16:31 +00:00
Deepesh Garg
aa6ef76043 Merge pull request #38247 from frappe/version-14-hotfix
chore: release v14
2023-11-22 09:43:45 +05:30
Deepesh Garg
f6f5ff0be9 Merge branch 'version-14' into version-14-hotfix 2023-11-22 00:28:38 +05:30
mergify[bot]
00def82843 fix: set asset's valuation_rate according to asset quantity (backport #38254) (#38255)
fix: set asset's valuation_rate according to asset quantity (#38254)

(cherry picked from commit e2bb4e2baa)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-11-21 22:53:31 +05:30
mergify[bot]
e08f1145c9 fix(Timesheet): warn user if billing hours > actual hours instead of resetting (backport #38239) (#38240)
fix(Timesheet): warn user if billing hours > actual hours instead of resetting  (#38239)

* revert: "fix(Timesheet): reset billing hours equal to hours if they exceed actual hours"

This reverts commit 0ec8034507.

* fix: warn user if billing hours > actual hours

(cherry picked from commit ac91030b31)

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2023-11-21 13:41:08 +05:30
ruthra kumar
ddf82cf433 Merge pull request #38235 from frappe/mergify/bp/version-14-hotfix/pr-38234
test: prevent rounding loss based validation error (backport #38234)
2023-11-21 12:30:34 +05:30
ruthra kumar
59a5e132fe test: prevent rounding loss based validation error
(cherry picked from commit 56e991b7f4)
2023-11-21 06:41:36 +00:00
ruthra kumar
7fc7105c48 Merge pull request #38217 from rtdany10/payment-reco-rounding-issue
fix: round `unreconciled_amount` before asserting
2023-11-21 11:33:42 +05:30
Anand Baburajan
3daf6f822a fix: set default asset quantity as 1 [v14] (#38224)
fix: set default asset quantity as 1
2023-11-20 22:27:25 +05:30
ruthra kumar
d7278477d6 Merge pull request #38213 from frappe/mergify/bp/version-14-hotfix/pr-38210
refactor: extend billed amount update flag to POS Invoice as well (backport #38210)
2023-11-20 15:02:44 +05:30
ruthra kumar
d0571530eb Merge pull request #38215 from frappe/mergify/bp/version-14-hotfix/pr-38212
refactor: update scheduled job for bulk transaction (backport #38212)
2023-11-20 14:49:10 +05:30
Dany Robert
392ee2e0fd fix: round unreconciled_amount before asserting 2023-11-20 14:36:58 +05:30
ruthra kumar
562a55122b refactor: update scheduled job for bulk transaction
(cherry picked from commit fb06ad7330)
2023-11-20 08:51:08 +00:00
ruthra kumar
b226adeb2f Merge pull request #38150 from frappe/mergify/bp/version-14-hotfix/pr-38038
refactor: supercharge Bulk actions (backport #38038)
2023-11-20 14:16:27 +05:30
ruthra kumar
12f027b3f4 chore: resolve conflict 2023-11-20 14:15:33 +05:30
ruthra kumar
9f8aa7c59d refactor: add flag to POS Invoice
(cherry picked from commit 83a13e22b7)

# Conflicts:
#	erpnext/accounts/doctype/pos_invoice/pos_invoice.json
2023-11-20 08:36:52 +00:00
ruthra kumar
40f904391e refactor: set default for 'update_billed_amount_in_delivery_note'
(cherry picked from commit ee0c64215d)
2023-11-20 08:36:51 +00:00
ruthra kumar
bfb85527dc Merge pull request #38196 from frappe/mergify/bp/version-14-hotfix/pr-38159
refactor: provision to truncate `remarks` in General Ledger and Accounts Receivable/Payable reports (backport #38159)
2023-11-20 13:30:39 +05:30
ruthra kumar
b868e2bd5b chore: resolve conflicts 2023-11-20 12:33:51 +05:30
Sagar Vora
b7e74b479f Merge pull request #38198 from frappe/mergify/bp/version-14-hotfix/pr-37963
fix: Supplier Quotation fields (backport #37963)
2023-11-20 11:46:25 +05:30
Sagar Vora
7c92ecdc9d chore: resolve conflicts 2023-11-20 11:39:15 +05:30
Smit Vora
80bc235d6e fix: partial cancel of gle and ple (backport #35609) 2023-11-20 10:56:56 +05:30
Vishakh Desai
883eaee014 fix: Supplier Quotation fields (#37963)
(cherry picked from commit c2bda2c705)

# Conflicts:
#	erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
2023-11-20 04:42:39 +00:00
ruthra kumar
ae319760a0 refactor: add substring logic in ar/ap report
(cherry picked from commit a9bf906545)
2023-11-20 04:38:04 +00:00
ruthra kumar
4e2d0aa892 refactor: provision to set remarks length in accounts settings
(cherry picked from commit 97090ff367)

# Conflicts:
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.json
2023-11-20 04:38:04 +00:00
Deepesh Garg
5afb8b59c9 Merge pull request #38190 from frappe/mergify/bp/version-14-hotfix/pr-38171
fix: wrong round off and rounded total (#38171)
2023-11-19 19:44:04 +05:30
Deepesh Garg
8136657dfc Merge pull request #38146 from GursheenK/show-party-values-when-naming-series-unset
fix(minor): show party values when naming by is not naming series
2023-11-19 19:23:57 +05:30
Dany Robert
9b5185adc9 fix: test case for rounded total with cash disc
(cherry picked from commit cc60c328fe)
2023-11-19 13:49:06 +00:00
Dany Robert
296433a1dd fix: wrong round off and rounded total
(cherry picked from commit 3a487bd33a)
2023-11-19 13:49:05 +00:00
Deepesh Garg
5033f189f9 Merge pull request #38172 from frappe/mergify/bp/version-14-hotfix/pr-38142
feat: Add accounting dimensions to Supplier Quotation (#38142)
2023-11-19 19:10:39 +05:30
Deepesh Garg
d85185db2e Merge pull request #38175 from frappe/mergify/bp/version-14-hotfix/pr-38163
fix: attributes were mandatory for manufacturers (#38163)
2023-11-19 19:08:46 +05:30
Deepesh Garg
76b6e0407d Merge pull request #38179 from frappe/mergify/bp/version-14-hotfix/pr-38161
fix: valuation rate in report Item Prices (#38161)
2023-11-19 18:47:40 +05:30
Deepesh Garg
2fdc575441 Merge pull request #38181 from pps190/fix-pe-precision-bp
fix: payment entry rounding error (#38177)
2023-11-19 18:47:01 +05:30
Deepesh Garg
7b9afa43ff chore: resolve conflicts 2023-11-19 18:34:47 +05:30
Devin Slauenwhite
49735bc120 fix: payment entry rounding error 2023-11-18 15:09:44 +00:00
Patrick Eissler
a70696ea77 fix: valuation rate in report Item Prices (#38161)
Co-authored-by: PatrickDenis-stack <77415730+PatrickDenis-stack@users.noreply.github.com>
(cherry picked from commit 32f622ef80)
2023-11-18 14:55:12 +00:00
barredterra
2849e0daed fix: update modified timestamp
Was missing in 434c2a1815
2023-11-18 15:44:36 +01:00
Deepesh Garg
da27c0fb2d chore: resolve conflicts 2023-11-18 20:10:28 +05:30
PatrickDenis-stack
430980a836 fix: attributes were mandatory for manufacturers
(cherry picked from commit 434c2a1815)
2023-11-18 14:38:57 +00:00
Deepesh Garg
51e33e1556 feat: Add accounting dimensions to Supplier Quotation
(cherry picked from commit 089da459f7)

# Conflicts:
#	erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
#	erpnext/patches.txt
2023-11-18 14:11:16 +00:00
mergify[bot]
8d4a19cecf feat: add Supplier Delivery Note field in SCR (backport #38127) (#38155)
* feat: add `Supplier Delivery Note` field in SCR

(cherry picked from commit da80e4dbce)

# Conflicts:
#	erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.json

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-11-18 18:53:55 +05:30
s-aga-r
9a34518e54 fix: incorrect incoming rate for serial and batch items in standalone debit note (#38121) 2023-11-18 18:48:25 +05:30
Sagar Vora
39841f9edd Merge pull request #38168 from frappe/mergify/bp/version-14-hotfix/pr-38167
fix: pass check permission in `render_address` (backport #38167)
2023-11-18 17:39:38 +05:30
Vishakh Desai
1ccd5e4ff5 fix: pass check permission in render_address
(cherry picked from commit 45299fe4b3)
2023-11-18 12:08:24 +00:00
Gursheen Kaur Anand
05d514ca8e Merge branch 'version-14-hotfix' into show-party-values-when-naming-series-unset 2023-11-17 20:36:11 +05:30
mergify[bot]
c7c751ecd0 fix(Timesheet): reset billing hours equal to hours if they exceed actual hours (backport #38134) (#38152)
fix(Timesheet): reset billing hours equal to hours if they exceed actual hours (#38134)

(cherry picked from commit 20c6e9fca2)

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2023-11-17 18:28:10 +05:30
ruthra kumar
fa1f623801 refactor: raise exception on invalid date
(cherry picked from commit a393a6b76c)
2023-11-17 10:56:24 +00:00
ruthra kumar
8dbe753a25 refactor: update traceback on retry
(cherry picked from commit a52a1b49af)
2023-11-17 10:56:24 +00:00
ruthra kumar
a060000b70 refactor: support list view filters
(cherry picked from commit 93295bf25b)
2023-11-17 10:56:24 +00:00
ruthra kumar
b615cfc540 chore: resolve linting issue
(cherry picked from commit 73639db910)
2023-11-17 10:56:24 +00:00
ruthra kumar
32b6eed691 refactor: rollback for retries and UI alerts
(cherry picked from commit c320288690)
2023-11-17 10:56:23 +00:00
ruthra kumar
ad03008a1a refactor: barebones retry functionality
(cherry picked from commit 0aa1636d04)
2023-11-17 10:56:23 +00:00
ruthra kumar
2ec1a2f862 chore: show retried in list view
(cherry picked from commit 194d70f8a0)
2023-11-17 10:56:23 +00:00
ruthra kumar
f5f48f7480 refactor: add basic functionalities
(cherry picked from commit af35590549)
2023-11-17 10:56:23 +00:00
ruthra kumar
8dbf2ced79 feat: virtual parent doctype
(cherry picked from commit a248b13cc3)
2023-11-17 10:56:22 +00:00
ruthra kumar
b951dbfced chore: make from_doctype readonly
(cherry picked from commit b0dfc936a1)
2023-11-17 10:56:22 +00:00
ruthra kumar
863a200989 chore: add indexes
(cherry picked from commit 73090fa130)
2023-11-17 10:56:22 +00:00
ruthra kumar
8dafe103bd chore: add list view filters
(cherry picked from commit ade09bc709)
2023-11-17 10:56:22 +00:00
ruthra kumar
eda9800c93 refactor: simplify logging logic bulk_transaction
(cherry picked from commit ebd74a4e5b)
2023-11-17 10:56:22 +00:00
ruthra kumar
6d983b5f45 chore: rearrange fields
(cherry picked from commit c4f8f3613f)
2023-11-17 10:56:21 +00:00
ruthra kumar
65614497ed chore: convert child to normal table
(cherry picked from commit e5a8ad54e2)
2023-11-17 10:56:21 +00:00
ruthra kumar
785bec98d3 chore: remove 'Bulk Transaction Log' doctype
(cherry picked from commit 815c616f18)
2023-11-17 10:56:21 +00:00
Gursheen Kaur Anand
6b08aa2198 Merge branch 'version-14-hotfix' into show-party-values-when-naming-series-unset 2023-11-17 14:21:52 +05:30
Gursheen Anand
dd76695d3a fix: show party values when naming by is not naming series 2023-11-17 12:50:08 +05:30
Frappe PR Bot
236a064cd3 chore(release): Bumped to Version 14.48.1
## [14.48.1](https://github.com/frappe/erpnext/compare/v14.48.0...v14.48.1) (2023-11-17)

### Bug Fixes

* add revaluation journal filter in Payable report ([4eb37cc](4eb37cce26))
2023-11-17 04:38:02 +00:00
ruthra kumar
dd685e50df Merge pull request #38140 from frappe/mergify/bp/version-14/pr-38119
fix: add revaluation journal filter in Payable report (backport #38119)
2023-11-17 10:06:30 +05:30
ruthra kumar
85853295c4 Merge pull request #38138 from frappe/mergify/bp/version-14-hotfix/pr-38119
fix: add revaluation journal filter in Payable report (backport #38119)
2023-11-17 10:04:51 +05:30
ruthra kumar
4eb37cce26 fix: add revaluation journal filter in Payable report
(cherry picked from commit 134201794a)
2023-11-17 10:03:24 +05:30
ruthra kumar
d0698b32bb fix: add revaluation journal filter in Payable report
(cherry picked from commit 134201794a)
2023-11-17 10:02:13 +05:30
mergify[bot]
bc01007c16 fix: remove ESS role when not mapped to employee (backport #37867) (#38132)
fix: remove ESS role when not mapped to employee (#37867)

* fix: remove ESS role when not mapped to employee

* fix: emp role removal on unlinking

* fix: test case for user employee role mapping

* fix: mapped employee and user on creation

(cherry picked from commit 56b8d1b927)

Co-authored-by: Dany Robert <danyrt@wahni.com>
2023-11-16 20:27:53 +05:30
Anand Baburajan
fb2ca3e172 Merge pull request #38114 from frappe/mergify/bp/version-14/pr-38112
chore: change read only condition of asset quantity field (backport #38111) (backport #38112)
2023-11-15 18:03:01 +05:30
mergify[bot]
7d66cb2195 chore: change read only condition of asset quantity field (backport #38111) (#38112)
chore: change read only condition of asset quantity field (#38111)

chore: change read only condition of asset quantity
(cherry picked from commit 6e0362dee8)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
(cherry picked from commit 58cb4303ee)
2023-11-15 12:32:19 +00:00
mergify[bot]
58cb4303ee chore: change read only condition of asset quantity field (backport #38111) (#38112)
chore: change read only condition of asset quantity field (#38111)

chore: change read only condition of asset quantity
(cherry picked from commit 6e0362dee8)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-11-15 18:01:28 +05:30
Deepesh Garg
56c70d300b Merge pull request #38106 from frappe/mergify/bp/version-14-hotfix/pr-38105
fix: duplicate field (#38105)
2023-11-15 13:29:35 +05:30
Arjun
1f16c47a2c fix: duplicate field in Closing Stock Balance (#38105)
(cherry picked from commit 908b21f7fd)
2023-11-15 07:06:34 +00:00
Anand Baburajan
7b14e9d5f6 Merge pull request #38100 from frappe/mergify/bp/version-14/pr-38098
chore: refetch item images on transaction save (backport #38095) (backport #38098)
2023-11-14 20:15:28 +05:30
mergify[bot]
966adfc081 chore: refetch item images on transaction save (backport #38095) (#38098)
* chore: refetch item images on transaction save (#38095)

chore: re fetch item images on transaction save
(cherry picked from commit e93a19ffb5)

# Conflicts:
#	erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.json
#	erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
#	erpnext/selling/doctype/quotation_item/quotation_item.json

* chore: fix conflict in pos_invoice_item.json

* chore: fix conflict in sales_invoice_item.json

* chore: fix conflict in quotation_item.json

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
(cherry picked from commit d1a8202624)
2023-11-14 14:43:12 +00:00
mergify[bot]
d1a8202624 chore: refetch item images on transaction save (backport #38095) (#38098)
* chore: refetch item images on transaction save (#38095)

chore: re fetch item images on transaction save
(cherry picked from commit e93a19ffb5)

# Conflicts:
#	erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.json
#	erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
#	erpnext/selling/doctype/quotation_item/quotation_item.json

* chore: fix conflict in pos_invoice_item.json

* chore: fix conflict in sales_invoice_item.json

* chore: fix conflict in quotation_item.json

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-11-14 20:11:23 +05:30
Frappe PR Bot
7a2df24129 chore(release): Bumped to Version 14.48.0
# [14.48.0](https://github.com/frappe/erpnext/compare/v14.47.4...v14.48.0) (2023-11-14)

### Bug Fixes

* asset depreciation ledger (backport [#37991](https://github.com/frappe/erpnext/issues/37991)) ([#37992](https://github.com/frappe/erpnext/issues/37992)) ([043dc1b](043dc1b14b))
* close `Credit Limit Crossed` dialog (backport [#38052](https://github.com/frappe/erpnext/issues/38052)) ([#38058](https://github.com/frappe/erpnext/issues/38058)) ([6979c3e](6979c3e490))
* COA Importer app related issues ([#37238](https://github.com/frappe/erpnext/issues/37238)) ([57ce73d](57ce73d540))
* german translations of Accounts Settings ([b75aae9](b75aae99ca))
* indentation issue in the Production Plan Summary report (backport [#38019](https://github.com/frappe/erpnext/issues/38019)) ([#38068](https://github.com/frappe/erpnext/issues/38068)) ([c552884](c5528844fd))
* make adjustment entry using stock reconciliation (backport [#37995](https://github.com/frappe/erpnext/issues/37995)) ([#38008](https://github.com/frappe/erpnext/issues/38008)) ([984703c](984703c3c9))
* make item field read-only in batch (backport [#38010](https://github.com/frappe/erpnext/issues/38010)) ([#38033](https://github.com/frappe/erpnext/issues/38033)) ([424ebd1](424ebd154a))
* minor change added to test_case ([6b34568](6b34568128))
* minor issue ([0eab723](0eab723243))
* new logic for handling revaluation journals ([9c0d80c](9c0d80cef4))
* pick serial nos from selected batch only ([#37988](https://github.com/frappe/erpnext/issues/37988)) ([db29180](db29180eec))
* sales order not assigned to territory orders ([#37905](https://github.com/frappe/erpnext/issues/37905)) ([#38024](https://github.com/frappe/erpnext/issues/38024)) ([620f4f2](620f4f2c10))
* Set right party name in bank transaction ([21b430a](21b430a575))
* **translations:** suggestions from review ([4d2169e](4d2169e48e))
* Use `process.extract` to get the corresponding party doc name of the result ([b0a184e](b0a184e937))

### Features

* **accounts_receivable:** test_case added for multi-select customer group ([cf0d936](cf0d936195))
* multi-select customer group in AR Report ([935286f](935286ff94))
2023-11-14 12:57:28 +00:00
Deepesh Garg
ecb116aa99 Merge pull request #38086 from frappe/version-14-hotfix
chore: release v14
2023-11-14 18:25:20 +05:30
mergify[bot]
8446e87cc2 chore: delete comments and unlink attachments on company transactions deletion (backport #38077) (#38078)
* chore: delete comments and unlink attachments on company transactions deletion

(cherry picked from commit 2f9e96e324)

* fix: unrelated transation date typo

(cherry picked from commit b097bb20d9)

---------

Co-authored-by: anandbaburajan <anandbaburajan@gmail.com>
2023-11-13 19:20:52 +05:30
marination
fb19e7f15e fix: Re-add no.of rows split in alert message
(cherry picked from commit 1fc5844025)
2023-11-13 10:46:39 +00:00
marination
c840f30a20 style: Remove spaces introduced via merge conflict
(cherry picked from commit 4b4b176fcf)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/test_payment_entry.py
2023-11-13 10:46:39 +00:00
marination
0813f02ca5 fix: Alert message and make sure invoice due dates are different for effective test
- Make invoice due dates are different so that the invoice with the earliest due date is allocated first in the test
- Translate voucher type, simplify alert message. The invoice could be "split" into 1 row, no. of rows in the message seems unnecessary.

(cherry picked from commit 56ac3424d2)
2023-11-13 10:46:38 +00:00
marination
a7e2867526 test: get_outstanding_reference_documents (triggered via UI)
(cherry picked from commit 162c0497d1)
2023-11-13 10:46:38 +00:00
marination
077f3928cf refactor: split_invoices_based_on_payment_terms
- Invoices were in the wrong order due to the logic. The invoices with payment terms were added first and the rest after.
- Overly long function with unnecessary loops (reduced to one main loop) and complexity
- The split row as per payment terms was not ordered. So the second installment was allocated first

(cherry picked from commit 6bd56d2d5f)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.py
2023-11-13 10:46:38 +00:00
mergify[bot]
c5528844fd fix: indentation issue in the Production Plan Summary report (backport #38019) (#38068)
fix: indentation issue in the Production Plan Summary report (#38019)

fix: Production Plan Summary report
(cherry picked from commit 4a111f7362)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-11-13 14:03:45 +05:30
ruthra kumar
55885e84ab Merge pull request #38066 from frappe/mergify/bp/version-14/pr-38064
refactor: add revaluation journal checkbox in AR/AP summary reports (backport #38064)
2023-11-13 12:15:34 +05:30
ruthra kumar
2faf2ce468 Merge pull request #38065 from frappe/mergify/bp/version-14-hotfix/pr-38064
refactor: add revaluation journal checkbox in AR/AP summary reports (backport #38064)
2023-11-13 12:15:27 +05:30
ruthra kumar
7ab18fc434 refactor: add revaluation journal checkbox in AR/AP summary reports
(cherry picked from commit 95edd82638)
2023-11-13 06:39:03 +00:00
ruthra kumar
a104a4bca6 refactor: add revaluation journal checkbox in AR/AP summary reports
(cherry picked from commit 95edd82638)
2023-11-13 06:38:38 +00:00
mergify[bot]
6979c3e490 fix: close Credit Limit Crossed dialog (backport #38052) (#38058)
fix: close `Credit Limit Crossed` dialog (#38052)

(cherry picked from commit 94faa44697)

Co-authored-by: Arjun <arjun99c@gmail.com>
2023-11-12 18:07:31 +05:30
mergify[bot]
57ce73d540 fix: COA Importer app related issues (#37238)
fix: COA Importer app related issues (#37238)

* fix: COA Importer app related issues

* fix: Clear all account links fields befor import

* fix: Attribute error

(cherry picked from commit 8634abc021)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-11-12 17:40:56 +05:30
mergify[bot]
424ebd154a fix: make item field read-only in batch (backport #38010) (#38033)
* fix: make item field read-only in batch

(cherry picked from commit 779260fb49)

# Conflicts:
#	erpnext/stock/doctype/batch/batch.json

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-11-11 10:51:36 +05:30
Frappe PR Bot
7c7dc5328e chore(release): Bumped to Version 14.47.4
## [14.47.4](https://github.com/frappe/erpnext/compare/v14.47.3...v14.47.4) (2023-11-10)

### Bug Fixes

* new logic for handling revaluation journals ([010ccf8](010ccf80f5))
2023-11-10 07:46:10 +00:00
ruthra kumar
cb655226de Merge pull request #38037 from frappe/mergify/bp/version-14/pr-38004
fix: handling of exchange rate journals in AR/AP (backport #38004)
2023-11-10 13:14:45 +05:30
ruthra kumar
010ccf80f5 fix: new logic for handling revaluation journals
(cherry picked from commit 1d8fcd66e6)
2023-11-10 12:05:46 +05:30
ruthra kumar
13ea910fa6 Merge pull request #38035 from frappe/mergify/bp/version-14-hotfix/pr-38004
fix: handling of exchange rate journals in AR/AP (backport #38004)
2023-11-10 11:59:03 +05:30
ruthra kumar
9c0d80cef4 fix: new logic for handling revaluation journals
(cherry picked from commit 1d8fcd66e6)
2023-11-10 11:17:46 +05:30
mergify[bot]
620f4f2c10 fix: sales order not assigned to territory orders (#37905) (#38024)
fix: sales order not assigned to territory orders (#37905)

filtered sales order are not assigned to 'territory_orders' which results in 0 order amount and 0 billing amount in the output

(cherry picked from commit 45b4bfc947)

Co-authored-by: jabir-elat <44110258+jabir-elat@users.noreply.github.com>
2023-11-09 21:52:43 +05:30
ruthra kumar
89695022c7 Merge pull request #38021 from frappe/mergify/bp/version-14/pr-37860
refactor: ignore disabled account while selecting Income Accounts (backport #37860)
2023-11-09 17:28:14 +05:30
Frappe PR Bot
50627733b4 chore(release): Bumped to Version 14.47.3
## [14.47.3](https://github.com/frappe/erpnext/compare/v14.47.2...v14.47.3) (2023-11-09)

### Bug Fixes

* make adjustment entry using stock reconciliation (backport [#37995](https://github.com/frappe/erpnext/issues/37995)) (backport [#38008](https://github.com/frappe/erpnext/issues/38008)) ([#38018](https://github.com/frappe/erpnext/issues/38018)) ([7942ad4](7942ad488e))
2023-11-09 11:24:29 +00:00
mergify[bot]
7942ad488e fix: make adjustment entry using stock reconciliation (backport #37995) (backport #38008) (#38018)
fix: make adjustment entry using stock reconciliation (backport #37995) (#38008)

* fix: make adjustment entry using stock reconciliation (#37995)

fix: do adjustment entry using stock reconciliation
(cherry picked from commit a8216b9727)

# Conflicts:
#	erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json
#	erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py

* chore: fix conflicts

* fix: conflicts

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
(cherry picked from commit 984703c3c9)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-11-09 16:53:14 +05:30
ruthra kumar
c3d7348c73 refactor: ignore disabled account while selecting Income Accounts
(cherry picked from commit 6e3e094c95)
2023-11-09 11:14:38 +00:00
Deepesh Garg
ad178db28f Merge pull request #38012 from frappe/mergify/bp/version-14-hotfix/pr-37716
feat: multi-select customer group in AR Report (backport #37716)
2023-11-09 14:05:59 +05:30
mergify[bot]
984703c3c9 fix: make adjustment entry using stock reconciliation (backport #37995) (#38008)
* fix: make adjustment entry using stock reconciliation (#37995)

fix: do adjustment entry using stock reconciliation
(cherry picked from commit a8216b9727)

# Conflicts:
#	erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json
#	erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py

* chore: fix conflicts

* fix: conflicts

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-11-09 13:40:14 +05:30
vishal
6b34568128 fix: minor change added to test_case
(cherry picked from commit 30402033bc)
2023-11-09 07:35:16 +00:00
vishal
cf0d936195 feat(accounts_receivable): test_case added for multi-select customer group
(cherry picked from commit de445b32f5)
2023-11-09 07:35:16 +00:00
vishal
0eab723243 fix: minor issue
(cherry picked from commit b60c57a97d)
2023-11-09 07:35:15 +00:00
vishal
935286ff94 feat: multi-select customer group in AR Report
(cherry picked from commit 8903c1bc6f)
2023-11-09 07:35:15 +00:00
Frappe PR Bot
9a2674ea29 chore(release): Bumped to Version 14.47.2
## [14.47.2](https://github.com/frappe/erpnext/compare/v14.47.1...v14.47.2) (2023-11-09)

### Bug Fixes

* pick serial nos from selected batch only (backport [#37988](https://github.com/frappe/erpnext/issues/37988)) ([#38011](https://github.com/frappe/erpnext/issues/38011)) ([0405aae](0405aae4a0))
2023-11-09 07:28:50 +00:00
mergify[bot]
0405aae4a0 fix: pick serial nos from selected batch only (backport #37988) (#38011)
fix: pick serial nos from selected batch only (#37988)

* fix: pick current serial nos from selected batch only

* test: add test case for current qty and current serial nos

(cherry picked from commit db29180eec)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-11-09 12:57:03 +05:30
s-aga-r
db29180eec fix: pick serial nos from selected batch only (#37988)
* fix: pick current serial nos from selected batch only

* test: add test case for current qty and current serial nos
2023-11-09 12:30:22 +05:30
ruthra kumar
b5bed65d9e Merge pull request #38001 from frappe/mergify/bp/version-14-hotfix/pr-37860
refactor: ignore disabled account while selecting Income Accounts (backport #37860)
2023-11-09 10:41:13 +05:30
ruthra kumar
3f7f5bd8f0 refactor: ignore disabled account while selecting Income Accounts
(cherry picked from commit 6e3e094c95)
2023-11-09 04:45:53 +00:00
Frappe PR Bot
3f433b1b8b chore(release): Bumped to Version 14.47.1
## [14.47.1](https://github.com/frappe/erpnext/compare/v14.47.0...v14.47.1) (2023-11-08)

### Bug Fixes

* asset depreciation ledger (backport [#37991](https://github.com/frappe/erpnext/issues/37991)) ([#37992](https://github.com/frappe/erpnext/issues/37992)) ([0ac78a9](0ac78a96a9))
2023-11-08 18:40:20 +00:00
Anand Baburajan
0532f72cb1 Merge pull request #37996 from frappe/mergify/bp/version-14/pr-37992
fix: asset depreciation ledger (backport #37991) (backport #37992)
2023-11-09 00:09:05 +05:30
mergify[bot]
0ac78a96a9 fix: asset depreciation ledger (backport #37991) (#37992)
* fix: asset depreciation ledger (#37991)

* fix: include opening acc depr while calculating asset depr ledger report

* chore: include opening acc depr properly in acc depr amt

* chore: add cost_center in asset depr ledger report

* fix: handle finance books properly in asset depr ledger report

* chore: rename 'include default book entries' to 'include default FB entries'

(cherry picked from commit 9a171db97f)

# Conflicts:
#	erpnext/accounts/report/balance_sheet/balance_sheet.js
#	erpnext/accounts/report/cash_flow/cash_flow.js
#	erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.js
#	erpnext/accounts/report/trial_balance/trial_balance.js
#	erpnext/translations/pl.csv
#	erpnext/translations/tr.csv

* chore: fix conflict in balance_sheet.js

* chore: fix conflict in cash_flow.js

* chore: fix conflict in consolidated_financial_statement.js

* chore: fix conflict in trial_balance.js

* chore: fix conflict in tr.csv

* chore: fix conflict in pl.csv

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
(cherry picked from commit 043dc1b14b)
2023-11-08 18:07:42 +00:00
mergify[bot]
043dc1b14b fix: asset depreciation ledger (backport #37991) (#37992)
* fix: asset depreciation ledger (#37991)

* fix: include opening acc depr while calculating asset depr ledger report

* chore: include opening acc depr properly in acc depr amt

* chore: add cost_center in asset depr ledger report

* fix: handle finance books properly in asset depr ledger report

* chore: rename 'include default book entries' to 'include default FB entries'

(cherry picked from commit 9a171db97f)

# Conflicts:
#	erpnext/accounts/report/balance_sheet/balance_sheet.js
#	erpnext/accounts/report/cash_flow/cash_flow.js
#	erpnext/accounts/report/consolidated_financial_statement/consolidated_financial_statement.js
#	erpnext/accounts/report/trial_balance/trial_balance.js
#	erpnext/translations/pl.csv
#	erpnext/translations/tr.csv

* chore: fix conflict in balance_sheet.js

* chore: fix conflict in cash_flow.js

* chore: fix conflict in consolidated_financial_statement.js

* chore: fix conflict in trial_balance.js

* chore: fix conflict in tr.csv

* chore: fix conflict in pl.csv

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-11-08 23:36:17 +05:30
Deepesh Garg
c5a6b17c15 Merge pull request #37825 from frappe/mergify/bp/version-14-hotfix/pr-37278
fix: german translations of Accounts Settings (backport #37278)
2023-11-08 18:44:11 +05:30
Deepesh Garg
16c3f3bcbd Merge pull request #37913 from frappe/mergify/bp/version-14-hotfix/pr-37299
fix: Set right party name in bank transaction (backport #37299)
2023-11-08 12:28:10 +05:30
Frappe PR Bot
4d804951c6 chore(release): Bumped to Version 14.47.0
# [14.47.0](https://github.com/frappe/erpnext/compare/v14.46.7...v14.47.0) (2023-11-08)

### Bug Fixes

* `TypeError` in PR for non-stock item ([ef4471f](ef4471f8c0))
* add missing disbursement account in update_old_loans patch ([ad64065](ad64065ec6))
* add translation wrapper (backport [#37911](https://github.com/frappe/erpnext/issues/37911)) ([#37946](https://github.com/frappe/erpnext/issues/37946)) ([c53d281](c53d281b9e))
* don't reset rate if greater than zero in standalone debit note (backport [#37935](https://github.com/frappe/erpnext/issues/37935)) ([#37940](https://github.com/frappe/erpnext/issues/37940)) ([64658fc](64658fc790))
* fetch asset received but not billed account only when needed ([7df4009](7df4009dd3))
* gov compliance for tax withholding report ([#37590](https://github.com/frappe/erpnext/issues/37590)) ([273cc35](273cc35b91))
* In-Transit Warehouse company filter (backport [#37796](https://github.com/frappe/erpnext/issues/37796)) ([#37797](https://github.com/frappe/erpnext/issues/37797)) ([0b1da08](0b1da08d78))
* link between parent and child procedure (backport [#37903](https://github.com/frappe/erpnext/issues/37903)) ([#37943](https://github.com/frappe/erpnext/issues/37943)) ([24da29a](24da29a817))
* list index out of range ([#37880](https://github.com/frappe/erpnext/issues/37880)) ([05fed9e](05fed9e352))
* make `Material Request Item` required if `Material Request` is set in PO (backport [#37928](https://github.com/frappe/erpnext/issues/37928)) ([#37936](https://github.com/frappe/erpnext/issues/37936)) ([c870120](c87012046d))
* permission error while creating Supplier Quotation from Portal (backport [#37864](https://github.com/frappe/erpnext/issues/37864)) ([#37870](https://github.com/frappe/erpnext/issues/37870)) ([1a3dae0](1a3dae0f9a))
* **plaid:** Do not sync pending transactions ([ffdc11b](ffdc11bbf6))
* POS change amount gl entry with no amount ([#37799](https://github.com/frappe/erpnext/issues/37799)) ([5e1a89b](5e1a89b3f9))
* Quality Inspection Parameter migration - DuplicateEntryError due to case sensitivity (backport [#37499](https://github.com/frappe/erpnext/issues/37499)) ([#37916](https://github.com/frappe/erpnext/issues/37916)) ([eb3630b](eb3630bcf8))
* remove voucher type and no for Item and Warehouse based reposting (backport [#37849](https://github.com/frappe/erpnext/issues/37849)) ([#37850](https://github.com/frappe/erpnext/issues/37850)) ([e19cade](e19cade12d))
* standard submit perm in repost ledger for editable invoices (backport [#37826](https://github.com/frappe/erpnext/issues/37826)) ([#37854](https://github.com/frappe/erpnext/issues/37854)) ([69b569d](69b569df46))
* status for over delivery or billing ([d8e7430](d8e743013f))
* type error on new payment entry ([38184f7](38184f77c7))
* typo in AR report ([3d72ec7](3d72ec7ca4))
* validate so item with qtn ([4a225b0](4a225b069b))

### Features

* reserved production plan sub assembly items (backport [#37884](https://github.com/frappe/erpnext/issues/37884)) ([#37926](https://github.com/frappe/erpnext/issues/37926)) ([4de97a4](4de97a4fcb))
* settings page for repost ([09cde5d](09cde5da08))
* **Stock Balance:** add filters from route (backport [#37836](https://github.com/frappe/erpnext/issues/37836)) ([#37839](https://github.com/frappe/erpnext/issues/37839)) ([e8a706a](e8a706a5ea))

### Performance Improvements

* Add index to supplier invoice field (backport [#37861](https://github.com/frappe/erpnext/issues/37861)) ([#37862](https://github.com/frappe/erpnext/issues/37862)) ([2c93f81](2c93f81d59))
* index return against for purchase invoice (backport [#37881](https://github.com/frappe/erpnext/issues/37881)) ([#37882](https://github.com/frappe/erpnext/issues/37882)) ([fed25fa](fed25fac76))
2023-11-08 06:19:10 +00:00
Deepesh Garg
c5ddb4153a Merge pull request #37965 from frappe/version-14-hotfix
chore: release v14
2023-11-08 11:47:53 +05:30
ruthra kumar
b0ed3c2f0a Merge pull request #37977 from ruthra-kumar/add_voucher_detail_no_to_payment_ledger
refactor: Add voucher_detail_no to payment ledger
2023-11-08 11:23:15 +05:30
ruthra kumar
3f8d58c9c6 refactor: add voucher_detail_no to PLE doctype 2023-11-08 10:53:16 +05:30
ruthra kumar
8a3139f6f5 Merge pull request #37901 from frappe/mergify/bp/version-14-hotfix/pr-37887
chore: performance optimization on payment ledger entry doctype (backport #37887)
2023-11-08 10:48:30 +05:30
ruthra kumar
0b601d8cae chore: performance optimization on payment ledger entry doctype
(cherry picked from commit f14d1eb871)
2023-11-08 10:23:52 +05:30
ruthra kumar
9be71e45b9 Merge pull request #37975 from frappe/mergify/bp/version-14-hotfix/pr-37971
refactor: optimize bulk transaction for speed (backport #37971)
2023-11-08 07:08:42 +05:30
ruthra kumar
e58604a90f refactor: optimize for speed
(cherry picked from commit 416bd400bb)
2023-11-08 01:03:28 +00:00
mergify[bot]
e895bb3a63 chore: typo in Stock Entry enqueue msg (backport #37970) (#37972)
chore: typo in `Stock Entry` enqueue msg

(cherry picked from commit ee60fa940c)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-11-07 15:57:20 +00:00
ruthra kumar
38a5e6f10b Merge pull request #37967 from frappe/mergify/bp/version-14-hotfix/pr-37954
refactor: expand repost to `Expense Claim` and make it configurable (backport #37954)
2023-11-07 16:24:44 +05:30
ruthra kumar
8f0cf1b7dc chore: resolve conflict 2023-11-07 15:56:35 +05:30
ruthra kumar
3da2597703 refactor: update permissions for repost settings
(cherry picked from commit 10b9570429)
2023-11-07 10:14:36 +00:00
ruthra kumar
82bf726b83 refactor(test): repost test case for purchase invoice
(cherry picked from commit 11c8d9fcf1)
2023-11-07 10:14:35 +00:00
ruthra kumar
7d4dc67b61 refactor: select distinct types
(cherry picked from commit 61705047b0)
2023-11-07 10:14:33 +00:00
ruthra kumar
35f5498913 refactor(test): update repost settings for test cases
(cherry picked from commit ac79b8483f)
2023-11-07 10:14:32 +00:00
ruthra kumar
ed557274d2 refactor: support for expense claim repost
(cherry picked from commit b651b36fff)
2023-11-07 10:14:30 +00:00
ruthra kumar
18e6931d78 refactor: configurable repost settings
(cherry picked from commit 5a068410c6)
2023-11-07 10:14:29 +00:00
ruthra kumar
560a45b343 chore: patch to update default repost settings value
(cherry picked from commit ebb186c8df)

# Conflicts:
#	erpnext/patches.txt
2023-11-07 10:14:28 +00:00
ruthra kumar
09cde5da08 feat: settings page for repost
(cherry picked from commit d582a73795)
2023-11-07 10:14:21 +00:00
ruthra kumar
503c0f33bb Merge pull request #37957 from frappe/mergify/bp/version-14-hotfix/pr-37956
fix: type error on new payment entry (backport #37956)
2023-11-07 12:47:10 +05:30
ruthra kumar
38184f77c7 fix: type error on new payment entry
(cherry picked from commit adff287160)
2023-11-07 12:40:16 +05:30
Frappe PR Bot
449b641560 chore(release): Bumped to Version 14.46.7
## [14.46.7](https://github.com/frappe/erpnext/compare/v14.46.6...v14.46.7) (2023-11-06)

### Bug Fixes

* typo in AR report ([d54e756](d54e756453))
2023-11-06 15:33:32 +00:00
ruthra kumar
3cc5e5591d Merge pull request #37951 from frappe/mergify/bp/version-14/pr-37948
fix: typo in AR report (backport #37948)
2023-11-06 21:00:23 +05:30
ruthra kumar
bc5e01e846 Merge pull request #37949 from frappe/mergify/bp/version-14-hotfix/pr-37948
fix: typo in AR report (backport #37948)
2023-11-06 20:55:22 +05:30
ruthra kumar
d54e756453 fix: typo in AR report
(cherry picked from commit 67e74d03ed)
2023-11-06 15:00:11 +00:00
ruthra kumar
3d72ec7ca4 fix: typo in AR report
(cherry picked from commit 67e74d03ed)
2023-11-06 14:56:44 +00:00
mergify[bot]
c53d281b9e fix: add translation wrapper (backport #37911) (#37946)
fix: add translation wrapper

(cherry picked from commit 8722318081)

Co-authored-by: hyaray <hyaray@vip.qq.com>
2023-11-06 19:52:11 +05:30
Frappe PR Bot
94b38b900c chore(release): Bumped to Version 14.46.6
## [14.46.6](https://github.com/frappe/erpnext/compare/v14.46.5...v14.46.6) (2023-11-06)

### Bug Fixes

* don't reset rate if greater than zero in standalone debit note (backport [#37935](https://github.com/frappe/erpnext/issues/37935)) (backport [#37940](https://github.com/frappe/erpnext/issues/37940)) ([#37945](https://github.com/frappe/erpnext/issues/37945)) ([235f166](235f1664e0))
2023-11-06 14:15:53 +00:00
mergify[bot]
235f1664e0 fix: don't reset rate if greater than zero in standalone debit note (backport #37935) (backport #37940) (#37945)
fix: don't reset rate if greater than zero in standalone debit note (backport #37935) (#37940)

* fix: don't reset rate if greater than zero in standalone debit note

(cherry picked from commit 5cce522ecd)

* fix(test): `test_gl_entries_for_standalone_debit_note`

(cherry picked from commit f9fc6c9c9d)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
(cherry picked from commit 64658fc790)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-11-06 19:37:15 +05:30
mergify[bot]
24da29a817 fix: link between parent and child procedure (backport #37903) (#37943)
* fix: link between parent and child procedure

(cherry picked from commit 05f24ede96)

* chore: add missing filters for `Parent Procedure`

(cherry picked from commit 8fbd4cea5b)

* test: add test case for Quality Procedure`

(cherry picked from commit 30c6b83a10)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-11-06 19:28:19 +05:30
mergify[bot]
64658fc790 fix: don't reset rate if greater than zero in standalone debit note (backport #37935) (#37940)
* fix: don't reset rate if greater than zero in standalone debit note

(cherry picked from commit 5cce522ecd)

* fix(test): `test_gl_entries_for_standalone_debit_note`

(cherry picked from commit f9fc6c9c9d)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-11-06 19:27:28 +05:30
mergify[bot]
c87012046d fix: make Material Request Item required if Material Request is set in PO (backport #37928) (#37936)
fix: make `Material Request Item` required if `Material Request` is set in PO

(cherry picked from commit a9d91189b0)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-11-06 17:26:37 +05:30
Frappe PR Bot
21ad1dba19 chore(release): Bumped to Version 14.46.5
## [14.46.5](https://github.com/frappe/erpnext/compare/v14.46.4...v14.46.5) (2023-11-06)

### Bug Fixes

* additional filter in ar/ap report ([930aee1](930aee1d70))
2023-11-06 06:42:02 +00:00
ruthra kumar
9c356a0ac2 Merge pull request #37929 from frappe/mergify/bp/version-14/pr-37873
refactor: 'group only by voucher' flag in AR/AP report (backport #37869) (backport #37873)
2023-11-06 12:10:29 +05:30
ruthra kumar
930aee1d70 fix: additional filter in ar/ap report
empty commit
2023-11-06 11:51:39 +05:30
mergify[bot]
4de97a4fcb feat: reserved production plan sub assembly items (backport #37884) (#37926)
feat: reserved production plan sub assembly items (#37884)

(cherry picked from commit 34d3eb88b3)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-11-06 11:40:21 +05:30
ruthra kumar
932d1e7c62 Merge pull request #37924 from frappe/mergify/bp/version-14-hotfix/pr-37879
refactor: flag to toggle billed amy update in DN for Credit Note (backport #37879)
2023-11-06 11:24:08 +05:30
ruthra kumar
a8b26ebc6b refactor: group only by voucher flag in AR/AP report
(cherry picked from commit 23beb46d15)
(cherry picked from commit ee5898a773)
2023-11-06 05:53:50 +00:00
ruthra kumar
71ad448281 refactor(test): enable billed amt update on Sales Return(Cr Note)
(cherry picked from commit 0c5bdbdcf3)
2023-11-06 09:40:32 +05:30
ruthra kumar
6eb867a1e4 refactor: flag to toggle billed amy update in DN for Credit Note
(cherry picked from commit a3191f1c8c)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.json
2023-11-06 03:11:20 +00:00
mergify[bot]
5e1a89b3f9 fix: POS change amount gl entry with no amount (#37799)
fix: POS change amount gl entry with no amount (#37799)

(cherry picked from commit 2b02ef0066)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-11-05 17:56:19 +05:30
Frappe PR Bot
b2b8b72952 chore(release): Bumped to Version 14.46.4
## [14.46.4](https://github.com/frappe/erpnext/compare/v14.46.3...v14.46.4) (2023-11-05)

### Bug Fixes

* Quality Inspection Parameter migration - DuplicateEntryError due to case sensitivity (backport [#37499](https://github.com/frappe/erpnext/issues/37499)) (backport [#37916](https://github.com/frappe/erpnext/issues/37916)) ([#37919](https://github.com/frappe/erpnext/issues/37919)) ([555ebc1](555ebc190c))
2023-11-05 06:41:12 +00:00
mergify[bot]
555ebc190c fix: Quality Inspection Parameter migration - DuplicateEntryError due to case sensitivity (backport #37499) (backport #37916) (#37919)
fix: Quality Inspection Parameter migration - DuplicateEntryError due to case sensitivity (backport #37499) (#37916)

fix: Quality Inspection Parameter migration - DuplicateEntryError due to case sensitivity (#37499)

* fix: account for case-insensitive database primary key for parameter names

* chore: linting

(cherry picked from commit b099590b2c)

Co-authored-by: Richard Case <110036763+casesolved-co-uk@users.noreply.github.com>
(cherry picked from commit eb3630bcf8)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-11-05 12:10:04 +05:30
viralkansodiya15
05fed9e352 fix: list index out of range (#37880)
* fix: list index out of range

* fix: changes in error message

* fix: change error message and date comparision

* fix: change a return a value when disposal date is equal to available for use date

* fix: changes to fix linter test failing
2023-11-05 11:54:39 +05:30
mergify[bot]
eb3630bcf8 fix: Quality Inspection Parameter migration - DuplicateEntryError due to case sensitivity (backport #37499) (#37916)
fix: Quality Inspection Parameter migration - DuplicateEntryError due to case sensitivity (#37499)

* fix: account for case-insensitive database primary key for parameter names

* chore: linting

(cherry picked from commit b099590b2c)

Co-authored-by: Richard Case <110036763+casesolved-co-uk@users.noreply.github.com>
2023-11-05 06:16:23 +00:00
ruthra kumar
c2001bec15 Merge pull request #37915 from ruthra-kumar/prevent_precision_based_validation_error_reconciliation
refactor: avoid precision based validation error on reconciliation
2023-11-05 05:58:32 +05:30
ruthra kumar
be925d2d33 refactor: avoid precision based validation error on reconciliation 2023-11-05 05:22:09 +05:30
marination
b0a184e937 fix: Use process.extract to get the corresponding party doc name of the result
- rapidfuzz accepts an iterable or a dict. dict input gives the dict key and value in the result

(cherry picked from commit e0a03789ae)
2023-11-04 15:48:18 +00:00
marination
21b430a575 fix: Set right party name in bank transaction
- If party name and docname are different, set the docname in Bank Transaction

(cherry picked from commit ff1dc72d74)
2023-11-04 15:48:18 +00:00
Anand Baburajan
65dfef021a chore: rename depreciation_amount_based_on_num_days_in_month to daily_prorata_based [v14] (#37898)
chore: rename depreciation_amount_based_on_num_days_in_month to daily_prorata_based
2023-11-03 20:18:20 +00:00
Anand Baburajan
86c6ae6275 chore: rename daily_depreciation in asset to depreciation_amount_based_on_num_days_in_month [v14] (#37895)
chore: rename daily_depreciation to depreciation_amount_based_on_num_days_in_month
2023-11-03 23:26:34 +05:30
mergify[bot]
fed25fac76 perf: index return against for purchase invoice (backport #37881) (#37882)
perf: index return against for purchase invoice (#37881)

(cherry picked from commit 469ae2c7f1)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-11-03 21:59:46 +05:30
Frappe PR Bot
58eaaaa8ad chore(release): Bumped to Version 14.46.3
## [14.46.3](https://github.com/frappe/erpnext/compare/v14.46.2...v14.46.3) (2023-11-03)

### Bug Fixes

* add missing disbursement account in update_old_loans patch ([00bbf0f](00bbf0fbc5))
2023-11-03 16:29:27 +00:00
Anand Baburajan
df00bde748 Merge pull request #37894 from frappe/mergify/bp/version-14/pr-37889
fix: add missing disbursement account in update_old_loans patch (backport #37889)
2023-11-03 21:57:35 +05:30
anandbaburajan
00bbf0fbc5 fix: add missing disbursement account in update_old_loans patch
(cherry picked from commit ad64065ec6)
2023-11-03 16:25:46 +00:00
Anand Baburajan
6b5cffc77a Merge pull request #37889 from anandbaburajan/update_old_loans_disb_account
fix: add missing disbursement account in update_old_loans patch
2023-11-03 21:45:33 +05:30
anandbaburajan
ad64065ec6 fix: add missing disbursement account in update_old_loans patch 2023-11-03 20:57:52 +05:30
mergify[bot]
1a3dae0f9a fix: permission error while creating Supplier Quotation from Portal (backport #37864) (#37870)
* fix: permission error while creating Supplier Quotation from Portal

(cherry picked from commit e019d43d0b)

# Conflicts:
#	erpnext/controllers/buying_controller.py

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-11-03 16:24:36 +05:30
ruthra kumar
15308c9aac Merge pull request #37875 from frappe/mergify/bp/version-14-hotfix/pr-37852
refactor: better ledger comparision report (backport #37852)
2023-11-03 13:25:22 +05:30
ruthra kumar
09ba6c1266 Merge pull request #37873 from frappe/mergify/bp/version-14-hotfix/pr-37869
refactor: 'group only by voucher' flag in AR/AP report (backport #37869)
2023-11-03 13:25:04 +05:30
ruthra kumar
afa6ed9e22 refactor(test): for ledger comparision report
(cherry picked from commit 639f427d6d)
2023-11-03 07:22:59 +00:00
ruthra kumar
3d2ff7eea3 refactor: better output on gl and pl comparison report
(cherry picked from commit 539f0251d9)
2023-11-03 07:22:58 +00:00
ruthra kumar
ee5898a773 refactor: group only by voucher flag in AR/AP report
(cherry picked from commit 23beb46d15)
2023-11-03 07:00:25 +00:00
mergify[bot]
2c93f81d59 perf: Add index to supplier invoice field (backport #37861) (#37862)
fix: Add index to supplier invoice field (#37861)

* fix: Add index to supplier invoice field

* chore: remove unintetional changes

(cherry picked from commit c37e374fdd)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-11-03 11:52:07 +05:30
mergify[bot]
e19cade12d fix: remove voucher type and no for Item and Warehouse based reposting (backport #37849) (#37850)
* fix: remove voucher type and no for Item and Warehouse based reposting

(cherry picked from commit 0104897d69)

* chore: fix test cases

---------

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
2023-11-02 15:15:53 +05:30
mergify[bot]
273cc35b91 fix: gov compliance for tax withholding report (#37590)
* refactor: avoid relying only on against in tds docs query

(cherry picked from commit 705dadae8e)

* chore: change column order

(cherry picked from commit 7ecc0d5a04)

* fix: sort by section code

(cherry picked from commit 4471ad581e)

* feat: proprietorship & partnership options in entity type

(cherry picked from commit ed2457bddf)

# Conflicts:
#	erpnext/buying/doctype/supplier/supplier.json
#	erpnext/selling/doctype/customer/customer.json

* chore: linting issues

(cherry picked from commit 75441017c6)

* feat: add cols for supplier inv details

(cherry picked from commit 6d5ccde864)

* chore: resolve conflicts

* chore: resolve conflicts

* chore: linting issues

---------

Co-authored-by: Gursheen Anand <gursheen@frappe.io>
Co-authored-by: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com>
2023-11-02 14:34:23 +05:30
mergify[bot]
69b569df46 fix: standard submit perm in repost ledger for editable invoices (backport #37826) (#37854)
fix: standard submit perm in repost ledger for editable invoices (#37826)

* fix: ignore perm while reposting ledger

* fix: use flag in save

* fix: remove unnecessary save

(cherry picked from commit 1b808e1d7c)

Co-authored-by: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com>
2023-11-02 14:33:33 +05:30
Frappe PR Bot
99338b6d01 chore(release): Bumped to Version 14.46.2
## [14.46.2](https://github.com/frappe/erpnext/compare/v14.46.1...v14.46.2) (2023-11-02)

### Bug Fixes

* `TypeError` in PR for non-stock item (backport [#37819](https://github.com/frappe/erpnext/issues/37819)) (backport [#37841](https://github.com/frappe/erpnext/issues/37841)) ([#37853](https://github.com/frappe/erpnext/issues/37853)) ([f6418c1](f6418c14dd))
2023-11-02 08:33:41 +00:00
mergify[bot]
f6418c14dd fix: TypeError in PR for non-stock item (backport #37819) (backport #37841) (#37853)
fix: `TypeError` in PR for non-stock item

(cherry picked from commit 028b3e2fbf)
(cherry picked from commit ef4471f8c0)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-11-02 14:02:07 +05:30
rohitwaghchaure
a07d58bd0e Merge pull request #37841 from frappe/mergify/bp/version-14-hotfix/pr-37819
fix: `TypeError` in PR for non-stock item (backport #37819)
2023-11-02 13:34:23 +05:30
ruthra kumar
50fdc9dda0 Merge pull request #37846 from frappe/mergify/copy/version-14-hotfix/pr-37845
chore: add std permissions for Process Payment Reconciilation log (copy #37845)
2023-11-02 12:10:27 +05:30
ruthra kumar
9b0a46853f chore: std permissions for Process Payment Reconciilation log
(cherry picked from commit a9fceeb00f)
2023-11-02 06:10:54 +00:00
ruthra kumar
64d7590bd0 Merge pull request #37843 from frappe/mergify/bp/version-14-hotfix/pr-37838
refactor: pass limits to JE and PE queries in reconciliation tool (backport #37838)
2023-11-02 11:08:51 +05:30
mergify[bot]
e8a706a5ea feat(Stock Balance): add filters from route (backport #37836) (#37839)
feat(Stock Balance): add filters from route

(cherry picked from commit 38e5e4a893)

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
2023-11-02 10:46:42 +05:30
ruthra kumar
289236d065 refactor: pass limits to JE and PE queries in reconciliation tool
(cherry picked from commit 54e8ce1ac5)
2023-11-02 05:13:08 +00:00
s-aga-r
ef4471f8c0 fix: TypeError in PR for non-stock item
(cherry picked from commit 028b3e2fbf)
2023-11-02 05:10:19 +00:00
ruthra kumar
e616a0bb63 Merge pull request #37833 from frappe/mergify/bp/version-14-hotfix/pr-37832
refactor: checkbox to toggle remarks in General Ledger (backport #37832)
2023-11-02 08:06:40 +05:30
ruthra kumar
174b76f6ff refactor: checkbox to toggle remarks in General Ledger
(cherry picked from commit 8fa677b8e8)
2023-11-02 07:28:42 +05:30
mergify[bot]
875d7f8b72 refactor: update fields label and remove unused fields from BIN (backport #37827) (#37829)
* refactor: rearrange fields and update label

(cherry picked from commit ec1a7869f8)

* refactor: remove unused fields `fcfs_rate` and `ma_rate` from Bin

(cherry picked from commit f0a1f4ac7c)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-11-01 16:41:33 +05:30
Raffael Meyer
2c1fdecc91 chore: resolve merge conflicts 2023-11-01 11:54:29 +01:00
barredterra
4d2169e48e fix(translations): suggestions from review
(cherry picked from commit 115f024260)
2023-11-01 09:43:41 +00:00
barredterra
b75aae99ca fix: german translations of Accounts Settings
(cherry picked from commit b3486b43c4)

# Conflicts:
#	erpnext/translations/de.csv
2023-11-01 09:43:40 +00:00
Deepesh Garg
f502ec2268 Merge pull request #37821 from frappe/mergify/bp/version-14-hotfix/pr-37635
fix: validate sales order item with quotation (backport #37635)
2023-11-01 15:13:26 +05:30
Deepesh Garg
0196d7ac23 Merge pull request #37717 from frappe/mergify/bp/version-14-hotfix/pr-37690
fix(plaid): Do not sync pending transactions (#37690)
2023-11-01 14:12:33 +05:30
Deepesh Garg
357697702b chore: resolve conflicts 2023-11-01 14:11:36 +05:30
Gursheen Anand
4a225b069b fix: validate so item with qtn
(cherry picked from commit 17ebc1ea80)
2023-11-01 08:34:50 +00:00
Deepesh Garg
28c9458482 Merge pull request #37815 from frappe/mergify/bp/version-14-hotfix/pr-37680
fix: status when over delivery or billing in SO (#37680)
2023-11-01 14:03:59 +05:30
Gursheen Anand
d8e743013f fix: status for over delivery or billing
(cherry picked from commit d69b0d76dd)
2023-11-01 07:00:14 +00:00
Frappe PR Bot
42ccc092fe chore(release): Bumped to Version 14.46.1
## [14.46.1](https://github.com/frappe/erpnext/compare/v14.46.0...v14.46.1) (2023-11-01)

### Bug Fixes

* fetch asset received but not billed account only when needed ([487aa35](487aa35ee3))
2023-11-01 06:43:35 +00:00
Deepesh Garg
222bce62bf Merge pull request #37814 from frappe/mergify/bp/version-14/pr-37812
fix: fetch asset received but not billed account only when needed (#37737)
2023-11-01 12:12:02 +05:30
Deepesh Garg
487aa35ee3 fix: fetch asset received but not billed account only when needed
(cherry picked from commit 3a8736374c)
(cherry picked from commit 7df4009dd3)
2023-11-01 06:41:33 +00:00
Deepesh Garg
555cc62e50 Merge pull request #37812 from frappe/mergify/bp/version-14-hotfix/pr-37737
fix: fetch asset received but not billed account only when needed (backport #37737)
2023-11-01 12:10:04 +05:30
Deepesh Garg
7df4009dd3 fix: fetch asset received but not billed account only when needed
(cherry picked from commit 3a8736374c)
2023-11-01 04:49:59 +00:00
ruthra kumar
08a9a9d188 Merge pull request #37806 from frappe/mergify/bp/version-14-hotfix/pr-37795
chore: update default limit values in reconciliation tool (backport #37795)
2023-10-31 20:37:40 +05:30
ruthra kumar
e98be384f9 Merge pull request #37804 from frappe/mergify/bp/version-14-hotfix/pr-37793
refactor: pull remarks only if needed on AR/AP report (backport #37793)
2023-10-31 20:37:06 +05:30
ruthra kumar
fdf2977ce2 chore: update default limit values in reconciliation tool
(cherry picked from commit 1fd888175f)
2023-10-31 14:22:29 +00:00
ruthra kumar
3276f39740 refactor: pull remarks only if needed on AR/AP report
(cherry picked from commit eb73017798)
2023-10-31 14:21:52 +00:00
mergify[bot]
0b1da08d78 fix: In-Transit Warehouse company filter (backport #37796) (#37797)
fix: In-Transit Warehouse company filter (#37796)

(cherry picked from commit daf2ec063c)

Co-authored-by: hyaray <hyaray@vip.qq.com>
2023-10-31 18:53:37 +05:30
Frappe PR Bot
0f848fd968 chore(release): Bumped to Version 14.46.0
# [14.46.0](https://github.com/frappe/erpnext/compare/v14.45.4...v14.46.0) (2023-10-31)

### Bug Fixes

* add regional support to extend purchase gl entries ([d02ebd6](d02ebd6215))
* avoid name clash in delivery stop (backport [#37306](https://github.com/frappe/erpnext/issues/37306)) ([#37701](https://github.com/frappe/erpnext/issues/37701)) ([556095d](556095daaa))
* Cash flow mapping fix ([#37522](https://github.com/frappe/erpnext/issues/37522)) ([8e31379](8e31379ecc))
* close employee loan on write off ([#37638](https://github.com/frappe/erpnext/issues/37638)) ([922ace4](922ace4076))
* **defaults:** apply discount and provisonal defaults from item group and brand if available (backport [#37466](https://github.com/frappe/erpnext/issues/37466)) ([#37703](https://github.com/frappe/erpnext/issues/37703)) ([a0893dd](a0893ddf96))
* **delivery:** rename dt fetch stop action (backport [#37605](https://github.com/frappe/erpnext/issues/37605)) ([#37606](https://github.com/frappe/erpnext/issues/37606)) ([8660faa](8660faaa54))
* GL Entries for receiving non CWIP assets using Purchase Receipt ([#37660](https://github.com/frappe/erpnext/issues/37660)) ([80774e2](80774e2da1))
* incorrect cost center in the purchase invoice (backport [#37591](https://github.com/frappe/erpnext/issues/37591)) ([#37609](https://github.com/frappe/erpnext/issues/37609)) ([50daf70](50daf701dd))
* incorrect material request quantity in production plan ([#37785](https://github.com/frappe/erpnext/issues/37785)) ([25718d9](25718d9f1b))
* incorrect process loss validation for multiple finished items (backport [#37576](https://github.com/frappe/erpnext/issues/37576)) ([#37656](https://github.com/frappe/erpnext/issues/37656)) ([638c271](638c271d70))
* indexing on Delivery Note Item (backport [#37766](https://github.com/frappe/erpnext/issues/37766)) ([#37777](https://github.com/frappe/erpnext/issues/37777)) ([9b66a06](9b66a06c86))
* make changes that enable gantt view for job cards (backport [#37661](https://github.com/frappe/erpnext/issues/37661)) ([#37756](https://github.com/frappe/erpnext/issues/37756)) ([712ddb7](712ddb75be))
* **minor:** filter bank accounts in bank statement import ([#37525](https://github.com/frappe/erpnext/issues/37525)) ([1cb9f4c](1cb9f4cf8b))
* **minor:** filter tax template based on company in subscription ([#37562](https://github.com/frappe/erpnext/issues/37562)) ([c05e0a4](c05e0a4ffc))
* **minor:** set tax values for item variants (backport [#37674](https://github.com/frappe/erpnext/issues/37674)) ([#37738](https://github.com/frappe/erpnext/issues/37738)) ([fabcfc1](fabcfc1fce))
* negative current qty causing recursion issue ([#37752](https://github.com/frappe/erpnext/issues/37752)) ([f1407bc](f1407bcfd2))
* overallocation on Payment with PO/SO ([d71b885](d71b885fb8))
* purchase receipt with stock and asset items ([375be8c](375be8cd93))
* remove from or target warehouse for non internal transfer entries (backport [#37612](https://github.com/frappe/erpnext/issues/37612)) ([#37628](https://github.com/frappe/erpnext/issues/37628)) ([78b7c26](78b7c26420))
* set correct `purchase_sle` in `get_last_sle()` ([#37708](https://github.com/frappe/erpnext/issues/37708)) ([86cf156](86cf156968))
* set empty value for tax template in item details ([#37496](https://github.com/frappe/erpnext/issues/37496)) ([ec208b8](ec208b8df5))
* typeerror on tds payable monthly report ([fea27d5](fea27d5e2e))
* update existing doc if possible ([89f07dc](89f07dcfac))
* wrong german translation ([#37658](https://github.com/frappe/erpnext/issues/37658)) ([fa5780c](fa5780ca81))

### Features

* allow return of components for SCO that don't have SCR created (backport [#37686](https://github.com/frappe/erpnext/issues/37686)) ([#37692](https://github.com/frappe/erpnext/issues/37692)) ([e96d5b3](e96d5b314a))
* **delivery:** link to delivery notes list view from delivery trip (backport [#37604](https://github.com/frappe/erpnext/issues/37604)) ([#37695](https://github.com/frappe/erpnext/issues/37695)) ([c58fefb](c58fefb359))

### Reverts

* Revert "fix: set empty value for tax template in item details (#37496)" ([ca13816](ca13816ca1)), closes [#37496](https://github.com/frappe/erpnext/issues/37496) [#37496](https://github.com/frappe/erpnext/issues/37496)
2023-10-31 12:45:11 +00:00
rohitwaghchaure
c117ab851a Merge pull request #37788 from frappe/version-14-hotfix
chore: release v14
2023-10-31 18:13:28 +05:30
rohitwaghchaure
b7b62a8966 Merge branch 'version-14' into version-14-hotfix 2023-10-31 17:38:42 +05:30
Samuel Danieli
86cf156968 fix: set correct purchase_sle in get_last_sle() (#37708)
sle_dict may look like this:
{
  'incoming': [
    {... Stock Entry ...},
    {... Purchase Receipt ...}
  ],
  'outgoing': [
    {... Stock Entry ...}
  ]
}
2023-10-31 16:07:10 +05:30
rohitwaghchaure
25718d9f1b fix: incorrect material request quantity in production plan (#37785) 2023-10-31 15:12:35 +05:30
mergify[bot]
9b66a06c86 fix: indexing on Delivery Note Item (backport #37766) (#37777)
fix: indexing on Delivery Note Item (#37766)

fix: added indexing on Delivery Note Item
(cherry picked from commit 056b74b162)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-31 14:31:38 +05:30
ruthra kumar
7c2bd24d0b Merge pull request #37765 from frappe/mergify/bp/version-14/pr-37761
chore: add index to posting_date in PLE (backport #37761)
2023-10-30 17:39:53 +05:30
ruthra kumar
af57cc6c5f Merge pull request #37762 from frappe/mergify/bp/version-14-hotfix/pr-37761
chore: add index to posting_date in PLE (backport #37761)
2023-10-30 17:31:08 +05:30
ruthra kumar
25448fcdbc chore: add index to posting_date in PLE
(cherry picked from commit ca69845238)
2023-10-30 17:01:38 +05:30
ruthra kumar
69e83ff6ab chore: add index to posting_date in PLE
(cherry picked from commit ca69845238)
2023-10-30 16:59:56 +05:30
ruthra kumar
87a8c8d08e Merge pull request #37760 from frappe/mergify/bp/version-14-hotfix/pr-37720
refactor: ignore cancelled GLE's while looking for currency of existing entries (backport #37720)
2023-10-30 16:52:50 +05:30
ruthra kumar
4c01128827 refactor: ignore cancelled GLE's while looking for currency
(cherry picked from commit 8d9b90f3f5)
2023-10-30 10:43:02 +00:00
mergify[bot]
712ddb75be fix: make changes that enable gantt view for job cards (backport #37661) (#37756)
fix: make changes that enable gantt view for job cards (#37661)

* fix: make changes that enable gantt view for job cards

* fix: add fields on listview and remove from json file

* fix: undo modified date

---------

Co-authored-by: Dietmar Fischer <fischer@kk-software.de>
(cherry picked from commit 500435b856)

Co-authored-by: Didiman1998 <118364772+Didiman1998@users.noreply.github.com>
2023-10-30 15:20:26 +05:30
Frappe PR Bot
78a9edf6c9 chore(release): Bumped to Version 14.45.4
## [14.45.4](https://github.com/frappe/erpnext/compare/v14.45.3...v14.45.4) (2023-10-30)

### Bug Fixes

* negative current qty causing recursion issue (backport [#37752](https://github.com/frappe/erpnext/issues/37752)) ([#37753](https://github.com/frappe/erpnext/issues/37753)) ([20ca948](20ca948e6b))
2023-10-30 08:55:38 +00:00
mergify[bot]
20ca948e6b fix: negative current qty causing recursion issue (backport #37752) (#37753)
fix: negative current qty causing recursion issue (#37752)

(cherry picked from commit f1407bcfd2)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-30 14:23:39 +05:30
rohitwaghchaure
f1407bcfd2 fix: negative current qty causing recursion issue (#37752) 2023-10-30 13:53:48 +05:30
mergify[bot]
b605b08ec1 refactor: remove extraneous disabled filters (backport #37732) (#37748)
* refactor: remove extraneous disabled filters

(cherry picked from commit f276fbba4f)

# Conflicts:
#	erpnext/accounts/report/profitability_analysis/profitability_analysis.js
#	erpnext/public/js/controllers/accounts.js

* chore: `conflicts`

---------

Co-authored-by: Bernd Oliver Sünderhauf <46800703+bosue@users.noreply.github.com>
Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-10-30 10:10:16 +05:30
mergify[bot]
fabcfc1fce fix(minor): set tax values for item variants (backport #37674) (#37738)
* fix: copy all child fields to item variant

(cherry picked from commit 5deba1b6f9)

* fix: only update if variant table empty

(cherry picked from commit d436a40739)

---------

Co-authored-by: Gursheen Anand <gursheen@frappe.io>
2023-10-29 12:16:34 +05:30
Anand Baburajan
cfb9d8c6be Merge pull request #37730 from frappe/mergify/copy/version-14/pr-37725
chore: allow wip_composite_asset in the MR PO PR PI flow (copy #37723) (copy #37725)
2023-10-27 19:31:38 +05:30
mergify[bot]
6a6a5b0a75 chore: allow wip_composite_asset in the MR PO PR PI flow (copy #37723) (#37725)
* chore: allow wip_composite_asset in the MR PO PR PI flow

(cherry picked from commit 0e5bea33a3)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.py

* chore: resolve conflict

---------

Co-authored-by: anandbaburajan <anandbaburajan@gmail.com>
(cherry picked from commit 3f296eea3a)
2023-10-27 13:26:16 +00:00
mergify[bot]
3f296eea3a chore: allow wip_composite_asset in the MR PO PR PI flow (copy #37723) (#37725)
* chore: allow wip_composite_asset in the MR PO PR PI flow

(cherry picked from commit 0e5bea33a3)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.py

* chore: resolve conflict

---------

Co-authored-by: anandbaburajan <anandbaburajan@gmail.com>
2023-10-27 18:54:47 +05:30
Deepesh Garg
ffdc11bbf6 fix(plaid): Do not sync pending transactions
(cherry picked from commit 46ea868559)

# Conflicts:
#	erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py
2023-10-27 06:08:46 +00:00
Frappe PR Bot
8e4e4a9fb4 chore(release): Bumped to Version 14.45.3
## [14.45.3](https://github.com/frappe/erpnext/compare/v14.45.2...v14.45.3) (2023-10-27)

### Bug Fixes

* typeerror on tds payable monthly report ([52cfe3f](52cfe3f612))
2023-10-27 03:54:13 +00:00
ruthra kumar
254dd3d9bf Merge pull request #37715 from frappe/mergify/bp/version-14/pr-37714
fix: typeerror on tds payable monthly report (backport #37714)
2023-10-27 09:22:22 +05:30
Frappe PR Bot
83b3785202 chore(release): Bumped to Version 14.45.2
## [14.45.2](https://github.com/frappe/erpnext/compare/v14.45.1...v14.45.2) (2023-10-27)

### Bug Fixes

* purchase receipt with stock and asset items ([848928e](848928e7d1))
2023-10-27 03:44:35 +00:00
Deepesh Garg
b017f4a817 Merge pull request #37712 from frappe/mergify/bp/version-14/pr-37705
fix: purchase receipt with stock and asset items (#37705)
2023-10-27 09:12:57 +05:30
ruthra kumar
52cfe3f612 fix: typeerror on tds payable monthly report
(cherry picked from commit fea27d5e2e)
2023-10-27 03:23:30 +00:00
ruthra kumar
fd21dcd3b5 Merge pull request #37714 from ruthra-kumar/fix_typeerror_in_tds_montly_report
fix: typeerror on tds payable monthly report
2023-10-27 08:52:11 +05:30
ruthra kumar
fea27d5e2e fix: typeerror on tds payable monthly report 2023-10-27 07:41:30 +05:30
Smit Vora
848928e7d1 fix: purchase receipt with stock and asset items
(cherry picked from commit 375be8cd93)
2023-10-26 17:53:09 +00:00
Deepesh Garg
0f4e50185e Merge pull request #37705 from vorasmit/backport-asserts
fix: purchase receipt with stock and asset items
2023-10-26 23:22:18 +05:30
mergify[bot]
a0893ddf96 fix(defaults): apply discount and provisonal defaults from item group and brand if available (backport #37466) (#37703)
fix(defaults): apply discount and provisonal defaults from item group and brand if available (#37466)

(cherry picked from commit 1612d7ba3f)

Co-authored-by: David Arnold <dgx.arnold@gmail.com>
2023-10-26 18:14:23 +05:30
mergify[bot]
556095daaa fix: avoid name clash in delivery stop (backport #37306) (#37701)
fix: avoid name clash in delivery stop (#37306)

* fix(stock): avoid name clash in delivery stop with Document.lock()

* chore(stock): format delivery stop json according to doctype builder

(cherry picked from commit 681782121c)

Co-authored-by: David Arnold <dgx.arnold@gmail.com>
2023-10-26 18:12:01 +05:30
Smit Vora
375be8cd93 fix: purchase receipt with stock and asset items 2023-10-26 17:59:42 +05:30
Frappe PR Bot
38665760cd chore(release): Bumped to Version 14.45.1
## [14.45.1](https://github.com/frappe/erpnext/compare/v14.45.0...v14.45.1) (2023-10-26)

### Bug Fixes

* add regional support to extend purchase gl entries ([7558b62](7558b622a4))
* update existing doc if possible ([e457d39](e457d39b5d))
2023-10-26 08:52:24 +00:00
Deepesh Garg
f5120a6dd0 Merge pull request #37699 from frappe/mergify/bp/version-14/pr-37687
fix: add regional support to extend purchase gl entries (#37595)
2023-10-26 14:20:48 +05:30
Deepesh Garg
519bf3d377 chore: resolve conflicts
(cherry picked from commit fa490ef2f0)
2023-10-26 08:45:32 +00:00
Deepesh Garg
cef2231d6a chore: resolve conflicts
(cherry picked from commit e01e9ebc37)
2023-10-26 08:45:32 +00:00
Smit Vora
e457d39b5d fix: update existing doc if possible
(cherry picked from commit ff7108a3b1)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
(cherry picked from commit 89f07dcfac)
2023-10-26 08:45:32 +00:00
Smit Vora
7558b622a4 fix: add regional support to extend purchase gl entries
(cherry picked from commit 77cc91d06b)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
#	erpnext/controllers/stock_controller.py
#	erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
(cherry picked from commit d02ebd6215)
2023-10-26 08:45:31 +00:00
mergify[bot]
c58fefb359 feat(delivery): link to delivery notes list view from delivery trip (backport #37604) (#37695)
feat(delivery): link to delivery notes list view from delivery trip

(cherry picked from commit 85488cd0dc)

Co-authored-by: David Arnold <dgx.arnold@gmail.com>
2023-10-26 13:12:44 +05:30
mergify[bot]
e96d5b314a feat: allow return of components for SCO that don't have SCR created (backport #37686) (#37692)
* feat: allow return of components for SCO that don't have SCR created

(cherry picked from commit 8e3b9ec879)

* fix: consider returned qty while calculating unsupplied qty

(cherry picked from commit 3290df5593)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-10-26 06:14:02 +00:00
Deepesh Garg
a615535ca5 Merge pull request #37687 from frappe/mergify/bp/version-14-hotfix/pr-37595
fix: add regional support to extend purchase gl entries (#37595)
2023-10-25 23:09:28 +05:30
Deepesh Garg
fa490ef2f0 chore: resolve conflicts 2023-10-25 19:46:51 +05:30
Deepesh Garg
e01e9ebc37 chore: resolve conflicts 2023-10-25 19:42:02 +05:30
Smit Vora
89f07dcfac fix: update existing doc if possible
(cherry picked from commit ff7108a3b1)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
2023-10-25 14:05:19 +00:00
Smit Vora
d02ebd6215 fix: add regional support to extend purchase gl entries
(cherry picked from commit 77cc91d06b)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
#	erpnext/controllers/stock_controller.py
#	erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
2023-10-25 14:05:17 +00:00
mergify[bot]
f5e9913746 refactor: rename field Over Order Allowance to Blanket Order Allowance (backport #37669) (#37681)
* refactor: rename field `Over Order Allowance` to `Blanket Order Allowance`

(cherry picked from commit 8ffa2bfe25)

* chore: patch to rename field `over_order_allowance`

(cherry picked from commit fcfcf6957e)

# Conflicts:
#	erpnext/patches.txt

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-10-25 09:55:24 +00:00
mergify[bot]
a7b75a4cc1 chore: fixed test case non_internal_transfer_delivery_note (backport #37671) (#37675)
chore: fixed test case non_internal_transfer_delivery_note (#37671)

(cherry picked from commit 2bcff4c7f2)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-25 13:50:01 +05:30
rohitwaghchaure
6b951bd17a chore(release): Bumped to Version 14.45.0 2023-10-25 12:30:31 +05:30
ruthra kumar
912c315286 Merge pull request #37667 from frappe/mergify/bp/version-14-hotfix/pr-37625
refactor: set exchange rate on foreign currency JE from Bank Reconciliation (backport #37625)
2023-10-25 12:24:37 +05:30
Frappe PR Bot
f35a0c227d chore: release v14 (#37654)
* fix(delivery): rename dt fetch stop action (backport #37605) (#37606)

fix(delivery): rename dt fetch stop action

(cherry picked from commit 79d51a0a0b)

Co-authored-by: David Arnold <dgx.arnold@gmail.com>

* fix: incorrect cost center in the purchase invoice (backport #37591) (#37609)

* fix: incorrect cost center in the purchase invoice (#37591)

(cherry picked from commit 14b009b093)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>

* fix(minor): filter bank accounts in bank statement import (#37525)

fix(minor): filter bank accounts in bank statement import (#37525)

fix: filter by company in bank account
(cherry picked from commit 9d392970f0)

Co-authored-by: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com>

* fix: set empty value for tax template in item details (#37496)

* fix: set empty value for tax template in item details (#37496)

* fix: empty tax template for items with invalid templates

* fix: test for empty tax template

* fix: test for item tax template calculation

* fix: test for pos inv tax template calculation

(cherry picked from commit b0d440c34b)

# Conflicts:
#	erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py

* chore: resolve conflicts

---------

Co-authored-by: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com>

* fix(minor): filter tax template based on company in subscription (#37562)

fix: filter tax template based on company

(cherry picked from commit 1a2f659de2)

Co-authored-by: Gursheen Anand <gursheen@frappe.io>

* fix: Cash flow mapping fix (#37522)

Cash flow mapping fix

* fix: remove from or target warehouse for non internal transfer entries (backport #37612) (#37628)

fix: remove from or target warehouse for non internal transfer entries (#37612)

(cherry picked from commit 5136fe196b)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>

* Revert "fix: set empty value for tax template in item details (#37496)"

Revert "fix: set empty value for tax template in item details (#37496)"

This reverts commit ec208b8df5.

* refactor: gain_loss posting date fields in the allocation table

(cherry picked from commit 55dbcee36a)

* refactor: introduce fields in popup

(cherry picked from commit 5323bb7bee)

* refactor: pass gain loss posting date to controller

(cherry picked from commit 7e600a6494)

* test: varying posting date for gain loss journal

(cherry picked from commit 514d5434a3)

* fix: overallocation on Payment with PO/SO

(cherry picked from commit 23df4205f8)

# Conflicts:
#	erpnext/accounts/utils.py

* test: overalloction on reconciliation when PO is involved

(cherry picked from commit 946228d783)

* refactor(test): make use of utility methods

(cherry picked from commit 547993f801)

* chore: fix flakiness `test_sales_order_partial_advance_payment`

(cherry picked from commit 4dff2c7a0d)

* chore: resolve conflict

* fix: close employee loan on write off (#37638)

* fix: exclude written off amount while calculating loan repayment

* fix: revert exclude written off amount while calculating loan repayment

* fix: close employee loan on write off

* refactor: button on PE to filter associated Journals

(cherry picked from commit 150728deaa)

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

* chore: resolve conflict

* fix: incorrect process loss validation for multiple finished items (backport #37576) (#37656)

fix: incorrect process loss validation for multiple finished items (#37576)

(cherry picked from commit 92cbe580e6)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>

* chore: fixed test cases related to Internal Transfer (#37659)

* fix: GL Entries for receiving non CWIP assets using Purchase Receipt (#37660)

* fix: GL Entries for receiving non CWIP assets using Purchase Receipt

* fix: rearrange functions

* chore: rearrange functions

* chore: rearrange functions

* fix: Purchase Invoice GL entires for assets

* test: cwip accounting unit tests

* chore: Attribute error

* chore: Purchase Invoice tests

* chore: Missing asset account

* chore: Missing asset account

* chore: update tests

* fix: Internal transfer GL Entries

* test: Deprecate tests

* test: Depricate tests

* test: Depricate tests

* chore: make `Reserve Stock` checkbox visible in SO

* refactor: rename field `Auto Reserve Stock for Sales Order`

* feat: add fields to hold SO and SO Item ref in PR Item

* test: Deprecate tests

* test: Depricate tests

* test: Depricate tests

* refactor: Remove expense included in valuation accounts

* chore: Add back default in transit warehousefield

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>

* fix: wrong german translation (#37658)

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: David Arnold <dgx.arnold@gmail.com>
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
Co-authored-by: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com>
Co-authored-by: Gursheen Anand <gursheen@frappe.io>
Co-authored-by: saeedkola <mohammedsaeedk@gmail.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-10-25 12:03:24 +05:30
ruthra kumar
2317f6a000 chore: resolve conflict 2023-10-25 11:27:51 +05:30
ruthra kumar
91130854d8 refactor: handle bank transaction in foreign currency
(cherry picked from commit 74a0d6408a)
2023-10-25 05:39:51 +00:00
ruthra kumar
677d728e67 refactor: exc rate on foreign currency JE from Bank Reconciliation
(cherry picked from commit 89f484282a)

# Conflicts:
#	erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py
2023-10-25 05:39:51 +00:00
Raffael Meyer
fa5780ca81 fix: wrong german translation (#37658) 2023-10-25 09:13:06 +05:30
Deepesh Garg
80774e2da1 fix: GL Entries for receiving non CWIP assets using Purchase Receipt (#37660)
* fix: GL Entries for receiving non CWIP assets using Purchase Receipt

* fix: rearrange functions

* chore: rearrange functions

* chore: rearrange functions

* fix: Purchase Invoice GL entires for assets

* test: cwip accounting unit tests

* chore: Attribute error

* chore: Purchase Invoice tests

* chore: Missing asset account

* chore: Missing asset account

* chore: update tests

* fix: Internal transfer GL Entries

* test: Deprecate tests

* test: Depricate tests

* test: Depricate tests

* chore: make `Reserve Stock` checkbox visible in SO

* refactor: rename field `Auto Reserve Stock for Sales Order`

* feat: add fields to hold SO and SO Item ref in PR Item

* test: Deprecate tests

* test: Depricate tests

* test: Depricate tests

* refactor: Remove expense included in valuation accounts

* chore: Add back default in transit warehousefield

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-10-25 09:12:27 +05:30
rohitwaghchaure
72d32a4901 chore: fixed test cases related to Internal Transfer (#37659) 2023-10-24 19:10:23 +05:30
mergify[bot]
638c271d70 fix: incorrect process loss validation for multiple finished items (backport #37576) (#37656)
fix: incorrect process loss validation for multiple finished items (#37576)

(cherry picked from commit 92cbe580e6)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-24 18:03:34 +05:30
ruthra kumar
356b1bdb38 Merge pull request #37647 from frappe/mergify/copy/version-14-hotfix/pr-37200
refactor: button in Payment Entry to filter associated Journals (copy #37200)
2023-10-24 10:23:53 +05:30
ruthra kumar
0b082f0edc chore: resolve conflict 2023-10-24 09:44:41 +05:30
ruthra kumar
be90be37c7 refactor: button on PE to filter associated Journals
(cherry picked from commit 150728deaa)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.js
2023-10-24 04:09:06 +00:00
Anand Baburajan
922ace4076 fix: close employee loan on write off (#37638)
* fix: exclude written off amount while calculating loan repayment

* fix: revert exclude written off amount while calculating loan repayment

* fix: close employee loan on write off
2023-10-24 09:38:08 +05:30
ruthra kumar
920de792ce Merge pull request #37646 from frappe/mergify/bp/version-14-hotfix/pr-37586
fix: overallocation on purchase order to multiple invoices (backport #37586)
2023-10-24 09:22:19 +05:30
ruthra kumar
d576fc7490 chore: resolve conflict 2023-10-24 08:48:53 +05:30
ruthra kumar
7b9daeff66 chore: fix flakiness test_sales_order_partial_advance_payment
(cherry picked from commit 4dff2c7a0d)
2023-10-24 03:14:52 +00:00
ruthra kumar
c921d7d409 refactor(test): make use of utility methods
(cherry picked from commit 547993f801)
2023-10-24 03:14:51 +00:00
ruthra kumar
c8922ad566 test: overalloction on reconciliation when PO is involved
(cherry picked from commit 946228d783)
2023-10-24 03:14:51 +00:00
ruthra kumar
d71b885fb8 fix: overallocation on Payment with PO/SO
(cherry picked from commit 23df4205f8)

# Conflicts:
#	erpnext/accounts/utils.py
2023-10-24 03:14:51 +00:00
ruthra kumar
f413530493 Merge pull request #37643 from frappe/mergify/bp/version-14-hotfix/pr-37630
refactor: configurable exchange gain or loss posting date (backport #37630)
2023-10-24 05:50:57 +05:30
ruthra kumar
ae788e8358 test: varying posting date for gain loss journal
(cherry picked from commit 514d5434a3)
2023-10-23 15:57:16 +00:00
ruthra kumar
515bed8c80 refactor: pass gain loss posting date to controller
(cherry picked from commit 7e600a6494)
2023-10-23 15:57:16 +00:00
ruthra kumar
063d658b04 refactor: introduce fields in popup
(cherry picked from commit 5323bb7bee)
2023-10-23 15:57:15 +00:00
ruthra kumar
fa7fa85d92 refactor: gain_loss posting date fields in the allocation table
(cherry picked from commit 55dbcee36a)
2023-10-23 15:57:14 +00:00
Deepesh Garg
ca13816ca1 Revert "fix: set empty value for tax template in item details (#37496)"
Revert "fix: set empty value for tax template in item details (#37496)"

This reverts commit ec208b8df5.
2023-10-23 15:11:33 +05:30
mergify[bot]
78b7c26420 fix: remove from or target warehouse for non internal transfer entries (backport #37612) (#37628)
fix: remove from or target warehouse for non internal transfer entries (#37612)

(cherry picked from commit 5136fe196b)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-23 12:27:01 +05:30
saeedkola
8e31379ecc fix: Cash flow mapping fix (#37522)
Cash flow mapping fix
2023-10-23 11:14:06 +05:30
mergify[bot]
c05e0a4ffc fix(minor): filter tax template based on company in subscription (#37562)
fix: filter tax template based on company

(cherry picked from commit 1a2f659de2)

Co-authored-by: Gursheen Anand <gursheen@frappe.io>
2023-10-23 11:01:23 +05:30
mergify[bot]
ec208b8df5 fix: set empty value for tax template in item details (#37496)
* fix: set empty value for tax template in item details (#37496)

* fix: empty tax template for items with invalid templates

* fix: test for empty tax template

* fix: test for item tax template calculation

* fix: test for pos inv tax template calculation

(cherry picked from commit b0d440c34b)

# Conflicts:
#	erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py

* chore: resolve conflicts

---------

Co-authored-by: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com>
2023-10-23 10:15:46 +05:30
mergify[bot]
1cb9f4cf8b fix(minor): filter bank accounts in bank statement import (#37525)
fix(minor): filter bank accounts in bank statement import (#37525)

fix: filter by company in bank account
(cherry picked from commit 9d392970f0)

Co-authored-by: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com>
2023-10-23 10:04:02 +05:30
mergify[bot]
50daf701dd fix: incorrect cost center in the purchase invoice (backport #37591) (#37609)
* fix: incorrect cost center in the purchase invoice (#37591)

(cherry picked from commit 14b009b093)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-20 17:02:56 +05:30
mergify[bot]
8660faaa54 fix(delivery): rename dt fetch stop action (backport #37605) (#37606)
fix(delivery): rename dt fetch stop action

(cherry picked from commit 79d51a0a0b)

Co-authored-by: David Arnold <dgx.arnold@gmail.com>
2023-10-20 16:12:42 +05:30
Frappe PR Bot
6931db98f1 chore(release): Bumped to Version 14.44.1
## [14.44.1](https://github.com/frappe/erpnext/compare/v14.44.0...v14.44.1) (2023-10-19)

### Bug Fixes

* billed_qty to show a sum of all invoiced qty from the purchase order item. (backport [#37539](https://github.com/frappe/erpnext/issues/37539)) ([#37558](https://github.com/frappe/erpnext/issues/37558)) ([ac7d6d6](ac7d6d6d59))
* consider received qty while creating SO -> MR (backport [#37414](https://github.com/frappe/erpnext/issues/37414)) ([#37514](https://github.com/frappe/erpnext/issues/37514)) ([1b94510](1b94510f08))
* don't set finance books if gross_purchase_amount is not set (backport [#37480](https://github.com/frappe/erpnext/issues/37480)) ([#37482](https://github.com/frappe/erpnext/issues/37482)) ([0590f21](0590f21814))
* e-commerce permissions for address ([#37554](https://github.com/frappe/erpnext/issues/37554)) ([022f85d](022f85dd08))
* german tranlations of "Is Return" ([f9b2355](f9b2355066))
* GL Entries not getting created for PR Return (backport [#37513](https://github.com/frappe/erpnext/issues/37513)) ([#37516](https://github.com/frappe/erpnext/issues/37516)) ([c32258e](c32258e4b6))
* **gp:** wrong `allocated_amount` on multi sales person invoice ([d266423](d266423011))
* Incorrect vat amount in KSA VAT report ([44f7de0](44f7de0f31))
* inflated total amt in TDS report using back calculation ([78e22af](78e22af3ca))
* Issues related to RFQ and Supplier Quotation on Portal (backport [#37565](https://github.com/frappe/erpnext/issues/37565)) ([#37577](https://github.com/frappe/erpnext/issues/37577)) ([e1504ef](e1504efd40))
* keep customer/supplier website role by default ([76ef61c](76ef61c24f))
* keyerror on gl and pl comparision report ([6f143d3](6f143d35aa))
* payment entry count on supplier dashboard (backport [#37571](https://github.com/frappe/erpnext/issues/37571)) ([#37575](https://github.com/frappe/erpnext/issues/37575)) ([95abd79](95abd7908f))
* same Serial No get mapped while creating SO -> DN ([#37527](https://github.com/frappe/erpnext/issues/37527)) ([5025850](5025850258))
* serial and batch no get removed on save of return DN ([#37476](https://github.com/frappe/erpnext/issues/37476)) ([f1814a1](f1814a1a2a))
* Stock Reconciliation Insufficient Stock Error ([#37494](https://github.com/frappe/erpnext/issues/37494)) ([9406ddb](9406ddbff0))
* **test:** project test case (backport [#37541](https://github.com/frappe/erpnext/issues/37541)) ([#37543](https://github.com/frappe/erpnext/issues/37543)) ([e23710b](e23710bf00))
* use `flt` to ignore TypeError ([#37481](https://github.com/frappe/erpnext/issues/37481)) ([d2b22db](d2b22db500))

### Performance Improvements

* index `dn_detail` in `Delivery Note Item` (backport [#37528](https://github.com/frappe/erpnext/issues/37528)) ([#37530](https://github.com/frappe/erpnext/issues/37530)) ([001c230](001c230688))
2023-10-19 11:36:28 +00:00
Deepesh Garg
fdb2e94b5c Merge pull request #37545 from frappe/version-14-hotfix
chore: release v14
2023-10-19 17:04:34 +05:30
mergify[bot]
e1504efd40 fix: Issues related to RFQ and Supplier Quotation on Portal (backport #37565) (#37577)
* fix: Issues related to RFQ and Supplier Quotation on Portal (#37565)

fix: RFQ and Supplier Quotation for Portal
(cherry picked from commit 2851a41310)

* chore: removed backport changes

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-19 13:50:55 +05:30
mergify[bot]
95abd7908f fix: payment entry count on supplier dashboard (backport #37571) (#37575)
fix: payment entry count on supplier dashboard (#37571)

(cherry picked from commit 10311ff114)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-19 13:38:24 +05:30
mergify[bot]
022f85dd08 fix: e-commerce permissions for address (#37554)
* fix: E-commerce permissions

(cherry picked from commit f4d74990fe)

# Conflicts:
#	erpnext/controllers/selling_controller.py

* chore: conflicts

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-10-18 17:21:46 +05:30
Deepesh Garg
837a6b5f50 Merge pull request #37555 from frappe/mergify/bp/version-14-hotfix/pr-37550
chore: Add accounting dimensions to Sales Order Item table (backport #37550)
2023-10-18 17:09:14 +05:30
ruthra kumar
f6a550faae Merge pull request #37569 from frappe/mergify/bp/version-14-hotfix/pr-37105
refactor: move `unreconcile` button into a drop down (backport #37105)
2023-10-18 16:31:52 +05:30
ruthra kumar
54f672e144 refactor: add unreconcile btn to purchase invoice
(cherry picked from commit 94ce43b0d5)
2023-10-18 10:58:20 +00:00
ruthra kumar
e8d082560a refactor: move unreconcile btn inside a drop down
(cherry picked from commit f2b0ac6868)
2023-10-18 10:58:19 +00:00
mergify[bot]
ac7d6d6d59 fix: billed_qty to show a sum of all invoiced qty from the purchase order item. (backport #37539) (#37558)
fix: billed_qty to show a sum of all invoiced qty from the purchase order item.

(cherry picked from commit 8a72f4f58a)

Co-authored-by: HarryPaulo <paulo_fabris@hotmail.com>
2023-10-18 06:00:29 +00:00
ruthra kumar
e2e89492e0 Merge pull request #37556 from frappe/mergify/bp/version-14-hotfix/pr-37549
refactor: use account in key while grouping voucher in ar/ap report (backport #37549)
2023-10-18 09:41:24 +05:30
ruthra kumar
760eab961d test: report output if party is missing
(cherry picked from commit 244cec64b2)
2023-10-18 03:40:35 +00:00
ruthra kumar
3499089323 refactor: use account in key while grouping voucher in ar/ap report
(cherry picked from commit 601ab4567e)
2023-10-18 03:40:34 +00:00
Deepesh Garg
7db6988364 chore: resolve conflicts 2023-10-18 09:00:49 +05:30
Deepesh Garg
bfa93cd3f6 chore: Add accounting dimensions to Sales Order Item table
(cherry picked from commit e31db18912)

# Conflicts:
#	erpnext/patches.txt
2023-10-17 17:25:57 +00:00
mergify[bot]
e23710bf00 fix(test): project test case (backport #37541) (#37543)
fix(test): project test case

(cherry picked from commit fd6aee15e6)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-10-17 15:03:16 +05:30
s-aga-r
5025850258 fix: same Serial No get mapped while creating SO -> DN (#37527)
* fix: same Serial No get mapped while creating SO -> DN

* test: add test case for DN with repetitive serial item
2023-10-17 12:20:23 +05:30
ruthra kumar
473610506c Merge pull request #37540 from frappe/mergify/bp/version-14-hotfix/pr-37330
refactor: checkbox to toggle exchange rate inheritence in PO->PI (backport #37330)
2023-10-17 10:55:27 +05:30
ruthra kumar
71cb7d37ee refactor: checkbox to toggle exchange rate inheritence in PO->PI
(cherry picked from commit 08315522bb)
2023-10-17 04:16:50 +00:00
Deepesh Garg
5b1016c17d Merge pull request #37524 from deepeshgarg007/ksa_vat
fix: Incorrect vat amount in KSA VAT report
2023-10-16 18:41:25 +05:30
Ankush Menat
d598dad50e Merge pull request #37533 from frappe/mergify/bp/version-14-hotfix/pr-37532
fix: keep customer/supplier website role by default (backport #37532)
2023-10-16 17:33:44 +05:30
Ankush Menat
76ef61c24f fix: keep customer/supplier website role by default
(cherry picked from commit d2096cfdb7)
2023-10-16 12:01:17 +00:00
mergify[bot]
001c230688 perf: index dn_detail in Delivery Note Item (backport #37528) (#37530)
* perf: index `dn_detail` in `Delivery Note Item`

(cherry picked from commit 5b4528e614)

# Conflicts:
#	erpnext/stock/doctype/delivery_note_item/delivery_note_item.json

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-10-16 16:48:55 +05:30
Deepesh Garg
44f7de0f31 fix: Incorrect vat amount in KSA VAT report 2023-10-16 14:37:16 +05:30
mergify[bot]
c32258e4b6 fix: GL Entries not getting created for PR Return (backport #37513) (#37516)
* fix: GL Entries not getting created for PR Return

(cherry picked from commit 46add06a29)

* test: add test case for PR return with zero rate

(cherry picked from commit 253d4782c6)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-10-16 01:24:10 +05:30
mergify[bot]
1b94510f08 fix: consider received qty while creating SO -> MR (backport #37414) (#37514)
fix: consider received qty while creating SO -> MR

(cherry picked from commit b2cee396ac)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-10-16 01:23:13 +05:30
ruthra kumar
65b7fb1293 Merge pull request #37511 from frappe/mergify/bp/version-14-hotfix/pr-37319
test: use fixtures for sales and purchase invoice (backport #37319)
2023-10-15 12:44:13 +05:30
ruthra kumar
d1f6d62d72 chore: fix flaky test case 2023-10-15 12:19:34 +05:30
ruthra kumar
77e7a6cde7 Merge pull request #37512 from ruthra-kumar/back_calculate_tds
fix: inflated total amt in TDS report using back calculation
2023-10-15 11:54:25 +05:30
ruthra kumar
78e22af3ca fix: inflated total amt in TDS report using back calculation 2023-10-15 11:23:52 +05:30
ruthra kumar
7f903532f3 chore: resovle conflicts 2023-10-15 10:44:37 +05:30
ruthra kumar
8d1eac89e3 refactor(test): make sure TDS Payable is available for testing
(cherry picked from commit fbabf4ac2e)
2023-10-15 04:47:43 +00:00
ruthra kumar
d78316869b refactor(test): make use of @change_settings in PI test cases
(cherry picked from commit 0207d6e7c9)
2023-10-15 04:47:43 +00:00
ruthra kumar
33becb7b32 refactor(test): use test fixture in purchase invoice
(cherry picked from commit a2e064d214)
2023-10-15 04:47:43 +00:00
ruthra kumar
b97fdbe6fc refactor(test): use test fixture in subscription
(cherry picked from commit 3bdf4f628c)

# Conflicts:
#	erpnext/accounts/doctype/subscription/test_subscription.py
2023-10-15 04:47:42 +00:00
ruthra kumar
5699a8daa2 refactor(test): use @change_settings to fix failing test cases
(cherry picked from commit de9baef84a)
2023-10-15 04:47:42 +00:00
ruthra kumar
91a5bd8615 refactor(test): fix broken test cases in Sales Invoice
(cherry picked from commit 8ebe5733ac)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
2023-10-15 04:47:42 +00:00
ruthra kumar
485cb7dd28 refactor(test): use @change_settings in sales invoice
(cherry picked from commit 58065f31b1)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
2023-10-15 04:47:42 +00:00
ruthra kumar
9d6b434d1f refactor(test): unset accounts frozen date
(cherry picked from commit fc50b174eb)
2023-10-15 04:47:41 +00:00
ruthra kumar
405d1528c3 test: use fixtures for sales and purchase invoice
(cherry picked from commit c322e5f381)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
2023-10-15 04:47:41 +00:00
s-aga-r
f1814a1a2a fix: serial and batch no get removed on save of return DN (#37476)
* fix: serial and batch no get removed on save of return DN

* test: add test case for DN return with product bundle
2023-10-15 09:57:39 +05:30
s-aga-r
9406ddbff0 fix: Stock Reconciliation Insufficient Stock Error (#37494)
* fix: Stock Reconciliation Insufficient Stock Error

* fix: linter

* test: add test case for Stock Reco Batch Item
2023-10-14 16:53:29 +05:30
ruthra kumar
bae6c5bf5f Merge pull request #37500 from frappe/mergify/bp/version-14-hotfix/pr-37435
fix(gp): wrong `allocated_amount` when grouped by Sales Person (backport #37435)
2023-10-14 12:54:33 +05:30
ruthra kumar
cf9acd1ff6 Merge pull request #37501 from frappe/mergify/bp/version-14-hotfix/pr-37495
fix: keyerror on gl and pl comparision report (backport #37495)
2023-10-14 12:54:09 +05:30
ruthra kumar
6f143d35aa fix: keyerror on gl and pl comparision report
(cherry picked from commit ad00df0af6)
2023-10-14 06:46:18 +00:00
Dany Robert
d266423011 fix(gp): wrong allocated_amount on multi sales person invoice
(cherry picked from commit bda82bf1e9)
2023-10-14 06:43:15 +00:00
s-aga-r
d2b22db500 fix: use flt to ignore TypeError (#37481) 2023-10-13 10:22:20 +05:30
ruthra kumar
c43d0b81e3 Merge pull request #37488 from frappe/mergify/bp/version-14-hotfix/pr-37484
refactor(patch): ignore links on closing balance patch (backport #37484)
2023-10-13 09:59:08 +05:30
ruthra kumar
cf0ab51348 refactor(patch): ignore links on closing balance patch
(cherry picked from commit 17ca8756a7)
2023-10-13 03:50:02 +00:00
mergify[bot]
0590f21814 fix: don't set finance books if gross_purchase_amount is not set (backport #37480) (#37482)
fix: don't set finance books if gross_purchase_amount is not set (#37480)

(cherry picked from commit 18e3a8907a)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-10-12 19:44:36 +05:30
Sagar Vora
bbdf26c82e Merge pull request #37468 from frappe/mergify/bp/version-14-hotfix/pr-37418
fix: german tranlations of "Is Return" (backport #37418)
2023-10-12 13:05:49 +05:30
ruthra kumar
020d2e2ca6 Merge pull request #37464 from frappe/mergify/bp/version-14-hotfix/pr-37436
refactor: for non-repost fields, don't validate (backport #37436)
2023-10-12 10:51:42 +05:30
ruthra kumar
f434548204 Merge pull request #37465 from frappe/mergify/bp/version-14-hotfix/pr-37459
refactor: add validation for Advances in SI/PI (backport #37459)
2023-10-12 10:51:18 +05:30
barredterra
f9b2355066 fix: german tranlations of "Is Return"
(cherry picked from commit 38ca164662)
2023-10-12 02:21:05 +00:00
Frappe PR Bot
2815952a03 chore(release): Bumped to Version 14.44.0
# [14.44.0](https://github.com/frappe/erpnext/compare/v14.43.1...v14.44.0) (2023-10-12)

### Bug Fixes

* added validation for the batch on stock reco ([#37174](https://github.com/frappe/erpnext/issues/37174)) ([4c337a6](4c337a6f44))
* ageing summary in AR ([15d2024](15d2024b8e))
* allocate amt for payment term invoices ([b22ac13](b22ac137f5))
* call validate before setting repost flag ([bec3e8e](bec3e8ed96))
* do not run bg job for single doc ([4123e7b](4123e7b244))
* **Employee:** enable `no_copy` for `relieving_date` (backport [#37344](https://github.com/frappe/erpnext/issues/37344)) ([#37358](https://github.com/frappe/erpnext/issues/37358)) ([2b38b78](2b38b780ba))
* exception on exporting errored rows ([e58b3b1](e58b3b11e9))
* fetch company details for Lead based quotation ([c1d40a6](c1d40a6bfa))
* fetch dependent task subject and project (backport [#37401](https://github.com/frappe/erpnext/issues/37401)) ([#37421](https://github.com/frappe/erpnext/issues/37421)) ([0aad942](0aad942312))
* ignore cancelled gle in voucher-wise balance report ([#36417](https://github.com/frappe/erpnext/issues/36417)) ([ee1255a](ee1255a716))
* incorrect status of the returned purchase receipt ([#37300](https://github.com/frappe/erpnext/issues/37300)) ([63f4573](63f45739e0))
* linting issues ([6c8a65e](6c8a65e03b))
* negative valuation rate in PR return ([#37424](https://github.com/frappe/erpnext/issues/37424)) ([26ad688](26ad688584))
* payment request rounding in multi-currency and on status update ([eed5863](eed58634ba))
* production plan reserved qty incorrect calculation (backport [#37400](https://github.com/frappe/erpnext/issues/37400)) ([#37458](https://github.com/frappe/erpnext/issues/37458)) ([573b159](573b159541))
* split inv allocated amt on server side ([06b0477](06b04770fc))
* typo in doctype name and qb ([606c99e](606c99e57c))
* **ux:** allow MR to Stop until fully received (backport [#37452](https://github.com/frappe/erpnext/issues/37452)) ([#37456](https://github.com/frappe/erpnext/issues/37456)) ([fb0b426](fb0b426fe4))
* validation for si ([3dc68e3](3dc68e3b00))

### Features

* add repost btn in invoice ([cde848d](cde848dc7f))
* allow on submit fields ([f5245f6](f5245f6b3f))
* allow repost for pi ([2d13dda](2d13dda49c))
* composite WIP asset ([#37352](https://github.com/frappe/erpnext/issues/37352)) ([0ecd7d2](0ecd7d2bf5))
* disable currency exchange api. ([#33593](https://github.com/frappe/erpnext/issues/33593)) ([1ca0516](1ca0516fe5))
* filter on voucher no ([cb35218](cb35218eec))
* introduce unreconcile doctype ([ae8355c](ae8355c953))
* UI for unreconcile ([9531a45](9531a45b94))
* unreconcile support for journal entry ([cd2d335](cd2d335256))
* validate negative stock for inventory dimension ([#37373](https://github.com/frappe/erpnext/issues/37373)) ([1480aca](1480acabb0))
2023-10-12 02:15:37 +00:00
Deepesh Garg
33f4fae8cd Merge pull request #37430 from frappe/version-14-hotfix
chore: release v14
2023-10-12 07:43:46 +05:30
ruthra kumar
d37a1811db refactor: add validation for Advances in SI/PI
(cherry picked from commit 0cdd6435a5)
2023-10-11 14:34:38 +00:00
ruthra kumar
8dd26949b7 refactor: for non-repost fields, don't validate
(cherry picked from commit c1782c5015)
2023-10-11 14:34:29 +00:00
s-aga-r
26ad688584 fix: negative valuation rate in PR return (#37424)
* fix: negative valuation rate in PR return

* test: add test case for PR return
2023-10-11 18:44:32 +05:30
Frappe PR Bot
48ceead9d0 chore(release): Bumped to Version 14.43.1
## [14.43.1](https://github.com/frappe/erpnext/compare/v14.43.0...v14.43.1) (2023-10-11)

### Bug Fixes

* fetch company details for Lead based quotation ([e4ed1d6](e4ed1d684d))
2023-10-11 11:14:16 +00:00
ruthra kumar
9dd33739f9 Merge pull request #37460 from frappe/mergify/bp/version-14/pr-37371
fix: fetch company details for Lead based quotation (backport #37370) (backport #37371)
2023-10-11 16:42:42 +05:30
ruthra kumar
e4ed1d684d fix: fetch company details for Lead based quotation
(cherry picked from commit f388864fd5)
(cherry picked from commit c1d40a6bfa)
2023-10-11 10:46:00 +00:00
mergify[bot]
573b159541 fix: production plan reserved qty incorrect calculation (backport #37400) (#37458)
fix: production plan reserved qty incorrect calculation (#37400)

(cherry picked from commit f3238f9105)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-11 14:41:32 +05:30
mergify[bot]
fb0b426fe4 fix(ux): allow MR to Stop until fully received (backport #37452) (#37456)
fix(ux): allow MR to Stop until fully received

(cherry picked from commit 0d7a0f393d)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-10-11 13:51:29 +05:30
ruthra kumar
63ff1f1eaa Merge pull request #37399 from frappe/mergify/bp/version-14-hotfix/pr-37194
feat: editable purchase invoice  (backport #37194)
2023-10-10 21:05:56 +05:30
ruthra kumar
4d79a4e7b3 Merge pull request #37420 from frappe/mergify/bp/version-14-hotfix/pr-37204
fix: allocate payment amount for split invoices in PE (backport #37204)
2023-10-10 21:04:26 +05:30
ruthra kumar
97f9656460 Merge pull request #37419 from frappe/mergify/bp/version-14-hotfix/pr-37123
fix: payment request rounding in multi-currency and on status update (backport #37123)
2023-10-10 21:03:52 +05:30
ruthra kumar
14ddcd6c24 Merge pull request #37427 from frappe/mergify/bp/version-14-hotfix/pr-36417
fix: ignore cancelled gle in voucher-wise balance report (backport #36417)
2023-10-10 21:03:21 +05:30
Deepesh Garg
9689c1fcec Merge branch 'version-14' into version-14-hotfix 2023-10-10 20:19:26 +05:30
Gursheen Kaur Anand
ee1255a716 fix: ignore cancelled gle in voucher-wise balance report (#36417)
fix: ignore cancelled gle
(cherry picked from commit 1ddfaa7605)
2023-10-10 08:09:32 +00:00
ruthra kumar
b0ac097327 chore: resolve conflicts 2023-10-10 11:31:19 +05:30
ruthra kumar
5d97a69e32 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-37194 2023-10-10 11:10:09 +05:30
mergify[bot]
0aad942312 fix: fetch dependent task subject and project (backport #37401) (#37421)
fix: fetch dependent task subject and project (#37401)

(cherry picked from commit 78eaf5d035)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-10-10 11:06:33 +05:30
ruthra kumar
debfbc4761 refactor: remove references in repost doctypes upon parent doc delet
(cherry picked from commit ed7f67b1a8)
2023-10-10 11:01:05 +05:30
Gursheen Anand
3dc68e3b00 fix: validation for si
(cherry picked from commit 61c6ebbb95)
2023-10-10 10:58:19 +05:30
Gursheen Anand
bec3e8ed96 fix: call validate before setting repost flag
(cherry picked from commit 8ef0d88708)
2023-10-10 10:58:19 +05:30
Gursheen Anand
4123e7b244 fix: do not run bg job for single doc
(cherry picked from commit 1856050ef9)
2023-10-10 10:58:19 +05:30
Gursheen Anand
c9bcf79e83 refactor: remove repeated validation for voucher
(cherry picked from commit a856091ff4)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.py
2023-10-10 10:58:19 +05:30
Gursheen Anand
677525b2cf refactor: use repost accounting legder
(cherry picked from commit 7ebf083683)
2023-10-10 10:58:19 +05:30
Gursheen Anand
8c83bbc096 refactor: remove unused method
(cherry picked from commit ba7212c98b)
2023-10-10 10:58:19 +05:30
Gursheen Anand
a512d27dbb test: reposted acc entries for pi
(cherry picked from commit c66c438575)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
2023-10-10 10:58:19 +05:30
Gursheen Anand
6c8a65e03b fix: linting issues
(cherry picked from commit c88f6d1fa7)
2023-10-10 10:58:19 +05:30
Gursheen Anand
2d13dda49c feat: allow repost for pi
(cherry picked from commit 23470bf52d)
2023-10-10 10:58:19 +05:30
Gursheen Anand
cde848dc7f feat: add repost btn in invoice
(cherry picked from commit e77814fbc0)
2023-10-10 10:58:19 +05:30
Gursheen Anand
79e414cb97 refactor: move reposting logic to common controller
(cherry picked from commit 68effd93bd)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.py
2023-10-10 10:58:19 +05:30
Gursheen Anand
f5245f6b3f feat: allow on submit fields
(cherry picked from commit e922ec60eb)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
2023-10-10 10:58:19 +05:30
ruthra kumar
dc804f216d Merge pull request #37402 from frappe/mergify/bp/version-14-hotfix/pr-36879
feat: Unreconcile Payments (backport #36879)
2023-10-10 10:39:54 +05:30
Gursheen Anand
bc0db696c9 chore: remove unused variable
(cherry picked from commit 545f2ccdf1)
2023-10-10 04:42:15 +00:00
Gursheen Anand
06b04770fc fix: split inv allocated amt on server side
(cherry picked from commit b3aa201eb5)
2023-10-10 04:42:15 +00:00
Gursheen Anand
b22ac137f5 fix: allocate amt for payment term invoices
(cherry picked from commit ac28a5b372)
2023-10-10 04:42:15 +00:00
David Arnold
eed58634ba fix: payment request rounding in multi-currency and on status update
(cherry picked from commit 6e1ad4c5bd)
2023-10-10 04:38:31 +00:00
mergify[bot]
24852e46c1 chore: rewrite query using query builder (backport #37310) (#37415)
* chore: rewrite query using query builder

(cherry picked from commit 25718f5cc7)

* chore: fix shopping cart tests

(cherry picked from commit fb51cae88b)

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-10-09 20:56:43 +05:30
Deepesh Garg
50521d4efe Merge pull request #37322 from frappe/mergify/bp/version-14-hotfix/pr-37119
chore: add regional support for getting payment entries (#37119)
2023-10-09 19:28:07 +05:30
ruthra kumar
8fc705ea6a chore: resolve conflicts 2023-10-09 15:17:47 +05:30
ruthra kumar
63274527d2 test: multi currency invoice unreconciliation
exchange gain/loss associated with the unreconcile invoice should be
cancelled as well

(cherry picked from commit d398775715)
2023-10-09 06:15:09 +00:00
ruthra kumar
aba51ee352 refactor(test): more modularization
(cherry picked from commit 5c09fdf941)
2023-10-09 06:15:09 +00:00
ruthra kumar
4bd83b5058 refactor: cancel gain/loss JE on multi currency transactions
(cherry picked from commit 1d93d66c30)
2023-10-09 06:15:09 +00:00
ruthra kumar
75d3093aea refactor: only cancel specific gain/loss je
(cherry picked from commit 5dbcf7d2b9)
2023-10-09 06:15:09 +00:00
ruthra kumar
669d692844 refactor: display allocated amount in account currency with symbol
(cherry picked from commit 6fd1c1bca2)
2023-10-09 06:15:09 +00:00
ruthra kumar
606c99e57c fix: typo in doctype name and qb
(cherry picked from commit 9a1588f1cc)
2023-10-09 06:15:08 +00:00
ruthra kumar
cf308912a1 test: more granular unreconciliation
(cherry picked from commit 67980188a7)
2023-10-09 06:15:08 +00:00
ruthra kumar
f5718390b7 refactor: unlink individual vouchers from payments
(cherry picked from commit 9b6eac23b6)
2023-10-09 06:15:08 +00:00
ruthra kumar
8954bd7759 chore: type info
(cherry picked from commit b4dc2bdf28)
2023-10-09 06:15:08 +00:00
ruthra kumar
3cbaea389b refactor: convert raw sql to query_builder
(cherry picked from commit 0130aea2aa)
2023-10-09 06:15:07 +00:00
ruthra kumar
335cb5fd28 refactor: single fetch and unlinking logic for JE and PE
(cherry picked from commit de910ab152)
2023-10-09 06:15:07 +00:00
ruthra kumar
cd2d335256 feat: unreconcile support for journal entry
(cherry picked from commit 285963acdb)
2023-10-09 06:15:07 +00:00
ruthra kumar
1a69db0f80 refactor: modularisation and group by voucher_no
(cherry picked from commit cce96669f0)
2023-10-09 06:15:07 +00:00
ruthra kumar
84e4a2509c chore: rename and add trigger in journal entry
(cherry picked from commit 0ccb6d8242)
2023-10-09 06:15:06 +00:00
ruthra kumar
f4e1959cc7 chore: code cleanup
(cherry picked from commit 69683776a5)
2023-10-09 06:15:06 +00:00
ruthra kumar
7651ecbc2b chore: fetch logic for payment entry
(cherry picked from commit 1981f3837a)
2023-10-09 06:15:06 +00:00
ruthra kumar
e464f5e419 chore: move functions to a separate file in utils
(cherry picked from commit 25fe752185)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.js
#	erpnext/public/js/erpnext.bundle.js
2023-10-09 06:15:06 +00:00
ruthra kumar
1e93d0bcc4 chore: move dialog building function to utils.js file
(cherry picked from commit 5981c7e0ad)
2023-10-09 06:15:05 +00:00
ruthra kumar
b886589657 refactor: add UI elements
(cherry picked from commit 58dc0e52e1)
2023-10-09 06:15:05 +00:00
ruthra kumar
3a670264b2 chore: delete unreoncile doc upon parent doc deletion
(cherry picked from commit 6bbe47c671)
2023-10-09 06:15:05 +00:00
ruthra kumar
2fd500ce26 chore: track changes
(cherry picked from commit 489a545bbb)
2023-10-09 06:15:04 +00:00
ruthra kumar
9422422dcc refactor: remove references using framework
(cherry picked from commit 42df0d3d67)
2023-10-09 06:15:04 +00:00
ruthra kumar
37fc82cd11 chore: delete references upon parent deletion
(cherry picked from commit fbdfb8151c)
2023-10-09 06:15:04 +00:00
ruthra kumar
cb35218eec feat: filter on voucher no
(cherry picked from commit 41eb2c9f5a)
2023-10-09 06:15:04 +00:00
ruthra kumar
9531a45b94 feat: UI for unreconcile
(cherry picked from commit fc6be5bfb9)
2023-10-09 06:15:03 +00:00
ruthra kumar
fb41f5f88c test: basic unreconcile function
(cherry picked from commit 0faffaa8db)
2023-10-09 06:15:03 +00:00
ruthra kumar
b9647ac0a4 refactor: adding 'Get Allocations' button
(cherry picked from commit 5114a9580d)
2023-10-09 06:15:03 +00:00
ruthra kumar
77fa0f68df chore: working state on barebones functions
(cherry picked from commit e48a90efe6)
2023-10-09 06:15:03 +00:00
ruthra kumar
ae8355c953 feat: introduce unreconcile doctype
(cherry picked from commit dc71623295)
2023-10-09 06:15:02 +00:00
ruthra kumar
c42ef922d2 Merge pull request #37396 from frappe/mergify/bp/version-14-hotfix/pr-37395
fix: exception on exporting errored rows (backport #37395)
2023-10-08 18:39:49 +05:30
ruthra kumar
e58b3b11e9 fix: exception on exporting errored rows
(cherry picked from commit d3c6000904)
2023-10-08 12:52:16 +00:00
ruthra kumar
8f0e10bfbe Merge pull request #37388 from frappe/mergify/bp/version-14-hotfix/pr-37289
fix: ageing summary in SOA AR (backport #37289)
2023-10-08 12:25:51 +05:30
Gursheen Kaur Anand
77d719af6e chore: linting issues 2023-10-07 15:40:27 +05:30
Gursheen Kaur Anand
3f59518d01 chore: resolve conflicts 2023-10-07 15:21:50 +05:30
Gursheen Anand
24b1100c8f test: process soa for gl and ar
(cherry picked from commit 644e25e587)
2023-10-07 09:40:32 +00:00
Gursheen Anand
c29eab12df refactor: separate function for statement dict
(cherry picked from commit 67f878ff8c)

# Conflicts:
#	erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py
2023-10-07 09:40:32 +00:00
Gursheen Anand
15d2024b8e fix: ageing summary in AR
(cherry picked from commit d9eb44e62d)
2023-10-07 09:40:32 +00:00
rohitwaghchaure
1480acabb0 feat: validate negative stock for inventory dimension (#37373)
* feat: validate negative stock for inventory dimension

* test: test case for validate negative stock for inv dimension
2023-10-06 17:55:32 +05:30
rohitwaghchaure
4c337a6f44 fix: added validation for the batch on stock reco (#37174) 2023-10-06 13:06:13 +05:30
rohitwaghchaure
63f45739e0 fix: incorrect status of the returned purchase receipt (#37300) 2023-10-06 11:58:15 +05:30
ruthra kumar
55a9a8fd51 Merge pull request #37371 from frappe/mergify/bp/version-14-hotfix/pr-37370
fix: fetch company details for Lead based quotation (backport #37370)
2023-10-05 14:25:14 +05:30
ruthra kumar
c1d40a6bfa fix: fetch company details for Lead based quotation
(cherry picked from commit f388864fd5)
2023-10-05 08:21:26 +00:00
ruthra kumar
bbc13c719e Merge pull request #37367 from frappe/mergify/bp/version-14-hotfix/pr-37359
refactor: add `access_key` field to facilitate use of exchangerate.host provider (backport #37359)
2023-10-05 12:57:41 +05:30
ruthra kumar
3b49079ad7 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-37359 2023-10-05 12:17:07 +05:30
ruthra kumar
6fad2bad11 Merge pull request #37369 from frappe/mergify/bp/version-14-hotfix/pr-33593
feat: disable currency exchange api. (backport #33593)
2023-10-05 10:25:40 +05:30
Devin Slauenwhite
1ca0516fe5 feat: disable currency exchange api. (#33593)
(cherry picked from commit 179a31ed5e)
2023-10-05 04:03:15 +00:00
ruthra kumar
04b8527ba8 chore: refactor test case for exchangerate.host provider
(cherry picked from commit c8e3dc6c4c)
2023-10-05 03:50:28 +00:00
ruthra kumar
98a9007e9f refactor: introduce access_key field
(cherry picked from commit 81591a34c2)

# Conflicts:
#	erpnext/accounts/doctype/currency_exchange_settings/currency_exchange_settings.json
2023-10-05 03:50:28 +00:00
ruthra kumar
64a50cfabf Merge pull request #37366 from frappe/mergify/bp/version-14-hotfix/pr-37294
refactor: block Payment Entry as ref in Journals from UI (backport #37294)
2023-10-05 09:20:20 +05:30
ruthra kumar
587a965bdf refactor: block Payment Entry as ref in JE from UI
(cherry picked from commit d391e81505)
2023-10-05 03:25:04 +00:00
ruthra kumar
52c0900576 Merge pull request #37363 from frappe/mergify/copy/version-14-hotfix/pr-37362
test: fixing test_capitalization_with_wip_composite_asset (copy #37362)
2023-10-05 08:38:20 +05:30
anandbaburajan
67a43c353c test: fixing test_capitalization_with_wip_composite_asset
(cherry picked from commit 9468513d7c)
2023-10-04 16:44:31 +00:00
mergify[bot]
2b38b780ba fix(Employee): enable no_copy for relieving_date (backport #37344) (#37358)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
Co-authored-by: Jignesh (GreyCube Technologies) <jignesh@greycube.in>
fix(Employee): enable `no_copy` for `relieving_date` (#37344)
2023-10-04 14:29:45 +05:30
Anand Baburajan
0ecd7d2bf5 feat: composite WIP asset (#37352)
feat: wip composite asset
2023-10-04 10:29:14 +05:30
Smit Vora
f7de825e89 chore: add regional support for getting payment entries (#37119)
chore: add regional support for get payment entries
(cherry picked from commit 3e282bfbce)
2023-10-02 10:32:40 +00:00
409 changed files with 9870 additions and 55674 deletions

View File

@@ -5,7 +5,7 @@ fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.3.0
hooks:
- id: trailing-whitespace
files: "erpnext.*"
@@ -15,6 +15,10 @@ repos:
args: ['--branch', 'develop']
- id: check-merge-conflict
- id: check-ast
- id: check-json
- id: check-toml
- id: check-yaml
- id: debug-statements
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4

View File

@@ -3,7 +3,7 @@ import inspect
import frappe
__version__ = "14.43.0"
__version__ = "14.57.0"
def get_default_company(user=None):

View File

@@ -53,8 +53,13 @@
},
"II. Forderungen und sonstige Vermögensgegenstände": {
"is_group": 1,
"Ford. a. Lieferungen und Leistungen": {
"Forderungen aus Lieferungen und Leistungen mit Kontokorrent": {
"account_number": "1400",
"account_type": "Receivable",
"is_group": 1
},
"Forderungen aus Lieferungen und Leistungen ohne Kontokorrent": {
"account_number": "1410",
"account_type": "Receivable"
},
"Durchlaufende Posten": {
@@ -180,8 +185,13 @@
},
"IV. Verbindlichkeiten aus Lieferungen und Leistungen": {
"is_group": 1,
"Verbindlichkeiten aus Lieferungen u. Leistungen": {
"Verbindlichkeiten aus Lieferungen und Leistungen mit Kontokorrent": {
"account_number": "1600",
"account_type": "Payable",
"is_group": 1
},
"Verbindlichkeiten aus Lieferungen und Leistungen ohne Kontokorrent": {
"account_number": "1610",
"account_type": "Payable"
}
},

View File

@@ -407,13 +407,10 @@
"Bewertungskorrektur zu Forderungen aus Lieferungen und Leistungen": {
"account_number": "9960"
},
"Debitoren": {
"is_group": 1,
"account_number": "10000"
},
"Forderungen aus Lieferungen und Leistungen": {
"Forderungen aus Lieferungen und Leistungen mit Kontokorrent": {
"account_number": "1200",
"account_type": "Receivable"
"account_type": "Receivable",
"is_group": 1
},
"Forderungen aus Lieferungen und Leistungen ohne Kontokorrent": {
"account_number": "1210"
@@ -1138,18 +1135,15 @@
"Bewertungskorrektur zu Verb. aus Lieferungen und Leistungen": {
"account_number": "9964"
},
"Kreditoren": {
"account_number": "70000",
"Verb. aus Lieferungen und Leistungen mit Kontokorrent": {
"account_number": "3300",
"account_type": "Payable",
"is_group": 1,
"Wareneingangs-­Verrechnungskonto" : {
"Wareneingangs-Verrechnungskonto" : {
"account_number": "70001",
"account_type": "Stock Received But Not Billed"
}
},
"Verb. aus Lieferungen und Leistungen": {
"account_number": "3300",
"account_type": "Payable"
},
"Verb. aus Lieferungen und Leistungen ohne Kontokorrent": {
"account_number": "3310"
},

View File

@@ -37,6 +37,7 @@ def make_closing_entries(closing_entries, voucher_name, company, closing_date):
}
)
cle.flags.ignore_permissions = True
cle.flags.ignore_links = True
cle.submit()

View File

@@ -301,3 +301,30 @@ def get_dimensions(with_cost_center_and_project=False):
default_dimensions_map[dimension.company][dimension.fieldname] = dimension.default_dimension
return dimension_filters, default_dimensions_map
def create_accounting_dimensions_for_doctype(doctype):
accounting_dimensions = frappe.db.get_all(
"Accounting Dimension", fields=["fieldname", "label", "document_type", "disabled"]
)
if not accounting_dimensions:
return
for d in accounting_dimensions:
field = frappe.db.get_value("Custom Field", {"dt": doctype, "fieldname": d.fieldname})
if field:
continue
df = {
"fieldname": d.fieldname,
"label": d.label,
"fieldtype": "Link",
"options": d.document_type,
"insert_after": "accounting_dimensions_section",
}
create_custom_field(doctype, df, ignore_validate=True)
frappe.clear_cache(doctype=doctype)

View File

@@ -68,7 +68,12 @@
"enable_party_matching",
"enable_fuzzy_matching",
"tab_break_dpet",
"show_balance_in_coa"
"show_balance_in_coa",
"reports_tab",
"remarks_section",
"general_ledger_remarks_length",
"column_break_lvjk",
"receivable_payable_remarks_length"
],
"fields": [
{
@@ -429,6 +434,34 @@
"fieldname": "show_balance_in_coa",
"fieldtype": "Check",
"label": "Show Balances in Chart Of Accounts"
},
{
"fieldname": "reports_tab",
"fieldtype": "Tab Break",
"label": "Reports"
},
{
"default": "0",
"description": "Truncates 'Remarks' column to set character length",
"fieldname": "general_ledger_remarks_length",
"fieldtype": "Int",
"label": "General Ledger"
},
{
"default": "0",
"description": "Truncates 'Remarks' column to set character length",
"fieldname": "receivable_payable_remarks_length",
"fieldtype": "Int",
"label": "Accounts Receivable/Payable"
},
{
"fieldname": "column_break_lvjk",
"fieldtype": "Column Break"
},
{
"fieldname": "remarks_section",
"fieldtype": "Section Break",
"label": "Remarks Column Length"
}
],
"icon": "icon-cog",
@@ -436,7 +469,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2023-07-27 15:05:34.000264",
"modified": "2023-11-20 09:37:47.650347",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",

View File

@@ -17,6 +17,7 @@ from erpnext.accounts.report.bank_reconciliation_statement.bank_reconciliation_s
get_entries,
)
from erpnext.accounts.utils import get_balance_on
from erpnext.setup.utils import get_exchange_rate
class BankReconciliationTool(Document):
@@ -129,7 +130,7 @@ def create_journal_entry_bts(
bank_transaction = frappe.db.get_values(
"Bank Transaction",
bank_transaction_name,
fieldname=["name", "deposit", "withdrawal", "bank_account"],
fieldname=["name", "deposit", "withdrawal", "bank_account", "currency"],
as_dict=True,
)[0]
company_account = frappe.get_value("Bank Account", bank_transaction.bank_account, "account")
@@ -143,29 +144,94 @@ def create_journal_entry_bts(
)
company = frappe.get_value("Account", company_account, "company")
company_default_currency = frappe.get_cached_value("Company", company, "default_currency")
company_account_currency = frappe.get_cached_value("Account", company_account, "account_currency")
second_account_currency = frappe.get_cached_value("Account", second_account, "account_currency")
# determine if multi-currency Journal or not
is_multi_currency = (
True
if company_default_currency != company_account_currency
or company_default_currency != second_account_currency
or company_default_currency != bank_transaction.currency
else False
)
accounts = []
# Multi Currency?
accounts.append(
{
"account": second_account,
"credit_in_account_currency": bank_transaction.deposit,
"debit_in_account_currency": bank_transaction.withdrawal,
"party_type": party_type,
"party": party,
"cost_center": get_default_cost_center(company),
}
)
second_account_dict = {
"account": second_account,
"account_currency": second_account_currency,
"credit_in_account_currency": bank_transaction.deposit,
"debit_in_account_currency": bank_transaction.withdrawal,
"party_type": party_type,
"party": party,
"cost_center": get_default_cost_center(company),
}
accounts.append(
{
"account": company_account,
"bank_account": bank_transaction.bank_account,
"credit_in_account_currency": bank_transaction.withdrawal,
"debit_in_account_currency": bank_transaction.deposit,
"cost_center": get_default_cost_center(company),
}
)
company_account_dict = {
"account": company_account,
"account_currency": company_account_currency,
"bank_account": bank_transaction.bank_account,
"credit_in_account_currency": bank_transaction.withdrawal,
"debit_in_account_currency": bank_transaction.deposit,
"cost_center": get_default_cost_center(company),
}
# convert transaction amount to company currency
if is_multi_currency:
exc_rate = get_exchange_rate(bank_transaction.currency, company_default_currency, posting_date)
withdrawal_in_company_currency = flt(exc_rate * abs(bank_transaction.withdrawal))
deposit_in_company_currency = flt(exc_rate * abs(bank_transaction.deposit))
else:
withdrawal_in_company_currency = bank_transaction.withdrawal
deposit_in_company_currency = bank_transaction.deposit
# if second account is of foreign currency, convert and set debit and credit fields.
if second_account_currency != company_default_currency:
exc_rate = get_exchange_rate(second_account_currency, company_default_currency, posting_date)
second_account_dict.update(
{
"exchange_rate": exc_rate,
"credit": deposit_in_company_currency,
"debit": withdrawal_in_company_currency,
"credit_in_account_currency": flt(deposit_in_company_currency / exc_rate) or 0,
"debit_in_account_currency": flt(withdrawal_in_company_currency / exc_rate) or 0,
}
)
else:
second_account_dict.update(
{
"exchange_rate": 1,
"credit": deposit_in_company_currency,
"debit": withdrawal_in_company_currency,
"credit_in_account_currency": deposit_in_company_currency,
"debit_in_account_currency": withdrawal_in_company_currency,
}
)
# if company account is of foreign currency, convert and set debit and credit fields.
if company_account_currency != company_default_currency:
exc_rate = get_exchange_rate(company_account_currency, company_default_currency, posting_date)
company_account_dict.update(
{
"exchange_rate": exc_rate,
"credit": withdrawal_in_company_currency,
"debit": deposit_in_company_currency,
}
)
else:
company_account_dict.update(
{
"exchange_rate": 1,
"credit": withdrawal_in_company_currency,
"debit": deposit_in_company_currency,
"credit_in_account_currency": withdrawal_in_company_currency,
"debit_in_account_currency": deposit_in_company_currency,
}
)
accounts.append(second_account_dict)
accounts.append(company_account_dict)
journal_entry_dict = {
"voucher_type": entry_type,
@@ -175,6 +241,9 @@ def create_journal_entry_bts(
"cheque_no": reference_number,
"mode_of_payment": mode_of_payment,
}
if is_multi_currency:
journal_entry_dict.update({"multi_currency": True})
journal_entry = frappe.new_doc("Journal Entry")
journal_entry.update(journal_entry_dict)
journal_entry.set("accounts", accounts)

View File

@@ -2,6 +2,16 @@
// For license information, please see license.txt
frappe.ui.form.on("Bank Statement Import", {
onload(frm) {
frm.set_query("bank_account", function (doc) {
return {
filters: {
company: doc.company,
},
};
});
},
setup(frm) {
frappe.realtime.on("data_import_refresh", ({ data_import }) => {
frm.import_in_progress = false;
@@ -352,10 +362,11 @@ frappe.ui.form.on("Bank Statement Import", {
export_errored_rows(frm) {
open_url_post(
"/api/method/frappe.core.doctype.data_import.data_import.download_errored_template",
"/api/method/erpnext.accounts.doctype.bank_statement_import.bank_statement_import.download_errored_template",
{
data_import_name: frm.doc.name,
}
},
true
);
},

View File

@@ -112,7 +112,8 @@ class AutoMatchbyPartyNameDescription:
for party in parties:
filters = {"status": "Active"} if party == "Employee" else {"disabled": 0}
names = frappe.get_all(party, filters=filters, pluck=party.lower() + "_name")
field = party.lower() + "_name"
names = frappe.get_all(party, filters=filters, fields=[f"{field} as party_name", "name"])
for field in ["bank_party_name", "description"]:
if not self.get(field):
@@ -131,7 +132,11 @@ class AutoMatchbyPartyNameDescription:
def fuzzy_search_and_return_result(self, party, names, field) -> Union[Tuple, None]:
skip = False
result = process.extract(query=self.get(field), choices=names, scorer=fuzz.token_set_ratio)
result = process.extract(
query=self.get(field),
choices={row.get("name"): row.get("party_name") for row in names},
scorer=fuzz.token_set_ratio,
)
party_name, skip = self.process_fuzzy_result(result)
if not party_name:
@@ -149,14 +154,14 @@ class AutoMatchbyPartyNameDescription:
Returns: Result, Skip (whether or not to discontinue matching)
"""
PARTY, SCORE, CUTOFF = 0, 1, 80
SCORE, PARTY_ID, CUTOFF = 1, 2, 80
if not result or not len(result):
return None, False
first_result = result[0]
if len(result) == 1:
return (first_result[PARTY] if first_result[SCORE] > CUTOFF else None), True
return (first_result[PARTY_ID] if first_result[SCORE] > CUTOFF else None), True
second_result = result[1]
if first_result[SCORE] > CUTOFF:
@@ -165,7 +170,7 @@ class AutoMatchbyPartyNameDescription:
if first_result[SCORE] == second_result[SCORE]:
return None, True
return first_result[PARTY], True
return first_result[PARTY_ID], True
else:
return None, False

View File

@@ -89,7 +89,6 @@ class BankTransaction(StatusUpdater):
- 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:

View File

@@ -53,10 +53,18 @@ frappe.ui.form.on('Chart of Accounts Importer', {
of Accounts. Please enter the account names and add more rows as per your requirement.`);
}
}
}
},
{
label : "Company",
fieldname: "company",
fieldtype: "Link",
reqd: 1,
hidden: 1,
default: frm.doc.company,
},
],
primary_action: function() {
var data = d.get_values();
let data = d.get_values();
if (!data.template_type) {
frappe.throw(__('Please select <b>Template Type</b> to download template'));
@@ -66,7 +74,8 @@ frappe.ui.form.on('Chart of Accounts Importer', {
'/api/method/erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.download_template',
{
file_type: data.file_type,
template_type: data.template_type
template_type: data.template_type,
company: data.company
}
);

View File

@@ -8,6 +8,7 @@ from functools import reduce
import frappe
from frappe import _
from frappe.desk.form.linked_with import get_linked_fields
from frappe.model.document import Document
from frappe.utils import cint, cstr
from frappe.utils.csvutils import UnicodeWriter
@@ -112,7 +113,7 @@ def generate_data_from_csv(file_doc, as_dict=False):
if as_dict:
data.append({frappe.scrub(header): row[index] for index, header in enumerate(headers)})
else:
if not row[1]:
if not row[1] and len(row) > 1:
row[1] = row[0]
row[3] = row[2]
data.append(row)
@@ -294,10 +295,8 @@ def build_response_as_excel(writer):
@frappe.whitelist()
def download_template(file_type, template_type):
data = frappe._dict(frappe.local.form_dict)
writer = get_template(template_type)
def download_template(file_type, template_type, company):
writer = get_template(template_type, company)
if file_type == "CSV":
# download csv file
@@ -308,8 +307,7 @@ def download_template(file_type, template_type):
build_response_as_excel(writer)
def get_template(template_type):
def get_template(template_type, company):
fields = [
"Account Name",
"Parent Account",
@@ -335,34 +333,17 @@ def get_template(template_type):
["", "", "", "", 0, account_type.get("account_type"), account_type.get("root_type")]
)
else:
writer = get_sample_template(writer)
writer = get_sample_template(writer, company)
return writer
def get_sample_template(writer):
template = [
["Application Of Funds(Assets)", "", "", "", 1, "", "Asset"],
["Sources Of Funds(Liabilities)", "", "", "", 1, "", "Liability"],
["Equity", "", "", "", 1, "", "Equity"],
["Expenses", "", "", "", 1, "", "Expense"],
["Income", "", "", "", 1, "", "Income"],
["Bank Accounts", "Application Of Funds(Assets)", "", "", 1, "Bank", "Asset"],
["Cash In Hand", "Application Of Funds(Assets)", "", "", 1, "Cash", "Asset"],
["Stock Assets", "Application Of Funds(Assets)", "", "", 1, "Stock", "Asset"],
["Cost Of Goods Sold", "Expenses", "", "", 0, "Cost of Goods Sold", "Expense"],
["Asset Depreciation", "Expenses", "", "", 0, "Depreciation", "Expense"],
["Fixed Assets", "Application Of Funds(Assets)", "", "", 0, "Fixed Asset", "Asset"],
["Accounts Payable", "Sources Of Funds(Liabilities)", "", "", 0, "Payable", "Liability"],
["Accounts Receivable", "Application Of Funds(Assets)", "", "", 1, "Receivable", "Asset"],
["Stock Expenses", "Expenses", "", "", 0, "Stock Adjustment", "Expense"],
["Sample Bank", "Bank Accounts", "", "", 0, "Bank", "Asset"],
["Cash", "Cash In Hand", "", "", 0, "Cash", "Asset"],
["Stores", "Stock Assets", "", "", 0, "Stock", "Asset"],
]
for row in template:
writer.writerow(row)
def get_sample_template(writer, company):
currency = frappe.db.get_value("Company", company, "default_currency")
with open(os.path.join(os.path.dirname(__file__), "coa_sample_template.csv"), "r") as f:
for row in f:
row = row.strip().split(",") + [currency]
writer.writerow(row)
return writer
@@ -453,14 +434,11 @@ def get_mandatory_account_types():
def unset_existing_data(company):
linked = frappe.db.sql(
'''select fieldname from tabDocField
where fieldtype="Link" and options="Account" and parent="Company"''',
as_dict=True,
)
# remove accounts data from company
update_values = {d.fieldname: "" for d in linked}
fieldnames = get_linked_fields("Account").get("Company", {}).get("fieldname", [])
linked = [{"fieldname": name} for name in fieldnames]
update_values = {d.get("fieldname"): "" for d in linked}
frappe.db.set_value("Company", company, update_values, update_values)
# remove accounts data from various doctypes

View File

@@ -0,0 +1,17 @@
Application Of Funds(Assets),,,,1,,Asset
Sources Of Funds(Liabilities),,,,1,,Liability
Equity,,,,1,,Equity
Expenses,,,,1,Expense Account,Expense
Income,,,,1,Income Account,Income
Bank Accounts,Application Of Funds(Assets),,,1,Bank,Asset
Cash In Hand,Application Of Funds(Assets),,,1,Cash,Asset
Stock Assets,Application Of Funds(Assets),,,1,Stock,Asset
Cost Of Goods Sold,Expenses,,,0,Cost of Goods Sold,Expense
Asset Depreciation,Expenses,,,0,Depreciation,Expense
Fixed Assets,Application Of Funds(Assets),,,0,Fixed Asset,Asset
Accounts Payable,Sources Of Funds(Liabilities),,,0,Payable,Liability
Accounts Receivable,Application Of Funds(Assets),,,1,Receivable,Asset
Stock Expenses,Expenses,,,0,Stock Adjustment,Expense
Sample Bank,Bank Accounts,,,0,Bank,Asset
Cash,Cash In Hand,,,0,Cash,Asset
Stores,Stock Assets,,,0,Stock,Asset
1 Application Of Funds(Assets) 1 Asset
2 Sources Of Funds(Liabilities) 1 Liability
3 Equity 1 Equity
4 Expenses 1 Expense Account Expense
5 Income 1 Income Account Income
6 Bank Accounts Application Of Funds(Assets) 1 Bank Asset
7 Cash In Hand Application Of Funds(Assets) 1 Cash Asset
8 Stock Assets Application Of Funds(Assets) 1 Stock Asset
9 Cost Of Goods Sold Expenses 0 Cost of Goods Sold Expense
10 Asset Depreciation Expenses 0 Depreciation Expense
11 Fixed Assets Application Of Funds(Assets) 0 Fixed Asset Asset
12 Accounts Payable Sources Of Funds(Liabilities) 0 Payable Liability
13 Accounts Receivable Application Of Funds(Assets) 1 Receivable Asset
14 Stock Expenses Expenses 0 Stock Adjustment Expense
15 Sample Bank Bank Accounts 0 Bank Asset
16 Cash Cash In Hand 0 Cash Asset
17 Stores Stock Assets 0 Stock Asset

View File

@@ -6,8 +6,10 @@
"engine": "InnoDB",
"field_order": [
"api_details_section",
"disabled",
"service_provider",
"api_endpoint",
"access_key",
"url",
"column_break_3",
"help",
@@ -77,12 +79,24 @@
"label": "Service Provider",
"options": "frankfurter.app\nexchangerate.host\nCustom",
"reqd": 1
},
{
"default": "0",
"fieldname": "disabled",
"fieldtype": "Check",
"label": "Disabled"
},
{
"depends_on": "eval:doc.service_provider == 'exchangerate.host';",
"fieldname": "access_key",
"fieldtype": "Data",
"label": "Access Key"
}
],
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2022-01-10 15:51:14.521174",
"modified": "2023-10-04 15:30:25.333860",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Currency Exchange Settings",

View File

@@ -18,11 +18,21 @@ class CurrencyExchangeSettings(Document):
def set_parameters_and_result(self):
if self.service_provider == "exchangerate.host":
if not self.access_key:
frappe.throw(
_("Access Key is required for Service Provider: {0}").format(
frappe.bold(self.service_provider)
)
)
self.set("result_key", [])
self.set("req_params", [])
self.api_endpoint = "https://api.exchangerate.host/convert"
self.append("result_key", {"key": "result"})
self.append("req_params", {"key": "access_key", "value": self.access_key})
self.append("req_params", {"key": "amount", "value": "1"})
self.append("req_params", {"key": "date", "value": "{transaction_date}"})
self.append("req_params", {"key": "from", "value": "{from_currency}"})
self.append("req_params", {"key": "to", "value": "{to_currency}"})

View File

@@ -192,7 +192,7 @@ class ExchangeRateRevaluation(Document):
# round off balance based on currency precision
# and consider debit-credit difference allowance
currency_precision = get_currency_precision()
rounding_loss_allowance = float(rounding_loss_allowance) or 0.05
rounding_loss_allowance = float(rounding_loss_allowance)
for acc in account_details:
acc.balance_in_account_currency = flt(acc.balance_in_account_currency, currency_precision)
if abs(acc.balance_in_account_currency) <= rounding_loss_allowance:

View File

@@ -138,8 +138,7 @@
"label": "Against Voucher Type",
"oldfieldname": "against_voucher_type",
"oldfieldtype": "Data",
"options": "DocType",
"search_index": 1
"options": "DocType"
},
{
"fieldname": "against_voucher",
@@ -158,8 +157,7 @@
"label": "Voucher Type",
"oldfieldname": "voucher_type",
"oldfieldtype": "Select",
"options": "DocType",
"search_index": 1
"options": "DocType"
},
{
"fieldname": "voucher_no",
@@ -291,4 +289,4 @@
"search_fields": "voucher_no,account,posting_date,against_voucher",
"sort_field": "modified",
"sort_order": "DESC"
}
}

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', 'Journal Entry', 'Repost Payment Ledger', 'Asset', 'Asset Movement', 'Repost Accounting Ledger'];
frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice', 'Journal Entry', "Repost Payment Ledger", 'Asset', 'Asset Movement', "Repost Accounting Ledger", "Unreconcile Payment", "Unreconcile Payment Entries"];
},
refresh: function(frm) {
@@ -50,8 +50,18 @@ frappe.ui.form.on("Journal Entry", {
frm.trigger("make_inter_company_journal_entry");
}, __('Make'));
}
},
erpnext.accounts.unreconcile_payment.add_unreconcile_btn(frm);
},
before_save: function(frm) {
if ((frm.doc.docstatus == 0) && (!frm.doc.is_system_generated)) {
let payment_entry_references = frm.doc.accounts.filter(elem => (elem.reference_type == "Payment Entry"));
if (payment_entry_references.length > 0) {
let rows = payment_entry_references.map(x => "#"+x.idx);
frappe.throw(__("Rows: {0} have 'Payment Entry' as reference_type. This should not be set manually.", [frappe.utils.comma_and(rows)]));
}
}
},
make_inter_company_journal_entry: function(frm) {
var d = new frappe.ui.Dialog({
title: __("Select Company"),

View File

@@ -548,8 +548,16 @@
"icon": "fa fa-file-text",
"idx": 176,
"is_submittable": 1,
"links": [],
"modified": "2023-08-10 14:32:22.366895",
"links": [
{
"is_child_table": 1,
"link_doctype": "Bank Transaction Payments",
"link_fieldname": "payment_entry",
"parent_doctype": "Bank Transaction",
"table_fieldname": "payment_entries"
}
],
"modified": "2023-11-23 12:11:04.128015",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry",

View File

@@ -98,6 +98,8 @@ class JournalEntry(AccountsController):
"Repost Payment Ledger Items",
"Repost Accounting Ledger",
"Repost Accounting Ledger Items",
"Unreconcile Payment",
"Unreconcile Payment Entries",
)
self.make_gl_entries(1)
self.update_advance_paid()
@@ -496,7 +498,7 @@ class JournalEntry(AccountsController):
).format(d.reference_name, d.account)
)
else:
dr_or_cr = "debit" if d.credit > 0 else "credit"
dr_or_cr = "debit" if flt(d.credit) > 0 else "credit"
valid = False
for jvd in against_entries:
if flt(jvd[dr_or_cr]) > 0:

View File

@@ -203,7 +203,8 @@
"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\nPayment Entry"
"options": "\nSales Invoice\nPurchase Invoice\nJournal Entry\nSales Order\nPurchase Order\nExpense Claim\nAsset\nLoan\nPayroll Entry\nEmployee Advance\nExchange Rate Revaluation\nInvoice Discounting\nFees\nFull and Final Statement\nPayment Entry",
"search_index": 1
},
{
"fieldname": "reference_name",
@@ -211,7 +212,8 @@
"in_list_view": 1,
"label": "Reference Name",
"no_copy": 1,
"options": "reference_type"
"options": "reference_type",
"search_index": 1
},
{
"depends_on": "eval:doc.reference_type&&!in_list(doc.reference_type, ['Expense Claim', 'Asset', 'Employee Loan', 'Employee Advance'])",
@@ -278,13 +280,14 @@
"fieldtype": "Data",
"hidden": 1,
"label": "Reference Detail No",
"no_copy": 1
"no_copy": 1,
"search_index": 1
}
],
"idx": 1,
"istable": 1,
"links": [],
"modified": "2023-06-16 14:11:13.507807",
"modified": "2023-11-23 11:44:25.841187",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry Account",

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', 'Journal Entry', 'Repost Payment Ledger','Repost Accounting Ledger'];
frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice', 'Journal Entry', 'Repost Payment Ledger','Repost Accounting Ledger', 'Unreconcile Payment', 'Unreconcile Payment Entries'];
if(frm.doc.__islocal) {
if (!frm.doc.paid_from) frm.set_value("paid_from_account_currency", null);
@@ -152,6 +152,13 @@ frappe.ui.form.on('Payment Entry', {
frm.events.hide_unhide_fields(frm);
frm.events.set_dynamic_labels(frm);
frm.events.show_general_ledger(frm);
if((frm.doc.references) && (frm.doc.references.find((elem) => {return elem.exchange_gain_loss != 0}))) {
frm.add_custom_button(__("View Exchange Gain/Loss Journals"), function() {
frappe.set_route("List", "Journal Entry", {"voucher_type": "Exchange Gain Or Loss", "reference_name": frm.doc.name});
}, __('Actions'));
}
erpnext.accounts.unreconcile_payment.add_unreconcile_btn(frm);
},
validate_company: (frm) => {
@@ -822,7 +829,6 @@ frappe.ui.form.on('Payment Entry', {
else
total_negative_outstanding += Math.abs(flt(row.outstanding_amount));
})
var allocated_negative_outstanding = 0;
if (
(frm.doc.payment_type=="Receive" && frm.doc.party_type=="Customer") ||
@@ -837,6 +843,7 @@ frappe.ui.form.on('Payment Entry', {
var allocated_positive_outstanding = paid_amount + allocated_negative_outstanding;
} else if (in_list(["Customer", "Supplier"], frm.doc.party_type)) {
total_negative_outstanding = flt(total_negative_outstanding, precision("outstanding_amount"))
if(paid_amount > total_negative_outstanding) {
if(total_negative_outstanding == 0) {
frappe.msgprint(

View File

@@ -739,8 +739,16 @@
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2023-06-19 11:38:04.387219",
"links": [
{
"is_child_table": 1,
"link_doctype": "Bank Transaction Payments",
"link_fieldname": "payment_entry",
"parent_doctype": "Bank Transaction",
"table_fieldname": "payment_entries"
}
],
"modified": "2023-11-23 12:07:20.887885",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry",
@@ -786,4 +794,4 @@
"states": [],
"title_field": "title",
"track_changes": 1
}
}

View File

@@ -9,6 +9,8 @@ import frappe
from frappe import ValidationError, _, qb, scrub, throw
from frappe.utils import cint, comma_or, flt, getdate, nowdate
from frappe.utils.data import comma_and, fmt_money
from pypika import Case
from pypika.functions import Coalesce, Sum
import erpnext
from erpnext.accounts.doctype.bank_account.bank_account import (
@@ -107,6 +109,8 @@ class PaymentEntry(AccountsController):
"Repost Payment Ledger Items",
"Repost Accounting Ledger",
"Repost Accounting Ledger Items",
"Unreconcile Payment",
"Unreconcile Payment Entries",
)
super(PaymentEntry, self).on_cancel()
self.make_gl_entries(cancel=1)
@@ -227,16 +231,18 @@ class PaymentEntry(AccountsController):
# if no payment template is used by invoice and has a custom term(no `payment_term`), then invoice outstanding will be in 'None' key
latest = latest.get(d.payment_term) or latest.get(None)
# The reference has already been fully paid
if not latest:
frappe.throw(
_("{0} {1} has already been fully paid.").format(_(d.reference_doctype), d.reference_name)
)
# The reference has already been partly paid
elif latest.outstanding_amount < latest.invoice_amount and flt(
d.outstanding_amount, d.precision("outstanding_amount")
) != flt(latest.outstanding_amount, d.precision("outstanding_amount")):
elif (
latest.outstanding_amount < latest.invoice_amount
and flt(d.outstanding_amount, d.precision("outstanding_amount"))
!= flt(latest.outstanding_amount, d.precision("outstanding_amount"))
and d.payment_term == ""
):
frappe.throw(
_(
"{0} {1} has already been partly paid. Please use the 'Get Outstanding Invoice' or the 'Get Outstanding Orders' button to get the latest outstanding amounts."
@@ -909,8 +915,11 @@ class PaymentEntry(AccountsController):
):
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 = flt(
sum(
abs(flt(d.outstanding_amount)) for d in self.get("references") if flt(d.outstanding_amount) < 0
),
self.references[0].precision("outstanding_amount") if self.references else None,
)
paid_amount = self.paid_amount if self.payment_type == "Receive" else self.received_amount
@@ -1545,13 +1554,43 @@ def get_outstanding_reference_documents(args):
return data
def split_invoices_based_on_payment_terms(outstanding_invoices, company):
invoice_ref_based_on_payment_terms = {}
def split_invoices_based_on_payment_terms(outstanding_invoices, company) -> list:
"""Split a list of invoices based on their payment terms."""
exc_rates = get_currency_data(outstanding_invoices, company)
outstanding_invoices_after_split = []
for entry in outstanding_invoices:
if entry.voucher_type in ["Sales Invoice", "Purchase Invoice"]:
if payment_term_template := frappe.db.get_value(
entry.voucher_type, entry.voucher_no, "payment_terms_template"
):
split_rows = get_split_invoice_rows(entry, payment_term_template, exc_rates)
if not split_rows:
continue
if len(split_rows) > 1:
frappe.msgprint(
_("Splitting {0} {1} into {2} rows as per Payment Terms").format(
_(entry.voucher_type), frappe.bold(entry.voucher_no), len(split_rows)
),
alert=True,
)
outstanding_invoices_after_split += split_rows
continue
# If not an invoice or no payment terms template, add as it is
outstanding_invoices_after_split.append(entry)
return outstanding_invoices_after_split
def get_currency_data(outstanding_invoices: list, company: str = None) -> dict:
"""Get currency and conversion data for a list of invoices."""
exc_rates = frappe._dict()
company_currency = (
frappe.db.get_value("Company", company, "default_currency") if company else None
)
exc_rates = frappe._dict()
for doctype in ["Sales Invoice", "Purchase Invoice"]:
invoices = [x.voucher_no for x in outstanding_invoices if x.voucher_type == doctype]
for x in frappe.db.get_all(
@@ -1566,72 +1605,54 @@ def split_invoices_based_on_payment_terms(outstanding_invoices, company):
company_currency=company_currency,
)
for idx, d in enumerate(outstanding_invoices):
if d.voucher_type in ["Sales Invoice", "Purchase Invoice"]:
payment_term_template = frappe.db.get_value(
d.voucher_type, d.voucher_no, "payment_terms_template"
return exc_rates
def get_split_invoice_rows(invoice: dict, payment_term_template: str, exc_rates: dict) -> list:
"""Split invoice based on its payment schedule table."""
split_rows = []
allocate_payment_based_on_payment_terms = frappe.db.get_value(
"Payment Terms Template", payment_term_template, "allocate_payment_based_on_payment_terms"
)
if not allocate_payment_based_on_payment_terms:
return [invoice]
payment_schedule = frappe.get_all(
"Payment Schedule", filters={"parent": invoice.voucher_no}, fields=["*"], order_by="due_date"
)
for payment_term in payment_schedule:
if not payment_term.outstanding > 0.1:
continue
doc_details = exc_rates.get(payment_term.parent, None)
is_multi_currency_acc = (doc_details.currency != doc_details.company_currency) and (
doc_details.party_account_currency != doc_details.company_currency
)
payment_term_outstanding = flt(payment_term.outstanding)
if not is_multi_currency_acc:
payment_term_outstanding = doc_details.conversion_rate * flt(payment_term.outstanding)
split_rows.append(
frappe._dict(
{
"due_date": invoice.due_date,
"currency": invoice.currency,
"voucher_no": invoice.voucher_no,
"voucher_type": invoice.voucher_type,
"posting_date": invoice.posting_date,
"invoice_amount": flt(invoice.invoice_amount),
"outstanding_amount": payment_term_outstanding
if payment_term_outstanding
else invoice.outstanding_amount,
"payment_term_outstanding": payment_term_outstanding,
"payment_amount": payment_term.payment_amount,
"payment_term": payment_term.payment_term,
}
)
if payment_term_template:
allocate_payment_based_on_payment_terms = frappe.db.get_value(
"Payment Terms Template", payment_term_template, "allocate_payment_based_on_payment_terms"
)
if allocate_payment_based_on_payment_terms:
payment_schedule = frappe.get_all(
"Payment Schedule", filters={"parent": d.voucher_no}, fields=["*"]
)
)
for payment_term in payment_schedule:
if payment_term.outstanding > 0.1:
doc_details = exc_rates.get(payment_term.parent, None)
is_multi_currency_acc = (doc_details.currency != doc_details.company_currency) and (
doc_details.party_account_currency != doc_details.company_currency
)
payment_term_outstanding = flt(payment_term.outstanding)
if not is_multi_currency_acc:
payment_term_outstanding = doc_details.conversion_rate * flt(payment_term.outstanding)
invoice_ref_based_on_payment_terms.setdefault(idx, [])
invoice_ref_based_on_payment_terms[idx].append(
frappe._dict(
{
"due_date": d.due_date,
"currency": d.currency,
"voucher_no": d.voucher_no,
"voucher_type": d.voucher_type,
"posting_date": d.posting_date,
"invoice_amount": flt(d.invoice_amount),
"outstanding_amount": flt(d.outstanding_amount),
"payment_term_outstanding": payment_term_outstanding,
"allocated_amount": payment_term_outstanding
if payment_term_outstanding
else d.outstanding_amount,
"payment_amount": payment_term.payment_amount,
"payment_term": payment_term.payment_term,
}
)
)
outstanding_invoices_after_split = []
if invoice_ref_based_on_payment_terms:
for idx, ref in invoice_ref_based_on_payment_terms.items():
voucher_no = ref[0]["voucher_no"]
voucher_type = ref[0]["voucher_type"]
frappe.msgprint(
_("Spliting {} {} into {} row(s) as per Payment Terms").format(
voucher_type, voucher_no, len(ref)
),
alert=True,
)
outstanding_invoices_after_split += invoice_ref_based_on_payment_terms[idx]
existing_row = list(filter(lambda x: x.get("voucher_no") == voucher_no, outstanding_invoices))
index = outstanding_invoices.index(existing_row[0])
outstanding_invoices.pop(index)
outstanding_invoices_after_split += outstanding_invoices
return outstanding_invoices_after_split
return split_rows
def get_orders_to_be_billed(
@@ -1835,18 +1856,24 @@ def get_company_defaults(company):
def get_outstanding_on_journal_entry(name):
res = frappe.db.sql(
"SELECT "
'CASE WHEN party_type IN ("Customer") '
"THEN ifnull(sum(debit_in_account_currency - credit_in_account_currency), 0) "
"ELSE ifnull(sum(credit_in_account_currency - debit_in_account_currency), 0) "
"END as outstanding_amount "
"FROM `tabGL Entry` WHERE (voucher_no=%s OR against_voucher=%s) "
"AND party_type IS NOT NULL "
'AND party_type != ""',
(name, name),
as_dict=1,
)
gl = frappe.qb.DocType("GL Entry")
res = (
frappe.qb.from_(gl)
.select(
Case()
.when(
gl.party_type == "Customer",
Coalesce(Sum(gl.debit_in_account_currency - gl.credit_in_account_currency), 0),
)
.else_(Coalesce(Sum(gl.credit_in_account_currency - gl.debit_in_account_currency), 0))
.as_("outstanding_amount")
)
.where(
(Coalesce(gl.party_type, "") != "")
& (gl.is_cancelled == 0)
& ((gl.voucher_no == name) | (gl.against_voucher == name))
)
).run(as_dict=True)
outstanding_amount = res[0].get("outstanding_amount", 0) if res else 0

View File

@@ -1,15 +1,17 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import json
import unittest
import frappe
from frappe import qb
from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import flt, nowdate
from frappe.utils import add_days, flt, nowdate
from erpnext.accounts.doctype.payment_entry.payment_entry import (
InvalidPaymentEntry,
get_outstanding_reference_documents,
get_payment_entry,
get_reference_details,
)
@@ -21,6 +23,7 @@ from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import (
create_sales_invoice,
create_sales_invoice_against_cost_center,
)
from erpnext.accounts.general_ledger import make_gl_entries, make_reverse_gl_entries
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.setup.doctype.employee.test_employee import make_employee
@@ -1219,6 +1222,115 @@ class TestPaymentEntry(FrappeTestCase):
so.reload()
self.assertEqual(so.advance_paid, so.rounded_total)
def test_outstanding_invoices_api(self):
"""
Test if `get_outstanding_reference_documents` fetches invoices in the right order.
"""
customer = create_customer("Max Mustermann", "INR")
create_payment_terms_template()
# SI has an earlier due date and SI2 has a later due date
si = create_sales_invoice(
qty=1, rate=100, customer=customer, posting_date=add_days(nowdate(), -4)
)
si2 = create_sales_invoice(do_not_save=1, qty=1, rate=100, customer=customer)
si2.payment_terms_template = "Test Receivable Template"
si2.submit()
args = {
"posting_date": nowdate(),
"company": "_Test Company",
"party_type": "Customer",
"payment_type": "Pay",
"party": customer,
"party_account": "Debtors - _TC",
}
args.update(
{
"get_outstanding_invoices": True,
"from_posting_date": add_days(nowdate(), -4),
"to_posting_date": add_days(nowdate(), 2),
}
)
references = get_outstanding_reference_documents(args)
self.assertEqual(len(references), 3)
self.assertEqual(references[0].voucher_no, si.name)
self.assertEqual(references[1].voucher_no, si2.name)
self.assertEqual(references[2].voucher_no, si2.name)
self.assertEqual(references[1].payment_term, "Basic Amount Receivable")
self.assertEqual(references[2].payment_term, "Tax Receivable")
def test_partial_cancel_for_payment_entry(self):
si = create_sales_invoice()
pe = get_payment_entry(si.doctype, si.name)
pe.save()
pe.submit()
# Additional GL Entry
tax_amount = 10
reference_row = pe.references[0]
gl_args = {
"party_type": pe.party_type,
"party": pe.party,
"against_voucher_type": reference_row.reference_doctype,
"against_voucher": reference_row.reference_name,
"voucher_detail_no": reference_row.name,
}
gl_dicts = []
gl_dicts.extend(
[
pe.get_gl_dict(
{
"account": pe.paid_to,
"credit": tax_amount,
"credit_in_account_currency": tax_amount,
**gl_args,
}
),
pe.get_gl_dict(
{
"account": pe.paid_from,
"debit": tax_amount,
"debit_in_account_currency": tax_amount,
**gl_args,
}
),
]
)
make_gl_entries(gl_dicts)
# Assert PLEs Before
self.assertPLEntries(
pe,
[
{"amount": -100.0, "against_voucher_no": si.name},
{"amount": 10.0, "against_voucher_no": si.name},
],
)
# Partially cancel Payment Entry
make_reverse_gl_entries(gl_dicts, partial_cancel=True)
self.assertPLEntries(pe, [{"amount": -100.0, "against_voucher_no": si.name}])
def assertPLEntries(self, payment_doc, expected_pl_entries):
pl_entries = frappe.get_all(
"Payment Ledger Entry",
filters={
"voucher_type": payment_doc.doctype,
"voucher_no": payment_doc.name,
"delinked": 0,
},
fields=["amount", "against_voucher_no"],
)
out_str = json.dumps(sorted(pl_entries, key=json.dumps))
expected_out_str = json.dumps(sorted(expected_pl_entries, key=json.dumps))
self.assertEqual(out_str, expected_out_str)
def create_payment_entry(**args):
payment_entry = frappe.new_doc("Payment Entry")
@@ -1279,6 +1391,9 @@ def create_payment_terms_template():
def create_payment_terms_template_with_discount(
name=None, discount_type=None, discount=None, template_name=None
):
"""
Create a Payment Terms Template with % or amount discount.
"""
create_payment_term(name or "30 Credit Days with 10% Discount")
template_name = template_name or "Test Discount Template"

View File

@@ -13,6 +13,7 @@
"party_type",
"party",
"due_date",
"voucher_detail_no",
"cost_center",
"finance_book",
"voucher_type",
@@ -29,7 +30,8 @@
{
"fieldname": "posting_date",
"fieldtype": "Date",
"label": "Posting Date"
"label": "Posting Date",
"search_index": 1
},
{
"fieldname": "account_type",
@@ -63,7 +65,8 @@
"fieldtype": "Link",
"in_standard_filter": 1,
"label": "Voucher Type",
"options": "DocType"
"options": "DocType",
"search_index": 1
},
{
"fieldname": "voucher_no",
@@ -71,14 +74,16 @@
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Voucher No",
"options": "voucher_type"
"options": "voucher_type",
"search_index": 1
},
{
"fieldname": "against_voucher_type",
"fieldtype": "Link",
"in_standard_filter": 1,
"label": "Against Voucher Type",
"options": "DocType"
"options": "DocType",
"search_index": 1
},
{
"fieldname": "against_voucher_no",
@@ -86,7 +91,8 @@
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Against Voucher No",
"options": "against_voucher_type"
"options": "against_voucher_type",
"search_index": 1
},
{
"fieldname": "amount",
@@ -142,12 +148,18 @@
"fieldname": "remarks",
"fieldtype": "Text",
"label": "Remarks"
},
{
"fieldname": "voucher_detail_no",
"fieldtype": "Data",
"label": "Voucher Detail No",
"search_index": 1
}
],
"in_create": 1,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-08-22 15:32:56.629430",
"modified": "2023-11-08 10:53:10.664896",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Ledger Entry",

View File

@@ -216,6 +216,7 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
this.data = [];
const dialog = new frappe.ui.Dialog({
title: __("Select Difference Account"),
size: 'extra-large',
fields: [
{
fieldname: "allocation",
@@ -239,6 +240,13 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
in_list_view: 1,
read_only: 1
}, {
fieldtype:'Date',
fieldname:"gain_loss_posting_date",
label: __("Posting Date"),
in_list_view: 1,
reqd: 1,
}, {
fieldtype:'Link',
options: 'Account',
in_list_view: 1,
@@ -272,6 +280,9 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
args.forEach(d => {
frappe.model.set_value("Payment Reconciliation Allocation", d.docname,
"difference_account", d.difference_account);
frappe.model.set_value("Payment Reconciliation Allocation", d.docname,
"gain_loss_posting_date", d.gain_loss_posting_date);
});
this.reconcile_payment_entries();
@@ -287,6 +298,7 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
'reference_name': d.reference_name,
'difference_amount': d.difference_amount,
'difference_account': d.difference_account,
'gain_loss_posting_date': d.gain_loss_posting_date
});
}
});

View File

@@ -203,9 +203,10 @@
],
"hide_toolbar": 1,
"icon": "icon-resize-horizontal",
"is_virtual": 1,
"issingle": 1,
"links": [],
"modified": "2023-08-15 05:35:50.109290",
"modified": "2023-11-17 17:33:55.701726",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation",
@@ -230,6 +231,5 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
"states": []
}

View File

@@ -19,7 +19,7 @@ from erpnext.accounts.utils import (
get_outstanding_invoices,
reconcile_against_document,
)
from erpnext.controllers.accounts_controller import get_advance_payment_entries
from erpnext.controllers.accounts_controller import get_advance_payment_entries_for_regional
class PaymentReconciliation(Document):
@@ -29,6 +29,58 @@ class PaymentReconciliation(Document):
self.accounting_dimension_filter_conditions = []
self.ple_posting_date_filter = []
def load_from_db(self):
# 'modified' attribute is required for `run_doc_method` to work properly.
doc_dict = frappe._dict(
{
"modified": None,
"company": None,
"party": None,
"party_type": None,
"receivable_payable_account": None,
"default_advance_account": None,
"from_invoice_date": None,
"to_invoice_date": None,
"invoice_limit": 50,
"from_payment_date": None,
"to_payment_date": None,
"payment_limit": 50,
"minimum_invoice_amount": None,
"minimum_payment_amount": None,
"maximum_invoice_amount": None,
"maximum_payment_amount": None,
"bank_cash_account": None,
"cost_center": None,
"payment_name": None,
"invoice_name": None,
}
)
super(Document, self).__init__(doc_dict)
def save(self):
return
@staticmethod
def get_list(args):
pass
@staticmethod
def get_count(args):
pass
@staticmethod
def get_stats(args):
pass
def db_insert(self, *args, **kwargs):
pass
def db_update(self, *args, **kwargs):
pass
def delete(self):
pass
@frappe.whitelist()
def get_unreconciled_entries(self):
self.get_nonreconciled_payment_entries()
@@ -59,10 +111,8 @@ class PaymentReconciliation(Document):
def get_payment_entries(self):
order_doctype = "Sales Order" if self.party_type == "Customer" else "Purchase Order"
condition = self.get_conditions(get_payments=True)
if self.payment_name:
condition += "name like '%%{0}%%'".format(self.payment_name)
payment_entries = get_advance_payment_entries(
payment_entries = get_advance_payment_entries_for_regional(
self.party_type,
self.party,
self.receivable_payable_account,
@@ -70,6 +120,7 @@ class PaymentReconciliation(Document):
against_all_orders=True,
limit=self.payment_limit,
condition=condition,
payment_name=self.payment_name,
)
return payment_entries
@@ -93,6 +144,8 @@ class PaymentReconciliation(Document):
"t2.against_account like %(bank_cash_account)s" if self.bank_cash_account else "1=1"
)
limit = f"limit {self.payment_limit}" if self.payment_limit else " "
# nosemgrep
journal_entries = frappe.db.sql(
"""
@@ -116,11 +169,13 @@ class PaymentReconciliation(Document):
ELSE {bank_account_condition}
END)
order by t1.posting_date
{limit}
""".format(
**{
"dr_or_cr": dr_or_cr,
"bank_account_condition": bank_account_condition,
"condition": condition,
"limit": limit,
}
),
{
@@ -146,7 +201,7 @@ class PaymentReconciliation(Document):
if self.payment_name:
conditions.append(doc.name.like(f"%{self.payment_name}%"))
self.return_invoices = (
self.return_invoices_query = (
qb.from_(doc)
.select(
ConstantColumn(voucher_type).as_("voucher_type"),
@@ -154,8 +209,11 @@ class PaymentReconciliation(Document):
doc.return_against,
)
.where(Criterion.all(conditions))
.run(as_dict=True)
)
if self.payment_limit:
self.return_invoices_query = self.return_invoices_query.limit(self.payment_limit)
self.return_invoices = self.return_invoices_query.run(as_dict=True)
def get_dr_or_cr_notes(self):
@@ -315,6 +373,7 @@ class PaymentReconciliation(Document):
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")
res.update({"gain_loss_posting_date": pay.get("posting_date")})
if pay.get("amount") == 0:
entries.append(res)
@@ -350,6 +409,7 @@ class PaymentReconciliation(Document):
)
def reconcile_allocations(self, skip_ref_details_update_for_pe=False):
adjust_allocations_for_taxes(self)
dr_or_cr = (
"credit_in_account_currency"
if erpnext.get_party_account_type(self.party_type) == "Receivable"
@@ -420,6 +480,7 @@ class PaymentReconciliation(Document):
"allocated_amount": flt(row.get("allocated_amount")),
"difference_amount": flt(row.get("difference_amount")),
"difference_account": row.get("difference_account"),
"difference_posting_date": row.get("gain_loss_posting_date"),
"cost_center": row.get("cost_center"),
}
)
@@ -477,6 +538,27 @@ class PaymentReconciliation(Document):
invoice_exchange_map.update(purchase_invoice_map)
journals = [
d.get("invoice_number") for d in invoices if d.get("invoice_type") == "Journal Entry"
]
journals.extend(
[d.get("reference_name") for d in payments if d.get("reference_type") == "Journal Entry"]
)
if journals:
journals = list(set(journals))
journals_map = frappe._dict(
frappe.db.get_all(
"Journal Entry Account",
filters={"parent": ("in", journals), "account": ("in", [self.receivable_payable_account])},
fields=[
"parent as `name`",
"exchange_rate",
],
as_list=1,
)
)
invoice_exchange_map.update(journals_map)
return invoice_exchange_map
def validate_allocation(self):
@@ -650,3 +732,8 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
None,
inv.cost_center,
)
@erpnext.allow_regional
def adjust_allocations_for_taxes(doc):
pass

View File

@@ -14,6 +14,7 @@ from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_pay
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.accounts.party import get_party_account
from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order
from erpnext.stock.doctype.item.test_item import create_item
test_dependencies = ["Item"]
@@ -85,26 +86,44 @@ class TestPaymentReconciliation(FrappeTestCase):
self.customer5 = make_customer("_Test PR Customer 5", "EUR")
def create_account(self):
account_name = "Debtors EUR"
if not frappe.db.get_value(
"Account", filters={"account_name": account_name, "company": self.company}
):
acc = frappe.new_doc("Account")
acc.account_name = account_name
acc.parent_account = "Accounts Receivable - _PR"
acc.company = self.company
acc.account_currency = "EUR"
acc.account_type = "Receivable"
acc.insert()
else:
name = frappe.db.get_value(
"Account",
filters={"account_name": account_name, "company": self.company},
fieldname="name",
pluck=True,
)
acc = frappe.get_doc("Account", name)
self.debtors_eur = acc.name
accounts = [
{
"attribute": "debtors_eur",
"account_name": "Debtors EUR",
"parent_account": "Accounts Receivable - _PR",
"account_currency": "EUR",
"account_type": "Receivable",
},
{
"attribute": "creditors_usd",
"account_name": "Payable USD",
"parent_account": "Accounts Payable - _PR",
"account_currency": "USD",
"account_type": "Payable",
},
]
for x in accounts:
x = frappe._dict(x)
if not frappe.db.get_value(
"Account", filters={"account_name": x.account_name, "company": self.company}
):
acc = frappe.new_doc("Account")
acc.account_name = x.account_name
acc.parent_account = x.parent_account
acc.company = self.company
acc.account_currency = x.account_currency
acc.account_type = x.account_type
acc.insert()
else:
name = frappe.db.get_value(
"Account",
filters={"account_name": x.account_name, "company": self.company},
fieldname="name",
pluck=True,
)
acc = frappe.get_doc("Account", name)
setattr(self, x.attribute, acc.name)
def create_sales_invoice(
self, qty=1, rate=100, posting_date=nowdate(), do_not_save=False, do_not_submit=False
@@ -151,6 +170,64 @@ class TestPaymentReconciliation(FrappeTestCase):
payment.posting_date = posting_date
return payment
def create_purchase_invoice(
self, qty=1, rate=100, posting_date=nowdate(), do_not_save=False, do_not_submit=False
):
"""
Helper function to populate default values in sales invoice
"""
pinv = make_purchase_invoice(
qty=qty,
rate=rate,
company=self.company,
customer=self.supplier,
item_code=self.item,
item_name=self.item,
cost_center=self.cost_center,
warehouse=self.warehouse,
debit_to=self.debit_to,
parent_cost_center=self.cost_center,
update_stock=0,
currency="INR",
is_pos=0,
is_return=0,
return_against=None,
income_account=self.income_account,
expense_account=self.expense_account,
do_not_save=do_not_save,
do_not_submit=do_not_submit,
)
return pinv
def create_purchase_order(
self, qty=1, rate=100, posting_date=nowdate(), do_not_save=False, do_not_submit=False
):
"""
Helper function to populate default values in sales invoice
"""
pord = create_purchase_order(
qty=qty,
rate=rate,
company=self.company,
customer=self.supplier,
item_code=self.item,
item_name=self.item,
cost_center=self.cost_center,
warehouse=self.warehouse,
debit_to=self.debit_to,
parent_cost_center=self.cost_center,
update_stock=0,
currency="INR",
is_pos=0,
is_return=0,
return_against=None,
income_account=self.income_account,
expense_account=self.expense_account,
do_not_save=do_not_save,
do_not_submit=do_not_submit,
)
return pord
def clear_old_entries(self):
doctype_list = [
"GL Entry",
@@ -163,13 +240,11 @@ class TestPaymentReconciliation(FrappeTestCase):
for doctype in doctype_list:
qb.from_(qb.DocType(doctype)).delete().where(qb.DocType(doctype).company == self.company).run()
def create_payment_reconciliation(self):
def create_payment_reconciliation(self, party_is_customer=True):
pr = frappe.new_doc("Payment Reconciliation")
pr.company = self.company
pr.party_type = (
self.party_type if hasattr(self, "party_type") and self.party_type else "Customer"
)
pr.party = self.customer
pr.party_type = "Customer" if party_is_customer else "Supplier"
pr.party = self.customer if party_is_customer else self.supplier
pr.receivable_payable_account = get_party_account(pr.party_type, pr.party, pr.company)
pr.from_invoice_date = pr.to_invoice_date = pr.from_payment_date = pr.to_payment_date = nowdate()
return pr
@@ -906,9 +981,13 @@ class TestPaymentReconciliation(FrappeTestCase):
self.assertEqual(pr.allocation[0].difference_amount, 0)
def test_reconciliation_purchase_invoice_against_return(self):
pi = make_purchase_invoice(
supplier="_Test Supplier USD", currency="USD", conversion_rate=50
).submit()
self.supplier = "_Test Supplier USD"
pi = self.create_purchase_invoice(qty=5, rate=50, do_not_submit=True)
pi.supplier = self.supplier
pi.currency = "USD"
pi.conversion_rate = 50
pi.credit_to = self.creditors_usd
pi.save().submit()
pi_return = frappe.get_doc(pi.as_dict())
pi_return.name = None
@@ -918,11 +997,12 @@ class TestPaymentReconciliation(FrappeTestCase):
pi_return.items[0].qty = -pi_return.items[0].qty
pi_return.submit()
self.company = "_Test Company"
self.party_type = "Supplier"
self.customer = "_Test Supplier USD"
pr = self.create_payment_reconciliation()
pr = frappe.get_doc("Payment Reconciliation")
pr.company = self.company
pr.party_type = "Supplier"
pr.party = self.supplier
pr.receivable_payable_account = self.creditors_usd
pr.from_invoice_date = pr.to_invoice_date = pr.from_payment_date = pr.to_payment_date = nowdate()
pr.get_unreconciled_entries()
invoices = []
@@ -931,6 +1011,7 @@ class TestPaymentReconciliation(FrappeTestCase):
if invoice.invoice_number == pi.name:
invoices.append(invoice.as_dict())
break
for payment in pr.payments:
if payment.reference_name == pi_return.name:
payments.append(payment.as_dict())
@@ -941,6 +1022,155 @@ class TestPaymentReconciliation(FrappeTestCase):
# Should not raise frappe.exceptions.ValidationError: Total Debit must be equal to Total Credit.
pr.reconcile()
def test_reconciliation_from_purchase_order_to_multiple_invoices(self):
"""
Reconciling advance payment from PO/SO to multiple invoices should not cause overallocation
"""
self.supplier = "_Test Supplier"
pi1 = self.create_purchase_invoice(qty=10, rate=100)
pi2 = self.create_purchase_invoice(qty=10, rate=100)
po = self.create_purchase_order(qty=20, rate=100)
pay = get_payment_entry(po.doctype, po.name)
# Overpay Puchase Order
pay.paid_amount = 3000
pay.save().submit()
# assert total allocated and unallocated before reconciliation
self.assertEqual(
(
pay.references[0].reference_doctype,
pay.references[0].reference_name,
pay.references[0].allocated_amount,
),
(po.doctype, po.name, 2000),
)
self.assertEqual(pay.total_allocated_amount, 2000)
self.assertEqual(pay.unallocated_amount, 1000)
self.assertEqual(pay.difference_amount, 0)
pr = self.create_payment_reconciliation(party_is_customer=False)
pr.get_unreconciled_entries()
self.assertEqual(len(pr.invoices), 2)
self.assertEqual(len(pr.payments), 2)
for x in pr.payments:
self.assertEqual((x.reference_type, x.reference_name), (pay.doctype, pay.name))
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}))
# partial allocation on pi1 and full allocate on pi2
pr.allocation[0].allocated_amount = 100
pr.reconcile()
# assert references and total allocated and unallocated amount
pay.reload()
self.assertEqual(len(pay.references), 3)
self.assertEqual(
(
pay.references[0].reference_doctype,
pay.references[0].reference_name,
pay.references[0].allocated_amount,
),
(po.doctype, po.name, 900),
)
self.assertEqual(
(
pay.references[1].reference_doctype,
pay.references[1].reference_name,
pay.references[1].allocated_amount,
),
(pi1.doctype, pi1.name, 100),
)
self.assertEqual(
(
pay.references[2].reference_doctype,
pay.references[2].reference_name,
pay.references[2].allocated_amount,
),
(pi2.doctype, pi2.name, 1000),
)
self.assertEqual(pay.total_allocated_amount, 2000)
self.assertEqual(pay.unallocated_amount, 1000)
self.assertEqual(pay.difference_amount, 0)
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 = [x.as_dict() for x in pr.payments]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
pr.reconcile()
# assert references and total allocated and unallocated amount
pay.reload()
self.assertEqual(len(pay.references), 3)
# PO references should be removed now
self.assertEqual(
(
pay.references[0].reference_doctype,
pay.references[0].reference_name,
pay.references[0].allocated_amount,
),
(pi1.doctype, pi1.name, 100),
)
self.assertEqual(
(
pay.references[1].reference_doctype,
pay.references[1].reference_name,
pay.references[1].allocated_amount,
),
(pi2.doctype, pi2.name, 1000),
)
self.assertEqual(
(
pay.references[2].reference_doctype,
pay.references[2].reference_name,
pay.references[2].allocated_amount,
),
(pi1.doctype, pi1.name, 900),
)
self.assertEqual(pay.total_allocated_amount, 2000)
self.assertEqual(pay.unallocated_amount, 1000)
self.assertEqual(pay.difference_amount, 0)
def test_rounding_of_unallocated_amount(self):
self.supplier = "_Test Supplier USD"
pi = self.create_purchase_invoice(qty=1, rate=10, do_not_submit=True)
pi.supplier = self.supplier
pi.currency = "USD"
pi.conversion_rate = 80
pi.credit_to = self.creditors_usd
pi.save().submit()
pe = get_payment_entry(pi.doctype, pi.name)
pe.target_exchange_rate = 78.726500000
pe.received_amount = 26.75
pe.paid_amount = 2105.93
pe.references = []
pe.save().submit()
# unallocated_amount will have some rounding loss - 26.749950
self.assertNotEqual(pe.unallocated_amount, 26.75)
pr = frappe.get_doc("Payment Reconciliation")
pr.company = self.company
pr.party_type = "Supplier"
pr.party = self.supplier
pr.receivable_payable_account = self.creditors_usd
pr.from_invoice_date = pr.to_invoice_date = pr.from_payment_date = pr.to_payment_date = nowdate()
pr.get_unreconciled_entries()
invoices = [invoice.as_dict() for invoice in pr.invoices]
payments = [payment.as_dict() for payment in pr.payments]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
# Should not raise frappe.exceptions.ValidationError: Payment Entry has been modified after you pulled it. Please pull it again.
pr.reconcile()
def make_customer(customer_name, currency=None):
if not frappe.db.exists("Customer", customer_name):

View File

@@ -19,6 +19,7 @@
"is_advance",
"section_break_5",
"difference_amount",
"gain_loss_posting_date",
"column_break_7",
"difference_account",
"exchange_rate",
@@ -151,11 +152,17 @@
"fieldtype": "Link",
"label": "Cost Center",
"options": "Cost Center"
},
{
"fieldname": "gain_loss_posting_date",
"fieldtype": "Date",
"label": "Difference Posting Date"
}
],
"is_virtual": 1,
"istable": 1,
"links": [],
"modified": "2023-09-03 07:52:33.684217",
"modified": "2023-11-17 17:33:38.612615",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation Allocation",

View File

@@ -6,4 +6,6 @@ from frappe.model.document import Document
class PaymentReconciliationAllocation(Document):
pass
@staticmethod
def get_list(args):
pass

View File

@@ -71,9 +71,10 @@
"label": "Exchange Rate"
}
],
"is_virtual": 1,
"istable": 1,
"links": [],
"modified": "2022-11-08 18:18:02.502149",
"modified": "2023-11-17 17:33:45.455166",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation Invoice",

View File

@@ -6,4 +6,6 @@ from frappe.model.document import Document
class PaymentReconciliationInvoice(Document):
pass
@staticmethod
def get_list(args):
pass

View File

@@ -107,9 +107,10 @@
"options": "Cost Center"
}
],
"is_virtual": 1,
"istable": 1,
"links": [],
"modified": "2023-09-03 07:43:29.965353",
"modified": "2023-11-17 17:33:34.818530",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation Payment",

View File

@@ -6,4 +6,6 @@ from frappe.model.document import Document
class PaymentReconciliationPayment(Document):
pass
@staticmethod
def get_list(args):
pass

View File

@@ -249,7 +249,7 @@ class PaymentRequest(Document):
if (
party_account_currency == ref_doc.company_currency and party_account_currency != self.currency
):
party_amount = ref_doc.base_grand_total
party_amount = ref_doc.get("base_rounded_total") or ref_doc.get("base_grand_total")
else:
party_amount = self.grand_total

View File

@@ -18,6 +18,7 @@
"is_pos",
"is_return",
"update_billed_amount_in_sales_order",
"update_billed_amount_in_delivery_note",
"column_break1",
"company",
"posting_date",
@@ -1549,12 +1550,19 @@
"fieldtype": "Currency",
"label": "Amount Eligible for Commission",
"read_only": 1
},
{
"default": "1",
"depends_on": "eval: doc.is_return && doc.return_against",
"fieldname": "update_billed_amount_in_delivery_note",
"fieldtype": "Check",
"label": "Update Billed Amount in Delivery Note"
}
],
"icon": "fa fa-file-text",
"is_submittable": 1,
"links": [],
"modified": "2022-09-30 03:49:50.455199",
"modified": "2023-11-20 12:27:12.848149",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice",

View File

@@ -659,7 +659,7 @@ def get_stock_availability(item_code, warehouse):
return bin_qty - pos_sales_qty, is_stock_item
else:
is_stock_item = True
if frappe.db.exists("Product Bundle", item_code):
if frappe.db.exists("Product Bundle", {"name": item_code, "disabled": 0}):
return get_bundle_availability(item_code, warehouse), is_stock_item
else:
is_stock_item = False

View File

@@ -185,6 +185,7 @@
"label": "Image"
},
{
"fetch_from": "item_code.image",
"fieldname": "image",
"fieldtype": "Attach",
"hidden": 1,
@@ -821,7 +822,7 @@
],
"istable": 1,
"links": [],
"modified": "2022-11-02 12:52:39.125295",
"modified": "2023-11-14 18:33:22.585715",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice Item",
@@ -831,4 +832,4 @@
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
}

View File

@@ -110,7 +110,7 @@
"in_create": 1,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-04-21 17:36:26.642617",
"modified": "2023-11-02 11:32:12.254018",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Payment Reconciliation Log",
@@ -125,7 +125,19 @@
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"role": "Accounts Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"share": 1,
"write": 1
}

View File

@@ -15,6 +15,7 @@
"group_by",
"cost_center",
"territory",
"ignore_exchange_rate_revaluation_journals",
"column_break_14",
"to_date",
"finance_book",
@@ -374,10 +375,16 @@
"fieldname": "pdf_name",
"fieldtype": "Data",
"label": "PDF Name"
},
{
"default": "0",
"fieldname": "ignore_exchange_rate_revaluation_journals",
"fieldtype": "Check",
"label": "Ignore Exchange Rate Revaluation Journals"
}
],
"links": [],
"modified": "2023-08-28 12:59:53.071334",
"modified": "2023-12-18 12:20:08.965120",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Statement Of Accounts",

View File

@@ -47,9 +47,35 @@ class ProcessStatementOfAccounts(Document):
def get_report_pdf(doc, consolidated=True):
statement_dict = get_statement_dict(doc)
if not bool(statement_dict):
return False
elif consolidated:
delimiter = '<div style="page-break-before: always;"></div>' if doc.include_break else ""
result = delimiter.join(list(statement_dict.values()))
return get_pdf(result, {"orientation": doc.orientation})
else:
for customer, statement_html in statement_dict.items():
statement_dict[customer] = get_pdf(statement_html, {"orientation": doc.orientation})
return statement_dict
def get_statement_dict(doc, get_statement_dict=False):
statement_dict = {}
ageing = ""
err_journals = None
if doc.report == "General Ledger" and doc.ignore_exchange_rate_revaluation_journals:
err_journals = frappe.db.get_all(
"Journal Entry",
filters={
"company": doc.company,
"docstatus": 1,
"voucher_type": ("in", ["Exchange Rate Revaluation", "Exchange Gain Or Loss"]),
},
as_list=True,
)
for entry in doc.customers:
if doc.include_ageing:
ageing = set_ageing(doc, entry)
@@ -62,6 +88,8 @@ def get_report_pdf(doc, consolidated=True):
)
filters = get_common_filters(doc)
if err_journals:
filters.update({"voucher_no_not_in": [x[0] for x in err_journals]})
if doc.report == "General Ledger":
filters.update(get_gl_filters(doc, entry, tax_id, presentation_currency))
@@ -77,17 +105,11 @@ def get_report_pdf(doc, consolidated=True):
if not res:
continue
statement_dict[entry.customer] = get_html(doc, filters, entry, col, res, ageing)
statement_dict[entry.customer] = (
[res, ageing] if get_statement_dict else get_html(doc, filters, entry, col, res, ageing)
)
if not bool(statement_dict):
return False
elif consolidated:
result = "".join(list(statement_dict.values()))
return get_pdf(result, {"orientation": doc.orientation})
else:
for customer, statement_html in statement_dict.items():
statement_dict[customer] = get_pdf(statement_html, {"orientation": doc.orientation})
return statement_dict
return statement_dict
def set_ageing(doc, entry):
@@ -100,7 +122,8 @@ def set_ageing(doc, entry):
"range2": 60,
"range3": 90,
"range4": 120,
"customer": entry.customer,
"party_type": "Customer",
"party": [entry.customer],
}
)
col1, ageing = get_ageing(ageing_filters)

View File

@@ -4,39 +4,107 @@
import unittest
import frappe
from frappe.tests.utils import FrappeTestCase
from frappe.utils import add_days, getdate, today
from erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts import (
get_statement_dict,
send_emails,
)
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
class TestProcessStatementOfAccounts(unittest.TestCase):
class TestProcessStatementOfAccounts(AccountsTestMixin, FrappeTestCase):
def setUp(self):
self.create_company()
self.create_customer()
self.create_customer(customer_name="Other Customer")
self.clear_old_entries()
self.si = create_sales_invoice()
self.process_soa = create_process_soa()
create_sales_invoice(customer="Other Customer")
def test_process_soa_for_gl(self):
"""Tests the utils for Statement of Accounts(General Ledger)"""
process_soa = create_process_soa(
name="_Test Process SOA for GL",
customers=[{"customer": "_Test Customer"}, {"customer": "Other Customer"}],
)
statement_dict = get_statement_dict(process_soa, get_statement_dict=True)
# Checks if the statements are filtered based on the Customer
self.assertIn("Other Customer", statement_dict)
self.assertIn("_Test Customer", statement_dict)
# Checks if the correct number of receivable entries exist
# 3 rows for opening and closing and 1 row for SI
receivable_entries = statement_dict["_Test Customer"][0]
self.assertEqual(len(receivable_entries), 4)
# Checks the amount for the receivable entry
self.assertEqual(receivable_entries[1].voucher_no, self.si.name)
self.assertEqual(receivable_entries[1].balance, 100)
def test_process_soa_for_ar(self):
"""Tests the utils for Statement of Accounts(Accounts Receivable)"""
process_soa = create_process_soa(name="_Test Process SOA for AR", report="Accounts Receivable")
statement_dict = get_statement_dict(process_soa, get_statement_dict=True)
# Checks if the statements are filtered based on the Customer
self.assertNotIn("Other Customer", statement_dict)
self.assertIn("_Test Customer", statement_dict)
# Checks if the correct number of receivable entries exist
receivable_entries = statement_dict["_Test Customer"][0]
self.assertEqual(len(receivable_entries), 1)
# Checks the amount for the receivable entry
self.assertEqual(receivable_entries[0].voucher_no, self.si.name)
self.assertEqual(receivable_entries[0].total_due, 100)
# Checks the ageing summary for AR
ageing_summary = statement_dict["_Test Customer"][1][0]
expected_summary = frappe._dict(
range1=100,
range2=0,
range3=0,
range4=0,
range5=0,
)
self.check_ageing_summary(ageing_summary, expected_summary)
def test_auto_email_for_process_soa_ar(self):
send_emails(self.process_soa.name, from_scheduler=True)
self.process_soa.load_from_db()
self.assertEqual(self.process_soa.posting_date, getdate(add_days(today(), 7)))
process_soa = create_process_soa(
name="_Test Process SOA", enable_auto_email=1, report="Accounts Receivable"
)
send_emails(process_soa.name, from_scheduler=True)
process_soa.load_from_db()
self.assertEqual(process_soa.posting_date, getdate(add_days(today(), 7)))
def check_ageing_summary(self, ageing, expected_ageing):
for age_range in expected_ageing:
self.assertEqual(expected_ageing[age_range], ageing.get(age_range))
def tearDown(self):
frappe.delete_doc_if_exists("Process Statement Of Accounts", "Test Process SOA")
frappe.db.rollback()
def create_process_soa():
frappe.delete_doc_if_exists("Process Statement Of Accounts", "Test Process SOA")
def create_process_soa(**args):
args = frappe._dict(args)
frappe.delete_doc_if_exists("Process Statement Of Accounts", args.name)
process_soa = frappe.new_doc("Process Statement Of Accounts")
soa_dict = {
"name": "Test Process SOA",
"company": "_Test Company",
}
soa_dict = frappe._dict(
name=args.name,
company=args.company or "_Test Company",
customers=args.customers or [{"customer": "_Test Customer"}],
enable_auto_email=1 if args.enable_auto_email else 0,
frequency=args.frequency or "Weekly",
report=args.report or "General Ledger",
from_date=args.from_date or getdate(today()),
to_date=args.to_date or getdate(today()),
posting_date=args.posting_date or getdate(today()),
include_ageing=1,
)
process_soa.update(soa_dict)
process_soa.set("customers", [{"customer": "_Test Customer"}])
process_soa.enable_auto_email = 1
process_soa.frequency = "Weekly"
process_soa.report = "Accounts Receivable"
process_soa.save()
return process_soa

View File

@@ -31,7 +31,7 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
super.onload();
// Ignore linked advances
this.frm.ignore_doctypes_on_cancel_all = ['Journal Entry', 'Payment Entry', 'Purchase Invoice', "Repost Payment Ledger", "Repost Accounting Ledger"];
this.frm.ignore_doctypes_on_cancel_all = ['Journal Entry', 'Payment Entry', 'Purchase Invoice', "Repost Payment Ledger", "Repost Accounting Ledger", "Unreconcile Payment", "Unreconcile Payment Entries"];
if(!this.frm.doc.__islocal) {
// show credit_to in print format
@@ -59,6 +59,25 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
this.show_stock_ledger();
}
if (this.frm.doc.repost_required && this.frm.doc.docstatus===1) {
this.frm.set_intro(__("Accounting entries for this invoice need to be reposted. Please click on 'Repost' button to update."));
this.frm.add_custom_button(__('Repost Accounting Entries'),
() => {
this.frm.call({
doc: this.frm.doc,
method: 'repost_accounting_entries',
freeze: true,
freeze_message: __('Reposting...'),
callback: (r) => {
if (!r.exc) {
frappe.msgprint(__('Accounting Entries are reposted.'));
me.frm.refresh();
}
}
});
}).removeClass('btn-default').addClass('btn-warning');
}
if(!doc.is_return && doc.docstatus == 1 && doc.outstanding_amount != 0){
if(doc.on_hold) {
this.frm.add_custom_button(
@@ -145,6 +164,18 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
}
})
}, __("Get Items From"));
if (!this.frm.doc.is_return) {
frappe.db.get_single_value("Buying Settings", "maintain_same_rate").then((value) => {
if (value) {
this.frm.doc.items.forEach((item) => {
this.frm.fields_dict.items.grid.update_docfield_property(
"rate", "read_only", (item.purchase_receipt && item.pr_detail)
);
});
}
});
}
}
this.frm.toggle_reqd("supplier_warehouse", this.frm.doc.is_subcontracted);
@@ -162,6 +193,7 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
}
this.frm.set_df_property("tax_withholding_category", "hidden", doc.apply_tds ? 0 : 1);
erpnext.accounts.unreconcile_payment.add_unreconcile_btn(me.frm);
}
unblock_invoice() {

View File

@@ -36,6 +36,7 @@
"currency_and_price_list",
"currency",
"conversion_rate",
"use_transaction_date_exchange_rate",
"column_break2",
"buying_price_list",
"price_list_currency",
@@ -166,6 +167,7 @@
"against_expense_account",
"column_break_63",
"unrealized_profit_loss_account",
"repost_required",
"subscription_section",
"auto_repeat",
"update_auto_repeat_reference",
@@ -190,8 +192,7 @@
"inter_company_invoice_reference",
"is_old_subcontracting_flow",
"remarks",
"connections_tab",
"column_break_38"
"connections_tab"
],
"fields": [
{
@@ -382,7 +383,8 @@
"label": "Supplier Invoice No",
"oldfieldname": "bill_no",
"oldfieldtype": "Data",
"print_hide": 1
"print_hide": 1,
"search_index": 1
},
{
"fieldname": "column_break_15",
@@ -405,7 +407,8 @@
"no_copy": 1,
"options": "Purchase Invoice",
"print_hide": 1,
"read_only": 1
"read_only": 1,
"search_index": 1
},
{
"fieldname": "section_addresses",
@@ -987,6 +990,7 @@
"print_hide": 1
},
{
"allow_on_submit": 1,
"fieldname": "cash_bank_account",
"fieldtype": "Link",
"label": "Cash/Bank Account",
@@ -1050,6 +1054,7 @@
"fieldtype": "Column Break"
},
{
"allow_on_submit": 1,
"depends_on": "eval:flt(doc.write_off_amount)!=0",
"fieldname": "write_off_account",
"fieldtype": "Link",
@@ -1213,6 +1218,7 @@
"read_only": 1
},
{
"allow_on_submit": 1,
"default": "No",
"fieldname": "is_opening",
"fieldtype": "Select",
@@ -1345,6 +1351,7 @@
"options": "Project"
},
{
"allow_on_submit": 1,
"depends_on": "eval:doc.is_internal_supplier",
"description": "Unrealized Profit/Loss account for intra-company transfers",
"fieldname": "unrealized_profit_loss_account",
@@ -1495,10 +1502,6 @@
"fieldname": "column_break_6",
"fieldtype": "Column Break"
},
{
"fieldname": "column_break_38",
"fieldtype": "Column Break"
},
{
"fieldname": "column_break_50",
"fieldtype": "Column Break"
@@ -1569,13 +1572,29 @@
"fieldname": "use_company_roundoff_cost_center",
"fieldtype": "Check",
"label": "Use Company Default Round Off Cost Center"
},
{
"default": "0",
"fieldname": "repost_required",
"fieldtype": "Check",
"hidden": 1,
"label": "Repost Required",
"options": "Account",
"read_only": 1
},
{
"default": "0",
"fieldname": "use_transaction_date_exchange_rate",
"fieldtype": "Check",
"label": "Use Transaction Date Exchange Rate",
"read_only": 1
}
],
"icon": "fa fa-file-text",
"idx": 204,
"is_submittable": 1,
"links": [],
"modified": "2023-10-01 21:01:47.282533",
"modified": "2023-11-03 15:47:30.319200",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",

View File

@@ -11,6 +11,10 @@ from frappe.utils import cint, cstr, flt, formatdate, get_link_to_form, getdate,
import erpnext
from erpnext.accounts.deferred_revenue import validate_service_stop_date
from erpnext.accounts.doctype.gl_entry.gl_entry import update_outstanding_amt
from erpnext.accounts.doctype.repost_accounting_ledger.repost_accounting_ledger import (
validate_docs_for_deferred_accounting,
validate_docs_for_voucher_types,
)
from erpnext.accounts.doctype.sales_invoice.sales_invoice import (
check_if_return_invoice_linked_with_payment_entry,
get_total_in_party_account_currency,
@@ -30,7 +34,7 @@ from erpnext.accounts.general_ledger import (
)
from erpnext.accounts.party import get_due_date, get_party_account
from erpnext.accounts.utils import get_account_currency, get_fiscal_year
from erpnext.assets.doctype.asset.asset import get_asset_account, is_cwip_accounting_enabled
from erpnext.assets.doctype.asset.asset import is_cwip_accounting_enabled
from erpnext.assets.doctype.asset_category.asset_category import get_asset_category_account
from erpnext.buying.utils import check_on_hold_or_closed_status
from erpnext.controllers.accounts_controller import validate_account_head
@@ -281,9 +285,6 @@ class PurchaseInvoice(BuyingController):
# in case of auto inventory accounting,
# expense account is always "Stock Received But Not Billed" for a stock item
# except opening entry, drop-ship entry and fixed asset items
if item.item_code:
asset_category = frappe.get_cached_value("Item", item.item_code, "asset_category")
if (
auto_accounting_for_stock
and item.item_code in stock_items
@@ -350,22 +351,26 @@ class PurchaseInvoice(BuyingController):
frappe.msgprint(msg, title=_("Expense Head Changed"))
item.expense_account = stock_not_billed_account
elif item.is_fixed_asset and not is_cwip_accounting_enabled(asset_category):
elif item.is_fixed_asset and item.pr_detail:
if not asset_received_but_not_billed:
asset_received_but_not_billed = self.get_company_default("asset_received_but_not_billed")
item.expense_account = asset_received_but_not_billed
elif item.is_fixed_asset:
account_type = (
"capital_work_in_progress_account"
if is_cwip_accounting_enabled(item.asset_category)
else "fixed_asset_account"
)
asset_category_account = get_asset_category_account(
"fixed_asset_account", item=item.item_code, company=self.company
account_type, item=item.item_code, company=self.company
)
if not asset_category_account:
form_link = get_link_to_form("Asset Category", asset_category)
form_link = get_link_to_form("Asset Category", item.asset_category)
throw(
_("Please set Fixed Asset Account in {} against {}.").format(form_link, self.company),
title=_("Missing Account"),
)
item.expense_account = asset_category_account
elif item.is_fixed_asset and item.pr_detail:
if not asset_received_but_not_billed:
asset_received_but_not_billed = self.get_company_default("asset_received_but_not_billed")
item.expense_account = asset_received_but_not_billed
elif not item.expense_account and for_validate:
throw(_("Expense account is mandatory for item {0}").format(item.item_code or item.item_name))
@@ -487,6 +492,12 @@ class PurchaseInvoice(BuyingController):
_("Stock cannot be updated against Purchase Receipt {0}").format(item.purchase_receipt)
)
def validate_for_repost(self):
self.validate_write_off_account()
self.validate_expense_account()
validate_docs_for_voucher_types(["Purchase Invoice"])
validate_docs_for_deferred_accounting([], [self.name])
def on_submit(self):
super(PurchaseInvoice, self).on_submit()
@@ -523,12 +534,29 @@ class PurchaseInvoice(BuyingController):
if self.update_stock == 1:
self.repost_future_sle_and_gle()
self.update_project()
if (
frappe.db.get_single_value("Buying Settings", "project_update_frequency") == "Each Transaction"
):
self.update_project()
update_linked_doc(self.doctype, self.name, self.inter_company_invoice_reference)
self.update_advance_tax_references()
self.process_common_party_accounting()
def on_update_after_submit(self):
if hasattr(self, "repost_required"):
fields_to_check = [
"cash_bank_account",
"write_off_account",
"unrealized_profit_loss_account",
]
child_tables = {"items": ("expense_account",), "taxes": ("account_head",)}
self.needs_repost = self.check_if_fields_updated(fields_to_check, child_tables)
if self.needs_repost:
self.validate_for_repost()
self.db_set("repost_required", self.needs_repost)
def make_gl_entries(self, gl_entries=None, from_repost=False):
if not gl_entries:
gl_entries = self.get_gl_entries()
@@ -570,12 +598,11 @@ class PurchaseInvoice(BuyingController):
def get_gl_entries(self, warehouse_account=None):
self.auto_accounting_for_stock = erpnext.is_perpetual_inventory_enabled(self.company)
if self.auto_accounting_for_stock:
self.stock_received_but_not_billed = self.get_company_default("stock_received_but_not_billed")
self.expenses_included_in_valuation = self.get_company_default("expenses_included_in_valuation")
else:
self.stock_received_but_not_billed = None
self.expenses_included_in_valuation = None
self.negative_expense_to_be_booked = 0.0
gl_entries = []
@@ -584,9 +611,6 @@ class PurchaseInvoice(BuyingController):
self.make_item_gl_entries(gl_entries)
self.make_precision_loss_gl_entry(gl_entries)
if self.check_asset_cwip_enabled():
self.get_asset_gl_entry(gl_entries)
self.make_tax_gl_entries(gl_entries)
self.make_internal_transfer_gl_entries(gl_entries)
@@ -690,7 +714,11 @@ class PurchaseInvoice(BuyingController):
if item.item_code:
asset_category = frappe.get_cached_value("Item", item.item_code, "asset_category")
if self.update_stock and self.auto_accounting_for_stock and item.item_code in stock_items:
if (
self.update_stock
and self.auto_accounting_for_stock
and (item.item_code in stock_items or item.is_fixed_asset)
):
# warehouse account
warehouse_debit_amount = self.make_stock_adjustment_entry(
gl_entries, item, voucher_wise_stock_value, account_currency
@@ -805,9 +833,7 @@ class PurchaseInvoice(BuyingController):
)
)
elif not item.is_fixed_asset or (
item.is_fixed_asset and not is_cwip_accounting_enabled(asset_category)
):
else:
expense_account = (
item.expense_account
if (not item.enable_deferred_expense or self.is_return)
@@ -900,40 +926,6 @@ class PurchaseInvoice(BuyingController):
)
)
# If asset is bought through this document and not linked to PR
if self.update_stock and item.landed_cost_voucher_amount:
expenses_included_in_asset_valuation = self.get_company_default(
"expenses_included_in_asset_valuation"
)
# Amount added through landed-cost-voucher
gl_entries.append(
self.get_gl_dict(
{
"account": expenses_included_in_asset_valuation,
"against": expense_account,
"cost_center": item.cost_center,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"credit": flt(item.landed_cost_voucher_amount),
"project": item.project or self.project,
},
item=item,
)
)
gl_entries.append(
self.get_gl_dict(
{
"account": expense_account,
"against": expenses_included_in_asset_valuation,
"cost_center": item.cost_center,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"debit": flt(item.landed_cost_voucher_amount),
"project": item.project or self.project,
},
item=item,
)
)
# update gross amount of asset bought through this document
assets = frappe.db.get_all(
"Asset", filters={"purchase_invoice": self.name, "item_code": item.item_code}
@@ -958,11 +950,17 @@ class PurchaseInvoice(BuyingController):
(item.purchase_receipt, valuation_tax_accounts),
)
stock_rbnb = (
self.get_company_default("asset_received_but_not_billed")
if item.is_fixed_asset
else self.stock_received_but_not_billed
)
if not negative_expense_booked_in_pr:
gl_entries.append(
self.get_gl_dict(
{
"account": self.stock_received_but_not_billed,
"account": stock_rbnb,
"against": self.supplier,
"debit": flt(item.item_tax_amount, item.precision("item_tax_amount")),
"remarks": self.remarks or _("Accounting Entry for Stock"),
@@ -977,156 +975,12 @@ class PurchaseInvoice(BuyingController):
item.item_tax_amount, item.precision("item_tax_amount")
)
def get_asset_gl_entry(self, gl_entries):
arbnb_account = None
eiiav_account = None
asset_eiiav_currency = None
for item in self.get("items"):
if item.is_fixed_asset:
asset_amount = flt(item.net_amount) + flt(item.item_tax_amount / self.conversion_rate)
base_asset_amount = flt(item.base_net_amount + item.item_tax_amount)
item_exp_acc_type = frappe.db.get_value("Account", item.expense_account, "account_type")
if not item.expense_account or item_exp_acc_type not in [
"Asset Received But Not Billed",
"Fixed Asset",
]:
if not arbnb_account:
arbnb_account = self.get_company_default("asset_received_but_not_billed")
item.expense_account = arbnb_account
if not self.update_stock:
arbnb_currency = get_account_currency(item.expense_account)
gl_entries.append(
self.get_gl_dict(
{
"account": item.expense_account,
"against": self.supplier,
"remarks": self.get("remarks") or _("Accounting Entry for Asset"),
"debit": base_asset_amount,
"debit_in_account_currency": (
base_asset_amount if arbnb_currency == self.company_currency else asset_amount
),
"cost_center": item.cost_center,
"project": item.project or self.project,
},
item=item,
)
)
if item.item_tax_amount:
if not eiiav_account or not asset_eiiav_currency:
eiiav_account = self.get_company_default("expenses_included_in_asset_valuation")
asset_eiiav_currency = get_account_currency(eiiav_account)
gl_entries.append(
self.get_gl_dict(
{
"account": eiiav_account,
"against": self.supplier,
"remarks": self.get("remarks") or _("Accounting Entry for Asset"),
"cost_center": item.cost_center,
"project": item.project or self.project,
"credit": item.item_tax_amount,
"credit_in_account_currency": (
item.item_tax_amount
if asset_eiiav_currency == self.company_currency
else item.item_tax_amount / self.conversion_rate
),
},
item=item,
)
)
else:
cwip_account = get_asset_account(
"capital_work_in_progress_account", asset_category=item.asset_category, company=self.company
)
cwip_account_currency = get_account_currency(cwip_account)
gl_entries.append(
self.get_gl_dict(
{
"account": cwip_account,
"against": self.supplier,
"remarks": self.get("remarks") or _("Accounting Entry for Asset"),
"debit": base_asset_amount,
"debit_in_account_currency": (
base_asset_amount if cwip_account_currency == self.company_currency else asset_amount
),
"cost_center": self.cost_center,
"project": item.project or self.project,
},
item=item,
)
)
if item.item_tax_amount and not cint(erpnext.is_perpetual_inventory_enabled(self.company)):
if not eiiav_account or not asset_eiiav_currency:
eiiav_account = self.get_company_default("expenses_included_in_asset_valuation")
asset_eiiav_currency = get_account_currency(eiiav_account)
gl_entries.append(
self.get_gl_dict(
{
"account": eiiav_account,
"against": self.supplier,
"remarks": self.get("remarks") or _("Accounting Entry for Asset"),
"cost_center": item.cost_center,
"credit": item.item_tax_amount,
"project": item.project or self.project,
"credit_in_account_currency": (
item.item_tax_amount
if asset_eiiav_currency == self.company_currency
else item.item_tax_amount / self.conversion_rate
),
},
item=item,
)
)
# Assets are bought through this document then it will be linked to this document
if flt(item.landed_cost_voucher_amount):
if not eiiav_account:
eiiav_account = self.get_company_default("expenses_included_in_asset_valuation")
gl_entries.append(
self.get_gl_dict(
{
"account": eiiav_account,
"against": cwip_account,
"cost_center": item.cost_center,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"credit": flt(item.landed_cost_voucher_amount),
"project": item.project or self.project,
},
item=item,
)
)
gl_entries.append(
self.get_gl_dict(
{
"account": cwip_account,
"against": eiiav_account,
"cost_center": item.cost_center,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"debit": flt(item.landed_cost_voucher_amount),
"project": item.project or self.project,
},
item=item,
)
)
# update gross amount of assets bought through this document
assets = frappe.db.get_all(
"Asset", filters={"purchase_invoice": self.name, "item_code": item.item_code}
)
for asset in assets:
frappe.db.set_value("Asset", asset.name, "gross_purchase_amount", flt(item.valuation_rate))
frappe.db.set_value("Asset", asset.name, "purchase_receipt_amount", flt(item.valuation_rate))
return gl_entries
assets = frappe.db.get_all(
"Asset", filters={"purchase_invoice": self.name, "item_code": item.item_code}
)
for asset in assets:
frappe.db.set_value("Asset", asset.name, "gross_purchase_amount", flt(item.valuation_rate))
frappe.db.set_value("Asset", asset.name, "purchase_receipt_amount", flt(item.valuation_rate))
def make_stock_adjustment_entry(
self, gl_entries, item, voucher_wise_stock_value, account_currency
@@ -1421,7 +1275,10 @@ class PurchaseInvoice(BuyingController):
if self.update_stock == 1:
self.repost_future_sle_and_gle()
self.update_project()
if (
frappe.db.get_single_value("Buying Settings", "project_update_frequency") == "Each Transaction"
):
self.update_project()
self.db_set("status", "Cancelled")
unlink_inter_company_doc(self.doctype, self.name, self.inter_company_invoice_reference)
@@ -1433,19 +1290,29 @@ class PurchaseInvoice(BuyingController):
"Repost Payment Ledger Items",
"Repost Accounting Ledger",
"Repost Accounting Ledger Items",
"Unreconcile Payment",
"Unreconcile Payment Entries",
"Payment Ledger Entry",
"Tax Withheld Vouchers",
)
self.update_advance_tax_references(cancel=1)
def update_project(self):
project_list = []
projects = frappe._dict()
for d in self.items:
if d.project and d.project not in project_list:
project = frappe.get_doc("Project", d.project)
project.update_purchase_costing()
project.db_update()
project_list.append(d.project)
if d.project:
if self.docstatus == 1:
projects[d.project] = projects.get(d.project, 0) + d.base_net_amount
elif self.docstatus == 2:
projects[d.project] = projects.get(d.project, 0) - d.base_net_amount
pj = frappe.qb.DocType("Project")
for proj, value in projects.items():
res = (
frappe.qb.from_(pj).select(pj.total_purchase_cost).where(pj.name == proj).for_update().run()
)
current_purchase_cost = res and res[0][0] or 0
frappe.db.set_value("Project", proj, "total_purchase_cost", current_purchase_cost + value)
def validate_supplier_invoice(self):
if self.bill_date:
@@ -1793,10 +1660,6 @@ def make_inter_company_sales_invoice(source_name, target_doc=None):
return make_inter_company_transaction("Purchase Invoice", source_name, target_doc)
def on_doctype_update():
frappe.db.add_index("Purchase Invoice", ["supplier", "is_return", "return_against"])
@frappe.whitelist()
def make_purchase_receipt(source_name, target_doc=None):
def update_item(obj, target, source_parent):
@@ -1828,6 +1691,7 @@ def make_purchase_receipt(source_name, target_doc=None):
"po_detail": "purchase_order_item",
"material_request": "material_request",
"material_request_item": "material_request_item",
"wip_composite_asset": "wip_composite_asset",
},
"postprocess": update_item,
"condition": lambda doc: abs(doc.received_qty) < abs(doc.qty),
@@ -1837,6 +1701,4 @@ def make_purchase_receipt(source_name, target_doc=None):
target_doc,
)
doc.set_onload("ignore_price_list", True)
return doc

View File

@@ -5,7 +5,7 @@
import unittest
import frappe
from frappe.tests.utils import change_settings
from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import add_days, cint, flt, getdate, nowdate, today
import erpnext
@@ -33,7 +33,7 @@ test_dependencies = ["Item", "Cost Center", "Payment Term", "Payment Terms Templ
test_ignore = ["Serial No"]
class TestPurchaseInvoice(unittest.TestCase, StockTestMixin):
class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
@classmethod
def setUpClass(self):
unlink_payment_on_cancel_of_invoice()
@@ -43,6 +43,9 @@ class TestPurchaseInvoice(unittest.TestCase, StockTestMixin):
def tearDownClass(self):
unlink_payment_on_cancel_of_invoice(0)
def tearDown(self):
frappe.db.rollback()
def test_purchase_invoice_received_qty(self):
"""
1. Test if received qty is validated against accepted + rejected
@@ -417,6 +420,7 @@ class TestPurchaseInvoice(unittest.TestCase, StockTestMixin):
self.assertEqual(tax.tax_amount, expected_values[i][1])
self.assertEqual(tax.total, expected_values[i][2])
@change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_purchase_invoice_with_advance(self):
from erpnext.accounts.doctype.journal_entry.test_journal_entry import (
test_records as jv_test_records,
@@ -471,6 +475,7 @@ class TestPurchaseInvoice(unittest.TestCase, StockTestMixin):
)
)
@change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_invoice_with_advance_and_multi_payment_terms(self):
from erpnext.accounts.doctype.journal_entry.test_journal_entry import (
test_records as jv_test_records,
@@ -1209,6 +1214,7 @@ class TestPurchaseInvoice(unittest.TestCase, StockTestMixin):
acc_settings.submit_journal_entriessubmit_journal_entries = 0
acc_settings.save()
@change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_gain_loss_with_advance_entry(self):
unlink_enabled = frappe.db.get_value(
"Accounts Settings", "Accounts Settings", "unlink_payment_on_cancel_of_invoice"
@@ -1411,6 +1417,7 @@ class TestPurchaseInvoice(unittest.TestCase, StockTestMixin):
)
frappe.db.set_value("Company", "_Test Company", "exchange_gain_loss_account", original_account)
@change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_purchase_invoice_advance_taxes(self):
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
@@ -1711,9 +1718,14 @@ class TestPurchaseInvoice(unittest.TestCase, StockTestMixin):
self.assertTrue(return_pi.docstatus == 1)
def test_gl_entries_for_standalone_debit_note(self):
make_purchase_invoice(qty=5, rate=500, update_stock=True)
from erpnext.stock.doctype.item.test_item import make_item
returned_inv = make_purchase_invoice(qty=-5, rate=5, update_stock=True, is_return=True)
item_code = make_item(properties={"is_stock_item": 1})
make_purchase_invoice(item_code=item_code, qty=5, rate=500, update_stock=True)
returned_inv = make_purchase_invoice(
item_code=item_code, qty=-5, rate=5, update_stock=True, is_return=True
)
# override the rate with valuation rate
sle = frappe.get_all(
@@ -1723,7 +1735,7 @@ class TestPurchaseInvoice(unittest.TestCase, StockTestMixin):
)[0]
rate = flt(sle.stock_value_difference) / flt(sle.actual_qty)
self.assertAlmostEqual(returned_inv.items[0].rate, rate)
self.assertAlmostEqual(rate, 500)
def test_payment_allocation_for_payment_terms(self):
from erpnext.buying.doctype.purchase_order.test_purchase_order import (
@@ -1796,7 +1808,6 @@ class TestPurchaseInvoice(unittest.TestCase, StockTestMixin):
pi = make_purchase_invoice(
company="_Test Company",
customer="_Test Supplier",
do_not_save=True,
do_not_submit=True,
rate=1000,
@@ -1826,6 +1837,62 @@ class TestPurchaseInvoice(unittest.TestCase, StockTestMixin):
clear_dimension_defaults("Branch")
disable_dimension()
def test_repost_accounting_entries(self):
# update repost settings
settings = frappe.get_doc("Repost Accounting Ledger Settings")
if not [x for x in settings.allowed_types if x.document_type == "Purchase Invoice"]:
settings.append("allowed_types", {"document_type": "Purchase Invoice", "allowed": True})
settings.save()
pi = make_purchase_invoice(
rate=1000,
price_list_rate=1000,
qty=1,
)
expected_gle = [
["_Test Account Cost for Goods Sold - _TC", 1000, 0.0, nowdate()],
["Creditors - _TC", 0.0, 1000, nowdate()],
]
check_gl_entries(self, pi.name, expected_gle, nowdate())
pi.items[0].expense_account = "Service - _TC"
pi.save()
pi.load_from_db()
self.assertTrue(pi.repost_required)
pi.repost_accounting_entries()
expected_gle = [
["Creditors - _TC", 0.0, 1000, nowdate()],
["Service - _TC", 1000, 0.0, nowdate()],
]
check_gl_entries(self, pi.name, expected_gle, nowdate())
pi.load_from_db()
self.assertFalse(pi.repost_required)
def test_default_cost_center_for_purchase(self):
from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
for c_center in ["_Test Cost Center Selling", "_Test Cost Center Buying"]:
create_cost_center(cost_center_name=c_center)
item = create_item(
"_Test Cost Center Item For Purchase",
is_stock_item=1,
buying_cost_center="_Test Cost Center Buying - _TC",
selling_cost_center="_Test Cost Center Selling - _TC",
)
pi = make_purchase_invoice(
item=item.name, qty=1, rate=1000, update_stock=True, do_not_submit=True, cost_center=""
)
pi.items[0].cost_center = ""
pi.set_missing_values()
pi.calculate_taxes_and_totals()
pi.save()
self.assertEqual(pi.items[0].cost_center, "_Test Cost Center Buying - _TC")
def check_gl_entries(
doc,

View File

@@ -156,6 +156,7 @@
"width": "300px"
},
{
"fetch_from": "item_code.image",
"fieldname": "image",
"fieldtype": "Attach",
"hidden": 1,
@@ -468,6 +469,7 @@
"label": "Accounting"
},
{
"allow_on_submit": 1,
"fieldname": "expense_account",
"fieldtype": "Link",
"label": "Expense Head",
@@ -490,6 +492,7 @@
"fieldtype": "Column Break"
},
{
"allow_on_submit": 1,
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
@@ -497,6 +500,7 @@
"print_hide": 1
},
{
"allow_on_submit": 1,
"default": ":Company",
"depends_on": "eval:!doc.is_fixed_asset",
"fieldname": "cost_center",
@@ -889,7 +893,7 @@
"idx": 1,
"istable": 1,
"links": [],
"modified": "2023-10-03 21:01:01.824892",
"modified": "2023-12-25 22:00:28.043555",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",

View File

@@ -86,6 +86,7 @@
"fieldtype": "Column Break"
},
{
"allow_on_submit": 1,
"columns": 2,
"fieldname": "account_head",
"fieldtype": "Link",
@@ -97,6 +98,7 @@
"reqd": 1
},
{
"allow_on_submit": 1,
"default": ":Company",
"fieldname": "cost_center",
"fieldtype": "Link",

View File

@@ -5,9 +5,7 @@ frappe.ui.form.on("Repost Accounting Ledger", {
setup: function(frm) {
frm.fields_dict['vouchers'].grid.get_field('voucher_type').get_query = function(doc) {
return {
filters: {
name: ['in', ['Purchase Invoice', 'Sales Invoice', 'Payment Entry', 'Journal Entry']],
}
query: "erpnext.accounts.doctype.repost_accounting_ledger.repost_accounting_ledger.get_repost_allowed_types"
}
}

View File

@@ -55,7 +55,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2023-07-27 15:47:58.975034",
"modified": "2023-09-26 14:21:27.362567",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Repost Accounting Ledger",
@@ -77,5 +77,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
"states": [],
"track_changes": 1
}

View File

@@ -10,9 +10,7 @@ from frappe.utils.data import comma_and
class RepostAccountingLedger(Document):
def __init__(self, *args, **kwargs):
super(RepostAccountingLedger, self).__init__(*args, **kwargs)
self._allowed_types = set(
["Purchase Invoice", "Sales Invoice", "Payment Entry", "Journal Entry"]
)
self._allowed_types = get_allowed_types_from_settings()
def validate(self):
self.validate_vouchers()
@@ -21,29 +19,8 @@ class RepostAccountingLedger(Document):
def validate_for_deferred_accounting(self):
sales_docs = [x.voucher_no for x in self.vouchers if x.voucher_type == "Sales Invoice"]
docs_with_deferred_revenue = frappe.db.get_all(
"Sales Invoice Item",
filters={"parent": ["in", sales_docs], "docstatus": 1, "enable_deferred_revenue": True},
fields=["parent"],
as_list=1,
)
purchase_docs = [x.voucher_no for x in self.vouchers if x.voucher_type == "Purchase Invoice"]
docs_with_deferred_expense = frappe.db.get_all(
"Purchase Invoice Item",
filters={"parent": ["in", purchase_docs], "docstatus": 1, "enable_deferred_expense": 1},
fields=["parent"],
as_list=1,
)
if docs_with_deferred_revenue or docs_with_deferred_expense:
frappe.throw(
_("Documents: {0} have deferred revenue/expense enabled for them. Cannot repost.").format(
frappe.bold(
comma_and([x[0] for x in docs_with_deferred_expense + docs_with_deferred_revenue])
)
)
)
validate_docs_for_deferred_accounting(sales_docs, purchase_docs)
def validate_for_closed_fiscal_year(self):
if self.vouchers:
@@ -74,15 +51,7 @@ class RepostAccountingLedger(Document):
def validate_vouchers(self):
if self.vouchers:
# Validate voucher types
voucher_types = set([x.voucher_type for x in self.vouchers])
if disallowed_types := voucher_types.difference(self._allowed_types):
frappe.throw(
_("{0} types are not allowed. Only {1} are.").format(
frappe.bold(comma_and(list(disallowed_types))),
frappe.bold(comma_and(list(self._allowed_types))),
)
)
validate_docs_for_voucher_types([x.voucher_type for x in self.vouchers])
def get_existing_ledger_entries(self):
vouchers = [x.voucher_no for x in self.vouchers]
@@ -139,14 +108,17 @@ class RepostAccountingLedger(Document):
return rendered_page
def on_submit(self):
job_name = "repost_accounting_ledger_" + self.name
frappe.enqueue(
method="erpnext.accounts.doctype.repost_accounting_ledger.repost_accounting_ledger.start_repost",
account_repost_doc=self.name,
is_async=True,
job_name=job_name,
)
frappe.msgprint(_("Repost has started in the background"))
if len(self.vouchers) > 5:
job_name = "repost_accounting_ledger_" + self.name
frappe.enqueue(
method="erpnext.accounts.doctype.repost_accounting_ledger.repost_accounting_ledger.start_repost",
account_repost_doc=self.name,
is_async=True,
job_name=job_name,
)
frappe.msgprint(_("Repost has started in the background"))
else:
start_repost(self.name)
@frappe.whitelist()
@@ -175,9 +147,73 @@ def start_repost(account_repost_doc=str) -> None:
doc.docstatus = 1
doc.make_gl_entries()
elif doc.doctype in ["Payment Entry", "Journal Entry"]:
elif doc.doctype in ["Payment Entry", "Journal Entry", "Expense Claim"]:
if not repost_doc.delete_cancelled_entries:
doc.make_gl_entries(1)
doc.make_gl_entries()
frappe.db.commit()
def get_allowed_types_from_settings():
return [
x.document_type
for x in frappe.db.get_all(
"Repost Allowed Types", filters={"allowed": True}, fields=["distinct(document_type)"]
)
]
def validate_docs_for_deferred_accounting(sales_docs, purchase_docs):
docs_with_deferred_revenue = frappe.db.get_all(
"Sales Invoice Item",
filters={"parent": ["in", sales_docs], "docstatus": 1, "enable_deferred_revenue": True},
fields=["parent"],
as_list=1,
)
docs_with_deferred_expense = frappe.db.get_all(
"Purchase Invoice Item",
filters={"parent": ["in", purchase_docs], "docstatus": 1, "enable_deferred_expense": 1},
fields=["parent"],
as_list=1,
)
if docs_with_deferred_revenue or docs_with_deferred_expense:
frappe.throw(
_("Documents: {0} have deferred revenue/expense enabled for them. Cannot repost.").format(
frappe.bold(comma_and([x[0] for x in docs_with_deferred_expense + docs_with_deferred_revenue]))
)
)
def validate_docs_for_voucher_types(doc_voucher_types):
allowed_types = get_allowed_types_from_settings()
# Validate voucher types
voucher_types = set(doc_voucher_types)
if disallowed_types := voucher_types.difference(allowed_types):
message = "are" if len(disallowed_types) > 1 else "is"
frappe.throw(
_("{0} {1} not allowed to be reposted. Modify {2} to enable reposting.").format(
frappe.bold(comma_and(list(disallowed_types))),
message,
frappe.bold(
frappe.utils.get_link_to_form(
"Repost Accounting Ledger Settings", "Repost Accounting Ledger Settings"
)
),
)
)
@frappe.whitelist()
@frappe.validate_and_sanitize_search_inputs
def get_repost_allowed_types(doctype, txt, searchfield, start, page_len, filters):
filters = {"allowed": True}
if txt:
filters.update({"document_type": ("like", f"%{txt}%")})
if allowed_types := frappe.db.get_all(
"Repost Allowed Types", filters=filters, fields=["distinct(document_type)"], as_list=1
):
return allowed_types
return []

View File

@@ -20,8 +20,9 @@ class TestRepostAccountingLedger(AccountsTestMixin, FrappeTestCase):
self.create_company()
self.create_customer()
self.create_item()
update_repost_settings()
def teadDown(self):
def tearDown(self):
frappe.db.rollback()
def test_01_basic_functions(self):
@@ -82,9 +83,6 @@ class TestRepostAccountingLedger(AccountsTestMixin, FrappeTestCase):
# Submit repost document
ral.save().submit()
# background jobs don't run on test cases. Manually triggering repost function.
start_repost(ral.name)
res = (
qb.from_(gl)
.select(gl.voucher_no, Sum(gl.debit).as_("debit"), Sum(gl.credit).as_("credit"))
@@ -169,26 +167,6 @@ class TestRepostAccountingLedger(AccountsTestMixin, FrappeTestCase):
pe = get_payment_entry(si.doctype, si.name)
pe.save().submit()
# without deletion flag set
ral = frappe.new_doc("Repost Accounting Ledger")
ral.company = self.company
ral.delete_cancelled_entries = False
ral.append("vouchers", {"voucher_type": si.doctype, "voucher_no": si.name})
ral.append("vouchers", {"voucher_type": pe.doctype, "voucher_no": pe.name})
ral.save()
# assert preview data is generated
preview = ral.generate_preview()
self.assertIsNotNone(preview)
ral.save().submit()
# background jobs don't run on test cases. Manually triggering repost function.
start_repost(ral.name)
self.assertIsNotNone(frappe.db.exists("GL Entry", {"voucher_no": si.name, "is_cancelled": 1}))
self.assertIsNotNone(frappe.db.exists("GL Entry", {"voucher_no": pe.name, "is_cancelled": 1}))
# with deletion flag set
ral = frappe.new_doc("Repost Accounting Ledger")
ral.company = self.company
@@ -197,6 +175,38 @@ class TestRepostAccountingLedger(AccountsTestMixin, FrappeTestCase):
ral.append("vouchers", {"voucher_type": pe.doctype, "voucher_no": pe.name})
ral.save().submit()
start_repost(ral.name)
self.assertIsNone(frappe.db.exists("GL Entry", {"voucher_no": si.name, "is_cancelled": 1}))
self.assertIsNone(frappe.db.exists("GL Entry", {"voucher_no": pe.name, "is_cancelled": 1}))
def test_05_without_deletion_flag(self):
si = create_sales_invoice(
item=self.item,
company=self.company,
customer=self.customer,
debit_to=self.debit_to,
parent_cost_center=self.cost_center,
cost_center=self.cost_center,
rate=100,
)
pe = get_payment_entry(si.doctype, si.name)
pe.save().submit()
# without deletion flag set
ral = frappe.new_doc("Repost Accounting Ledger")
ral.company = self.company
ral.delete_cancelled_entries = False
ral.append("vouchers", {"voucher_type": si.doctype, "voucher_no": si.name})
ral.append("vouchers", {"voucher_type": pe.doctype, "voucher_no": pe.name})
ral.save().submit()
self.assertIsNotNone(frappe.db.exists("GL Entry", {"voucher_no": si.name, "is_cancelled": 1}))
self.assertIsNotNone(frappe.db.exists("GL Entry", {"voucher_no": pe.name, "is_cancelled": 1}))
def update_repost_settings():
allowed_types = ["Sales Invoice", "Purchase Invoice", "Payment Entry", "Journal Entry"]
repost_settings = frappe.get_doc("Repost Accounting Ledger Settings")
for x in allowed_types:
repost_settings.append("allowed_types", {"document_type": x, "allowed": True})
repost_settings.save()

View File

@@ -0,0 +1,8 @@
// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
// frappe.ui.form.on("Repost Accounting Ledger Settings", {
// refresh(frm) {
// },
// });

View File

@@ -0,0 +1,46 @@
{
"actions": [],
"creation": "2023-11-07 09:57:20.619939",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"allowed_types"
],
"fields": [
{
"fieldname": "allowed_types",
"fieldtype": "Table",
"label": "Allowed Doctypes",
"options": "Repost Allowed Types"
}
],
"in_create": 1,
"issingle": 1,
"links": [],
"modified": "2023-11-07 14:24:13.321522",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Repost Accounting Ledger Settings",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"print": 1,
"read": 1,
"role": "Administrator",
"share": 1,
"write": 1
},
{
"read": 1,
"role": "System Manager",
"select": 1
}
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -0,0 +1,9 @@
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class RepostAccountingLedgerSettings(Document):
pass

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

View File

@@ -0,0 +1,45 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2023-11-07 09:58:03.595382",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"document_type",
"column_break_sfzb",
"allowed"
],
"fields": [
{
"fieldname": "document_type",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Doctype",
"options": "DocType"
},
{
"default": "0",
"fieldname": "allowed",
"fieldtype": "Check",
"in_list_view": 1,
"label": "Allowed"
},
{
"fieldname": "column_break_sfzb",
"fieldtype": "Column Break"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2023-11-07 10:01:39.217861",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Repost Allowed Types",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}

View File

@@ -0,0 +1,9 @@
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class RepostAllowedTypes(Document):
pass

View File

@@ -99,7 +99,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2022-11-08 07:38:40.079038",
"modified": "2023-09-26 14:21:35.719727",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Repost Payment Ledger",
@@ -155,5 +155,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
"states": [],
"track_changes": 1
}

View File

@@ -34,7 +34,7 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e
super.onload();
this.frm.ignore_doctypes_on_cancel_all = ['POS Invoice', 'Timesheet', 'POS Invoice Merge Log',
'POS Closing Entry', 'Journal Entry', 'Payment Entry', "Repost Payment Ledger", "Repost Accounting Ledger"];
'POS Closing Entry', 'Journal Entry', 'Payment Entry', "Repost Payment Ledger", "Repost Accounting Ledger", "Unreconcile Payment", "Unreconcile Payment Entries"];
if(!this.frm.doc.__islocal && !this.frm.doc.customer && this.frm.doc.debit_to) {
// show debit_to in print format
@@ -177,6 +177,8 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e
}, __('Create'));
}
}
erpnext.accounts.unreconcile_payment.add_unreconcile_btn(me.frm);
}
make_maintenance_schedule() {
@@ -554,15 +556,6 @@ cur_frm.fields_dict.write_off_cost_center.get_query = function(doc) {
}
}
// Income Account in Details Table
// --------------------------------
cur_frm.set_query("income_account", "items", function(doc) {
return{
query: "erpnext.controllers.queries.get_income_account",
filters: {'company': doc.company}
}
});
// Cost Center in Details Table
// -----------------------------
cur_frm.fields_dict["items"].grid.get_field("cost_center").get_query = function(doc) {
@@ -657,6 +650,16 @@ frappe.ui.form.on('Sales Invoice', {
};
});
frm.set_query("income_account", "items", function() {
return{
query: "erpnext.controllers.queries.get_income_account",
filters: {
'company': frm.doc.company,
"disabled": 0
}
}
});
frm.custom_make_buttons = {
'Delivery Note': 'Delivery',
'Sales Invoice': 'Return / Credit Note',

View File

@@ -26,6 +26,7 @@
"is_return",
"return_against",
"update_billed_amount_in_sales_order",
"update_billed_amount_in_delivery_note",
"is_debit_note",
"amended_from",
"accounting_dimensions_section",
@@ -1612,7 +1613,8 @@
"hide_seconds": 1,
"label": "Inter Company Invoice Reference",
"options": "Purchase Invoice",
"read_only": 1
"read_only": 1,
"search_index": 1
},
{
"fieldname": "customer_group",
@@ -2144,6 +2146,13 @@
"fieldname": "use_company_roundoff_cost_center",
"fieldtype": "Check",
"label": "Use Company default Cost Center for Round off"
},
{
"default": "1",
"depends_on": "eval: doc.is_return",
"fieldname": "update_billed_amount_in_delivery_note",
"fieldtype": "Check",
"label": "Update Billed Amount in Delivery Note"
}
],
"icon": "fa fa-file-text",
@@ -2156,7 +2165,7 @@
"link_fieldname": "consolidated_invoice"
}
],
"modified": "2023-06-19 16:02:05.309332",
"modified": "2023-11-23 16:56:29.679499",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",

View File

@@ -11,13 +11,14 @@ from frappe.utils import add_days, cint, cstr, flt, formatdate, get_link_to_form
import erpnext
from erpnext.accounts.deferred_revenue import validate_service_stop_date
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
get_accounting_dimensions,
)
from erpnext.accounts.doctype.loyalty_program.loyalty_program import (
get_loyalty_program_details_with_points,
validate_loyalty_points,
)
from erpnext.accounts.doctype.repost_accounting_ledger.repost_accounting_ledger import (
validate_docs_for_deferred_accounting,
validate_docs_for_voucher_types,
)
from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category import (
get_party_tax_withholding_details,
)
@@ -176,6 +177,13 @@ class SalesInvoice(SellingController):
self.validate_account_for_change_amount()
self.validate_income_account()
def validate_for_repost(self):
self.validate_write_off_account()
self.validate_account_for_change_amount()
self.validate_income_account()
validate_docs_for_voucher_types(["Sales Invoice"])
validate_docs_for_deferred_accounting([self.name], [])
def validate_fixed_asset(self):
for d in self.get("items"):
if d.is_fixed_asset and d.meta.get_field("asset") and d.asset:
@@ -255,6 +263,7 @@ class SalesInvoice(SellingController):
self.update_status_updater_args()
self.update_prevdoc_status()
self.update_billing_status_in_dn()
self.clear_unallocated_mode_of_payments()
@@ -401,6 +410,8 @@ class SalesInvoice(SellingController):
"Repost Payment Ledger Items",
"Repost Accounting Ledger",
"Repost Accounting Ledger Items",
"Unreconcile Payment",
"Unreconcile Payment Entries",
"Payment Ledger Entry",
)
@@ -527,89 +538,22 @@ class SalesInvoice(SellingController):
def on_update_after_submit(self):
if hasattr(self, "repost_required"):
needs_repost = 0
# Check if any field affecting accounting entry is altered
doc_before_update = self.get_doc_before_save()
accounting_dimensions = get_accounting_dimensions() + ["cost_center", "project"]
# Check if opening entry check updated
if doc_before_update.get("is_opening") != self.is_opening:
needs_repost = 1
if not needs_repost:
# Parent Level Accounts excluding party account
for field in (
"additional_discount_account",
"cash_bank_account",
"account_for_change_amount",
"write_off_account",
"loyalty_redemption_account",
"unrealized_profit_loss_account",
):
if doc_before_update.get(field) != self.get(field):
needs_repost = 1
break
# Check for parent accounting dimensions
for dimension in accounting_dimensions:
if doc_before_update.get(dimension) != self.get(dimension):
needs_repost = 1
break
# Check for child tables
if self.check_if_child_table_updated(
"items",
doc_before_update,
("income_account", "expense_account", "discount_account"),
accounting_dimensions,
):
needs_repost = 1
if self.check_if_child_table_updated(
"taxes", doc_before_update, ("account_head",), accounting_dimensions
):
needs_repost = 1
self.validate_accounts()
# validate if deferred revenue is enabled for any item
# Don't allow to update the invoice if deferred revenue is enabled
for item in self.get("items"):
if item.enable_deferred_revenue:
frappe.throw(
_(
"Deferred Revenue is enabled for item {0}. You cannot update the invoice after submission."
).format(item.item_code)
)
self.db_set("repost_required", needs_repost)
def check_if_child_table_updated(
self, child_table, doc_before_update, fields_to_check, accounting_dimensions
):
# Check if any field affecting accounting entry is altered
for index, item in enumerate(self.get(child_table)):
for field in fields_to_check:
if doc_before_update.get(child_table)[index].get(field) != item.get(field):
return True
for dimension in accounting_dimensions:
if doc_before_update.get(child_table)[index].get(dimension) != item.get(dimension):
return True
return False
@frappe.whitelist()
def repost_accounting_entries(self):
if self.repost_required:
self.docstatus = 2
self.make_gl_entries_on_cancel()
self.docstatus = 1
self.make_gl_entries()
self.db_set("repost_required", 0)
else:
frappe.throw(_("No updates pending for reposting"))
fields_to_check = [
"additional_discount_account",
"cash_bank_account",
"account_for_change_amount",
"write_off_account",
"loyalty_redemption_account",
"unrealized_profit_loss_account",
]
child_tables = {
"items": ("income_account", "expense_account", "discount_account"),
"taxes": ("account_head",),
}
self.needs_repost = self.check_if_fields_updated(fields_to_check, child_tables)
if self.needs_repost:
self.validate_for_repost()
self.db_set("repost_required", self.needs_repost)
def set_paid_amount(self):
paid_amount = 0.0
@@ -1095,7 +1039,7 @@ class SalesInvoice(SellingController):
def make_customer_gl_entry(self, gl_entries):
# Checked both rounding_adjustment and rounded_total
# because rounded_total had value even before introcution of posting GLE based on rounded total
# because rounded_total had value even before introduction of posting GLE based on rounded total
grand_total = (
self.rounded_total if (self.rounding_adjustment and self.rounded_total) else self.grand_total
)
@@ -1330,7 +1274,7 @@ class SalesInvoice(SellingController):
if skip_change_gl_entries and payment_mode.account == self.account_for_change_amount:
payment_mode.base_amount -= flt(self.change_amount)
if payment_mode.amount:
if payment_mode.base_amount:
# POS, make payment entries
gl_entries.append(
self.get_gl_dict(
@@ -1492,6 +1436,8 @@ class SalesInvoice(SellingController):
)
def update_billing_status_in_dn(self, update_modified=True):
if self.is_return and not self.update_billed_amount_in_delivery_note:
return
updated_delivery_notes = []
for d in self.get("items"):
if d.dn_detail:
@@ -1988,7 +1934,6 @@ def make_delivery_note(source_name, target_doc=None):
set_missing_values,
)
doclist.set_onload("ignore_price_list", True)
return doclist
@@ -2250,9 +2195,18 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
def get_received_items(reference_name, doctype, reference_fieldname):
reference_field = "inter_company_invoice_reference"
if doctype == "Purchase Order":
reference_field = "inter_company_order_reference"
filters = {
reference_field: reference_name,
"docstatus": 1,
}
target_doctypes = frappe.get_all(
doctype,
filters={"inter_company_invoice_reference": reference_name, "docstatus": 1},
filters=filters,
as_list=True,
)
@@ -2434,10 +2388,6 @@ def get_loyalty_programs(customer):
return lp_details
def on_doctype_update():
frappe.db.add_index("Sales Invoice", ["customer", "is_return", "return_against"])
@frappe.whitelist()
def create_invoice_discounting(source_name, target_doc=None):
invoice = frappe.get_doc("Sales Invoice", source_name)

View File

@@ -7,7 +7,7 @@ import unittest
import frappe
from frappe.model.dynamic_links import get_dynamic_link_map
from frappe.model.naming import make_autoname
from frappe.tests.utils import change_settings
from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import add_days, flt, getdate, nowdate, today
import erpnext
@@ -38,13 +38,17 @@ from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import
from erpnext.stock.utils import get_incoming_rate, get_stock_balance
class TestSalesInvoice(unittest.TestCase):
class TestSalesInvoice(FrappeTestCase):
def setUp(self):
from erpnext.stock.doctype.stock_ledger_entry.test_stock_ledger_entry import create_items
create_items(["_Test Internal Transfer Item"], uoms=[{"uom": "Box", "conversion_factor": 10}])
create_internal_parties()
setup_accounts()
frappe.db.set_single_value("Accounts Settings", "acc_frozen_upto", None)
def tearDown(self):
frappe.db.rollback()
def make(self):
w = frappe.copy_doc(test_records[0])
@@ -172,6 +176,7 @@ class TestSalesInvoice(unittest.TestCase):
self.assertRaises(frappe.LinkExistsError, si.cancel)
unlink_payment_on_cancel_of_invoice()
@change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_payment_entry_unlink_against_standalone_credit_note(self):
from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
@@ -777,6 +782,28 @@ class TestSalesInvoice(unittest.TestCase):
w = self.make()
self.assertEqual(w.outstanding_amount, w.base_rounded_total)
def test_rounded_total_with_cash_discount(self):
si = frappe.copy_doc(test_records[2])
item = copy.deepcopy(si.get("items")[0])
item.update(
{
"qty": 1,
"rate": 14960.66,
}
)
si.set("items", [item])
si.set("taxes", [])
si.apply_discount_on = "Grand Total"
si.is_cash_or_non_trade_discount = 1
si.discount_amount = 1
si.insert()
self.assertEqual(si.grand_total, 14959.66)
self.assertEqual(si.rounded_total, 14960)
self.assertEqual(si.rounding_adjustment, 0.34)
def test_payment(self):
w = self.make()
@@ -1293,6 +1320,7 @@ class TestSalesInvoice(unittest.TestCase):
dn.submit()
return dn
@change_settings("Accounts Settings", {"unlink_payment_on_cancellation_of_invoice": 1})
def test_sales_invoice_with_advance(self):
from erpnext.accounts.doctype.journal_entry.test_journal_entry import (
test_records as jv_test_records,
@@ -2491,12 +2519,6 @@ class TestSalesInvoice(unittest.TestCase):
"stock_received_but_not_billed",
"Stock Received But Not Billed - _TC1",
)
frappe.db.set_value(
"Company",
"_Test Company 1",
"expenses_included_in_valuation",
"Expenses Included In Valuation - _TC1",
)
# begin test
si = create_sales_invoice(
@@ -2534,7 +2556,7 @@ class TestSalesInvoice(unittest.TestCase):
# tear down
frappe.local.enable_perpetual_inventory["_Test Company 1"] = old_perpetual_inventory
frappe.db.set_value("Stock Settings", None, "allow_negative_stock", old_negative_stock)
frappe.db.set_single_value("Stock Settings", "allow_negative_stock", old_negative_stock)
def test_sle_for_target_warehouse(self):
se = make_stock_entry(
@@ -2546,6 +2568,7 @@ class TestSalesInvoice(unittest.TestCase):
)
si = frappe.copy_doc(test_records[0])
si.customer = "_Test Internal Customer 3"
si.update_stock = 1
si.set_warehouse = "Finished Goods - _TC"
si.set_target_warehouse = "Stores - _TC"
@@ -2768,12 +2791,25 @@ class TestSalesInvoice(unittest.TestCase):
@change_settings("Selling Settings", {"enable_discount_accounting": 1})
def test_additional_discount_for_sales_invoice_with_discount_accounting_enabled(self):
from erpnext.accounts.doctype.repost_accounting_ledger.test_repost_accounting_ledger import (
update_repost_settings,
)
update_repost_settings()
additional_discount_account = create_account(
account_name="Discount Account",
parent_account="Indirect Expenses - _TC",
company="_Test Company",
)
tds_payable_account = create_account(
account_name="TDS Payable",
account_type="Tax",
parent_account="Duties and Taxes - _TC",
company="_Test Company",
)
si = create_sales_invoice(parent_cost_center="Main - _TC", do_not_save=1)
si.apply_discount_on = "Grand Total"
si.additional_discount_account = additional_discount_account
@@ -3072,8 +3108,8 @@ class TestSalesInvoice(unittest.TestCase):
si.commission_rate = commission_rate
self.assertRaises(frappe.ValidationError, si.save)
@change_settings("Accounts Settings", {"acc_frozen_upto": add_days(getdate(), 1)})
def test_sales_invoice_submission_post_account_freezing_date(self):
frappe.db.set_value("Accounts Settings", None, "acc_frozen_upto", add_days(getdate(), 1))
si = create_sales_invoice(do_not_save=True)
si.posting_date = add_days(getdate(), 1)
si.save()
@@ -3082,8 +3118,6 @@ class TestSalesInvoice(unittest.TestCase):
si.posting_date = getdate()
si.submit()
frappe.db.set_value("Accounts Settings", None, "acc_frozen_upto", None)
def test_over_billing_case_against_delivery_note(self):
"""
Test a case where duplicating the item with qty = 1 in the invoice
@@ -3112,6 +3146,13 @@ class TestSalesInvoice(unittest.TestCase):
frappe.db.set_value("Accounts Settings", None, "over_billing_allowance", over_billing_allowance)
@change_settings(
"Accounts Settings",
{
"book_deferred_entries_via_journal_entry": 1,
"submit_journal_entries": 1,
},
)
def test_multi_currency_deferred_revenue_via_journal_entry(self):
deferred_account = create_account(
account_name="Deferred Revenue",
@@ -3119,11 +3160,6 @@ class TestSalesInvoice(unittest.TestCase):
company="_Test Company",
)
acc_settings = frappe.get_single("Accounts Settings")
acc_settings.book_deferred_entries_via_journal_entry = 1
acc_settings.submit_journal_entries = 1
acc_settings.save()
item = create_item("_Test Item for Deferred Accounting")
item.enable_deferred_expense = 1
item.item_defaults[0].deferred_revenue_account = deferred_account
@@ -3189,13 +3225,6 @@ class TestSalesInvoice(unittest.TestCase):
self.assertEqual(expected_gle[i][2], gle.debit)
self.assertEqual(getdate(expected_gle[i][3]), gle.posting_date)
acc_settings = frappe.get_single("Accounts Settings")
acc_settings.book_deferred_entries_via_journal_entry = 0
acc_settings.submit_journal_entries = 0
acc_settings.save()
frappe.db.set_value("Accounts Settings", None, "acc_frozen_upto", None)
def test_standalone_serial_no_return(self):
si = create_sales_invoice(
item_code="_Test Serialized Item With Series", update_stock=True, is_return=True, qty=-1
@@ -3573,6 +3602,20 @@ def create_internal_parties():
allowed_to_interact_with="_Test Company with perpetual inventory",
)
create_internal_customer(
customer_name="_Test Internal Customer 3",
represents_company="_Test Company",
allowed_to_interact_with="_Test Company",
)
account = create_account(
account_name="Unrealized Profit",
parent_account="Current Liabilities - _TC",
company="_Test Company",
)
frappe.db.set_value("Company", "_Test Company", "unrealized_profit_loss_account", account)
create_internal_supplier(
supplier_name="_Test Internal Supplier",
represents_company="Wind Power LLC",

View File

@@ -167,6 +167,7 @@
"print_hide": 1
},
{
"fetch_from": "item_code.image",
"fieldname": "image",
"fieldtype": "Attach",
"hidden": 1,
@@ -891,7 +892,7 @@
"idx": 1,
"istable": 1,
"links": [],
"modified": "2023-07-25 11:58:10.723833",
"modified": "2023-11-14 18:34:10.479329",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",
@@ -901,4 +902,4 @@
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
}

View File

@@ -18,6 +18,14 @@ frappe.ui.form.on('Subscription', {
}
};
});
frm.set_query('sales_tax_template', function () {
return {
filters: {
company: frm.doc.company
}
};
});
},
refresh: function(frm) {

View File

@@ -4,6 +4,7 @@
import unittest
import frappe
from frappe.tests.utils import FrappeTestCase
from frappe.utils.data import (
add_days,
add_months,
@@ -90,10 +91,14 @@ def create_parties():
customer.insert()
class TestSubscription(unittest.TestCase):
class TestSubscription(FrappeTestCase):
def setUp(self):
create_plan()
create_parties()
frappe.db.set_single_value("Accounts Settings", "acc_frozen_upto", None)
def tearDown(self):
frappe.db.rollback()
def test_create_subscription_with_trial_with_correct_period(self):
subscription = frappe.new_doc("Subscription")

View File

@@ -0,0 +1,316 @@
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import frappe
from frappe.tests.utils import FrappeTestCase
from frappe.utils import today
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.test.accounts_mixin import AccountsTestMixin
class TestUnreconcilePayment(AccountsTestMixin, FrappeTestCase):
def setUp(self):
self.create_company()
self.create_customer()
self.create_usd_receivable_account()
self.create_item()
self.clear_old_entries()
def tearDown(self):
frappe.db.rollback()
def create_sales_invoice(self, do_not_submit=False):
si = create_sales_invoice(
item=self.item,
company=self.company,
customer=self.customer,
debit_to=self.debit_to,
posting_date=today(),
parent_cost_center=self.cost_center,
cost_center=self.cost_center,
rate=100,
price_list_rate=100,
do_not_submit=do_not_submit,
)
return si
def create_payment_entry(self):
pe = create_payment_entry(
company=self.company,
payment_type="Receive",
party_type="Customer",
party=self.customer,
paid_from=self.debit_to,
paid_to=self.cash,
paid_amount=200,
save=True,
)
return pe
def test_01_unreconcile_invoice(self):
si1 = self.create_sales_invoice()
si2 = self.create_sales_invoice()
pe = self.create_payment_entry()
pe.append(
"references",
{"reference_doctype": si1.doctype, "reference_name": si1.name, "allocated_amount": 100},
)
pe.append(
"references",
{"reference_doctype": si2.doctype, "reference_name": si2.name, "allocated_amount": 100},
)
# Allocation payment against both invoices
pe.save().submit()
# Assert outstanding
[doc.reload() for doc in [si1, si2, pe]]
self.assertEqual(si1.outstanding_amount, 0)
self.assertEqual(si2.outstanding_amount, 0)
self.assertEqual(pe.unallocated_amount, 0)
unreconcile = frappe.get_doc(
{
"doctype": "Unreconcile Payment",
"company": self.company,
"voucher_type": pe.doctype,
"voucher_no": pe.name,
}
)
unreconcile.add_references()
self.assertEqual(len(unreconcile.allocations), 2)
allocations = [x.reference_name for x in unreconcile.allocations]
self.assertEquals([si1.name, si2.name], allocations)
# unreconcile si1
for x in unreconcile.allocations:
if x.reference_name != si1.name:
unreconcile.remove(x)
unreconcile.save().submit()
# Assert outstanding
[doc.reload() for doc in [si1, si2, pe]]
self.assertEqual(si1.outstanding_amount, 100)
self.assertEqual(si2.outstanding_amount, 0)
self.assertEqual(len(pe.references), 1)
self.assertEqual(pe.unallocated_amount, 100)
def test_02_unreconcile_one_payment_from_multi_payments(self):
"""
Scenario: 2 payments, both split against 2 different invoices
Unreconcile only one payment from one invoice
"""
si1 = self.create_sales_invoice()
si2 = self.create_sales_invoice()
pe1 = self.create_payment_entry()
pe1.paid_amount = 100
# Allocate payment against both invoices
pe1.append(
"references",
{"reference_doctype": si1.doctype, "reference_name": si1.name, "allocated_amount": 50},
)
pe1.append(
"references",
{"reference_doctype": si2.doctype, "reference_name": si2.name, "allocated_amount": 50},
)
pe1.save().submit()
pe2 = self.create_payment_entry()
pe2.paid_amount = 100
# Allocate payment against both invoices
pe2.append(
"references",
{"reference_doctype": si1.doctype, "reference_name": si1.name, "allocated_amount": 50},
)
pe2.append(
"references",
{"reference_doctype": si2.doctype, "reference_name": si2.name, "allocated_amount": 50},
)
pe2.save().submit()
# Assert outstanding and unallocated
[doc.reload() for doc in [si1, si2, pe1, pe2]]
self.assertEqual(si1.outstanding_amount, 0.0)
self.assertEqual(si2.outstanding_amount, 0.0)
self.assertEqual(pe1.unallocated_amount, 0.0)
self.assertEqual(pe2.unallocated_amount, 0.0)
unreconcile = frappe.get_doc(
{
"doctype": "Unreconcile Payment",
"company": self.company,
"voucher_type": pe2.doctype,
"voucher_no": pe2.name,
}
)
unreconcile.add_references()
self.assertEqual(len(unreconcile.allocations), 2)
allocations = [x.reference_name for x in unreconcile.allocations]
self.assertEquals([si1.name, si2.name], allocations)
# unreconcile si1 from pe2
for x in unreconcile.allocations:
if x.reference_name != si1.name:
unreconcile.remove(x)
unreconcile.save().submit()
# Assert outstanding and unallocated
[doc.reload() for doc in [si1, si2, pe1, pe2]]
self.assertEqual(si1.outstanding_amount, 50)
self.assertEqual(si2.outstanding_amount, 0)
self.assertEqual(len(pe1.references), 2)
self.assertEqual(len(pe2.references), 1)
self.assertEqual(pe1.unallocated_amount, 0)
self.assertEqual(pe2.unallocated_amount, 50)
def test_03_unreconciliation_on_multi_currency_invoice(self):
self.create_customer("_Test MC Customer USD", "USD")
si1 = self.create_sales_invoice(do_not_submit=True)
si1.currency = "USD"
si1.debit_to = self.debtors_usd
si1.conversion_rate = 80
si1.save().submit()
si2 = self.create_sales_invoice(do_not_submit=True)
si2.currency = "USD"
si2.debit_to = self.debtors_usd
si2.conversion_rate = 80
si2.save().submit()
pe = self.create_payment_entry()
pe.paid_from = self.debtors_usd
pe.paid_from_account_currency = "USD"
pe.source_exchange_rate = 75
pe.received_amount = 75 * 200
pe.save()
# Allocate payment against both invoices
pe.append(
"references",
{"reference_doctype": si1.doctype, "reference_name": si1.name, "allocated_amount": 100},
)
pe.append(
"references",
{"reference_doctype": si2.doctype, "reference_name": si2.name, "allocated_amount": 100},
)
pe.save().submit()
unreconcile = frappe.get_doc(
{
"doctype": "Unreconcile Payment",
"company": self.company,
"voucher_type": pe.doctype,
"voucher_no": pe.name,
}
)
unreconcile.add_references()
self.assertEqual(len(unreconcile.allocations), 2)
allocations = [x.reference_name for x in unreconcile.allocations]
self.assertEquals([si1.name, si2.name], allocations)
# unreconcile si1 from pe
for x in unreconcile.allocations:
if x.reference_name != si1.name:
unreconcile.remove(x)
unreconcile.save().submit()
# Assert outstanding and unallocated
[doc.reload() for doc in [si1, si2, pe]]
self.assertEqual(si1.outstanding_amount, 100)
self.assertEqual(si2.outstanding_amount, 0)
self.assertEqual(len(pe.references), 1)
self.assertEqual(pe.unallocated_amount, 100)
# Exc gain/loss JE should've been cancelled as well
self.assertEqual(
frappe.db.count(
"Journal Entry Account",
filters={"reference_type": si1.doctype, "reference_name": si1.name, "docstatus": 1},
),
0,
)
def test_04_unreconciliation_on_multi_currency_invoice(self):
"""
2 payments split against 2 foreign currency invoices
"""
self.create_customer("_Test MC Customer USD", "USD")
si1 = self.create_sales_invoice(do_not_submit=True)
si1.currency = "USD"
si1.debit_to = self.debtors_usd
si1.conversion_rate = 80
si1.save().submit()
si2 = self.create_sales_invoice(do_not_submit=True)
si2.currency = "USD"
si2.debit_to = self.debtors_usd
si2.conversion_rate = 80
si2.save().submit()
pe1 = self.create_payment_entry()
pe1.paid_from = self.debtors_usd
pe1.paid_from_account_currency = "USD"
pe1.source_exchange_rate = 75
pe1.received_amount = 75 * 100
pe1.save()
# Allocate payment against both invoices
pe1.append(
"references",
{"reference_doctype": si1.doctype, "reference_name": si1.name, "allocated_amount": 50},
)
pe1.append(
"references",
{"reference_doctype": si2.doctype, "reference_name": si2.name, "allocated_amount": 50},
)
pe1.save().submit()
pe2 = self.create_payment_entry()
pe2.paid_from = self.debtors_usd
pe2.paid_from_account_currency = "USD"
pe2.source_exchange_rate = 75
pe2.received_amount = 75 * 100
pe2.save()
# Allocate payment against both invoices
pe2.append(
"references",
{"reference_doctype": si1.doctype, "reference_name": si1.name, "allocated_amount": 50},
)
pe2.append(
"references",
{"reference_doctype": si2.doctype, "reference_name": si2.name, "allocated_amount": 50},
)
pe2.save().submit()
unreconcile = frappe.get_doc(
{
"doctype": "Unreconcile Payment",
"company": self.company,
"voucher_type": pe2.doctype,
"voucher_no": pe2.name,
}
)
unreconcile.add_references()
self.assertEqual(len(unreconcile.allocations), 2)
allocations = [x.reference_name for x in unreconcile.allocations]
self.assertEquals([si1.name, si2.name], allocations)
# unreconcile si1 from pe2
for x in unreconcile.allocations:
if x.reference_name != si1.name:
unreconcile.remove(x)
unreconcile.save().submit()
# Assert outstanding and unallocated
[doc.reload() for doc in [si1, si2, pe1, pe2]]
self.assertEqual(si1.outstanding_amount, 50)
self.assertEqual(si2.outstanding_amount, 0)
self.assertEqual(len(pe1.references), 2)
self.assertEqual(len(pe2.references), 1)
self.assertEqual(pe1.unallocated_amount, 0)
self.assertEqual(pe2.unallocated_amount, 50)
# Exc gain/loss JE from PE1 should be available
self.assertEqual(
frappe.db.count(
"Journal Entry Account",
filters={"reference_type": si1.doctype, "reference_name": si1.name, "docstatus": 1},
),
1,
)

View File

@@ -0,0 +1,41 @@
// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on("Unreconcile Payment", {
refresh(frm) {
frm.set_query("voucher_type", function() {
return {
filters: {
name: ["in", ["Payment Entry", "Journal Entry"]]
}
}
});
frm.set_query("voucher_no", function(doc) {
return {
filters: {
company: doc.company,
docstatus: 1
}
}
});
},
get_allocations: function(frm) {
frm.clear_table("allocations");
frappe.call({
method: "get_allocations_from_payment",
doc: frm.doc,
callback: function(r) {
if (r.message) {
r.message.forEach(x => {
frm.add_child("allocations", x)
})
frm.refresh_fields();
}
}
})
}
});

View File

@@ -0,0 +1,93 @@
{
"actions": [],
"allow_rename": 1,
"autoname": "format:UNREC-{#####}",
"creation": "2023-08-22 10:26:34.421423",
"default_view": "List",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"company",
"voucher_type",
"voucher_no",
"get_allocations",
"allocations",
"amended_from"
],
"fields": [
{
"fieldname": "amended_from",
"fieldtype": "Link",
"label": "Amended From",
"no_copy": 1,
"options": "Unreconcile Payment",
"print_hide": 1,
"read_only": 1
},
{
"fieldname": "company",
"fieldtype": "Link",
"label": "Company",
"options": "Company"
},
{
"fieldname": "voucher_type",
"fieldtype": "Link",
"label": "Voucher Type",
"options": "DocType"
},
{
"fieldname": "voucher_no",
"fieldtype": "Dynamic Link",
"label": "Voucher No",
"options": "voucher_type"
},
{
"fieldname": "get_allocations",
"fieldtype": "Button",
"label": "Get Allocations"
},
{
"fieldname": "allocations",
"fieldtype": "Table",
"label": "Allocations",
"options": "Unreconcile Payment Entries"
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2023-08-28 17:42:50.261377",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Unreconcile Payment",
"naming_rule": "Expression",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"read": 1,
"role": "Accounts Manager",
"select": 1,
"share": 1,
"submit": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"read": 1,
"role": "Accounts User",
"select": 1,
"share": 1,
"submit": 1,
"write": 1
}
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -0,0 +1,158 @@
# 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.query_builder import Criterion
from frappe.query_builder.functions import Abs, Sum
from frappe.utils.data import comma_and
from erpnext.accounts.utils import (
cancel_exchange_gain_loss_journal,
unlink_ref_doc_from_payment_entries,
update_voucher_outstanding,
)
class UnreconcilePayment(Document):
def validate(self):
self.supported_types = ["Payment Entry", "Journal Entry"]
if not self.voucher_type in self.supported_types:
frappe.throw(_("Only {0} are supported").format(comma_and(self.supported_types)))
@frappe.whitelist()
def get_allocations_from_payment(self):
allocated_references = []
ple = qb.DocType("Payment Ledger Entry")
allocated_references = (
qb.from_(ple)
.select(
ple.account,
ple.party_type,
ple.party,
ple.against_voucher_type.as_("reference_doctype"),
ple.against_voucher_no.as_("reference_name"),
Abs(Sum(ple.amount_in_account_currency)).as_("allocated_amount"),
ple.account_currency,
)
.where(
(ple.docstatus == 1)
& (ple.voucher_type == self.voucher_type)
& (ple.voucher_no == self.voucher_no)
& (ple.voucher_no != ple.against_voucher_no)
)
.groupby(ple.against_voucher_type, ple.against_voucher_no)
.run(as_dict=True)
)
return allocated_references
def add_references(self):
allocations = self.get_allocations_from_payment()
for alloc in allocations:
self.append("allocations", alloc)
def on_submit(self):
# todo: more granular unreconciliation
for alloc in self.allocations:
doc = frappe.get_doc(alloc.reference_doctype, alloc.reference_name)
unlink_ref_doc_from_payment_entries(doc, self.voucher_no)
cancel_exchange_gain_loss_journal(doc, self.voucher_type, self.voucher_no)
update_voucher_outstanding(
alloc.reference_doctype, alloc.reference_name, alloc.account, alloc.party_type, alloc.party
)
frappe.db.set_value("Unreconcile Payment Entries", alloc.name, "unlinked", True)
@frappe.whitelist()
def doc_has_references(doctype: str = None, docname: str = None):
if doctype in ["Sales Invoice", "Purchase Invoice"]:
return frappe.db.count(
"Payment Ledger Entry",
filters={"delinked": 0, "against_voucher_no": docname, "amount": ["<", 0]},
)
else:
return frappe.db.count(
"Payment Ledger Entry",
filters={"delinked": 0, "voucher_no": docname, "against_voucher_no": ["!=", docname]},
)
@frappe.whitelist()
def get_linked_payments_for_doc(
company: str = None, doctype: str = None, docname: str = None
) -> list:
if company and doctype and docname:
_dt = doctype
_dn = docname
ple = qb.DocType("Payment Ledger Entry")
if _dt in ["Sales Invoice", "Purchase Invoice"]:
criteria = [
(ple.company == company),
(ple.delinked == 0),
(ple.against_voucher_no == _dn),
(ple.amount < 0),
]
res = (
qb.from_(ple)
.select(
ple.company,
ple.voucher_type,
ple.voucher_no,
Abs(Sum(ple.amount_in_account_currency)).as_("allocated_amount"),
ple.account_currency,
)
.where(Criterion.all(criteria))
.groupby(ple.voucher_no, ple.against_voucher_no)
.having(qb.Field("allocated_amount") > 0)
.run(as_dict=True)
)
return res
else:
criteria = [
(ple.company == company),
(ple.delinked == 0),
(ple.voucher_no == _dn),
(ple.against_voucher_no != _dn),
]
query = (
qb.from_(ple)
.select(
ple.company,
ple.against_voucher_type.as_("voucher_type"),
ple.against_voucher_no.as_("voucher_no"),
Abs(Sum(ple.amount_in_account_currency)).as_("allocated_amount"),
ple.account_currency,
)
.where(Criterion.all(criteria))
.groupby(ple.against_voucher_no)
)
res = query.run(as_dict=True)
return res
return []
@frappe.whitelist()
def create_unreconcile_doc_for_selection(selections=None):
if selections:
selections = frappe.json.loads(selections)
# assuming each row is a unique voucher
for row in selections:
unrecon = frappe.new_doc("Unreconcile Payment")
unrecon.company = row.get("company")
unrecon.voucher_type = row.get("voucher_type")
unrecon.voucher_no = row.get("voucher_no")
unrecon.add_references()
# remove unselected references
unrecon.allocations = [
x
for x in unrecon.allocations
if x.reference_doctype == row.get("against_voucher_type")
and x.reference_name == row.get("against_voucher_no")
]
unrecon.save().submit()

View File

@@ -0,0 +1,83 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2023-08-22 10:28:10.196712",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"account",
"party_type",
"party",
"reference_doctype",
"reference_name",
"allocated_amount",
"account_currency",
"unlinked"
],
"fields": [
{
"fieldname": "reference_name",
"fieldtype": "Dynamic Link",
"in_list_view": 1,
"label": "Reference Name",
"options": "reference_doctype"
},
{
"fieldname": "allocated_amount",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Allocated Amount",
"options": "account_currency"
},
{
"default": "0",
"fieldname": "unlinked",
"fieldtype": "Check",
"in_list_view": 1,
"label": "Unlinked",
"read_only": 1
},
{
"fieldname": "reference_doctype",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Reference Type",
"options": "DocType"
},
{
"fieldname": "account",
"fieldtype": "Data",
"label": "Account"
},
{
"fieldname": "party_type",
"fieldtype": "Data",
"label": "Party Type"
},
{
"fieldname": "party",
"fieldtype": "Data",
"label": "Party"
},
{
"fieldname": "account_currency",
"fieldtype": "Link",
"label": "Account Currency",
"options": "Currency",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2023-09-05 09:33:28.620149",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Unreconcile Payment Entries",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}

View File

@@ -0,0 +1,9 @@
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class UnreconcilePaymentEntries(Document):
pass

View File

@@ -41,7 +41,7 @@ def make_gl_entries(
from_repost=from_repost,
)
save_entries(gl_map, adv_adj, update_outstanding, from_repost)
# Post GL Map proccess there may no be any GL Entries
# Post GL Map process there may no be any GL Entries
elif gl_map:
frappe.throw(
_(
@@ -556,7 +556,12 @@ def get_round_off_account_and_cost_center(
def make_reverse_gl_entries(
gl_entries=None, voucher_type=None, voucher_no=None, adv_adj=False, update_outstanding="Yes"
gl_entries=None,
voucher_type=None,
voucher_no=None,
adv_adj=False,
update_outstanding="Yes",
partial_cancel=False,
):
"""
Get original gl entries of the voucher
@@ -576,14 +581,19 @@ def make_reverse_gl_entries(
if gl_entries:
create_payment_ledger_entry(
gl_entries, cancel=1, adv_adj=adv_adj, update_outstanding=update_outstanding
gl_entries,
cancel=1,
adv_adj=adv_adj,
update_outstanding=update_outstanding,
partial_cancel=partial_cancel,
)
validate_accounting_period(gl_entries)
check_freezing_date(gl_entries[0]["posting_date"], adv_adj)
is_opening = any(d.get("is_opening") == "Yes" for d in gl_entries)
validate_against_pcv(is_opening, gl_entries[0]["posting_date"], gl_entries[0]["company"])
set_as_cancel(gl_entries[0]["voucher_type"], gl_entries[0]["voucher_no"])
if not partial_cancel:
set_as_cancel(gl_entries[0]["voucher_type"], gl_entries[0]["voucher_no"])
for entry in gl_entries:
new_gle = copy.deepcopy(entry)

View File

@@ -5,13 +5,8 @@
from typing import Optional
import frappe
from frappe import _, msgprint, scrub
from frappe.contacts.doctype.address.address import (
get_address_display,
get_company_address,
get_default_address,
)
from frappe.contacts.doctype.contact.contact import get_contact_details
from frappe import _, msgprint, qb, scrub
from frappe.contacts.doctype.address.address import get_company_address, get_default_address
from frappe.core.doctype.user_permission.user_permission import get_permitted_documents
from frappe.model.utils import get_fetch_values
from frappe.query_builder.functions import Abs, Date, Sum
@@ -36,7 +31,12 @@ from erpnext.accounts.utils import get_fiscal_year
from erpnext.exceptions import InvalidAccountCurrency, PartyDisabled, PartyFrozen
from erpnext.utilities.regional import temporary_flag
PURCHASE_TRANSACTION_TYPES = {"Purchase Order", "Purchase Receipt", "Purchase Invoice"}
PURCHASE_TRANSACTION_TYPES = {
"Supplier Quotation",
"Purchase Order",
"Purchase Receipt",
"Purchase Invoice",
}
SALES_TRANSACTION_TYPES = {
"Quotation",
"Sales Order",
@@ -133,6 +133,7 @@ def _get_party_details(
party_address,
company_address,
shipping_address,
ignore_permissions=ignore_permissions,
)
set_contact_details(party_details, party, party_type)
set_other_values(party_details, party, party_type)
@@ -193,6 +194,8 @@ def set_address_details(
party_address=None,
company_address=None,
shipping_address=None,
*,
ignore_permissions=False,
):
billing_address_field = (
"customer_address" if party_type == "Lead" else party_type.lower() + "_address"
@@ -205,13 +208,17 @@ def set_address_details(
get_fetch_values(doctype, billing_address_field, party_details[billing_address_field])
)
# address display
party_details.address_display = get_address_display(party_details[billing_address_field])
party_details.address_display = render_address(
party_details[billing_address_field], check_permissions=not ignore_permissions
)
# shipping address
if party_type in ["Customer", "Lead"]:
party_details.shipping_address_name = shipping_address or get_party_shipping_address(
party_type, party.name
)
party_details.shipping_address = get_address_display(party_details["shipping_address_name"])
party_details.shipping_address = render_address(
party_details["shipping_address_name"], check_permissions=not ignore_permissions
)
if doctype:
party_details.update(
get_fetch_values(doctype, "shipping_address_name", party_details.shipping_address_name)
@@ -229,8 +236,10 @@ def set_address_details(
if shipping_address:
party_details.update(
shipping_address=shipping_address,
shipping_address_display=get_address_display(shipping_address),
**get_fetch_values(doctype, "shipping_address", shipping_address)
shipping_address_display=render_address(
shipping_address, check_permissions=not ignore_permissions
),
**get_fetch_values(doctype, "shipping_address", shipping_address),
)
if party_details.company_address:
@@ -238,9 +247,10 @@ def set_address_details(
party_details.update(
billing_address=party_details.company_address,
billing_address_display=(
party_details.company_address_display or get_address_display(party_details.company_address)
party_details.company_address_display
or render_address(party_details.company_address, check_permissions=False)
),
**get_fetch_values(doctype, "billing_address", party_details.company_address)
**get_fetch_values(doctype, "billing_address", party_details.company_address),
)
# shipping address - if not already set
@@ -248,7 +258,7 @@ def set_address_details(
party_details.update(
shipping_address=party_details.billing_address,
shipping_address_display=party_details.billing_address_display,
**get_fetch_values(doctype, "shipping_address", party_details.billing_address)
**get_fetch_values(doctype, "shipping_address", party_details.billing_address),
)
party_address, shipping_address = (
@@ -290,7 +300,34 @@ def set_contact_details(party_details, party, party_type):
}
)
else:
party_details.update(get_contact_details(party_details.contact_person))
fields = [
"name as contact_person",
"salutation",
"first_name",
"last_name",
"email_id as contact_email",
"mobile_no as contact_mobile",
"phone as contact_phone",
"designation as contact_designation",
"department as contact_department",
]
contact_details = frappe.db.get_value(
"Contact", party_details.contact_person, fields, as_dict=True
)
contact_details.contact_display = " ".join(
filter(
None,
[
contact_details.get("salutation"),
contact_details.get("first_name"),
contact_details.get("last_name"),
],
)
)
party_details.update(contact_details)
def set_other_values(party_details, party, party_type):
@@ -429,11 +466,19 @@ def get_party_account_currency(party_type, party, company):
def get_party_gle_currency(party_type, party, company):
def generator():
existing_gle_currency = frappe.db.sql(
"""select account_currency from `tabGL Entry`
where docstatus=1 and company=%(company)s and party_type=%(party_type)s and party=%(party)s
limit 1""",
{"company": company, "party_type": party_type, "party": party},
gl = qb.DocType("GL Entry")
existing_gle_currency = (
qb.from_(gl)
.select(gl.account_currency)
.where(
(gl.docstatus == 1)
& (gl.company == company)
& (gl.party_type == party_type)
& (gl.party == party)
& (gl.is_cancelled == 0)
)
.limit(1)
.run()
)
return existing_gle_currency[0][0] if existing_gle_currency else None
@@ -911,6 +956,9 @@ def get_partywise_advanced_payment_amount(
if party:
query = query.where(ple.party == party)
if invoice_doctypes := frappe.get_hooks("invoice_doctypes"):
query = query.where(ple.voucher_type.notin(invoice_doctypes))
data = query.run()
if data:
return frappe._dict(data)
@@ -957,3 +1005,13 @@ def add_party_account(party_type, party, company, account):
doc.append("accounts", accounts)
doc.save()
def render_address(address, check_permissions=True):
try:
from frappe.contacts.doctype.address.address import render_address as _render
except ImportError:
# Older frappe versions where this function is not available
from frappe.contacts.doctype.address.address import get_address_display as _render
return frappe.call(_render, address, check_permissions=check_permissions)

View File

@@ -143,7 +143,23 @@ frappe.query_reports["Accounts Payable"] = {
"fieldname": "show_future_payments",
"label": __("Show Future Payments"),
"fieldtype": "Check",
}
},
{
"fieldname": "for_revaluation_journals",
"label": __("Revaluation Journals"),
"fieldtype": "Check",
},
{
"fieldname": "in_party_currency",
"label": __("In Party Currency"),
"fieldtype": "Check",
},
{
"fieldname": "ignore_accounts",
"label": __("Group by Voucher"),
"fieldtype": "Check",
},
],
"formatter": function(value, row, column, data, default_formatter) {
@@ -175,4 +191,4 @@ function get_party_type_options() {
});
});
return options;
}
}

View File

@@ -40,6 +40,7 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase):
"range2": 60,
"range3": 90,
"range4": 120,
"in_party_currency": 1,
}
data = execute(filters)

View File

@@ -110,6 +110,11 @@ frappe.query_reports["Accounts Payable Summary"] = {
"fieldname":"based_on_payment_terms",
"label": __("Based On Payment Terms"),
"fieldtype": "Check",
},
{
"fieldname": "for_revaluation_journals",
"label": __("Revaluation Journals"),
"fieldtype": "Check",
}
],

View File

@@ -114,10 +114,13 @@ frappe.query_reports["Accounts Receivable"] = {
"reqd": 1
},
{
"fieldname": "customer_group",
"fieldname":"customer_group",
"label": __("Customer Group"),
"fieldtype": "Link",
"options": "Customer Group"
"fieldtype": "MultiSelectList",
"options": "Customer Group",
get_data: function(txt) {
return frappe.db.get_link_options('Customer Group', txt);
}
},
{
"fieldname": "payment_terms_template",
@@ -172,7 +175,23 @@ frappe.query_reports["Accounts Receivable"] = {
"fieldname": "show_remarks",
"label": __("Show Remarks"),
"fieldtype": "Check",
},
{
"fieldname": "for_revaluation_journals",
"label": __("Revaluation Journals"),
"fieldtype": "Check",
},
{
"fieldname": "in_party_currency",
"label": __("In Party Currency"),
"fieldtype": "Check",
},
{
"fieldname": "ignore_accounts",
"label": __("Group by Voucher"),
"fieldtype": "Check",
}
],
"formatter": function(value, row, column, data, default_formatter) {
@@ -205,4 +224,4 @@ function get_party_type_options() {
});
});
return options;
}
}

View File

@@ -7,7 +7,7 @@ from collections import OrderedDict
import frappe
from frappe import _, qb, scrub
from frappe.query_builder import Criterion
from frappe.query_builder.functions import Date, Sum
from frappe.query_builder.functions import Date, Substring, Sum
from frappe.utils import cint, cstr, flt, getdate, nowdate
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
@@ -28,8 +28,8 @@ from erpnext.accounts.utils import get_currency_precision
# 6. Configurable Ageing Groups (0-30, 30-60 etc) can be set via filters
# 7. For overpayment against an invoice with payment terms, there will be an additional row
# 8. Invoice details like Sales Persons, Delivery Notes are also fetched comma separated
# 9. Report amounts are in "Party Currency" if party is selected, or company currency for multi-party
# 10. This reports is based on all GL Entries that are made against account_type "Receivable" or "Payable"
# 9. Report amounts are in party currency if in_party_currency is selected, otherwise company currency
# 10. This report is based on Payment Ledger Entries
def execute(filters=None):
@@ -84,6 +84,9 @@ class ReceivablePayableReport(object):
self.total_row_map = {}
self.skip_total_row = 1
if self.filters.get("in_party_currency"):
self.skip_total_row = 1
def get_data(self):
self.get_ple_entries()
self.get_sales_invoices_or_customers_based_on_sales_person()
@@ -116,7 +119,12 @@ class ReceivablePayableReport(object):
# build all keys, since we want to exclude vouchers beyond the report date
for ple in self.ple_entries:
# get the balance object for voucher_type
key = (ple.voucher_type, ple.voucher_no, ple.party)
if self.filters.get("ignore_accounts"):
key = (ple.voucher_type, ple.voucher_no, ple.party)
else:
key = (ple.account, ple.voucher_type, ple.voucher_no, ple.party)
if not key in self.voucher_balance:
self.voucher_balance[key] = frappe._dict(
voucher_type=ple.voucher_type,
@@ -140,7 +148,7 @@ class ReceivablePayableReport(object):
if self.filters.get("group_by_party"):
self.init_subtotal_row(ple.party)
if self.filters.get("group_by_party"):
if self.filters.get("group_by_party") and not self.filters.get("in_party_currency"):
self.init_subtotal_row("Total")
def get_invoices(self, ple):
@@ -183,7 +191,10 @@ class ReceivablePayableReport(object):
):
return
key = (ple.against_voucher_type, ple.against_voucher_no, ple.party)
if self.filters.get("ignore_accounts"):
key = (ple.against_voucher_type, ple.against_voucher_no, ple.party)
else:
key = (ple.account, ple.against_voucher_type, ple.against_voucher_no, ple.party)
# If payment is made against credit note
# and credit note is made against a Sales Invoice
@@ -192,13 +203,19 @@ class ReceivablePayableReport(object):
if ple.against_voucher_no in self.return_entries:
return_against = self.return_entries.get(ple.against_voucher_no)
if return_against:
key = (ple.against_voucher_type, return_against, ple.party)
if self.filters.get("ignore_accounts"):
key = (ple.against_voucher_type, return_against, ple.party)
else:
key = (ple.account, ple.against_voucher_type, return_against, ple.party)
row = self.voucher_balance.get(key)
if not row:
# no invoice, this is an invoice / stand-alone payment / credit note
row = self.voucher_balance.get((ple.voucher_type, ple.voucher_no, ple.party))
if self.filters.get("ignore_accounts"):
row = self.voucher_balance.get((ple.voucher_type, ple.voucher_no, ple.party))
else:
row = self.voucher_balance.get((ple.account, ple.voucher_type, ple.voucher_no, ple.party))
row.party_type = ple.party_type
return row
@@ -210,8 +227,7 @@ class ReceivablePayableReport(object):
if not row:
return
# amount in "Party Currency", if its supplied. If not, amount in company currency
if self.filters.get("party_type") and self.filters.get("party"):
if self.filters.get("in_party_currency") or self.filters.get("party_account"):
amount = ple.amount_in_account_currency
else:
amount = ple.amount
@@ -230,8 +246,12 @@ class ReceivablePayableReport(object):
row.invoiced_in_account_currency += amount_in_account_currency
else:
if self.is_invoice(ple):
row.credit_note -= amount
row.credit_note_in_account_currency -= amount_in_account_currency
if row.voucher_no == ple.voucher_no == ple.against_voucher_no:
row.paid -= amount
row.paid_in_account_currency -= amount_in_account_currency
else:
row.credit_note -= amount
row.credit_note_in_account_currency -= amount_in_account_currency
else:
row.paid -= amount
row.paid_in_account_currency -= amount_in_account_currency
@@ -242,8 +262,10 @@ class ReceivablePayableReport(object):
def update_sub_total_row(self, row, party):
total_row = self.total_row_map.get(party)
for field in self.get_currency_fields():
total_row[field] += row.get(field, 0.0)
if total_row:
for field in self.get_currency_fields():
total_row[field] += row.get(field, 0.0)
total_row["currency"] = row.get("currency", "")
def append_subtotal_row(self, party):
sub_total_row = self.total_row_map.get(party)
@@ -267,11 +289,20 @@ class ReceivablePayableReport(object):
row.invoice_grand_total = row.invoiced
if (abs(row.outstanding) > 1.0 / 10**self.currency_precision) and (
(abs(row.outstanding_in_account_currency) > 1.0 / 10**self.currency_precision)
or (row.voucher_no in self.err_journals)
):
must_consider = False
if self.filters.get("for_revaluation_journals"):
if (abs(row.outstanding) > 0.0 / 10**self.currency_precision) or (
(abs(row.outstanding_in_account_currency) > 0.0 / 10**self.currency_precision)
):
must_consider = True
else:
if (abs(row.outstanding) > 1.0 / 10**self.currency_precision) and (
(abs(row.outstanding_in_account_currency) > 1.0 / 10**self.currency_precision)
or (row.voucher_no in self.err_journals)
):
must_consider = True
if must_consider:
# non-zero oustanding, we must consider this row
if self.is_invoice(row) and self.filters.based_on_payment_terms:
@@ -295,7 +326,7 @@ class ReceivablePayableReport(object):
if self.filters.get("group_by_party"):
self.append_subtotal_row(self.previous_party)
if self.data:
self.data.append(self.total_row_map.get("Total"))
self.data.append(self.total_row_map.get("Total", {}))
def append_row(self, row):
self.allocate_future_payments(row)
@@ -426,7 +457,7 @@ class ReceivablePayableReport(object):
party_details = self.get_party_details(row.party) or {}
row.update(party_details)
if self.filters.get("party_type") and self.filters.get("party"):
if self.filters.get("in_party_currency") or self.filters.get("party_account"):
row.currency = row.account_currency
else:
row.currency = self.company_currency
@@ -718,6 +749,7 @@ class ReceivablePayableReport(object):
query = (
qb.from_(ple)
.select(
ple.name,
ple.account,
ple.voucher_type,
ple.voucher_no,
@@ -731,13 +763,20 @@ class ReceivablePayableReport(object):
ple.account_currency,
ple.amount,
ple.amount_in_account_currency,
ple.remarks,
)
.where(ple.delinked == 0)
.where(Criterion.all(self.qb_selection_filter))
.where(Criterion.any(self.or_filters))
)
if self.filters.get("show_remarks"):
if remarks_length := frappe.db.get_single_value(
"Accounts Settings", "receivable_payable_remarks_length"
):
query = query.select(Substring(ple.remarks, 1, remarks_length).as_("remarks"))
else:
query = query.select(ple.remarks)
if self.filters.get("group_by_party"):
query = query.orderby(self.ple.party, self.ple.posting_date)
else:
@@ -823,7 +862,13 @@ class ReceivablePayableReport(object):
self.customer = qb.DocType("Customer")
if self.filters.get("customer_group"):
self.get_hierarchical_filters("Customer Group", "customer_group")
groups = get_customer_group_with_children(self.filters.customer_group)
customers = (
qb.from_(self.customer)
.select(self.customer.name)
.where(self.customer["customer_group"].isin(groups))
)
self.qb_selection_filter.append(self.ple.party.isin(customers))
if self.filters.get("territory"):
self.get_hierarchical_filters("Territory", "territory")
@@ -1048,7 +1093,7 @@ class ReceivablePayableReport(object):
)
if self.filters.show_remarks:
self.add_column(label=_("Remarks"), fieldname="remarks", fieldtype="Text", width=200),
self.add_column(label=_("Remarks"), fieldname="remarks", fieldtype="Text", width=200)
def add_column(self, label, fieldname=None, fieldtype="Currency", options=None, width=120):
if not fieldname:
@@ -1115,3 +1160,19 @@ class ReceivablePayableReport(object):
.run()
)
self.err_journals = [x[0] for x in results] if results else []
def get_customer_group_with_children(customer_groups):
if not isinstance(customer_groups, list):
customer_groups = [d.strip() for d in customer_groups.strip().split(",") if d]
all_customer_groups = []
for d in customer_groups:
if frappe.db.exists("Customer Group", d):
lft, rgt = frappe.db.get_value("Customer Group", d, ["lft", "rgt"])
children = frappe.get_all("Customer Group", filters={"lft": [">=", lft], "rgt": ["<=", rgt]})
all_customer_groups += [c.name for c in children]
else:
frappe.throw(_("Customer Group: {0} does not exist").format(d))
return list(set(all_customer_groups))

View File

@@ -1,6 +1,7 @@
import unittest
import frappe
from frappe import qb
from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import add_days, flt, getdate, today
@@ -23,29 +24,6 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase):
def tearDown(self):
frappe.db.rollback()
def create_usd_account(self):
name = "Debtors USD"
exists = frappe.db.get_list(
"Account", filters={"company": "_Test Company 2", "account_name": "Debtors USD"}
)
if exists:
self.debtors_usd = exists[0].name
else:
debtors = frappe.get_doc(
"Account",
frappe.db.get_list(
"Account", filters={"company": "_Test Company 2", "account_name": "Debtors"}
)[0].name,
)
debtors_usd = frappe.new_doc("Account")
debtors_usd.company = debtors.company
debtors_usd.account_name = "Debtors USD"
debtors_usd.account_currency = "USD"
debtors_usd.parent_account = debtors.parent_account
debtors_usd.account_type = debtors.account_type
self.debtors_usd = debtors_usd.save().name
def create_sales_invoice(self, no_payment_schedule=False, do_not_submit=False):
frappe.set_user("Administrator")
si = create_sales_invoice(
@@ -98,6 +76,41 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase):
return credit_note
def test_pos_receivable(self):
filters = {
"company": self.company,
"party_type": "Customer",
"party": [self.customer],
"report_date": add_days(today(), 2),
"based_on_payment_terms": 0,
"range1": 30,
"range2": 60,
"range3": 90,
"range4": 120,
"show_remarks": False,
}
pos_inv = self.create_sales_invoice(no_payment_schedule=True, do_not_submit=True)
pos_inv.posting_date = add_days(today(), 2)
pos_inv.is_pos = 1
pos_inv.append(
"payments",
frappe._dict(
mode_of_payment="Cash",
amount=flt(pos_inv.grand_total / 2),
),
)
pos_inv.disable_rounded_total = 1
pos_inv.save()
pos_inv.submit()
report = execute(filters)
expected_data = [[pos_inv.grand_total, pos_inv.paid_amount, 0]]
row = report[1][-1]
self.assertEqual(expected_data[0], [row.invoiced, row.paid, row.credit_note])
pos_inv.cancel()
def test_accounts_receivable(self):
filters = {
"company": self.company,
@@ -497,6 +510,30 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase):
report = execute(filters)[1]
self.assertEqual(len(report), 0)
def test_multi_customer_group_filter(self):
si = self.create_sales_invoice()
cus_group = frappe.db.get_value("Customer", self.customer, "customer_group")
# Create a list of customer groups, e.g., ["Group1", "Group2"]
cus_groups_list = [cus_group, "_Test Customer Group 1"]
filters = {
"company": self.company,
"report_date": today(),
"range1": 30,
"range2": 60,
"range3": 90,
"range4": 120,
"customer_group": cus_groups_list, # Use the list of customer groups
}
report = execute(filters)[1]
# Assert that the report contains data for the specified customer groups
self.assertTrue(len(report) > 0)
for row in report:
# Assert that the customer group of each row is in the list of customer groups
self.assertIn(row.customer_group, cus_groups_list)
def test_party_account_filter(self):
si1 = self.create_sales_invoice()
self.customer2 = (
@@ -542,7 +579,7 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase):
filters.update({"party_account": self.debtors_usd})
report = execute(filters)[1]
self.assertEqual(len(report), 1)
expected_data = [8000.0, 8000.0, self.debtors_usd, si2.currency]
expected_data = [100.0, 100.0, self.debtors_usd, si2.currency]
row = report[0]
self.assertEqual(
expected_data, [row.invoiced, row.outstanding, row.party_account, row.account_currency]
@@ -579,6 +616,7 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase):
"range2": 60,
"range3": 90,
"range4": 120,
"in_party_currency": 1,
}
si = self.create_sales_invoice(no_payment_schedule=True, do_not_submit=True)
@@ -643,3 +681,94 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase):
self.assertEqual(len(report[1]), 2)
output_for = set([x.party for x in report[1]])
self.assertEqual(output_for, expected_output)
def test_report_output_if_party_is_missing(self):
acc_name = "Additional Debtors"
if not frappe.db.get_value(
"Account", filters={"account_name": acc_name, "company": self.company}
):
additional_receivable_acc = frappe.get_doc(
{
"doctype": "Account",
"account_name": acc_name,
"parent_account": "Accounts Receivable - " + self.company_abbr,
"company": self.company,
"account_type": "Receivable",
}
).save()
self.debtors2 = additional_receivable_acc.name
je = frappe.new_doc("Journal Entry")
je.company = self.company
je.posting_date = today()
je.append(
"accounts",
{
"account": self.debit_to,
"party_type": "Customer",
"party": self.customer,
"debit_in_account_currency": 150,
"credit_in_account_currency": 0,
"cost_center": self.cost_center,
},
)
je.append(
"accounts",
{
"account": self.debtors2,
"party_type": "Customer",
"party": self.customer,
"debit_in_account_currency": 200,
"credit_in_account_currency": 0,
"cost_center": self.cost_center,
},
)
je.append(
"accounts",
{
"account": self.cash,
"debit_in_account_currency": 0,
"credit_in_account_currency": 350,
"cost_center": self.cost_center,
},
)
je.save().submit()
# manually remove party from Payment Ledger
ple = qb.DocType("Payment Ledger Entry")
qb.update(ple).set(ple.party, None).where(ple.voucher_no == je.name).run()
filters = {
"company": self.company,
"report_date": today(),
"range1": 30,
"range2": 60,
"range3": 90,
"range4": 120,
}
report_ouput = execute(filters)[1]
expected_data = [
[self.debtors2, je.doctype, je.name, "Customer", self.customer, 200.0, 0.0, 0.0, 200.0],
[self.debit_to, je.doctype, je.name, "Customer", self.customer, 150.0, 0.0, 0.0, 150.0],
]
self.assertEqual(len(report_ouput), 2)
# fetch only required fields
report_output = [
[
x.party_account,
x.voucher_type,
x.voucher_no,
"Customer",
self.customer,
x.invoiced,
x.paid,
x.credit_note,
x.outstanding,
]
for x in report_ouput
]
# use account name to sort
# post sorting output should be [[Additional Debtors, ...], [Debtors, ...]]
report_output = sorted(report_output, key=lambda x: x[0])
self.assertEqual(expected_data, report_output)

View File

@@ -139,6 +139,11 @@ frappe.query_reports["Accounts Receivable Summary"] = {
"label": __("Show GL Balance"),
"fieldtype": "Check",
},
{
"fieldname": "for_revaluation_journals",
"label": __("Revaluation Journals"),
"fieldtype": "Check",
}
],
onload: function(report) {

View File

@@ -8,6 +8,7 @@ from frappe.utils import cint, flt
from erpnext.accounts.party import get_partywise_advanced_payment_amount
from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport
from erpnext.accounts.utils import get_currency_precision
def execute(filters=None):
@@ -35,6 +36,7 @@ class AccountsReceivableSummary(ReceivablePayableReport):
def get_data(self, args):
self.data = []
self.receivables = ReceivablePayableReport(self.filters).run(args)[1]
self.currency_precision = get_currency_precision() or 2
self.get_party_total(args)
@@ -58,7 +60,7 @@ class AccountsReceivableSummary(ReceivablePayableReport):
gl_balance_map = get_gl_balance(self.filters.report_date, self.filters.company)
for party, party_dict in self.party_total.items():
if party_dict.outstanding == 0:
if flt(party_dict.outstanding, self.currency_precision) == 0:
continue
row = frappe._dict()

View File

@@ -31,6 +31,18 @@ frappe.query_reports["Asset Depreciation Ledger"] = {
"fieldtype": "Link",
"options": "Asset"
},
{
"fieldname":"asset_category",
"label": __("Asset Category"),
"fieldtype": "Link",
"options": "Asset Category"
},
{
"fieldname":"cost_center",
"label": __("Cost Center"),
"fieldtype": "Link",
"options": "Cost Center"
},
{
"fieldname":"finance_book",
"label": __("Finance Book"),
@@ -38,10 +50,10 @@ frappe.query_reports["Asset Depreciation Ledger"] = {
"options": "Finance Book"
},
{
"fieldname":"asset_category",
"label": __("Asset Category"),
"fieldtype": "Link",
"options": "Asset Category"
}
"fieldname": "include_default_book_assets",
"label": __("Include Default FB Assets"),
"fieldtype": "Check",
"default": 1
},
]
}

View File

@@ -1,15 +1,15 @@
{
"add_total_row": 1,
"add_total_row": 0,
"columns": [],
"creation": "2016-04-08 14:49:58.133098",
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 2,
"idx": 6,
"is_standard": "Yes",
"letterhead": null,
"modified": "2023-07-26 21:05:33.554778",
"modified": "2023-11-08 20:17:05.774211",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Asset Depreciation Ledger",

View File

@@ -4,7 +4,7 @@
import frappe
from frappe import _
from frappe.utils import flt
from frappe.utils import cstr, flt
def execute(filters=None):
@@ -32,7 +32,6 @@ def get_data(filters):
filters_data.append(["against_voucher", "=", filters.get("asset")])
if filters.get("asset_category"):
assets = frappe.db.sql_list(
"""select name from tabAsset
where asset_category = %s and docstatus=1""",
@@ -41,12 +40,27 @@ def get_data(filters):
filters_data.append(["against_voucher", "in", assets])
if filters.get("finance_book"):
filters_data.append(["finance_book", "in", ["", filters.get("finance_book")]])
company_fb = frappe.get_cached_value("Company", filters.get("company"), "default_finance_book")
if filters.get("include_default_book_assets") and company_fb:
if filters.get("finance_book") and cstr(filters.get("finance_book")) != cstr(company_fb):
frappe.throw(_("To use a different finance book, please uncheck 'Include Default FB Assets'"))
else:
finance_book = company_fb
elif filters.get("finance_book"):
finance_book = filters.get("finance_book")
else:
finance_book = None
if finance_book:
or_filters_data = [["finance_book", "in", ["", finance_book]], ["finance_book", "is", "not set"]]
else:
or_filters_data = [["finance_book", "in", [""]], ["finance_book", "is", "not set"]]
gl_entries = frappe.get_all(
"GL Entry",
filters=filters_data,
or_filters=or_filters_data,
fields=["against_voucher", "debit_in_account_currency as debit", "voucher_no", "posting_date"],
order_by="against_voucher, posting_date",
)
@@ -61,7 +75,9 @@ def get_data(filters):
asset_data = assets_details.get(d.against_voucher)
if asset_data:
if not asset_data.get("accumulated_depreciation_amount"):
asset_data.accumulated_depreciation_amount = d.debit
asset_data.accumulated_depreciation_amount = d.debit + asset_data.get(
"opening_accumulated_depreciation"
)
else:
asset_data.accumulated_depreciation_amount += d.debit
@@ -70,7 +86,7 @@ def get_data(filters):
{
"depreciation_amount": d.debit,
"depreciation_date": d.posting_date,
"amount_after_depreciation": (
"value_after_depreciation": (
flt(row.gross_purchase_amount) - flt(row.accumulated_depreciation_amount)
),
"depreciation_entry": d.voucher_no,
@@ -88,10 +104,12 @@ def get_assets_details(assets):
fields = [
"name as asset",
"gross_purchase_amount",
"opening_accumulated_depreciation",
"asset_category",
"status",
"depreciation_method",
"purchase_date",
"cost_center",
]
for d in frappe.get_all("Asset", fields=fields, filters={"name": ("in", assets)}):
@@ -121,6 +139,12 @@ def get_columns():
"fieldtype": "Currency",
"width": 120,
},
{
"label": _("Opening Accumulated Depreciation"),
"fieldname": "opening_accumulated_depreciation",
"fieldtype": "Currency",
"width": 140,
},
{
"label": _("Depreciation Amount"),
"fieldname": "depreciation_amount",
@@ -134,8 +158,8 @@ def get_columns():
"width": 210,
},
{
"label": _("Amount After Depreciation"),
"fieldname": "amount_after_depreciation",
"label": _("Value After Depreciation"),
"fieldname": "value_after_depreciation",
"fieldtype": "Currency",
"width": 180,
},
@@ -153,12 +177,13 @@ def get_columns():
"options": "Asset Category",
"width": 120,
},
{"label": _("Current Status"), "fieldname": "status", "fieldtype": "Data", "width": 120},
{
"label": _("Depreciation Method"),
"fieldname": "depreciation_method",
"fieldtype": "Data",
"width": 130,
"label": _("Cost Center"),
"fieldtype": "Link",
"fieldname": "cost_center",
"options": "Cost Center",
"width": 100,
},
{"label": _("Current Status"), "fieldname": "status", "fieldtype": "Data", "width": 120},
{"label": _("Purchase Date"), "fieldname": "purchase_date", "fieldtype": "Date", "width": 120},
]

View File

@@ -15,7 +15,7 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() {
frappe.query_reports["Balance Sheet"]["filters"].push({
"fieldname": "include_default_book_entries",
"label": __("Include Default Book Entries"),
"label": __("Include Default FB Entries"),
"fieldtype": "Check",
"default": 1
});

View File

@@ -23,6 +23,7 @@ class TestBankReconciliationStatement(FrappeTestCase):
"Payment Entry",
]:
frappe.db.delete(dt)
frappe.db.set_single_value("Accounts Settings", "acc_frozen_upto", None)
def test_loan_entries_in_bank_reco_statement(self):
create_loan_accounts()

View File

@@ -16,7 +16,7 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() {
frappe.query_reports["Cash Flow"]["filters"].push(
{
"fieldname": "include_default_book_entries",
"label": __("Include Default Book Entries"),
"label": __("Include Default FB Entries"),
"fieldtype": "Check",
"default": 1
}

View File

@@ -67,7 +67,7 @@ def setup_mappers(mappers):
mapping["finance_costs"] = []
mapping["finance_costs_adjustments"] = []
doc = frappe.get_doc("Cash Flow Mapper", mapping["name"])
mapping_names = [item.name for item in doc.accounts]
mapping_names = [item.mapping for item in doc.accounts]
if not mapping_names:
continue

View File

@@ -105,7 +105,7 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() {
},
{
"fieldname": "include_default_book_entries",
"label": __("Include Default Book Entries"),
"label": __("Include Default FB Entries"),
"fieldtype": "Check",
"default": 1
},

View File

@@ -8,7 +8,17 @@ import re
import frappe
from frappe import _
from frappe.utils import add_days, add_months, cint, cstr, flt, formatdate, get_first_day, getdate
from frappe.utils import (
add_days,
add_months,
cint,
cstr,
flt,
formatdate,
get_first_day,
getdate,
today,
)
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
get_accounting_dimensions,
@@ -43,6 +53,8 @@ def get_period_list(
year_start_date = getdate(period_start_date)
year_end_date = getdate(period_end_date)
year_end_date = getdate(today()) if year_end_date > getdate(today()) else year_end_date
months_to_add = {"Yearly": 12, "Half-Yearly": 6, "Quarterly": 3, "Monthly": 1}[periodicity]
period_list = []
@@ -561,9 +573,7 @@ def apply_additional_conditions(doctype, query, from_date, ignore_closing_entrie
company_fb = frappe.get_cached_value("Company", filters.company, "default_finance_book")
if filters.finance_book and company_fb and cstr(filters.finance_book) != cstr(company_fb):
frappe.throw(
_("To use a different finance book, please uncheck 'Include Default Book Entries'")
)
frappe.throw(_("To use a different finance book, please uncheck 'Include Default FB Entries'"))
query = query.where(
(gl_entry.finance_book.isin([cstr(filters.finance_book), cstr(company_fb), ""]))

View File

@@ -79,7 +79,9 @@ class General_Payment_Ledger_Comparison(object):
.select(
gle.company,
gle.account,
gle.voucher_type,
gle.voucher_no,
gle.party_type,
gle.party,
outstanding,
)
@@ -89,7 +91,9 @@ class General_Payment_Ledger_Comparison(object):
& (gle.account.isin(val.accounts))
)
.where(Criterion.all(filter_criterion))
.groupby(gle.company, gle.account, gle.voucher_no, gle.party)
.groupby(
gle.company, gle.account, gle.voucher_type, gle.voucher_no, gle.party_type, gle.party
)
.run()
)
@@ -112,7 +116,13 @@ class General_Payment_Ledger_Comparison(object):
self.account_types[acc_type].ple = (
qb.from_(ple)
.select(
ple.company, ple.account, ple.voucher_no, ple.party, Sum(ple.amount).as_("outstanding")
ple.company,
ple.account,
ple.voucher_type,
ple.voucher_no,
ple.party_type,
ple.party,
Sum(ple.amount).as_("outstanding"),
)
.where(
(ple.company == self.filters.company)
@@ -120,7 +130,9 @@ class General_Payment_Ledger_Comparison(object):
& (ple.account.isin(val.accounts))
)
.where(Criterion.all(filter_criterion))
.groupby(ple.company, ple.account, ple.voucher_no, ple.party)
.groupby(
ple.company, ple.account, ple.voucher_type, ple.voucher_no, ple.party_type, ple.party
)
.run()
)
@@ -133,15 +145,17 @@ class General_Payment_Ledger_Comparison(object):
self.gle_balances = set(val.gle) | self.gle_balances
self.ple_balances = set(val.ple) | self.ple_balances
self.diff1 = self.gle_balances.difference(self.ple_balances)
self.diff2 = self.ple_balances.difference(self.gle_balances)
self.variation_in_payment_ledger = self.gle_balances.difference(self.ple_balances)
self.variation_in_general_ledger = self.ple_balances.difference(self.gle_balances)
self.diff = frappe._dict({})
for x in self.diff1:
self.diff[(x[0], x[1], x[2], x[3])] = frappe._dict({"gl_balance": x[4]})
for x in self.variation_in_payment_ledger:
self.diff[(x[0], x[1], x[2], x[3], x[4], x[5])] = frappe._dict({"gl_balance": x[6]})
for x in self.diff2:
self.diff[(x[0], x[1], x[2], x[3])].update(frappe._dict({"pl_balance": x[4]}))
for x in self.variation_in_general_ledger:
self.diff.setdefault(
(x[0], x[1], x[2], x[3], x[4], x[5]), frappe._dict({"gl_balance": 0.0})
).update(frappe._dict({"pl_balance": x[6]}))
def generate_data(self):
self.data = []
@@ -149,8 +163,12 @@ class General_Payment_Ledger_Comparison(object):
self.data.append(
frappe._dict(
{
"voucher_no": key[2],
"party": key[3],
"company": key[0],
"account": key[1],
"voucher_type": key[2],
"voucher_no": key[3],
"party_type": key[4],
"party": key[5],
"gl_balance": val.gl_balance,
"pl_balance": val.pl_balance,
}
@@ -160,12 +178,52 @@ class General_Payment_Ledger_Comparison(object):
def get_columns(self):
self.columns = []
options = None
self.columns.append(
dict(
label=_("Company"),
fieldname="company",
fieldtype="Link",
options="Company",
width="100",
)
)
self.columns.append(
dict(
label=_("Account"),
fieldname="account",
fieldtype="Link",
options="Account",
width="100",
)
)
self.columns.append(
dict(
label=_("Voucher Type"),
fieldname="voucher_type",
fieldtype="Link",
options="DocType",
width="100",
)
)
self.columns.append(
dict(
label=_("Voucher No"),
fieldname="voucher_no",
fieldtype="Data",
options=options,
fieldtype="Dynamic Link",
options="voucher_type",
width="100",
)
)
self.columns.append(
dict(
label=_("Party Type"),
fieldname="party_type",
fieldtype="Link",
options="DocType",
width="100",
)
)
@@ -174,8 +232,8 @@ class General_Payment_Ledger_Comparison(object):
dict(
label=_("Party"),
fieldname="party",
fieldtype="Data",
options=options,
fieldtype="Dynamic Link",
options="party_type",
width="100",
)
)

View File

@@ -50,7 +50,11 @@ class TestGeneralAndPaymentLedger(FrappeTestCase, AccountsTestMixin):
self.assertEqual(len(data), 1)
expected = {
"company": sinv.company,
"account": sinv.debit_to,
"voucher_type": sinv.doctype,
"voucher_no": sinv.name,
"party_type": "Customer",
"party": sinv.customer,
"gl_balance": sinv.grand_total,
"pl_balance": sinv.grand_total - 1,

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