Compare commits

..

830 Commits

Author SHA1 Message Date
Frappe PR Bot
225d4ccb63 chore(release): Bumped to Version 14.78.2
## [14.78.2](https://github.com/frappe/erpnext/compare/v14.78.1...v14.78.2) (2024-12-12)

### Bug Fixes

* add docstatus for translation ([0a4090a](0a4090a771))
* add label strings for translation in pos_controller.js ([8233e22](8233e22d8b))
* add labels for translation in production_analytics.py ([1a7f195](1a7f195d8f))
* add labels for translation in purchase_order_analysis.py ([f9974f9](f9974f9eb0))
* add labels for translation in quality_inspection_summary.py ([9986c26](9986c26a0c))
* add labels for translation in sales_order_analysis.py ([bad1b2a](bad1b2a164))
* add labels for translation in sales_order.js ([3620dda](3620ddab34))
* add string for translation in delayed_tasks_summary.py ([ce04f6d](ce04f6d7c9))
* add strings for translation in pos_item_cart.js ([1f0f31a](1f0f31a773))
* add strings for translation payment_terms_status_for_sales_order.py ([17dad01](17dad01ab7))
* add title for translation in  asset.js ([aed90f7](aed90f73d7))
* **Bank Transaction:** error in party matching should not block submitting (backport [#44416](https://github.com/frappe/erpnext/issues/44416)) ([#44573](https://github.com/frappe/erpnext/issues/44573)) ([ebc8bed](ebc8bede7f))
* description overwrite on qty change (backport [#44606](https://github.com/frappe/erpnext/issues/44606)) ([#44608](https://github.com/frappe/erpnext/issues/44608)) ([a460bf9](a460bf9433))
* incorrect stock UOM for BOM raw materials (backport [#44528](https://github.com/frappe/erpnext/issues/44528)) ([#44530](https://github.com/frappe/erpnext/issues/44530)) ([ecc756b](ecc756bd52))
* inv dimensions fields not creating for standard doctype (backport [#44504](https://github.com/frappe/erpnext/issues/44504)) ([#44514](https://github.com/frappe/erpnext/issues/44514)) ([c502b56](c502b562db))
* prevent set_payment_schedule on return documents ([3c8b637](3c8b637a8b))
* required by date in the reorder material request (backport [#44497](https://github.com/frappe/erpnext/issues/44497)) ([#44508](https://github.com/frappe/erpnext/issues/44508)) ([15e3663](15e3663633))
* strings for translation in pos_past_order_summary.js ([dfbb227](dfbb2279b6))
* variant qty while making work order from BOM (backport [#44548](https://github.com/frappe/erpnext/issues/44548)) ([#44550](https://github.com/frappe/erpnext/issues/44550)) ([e2aedc8](e2aedc85b4))
2024-12-12 10:37:15 +00:00
ruthra kumar
e09232234e Merge pull request #44639 from frappe/version-14-hotfix
chore: release v14
2024-12-12 16:05:12 +05:30
mergify[bot]
a460bf9433 fix: description overwrite on qty change (backport #44606) (#44608)
* fix: description overwrite on qty change (#44606)

(cherry picked from commit 9ad79625e0)

# Conflicts:
#	erpnext/stock/doctype/material_request/material_request.js

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-12-09 19:12:09 +05:30
ruthra kumar
30151da57c Merge pull request #44611 from ruthra-kumar/backport_v14_44495
fix: prevent set_payment_schedule on return documents
2024-12-09 13:34:15 +05:30
ruthra kumar
3c8b637a8b fix: prevent set_payment_schedule on return documents 2024-12-09 13:00:56 +05:30
ruthra kumar
6fa338bfb7 Merge pull request #44602 from frappe/mergify/bp/version-14-hotfix/pr-44582
fix: add doc.status for translation (backport #44582)
2024-12-09 12:56:05 +05:30
ruthra kumar
9664790272 chore: fix linter 2024-12-09 12:08:54 +05:30
mahsem
0a4090a771 fix: add docstatus for translation
(cherry picked from commit dda272220b)
2024-12-09 05:51:35 +00:00
mergify[bot]
ebc8bede7f fix(Bank Transaction): error in party matching should not block submitting (backport #44416) (#44573)
fix(Bank Transaction): error in party matching should not block submitting (#44416)

(cherry picked from commit 72256565bb)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2024-12-06 11:57:52 +01:00
ruthra kumar
19b64496b1 Merge pull request #44571 from frappe/mergify/bp/version-14-hotfix/pr-44538
fix: add labels for translation in purchase_order_analysis.py (backport #44538)
2024-12-06 12:21:04 +05:30
mahsem
f9974f9eb0 fix: add labels for translation in purchase_order_analysis.py
(cherry picked from commit 342a398bec)
2024-12-06 06:49:54 +00:00
ruthra kumar
0eccb01b7b Merge pull request #44565 from frappe/mergify/bp/version-14-hotfix/pr-44558
fix: add string for translation in delayed_tasks_summary.py (backport #44558)
2024-12-06 12:18:52 +05:30
mahsem
ce04f6d7c9 fix: add string for translation in delayed_tasks_summary.py
(cherry picked from commit 84b54f549a)
2024-12-06 12:17:50 +05:30
ruthra kumar
424d585962 Merge pull request #44569 from frappe/mergify/bp/version-14-hotfix/pr-44539
fix: add labels for translation in production_analytics.py (backport #44539)
2024-12-06 12:16:58 +05:30
mahsem
1a7f195d8f fix: add labels for translation in production_analytics.py
(cherry picked from commit 9b09116576)
2024-12-06 06:46:26 +00:00
ruthra kumar
5b0222615d Merge pull request #44567 from frappe/mergify/bp/version-14-hotfix/pr-44541
fix: add labels for translation in quality_inspection_summary.py (backport #44541)
2024-12-06 12:15:39 +05:30
mahsem
9986c26a0c fix: add labels for translation in quality_inspection_summary.py
(cherry picked from commit 6ff4704345)
2024-12-06 06:44:58 +00:00
ruthra kumar
e0c1e3474e Merge pull request #44563 from frappe/mergify/bp/version-14-hotfix/pr-44559
fix: add strings for translation payment_terms_status_for_sales_order.py (backport #44559)
2024-12-06 12:12:57 +05:30
mahsem
17dad01ab7 fix: add strings for translation payment_terms_status_for_sales_order.py
(cherry picked from commit 7d244051c8)
2024-12-06 06:38:29 +00:00
ruthra kumar
9515625135 Merge pull request #44561 from frappe/mergify/bp/version-14-hotfix/pr-44560
fix: add labels for translation in sales_order_analysis.py (backport #44560)
2024-12-06 12:07:05 +05:30
mahsem
bad1b2a164 fix: add labels for translation in sales_order_analysis.py
(cherry picked from commit 8a554a5538)
2024-12-06 06:09:28 +00:00
mergify[bot]
e2aedc85b4 fix: variant qty while making work order from BOM (backport #44548) (#44550)
fix: variant qty while making work order from BOM (#44548)

(cherry picked from commit 1571dff3ef)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-12-05 16:01:49 +05:30
Khushi Rawat
68fe3b4165 Merge pull request #44543 from frappe/mergify/bp/version-14-hotfix/pr-44537
fix: add title for translation in  asset.js (backport #44537)
2024-12-05 15:42:11 +05:30
mahsem
aed90f73d7 fix: add title for translation in asset.js
(cherry picked from commit 61439132a4)
2024-12-05 09:47:58 +00:00
Frappe PR Bot
7a2b07a2a3 chore(release): Bumped to Version 14.78.1
## [14.78.1](https://github.com/frappe/erpnext/compare/v14.78.0...v14.78.1) (2024-12-05)

### Bug Fixes

* required by date in the reorder material request (backport [#44497](https://github.com/frappe/erpnext/issues/44497)) ([#44508](https://github.com/frappe/erpnext/issues/44508)) ([e0b8c27](e0b8c2788b))
2024-12-05 08:18:33 +00:00
rohitwaghchaure
86ff1545ce Merge pull request #44535 from frappe/mergify/bp/version-14/pr-44508
fix: required by date in the reorder material request (backport #44497) (backport #44508)
2024-12-05 13:47:02 +05:30
mergify[bot]
e0b8c2788b fix: required by date in the reorder material request (backport #44497) (#44508)
* fix: required by date in the reorder material request (#44497)

(cherry picked from commit 4001166ecc)

# Conflicts:
#	erpnext/stock/doctype/stock_entry/test_stock_entry.py

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
(cherry picked from commit 15e3663633)
2024-12-05 07:24:59 +00:00
mergify[bot]
ecc756bd52 fix: incorrect stock UOM for BOM raw materials (backport #44528) (#44530)
fix: incorrect stock UOM for BOM raw materials (#44528)

fix: incorrect stock uom for BOM raw materials
(cherry picked from commit 5413cf9f1f)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-12-05 12:51:39 +05:30
ruthra kumar
0891399916 Merge pull request #44527 from frappe/mergify/bp/version-14-hotfix/pr-44503
fix: add strings for translation in pos_item_cart.js (backport #44503)
2024-12-05 10:24:51 +05:30
ruthra kumar
1436fda041 Merge pull request #44519 from frappe/mergify/bp/version-14-hotfix/pr-44500
fix: add labels for translation in sales_order.js (backport #44500)
2024-12-05 10:19:02 +05:30
ruthra kumar
639a71ffd0 chore: linter fix
(cherry picked from commit 31efaf6dbf)
2024-12-05 04:49:01 +00:00
mahsem
1f0f31a773 fix: add strings for translation in pos_item_cart.js
(cherry picked from commit 4b72b60f1a)
2024-12-05 04:49:00 +00:00
ruthra kumar
3bb4699754 Merge pull request #44525 from frappe/mergify/bp/version-14-hotfix/pr-44512
fix: add label strings for translation in pos_controller.js (backport #44512)
2024-12-05 10:17:40 +05:30
mahsem
3620ddab34 fix: add labels for translation in sales_order.js
(cherry picked from commit d544328ffe)
2024-12-05 10:16:48 +05:30
mahsem
8233e22d8b fix: add label strings for translation in pos_controller.js
(cherry picked from commit bd77a5557d)
2024-12-05 04:42:44 +00:00
ruthra kumar
1f293edc9e Merge pull request #44523 from frappe/mergify/bp/version-14-hotfix/pr-44501
fix: strings for translation in pos_past_order_summary.js (backport #44501)
2024-12-05 10:12:41 +05:30
ruthra kumar
13cd12e1e2 Merge pull request #44521 from frappe/mergify/bp/version-14-hotfix/pr-42081
Use better description in pos_payment.js (backport #42081)
2024-12-05 10:12:11 +05:30
mahsem
dfbb2279b6 fix: strings for translation in pos_past_order_summary.js
(cherry picked from commit 23c846d4b9)
2024-12-05 04:31:29 +00:00
mahsem
e1d288321f refactor: translatable label on pos payments (#42081)
* Use better description in pos_payment.js

Use Change Amount instead of Change and To Be Paid in pos_payment.js and be consistent with other strings

* change_amount_pos_payment.js

(cherry picked from commit 138ffc4e93)
2024-12-05 04:30:46 +00:00
mergify[bot]
c502b562db fix: inv dimensions fields not creating for standard doctype (backport #44504) (#44514)
fix: inv dimensions fields not creating for standard doctype (#44504)

(cherry picked from commit 353610ce61)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-12-05 09:45:29 +05:30
mergify[bot]
15e3663633 fix: required by date in the reorder material request (backport #44497) (#44508)
* fix: required by date in the reorder material request (#44497)

(cherry picked from commit 4001166ecc)

# Conflicts:
#	erpnext/stock/doctype/stock_entry/test_stock_entry.py

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-12-04 19:03:09 +05:30
Frappe PR Bot
c1a1346e2a chore(release): Bumped to Version 14.78.0
# [14.78.0](https://github.com/frappe/erpnext/compare/v14.77.3...v14.78.0) (2024-12-04)

### Bug Fixes

* Add filter for `outstanding_amount` to fetch open PRs ([7e847f2](7e847f27dd))
* Add translation for showing mandatory fields in error msg ([de5b253](de5b253215))
* added fieldname to avoid fieldname to translate ([d7caa8d](d7caa8d51b))
* Added translation for `Account` column ([2061c7c](2061c7ca46))
* adjusted incoming rate for zero rated item in purchase receipt ([d7583e3](d7583e3993))
* correct buying amount for product bundel ([91f6393](91f6393104))
* Dashboard for `Payment Request` ([c911a70](c911a70a84))
* Data Should be Computed in Backend to Maintain Consistent Behaviour ([#44195](https://github.com/frappe/erpnext/issues/44195)) ([8529eb4](8529eb4573))
* handle multi currency in common party journal entry ([bed6dab](bed6dabecb))
* incorrect Gross Margin on project ([#44461](https://github.com/frappe/erpnext/issues/44461)) ([5533592](5533592b2b))
* remove queries ([7d724d7](7d724d7647))
* show "Send SMS" only when enabled (backport [#43941](https://github.com/frappe/erpnext/issues/43941)) ([#43969](https://github.com/frappe/erpnext/issues/43969)) ([9ae04df](9ae04dfed3))
* source warehouse not set in required items of WO (backport [#44426](https://github.com/frappe/erpnext/issues/44426)) ([#44433](https://github.com/frappe/erpnext/issues/44433)) ([cbce4e7](cbce4e72d9))
* Translate `Party Account` column label ([c4103d2](c4103d26be))
* typeerror on transaction.js ([147eb04](147eb047aa))

### Features

* add Company Contact Person in selling transactions (backport [#44362](https://github.com/frappe/erpnext/issues/44362)) ([#44397](https://github.com/frappe/erpnext/issues/44397)) ([78ab44c](78ab44ce1a))

### Performance Improvements

* cache product bundle items at document level ([#44440](https://github.com/frappe/erpnext/issues/44440)) ([df0dac5](df0dac5610))
* reduce queries during transaction save ([f884cf8](f884cf8a5e))

### Reverts

* remove default `Payment Request` indicator color ([9baaaca](9baaaca924))
2024-12-04 04:36:03 +00:00
ruthra kumar
1e02d06424 Merge pull request #44482 from frappe/version-14-hotfix
chore: release v14
2024-12-04 10:04:44 +05:30
ruthra kumar
2812eae589 Merge pull request #44484 from frappe/mergify/bp/version-14-hotfix/pr-44467
fix: Multiple Fixes in Gross Profit Report (backport #44467)
2024-12-03 19:15:34 +05:30
ruthra kumar
a94e3cd433 chore: fix typo
(cherry picked from commit fc0122ce76)
2024-12-03 12:00:36 +00:00
ljain112
91f6393104 fix: correct buying amount for product bundel
(cherry picked from commit 4e6a5893e7)
2024-12-03 12:00:36 +00:00
ljain112
7d724d7647 fix: remove queries
(cherry picked from commit a86b223aed)
2024-12-03 12:00:35 +00:00
ruthra kumar
e4b811be23 Merge pull request #44469 from frappe/mergify/bp/version-14-hotfix/pr-44461
fix: incorrect Gross Margin on project (backport #44461)
2024-12-03 15:32:04 +05:30
rohitwaghchaure
ccd7992e99 chore: fix conflicts 2024-12-03 15:08:38 +05:30
rohitwaghchaure
86ff3e0c10 chore: fix conflicts 2024-12-03 15:06:16 +05:30
ruthra kumar
96fe3f4a2c Merge pull request #44479 from frappe/mergify/bp/version-14-hotfix/pr-44415
fix: adjusted incoming rate for zero rated item in purchase receipt (backport #44415)
2024-12-03 14:48:24 +05:30
ljain112
d7583e3993 fix: adjusted incoming rate for zero rated item in purchase receipt
(cherry picked from commit 3182c6981c)
2024-12-03 08:56:06 +00:00
rohitwaghchaure
5533592b2b fix: incorrect Gross Margin on project (#44461)
(cherry picked from commit 7de9c14a2c)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.py
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
2024-12-02 10:10:31 +00:00
ruthra kumar
ba19e06e64 Merge pull request #44464 from frappe/mergify/bp/version-14-hotfix/pr-44412
fix: handle multi currency in common party journal entry (backport #44412)
2024-12-02 14:03:21 +05:30
ruthra kumar
1988c23539 chore: resolve conflict 2024-12-02 13:42:27 +05:30
ruthra kumar
70cac3186b Merge pull request #44462 from frappe/mergify/bp/version-14-hotfix/pr-44437
fix: Added translation for `Account` column (backport #44437)
2024-12-02 13:39:59 +05:30
ljain112
bed6dabecb fix: handle multi currency in common party journal entry
(cherry picked from commit e371f68d66)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
2024-12-02 07:10:05 +00:00
Abdeali Chharchhoda
c4103d26be fix: Translate Party Account column label
(cherry picked from commit a4f8315602)
2024-12-02 06:53:37 +00:00
Abdeali Chharchhoda
2061c7ca46 fix: Added translation for Account column
(cherry picked from commit de6cbd382f)
2024-12-02 06:53:37 +00:00
Sagar Vora
84bd0c8c50 Merge pull request #44446 from frappe/mergify/bp/version-14-hotfix/pr-44443
perf: reduce queries during transaction save (backport #44443)
2024-11-30 00:47:53 +05:30
Sagar Vora
f884cf8a5e perf: reduce queries during transaction save
(cherry picked from commit b6b8a06fda)
2024-11-29 19:17:26 +00:00
Sagar Vora
54782d41be Merge pull request #44444 from frappe/mergify/bp/version-14-hotfix/pr-44439
fix: added fieldname to avoid fieldname to translate (backport #44439)
2024-11-30 00:29:47 +05:30
Abdeali Chharchhoda
d7caa8d51b fix: added fieldname to avoid fieldname to translate
(cherry picked from commit b80022133c)
2024-11-29 18:56:31 +00:00
Sagar Vora
9e8150554f Merge pull request #44441 from frappe/mergify/bp/version-14-hotfix/pr-44440
perf: cache product bundle items at document level (backport #44440)
2024-11-29 23:04:01 +05:30
Sagar Vora
df0dac5610 perf: cache product bundle items at document level (#44440)
(cherry picked from commit 6de7320ef4)
2024-11-29 17:22:51 +00:00
mergify[bot]
cbce4e72d9 fix: source warehouse not set in required items of WO (backport #44426) (#44433)
* fix: source warehouse not set in required items of WO (#44426)

fix: source warehouse not set in required items of WO on data import
(cherry picked from commit 4050ea07eb)

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

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-11-29 18:13:25 +05:30
ruthra kumar
2c2a204a06 Merge pull request #44390 from frappe/mergify/bp/version-14-hotfix/pr-44386
fix: Add translation for showing mandatory fields in error msg (backport #44386)
2024-11-29 15:38:52 +05:30
ruthra kumar
da5b57e4af Merge pull request #44424 from frappe/mergify/bp/version-14-hotfix/pr-44302
fix: Minor Updates in `Payment Request` and `Payment Entry`  (backport #44302)
2024-11-29 15:38:11 +05:30
Abdeali Chharchhoda
de5b253215 fix: Add translation for showing mandatory fields in error msg
(cherry picked from commit f42ec6a124)
2024-11-29 14:57:21 +05:30
ruthra kumar
a8ef90b40c chore: resolve conflict 2024-11-29 14:51:46 +05:30
Abdeali Chharchhoda
7e847f27dd fix: Add filter for outstanding_amount to fetch open PRs
(cherry picked from commit 214dfab269)
2024-11-29 09:11:07 +00:00
Abdeali Chharchhoda
eb809847f1 refactor: Move PR link filters to client side
(cherry picked from commit 2db2c8bce1)
2024-11-29 09:11:06 +00:00
Abdeali Chharchhoda
9baaaca924 revert: remove default Payment Request indicator color
(cherry picked from commit 37ceb09955)

# Conflicts:
#	erpnext/accounts/doctype/payment_request/payment_request_list.js
2024-11-29 09:11:06 +00:00
Abdeali Chharchhoda
c911a70a84 fix: Dashboard for Payment Request
(cherry picked from commit 91955e27c3)
2024-11-29 09:11:06 +00:00
Abdeali Chharchhoda
e2728db5c2 refactor: Used object to get payment request status indicator
(cherry picked from commit e1c4d6e1e6)

# Conflicts:
#	erpnext/accounts/doctype/payment_request/payment_request_list.js
2024-11-29 09:11:06 +00:00
Smit Vora
f6f1052a80 Merge pull request #44409 from frappe/mergify/bp/version-14-hotfix/pr-44195
fix: Data Should be Computed in Backend to Maintain Consistent Behaviour (backport #44195)
2024-11-28 16:27:16 +05:30
Ninad Parikh
8529eb4573 fix: Data Should be Computed in Backend to Maintain Consistent Behaviour (#44195)
(cherry picked from commit 69bd90b038)
2024-11-28 10:31:28 +00:00
ruthra kumar
a73fedbaca Merge pull request #44406 from frappe/mergify/bp/version-14-hotfix/pr-44405
fix: typeerror on transaction.js (backport #44405)
2024-11-28 15:13:27 +05:30
ruthra kumar
147eb047aa fix: typeerror on transaction.js
(cherry picked from commit 46ce8780f2)
2024-11-28 15:02:35 +05:30
mergify[bot]
9ae04dfed3 fix: show "Send SMS" only when enabled (backport #43941) (#43969)
fix: show "Send SMS" only when enabled (#43941)

(cherry picked from commit 65088cbb1b)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2024-11-27 23:52:12 +01:00
mergify[bot]
78ab44ce1a feat: add Company Contact Person in selling transactions (backport #44362) (#44397)
* feat: add Company Contact Person in selling transactions (#44362)

(cherry picked from commit f6776c7d6b)

* chore: resolve conflicts

---------

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2024-11-27 17:09:09 +01:00
Frappe PR Bot
0079bd282e chore(release): Bumped to Version 14.77.3
## [14.77.3](https://github.com/frappe/erpnext/compare/v14.77.2...v14.77.3) (2024-11-27)

### Bug Fixes

*  correct placeholder index in message ([d7e6b0e](d7e6b0e1b7))
* added Stock UOM field for RM in work order (backport [#44185](https://github.com/frappe/erpnext/issues/44185)) ([#44236](https://github.com/frappe/erpnext/issues/44236)) ([ee647f2](ee647f2381))
* billed qty and received amount in PO analysis report (backport [#44349](https://github.com/frappe/erpnext/issues/44349)) ([#44353](https://github.com/frappe/erpnext/issues/44353)) ([6aebe98](6aebe98020))
* change asset status correctly ([841df3b](841df3b1ce))
* Get submitted documents in validate_for_closed_fiscal_year ([b9efeeb](b9efeeb71a))
* gp for return invoice ([6e56343](6e563438bd))
* include current invoice amount when tax_on_excess_amount is checked ([071adcf](071adcf291))
* incorrect GL entry on sale of fully depreciated asset ([cc5ada1](cc5ada194e))
* make free qty round on large transaction qty ([2eb7002](2eb70026ae))
* patch ([#44191](https://github.com/frappe/erpnext/issues/44191)) ([3643c60](3643c60c67))
* test case ([7eafe7f](7eafe7f853))
* unify company address query in sales transactions (backport [#44361](https://github.com/frappe/erpnext/issues/44361)) ([#44366](https://github.com/frappe/erpnext/issues/44366)) ([fef7cfb](fef7cfb888))
* update gross profit for returned invoices ([0eb5e00](0eb5e001e1))
* Used `Fiscal Dates` instead of year's `Start` and `End` dates ([4f806f9](4f806f9a72))
2024-11-27 15:25:06 +00:00
ruthra kumar
2db54f0bb1 Merge pull request #44342 from frappe/version-14-hotfix
chore: release v14
2024-11-27 20:53:38 +05:30
ruthra kumar
627a50e7bc Merge pull request #44384 from frappe/mergify/bp/version-14-hotfix/pr-44323
fix: update gross profit for returned invoices (backport #44323)
2024-11-27 17:21:13 +05:30
ljain112
7eafe7f853 fix: test case
(cherry picked from commit af5a3e5a48)
2024-11-27 11:20:16 +00:00
ljain112
6e563438bd fix: gp for return invoice
(cherry picked from commit 00403515a8)
2024-11-27 11:20:16 +00:00
ljain112
0eb5e001e1 fix: update gross profit for returned invoices
(cherry picked from commit 8a42601e99)
2024-11-27 11:20:15 +00:00
ruthra kumar
0dfb9ddb85 Merge pull request #44380 from frappe/mergify/bp/version-14-hotfix/pr-44377
fix:  correct placeholder index in message (backport #44377)
2024-11-27 15:38:39 +05:30
ljain112
d7e6b0e1b7 fix: correct placeholder index in message
(cherry picked from commit d61cb9a4bf)
2024-11-27 09:26:10 +00:00
Raffael Meyer
fef7cfb888 fix: unify company address query in sales transactions (backport #44361) (#44366)
* fix: unify company address query in sales transactions (backport #44361)

* style: add whitespace
2024-11-26 21:11:27 +01:00
Khushi Rawat
aa442da2f6 Merge pull request #44329 from khushi8112/incorrect-gl-entry-on-asset-sale
fix: incorrect GL entry on sale of fully depreciated asset
2024-11-27 01:09:33 +05:30
mergify[bot]
6aebe98020 fix: billed qty and received amount in PO analysis report (backport #44349) (#44353)
* fix: billed qty and received amount in PO analysis report (#44349)

(cherry picked from commit 2ab7ec5437)

# Conflicts:
#	erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-11-26 21:18:38 +05:30
Khushi Rawat
841df3b1ce fix: change asset status correctly 2024-11-26 14:06:07 +05:30
Khushi Rawat
cc5ada194e fix: incorrect GL entry on sale of fully depreciated asset 2024-11-26 01:39:42 +05:30
Smit Vora
edccb746f0 Merge pull request #44294 from Abdeali099/fix-fiscal-dates 2024-11-25 16:15:04 +05:30
ruthra kumar
506fd97a2c Merge pull request #44314 from frappe/mergify/bp/version-14-hotfix/pr-44297
refactor: added translate function for some columns of report (backport #44297)
2024-11-25 10:39:49 +05:30
Abdeali Chharchhoda
6c9485fb13 refactor: added translate function for some columns of report
(cherry picked from commit e545c913b5)
2024-11-25 04:39:26 +00:00
Abdeali Chharchhoda
4f806f9a72 fix: Used Fiscal Dates instead of year's Start and End dates 2024-11-22 18:09:23 +05:30
Frappe PR Bot
4723fbfd57 chore(release): Bumped to Version 14.77.2
## [14.77.2](https://github.com/frappe/erpnext/compare/v14.77.1...v14.77.2) (2024-11-22)

### Bug Fixes

* patch ([#44191](https://github.com/frappe/erpnext/issues/44191)) ([d1295d1](d1295d1c79))
2024-11-22 11:28:10 +00:00
rohitwaghchaure
ab49ee2e05 Merge pull request #44289 from frappe/mergify/bp/version-14/pr-44288
fix: patch (backport #44191) (backport #44288)
2024-11-22 16:56:24 +05:30
rohitwaghchaure
d1295d1c79 fix: patch (#44191)
(cherry picked from commit 495528a758)
(cherry picked from commit 3643c60c67)
2024-11-22 10:56:37 +00:00
ruthra kumar
8a45258778 Merge pull request #44286 from frappe/mergify/bp/version-14-hotfix/pr-44246
fix: Get submitted documents in validate_for_closed_fiscal_year (backport #44246)
2024-11-22 16:25:37 +05:30
rohitwaghchaure
d10a9d3225 Merge pull request #44288 from frappe/mergify/bp/version-14-hotfix/pr-44191
fix: patch (backport #44191)
2024-11-22 16:25:03 +05:30
rohitwaghchaure
3643c60c67 fix: patch (#44191)
(cherry picked from commit 495528a758)
2024-11-22 10:51:44 +00:00
ruthra kumar
92e252e37a Merge pull request #44284 from frappe/mergify/bp/version-14-hotfix/pr-44266
fix: make free qty round on large transaction qty (backport #44266)
2024-11-22 16:15:19 +05:30
vimalraj27
b9efeeb71a fix: Get submitted documents in validate_for_closed_fiscal_year
(cherry picked from commit c607e5f940)
2024-11-22 15:56:34 +05:30
venkat102
d695fb5723 test: add unit test to validate free qty round on large transaction qty
(cherry picked from commit 013a6fc6ec)
2024-11-22 10:20:54 +00:00
venkat102
2eb70026ae fix: make free qty round on large transaction qty
(cherry picked from commit f9b8165385)
2024-11-22 10:20:53 +00:00
Frappe PR Bot
46a8500361 chore(release): Bumped to Version 14.77.1
## [14.77.1](https://github.com/frappe/erpnext/compare/v14.77.0...v14.77.1) (2024-11-22)

### Bug Fixes

* include current invoice amount when tax_on_excess_amount is checked ([43f59da](43f59da0a9))
2024-11-22 06:01:07 +00:00
ruthra kumar
88ba24f1cf Merge pull request #44270 from frappe/mergify/bp/version-14/pr-44194
fix: include current invoice amount when tax_on_excess_amount is checked (backport #44194)
2024-11-22 11:29:50 +05:30
ruthra kumar
18cbc956bb Merge pull request #44271 from frappe/mergify/bp/version-14-hotfix/pr-44194
fix: include current invoice amount when tax_on_excess_amount is checked (backport #44194)
2024-11-22 11:29:21 +05:30
venkat102
47e4fd3c76 test: add unit test for tax on excess amount
(cherry picked from commit 4820273595)
2024-11-22 05:37:26 +00:00
venkat102
071adcf291 fix: include current invoice amount when tax_on_excess_amount is checked
(cherry picked from commit b74f2896cd)
2024-11-22 05:37:26 +00:00
venkat102
87bb403159 test: add unit test for tax on excess amount
(cherry picked from commit 4820273595)
2024-11-22 05:37:12 +00:00
venkat102
43f59da0a9 fix: include current invoice amount when tax_on_excess_amount is checked
(cherry picked from commit b74f2896cd)
2024-11-22 05:37:12 +00:00
mergify[bot]
ee647f2381 fix: added Stock UOM field for RM in work order (backport #44185) (#44236)
* fix: added Stock UOM field for RM in work order (#44185)

fix: added UOM field for RM in work order
(cherry picked from commit cc571aca8f)

# Conflicts:
#	erpnext/manufacturing/doctype/work_order_item/work_order_item.json
#	erpnext/manufacturing/doctype/work_order_item/work_order_item.py
#	erpnext/patches.txt

* chore: fix conflicts

* chore: fix conflicts

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-11-21 14:52:18 +05:30
Frappe PR Bot
2c865bcd49 chore(release): Bumped to Version 14.77.0
# [14.77.0](https://github.com/frappe/erpnext/compare/v14.76.0...v14.77.0) (2024-11-20)

### Bug Fixes

* added test cases ([5fa4fd8](5fa4fd8825))
* apply posting date sorting to invoices in Payment Reconciliation similar to payments ([cc9b22c](cc9b22ce9f))
* backport german translations from develop ([#44046](https://github.com/frappe/erpnext/issues/44046)) ([c23868a](c23868a14d))
* broken apply on other item pricing rule ([f03e301](f03e301250))
* broken UI on currency exchange ([36898f6](36898f6797))
* check if pricing rule matches with coupon code ([#44104](https://github.com/frappe/erpnext/issues/44104)) ([24b5b3c](24b5b3c8e0))
* correctly set 'cannot_add_rows' property on allocations table field ([137ef78](137ef78d96))
* disable conversion to user tz for sales order calender ([356da69](356da69179))
* Get Entries not showing accounts with no gain or loss in Exchange Rate Revaluation issue ([33e835c](33e835c4d3))
* linters ([c3e2ff2](c3e2ff2fa5))
* non group pos warehouse ([ec40131](ec40131d4d))
* payment reco for jv with negative dr or cr amount ([23fb4f3](23fb4f348f))
* remove trailing whitespace ([1019d98](1019d98c5a))
* set conversion factor before applying price list ([e09f101](e09f101336))
* set default party type in Payment Entry ([f3cbbef](f3cbbef346))
* stock ledger variance report filter options (backport [#44137](https://github.com/frappe/erpnext/issues/44137)) ([#44149](https://github.com/frappe/erpnext/issues/44149)) ([f871f08](f871f08f47))
* validate sales team to ensure all sales person are enabled ([bd0f11e](bd0f11ef4f))

### Features

* new DocTypes "Code List" and "Common Code" (backport [#43425](https://github.com/frappe/erpnext/issues/43425)) ([#44172](https://github.com/frappe/erpnext/issues/44172)) ([a7de8c1](a7de8c1143))
2024-11-20 08:37:41 +00:00
ruthra kumar
fc783f5acf Merge pull request #44210 from frappe/version-14-hotfix
chore: release v14
2024-11-20 14:06:14 +05:30
ruthra kumar
24126b03dd Merge pull request #44244 from frappe/mergify/bp/version-14-hotfix/pr-44197
fix: payment reco for jv with negative dr or cr amount (backport #44197)
2024-11-20 13:12:55 +05:30
ljain112
5fa4fd8825 fix: added test cases
(cherry picked from commit 6f9ea6422d)
2024-11-20 07:18:19 +00:00
ljain112
23fb4f348f fix: payment reco for jv with negative dr or cr amount
(cherry picked from commit fee79b9445)
2024-11-20 07:18:19 +00:00
ruthra kumar
227c912ece Merge pull request #44241 from frappe/mergify/bp/version-14-hotfix/pr-44240
fix: non group pos warehouse (backport #44240)
2024-11-20 12:17:33 +05:30
ruthra kumar
5bfbdb805c Merge pull request #44238 from frappe/mergify/bp/version-14-hotfix/pr-44220
refactor: Update `Payment Request` search query in PE's reference (backport #44220)
2024-11-20 12:16:21 +05:30
Nihantra C. Patel
ec40131d4d fix: non group pos warehouse
(cherry picked from commit d526be0394)
2024-11-20 06:41:34 +00:00
ruthra kumar
859672c419 Merge pull request #44232 from frappe/mergify/bp/version-14-hotfix/pr-44207
fix: validate sales team to ensure all sales person are enabled (backport #44207)
2024-11-20 11:51:56 +05:30
Abdeali Chharchhoda
e8c3617628 refactor: Update Payment Request search query in PE's reference
(cherry picked from commit 4ab3499a17)
2024-11-20 06:21:41 +00:00
ruthra kumar
09b21b8cb4 Merge pull request #44234 from frappe/mergify/bp/version-14-hotfix/pr-44203
fix: disable conversion to user tz for sales order calender (backport #44203)
2024-11-20 11:51:21 +05:30
ljain112
356da69179 fix: disable conversion to user tz for sales order calender
(cherry picked from commit cdf098c193)
2024-11-20 05:17:52 +00:00
ljain112
bd0f11ef4f fix: validate sales team to ensure all sales person are enabled
(cherry picked from commit 548dbb33eb)
2024-11-20 05:11:35 +00:00
ruthra kumar
9f3dfb3d18 Merge pull request #44216 from frappe/mergify/bp/version-14-hotfix/pr-44104
fix: check if pricing rule matches with coupon code (backport #44104)
2024-11-19 17:37:33 +05:30
Nikolas Beckel
24b5b3c8e0 fix: check if pricing rule matches with coupon code (#44104)
* fix: check if pricing rule matches with coupon code

* fix: correct linting error

(cherry picked from commit 9d31bf7647)
2024-11-19 11:41:48 +00:00
mergify[bot]
a7de8c1143 feat: new DocTypes "Code List" and "Common Code" (backport #43425) (#44172)
Co-authored-by: David <dgx.arnold@gmail.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2024-11-18 20:59:41 +01:00
ruthra kumar
2fcab327aa Merge pull request #44181 from frappe/mergify/bp/version-14-hotfix/pr-44127
fix: set default Party Type based on Payment Type in Payment Entry (backport #44127)
2024-11-18 10:49:10 +05:30
vishakhdesai
f3cbbef346 fix: set default party type in Payment Entry
(cherry picked from commit 19222690d3)
2024-11-18 10:16:59 +05:30
ruthra kumar
339beff023 Merge pull request #44179 from frappe/mergify/bp/version-14-hotfix/pr-44147
fix: set conversion factor before applying price list (backport #44147)
2024-11-18 10:14:34 +05:30
ruthra kumar
85d398efcc Merge pull request #44177 from frappe/mergify/bp/version-14-hotfix/pr-44157
fix: apply "cannot_add_rows" directly to table field for more efficient solution (backport #44157)
2024-11-18 10:14:12 +05:30
vishakhdesai
e09f101336 fix: set conversion factor before applying price list
(cherry picked from commit 9749fe23cc)
2024-11-18 04:38:32 +00:00
UmakanthKaspa
f9b52b292e refactor: set 'cannot_add_rows' directly in the allocations table field (optimized approach)
(cherry picked from commit 5dd8eafdfc)
2024-11-18 04:36:12 +00:00
Türker Tunalı
8a94d7bea8 fix:Unable to pause job card (#42839)
fix: unable to pause job card

Pause operation creates "Value missing for: Completed Qty" error. That field was mandatory but it's non mandatory in v15.
2024-11-15 17:29:58 +05:30
mergify[bot]
f871f08f47 fix: stock ledger variance report filter options (backport #44137) (#44149)
fix: stock ledger variance report filter options (#44137)

(cherry picked from commit e8bbf6492f)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-11-15 15:05:03 +05:30
ruthra kumar
313ea3983f Merge pull request #44161 from frappe/mergify/bp/version-14-hotfix/pr-43414
fix: Get Entries not showing accounts with no gain or loss in Exchange Rate Revaluation issue fixed (backport #43414)
2024-11-15 13:09:35 +05:30
Vishakh Desai
c3e2ff2fa5 fix: linters
(cherry picked from commit 9cc22b4cac)
2024-11-15 07:18:49 +00:00
Vishakh Desai
33e835c4d3 fix: Get Entries not showing accounts with no gain or loss in Exchange Rate Revaluation issue
(cherry picked from commit 6de6f55b39)
2024-11-15 07:18:49 +00:00
ruthra kumar
c9fa4af4fe Merge pull request #44159 from frappe/mergify/bp/version-14-hotfix/pr-44158
fix: broken UI on currency exchange (backport #44158)
2024-11-15 12:28:18 +05:30
ruthra kumar
36898f6797 fix: broken UI on currency exchange
(cherry picked from commit e91b65e7bd)
2024-11-15 06:52:40 +00:00
ruthra kumar
b9a0f4fed8 Merge pull request #44154 from frappe/mergify/bp/version-14-hotfix/pr-44089
fix: apply posting date sorting to invoices in Payment Reconciliation similar to payments (backport #44089)
2024-11-15 10:54:40 +05:30
UmakanthKaspa
1019d98c5a fix: remove trailing whitespace
(cherry picked from commit d6703eb88b)
2024-11-15 05:00:03 +00:00
UmakanthKaspa
cc9b22ce9f fix: apply posting date sorting to invoices in Payment Reconciliation similar to payments
(cherry picked from commit 0bd83d920d)
2024-11-15 05:00:02 +00:00
ruthra kumar
f5135cd4a4 Merge pull request #44152 from frappe/mergify/bp/version-14-hotfix/pr-44148
Fix: Disable "Add Row" button in allocations table during UnReconcile process (backport #44148)
2024-11-15 10:22:43 +05:30
UmakanthKaspa
137ef78d96 fix: correctly set 'cannot_add_rows' property on allocations table field
(cherry picked from commit 13ca2700f8)
2024-11-15 04:47:46 +00:00
ruthra kumar
5452f8ac4a Merge pull request #44139 from frappe/mergify/bp/version-14-hotfix/pr-43189
fix: broken apply on other item (backport #43189)
2024-11-14 13:45:41 +05:30
ruthra kumar
f03e301250 fix: broken apply on other item pricing rule
(cherry picked from commit e5119a749c)
2024-11-14 07:54:10 +00:00
Raffael Meyer
c23868a14d fix: backport german translations from develop (#44046) 2024-11-13 18:17:50 +01:00
Frappe PR Bot
75d785f6b6 chore(release): Bumped to Version 14.76.0
# [14.76.0](https://github.com/frappe/erpnext/compare/v14.75.2...v14.76.0) (2024-11-13)

### Bug Fixes

* Drop Shipping address based on customer shopping address ([ea38a1f](ea38a1f36a))
* exception on register reports when filtered on cost center ([599581e](599581e09d))
* NoneType while updating ordered_qty in SO for removed items ([1446aa3](1446aa3636))
* populate payment schedule from payment terms (backport [#44082](https://github.com/frappe/erpnext/issues/44082)) ([#44084](https://github.com/frappe/erpnext/issues/44084)) ([6b149f5](6b149f5ddf))
* subcontracting receipt has no reference field for purchase order ([b1e205f](b1e205f4d1))
* task path (backport [#44073](https://github.com/frappe/erpnext/issues/44073)) ([#44077](https://github.com/frappe/erpnext/issues/44077)) ([c12d5f6](c12d5f613a))
* tyeerror while saving pick list ([d73cc83](d73cc83b91))
* update per_billed value in Purchase Receipt while creating Debit Note ([#43977](https://github.com/frappe/erpnext/issues/43977)) ([da6c6dc](da6c6dcfcb))

### Features

* Partly billed status in Purchase Receipt ([#39543](https://github.com/frappe/erpnext/issues/39543)) ([3e2fa16](3e2fa16d84))
2024-11-13 15:00:34 +00:00
ruthra kumar
a63a0e0d37 Merge pull request #44102 from frappe/version-14-hotfix
chore: release v14
2024-11-13 20:29:06 +05:30
ruthra kumar
ddac2c59ab Merge pull request #44114 from frappe/mergify/bp/version-14-hotfix/pr-43977
fix: update per_billed value in Purchase Receipt while creating Debit Note (backport #43977)
2024-11-13 19:01:04 +05:30
rohitwaghchaure
030df0d7e8 chore: fix conflicts 2024-11-13 18:27:41 +05:30
NaviN
da6c6dcfcb fix: update per_billed value in Purchase Receipt while creating Debit Note (#43977)
* fix: update per_billed value in Purchase Receipt while creating Debit Note

* test: add unit test for validating per_billed value for partial Debit Note

(cherry picked from commit 494fd7ceea)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
2024-11-13 18:27:41 +05:30
ruthra kumar
cbe92fef0c Merge pull request #44128 from frappe/mergify/bp/version-14-hotfix/pr-39543
feat: Partly billed status in Purchase Receipt (backport #39543)
2024-11-13 18:04:39 +05:30
Deepesh Garg
3e2fa16d84 feat: Partly billed status in Purchase Receipt (#39543)
(cherry picked from commit a673220feb)
2024-11-13 12:13:37 +00:00
ruthra kumar
44988c8bfa Merge pull request #44126 from frappe/mergify/copy/version-14-hotfix/pr-44124
refactor: 'Partly Billed' status for Purchase Receipt (copy #44124)
2024-11-13 17:22:41 +05:30
ruthra kumar
2acee05a0a refactor: 'Partly Billed' status for Purchase Receipt
(cherry picked from commit c58bbd25f2)
2024-11-13 17:00:20 +05:30
Nihantra C. Patel
d258684b8d Merge pull request #44119 from frappe/mergify/bp/version-14-hotfix/pr-44116
fix: Drop Shipping address based on customer shopping address (backport #44116)
2024-11-13 15:51:55 +05:30
Nihantra Patel
ea38a1f36a fix: Drop Shipping address based on customer shopping address
(cherry picked from commit c7499f3528)
2024-11-13 10:01:42 +00:00
ruthra kumar
7fb5f17100 Merge pull request #44087 from frappe/mergify/bp/version-14-hotfix/pr-43695
fix: exception on register reports when filtered on cost center (backport #43695)
2024-11-11 17:05:32 +05:30
ruthra kumar
fd9fd8f46f chore: filter report output 2024-11-11 16:42:42 +05:30
ruthra kumar
558fac6843 chore: use FrappeTestCase 2024-11-11 15:07:46 +05:30
ruthra kumar
71a1e50314 refactor(test): assertion refactoring and exact decimals
(cherry picked from commit 1d11131afe)
2024-11-11 09:18:08 +00:00
ruthra kumar
4f7d534cab refactor(test): pass all mandatory fields
(cherry picked from commit c53e9637dd)
2024-11-11 09:18:08 +00:00
ruthra kumar
a8a89f971d refactor(test): fix incorrect assertion
(cherry picked from commit d6030e7112)
2024-11-11 09:18:07 +00:00
ruthra kumar
964ac05e74 test: journals with cost center
(cherry picked from commit c255f34eea)
2024-11-11 09:18:07 +00:00
ruthra kumar
a98fe7a72b test: basic report output
(cherry picked from commit 657201b324)
2024-11-11 09:18:07 +00:00
Vishv-silveroak
599581e09d fix: exception on register reports when filtered on cost center
1

(cherry picked from commit f01e1a8e20)
2024-11-11 09:18:07 +00:00
mergify[bot]
6b149f5ddf fix: populate payment schedule from payment terms (backport #44082) (#44084)
fix: populate payment schedule from payment terms (#44082)

(cherry picked from commit c81eb6c824)

Co-authored-by: Nihantra C. Patel <141945075+Nihantra-Patel@users.noreply.github.com>
2024-11-11 13:12:39 +05:30
mergify[bot]
f2aa71cd6c chore: update CODEOWNERS (backport #44074) (#44080)
* chore: update `CODEOWNERS` (#44074)

(cherry picked from commit 9a758ea826)

# Conflicts:
#	CODEOWNERS

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-11-11 13:06:26 +05:30
mergify[bot]
c12d5f613a fix: task path (backport #44073) (#44077)
fix: task path (#44073)

(cherry picked from commit 8c99acb1b9)

Co-authored-by: Nihantra C. Patel <141945075+Nihantra-Patel@users.noreply.github.com>
2024-11-11 13:00:43 +05:30
rohitwaghchaure
3df783bfff Merge pull request #44069 from frappe/mergify/bp/version-14-hotfix/pr-44058
fix: type error while saving pick list (backport #44058)
2024-11-11 12:27:00 +05:30
vishnu
d73cc83b91 fix: tyeerror while saving pick list
(cherry picked from commit 22de0ecbdc)
2024-11-11 06:24:53 +00:00
Frappe PR Bot
e46834095b chore(release): Bumped to Version 14.75.2
## [14.75.2](https://github.com/frappe/erpnext/compare/v14.75.1...v14.75.2) (2024-11-08)

### Bug Fixes

* subcontracting receipt has no reference field for purchase order ([1633a31](1633a3176c))
2024-11-08 07:22:01 +00:00
rohitwaghchaure
2f969478e9 Merge pull request #44032 from frappe/mergify/bp/version-14/pr-44014
fix: Subcontracting Receipt has no reference field for Purchase Order (backport #44014)
2024-11-08 12:49:15 +05:30
Ninad1306
1633a3176c fix: subcontracting receipt has no reference field for purchase order
(cherry picked from commit b1e205f4d1)
2024-11-08 06:53:14 +00:00
ruthra kumar
093b4f9845 Merge pull request #44026 from frappe/mergify/bp/version-14-hotfix/pr-43873
fix: add missing fields to field_no_map array (backport #43873)
2024-11-08 11:52:24 +05:30
Ravindu Nethmina
440ada1bdc refactor: add "margin_type" and "margin_rate_or_amount" to no copy
(cherry picked from commit 70f090c1ec)
2024-11-08 06:00:28 +00:00
ruthra kumar
82cd42bbdf Merge pull request #44023 from frappe/mergify/bp/version-14-hotfix/pr-43762
fix: handle NoneType error when updating ordered_qty in SO for remove… (backport #43762)
2024-11-08 11:11:18 +05:30
bhaveshkumar.j
1446aa3636 fix: NoneType while updating ordered_qty in SO for removed items
(cherry picked from commit 442cdd7ce4)
2024-11-08 05:10:39 +00:00
Sagar Vora
0cdb4cb927 Merge pull request #44014 from Ninad1306/dashboard_links 2024-11-07 18:16:06 +05:30
Frappe PR Bot
ea634ec230 chore(release): Bumped to Version 14.75.1
## [14.75.1](https://github.com/frappe/erpnext/compare/v14.75.0...v14.75.1) (2024-11-07)

### Bug Fixes

* ensure list has items ([5c8af85](5c8af85086))
* error when saving POS merge log ([#43989](https://github.com/frappe/erpnext/issues/43989)) ([657bd37](657bd3712b))
* removed single quotes from deferred revenue ([#43985](https://github.com/frappe/erpnext/issues/43985)) ([aee8a23](aee8a23626))
* serial no ledger report ([#44006](https://github.com/frappe/erpnext/issues/44006)) ([9838eaa](9838eaa332))
* task showing limit in customer portal (backport [#44003](https://github.com/frappe/erpnext/issues/44003)) ([#44004](https://github.com/frappe/erpnext/issues/44004)) ([bc9f0f8](bc9f0f8368))
2024-11-07 12:44:44 +00:00
Sagar Vora
33a9c5e88d Merge pull request #44007 from frappe/version-14-hotfix 2024-11-07 18:13:19 +05:30
Ninad1306
b1e205f4d1 fix: subcontracting receipt has no reference field for purchase order 2024-11-07 16:34:14 +05:30
rohitwaghchaure
9838eaa332 fix: serial no ledger report (#44006) 2024-11-07 13:12:46 +05:30
mergify[bot]
bc9f0f8368 fix: task showing limit in customer portal (backport #44003) (#44004)
fix: task showing limit in customer portal (#44003)

(cherry picked from commit 44832c3b5c)

Co-authored-by: Nihantra C. Patel <141945075+Nihantra-Patel@users.noreply.github.com>
2024-11-07 12:49:42 +05:30
Sagar Vora
478b49cc49 Merge pull request #43994 from frappe/mergify/bp/version-14-hotfix/pr-43993
fix: ensure list has items (backport #43993)
2024-11-06 14:08:21 +05:30
Sagar Vora
5c8af85086 fix: ensure list has items
(cherry picked from commit e13e688987)
2024-11-06 08:37:20 +00:00
Sagar Vora
876af6dca5 Merge pull request #43990 from frappe/mergify/bp/version-14-hotfix/pr-43989
fix: error when saving POS merge log (backport #43989)
2024-11-06 13:26:09 +05:30
Sagar Vora
657bd3712b fix: error when saving POS merge log (#43989)
(cherry picked from commit c62596b323)
2024-11-06 07:52:12 +00:00
Sagar Vora
0a166a813a Merge pull request #43988 from frappe/mergify/bp/version-14-hotfix/pr-43985
fix: removed single quotes from deferred revenue (backport #43985)
2024-11-06 12:08:14 +05:30
Nihantra C. Patel
aee8a23626 fix: removed single quotes from deferred revenue (#43985)
(cherry picked from commit 834d18840c)
2024-11-06 06:37:02 +00:00
Frappe PR Bot
710771edf4 chore(release): Bumped to Version 14.75.0
# [14.75.0](https://github.com/frappe/erpnext/compare/v14.74.8...v14.75.0) (2024-11-06)

### Bug Fixes

* SO link on PO and add in missing dashboard references on both ([4f8a8a5](4f8a8a5e99))

### Features

* remove Payroll Entry from Bank Account dashboard (backport [#43931](https://github.com/frappe/erpnext/issues/43931)) ([#43932](https://github.com/frappe/erpnext/issues/43932)) ([42c2b84](42c2b84b28))

### Performance Improvements

* too many writes error during reposting (backport [#43978](https://github.com/frappe/erpnext/issues/43978)) ([#43982](https://github.com/frappe/erpnext/issues/43982)) ([57d35ec](57d35ec20e))
2024-11-06 05:11:31 +00:00
ruthra kumar
e6b97cad89 Merge pull request #43974 from frappe/version-14-hotfix
chore: release v14
2024-11-06 10:40:10 +05:30
mergify[bot]
57d35ec20e perf: too many writes error during reposting (backport #43978) (#43982)
perf: too many writes error during reposting (#43978)

perf: too many writes error
(cherry picked from commit 134c24b9c5)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-11-06 10:05:36 +05:30
ruthra kumar
1e2bea82f9 Merge pull request #43964 from frappe/mergify/bp/version-14-hotfix/pr-43388
fix: SO link on PO and add in missing dashboard references on both (backport #43388)
2024-11-04 15:34:04 +05:30
ruthra kumar
0f4c5dd26c chore: resolve conflicts
Stock Reservation Entry is unavailable in v14
2024-11-04 14:17:04 +05:30
CaseSolved
7906c21bdf chore: linting
(cherry picked from commit be6970c850)
2024-11-04 08:32:22 +00:00
CaseSolved
4f8a8a5e99 fix: SO link on PO and add in missing dashboard references on both
(cherry picked from commit 2017fd80d1)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py
#	erpnext/selling/doctype/sales_order/sales_order_dashboard.py
2024-11-04 08:32:22 +00:00
mergify[bot]
42c2b84b28 feat: remove Payroll Entry from Bank Account dashboard (backport #43931) (#43932)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2024-10-30 15:49:21 +01:00
Frappe PR Bot
80f2f5cd2f chore(release): Bumped to Version 14.74.8
## [14.74.8](https://github.com/frappe/erpnext/compare/v14.74.7...v14.74.8) (2024-10-30)

### Bug Fixes

* add company filter for project ([d3e29fe](d3e29fe828))
* add parenttype clause to invoice tax query in sales_register report ([cbe704c](cbe704c73c))
* added validation for UOM must be whole number (backport [#43710](https://github.com/frappe/erpnext/issues/43710)) ([#43711](https://github.com/frappe/erpnext/issues/43711)) ([aaae81f](aaae81f7e8))
* basic rate not editable in Stock Entry Detail (backport [#43837](https://github.com/frappe/erpnext/issues/43837)) ([#43839](https://github.com/frappe/erpnext/issues/43839)) ([51c1d03](51c1d032ba))
* calculate tds with net amount when invoice exceeds single threshold amount (backport [#43869](https://github.com/frappe/erpnext/issues/43869)) ([#43919](https://github.com/frappe/erpnext/issues/43919)) ([55c5f30](55c5f30d54))
* do not check for payment terms details for return invoices. ([fd63ace](fd63ace6c7))
* do not set payment terms for return invoices ([bd34a67](bd34a67871))
* get stock accounts from the doc instead of db in validate_stock_accounts ([ad04610](ad04610c94))
* hide payment terms for return and paid purchase invoices ([78db8c0](78db8c0029))
* not able to submit stock entry ([#43890](https://github.com/frappe/erpnext/issues/43890)) ([0742e6e](0742e6e193))
* purchase return validation issue ([#43871](https://github.com/frappe/erpnext/issues/43871)) ([a7cc7b2](a7cc7b28c0))
* remarks field in payment reconciliation ([93243b1](93243b1d95))
* **RFQ:** make strings translatable (backport [#43843](https://github.com/frappe/erpnext/issues/43843)) ([#43847](https://github.com/frappe/erpnext/issues/43847)) ([895f1bf](895f1bff01))
* set bill_no before `against_voucher` gets concatenated ([2f3c3d5](2f3c3d5519))
* work order finish button not showing (backport [#43875](https://github.com/frappe/erpnext/issues/43875)) ([#43877](https://github.com/frappe/erpnext/issues/43877)) ([76530de](76530de786))
2024-10-30 09:52:54 +00:00
ruthra kumar
4e85a79e42 Merge pull request #43892 from frappe/version-14-hotfix
chore: release v14
2024-10-30 15:21:35 +05:30
mergify[bot]
55c5f30d54 fix: calculate tds with net amount when invoice exceeds single threshold amount (backport #43869) (#43919)
* fix: calculate tds with net amount when invoice exceeds single threshold amount

(cherry picked from commit ef694a40a1)

* test: add unit test to validate purchase invoice exceeding single threshold value

(cherry picked from commit 94badb464d)

---------

Co-authored-by: venkat102 <venkatesharunachalam659@gmail.com>
2024-10-30 11:26:08 +05:30
ruthra kumar
cc85f5de26 Merge pull request #43916 from frappe/mergify/bp/version-14-hotfix/pr-43886
fix: remarks field in payment reconciliation (backport #43886)
2024-10-30 10:51:39 +05:30
ruthra kumar
15881ea718 chore: resolve conflicts 2024-10-30 10:30:48 +05:30
Ahmed Shareef
93243b1d95 fix: remarks field in payment reconciliation
(cherry picked from commit 2d5b079949)

# Conflicts:
#	erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.json
#	erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.py
2024-10-30 04:50:23 +00:00
mergify[bot]
76530de786 fix: work order finish button not showing (backport #43875) (#43877)
* fix: work order finish button not showing (#43875)

(cherry picked from commit 0a70be5b99)

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

* chore: fix conflicts

* chore: fix conflicts

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-10-29 22:00:36 +05:30
ruthra kumar
d04396b697 Merge pull request #43896 from frappe/mergify/bp/version-14-hotfix/pr-43856
fix: add parenttype clause to invoice tax query in sales_register report (backport #43856)
2024-10-29 16:12:46 +05:30
ruthra kumar
e552df31d6 Merge pull request #43894 from frappe/mergify/bp/version-14-hotfix/pr-43698
fix: Project name instead of ID in chart (backport #43698)
2024-10-29 16:12:32 +05:30
Imesha Sudasingha
cbe704c73c fix: add parenttype clause to invoice tax query in sales_register report
(cherry picked from commit e30ab141f4)
2024-10-29 10:10:37 +00:00
rohitwaghchaure
0742e6e193 fix: not able to submit stock entry (#43890) 2024-10-29 15:35:19 +05:30
lukas.brandhoff
3fa392ebdf refactor: include 'Project Name' in Project summary report
Keep name field for backwards compatibility

(cherry picked from commit 736d1a1105)
2024-10-29 09:54:26 +00:00
ruthra kumar
a3c2121870 Merge pull request #43863 from frappe/mergify/bp/version-14-hotfix/pr-43685
fix: do not check for payment terms details for return invoices. (backport #43685)
2024-10-28 15:53:06 +05:30
mergify[bot]
aaae81f7e8 fix: added validation for UOM must be whole number (backport #43710) (#43711)
* fix: added validation for UOM must be whole number (#43710)

(cherry picked from commit 4fd4a37dc9)

# Conflicts:
#	erpnext/controllers/accounts_controller.py

* chore: fix conflicts

* chore: fix linters issue

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-10-28 15:12:16 +05:30
rohitwaghchaure
a7cc7b28c0 fix: purchase return validation issue (#43871) 2024-10-28 15:11:07 +05:30
mergify[bot]
51c1d032ba fix: basic rate not editable in Stock Entry Detail (backport #43837) (#43839)
* fix: basic rate not editable in Stock Entry Detail (#43837)

(cherry picked from commit 5a967bc868)

# Conflicts:
#	erpnext/stock/doctype/stock_entry/stock_entry.js

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-10-28 14:02:23 +05:30
ruthra kumar
c695959902 chore: resolve conflicts 2024-10-28 13:32:30 +05:30
ruthra kumar
83f5a24520 Merge pull request #43868 from frappe/mergify/bp/version-14-hotfix/pr-43862
refactor: fix garbage title, desc and name in razorpay (backport #43862)
2024-10-28 12:47:42 +05:30
ruthra kumar
627832fe5b refactor: fix garbage title, desc and name in razorpay
(cherry picked from commit 7332ec8fbd)
2024-10-28 06:55:08 +00:00
ljain112
78db8c0029 fix: hide payment terms for return and paid purchase invoices
(cherry picked from commit 912e1e3f3d)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
2024-10-28 05:53:55 +00:00
ljain112
bd34a67871 fix: do not set payment terms for return invoices
(cherry picked from commit 8b700eadc7)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.js
2024-10-28 05:53:54 +00:00
ljain112
fd63ace6c7 fix: do not check for payment terms details for return invoices.
(cherry picked from commit 6703b7d1ae)
2024-10-28 05:53:54 +00:00
ruthra kumar
36fdd540c0 Merge pull request #43858 from frappe/mergify/bp/version-14-hotfix/pr-43833
refactor: query for expense_account moved to setup hook in purchase invoice (backport #43833)
2024-10-28 09:59:55 +05:30
ruthra kumar
b81dc2bf5e chore: resolve conflict 2024-10-28 09:55:04 +05:30
ljain112
7e7cc807a5 refactor: query for expense_account moved to setup hook in purchase invoice
(cherry picked from commit a9ac0cc223)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
2024-10-28 04:14:14 +00:00
mergify[bot]
895f1bff01 fix(RFQ): make strings translatable (backport #43843) (#43847)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
fix(RFQ): make strings translatable (#43843)
2024-10-26 19:51:31 +02:00
ruthra kumar
53c4b5f752 Merge pull request #43832 from frappe/mergify/bp/version-14-hotfix/pr-43830
fix: set bill_no before `against_voucher` gets concatenated (backport #43830)
2024-10-25 14:28:44 +05:30
ruthra kumar
2f3c3d5519 fix: set bill_no before against_voucher gets concatenated
(cherry picked from commit 7bade7f1fe)
2024-10-25 14:05:15 +05:30
ruthra kumar
6ddff1b168 Merge pull request #43806 from frappe/mergify/bp/version-14-hotfix/pr-43755
fix: Add Company Filter (backport #43755)
2024-10-23 17:57:42 +05:30
IamSaiyyamChhetri
d3e29fe828 fix: add company filter for project
- In Project dt Sales Order field
- In Sales Order dt Project field

(cherry picked from commit 9909d760a5)
2024-10-23 17:31:44 +05:30
Smit Vora
3ace876c1f Merge pull request #43784 from frappe/mergify/bp/version-14-hotfix/pr-43462
fix: get stock accounts from the doc in `validate_stock_accounts` in Journal Entry (backport #43462)
2024-10-23 10:36:30 +05:30
Frappe PR Bot
8c7ed37afd chore(release): Bumped to Version 14.74.7
## [14.74.7](https://github.com/frappe/erpnext/compare/v14.74.6...v14.74.7) (2024-10-23)

### Bug Fixes

* "show_remarks" checkbox in Process statement of accounts ([0833823](083382399f))
* coupon code validation logic ([c18beae](c18beaea6b))
* **deferred_revenue:** Escape account in query ([3d082c9](3d082c93bc))
* Freeze Screen on load invoices on POS Closing Entry ([725b6be](725b6beff3))
* get period estimate till service end date ([35c257a](35c257a7ae))
* incorrect amount in bank clearance ([98362d9](98362d9183))
* party_balance based on company in payment entry ([5333f33](5333f33c21))
* remove extra space ([719565c](719565c897))
* use correct variable in error message (backport [#43790](https://github.com/frappe/erpnext/issues/43790)) ([#43791](https://github.com/frappe/erpnext/issues/43791)) ([5b0a8fd](5b0a8fd2ce))
2024-10-23 04:45:56 +00:00
ruthra kumar
9da08df3ca Merge pull request #43773 from frappe/version-14-hotfix
chore: release v14
2024-10-23 10:14:40 +05:30
mergify[bot]
5b0a8fd2ce fix: use correct variable in error message (backport #43790) (#43791)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
fix: use correct variable in error message (#43790)
2024-10-22 19:43:13 +02:00
Sagar Vora
f5f6c7609a test: fix test case 2024-10-22 20:27:06 +05:30
Vishakh Desai
ad04610c94 fix: get stock accounts from the doc instead of db in validate_stock_accounts
(cherry picked from commit 30954586d8)
2024-10-22 14:07:06 +00:00
ruthra kumar
1a4a329c1d Merge pull request #43779 from frappe/mergify/bp/version-14-hotfix/pr-43778
refactor: validate_return_against_account (backport #43778)
2024-10-22 17:36:37 +05:30
Raffael Meyer
411f7c3a2c refactor: validate_return_against_account (#43778)
(cherry picked from commit c4faa0e101)
2024-10-22 11:45:49 +00:00
ruthra kumar
c55d473c92 Merge pull request #43776 from frappe/mergify/bp/version-14-hotfix/pr-43775
fix(deferred_revenue): Escape account in query (backport #43775)
2024-10-22 16:40:02 +05:30
Corentin Forler
3d082c93bc fix(deferred_revenue): Escape account in query
(cherry picked from commit c7b3ae41d4)
2024-10-22 10:42:08 +00:00
ruthra kumar
a3e8cc6abe Merge pull request #43767 from frappe/mergify/bp/version-14-hotfix/pr-43766
refactor: allow unreconcile on bank and cash entry type journals (backport #43766)
2024-10-22 12:12:52 +05:30
ruthra kumar
0dcb5a4fbb refactor: allow unreconcile on bank and cash entry type journals
(cherry picked from commit 2c4f37f488)
2024-10-22 06:35:37 +00:00
ruthra kumar
14a589eb2f Merge pull request #43764 from frappe/mergify/bp/version-14-hotfix/pr-43761
fix: coupon code validation logic (backport #43761)
2024-10-22 10:39:10 +05:30
ruthra kumar
2af36383cc chore: resolve conflict 2024-10-22 10:16:57 +05:30
bhaveshkumar.j
719565c897 fix: remove extra space
(cherry picked from commit 1561a9e1bf)
2024-10-22 04:37:48 +00:00
bhaveshkumar.j
c18beaea6b fix: coupon code validation logic
(cherry picked from commit d04257a32d)

# Conflicts:
#	erpnext/accounts/doctype/pricing_rule/utils.py
2024-10-22 04:37:48 +00:00
ruthra kumar
3d5c15df0a Merge pull request #43741 from frappe/mergify/bp/version-14-hotfix/pr-43726
fix: "show_remarks" checkbox in Process statement of accounts (backport #43726)
2024-10-21 13:09:04 +05:30
ruthra kumar
0cf172c0da Merge pull request #43743 from frappe/mergify/bp/version-14-hotfix/pr-43727
fix: get period estimate till service end date (backport #43727)
2024-10-21 13:08:44 +05:30
ruthra kumar
5289022351 Merge pull request #43745 from frappe/mergify/bp/version-14-hotfix/pr-43720
fix: party_balance based on company in payment entry (backport #43720)
2024-10-21 13:08:22 +05:30
ruthra kumar
bbce58524e Merge pull request #43747 from frappe/mergify/bp/version-14-hotfix/pr-42461
fix: Freeze Screen on load invoices on POS Closing Entry (backport #42461)
2024-10-21 13:08:02 +05:30
HarryPaulo
725b6beff3 fix: Freeze Screen on load invoices on POS Closing Entry
(cherry picked from commit 486d396174)
2024-10-21 06:57:51 +00:00
ljain112
5333f33c21 fix: party_balance based on company in payment entry
(cherry picked from commit 97c9adf06b)
2024-10-21 06:53:31 +00:00
ruthra kumar
beb5318446 chore: resolve conflict 2024-10-21 12:21:51 +05:30
venkat102
35c257a7ae fix: get period estimate till service end date
(cherry picked from commit a7ba7e9c28)
2024-10-21 06:50:26 +00:00
ljain112
083382399f fix: "show_remarks" checkbox in Process statement of accounts
(cherry picked from commit f4600df1f7)

# Conflicts:
#	erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py
2024-10-21 06:44:35 +00:00
ruthra kumar
a05d6de2be Merge pull request #43716 from frappe/mergify/bp/version-14-hotfix/pr-42898
fix: incorrect amount in bank clearance (backport #42898)
2024-10-18 11:01:11 +05:30
NIYAZ RAZAK
98362d9183 fix: incorrect amount in bank clearance
(cherry picked from commit 9a11df59fc)
2024-10-18 10:37:17 +05:30
Frappe PR Bot
e401ad5b8f chore(release): Bumped to Version 14.74.6
## [14.74.6](https://github.com/frappe/erpnext/compare/v14.74.5...v14.74.6) (2024-10-16)

### Bug Fixes

* added parentheses for correct query formation for logical OR condition ([0f738de](0f738de5e5))
* added string for translation in bank reconciliation statement ([32f6eb7](32f6eb7ee7))
* conversion factor issue (backport [#43645](https://github.com/frappe/erpnext/issues/43645)) ([#43675](https://github.com/frappe/erpnext/issues/43675)) ([1262c32](1262c322d1))
* delete invalid pricing rule on change of applicable_for ([c7c2bdd](c7c2bdd159))
* ignore free item when qty is zero ([ae47fb9](ae47fb9617))
* missing child company accounts in consolidated balance sheet ([bb774ce](bb774cec58))
* removed unused query ([dcbfd4a](dcbfd4ae1d))
* run gl_entries and closing voucher processes in same function ([59c314c](59c314c98a))
* update formatings ([a8ad608](a8ad608fd8))
* update formatings ([699b098](699b09846a))
* update item details with actual quantity. ([c520a7c](c520a7c6c1))
* Use `ref_doc.get()` for `party_account_currency` ([01d6c10](01d6c1081b))
* validation for corrective job card (backport [#43555](https://github.com/frappe/erpnext/issues/43555)) (backport [#43558](https://github.com/frappe/erpnext/issues/43558)) ([#43628](https://github.com/frappe/erpnext/issues/43628)) ([1f09975](1f099752d2))
* zero incoming rate for delivery note return ([#43642](https://github.com/frappe/erpnext/issues/43642)) ([7eac9cc](7eac9cc1db))
2024-10-16 05:02:55 +00:00
ruthra kumar
9106c2fdd8 Merge pull request #43668 from frappe/version-14-hotfix
chore: release v14
2024-10-16 10:31:35 +05:30
ruthra kumar
2e6ead30e0 Merge pull request #43683 from frappe/mergify/bp/version-14-hotfix/pr-43661
fix: missing child company accounts in consolidated balance sheet (backport #43661)
2024-10-15 17:38:11 +05:30
ruthra kumar
70050081ff Merge pull request #43681 from frappe/mergify/bp/version-14-hotfix/pr-43663
fix: run gl_entries and closing voucher processes in same function (backport #43663)
2024-10-15 17:28:04 +05:30
ljain112
bb774cec58 fix: missing child company accounts in consolidated balance sheet
(cherry picked from commit 7fae9d57d2)
2024-10-15 11:37:52 +00:00
ruthra kumar
7c549e60d6 Merge pull request #43679 from frappe/mergify/bp/version-14-hotfix/pr-43602
fix: added parentheses for correct query formation for logical OR condition (backport #43602)
2024-10-15 17:07:17 +05:30
ljain112
59c314c98a fix: run gl_entries and closing voucher processes in same function
(cherry picked from commit af4daa5b0f)
2024-10-15 11:35:55 +00:00
ljain112
0f738de5e5 fix: added parentheses for correct query formation for logical OR condition
(cherry picked from commit c0da8f11f7)
2024-10-15 11:15:40 +00:00
ruthra kumar
8701cb73ef Merge pull request #43677 from frappe/mergify/bp/version-14-hotfix/pr-43600
fix: added string for translation in bank reconciliation statement (backport #43600)
2024-10-15 16:40:53 +05:30
ljain112
32f6eb7ee7 fix: added string for translation in bank reconciliation statement
(cherry picked from commit c99d9f7037)
2024-10-15 11:02:29 +00:00
mergify[bot]
1262c322d1 fix: conversion factor issue (backport #43645) (#43675)
fix: conversion factor issue (#43645)

(cherry picked from commit a52756f1d4)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-10-15 16:08:37 +05:30
ruthra kumar
aa85c3abee Merge pull request #43669 from frappe/mergify/bp/version-14-hotfix/pr-43557
fix: delete invalid pricing rule on change of applicable_for values (backport #43557)
2024-10-15 15:56:29 +05:30
ljain112
5d9474c98c test: added test for change in applicable_for_value in promotional scheme
(cherry picked from commit 2613bdd868)
2024-10-15 09:55:31 +00:00
ljain112
c7c2bdd159 fix: delete invalid pricing rule on change of applicable_for
(cherry picked from commit 42746fc630)
2024-10-15 09:55:31 +00:00
ruthra kumar
1913caf2b0 Merge pull request #43665 from frappe/mergify/bp/version-14-hotfix/pr-43662
fix: removed unused query (backport #43662)
2024-10-15 13:55:52 +05:30
ruthra kumar
5aff4242e3 Merge pull request #43657 from frappe/mergify/bp/version-14-hotfix/pr-43570
fix: update item details with actual quantity (backport #43570)
2024-10-15 13:52:23 +05:30
ruthra kumar
e7f630fc74 chore: resolve conflict 2024-10-15 13:34:37 +05:30
ruthra kumar
9697cb066c Merge pull request #43659 from frappe/mergify/bp/version-14-hotfix/pr-43642
fix: zero incoming rate for delivery note return (backport #43642)
2024-10-15 13:26:03 +05:30
ruthra kumar
be78e17e8c chore: resolve conflict 2024-10-15 13:25:14 +05:30
ljain112
dcbfd4ae1d fix: removed unused query
(cherry picked from commit 5f590ddfa2)

# Conflicts:
#	erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py
2024-10-15 07:53:40 +00:00
rohitwaghchaure
a585a7029f chore: fix conflicts 2024-10-15 12:08:24 +05:30
rohitwaghchaure
7eac9cc1db fix: zero incoming rate for delivery note return (#43642)
(cherry picked from commit 6087a57b0c)

# Conflicts:
#	erpnext/stock/doctype/delivery_note/test_delivery_note.py
2024-10-15 06:28:36 +00:00
Bhavan23
a8ad608fd8 fix: update formatings
(cherry picked from commit 5044297321)
2024-10-15 06:27:42 +00:00
Bhavan23
699b09846a fix: update formatings
(cherry picked from commit 5f4a523340)

# Conflicts:
#	erpnext/selling/doctype/sales_order/sales_order.py
2024-10-15 06:27:41 +00:00
Bhavan23
dc2483bb92 test: Validate the actual quantity when creating a material request from the sales order
(cherry picked from commit 17fdd42645)
2024-10-15 06:27:41 +00:00
Bhavan23
c520a7c6c1 fix: update item details with actual quantity.
(cherry picked from commit 9dbdfec9b7)
2024-10-15 06:27:40 +00:00
ruthra kumar
475c9b8450 Merge pull request #43653 from frappe/mergify/bp/version-14-hotfix/pr-43601
refactor: remove 'format:' based naming (backport #43601)
2024-10-15 07:34:49 +05:30
ruthra kumar
2cce2cfdbe Merge pull request #43649 from frappe/mergify/bp/version-14-hotfix/pr-43614
fix: ignore free item when qty is zero (backport #43614)
2024-10-15 06:01:44 +05:30
ruthra kumar
065465626e chore: resolve conflict 2024-10-15 06:00:47 +05:30
venkat102
fc7207bcd3 refactor: remove 'format:' based naming
(cherry picked from commit e8e1ec0e85)

# Conflicts:
#	erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.json
2024-10-14 15:45:57 +00:00
Ninad1306
3b1f0c191e test: test case to validate free item is ignored when qty is zero
(cherry picked from commit a2b41a0c16)
2024-10-14 10:51:00 +00:00
Ninad1306
ae47fb9617 fix: ignore free item when qty is zero
(cherry picked from commit 7ae98f77ee)
2024-10-14 10:51:00 +00:00
Smit Vora
16d9ca72e8 Merge pull request #43640 from frappe/mergify/bp/version-14-hotfix/pr-43638
fix: Use `ref_doc.get()` for `party_account_currency` (backport #43638)
2024-10-14 13:59:05 +05:30
Abdeali Chharchhoda
01d6c1081b fix: Use ref_doc.get() for party_account_currency
(cherry picked from commit b79549422a)
2024-10-14 06:09:08 +00:00
Frappe PR Bot
7404911940 chore(release): Bumped to Version 14.74.5
## [14.74.5](https://github.com/frappe/erpnext/compare/v14.74.4...v14.74.5) (2024-10-12)

### Bug Fixes

* validation for corrective job card (backport [#43555](https://github.com/frappe/erpnext/issues/43555)) (backport [#43558](https://github.com/frappe/erpnext/issues/43558)) ([#43628](https://github.com/frappe/erpnext/issues/43628)) ([ea0f044](ea0f044c48))
2024-10-12 15:51:49 +00:00
rohitwaghchaure
136adcb793 Merge pull request #43629 from frappe/mergify/bp/version-14/pr-43628
fix: validation for corrective job card (backport #43555) (backport #43558) (backport #43628)
2024-10-12 21:20:29 +05:30
mergify[bot]
ea0f044c48 fix: validation for corrective job card (backport #43555) (backport #43558) (#43628)
fix: validation for corrective job card (backport #43555) (#43558)

* fix: validation for corrective job card (#43555)

(cherry picked from commit 7a0a893d08)

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

* chore: fix conflicts

* chore: fix linters issue

---------

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 1f099752d2)
2024-10-12 13:04:35 +00:00
mergify[bot]
1f099752d2 fix: validation for corrective job card (backport #43555) (backport #43558) (#43628)
fix: validation for corrective job card (backport #43555) (#43558)

* fix: validation for corrective job card (#43555)

(cherry picked from commit 7a0a893d08)

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

* chore: fix conflicts

* chore: fix linters issue

---------

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-10-12 18:32:30 +05:30
Frappe PR Bot
e9dbbbe324 chore(release): Bumped to Version 14.74.4
## [14.74.4](https://github.com/frappe/erpnext/compare/v14.74.3...v14.74.4) (2024-10-10)

### Bug Fixes

* add parenttype condition for item table in Purchase Register Report ([4586f03](4586f03bdc))
* Add removed test code `b41f10c1b9` ([8f5c191](8f5c191136))
* create Account Closing Balance even though there are no transaction in period ([2fc776d](2fc776d0f5))
* deduct advances adjusted for threshold check for tcs ([de15728](de15728741))
* do not include advances for tds vouchers ([9d950a9](9d950a9b77))
* get company from ref doc as it's not available in payment request ([078eb46](078eb46eb8))
* multiple issues in Payment Request ([#42427](https://github.com/frappe/erpnext/issues/42427)) ([ef52be2](ef52be2f17))
* Remove `advance_payment_status` uses ([36b4f68](36b4f68566))
* Remove unreference method ([d4421da](d4421dade1))
* Remove unused  field ([3a51cf4](3a51cf4e1a))
* Remove unused function `get_paid_amount_against_order` ([677aadd](677aadde7c))
* Separate `on_submit` and `before_submit` of PR ([d828ea6](d828ea6a1a))
2024-10-10 00:48:02 +00:00
ruthra kumar
4b1e3c96c2 Merge pull request #43562 from frappe/version-14-hotfix
chore: release v14
2024-10-10 06:16:42 +05:30
Sagar Vora
8714ec608b Merge pull request #43571 from frappe/mergify/bp/version-14-hotfix/pr-43271
fix: deduct advances adjusted for threshold check for tcs (backport #43271)
2024-10-09 18:38:07 +05:30
Sagar Vora
e7518414cb Merge pull request #43595 from ljain112/fix-pr-43271 2024-10-09 17:44:37 +05:30
ljain112
d5c82ccbab test: fixed account settings in test case 2024-10-09 17:34:59 +05:30
ljain112
f5a7c8b0b0 test: added test cases for the tcs deduction for advances adjusted.
(cherry picked from commit efe238cefd)
2024-10-08 12:05:48 +00:00
ljain112
de15728741 fix: deduct advances adjusted for threshold check for tcs
(cherry picked from commit 767c8f92be)
2024-10-08 12:05:48 +00:00
Smit Vora
d6f9909ba5 Merge pull request #43552 from frappe/mergify/bp/version-14-hotfix/pr-43397
fix: do not include advances for tds vouchers (backport #43397)
2024-10-08 11:29:48 +05:30
ljain112
9d950a9b77 fix: do not include advances for tds vouchers
(cherry picked from commit 7ef918421e)
2024-10-08 05:09:01 +00:00
Smit Vora
0336e7ac45 Merge pull request #43529 from frappe/mergify/bp/version-14-hotfix/pr-43407
fix: multiple issues in Payment Request (backport #43407)
2024-10-08 10:38:50 +05:30
Smit Vora
078eb46eb8 fix: get company from ref doc as it's not available in payment request 2024-10-07 22:55:58 +05:30
Smit Vora
1d21f428c1 Merge pull request #43526 from frappe/mergify/bp/version-14-hotfix/pr-43391
fix: create Account Closing Balance even though there are no transaction in period (backport #43391)
2024-10-07 22:34:37 +05:30
Smit Vora
71ee88dc79 Merge pull request #43524 from frappe/mergify/bp/version-14-hotfix/pr-43384
fix: add parenttype condition for item table in Purchase Register Report (backport #43384)
2024-10-07 22:34:23 +05:30
Smit Vora
f6b91969b2 chore: resolve conflicts, remove additional new fields 2024-10-07 22:31:49 +05:30
Smit Vora
3f5f37fa73 chore: resolve conflicts visible prima-facie 2024-10-07 22:15:26 +05:30
Smit Vora
d4258fff9d chore: remove unused filed
(cherry picked from commit 0c599c2b6d)
2024-10-07 16:17:06 +00:00
Abdeali Chharchhoda
54608bdff9 test: Change Accounts Settings for multi currency (https://github.com/frappe/erpnext/pull/42427#discussion_r1789859737)
(cherry picked from commit 62cc86114b)
2024-10-07 16:17:05 +00:00
Abdeali Chharchhoda
4d00d2b87b test: Remove Payment Gateway settings from test
(cherry picked from commit 3d9d56ab50)
2024-10-07 16:17:05 +00:00
Abdeali Chharchhoda
d828ea6a1a fix: Separate on_submit and before_submit of PR
(cherry picked from commit dbd7b83204)
2024-10-07 16:17:05 +00:00
Abdeali Chharchhoda
677aadde7c fix: Remove unused function get_paid_amount_against_order
(cherry picked from commit 75916629c8)
2024-10-07 16:17:04 +00:00
Abdeali Chharchhoda
3a51cf4e1a fix: Remove unused field
(cherry picked from commit e785928c0f)

# Conflicts:
#	erpnext/accounts/doctype/payment_request/payment_request.json
2024-10-07 16:17:04 +00:00
Abdeali Chharchhoda
7d0a094515 test: Removed initial PR status assertion
(cherry picked from commit 67bd540135)
2024-10-07 16:17:03 +00:00
Abdeali Chharchhoda
8f5c191136 fix: Add removed test code b41f10c1b9
(cherry picked from commit 30fd11f138)
2024-10-07 16:17:02 +00:00
Abdeali Chharchhoda
d4421dade1 fix: Remove unreference method
(cherry picked from commit 770bc1c293)
2024-10-07 16:17:02 +00:00
Abdeali Chharchhoda
36b4f68566 fix: Remove advance_payment_status uses
(cherry picked from commit 907e3af1b0)
2024-10-07 16:17:02 +00:00
Abdeali Chharchhodawala
ef52be2f17 fix: multiple issues in Payment Request (#42427)
* fix: multiple issues in Payment Request

* chore: minor changes

* fix: remove  bug

* fix: replace `round` with `flt`

* fix: update `set_advance_payment_status()` logic

* fix: removed bug of `set_advance_payment_status`

* fix: changes as per review

* refactor: replace sql query of `matched_payment_requests` to query builder

* fix: replace `locals` with `get_doc` in set_query

* fix: changes during review

* fix: minor review changes

* fix: remove unnecessary code for setting payment entry received amount

* fix: logic for ser payment_request if PE made from transaction

* fix: Use rounded total to make Payment Request from `Sales Invoice` or `Purchase Invoice`

* refactor: enhance logic of `set_open_payment_requests_to_references`

* fix: added one optional arg `created_from_payment_request`

* fix: handle multiple allocation of PR at PE's reference

* fix: logic for PR if outstanding docs fetch

* fix: formatted Link field for `Payment Request` for PE's references

* fix: replace `get_all()` with `get_list()` for getting Payment Request for Link field

* fix: replace `get_all()` with `get_list()` for getting Payment Request for Link field

* chore: format `payment_entry.js` file

* style: Show preview popup of `Payment Request`

* fix: remove minor bug

* fix: add virtual field for Payment Term and Request `outstanding_amount` in PE's reference

* fix: get outstanding amount in PE's reference on realtime

* fix: move allocation of allocated_amount to server side (no change)

* fix: some minor changes to allocation

* fix: Split `Payment Request` if PE is created from PR and there are `Payment Terms`

* fix: minor logic changes

* fix: Allocation of allocated_amount if `paid_amount` is changes

* fix: improve logic of allocation

* fix: set matched payment request if unset

* fix: minor changes

* fix: Allocate single Payment Request if PE created from PR

* fix: improve code logic

* fix: Removed duplication code

* fix: proper message title

* refactor: Rename method of Allocation Amount to References

* refactor: Changing `grand_total` description based on `party_type`

* refactor: update Payment Request

* fix: Remove virtual property of payment_term_oustanding from references

* fix: fetch party account currency for creating payment request

* fix: use transaction currency as base in payment request

* fix: party amount for creating payment entry

* fix: allow for proportional amount paid by bank

* fix: Changed field order in Payment Request

* fix: Minor refactor in Payment Entry Reference table data

* test: Added test cases for allow Payment at `Partially Paid` status for PR

* test: Update partial paid status test case

* test: Update test case for same currency PR

* refactor: Wider the `msgprint` dialog for after save PE

* test: Update PR test cases

* chore: Remove dirty lines

* test: Checking `Advance Payment Status`

* fix: formatting update

* fix: Use `flt` where doing subtraction

* test: PR test case with Payment Term for same currency

* fix: remove redundant `flt`

* test: Add test cases for PR

---------

Co-authored-by: Sagar Vora <sagar@resilient.tech>
(cherry picked from commit ea69ba7cd8)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.js
#	erpnext/accounts/doctype/payment_entry/payment_entry.py
#	erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json
#	erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.py
#	erpnext/accounts/doctype/payment_request/payment_request.json
#	erpnext/accounts/doctype/payment_request/payment_request.py
2024-10-07 16:17:01 +00:00
ljain112
2fc776d0f5 fix: create Account Closing Balance even though there are no transaction in period
(cherry picked from commit 43deaea96b)
2024-10-07 16:12:19 +00:00
ljain112
4586f03bdc fix: add parenttype condition for item table in Purchase Register Report
(cherry picked from commit 28abf191fc)
2024-10-07 15:55:42 +00:00
Frappe PR Bot
96cb08dba8 chore(release): Bumped to Version 14.74.3
## [14.74.3](https://github.com/frappe/erpnext/compare/v14.74.2...v14.74.3) (2024-10-04)

### Bug Fixes

* add company filter in Warehouse wise Item Balance Age and Value ([3cb8502](3cb85028d0))
* adjustmen entry for stock reco ([57925a1](57925a1315))
* conflicts ([02ce528](02ce528501))
* **Dunning:** logic for fetching text (backport [#43160](https://github.com/frappe/erpnext/issues/43160)) ([#43489](https://github.com/frappe/erpnext/issues/43489)) ([31ecdb2](31ecdb2104))
* Fix API endpoint for Frankfurter ([1c0843c](1c0843caee))
* patch to update Currency Exchange Settings for `frankfurter.app` ([b4706db](b4706db816))
* set margin fields for purchase documents when updating items ([97edadf](97edadfc4b))
* Stock Ledger Invariant Check report ([4426384](44263842f5))
2024-10-04 03:04:09 +00:00
ruthra kumar
b18ad94071 Merge pull request #43468 from frappe/version-14-hotfix
chore: release v14
2024-10-04 08:32:45 +05:30
mergify[bot]
31ecdb2104 fix(Dunning): logic for fetching text (backport #43160) (#43489)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
fix(Dunning): logic for fetching text (#43160)
2024-10-03 20:28:59 +01:00
Sagar Vora
3b550ca419 Merge pull request #43484 from frappe/mergify/bp/version-14-hotfix/pr-43475
fix: set margin fields for purchase documents when updating items (backport #43475)
2024-10-02 15:24:03 +05:30
Sagar Vora
97edadfc4b fix: set margin fields for purchase documents when updating items
(cherry picked from commit 7be4d56be2)
2024-10-02 09:51:45 +00:00
Sagar Vora
824ccfb10c Merge pull request #43482 from frappe/mergify/bp/version-14-hotfix/pr-43481
fix: patch to update Currency Exchange Settings for `frankfurter.app` (backport #43481)
2024-10-02 15:14:46 +05:30
Sagar Vora
02ce528501 fix: conflicts 2024-10-02 15:14:16 +05:30
Sagar Vora
b4706db816 fix: patch to update Currency Exchange Settings for frankfurter.app
(cherry picked from commit c5889c5d2e)

# Conflicts:
#	erpnext/patches.txt
2024-10-02 09:43:14 +00:00
Sagar Vora
f608ba55ab Merge pull request #43477 from frappe/mergify/bp/version-14-hotfix/pr-43476
fix: Fix API endpoint for Frankfurter (backport #43476)
2024-10-02 14:43:07 +05:30
Sagar Vora
b18b4c1e35 test: update test for API change
(cherry picked from commit c444de017a)
2024-10-02 09:11:47 +00:00
Corentin Forler
1c0843caee fix: Fix API endpoint for Frankfurter
(cherry picked from commit 33e72111c7)
2024-10-02 09:11:47 +00:00
Nihantra C. Patel
7b158accec Merge pull request #43458 from frappe/mergify/bp/version-14-hotfix/pr-43455
fix: add company filter in Warehouse wise Item Balance Age and Value (backport #43455)
2024-10-01 11:46:54 +05:30
Nihantra Patel
3cb85028d0 fix: add company filter in Warehouse wise Item Balance Age and Value
(cherry picked from commit 75950f86cf)
2024-10-01 05:47:33 +00:00
rohitwaghchaure
619550942f Merge pull request #43439 from frappe/mergify/bp/version-14-hotfix/pr-43437
fix: adjustment entry for stock reco (backport #43437)
2024-09-30 15:38:09 +05:30
Rohit Waghchaure
57925a1315 fix: adjustmen entry for stock reco
(cherry picked from commit 4e463b7d6d)
2024-09-30 08:57:50 +00:00
rohitwaghchaure
a201c56b38 Merge pull request #43432 from frappe/mergify/bp/version-14-hotfix/pr-43420
fix: Stock Ledger Invariant Check report (backport #43420)
2024-09-30 13:39:47 +05:30
Rohit Waghchaure
44263842f5 fix: Stock Ledger Invariant Check report
(cherry picked from commit d7daedc5b2)
2024-09-29 17:07:35 +00:00
Frappe PR Bot
20f9549247 chore(release): Bumped to Version 14.74.2
## [14.74.2](https://github.com/frappe/erpnext/compare/v14.74.1...v14.74.2) (2024-09-25)

### Bug Fixes

* add currency in financial statement ([6becaba](6becaba672))
* AR / AP report to ignore 0.0 outstanding ([79f95ba](79f95ba507))
* **Bank Account:** dashboard connections (backport [#43365](https://github.com/frappe/erpnext/issues/43365)) ([#43366](https://github.com/frappe/erpnext/issues/43366)) ([4146bdf](4146bdf324))
* change dynamic link doctype fieldtype to data ([c0dfda6](c0dfda6ccc))
* incorrect outstanding on non-pos invoice with write_off_account ([79235cd](79235cd688))
* incorrect stock balance for inventory dimension (backport [#43284](https://github.com/frappe/erpnext/issues/43284)) ([#43289](https://github.com/frappe/erpnext/issues/43289)) ([1bdbcc6](1bdbcc6703))
* partial return on POS invoice ([50e0f56](50e0f56d18))
* partial return on POS invoice ([ef7d4fe](ef7d4fe84a))
* Payment Ledger Report currency fieldtype fix ([7ac39dc](7ac39dc233))
* **Payment Reconciliation:** German translations ([32d4f96](32d4f96e02))
* Serial No reserved against historical sales order - unable to sell again ([#43294](https://github.com/frappe/erpnext/issues/43294)) ([8abc1f4](8abc1f4da9))
* show chart tool tip in report currency ([92438f8](92438f8dba))
* translate in js ([e43c357](e43c357c08))
* Translation for button SO to PO ([a8b5bcf](a8b5bcfe02))
* Translation for button SO to PO --conflicts ([b6ce922](b6ce9222aa))
2024-09-25 04:38:46 +00:00
ruthra kumar
644ada8225 Merge pull request #43362 from frappe/version-14-hotfix
chore: release v14
2024-09-25 10:07:32 +05:30
mergify[bot]
4146bdf324 fix(Bank Account): dashboard connections (backport #43365) (#43366)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
fix(Bank Account): dashboard connections (#43365)
2024-09-24 16:20:05 +02:00
ruthra kumar
c36b40ad8c Merge pull request #43363 from frappe/mergify/bp/version-14-hotfix/pr-43356
fix: AR / AP report to ignore 0.0 outstanding (backport #43356)
2024-09-24 16:58:26 +05:30
ruthra kumar
79f95ba507 fix: AR / AP report to ignore 0.0 outstanding
(cherry picked from commit 6e2cf79e2c)
2024-09-24 10:14:49 +00:00
Nihantra C. Patel
5ba9fb73bb Merge pull request #43342 from frappe/mergify/bp/version-14-hotfix/pr-43253
fix: partial return on POS invoice (backport #43253)
2024-09-23 23:36:25 +05:30
ruthra kumar
43ba79f0e5 Merge pull request #43299 from barredterra/de-payment-reco
fix(Payment Reconciliation): German translations
2024-09-23 20:03:02 +05:30
ruthra kumar
5ce4dae204 chore: resolve conflict 2024-09-23 20:02:10 +05:30
Nihantra C. Patel
50e0f56d18 fix: partial return on POS invoice
(cherry picked from commit 18bdd06652)

# Conflicts:
#	erpnext/accounts/doctype/pos_invoice/pos_invoice.py
2024-09-23 14:26:05 +00:00
Nihantra C. Patel
ef7d4fe84a fix: partial return on POS invoice
(cherry picked from commit 76289fa8dc)

# Conflicts:
#	erpnext/accounts/doctype/pos_invoice/pos_invoice.py
2024-09-23 14:26:05 +00:00
ruthra kumar
8f81fdba4f Merge pull request #43335 from frappe/mergify/bp/version-14-hotfix/pr-43316
fix: incorrect outstanding on non-pos invoice with write_off_account (backport #43316)
2024-09-23 18:22:39 +05:30
ruthra kumar
5434d4bb1c Merge pull request #43337 from frappe/mergify/bp/version-14-hotfix/pr-43308
fix: show chart tool tip in report currency (backport #43308)
2024-09-23 18:22:17 +05:30
ruthra kumar
54d0162fef Merge pull request #43339 from frappe/mergify/bp/version-14-hotfix/pr-43307
fix: change dynamic link doctype fieldtype to data (backport #43307)
2024-09-23 18:21:57 +05:30
venkat102
c0dfda6ccc fix: change dynamic link doctype fieldtype to data
(cherry picked from commit 1e46f7344a)
2024-09-23 12:23:01 +00:00
venkat102
6becaba672 fix: add currency in financial statement
(cherry picked from commit 91a27bda84)
2024-09-23 12:11:47 +00:00
venkat102
92438f8dba fix: show chart tool tip in report currency
(cherry picked from commit 827b3f4542)
2024-09-23 12:11:46 +00:00
ruthra kumar
79235cd688 fix: incorrect outstanding on non-pos invoice with write_off_account
(cherry picked from commit d5e2906e59)
2024-09-23 12:09:50 +00:00
barredterra
32d4f96e02 fix(Payment Reconciliation): German translations 2024-09-19 13:57:55 +02:00
mergify[bot]
1bdbcc6703 fix: incorrect stock balance for inventory dimension (backport #43284) (#43289)
* fix: incorrect stock balance for inventory dimension (#43284)

(cherry picked from commit 3e7a7a54bf)

# Conflicts:
#	erpnext/stock/report/stock_balance/stock_balance.js

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-09-19 10:20:58 +05:30
rohitwaghchaure
8abc1f4da9 fix: Serial No reserved against historical sales order - unable to sell again (#43294) 2024-09-19 09:37:08 +05:30
ruthra kumar
2e2a4d9c70 Merge pull request #43292 from frappe/mergify/bp/version-14-hotfix/pr-43274
fix: translate in js (backport #43274)
2024-09-19 09:01:04 +05:30
Doğancan
e43c357c08 fix: translate in js
(cherry picked from commit 25faec5662)
2024-09-19 03:27:14 +00:00
ruthra kumar
66349d0877 Merge pull request #43288 from frappe/mergify/bp/version-14-hotfix/pr-43213
fix: Payment Ledger Report currency fieldtype fix (backport #43213)
2024-09-19 08:50:19 +05:30
sameer Chauhan
7ac39dc233 fix: Payment Ledger Report currency fieldtype fix
(cherry picked from commit ad2d6a1625)
2024-09-19 01:36:31 +00:00
Nihantra C. Patel
02f414e0aa Merge pull request #43277 from frappe/mergify/bp/version-14-hotfix/pr-43276
fix: Translation for button SO to PO (backport #43276)
2024-09-18 21:49:31 +05:30
Nihantra C. Patel
b6ce9222aa fix: Translation for button SO to PO --conflicts 2024-09-18 21:47:30 +05:30
Nihantra C. Patel
a8b5bcfe02 fix: Translation for button SO to PO
(cherry picked from commit a5275e9f28)

# Conflicts:
#	erpnext/selling/doctype/sales_order/sales_order.js
2024-09-18 16:14:06 +00:00
Frappe PR Bot
481610d400 chore(release): Bumped to Version 14.74.1
## [14.74.1](https://github.com/frappe/erpnext/compare/v14.74.0...v14.74.1) (2024-09-18)

### Bug Fixes

* add currency in options for rate field in pricing rule ([c9467f4](c9467f4c1f))
* cancel cost center allocation and journal entry after test ([4646f11](4646f11829))
* delete exchange gain loss journal entry while deleting payment entry ([62f1286](62f12861f1))
* fetch cost center allocation percentage only from the applicable allocation ([a26f0e9](a26f0e9973))
* hide and reset discount control on new POS order ([5434432](5434432cfc))
* invalid gp calculation ([9af2df3](9af2df3810))
2024-09-18 07:32:40 +00:00
ruthra kumar
829a42d679 Merge pull request #43255 from frappe/version-14-hotfix
chore: release v14
2024-09-18 13:01:22 +05:30
ruthra kumar
c442dc6b8e Merge pull request #43267 from frappe/mergify/bp/version-14-hotfix/pr-43239
fix: add currency in options for rate field in pricing rule (backport #43239)
2024-09-18 12:39:25 +05:30
ruthra kumar
fff8f8b83f chore: resolve conflict 2024-09-18 12:12:06 +05:30
krishna
c9467f4c1f fix: add currency in options for rate field in pricing rule
(cherry picked from commit 636c0131fa)

# Conflicts:
#	erpnext/accounts/doctype/pricing_rule/pricing_rule.json
2024-09-18 06:29:34 +00:00
ruthra kumar
eed7eba695 Merge pull request #43265 from frappe/mergify/bp/version-14-hotfix/pr-43216
fix: get cost center allocation percentage only from the applicable allocation (backport #43216)
2024-09-18 11:40:10 +05:30
venkat102
4646f11829 fix: cancel cost center allocation and journal entry after test
(cherry picked from commit 3c65b98b49)
2024-09-18 05:49:31 +00:00
venkat102
872c150ea7 test: add unit test for validating multiple cost center allocation with different child cost center
(cherry picked from commit 4d5d6150e1)
2024-09-18 05:49:30 +00:00
venkat102
a26f0e9973 fix: fetch cost center allocation percentage only from the applicable allocation
(cherry picked from commit 36e5945c66)
2024-09-18 05:49:30 +00:00
ruthra kumar
dc6d3cca70 Merge pull request #43248 from frappe/mergify/bp/version-14-hotfix/pr-43188
fix: invalid gp calculation (backport #43188)
2024-09-17 14:35:06 +05:30
Dany Robert
9af2df3810 fix: invalid gp calculation
(cherry picked from commit c79851239c)
2024-09-17 06:33:14 +00:00
Smit Vora
84447caac7 Merge pull request #43240 from frappe/mergify/bp/version-14-hotfix/pr-43176
fix: hide and reset discount control on new POS order (backport #43176)
2024-09-16 20:01:15 +05:30
ljain112
5434432cfc fix: hide and reset discount control on new POS order
(cherry picked from commit 5b0053f8dd)
2024-09-16 14:25:19 +00:00
ruthra kumar
2193395072 Merge pull request #43201 from frappe/mergify/bp/version-14-hotfix/pr-43191
fix: delete exchange gain loss journal entry while deleting payment entry (backport #43191)
2024-09-13 11:22:56 +05:30
ruthra kumar
73821ac647 Merge pull request #43203 from frappe/mergify/bp/version-14-hotfix/pr-43192
refactor(test): use test fixture on pricing rule test suite (backport #43192)
2024-09-13 11:22:29 +05:30
ruthra kumar
2e323cc126 refactor(test): use test fixture on pricing rule test suite
(cherry picked from commit 0ea1d6d960)
2024-09-13 05:20:23 +00:00
Navin-S-R
95a66b8d8f test: add unit test for deletion of gain loss jv while deleting payment entry
(cherry picked from commit 7855d3034b)
2024-09-13 05:19:04 +00:00
Navin-S-R
62f12861f1 fix: delete exchange gain loss journal entry while deleting payment entry
(cherry picked from commit 9886cf0d46)
2024-09-13 05:19:03 +00:00
ruthra kumar
77bdf18c23 Merge pull request #43170 from frappe/mergify/copy/version-14-hotfix/pr-43169
refactor: enable no-copy on Purchase Invoice status (copy #43169)
2024-09-11 14:20:38 +05:30
ruthra kumar
097eae478d refactor: enable no-copy on Purchase Invoice status
(cherry picked from commit 0d9741fdd7)
2024-09-11 07:56:59 +00:00
Frappe PR Bot
8f02b88119 chore(release): Bumped to Version 14.74.0
# [14.74.0](https://github.com/frappe/erpnext/compare/v14.73.2...v14.74.0) (2024-09-11)

### Bug Fixes

* `default_advance_account` field in Process Payment Reconciliation ([3691a50](3691a500eb))
* bom cost update is not working (backport [#43155](https://github.com/frappe/erpnext/issues/43155)) ([#43156](https://github.com/frappe/erpnext/issues/43156)) ([9110534](91105344bb))
* cancel common party advance jv while canceling the invoice ([f506952](f5069524f3))
* check multi-currency on jv for common party accounting with foreign currency ([a3a40fe](a3a40febf3))
* **Delivery Note:** translatability of validation errors ([5e33961](5e33961448))
* incorrect actual cost in Procurement Tracker report (backport [#43109](https://github.com/frappe/erpnext/issues/43109)) ([#43137](https://github.com/frappe/erpnext/issues/43137)) ([a4b9dda](a4b9dda4b2))
* incorrect qty after transaction in SLE (backport [#43103](https://github.com/frappe/erpnext/issues/43103)) ([#43104](https://github.com/frappe/erpnext/issues/43104)) ([77892f4](77892f4e24))
* return type of `get_party_details` (backport [#43131](https://github.com/frappe/erpnext/issues/43131)) ([#43135](https://github.com/frappe/erpnext/issues/43135)) ([e8aae50](e8aae5018a))
* set today in 'On This Date' in Available Batch Report ([36f65fc](36f65fc592))
* uncomment internal parties ([4dd06b6](4dd06b69a1))
* unreconcile allocation child table redirect url voucher no issue ([53496ed](53496ed79f))

### Features

* utility report to identify invalid ledger entries ([37b8715](37b8715096))
2024-09-11 05:11:21 +00:00
ruthra kumar
a91fb260e1 Merge pull request #43150 from frappe/version-14-hotfix
chore: release v14
2024-09-11 10:39:50 +05:30
mergify[bot]
91105344bb fix: bom cost update is not working (backport #43155) (#43156)
fix: bom cost update is not working (#43155)

(cherry picked from commit 05f9015c0b)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-09-10 23:07:52 +05:30
ruthra kumar
6895efe577 Merge pull request #43147 from frappe/mergify/bp/version-14-hotfix/pr-43144
feat: utility report for identifying invalid ledger entries (backport #43144)
2024-09-10 16:00:10 +05:30
ruthra kumar
2a890f9061 refactor: allow all accounts
(cherry picked from commit 43198c946b)
2024-09-10 09:06:14 +00:00
ruthra kumar
b2d361b495 refactor: fetch as dictionary
(cherry picked from commit 2126b10a92)
2024-09-10 09:06:14 +00:00
ruthra kumar
d51cf281c3 refactor: barebones methods with basic logic
(cherry picked from commit b05b378ef0)
2024-09-10 09:06:14 +00:00
ruthra kumar
3574d11946 refactor: standard filters
(cherry picked from commit dccbc1f432)
2024-09-10 09:06:14 +00:00
ruthra kumar
37b8715096 feat: utility report to identify invalid ledger entries
(cherry picked from commit 832c4aaf82)
2024-09-10 09:06:13 +00:00
mergify[bot]
e8aae5018a fix: return type of get_party_details (backport #43131) (#43135)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
fix: return type of `get_party_details` (#43131)
2024-09-09 19:26:21 +02:00
mergify[bot]
a4b9dda4b2 fix: incorrect actual cost in Procurement Tracker report (backport #43109) (#43137)
fix: incorrect actual cost in Procurement Tracker report (#43109)

(cherry picked from commit 80f101f92e)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-09-09 20:35:14 +05:30
ruthra kumar
a5a0c0cb07 Merge pull request #43128 from frappe/mergify/bp/version-14-hotfix/pr-42801
fix(Delivery Note): translatability of validation errors (backport #42801)
2024-09-09 15:15:36 +05:30
barredterra
14ae3edc1d refactor: extract common validation method
(cherry picked from commit 08646b7ab7)
2024-09-09 09:14:01 +00:00
barredterra
5e33961448 fix(Delivery Note): translatability of validation errors
(cherry picked from commit 34df6e39dc)
2024-09-09 09:14:00 +00:00
ruthra kumar
2db15d7375 Merge pull request #43126 from frappe/mergify/bp/version-14-hotfix/pr-43051
fix: unreconcile allocation child table redirect url voucher no issue (backport #43051)
2024-09-09 14:34:11 +05:30
Prashant Kamble
53496ed79f fix: unreconcile allocation child table redirect url voucher no issue
(cherry picked from commit 5d6f6a2fb9)
2024-09-09 09:00:19 +00:00
ruthra kumar
4536e8bc47 Merge pull request #43124 from frappe/mergify/bp/version-14-hotfix/pr-43121
fix: set today in 'On This Date' in Available Batch Report (backport #43121)
2024-09-09 14:14:26 +05:30
Nihantra C. Patel
36f65fc592 fix: set today in 'On This Date' in Available Batch Report
(cherry picked from commit 9fd55e4c83)
2024-09-09 08:27:14 +00:00
ruthra kumar
c237f3c4c4 Merge pull request #43119 from frappe/mergify/bp/version-14-hotfix/pr-43095
fix: check multi-currency on jv for common party accounting with foreign currency (backport #43095)
2024-09-09 11:24:00 +05:30
ruthra kumar
cf78f9702c chore: resolve conflict 2024-09-09 11:01:54 +05:30
ruthra kumar
de0b8c07f6 refactor(test): use change_settings decorator
(cherry picked from commit ee94fb37c8)
2024-09-09 05:06:22 +00:00
venkat102
4dd06b69a1 fix: uncomment internal parties
(cherry picked from commit 454e18ad5f)
2024-09-09 05:06:21 +00:00
venkat102
b6f352a024 test: add unit test for common party with foreign currency
(cherry picked from commit 740a04a704)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
2024-09-09 05:06:21 +00:00
venkat102
a3a40febf3 fix: check multi-currency on jv for common party accounting with foreign currency
(cherry picked from commit 00938bfd4d)
2024-09-09 05:06:21 +00:00
Smit Vora
6bfc8a0152 Merge pull request #43091 from frappe/mergify/bp/version-14-hotfix/pr-43013
fix: `default_advance_account` field in Process Payment Reconciliation (backport #43013)
2024-09-09 08:00:21 +05:30
Smit Vora
5113b0063e chore: resolve conflicts with backport 2024-09-09 06:58:34 +05:30
Smit Vora
9e77a0245a chore: resolve conflicts with backport 2024-09-09 06:51:30 +05:30
Frappe PR Bot
7c37d4c71a chore(release): Bumped to Version 14.73.2
## [14.73.2](https://github.com/frappe/erpnext/compare/v14.73.1...v14.73.2) (2024-09-07)

### Bug Fixes

* incorrect qty after transaction in SLE (backport [#43103](https://github.com/frappe/erpnext/issues/43103)) ([#43104](https://github.com/frappe/erpnext/issues/43104)) ([f054261](f0542613e0))
2024-09-07 12:40:10 +00:00
rohitwaghchaure
873962a109 Merge pull request #43108 from frappe/mergify/bp/version-14/pr-43104
fix: incorrect qty after transaction in SLE (backport #43103) (backport #43104)
2024-09-07 18:08:45 +05:30
mergify[bot]
f0542613e0 fix: incorrect qty after transaction in SLE (backport #43103) (#43104)
fix: incorrect qty after transaction in SLE (#43103)

(cherry picked from commit 5ff87edc85)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
(cherry picked from commit 77892f4e24)
2024-09-07 12:05:10 +00:00
mergify[bot]
77892f4e24 fix: incorrect qty after transaction in SLE (backport #43103) (#43104)
fix: incorrect qty after transaction in SLE (#43103)

(cherry picked from commit 5ff87edc85)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-09-07 17:34:22 +05:30
ruthra kumar
4bd7ce3e0b Merge pull request #43096 from frappe/mergify/bp/version-14-hotfix/pr-43077
fix: cancel common party advance jv while canceling the invoice (backport #43077)
2024-09-06 20:48:51 +05:30
venkat102
e7b17e05b0 test: add unit test for canceling the common party advance jv created from sales invoice
(cherry picked from commit 8c6e3f3c12)
2024-09-06 14:50:05 +00:00
venkat102
f5069524f3 fix: cancel common party advance jv while canceling the invoice
(cherry picked from commit 6a928b92df)
2024-09-06 14:50:04 +00:00
ruthra kumar
202ebbe140 refactor: fetch advance account on party seleection
(cherry picked from commit c4ed04cb31)
2024-09-06 09:48:47 +00:00
ljain112
3691a500eb fix: default_advance_account field in Process Payment Reconciliation
(cherry picked from commit 143209f91a)

# Conflicts:
#	erpnext/accounts/doctype/process_payment_reconciliation/process_payment_reconciliation.json
#	erpnext/accounts/doctype/process_payment_reconciliation/process_payment_reconciliation.py
2024-09-06 09:48:47 +00:00
ruthra kumar
f4032b64c9 Merge pull request #43073 from frappe/mergify/bp/version-14-hotfix/pr-43070
fix: AP filter to simulate employee advance as a ledger impacting voucher (backport #43070)
2024-09-06 10:09:21 +05:30
ruthra kumar
2913785bac refactor: filter to toggle employee advance scenario in AP
(cherry picked from commit 257e13c299)
2024-09-05 11:44:02 +00:00
ruthra kumar
3a57ef4c5f refactor: Handle Emp Advance as separate row in AP report
(cherry picked from commit eedf22b07a)
2024-09-05 11:44:02 +00:00
Frappe PR Bot
610f74ca62 chore(release): Bumped to Version 14.73.1
## [14.73.1](https://github.com/frappe/erpnext/compare/v14.73.0...v14.73.1) (2024-09-04)

### Bug Fixes

* adjust price insertion logic for internal suppliers/customers ([#42988](https://github.com/frappe/erpnext/issues/42988)) ([3912c68](3912c688ac))
* default fiscal year in report v14 ([#42960](https://github.com/frappe/erpnext/issues/42960)) ([9db7f7b](9db7f7b033))
* Discount and taxes in return document should follow the reference document (backport [#41911](https://github.com/frappe/erpnext/issues/41911)) ([#42573](https://github.com/frappe/erpnext/issues/42573)) ([c55f8e3](c55f8e3388))
* indentation ([e8cfb4d](e8cfb4d602))
* removed extra filter condition ([db319f9](db319f95f1))
* resolve gl entries duplication in asset purchase workflow ([#41845](https://github.com/frappe/erpnext/issues/41845)) ([b3c9697](b3c9697b7c))
* retain date filter when redirecting in Profit and Loss report ([c87f2d2](c87f2d2f7c))
* set up filters for dimensions ([450b3f3](450b3f338e))
* typeerror on Payment Entry ([dda4002](dda4002da4))
* typerror on default_currency ([22b283d](22b283d4a8))
2024-09-04 14:59:27 +00:00
ruthra kumar
012248bd12 Merge pull request #43025 from frappe/version-14-hotfix
chore: release v14
2024-09-04 20:28:07 +05:30
Smit Vora
ed185a6171 Merge pull request #43045 from frappe/mergify/bp/version-14-hotfix/pr-42988
fix: adjust price insertion logic for internal suppliers/customers (backport #42988)
2024-09-04 13:19:09 +05:30
Lakshit Jain
3912c688ac fix: adjust price insertion logic for internal suppliers/customers (#42988)
* fix: adjust price insertion logic for internal suppliers/customers

* refactor: correct indentation, specify conditions within function

* fix: typo

---------

Co-authored-by: Smit Vora <smitvora203@gmail.com>
(cherry picked from commit 38f925b376)
2024-09-04 07:26:53 +00:00
ruthra kumar
c7fb6e5f61 Merge pull request #43032 from frappe/mergify/bp/version-14-hotfix/pr-43030
fix: typerror on default_currency (backport #43030)
2024-09-03 16:51:31 +05:30
ruthra kumar
22b283d4a8 fix: typerror on default_currency
(cherry picked from commit 4a7cc4da87)
2024-09-03 11:11:30 +00:00
ruthra kumar
56b4e79305 Merge pull request #43027 from frappe/mergify/bp/version-14-hotfix/pr-42974
fix: retain date filter when redirecting in Profit and Loss report (backport #42974)
2024-09-03 15:51:57 +05:30
vishnu
e8cfb4d602 fix: indentation
(cherry picked from commit 598e9c1390)
2024-09-03 10:14:32 +00:00
vishnu
c87f2d2f7c fix: retain date filter when redirecting in Profit and Loss report
(cherry picked from commit bb29fc4c3d)
2024-09-03 10:14:32 +00:00
Khushi Rawat
ec00b2cf48 Merge pull request #42965 from frappe/mergify/bp/version-14-hotfix/pr-41845
fix: resolve gl entries duplication in asset purchase workflow (backport #41845)
2024-09-02 16:35:19 +05:30
mergify[bot]
c55f8e3388 fix: Discount and taxes in return document should follow the reference document (backport #41911) (#42573)
* fix: Discount and taxes in return document should follow the reference document (#41911)

* fix: Discount and taxes in return document should follow the reference document

* fix: Ignore Pricing rule on debit/credit note if created against PI/SI with test cases

* fix: linter issue

(cherry picked from commit 281198456d)

# Conflicts:
#	erpnext/controllers/sales_and_purchase_return.py

* fix: resolved conflict

---------

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2024-09-02 11:12:22 +05:30
Khushi Rawat
4951d01102 Merge pull request #42766 from frappe/mergify/bp/version-14-hotfix/pr-42765
fix: set up filters for dimensions (backport #42765)
2024-08-30 13:43:51 +05:30
ruthra kumar
a2d5024d3f Merge pull request #42984 from frappe/mergify/bp/version-14-hotfix/pr-42983
refactor: link utility report with bank reconciliation statement (backport #42983)
2024-08-29 16:16:37 +05:30
ruthra kumar
ef7a83c354 refactor: link utility report with bank reconciliation statement
(cherry picked from commit 00eac65712)
2024-08-29 10:42:52 +00:00
ruthra kumar
810bc65e30 Merge pull request #42980 from frappe/mergify/bp/version-14-hotfix/pr-42979
refactor: better UX on Bank Clearance tool (backport #42979)
2024-08-29 14:15:47 +05:30
ruthra kumar
cfb5a6592c chore: resolve conflict 2024-08-29 14:11:28 +05:30
ruthra kumar
9afbd43f05 refactor: better UX on Bank Clearance tool
(cherry picked from commit 6a06e26d04)

# Conflicts:
#	erpnext/accounts/doctype/bank_clearance/bank_clearance.js
2024-08-29 08:25:09 +00:00
Khushi Rawat
6fda0e8e1b chore: linters check 2024-08-28 15:22:07 +05:30
Nicolas Pereira
9db7f7b033 fix: default fiscal year in report v14 (#42960)
* loads the fiscal year from the calendar year

* loads the fiscal year from the calendar year

* loads the fiscal year from the calendar year

* loads the fiscal year from the calendar year

* fix: default fiscal year in report v14

* fix: default fiscal year in report v14 --prettier

---------

Co-authored-by: Nihantra C. Patel <141945075+Nihantra-Patel@users.noreply.github.com>
2024-08-28 14:18:55 +05:30
ruthra kumar
82b2046805 Merge pull request #42967 from frappe/mergify/bp/version-14-hotfix/pr-42966
fix: typeerror on Payment Entry (backport #42966)
2024-08-28 13:27:24 +05:30
ruthra kumar
6cb9ae2035 chore: resolve conflict 2024-08-28 13:23:49 +05:30
ruthra kumar
dda4002da4 fix: typeerror on Payment Entry
(cherry picked from commit e9cf8937cd)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.js
2024-08-28 06:57:56 +00:00
Khushi Rawat
91bff147e0 chore: resolved conflicts 2024-08-28 12:05:25 +05:30
Khushi Rawat
b3c9697b7c fix: resolve gl entries duplication in asset purchase workflow (#41845)
* fix: resolve gl entries duplication in asset purchase workflow

* fix: prevent duplicate entry when creating purchase receipt from purchase invoice

* chore: test case added

* fix: fixed missing asset category issue

(cherry picked from commit 55a4bd469b)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
2024-08-28 06:29:56 +00:00
Frappe PR Bot
7648d8db80 chore(release): Bumped to Version 14.73.0
# [14.73.0](https://github.com/frappe/erpnext/compare/v14.72.2...v14.73.0) (2024-08-28)

### Bug Fixes

* call 'process' directly instead of creating 'process_subscripti ([8412938](8412938442))
* currency symbol on `amount` field suppose to show as `Company`'s currency not as default company's currency ([333c757](333c7577eb))
* do not copy date fields in opportunity doctype ([5186872](5186872b9b))
* german translations for incoterms ([003653c](003653c572))
* get amount with taxes and charges from payment entry ([094411f](094411f5f0))
* same posting date and time, creation causing incorrect balance qty (backport [#42904](https://github.com/frappe/erpnext/issues/42904)) ([#42919](https://github.com/frappe/erpnext/issues/42919)) ([c0b5f7c](c0b5f7c8eb))
* specify precision for net_amount ([#39481](https://github.com/frappe/erpnext/issues/39481)) ([cf34219](cf34219c71))
* stock reco with incorrect serial numbers ([#42865](https://github.com/frappe/erpnext/issues/42865)) ([54842ea](54842ea0b3))
* timeout while submitting stock entry (backport [#42929](https://github.com/frappe/erpnext/issues/42929)) ([#42930](https://github.com/frappe/erpnext/issues/42930)) ([73eab91](73eab91631))
* unsupported operand type(s) for *: 'float' and 'NoneType' (backport [#42916](https://github.com/frappe/erpnext/issues/42916)) ([#42917](https://github.com/frappe/erpnext/issues/42917)) ([2f4f2a8](2f4f2a8eec))
* update dimesions in exchange_gain_loss jv based on base document ([820dcd7](820dcd79bb))
* Update get_amount to return currency precision grand total ([0c2d7f2](0c2d7f2d9a))
* use of incorrect attribute ([ff14d72](ff14d72a46))

### Features

* report to identify incorrectly cleared cheques ([c29b95e](c29b95e306))

### Performance Improvements

* data import for stock entries (backport [#42711](https://github.com/frappe/erpnext/issues/42711)) ([#42903](https://github.com/frappe/erpnext/issues/42903)) ([12d5e24](12d5e247c5))
2024-08-28 05:02:39 +00:00
ruthra kumar
578f9b61c6 Merge pull request #42938 from frappe/version-14-hotfix
chore: release v14
2024-08-28 10:31:18 +05:30
ruthra kumar
23c5edaf08 Merge pull request #42788 from kurogeek/fix-share_transfer-amount-currency-symbol
fix: share_transfer amount currency symbol field
2024-08-28 10:05:19 +05:30
Raffael Meyer
35c10fa97f Merge pull request #42671 from frappe/mergify/bp/version-14-hotfix/pr-42669
fix: german translations for incoterms (backport #42669)
2024-08-27 16:54:22 +02:00
ruthra kumar
10025a2c8d Merge pull request #42946 from frappe/mergify/bp/version-14-hotfix/pr-42923
fix: get amount with taxes and charges from payment entry (backport #42923)
2024-08-27 17:39:22 +05:30
ruthra kumar
813b699d5e Merge pull request #42948 from frappe/mergify/bp/version-14-hotfix/pr-42936
fix: remove unnecessary condition on 'voucher_no' (backport #42936)
2024-08-27 17:09:06 +05:30
ruthra kumar
94b09bb836 Merge pull request #42945 from frappe/mergify/bp/version-14-hotfix/pr-42453
fix: Update get_amount to return currency precision grand total (backport #42453)
2024-08-27 17:07:24 +05:30
ruthra kumar
ff14d72a46 fix: use of incorrect attribute
(cherry picked from commit fb32d2cafb)
2024-08-27 11:05:50 +00:00
Syed Mujeer Hashmi
0c2d7f2d9a fix: Update get_amount to return currency precision grand total
In case of multi-currency purchase invoice, we are getting the error "Total Payment Request amount cannot be greater than Purchase Invoice amount" because of rounding difference.

(cherry picked from commit 976abf7b3c)
2024-08-27 16:31:56 +05:30
venkat102
094411f5f0 fix: get amount with taxes and charges from payment entry
(cherry picked from commit b3a901b631)
2024-08-27 11:01:27 +00:00
mergify[bot]
c0b5f7c8eb fix: same posting date and time, creation causing incorrect balance qty (backport #42904) (#42919)
* fix: same posting date and time, creation causing incorrect balance qty (#42904)

fix: same posting date and time, creation causing incorrect balance quantity
(cherry picked from commit 27364b7e6b)

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

* chore: fix conflicts

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-08-27 14:33:56 +05:30
mergify[bot]
73eab91631 fix: timeout while submitting stock entry (backport #42929) (#42930)
* fix: timeout while submitting stock entry (#42929)

(cherry picked from commit ca2fde891e)

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

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-08-27 14:29:41 +05:30
mergify[bot]
2f4f2a8eec fix: unsupported operand type(s) for *: 'float' and 'NoneType' (backport #42916) (#42917)
fix: unsupported operand type(s) for *: 'float' and 'NoneType' (#42916)

(cherry picked from commit 10434742e9)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-08-27 09:30:01 +05:30
ruthra kumar
6a2210e46a Merge pull request #42914 from frappe/mergify/bp/version-14-hotfix/pr-42887
fix: update dimesions in exchange_gain_loss jv based on base document (backport #42887)
2024-08-26 17:56:18 +05:30
ljain112
820dcd79bb fix: update dimesions in exchange_gain_loss jv based on base document
(cherry picked from commit 96df19149d)
2024-08-26 12:01:01 +00:00
ruthra kumar
97205ce355 Merge pull request #42906 from frappe/mergify/bp/version-14-hotfix/pr-42905
refactor: better err msg on clearance tool (backport #42905)
2024-08-26 16:34:06 +05:30
ruthra kumar
8207b12f11 Merge pull request #42911 from frappe/mergify/bp/version-14-hotfix/pr-42910
feat: utility report to better diagnose incorrectly cleared Cheques and Deposits (backport #42910)
2024-08-26 16:32:41 +05:30
ruthra kumar
09946c7ea7 refactor: build dictionary for Journal
remove redundant filter

(cherry picked from commit 2144e0337d)
2024-08-26 10:11:09 +00:00
ruthra kumar
15aeec8a2d chore: remove redundant column
(cherry picked from commit 74b36db24e)
2024-08-26 10:11:09 +00:00
ruthra kumar
29fe7bea6d refactor: build dict for payment entry
(cherry picked from commit 784dec24c8)
2024-08-26 10:11:09 +00:00
ruthra kumar
c58987ba38 refactor: working state with minimum functions
(cherry picked from commit 4cd023444a)
2024-08-26 10:11:09 +00:00
ruthra kumar
ef93c96f43 refactor: barebones functions
(cherry picked from commit ceaa1be729)
2024-08-26 10:11:08 +00:00
ruthra kumar
c29b95e306 feat: report to identify incorrectly cleared cheques
(cherry picked from commit 28890fa833)
2024-08-26 10:11:08 +00:00
ruthra kumar
e6438b293d chore: resolve conflict 2024-08-26 15:30:53 +05:30
ruthra kumar
18a75fef9a refactor: better err msg on clearance tool
(cherry picked from commit 092411b54f)

# Conflicts:
#	erpnext/accounts/doctype/bank_clearance/bank_clearance.py
2024-08-26 08:55:01 +00:00
mergify[bot]
12d5e247c5 perf: data import for stock entries (backport #42711) (#42903)
* perf: data import for stock entries (#42711)

(cherry picked from commit 1511280464)

# Conflicts:
#	erpnext/stock/doctype/stock_entry/test_stock_entry.py

* chore: fix conflicts

* chore: fix linters issue

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-08-26 13:53:23 +05:30
Smit Vora
72cc42997b Merge pull request #42891 from frappe/mergify/bp/version-14-hotfix/pr-42848
fix: do not copy date fields in opportunity doctype (backport #42848)
2024-08-24 13:12:27 +05:30
Smit Vora
3a02800fbc chore: resolve conflicts 2024-08-24 12:38:11 +05:30
ruthra kumar
6cf248578f Merge pull request #42817 from frappe/mergify/bp/version-14-hotfix/pr-39481
fix: specify precision for net_amount (backport #39481)
2024-08-24 07:53:43 +05:30
ljain112
5186872b9b fix: do not copy date fields in opportunity doctype
(cherry picked from commit 74afa57a9f)

# Conflicts:
#	erpnext/crm/doctype/opportunity/opportunity.json
2024-08-23 08:48:29 +00:00
rohitwaghchaure
54842ea0b3 fix: stock reco with incorrect serial numbers (#42865) 2024-08-22 19:33:44 +05:30
ruthra kumar
a95a0524d9 Merge pull request #42870 from frappe/mergify/bp/version-14-hotfix/pr-42867
fix: call 'process' directly instead of creating 'process_subscription' (backport #42867)
2024-08-22 17:51:25 +05:30
ruthra kumar
dffd5f291d Merge pull request #42868 from frappe/mergify/bp/version-14-hotfix/pr-42851
refactor: Allow equity type Account in Payment Entry for shareholders (backport #42851)
2024-08-22 17:50:51 +05:30
ruthra kumar
164b417136 chore: resolve conflict 2024-08-22 17:34:31 +05:30
ruthra kumar
8412938442 fix: call 'process' directly instead of creating 'process_subscripti
reason: 'process' follows simple DB transaction model.
(cherry picked from commit b4d22c2936)
2024-08-22 11:53:32 +00:00
ruthra kumar
30ad25d86c refactor: filter shareholder on company
(cherry picked from commit 63ad9f4f86)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.js
2024-08-22 11:40:37 +00:00
ruthra kumar
651e853156 refactor: allow equity types on Payment Entry
(cherry picked from commit 6cbf98294a)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.js
2024-08-22 11:40:37 +00:00
ruthra kumar
c2fdef4d5b refactor(test): update grand total 2024-08-21 17:36:11 +05:30
ruthra kumar
678f08898a refactor(test): update tast case of rounding value 2024-08-21 15:26:47 +05:30
Frappe PR Bot
c79088f46a chore(release): Bumped to Version 14.72.2
## [14.72.2](https://github.com/frappe/erpnext/compare/v14.72.1...v14.72.2) (2024-08-21)

### Bug Fixes

* disable rename from warehouse ([ed568fb](ed568fb01d))
* disable rename from warehouse ([a520d06](a520d06c3f))
* **patch:** replace repost with direct sql to update 'against_voucher ([c98ab15](c98ab15a44))
2024-08-21 05:21:14 +00:00
ruthra kumar
d5896cd8a0 Merge pull request #42833 from frappe/version-14-hotfix
chore: release v14
2024-08-21 10:49:56 +05:30
ruthra kumar
c5dedab304 chore: resolve conflicts 2024-08-19 13:53:29 +05:30
Dany Robert
cf34219c71 fix: specify precision for net_amount (#39481)
* fix: specify precision for net_amount

* fix: correct existing test to account for precision

* fix: rounding issue in test cases

* fix: optional grand total manipulation

* fix: use `grand_total_diff` for manipulation

* fix: patch to set default for grand total manipulation

* fix: wrong rounding assertion for USD

* fix: undefined this.frm error

* chore: linters

* fix: `net_amount` percision and method rename

* fix: missing frm reference

* chore: minor cleanups and depr message

* refactor: remove optional adjusting of grand total

(cherry picked from commit 50d56db0c2)

# Conflicts:
#	erpnext/public/js/controllers/accounts.js
#	erpnext/public/js/controllers/taxes_and_totals.js
2024-08-19 04:36:52 +00:00
Frappe PR Bot
79edcb2a94 chore(release): Bumped to Version 14.72.1
## [14.72.1](https://github.com/frappe/erpnext/compare/v14.72.0...v14.72.1) (2024-08-16)

### Bug Fixes

* **patch:** replace repost with direct sql to update 'against_voucher ([f6f341a](f6f341ad58))
2024-08-16 11:09:57 +00:00
ruthra kumar
bd2f408f00 Merge pull request #42795 from frappe/mergify/bp/version-14/pr-42791
fix(patch): Use sql to update 'against_voucher' rather than reposting (backport #42791)
2024-08-16 16:38:39 +05:30
ruthra kumar
3b02f80a4e chore: resolve conflict 2024-08-16 16:04:52 +05:30
ruthra kumar
bebd1a0426 chore: update patches.txt
(cherry picked from commit 1721175a20)

# Conflicts:
#	erpnext/patches.txt
2024-08-16 10:26:22 +00:00
ruthra kumar
f6f341ad58 fix(patch): replace repost with direct sql to update 'against_voucher
(cherry picked from commit 13bb48434f)
2024-08-16 10:26:22 +00:00
ruthra kumar
752f93c630 Merge pull request #42793 from frappe/mergify/bp/version-14-hotfix/pr-42791
fix(patch): Use sql to update 'against_voucher' rather than reposting (backport #42791)
2024-08-16 15:55:22 +05:30
ruthra kumar
d14e386e18 chore: resolve conflict 2024-08-16 15:34:48 +05:30
ruthra kumar
9f687eee4e chore: update patches.txt
(cherry picked from commit 1721175a20)

# Conflicts:
#	erpnext/patches.txt
2024-08-16 10:02:34 +00:00
ruthra kumar
c98ab15a44 fix(patch): replace repost with direct sql to update 'against_voucher
(cherry picked from commit 13bb48434f)
2024-08-16 10:02:33 +00:00
kurogeek
333c7577eb fix: currency symbol on amount field suppose to show as Company's currency not as default company's currency 2024-08-16 13:52:54 +07:00
Khushi Rawat
ea7c82c6a3 chore: resolved conflicts 2024-08-15 13:12:38 +05:30
Nihantra C. Patel
54815b44e7 Merge pull request #42770 from frappe/mergify/bp/version-14-hotfix/pr-42769
fix: disable rename from warehouse (backport #42769)
2024-08-14 17:15:39 +05:30
Nihantra C. Patel
ed568fb01d fix: disable rename from warehouse 2024-08-14 16:35:34 +05:30
Nihantra C. Patel
a520d06c3f fix: disable rename from warehouse
(cherry picked from commit c1812f74e8)

# Conflicts:
#	erpnext/stock/doctype/warehouse/warehouse.json
2024-08-14 11:03:41 +00:00
Khushi Rawat
47a9325177 chore: linters check
(cherry picked from commit 0d42793397)

# Conflicts:
#	erpnext/assets/doctype/asset_capitalization/asset_capitalization.js
2024-08-14 09:07:34 +00:00
Khushi Rawat
db319f95f1 fix: removed extra filter condition
(cherry picked from commit 6fa29376a0)
2024-08-14 09:07:34 +00:00
Khushi Rawat
450b3f338e fix: set up filters for dimensions
(cherry picked from commit 2fd8de2f76)

# Conflicts:
#	erpnext/assets/doctype/asset_capitalization/asset_capitalization.js
2024-08-14 09:07:34 +00:00
Frappe PR Bot
2796aa8b57 chore(release): Bumped to Version 14.72.0
# [14.72.0](https://github.com/frappe/erpnext/compare/v14.71.0...v14.72.0) (2024-08-14)

### Bug Fixes

* dimensions in common party journal entry ([b73df8f](b73df8f5f0))
* expense causing p&l test case to fail ([a9fa9e8](a9fa9e86ea))
* force fetch updates for subcription ([f35bc43](f35bc43242))
* german translation of exit ([db27dd8](db27dd8702))
* ledger entries for pos return with update outstanding for self ([714a432](714a432c1c))
* Maintain same rate on qty change on Quotation to Sales Order ([29449cb](29449cbaf9))
* missing def expense if no exp in first month ([7cd6deb](7cd6debd0e))
* patch to fix incorrect against_voucher references in ledger ([5473546](54735469c1))
* pre-commit for better code formatting ([8f19832](8f19832aa5))
* Sort lists before calling itertools.groupby ([29cfb7c](29cfb7cf25))
* test case for zero deferred expense ([186701b](186701b54f))
* text color in sales funnel report based on theme ([2509618](25096185c9))
* typeerror on payment entry ([c4c001b](c4c001b6f9))
* update 'Paid Amount' on forex payment request ([365ef6b](365ef6b88a))
* warning message for negative stock (backport [#42683](https://github.com/frappe/erpnext/issues/42683)) ([#42709](https://github.com/frappe/erpnext/issues/42709)) ([e44daf7](e44daf73fb))

### Features

* changes in opportunity.py to show contacts and addresses from referenced and opportunities ([8d7e150](8d7e150afb))
2024-08-14 08:00:58 +00:00
ruthra kumar
a5ca5b5081 Merge pull request #42744 from frappe/version-14-hotfix
chore: release v14
2024-08-14 13:29:41 +05:30
ruthra kumar
695297b917 Merge pull request #42760 from frappe/mergify/bp/version-14-hotfix/pr-42720
fix: incorrect 'against_voucher' for Pos return with 'Update Outstanding for Self' disabled. (backport #42720)
2024-08-14 12:27:13 +05:30
ruthra kumar
8882b85888 chore: resolve conflict 2024-08-14 12:04:30 +05:30
ruthra kumar
1cddb4ff39 refactor: move patch to v14 and update patches.txt
(cherry picked from commit da2286802a)

# Conflicts:
#	erpnext/patches.txt
2024-08-14 06:26:35 +00:00
ruthra kumar
aaa6d66666 test: against_voucher for pos_returns without updating for self
(cherry picked from commit 3fb0858321)
2024-08-14 06:26:35 +00:00
ruthra kumar
fa44b0d745 refactor: update patches.txt
(cherry picked from commit 4dc0d3a003)

# Conflicts:
#	erpnext/patches.txt
2024-08-14 06:26:35 +00:00
ruthra kumar
54735469c1 fix: patch to fix incorrect against_voucher references in ledger
(cherry picked from commit 487d0a55f5)

# Conflicts:
#	erpnext/patches/v14_0/update_pos_return_ledger_entries.py
2024-08-14 06:26:34 +00:00
ruthra kumar
714a432c1c fix: ledger entries for pos return with update outstanding for self
(cherry picked from commit 2cd9b28e5b)
2024-08-14 06:26:34 +00:00
ruthra kumar
367b4177c6 Merge pull request #42748 from frappe/mergify/bp/version-14-hotfix/pr-42221
fix: Force Fetching updates on Subscriptions (backport #42221)
2024-08-13 17:24:50 +05:30
ruthra kumar
2d0dca943a chore: resolve conflict 2024-08-13 16:54:35 +05:30
ruthra kumar
456f5b644b Merge pull request #42740 from frappe/mergify/bp/version-14-hotfix/pr-42726
fix: text color in sales funnel report based on theme (backport #42726)
2024-08-13 16:49:01 +05:30
ruthra kumar
cca5aa8a96 chore: resolve conflict 2024-08-13 16:28:07 +05:30
ruthra kumar
366f383d1f refactor: test for force-fetch on future subscription
(cherry picked from commit fd680380bb)

# Conflicts:
#	erpnext/accounts/doctype/subscription/test_subscription.py
2024-08-13 10:53:15 +00:00
ruthra kumar
7752de3a1c chore: minor naming change
(cherry picked from commit d8b6767697)
2024-08-13 10:53:14 +00:00
ruthra kumar
f0f663e552 refactor: don't process future subscriptions
(cherry picked from commit 3a11577411)
2024-08-13 10:53:14 +00:00
ruthra kumar
f35bc43242 fix: force fetch updates for subcription
(cherry picked from commit 1ef890db73)

# Conflicts:
#	erpnext/accounts/doctype/subscription/subscription.js
2024-08-13 10:53:14 +00:00
ruthra kumar
b0b5b25a53 chore: resolve conflict 2024-08-13 14:38:44 +05:30
ljain112
25096185c9 fix: text color in sales funnel report based on theme
(cherry picked from commit 61bc0925d5)

# Conflicts:
#	erpnext/selling/page/sales_funnel/sales_funnel.js
2024-08-13 08:36:21 +00:00
ruthra kumar
a5b5b5e62c Merge pull request #42734 from frappe/mergify/bp/version-14-hotfix/pr-42733
refactor: add a new filter flag in Process Statement of Accounts (backport #42733)
2024-08-13 11:49:19 +05:30
ruthra kumar
e421e16fdc chore: resolve conflicts 2024-08-13 11:22:52 +05:30
ruthra kumar
cef3573d79 refactor: pass filter to General Ledger
(cherry picked from commit 90880c8c01)
2024-08-13 05:41:19 +00:00
ruthra kumar
1ebcc33cdd refactor: cr and dr note filter in Statement of Accounts
(cherry picked from commit 0cf478c4c2)

# Conflicts:
#	erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json
#	erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py
2024-08-13 05:41:19 +00:00
ruthra kumar
a9871e379a refactor: combine vouchers from both ignore
(cherry picked from commit 4cc5cd5a71)
2024-08-13 05:41:19 +00:00
ruthra kumar
34662e6e3c Merge pull request #42724 from frappe/mergify/bp/version-14-hotfix/pr-42672
fix: update 'Paid Amount' on forex payment request (backport #42672)
2024-08-12 16:36:28 +05:30
ruthra kumar
1844cb60a4 chore: resolve conflict 2024-08-12 16:14:29 +05:30
ruthra kumar
71416902f6 test: currency conversion on foreign currency account
(cherry picked from commit f913c0fde1)
2024-08-12 10:38:33 +00:00
ruthra kumar
e289793308 test: make use of test fixture
(cherry picked from commit d6d0a1b38d)

# Conflicts:
#	erpnext/accounts/doctype/payment_request/test_payment_request.py
2024-08-12 10:38:33 +00:00
ruthra kumar
365ef6b88a fix: update 'Paid Amount' on forex payment request
(cherry picked from commit 7b0dfb2a05)
2024-08-12 10:38:33 +00:00
mergify[bot]
e44daf73fb fix: warning message for negative stock (backport #42683) (#42709)
* fix: warning message for negative stock (#42683)

(cherry picked from commit deccb007c1)

# Conflicts:
#	erpnext/stock/stock_ledger.py

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-08-12 11:20:44 +05:30
ruthra kumar
a43136da5d Merge pull request #42694 from frappe/mergify/bp/version-14-hotfix/pr-42428
fix: Sort lists before calling itertools.groupby (backport #42428)
2024-08-09 12:44:24 +05:30
ruthra kumar
d0fbb4d532 Merge pull request #42692 from frappe/mergify/bp/version-14-hotfix/pr-42691
fix: typeerror on payment entry (backport #42691)
2024-08-09 11:55:49 +05:30
Corentin Forler
29cfb7cf25 fix: Sort lists before calling itertools.groupby
(cherry picked from commit 45a6ecbd38)
2024-08-09 06:23:57 +00:00
ruthra kumar
c4c001b6f9 fix: typeerror on payment entry
(cherry picked from commit 9cdca0d662)
2024-08-09 11:53:35 +05:30
Raffael Meyer
93d8e3f3b0 Merge pull request #42687 from frappe/mergify/bp/version-14-hotfix/pr-42684
fix: german translation of exit (backport #42684)
2024-08-08 23:25:58 +02:00
barredterra
db27dd8702 fix: german translation of exit
(cherry picked from commit a2df276880)
2024-08-08 21:15:03 +00:00
ruthra kumar
cc97d4e869 Merge pull request #42651 from frappe/mergify/bp/version-14-hotfix/pr-40865
fix: missing def expense if no exp in first month (backport #40865)
2024-08-08 14:37:39 +05:30
ruthra kumar
eb26610d54 Merge pull request #42677 from frappe/mergify/bp/version-14-hotfix/pr-42673
fix: Maintain same rate on qty change on Quotation to Sales Order (backport #42673)
2024-08-08 13:37:48 +05:30
ruthra kumar
29449cbaf9 fix: Maintain same rate on qty change on Quotation to Sales Order
(cherry picked from commit 91ce9fce9b)
2024-08-08 08:03:37 +00:00
Shariq Ansari
f29cad695a Merge pull request #42667 from frappe/mergify/bp/version-14-hotfix/pr-42596
fix: changes in opportunity.py to show contacts and addresses created from opportunity (backport #42596)
2024-08-08 11:39:47 +05:30
barredterra
003653c572 fix: german translations for incoterms
(cherry picked from commit 9789648175)
2024-08-07 18:54:36 +00:00
Dietmar Fischer
8f19832aa5 fix: pre-commit for better code formatting
(cherry picked from commit 511a0b9f37)
2024-08-07 14:29:48 +00:00
Dietmar Fischer
8d7e150afb feat: changes in opportunity.py to show contacts and addresses from referenced and opportunities
(cherry picked from commit 61576ca030)
2024-08-07 14:29:48 +00:00
ruthra kumar
4a77653e94 Merge pull request #42660 from frappe/mergify/bp/version-14-hotfix/pr-42578
fix: dimensions in common party journal entry (backport #42578)
2024-08-07 16:23:45 +05:30
ruthra kumar
fa74efc1fc test: dimension inheritance on Exc Gain/Loss JV on Common party
(cherry picked from commit 8040544216)
2024-08-07 10:33:23 +00:00
ljain112
b73df8f5f0 fix: dimensions in common party journal entry
(cherry picked from commit ac629ede79)
2024-08-07 10:33:22 +00:00
Frappe PR Bot
a8a8a033a1 chore(release): Bumped to Version 14.71.0
# [14.71.0](https://github.com/frappe/erpnext/compare/v14.70.14...v14.71.0) (2024-08-07)

### Bug Fixes

* 'undefined' in PL and BS report summary on Consolidated report ([a5e1432](a5e14324da))
* company filter for filtring tax withheld vouchers ([b7731c8](b7731c8fd7))
* do not update item price and last purchase rate for inter transf… (backport [#42616](https://github.com/frappe/erpnext/issues/42616)) ([#42632](https://github.com/frappe/erpnext/issues/42632)) ([5c5349e](5c5349ed16))
* filter condition in item-wise purchase register ([bc9b461](bc9b46126b))
* fixed depreciation calculation as per income tax act ([8df1079](8df1079618))
* item_code filter in item-wise sales register ([f0f8a2f](f0f8a2f01b))
* min height for rows in sales funnel ([7086a96](7086a96462))
* set query filters for sales / purchase tax template on PE ([c8d8536](c8d85364b9))
* slowness in reposting dependent vouchers. (backport [#42282](https://github.com/frappe/erpnext/issues/42282)) ([#42569](https://github.com/frappe/erpnext/issues/42569)) ([3fb6f97](3fb6f97f66))

### Features

* expiry date column in Available Batch Report (backport [#42628](https://github.com/frappe/erpnext/issues/42628)) ([#42641](https://github.com/frappe/erpnext/issues/42641)) ([83928bb](83928bbf78))
2024-08-07 09:27:57 +00:00
ruthra kumar
f0230b2dfd Merge pull request #42648 from frappe/version-14-hotfix
chore: release v14
2024-08-07 14:56:41 +05:30
Khushi Rawat
f4811c3846 Merge pull request #42629 from khushi8112/depreciation-adjustment-issue-when-field-for-income-tax-enabled
fix: depreciation calculation as per income tax act
2024-08-06 19:15:03 +05:30
Dany Robert
a9fa9e86ea fix: expense causing p&l test case to fail
(cherry picked from commit 01888c98bc)
2024-08-06 11:01:41 +00:00
Dany Robert
c67be05280 chore: semgrep
(cherry picked from commit 581af4eced)
2024-08-06 11:01:41 +00:00
Dany Robert
186701b54f fix: test case for zero deferred expense
(cherry picked from commit 7ef4dbcaf6)
2024-08-06 11:01:41 +00:00
Dany Robert
7cd6debd0e fix: missing def expense if no exp in first month
(cherry picked from commit 5c9ce575f6)
2024-08-06 11:01:41 +00:00
Nihantra C. Patel
f8fd354d75 Merge pull request #42650 from Nihantra-Patel/fix_item_sales_purchase_register
fix: item_code filter in item-wise sales-purchase register v14
2024-08-06 16:19:16 +05:30
Nihantra Patel
bc9b46126b fix: filter condition in item-wise purchase register 2024-08-06 15:56:00 +05:30
Nihantra Patel
f0f8a2f01b fix: item_code filter in item-wise sales register 2024-08-06 15:54:05 +05:30
mergify[bot]
83928bbf78 feat: expiry date column in Available Batch Report (backport #42628) (#42641)
* feat: expiry date column in Available Batch Report (#42628)

(cherry picked from commit faff84c6e5)

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

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-08-06 15:24:37 +05:30
ruthra kumar
bc50512c97 Merge pull request #42645 from frappe/mergify/bp/version-14-hotfix/pr-42592
fix: company filter for filtring tax withheld vouchers (backport #42592)
2024-08-06 13:39:17 +05:30
ljain112
b7731c8fd7 fix: company filter for filtring tax withheld vouchers
(cherry picked from commit cfe2ae604b)
2024-08-06 07:47:21 +00:00
ruthra kumar
8667bcd86b Merge pull request #42643 from frappe/mergify/bp/version-14-hotfix/pr-42545
fix: min height for rows in sales funnel (backport #42545)
2024-08-06 13:09:39 +05:30
ljain112
7086a96462 fix: min height for rows in sales funnel
(cherry picked from commit fd71d8af52)
2024-08-06 07:33:07 +00:00
ruthra kumar
2a38e14cca Merge pull request #42637 from frappe/mergify/bp/version-14-hotfix/pr-42636
refactor: posting date should not be considered for ignore filters in GL (backport #42636)
2024-08-06 11:43:54 +05:30
ruthra kumar
f4ba879203 refactor: posting date is not considered for ignore filters in GL
(cherry picked from commit c930f8ba9d)
2024-08-06 05:26:26 +00:00
mergify[bot]
5c5349ed16 fix: do not update item price and last purchase rate for inter transf… (backport #42616) (#42632)
fix: do not update item price and last purchase rate for inter transf… (#42616)

fix: do not update item price and last purchase rate for inter transfer transaction
(cherry picked from commit c8af544ef3)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-08-06 08:19:46 +05:30
Khushi Rawat
8df1079618 fix: fixed depreciation calculation as per income tax act 2024-08-05 18:04:06 +05:30
Khushi Rawat
38739bec45 Merge pull request #42630 from khushi8112/fix-semgrep
ci: fix semgrep version in linters
2024-08-05 18:01:50 +05:30
Khushi Rawat
6ceb3476a6 ci: fix semgrep version in linters 2024-08-05 17:37:29 +05:30
ruthra kumar
6cba69c7da Merge pull request #42625 from frappe/mergify/bp/version-14-hotfix/pr-42555
refactor: date filters should be mandatory in Sales Pipeline Analytics report (backport #42555)
2024-08-05 15:32:28 +05:30
ruthra kumar
ffd3aea07e refactor(test): use test fixture and supply from and to dates
(cherry picked from commit 4253caf910)
2024-08-05 09:39:27 +00:00
ruthra kumar
989ef52f59 refactor: consider empty-string as Not Assigned
(cherry picked from commit 213b2ba942)
2024-08-05 09:39:27 +00:00
ruthra kumar
baa36c6d5e refactor: report columns should be based on from and to dates
(cherry picked from commit 751a25c4b7)
2024-08-05 09:39:27 +00:00
ruthra kumar
f7f191fe50 refactor: make 'from_date' and 'to_date' mandatory
(cherry picked from commit 3617b41b95)
2024-08-05 09:39:27 +00:00
ruthra kumar
703f58ceac refactor: date filters should be explicit
(cherry picked from commit 40c166a0a0)
2024-08-05 09:39:27 +00:00
ruthra kumar
e1da019fe7 Merge pull request #42613 from frappe/mergify/bp/version-14-hotfix/pr-42597
refactor: filter to ignore system generated cr / dr reconciliation journals on general ledger (backport #42597)
2024-08-05 13:20:25 +05:30
ruthra kumar
f0bdc41a94 refactor(test): clear old records 2024-08-05 12:58:21 +05:30
ruthra kumar
392ba36dcf refactor(test): filter and reconcile concerned vouchers
(cherry picked from commit 9ade269b7a)
2024-08-05 05:43:50 +00:00
ruthra kumar
1b6539c3c5 test: clear old data
(cherry picked from commit 991069bfbc)
2024-08-05 05:43:50 +00:00
ruthra kumar
1da744dc4d refactor: make use of date filters on ignore filterss
(cherry picked from commit 03f3ab522f)
2024-08-05 05:43:50 +00:00
ruthra kumar
ac763f8c19 test: ignore filter for system generated cr / dr note journals
(cherry picked from commit 3ffac73598)
2024-08-05 05:43:50 +00:00
ruthra kumar
0a83c8b00c refactor: ignore system generated cr / dr notes on general ledger
(cherry picked from commit bb8c9b5a58)
2024-08-05 05:43:50 +00:00
ruthra kumar
b20b15af74 refactor: ignore filter in general ledger for cr / dr notes
(cherry picked from commit 59d5beee20)
2024-08-05 05:43:50 +00:00
Frappe PR Bot
4089af5a7b chore(release): Bumped to Version 14.70.14
## [14.70.14](https://github.com/frappe/erpnext/compare/v14.70.13...v14.70.14) (2024-08-01)

### Bug Fixes

* slowness in reposting dependent vouchers. (backport [#42282](https://github.com/frappe/erpnext/issues/42282)) ([#42569](https://github.com/frappe/erpnext/issues/42569)) ([cccfbf1](cccfbf193e))
2024-08-01 09:12:20 +00:00
rohitwaghchaure
06c73ef2da Merge pull request #42570 from frappe/mergify/bp/version-14/pr-42569
fix: slowness in reposting dependent vouchers. (backport #42282) (backport #42569)
2024-08-01 14:40:58 +05:30
mergify[bot]
cccfbf193e fix: slowness in reposting dependent vouchers. (backport #42282) (#42569)
fix: slowness in reposting dependent vouchers. (#42282)

(cherry picked from commit b17696a8ae)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
(cherry picked from commit 3fb6f97f66)
2024-08-01 07:52:46 +00:00
mergify[bot]
3fb6f97f66 fix: slowness in reposting dependent vouchers. (backport #42282) (#42569)
fix: slowness in reposting dependent vouchers. (#42282)

(cherry picked from commit b17696a8ae)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-08-01 13:21:37 +05:30
ruthra kumar
35f6657bae Merge pull request #42565 from frappe/mergify/bp/version-14-hotfix/pr-42563
fix: set query filters for sales / purchase tax template on PE (backport #42563)
2024-07-31 17:28:45 +05:30
ruthra kumar
e82c441326 chore: resolve conflict 2024-07-31 17:14:26 +05:30
ruthra kumar
c8d85364b9 fix: set query filters for sales / purchase tax template on PE
(cherry picked from commit 9fe47ac101)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.js
2024-07-31 11:39:09 +00:00
ruthra kumar
64234a571e Merge pull request #42559 from frappe/mergify/bp/version-14-hotfix/pr-42558
fix: 'undefined' in PL and BS report summary on Consolidated report (backport #42558)
2024-07-31 16:19:17 +05:30
ruthra kumar
a5e14324da fix: 'undefined' in PL and BS report summary on Consolidated report
(cherry picked from commit dd5a5e4919)
2024-07-31 10:03:56 +00:00
Frappe PR Bot
37a7da3371 chore(release): Bumped to Version 14.70.13
## [14.70.13](https://github.com/frappe/erpnext/compare/v14.70.12...v14.70.13) (2024-07-31)

### Bug Fixes

* builtins.KeyError: ('ABC', 'Store - CP') (backport [#42505](https://github.com/frappe/erpnext/issues/42505)) ([#42508](https://github.com/frappe/erpnext/issues/42508)) ([0256c64](0256c64634))
* consider payment entries for checking if tds is deducted ([e7432fc](e7432fc60d))
* dynamic condition in the pricing rule not working (backport [#42467](https://github.com/frappe/erpnext/issues/42467)) ([#42543](https://github.com/frappe/erpnext/issues/42543)) ([53034c3](53034c332b))
* **gross profit:** incorrect valuation rate on different warehouses ([1a7efbb](1a7efbb654))
* ignore duplicates while creating default templates ([99bc8e8](99bc8e849c))
* incorrect cost_center on AR/AP report ([0e2abbd](0e2abbd08e))
* keep status as In Progress for RIV for Timeout Error (backport [#42274](https://github.com/frappe/erpnext/issues/42274)) ([#42504](https://github.com/frappe/erpnext/issues/42504)) ([8e8d0c7](8e8d0c7bd0))
* parenttype in item wise purchase and sales register ([97f2e88](97f2e88f4c))
* performance issue for the report Purchase Order Analysis report (backport [#42503](https://github.com/frappe/erpnext/issues/42503)) ([#42506](https://github.com/frappe/erpnext/issues/42506)) ([f42f1bb](f42f1bb35f))
* price_list_currency not found error (backport [#42534](https://github.com/frappe/erpnext/issues/42534)) ([#42538](https://github.com/frappe/erpnext/issues/42538)) ([3ba6f40](3ba6f40063))
* warehouse filter in Product Bundle Balance (backport [#42532](https://github.com/frappe/erpnext/issues/42532)) ([#42536](https://github.com/frappe/erpnext/issues/42536)) ([0441984](0441984405))
2024-07-31 06:00:37 +00:00
ruthra kumar
81c362dbe4 Merge pull request #42542 from frappe/version-14-hotfix
chore: release v14
2024-07-31 11:29:23 +05:30
mergify[bot]
53034c332b fix: dynamic condition in the pricing rule not working (backport #42467) (#42543)
fix: dynamic condition in the pricing rule not working (#42467)

(cherry picked from commit 0e817f42ef)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-07-30 17:01:24 +05:30
mergify[bot]
0441984405 fix: warehouse filter in Product Bundle Balance (backport #42532) (#42536)
fix: warehouse filter in Product Bundle Balance (#42532)

(cherry picked from commit 0ecfa709d8)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-07-30 14:53:31 +05:30
mergify[bot]
3ba6f40063 fix: price_list_currency not found error (backport #42534) (#42538)
fix: price_list_currency not found error (#42534)

(cherry picked from commit 23fed831a0)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-07-30 14:52:45 +05:30
mergify[bot]
8e8d0c7bd0 fix: keep status as In Progress for RIV for Timeout Error (backport #42274) (#42504)
* fix: keep status as In Progress for RIV for Timeout Error (#42274)

(cherry picked from commit 10280d6140)

# Conflicts:
#	erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-07-30 14:25:51 +05:30
mergify[bot]
f42f1bb35f fix: performance issue for the report Purchase Order Analysis report (backport #42503) (#42506)
* fix: performance issue for the report Purchase Order Analysis report (#42503)

(cherry picked from commit cb522f8f22)

# Conflicts:
#	erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-07-30 14:25:23 +05:30
mergify[bot]
0256c64634 fix: builtins.KeyError: ('ABC', 'Store - CP') (backport #42505) (#42508)
fix: builtins.KeyError: ('ABC', 'Store - CP') (#42505)

(cherry picked from commit 25dac1f18e)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-07-30 14:25:01 +05:30
ruthra kumar
e4f583d25a Merge pull request #42529 from frappe/mergify/bp/version-14-hotfix/pr-42528
chore: button name should reflect what it creates (backport #42528)
2024-07-30 12:12:32 +05:30
ruthra kumar
7259c0fe30 chore: button name should reflect what it creates
(cherry picked from commit 0b6e7f83cd)
2024-07-30 06:31:17 +00:00
ruthra kumar
02547115e5 Merge pull request #42335 from frappe/mergify/bp/version-14-hotfix/pr-42330
fix: incorrect valuation rate for items from different warehouses in Gross Profit (backport #42330)
2024-07-29 10:17:04 +05:30
ruthra kumar
0bc9825238 Merge pull request #42491 from frappe/mergify/bp/version-14-hotfix/pr-42477
fix: incorrect cost_center on AR/AP report (backport #42477)
2024-07-26 20:10:43 +05:30
ruthra kumar
bb66126dfa test: invoice cost center reported in AR/AP report
(cherry picked from commit 9a0894fd65)
2024-07-26 14:14:32 +00:00
ruthra kumar
0e2abbd08e fix: incorrect cost_center on AR/AP report
(cherry picked from commit 3e19041fa3)
2024-07-26 14:14:32 +00:00
Smit Vora
ff78fab176 Merge pull request #42483 from frappe/mergify/bp/version-14-hotfix/pr-42305
fix: consider payment entries for checking if tds is deducted (backport #42305)
2024-07-26 15:17:05 +05:30
Smit Vora
04840762dd Merge pull request #42481 from frappe/mergify/bp/version-14-hotfix/pr-42444
fix: parenttype in purchase and sales item query (backport #42444)
2024-07-26 15:16:44 +05:30
ljain112
e7432fc60d fix: consider payment entries for checking if tds is deducted
(cherry picked from commit 40b59de4cd)
2024-07-26 09:11:50 +00:00
ljain112
97f2e88f4c fix: parenttype in item wise purchase and sales register
(cherry picked from commit 35981b8730)
2024-07-26 08:56:42 +00:00
ruthra kumar
37f24ae763 Merge pull request #42473 from frappe/mergify/bp/version-14-hotfix/pr-42472
refactor: index on Purchase Invoice 'release_date' (backport #42472)
2024-07-25 21:51:16 +05:30
ruthra kumar
25b9127bae refactor: index on Purchase Invoice 'release_date'
(cherry picked from commit 764dd12b10)
2024-07-25 15:57:59 +00:00
ruthra kumar
6e74e6f314 Merge pull request #42464 from frappe/mergify/bp/version-14-hotfix/pr-42462
refactor: provision for re-evaluating Exchange Rates in monthly frequency (backport #42462)
2024-07-24 22:11:22 +05:30
ruthra kumar
240118ee8b chore: resolve conflict 2024-07-24 18:48:32 +05:30
ruthra kumar
c1fd95ac66 refactor: hooks for monthly re-evaluation jobs
(cherry picked from commit fc4e5f165c)

# Conflicts:
#	erpnext/hooks.py
2024-07-24 13:15:15 +00:00
ruthra kumar
8e340bb7fd refactor: provision for monthly re-evaluation
(cherry picked from commit ce2b9e0f1a)

# Conflicts:
#	erpnext/setup/doctype/company/company.json
#	erpnext/setup/doctype/company/company.py
2024-07-24 13:15:15 +00:00
ruthra kumar
96a6172999 Merge pull request #42455 from frappe/mergify/bp/version-14-hotfix/pr-42390
refactor: cleaning up stale code related to reposting (backport #42390)
2024-07-24 17:35:24 +05:30
Smit Vora
d0d587432d Merge pull request #42439 from frappe/mergify/bp/version-14-hotfix/pr-42377
fix: ignore duplicates while creating default templates (backport #42377)
2024-07-24 14:25:46 +05:30
ruthra kumar
07509b5e99 chore: resolve conflicts 2024-07-24 13:07:15 +05:30
ruthra kumar
99d5b6dc71 chore: resolve conflicts 2024-07-24 13:04:57 +05:30
ruthra kumar
56b1582027 refactor(test): remove assert on 'repost_required'
(cherry picked from commit e71cb4eab7)
2024-07-24 07:29:10 +00:00
ruthra kumar
149109649d refactor: remove attribute check on 'repost_required'
(cherry picked from commit 07fc952a43)

# Conflicts:
#	erpnext/accounts/doctype/journal_entry/journal_entry.py
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.py
2024-07-24 07:29:09 +00:00
ruthra kumar
0284328e2c refactor: repost without checking on flag
(cherry picked from commit 09f429ffba)
2024-07-24 07:29:09 +00:00
ruthra kumar
a243873ab0 chore: remove stale UI code related to repost
(cherry picked from commit fe46e1d089)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
2024-07-24 07:29:09 +00:00
ruthra kumar
197e043fc9 chore: remove 'repost_required' from Journal Entry
(cherry picked from commit e81373bb6a)

# Conflicts:
#	erpnext/accounts/doctype/journal_entry/journal_entry.json
#	erpnext/accounts/doctype/journal_entry/journal_entry.py
2024-07-24 07:29:09 +00:00
ruthra kumar
925a164101 chore: remove 'repost_required' from purchase invoice
(cherry picked from commit a467888a67)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
2024-07-24 07:29:08 +00:00
ruthra kumar
8f1a4b9717 chore: remove stale 'repost_required' flag from sales invoice
(cherry picked from commit 06c5334f2a)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.json
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.py
2024-07-24 07:29:08 +00:00
ruthra kumar
67d4020241 chore: remove stale code from sales invoice
(cherry picked from commit f3fda9ce98)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.js
2024-07-24 07:29:08 +00:00
Frappe PR Bot
fe4b2e36cc chore(release): Bumped to Version 14.70.12
## [14.70.12](https://github.com/frappe/erpnext/compare/v14.70.11...v14.70.12) (2024-07-24)

### Bug Fixes

* missing cr/dr notes on payment reconciliation ([90ee21f](90ee21f868))
* remove proprietorship and update it with individual (backport [#42307](https://github.com/frappe/erpnext/issues/42307)) ([8c1f619](8c1f6196b8))
* set pos data if not return doc ([6ecb064](6ecb064264))
* Show the rows in AR/AP report where outstanding equals to 0.01 ([2936988](2936988cc6))
2024-07-24 07:26:52 +00:00
ruthra kumar
6759b90f85 Merge pull request #42448 from frappe/version-14-hotfix
chore: release v14
2024-07-24 12:55:36 +05:30
Smit Vora
99bc8e849c fix: ignore duplicates while creating default templates
(cherry picked from commit cf55c2ab3d)
2024-07-23 04:56:31 +00:00
ruthra kumar
7a25d33547 Merge pull request #42408 from frappe/mergify/bp/version-14-hotfix/pr-42407
test: basic test case for item-wise purchase register (backport #42407)
2024-07-21 20:08:19 +05:30
ruthra kumar
2466e28bf5 test: basic test case for item-wise purchase register
(cherry picked from commit c3c5d3f615)
2024-07-19 11:21:08 +00:00
ruthra kumar
1096528bb9 Merge pull request #42401 from frappe/mergify/bp/version-14-hotfix/pr-42386
fix: set pos data if not return doc (backport #42386)
2024-07-19 10:57:20 +05:30
ljain112
6ecb064264 fix: set pos data if not return doc
(cherry picked from commit 65d672da65)
2024-07-19 04:56:26 +00:00
ruthra kumar
92300b27c9 Merge pull request #42384 from frappe/mergify/bp/version-14-hotfix/pr-42374
fix: Show the rows in AR/AP report where outstanding equals to 0.01 (backport #42374)
2024-07-18 15:08:55 +05:30
ruthra kumar
4fa9626de0 chore: resolve conflict 2024-07-18 14:41:09 +05:30
ruthra kumar
9b828b829a test: AR/AP report on miniscule outstanding
(cherry picked from commit bb9e42cce2)
2024-07-18 08:15:39 +00:00
Nabin Hait
2936988cc6 fix: Show the rows in AR/AP report where outstanding equals to 0.01
(cherry picked from commit e1dedc5402)

# Conflicts:
#	erpnext/patches.txt
2024-07-18 08:15:38 +00:00
ruthra kumar
9fca232578 Merge pull request #42382 from frappe/mergify/bp/version-14-hotfix/pr-42369
fix: missing cr/dr notes on payment reconciliation (backport #42369)
2024-07-18 13:43:36 +05:30
ruthra kumar
fac22e93d0 chore: resolve conflict 2024-07-18 12:44:34 +05:30
ruthra kumar
3109efaf09 test: payment filter should not affect dr/cr notes
(cherry picked from commit 2d686c06ea)

# Conflicts:
#	erpnext/accounts/doctype/payment_reconciliation/test_payment_reconciliation.py
2024-07-18 07:12:45 +00:00
ruthra kumar
90ee21f868 fix: missing cr/dr notes on payment reconciliation
(cherry picked from commit a30af68e9e)
2024-07-18 07:12:45 +00:00
Smit Vora
36c46bb344 Merge pull request #42366 from vorasmit/update-prop-backport
fix: remove redundant proprietorship field from customer type and supplier type (backport #42307)
2024-07-17 18:55:40 +05:30
Sanket322
8c1f6196b8 fix: remove proprietorship and update it with individual (backport #42307) 2024-07-17 14:03:52 +05:30
Frappe PR Bot
12a31de25a chore(release): Bumped to Version 14.70.11
## [14.70.11](https://github.com/frappe/erpnext/compare/v14.70.10...v14.70.11) (2024-07-17)

### Bug Fixes

* missing discount on POS Credit Notes ([ac48c3d](ac48c3d4e7))
2024-07-17 05:11:39 +00:00
ruthra kumar
3b9400755e Merge pull request #42353 from frappe/version-14-hotfix
chore: release v14
2024-07-17 10:40:24 +05:30
ruthra kumar
2ce7300c3c Merge pull request #42337 from frappe/mergify/bp/version-14-hotfix/pr-42294
refactor: make reposting implicit (backport #42294)
2024-07-15 15:41:23 +05:30
ruthra kumar
b96b3b51b6 chore: resolve conflicts 2024-07-15 15:22:06 +05:30
ruthra kumar
8f03769bf2 chore: contextual comments
(cherry picked from commit 794a62aecb)
2024-07-15 09:41:56 +00:00
ruthra kumar
d20f3ab492 refactor(test): reposting happens implicitly
(cherry picked from commit c283cda169)
2024-07-15 09:41:56 +00:00
ruthra kumar
980ca1d8c5 refactor(test): no need to assert repost_required flag
Reposting happens implicitly upon 'Update After Submit'

(cherry picked from commit 8f135e9859)

# Conflicts:
#	erpnext/accounts/doctype/journal_entry/test_journal_entry.py
2024-07-15 09:41:56 +00:00
ruthra kumar
4668a2d7d8 refactor: make reposting implicit
(cherry picked from commit 722ef92324)

# Conflicts:
#	erpnext/accounts/doctype/journal_entry/journal_entry.py
2024-07-15 09:41:56 +00:00
ruthra kumar
1a7efbb654 fix(gross profit): incorrect valuation rate on different warehouses
(cherry picked from commit f9d2dd0a62)
2024-07-15 08:50:15 +00:00
ruthra kumar
ccc2a47e73 Merge pull request #42290 from frappe/mergify/bp/version-14-hotfix/pr-42192
refactor: tests for item wise sales register report (backport #42192)
2024-07-12 09:28:05 +05:30
ruthra kumar
f98716cc2a refactor(test): clear old records 2024-07-11 21:03:29 +05:30
ruthra kumar
7903e8d669 refactor(test): use each instance UOM for assertion
(cherry picked from commit cf4fbfb601)
2024-07-11 12:34:13 +00:00
ruthra kumar
9a50a0a129 refactor: test suite for item-wise sales register
(cherry picked from commit 3aaa22e672)
2024-07-11 12:34:12 +00:00
ruthra kumar
1646517dc4 chore: rename test suite for payable report
(cherry picked from commit 9474f72776)
2024-07-11 12:34:12 +00:00
ruthra kumar
38811e792c Merge pull request #42288 from frappe/mergify/bp/version-14-hotfix/pr-42287
fix: missing discount on POS Credit Notes (backport #42287)
2024-07-11 17:33:26 +05:30
ruthra kumar
edfb408464 chore: resolve conflict 2024-07-11 17:31:20 +05:30
ruthra kumar
ac48c3d4e7 fix: missing discount on POS Credit Notes
(cherry picked from commit 1049550951)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.js
2024-07-11 11:58:57 +00:00
Frappe PR Bot
1d66b7e5a3 chore(release): Bumped to Version 14.70.10
## [14.70.10](https://github.com/frappe/erpnext/compare/v14.70.9...v14.70.10) (2024-07-10)

### Bug Fixes

* add missing german translations ([d5c1c62](d5c1c62622))
* empty item-wise sales/purchase register reports on initial load ([13895fa](13895fa060))
* fetch expence account from asset category ([4d6a71a](4d6a71ab4b))
* group by in item-wise purchase register ([62ad466](62ad466a3b))
* **Holiday List:** sort holidays on save to avoid disorienting the user (backport [#42236](https://github.com/frappe/erpnext/issues/42236)) ([#42251](https://github.com/frappe/erpnext/issues/42251)) ([fcf6500](fcf6500144))
* manual pick allow to pick more than available stock (backport [#42155](https://github.com/frappe/erpnext/issues/42155)) ([#42158](https://github.com/frappe/erpnext/issues/42158)) ([454e147](454e147592))
* multiple free items on same Item Group ([701dd9e](701dd9e19b))
* removed max discount validation for sales return ([4195c50](4195c50f02))
* stock qty validation in SCR (backport [#42124](https://github.com/frappe/erpnext/issues/42124)) ([#42224](https://github.com/frappe/erpnext/issues/42224)) ([e2f8e02](e2f8e02c73))
* tax on stock_rbnb on repost of Purchase Receipt ([106c154](106c154a16))
* **tds:** use doctype reference when mapping keys across multiple doctypes ([51cbbee](51cbbee4ca))
* updated logic for calculating tax_withholding_net_total in payment entry ([49e5066](49e50662b6))
* use standard method to get `_doc_before_save` ([9fde733](9fde7330e0))
2024-07-10 10:43:56 +00:00
ruthra kumar
ab9bde86f9 Merge pull request #42254 from frappe/version-14-hotfix
chore: release v14
2024-07-10 16:12:40 +05:30
ruthra kumar
5c75bb8775 Merge pull request #42271 from frappe/mergify/bp/version-14-hotfix/pr-42247
fix: don't merge tax into stock account on purchase receipt repost (backport #42247)
2024-07-10 15:52:00 +05:30
ruthra kumar
115a0123ed chore: resolve conflict 2024-07-10 15:30:24 +05:30
ruthra kumar
fdf1dfe46e test: tax account heads on PR report without LCV
(cherry picked from commit 9562628ed6)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
2024-07-10 09:58:30 +00:00
ruthra kumar
106c154a16 fix: tax on stock_rbnb on repost of Purchase Receipt
(cherry picked from commit 8633080dff)
2024-07-10 09:58:30 +00:00
Smit Vora
00e8b862dd Merge pull request #42264 from frappe/mergify/bp/version-14-hotfix/pr-42127
fix: removed max discount validation for sales return (backport #42127)
2024-07-10 15:22:51 +05:30
ljain112
4195c50f02 fix: removed max discount validation for sales return
(cherry picked from commit db807d433b)
2024-07-10 07:01:54 +00:00
Smit Vora
fdb8e5b379 Merge pull request #42262 from ljain112/fix-tds-backport
fix(tds): use doctype reference when mapping keys across multiple doctype (backport #42258)
2024-07-10 12:27:28 +05:30
ljain112
51cbbee4ca fix(tds): use doctype reference when mapping keys across multiple doctypes 2024-07-10 11:55:35 +05:30
Sagar Vora
5000c09759 Merge pull request #42261 from frappe/mergify/bp/version-14-hotfix/pr-42060
fix: updated logic for calculating tax_withholding_net_total in payment entry (backport #42060)
2024-07-10 11:24:31 +05:30
ljain112
49e50662b6 fix: updated logic for calculating tax_withholding_net_total in payment entry
(cherry picked from commit c8a34cde7f)
2024-07-10 05:53:37 +00:00
ruthra kumar
f2f1f32826 Merge pull request #42163 from frappe/mergify/bp/version-14-hotfix/pr-42162
refactor: remove obsolete function call (backport #42162)
2024-07-10 10:28:37 +05:30
mergify[bot]
fcf6500144 fix(Holiday List): sort holidays on save to avoid disorienting the user (backport #42236) (#42251)
* fix(Holiday List): sort holidays on save to avoid disorienting the user (#42236)

fix: sort holidays on save to avoid disorienting the user
(cherry picked from commit ad137250fc)

# Conflicts:
#	erpnext/setup/doctype/holiday_list/holiday_list.py

* chore: fix conflicts

---------

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2024-07-09 18:44:08 +05:30
Raffael Meyer
f2d5a69af4 Merge pull request #42237 from frappe/mergify/bp/version-14-hotfix/pr-42235
fix: add missing german translations (backport #42235)
2024-07-08 19:53:18 +02:00
barredterra
d5c1c62622 fix: add missing german translations
(cherry picked from commit 2f89461ace)
2024-07-08 17:51:41 +00:00
mergify[bot]
e2f8e02c73 fix: stock qty validation in SCR (backport #42124) (#42224)
* fix: stock qty validation in SCR (#42124)

(cherry picked from commit 99f2735ad3)

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

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-07-08 17:06:23 +05:30
Frappe PR Bot
30cba7ee2c chore(release): Bumped to Version 14.70.9
## [14.70.9](https://github.com/frappe/erpnext/compare/v14.70.8...v14.70.9) (2024-07-05)

### Bug Fixes

* blank item-wise sales/purchase register reports on first load ([0f275a9](0f275a9ff0))
* group by in item-wise purchase register ([1840267](18402677da))
2024-07-05 02:47:14 +00:00
ruthra kumar
21a60c9927 Merge pull request #42190 from frappe/mergify/bp/version-14/pr-41975
fix: group by in item-wise purchase register (backport #41975)
2024-07-05 08:15:53 +05:30
ruthra kumar
0f275a9ff0 fix: blank item-wise sales/purchase register reports on first load 2024-07-05 07:50:37 +05:30
Nihantra C. Patel
18402677da fix: group by in item-wise purchase register
(cherry picked from commit 3fab00135b)
2024-07-05 02:05:26 +00:00
ruthra kumar
e9357c193d Merge pull request #42184 from frappe/mergify/bp/version-14-hotfix/pr-42183
fix: empty item-wise sales/purchase register reports on initial load (backport #42183)
2024-07-04 15:10:30 +05:30
ruthra kumar
13895fa060 fix: empty item-wise sales/purchase register reports on initial load
(cherry picked from commit ee862126e4)
2024-07-04 09:36:58 +00:00
ruthra kumar
64f8498576 Merge pull request #42180 from frappe/mergify/bp/version-14-hotfix/pr-41975
fix: group by in item-wise purchase register (backport #41975)
2024-07-04 14:59:50 +05:30
Nihantra C. Patel
62ad466a3b fix: group by in item-wise purchase register
(cherry picked from commit 3fab00135b)
2024-07-04 09:09:07 +00:00
Khushi Rawat
45899b3017 Merge pull request #42174 from khushi8112/fetch-expence-account-from-asset-category
fix: fetch expense account from asset category
2024-07-04 13:14:39 +05:30
ruthra kumar
d92a042bf7 Merge pull request #42172 from frappe/mergify/bp/version-14-hotfix/pr-42143
refactor: validation to prevent recursion with mixed conditions (backport #42143)
2024-07-04 09:20:35 +05:30
Khushi Rawat
4d6a71ab4b fix: fetch expence account from asset category 2024-07-04 01:45:01 +05:30
ruthra kumar
d5fa968078 chore: resolve conflicts 2024-07-03 20:59:27 +05:30
ruthra kumar
71cbebd31b test: validation on mixed condition and recursion on pricing rule
(cherry picked from commit eb4af58bf0)

# Conflicts:
#	erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
2024-07-03 15:26:56 +00:00
ruthra kumar
99317768f6 test: validation on mixed condition with recursion
(cherry picked from commit 9bd4e7b709)

# Conflicts:
#	erpnext/accounts/doctype/promotional_scheme/test_promotional_scheme.py
2024-07-03 15:26:56 +00:00
ruthra kumar
9fde7330e0 fix: use standard method to get _doc_before_save
(cherry picked from commit 9d7be293ae)
2024-07-03 15:26:56 +00:00
ruthra kumar
49fb6bec6a refactor: validation to prevent recursion with mixed conditions
(cherry picked from commit 406dfd528f)
2024-07-03 15:26:55 +00:00
ruthra kumar
0f1f5b6f3d Merge pull request #42169 from frappe/mergify/bp/version-14-hotfix/pr-42165
fix: multiple free items on same Item Group (backport #42165)
2024-07-03 20:55:34 +05:30
mergify[bot]
454e147592 fix: manual pick allow to pick more than available stock (backport #42155) (#42158)
* fix: manual pick allow to pick more than available stock (#42155)

(cherry picked from commit 938dd4b2aa)

# Conflicts:
#	erpnext/stock/doctype/pick_list/test_pick_list.py

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-07-03 19:28:18 +05:30
ruthra kumar
701dd9e19b fix: multiple free items on same Item Group
(cherry picked from commit c4ae0d283f)
2024-07-03 12:28:35 +00:00
Markus Lobedann
2cf82561f6 refactor: remove obsolete function call (#42162)
(cherry picked from commit 4512432816)
2024-07-03 10:22:23 +00:00
Frappe PR Bot
f2d113dcf2 chore(release): Bumped to Version 14.70.8
## [14.70.8](https://github.com/frappe/erpnext/compare/v14.70.7...v14.70.8) (2024-07-03)

### Bug Fixes

* always post to tax account heads if LCV is booked ([650b25f](650b25fc23))
* asset value correction in fixed asset register ([#41943](https://github.com/frappe/erpnext/issues/41943)) ([a2ee463](a2ee4631cc))
* consistent query field name in item wise purchase register with item wise sales register ([9665212](9665212607))
* **Delivery Note:** only show permitted actions ([0aa246c](0aa246c39e))
* dynamic_link for party in customer and supplier dashboard ([6de7a8d](6de7a8de10))
* incorrect against_account upon reposting ([6028a19](6028a19e6b))
* Re-open allows SO's to be over credit limit ([952a7b4](952a7b46d5))
* **Sales Order:** only show permitted actions ([5468a3b](5468a3b0b7))
* timeout while cancelling LCV ([#42030](https://github.com/frappe/erpnext/issues/42030)) ([21bf7fd](21bf7fd1f8))
2024-07-03 05:02:59 +00:00
ruthra kumar
97e4495f1f Merge pull request #42141 from frappe/version-14-hotfix
chore: release v14
2024-07-03 10:31:45 +05:30
ruthra kumar
26c99351fd Merge pull request #42150 from frappe/mergify/bp/version-14-hotfix/pr-42073
fix: always post to tax account heads if LCV is booked (backport #42073)
2024-07-03 07:44:36 +05:30
ruthra kumar
4d99449aa8 chore: resolve conflict 2024-07-03 07:16:08 +05:30
ruthra kumar
72b93805fd refactor(test): fix flaky test
(cherry picked from commit 0e256b8b29)
2024-07-03 01:34:50 +00:00
ruthra kumar
f31ed75578 refactor(test): cleanup test data
(cherry picked from commit 6ba6b5aa33)
2024-07-03 01:34:50 +00:00
ruthra kumar
003d7e9f3e test: Repost should not merge expense accounts from LCV
(cherry picked from commit fa56555150)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
2024-07-03 01:34:49 +00:00
ruthra kumar
650b25fc23 fix: always post to tax account heads if LCV is booked
(cherry picked from commit 0fcd5d5130)
2024-07-03 01:34:49 +00:00
ruthra kumar
d5366c5873 Merge pull request #42131 from frappe/mergify/bp/version-14-hotfix/pr-42126
fix: Re-open allows SO's to be over credit limit (backport #42126)
2024-07-01 17:25:50 +05:30
ruthra kumar
bf36b4fa11 chore: resolve conflict 2024-07-01 17:05:56 +05:30
ruthra kumar
f4fc26b52e test: credit check on Sales Order re-open
(cherry picked from commit 60694e09c4)

# Conflicts:
#	erpnext/selling/doctype/sales_order/test_sales_order.py
2024-07-01 11:33:36 +00:00
ruthra kumar
952a7b46d5 fix: Re-open allows SO's to be over credit limit
(cherry picked from commit 5eed781263)
2024-07-01 11:33:35 +00:00
Smit Vora
cc9857affd Merge pull request #42064 from frappe/mergify/bp/version-14-hotfix/pr-41979
fix: dynamic_link for party in customer and supplier dashboard (backport #41979)
2024-06-28 13:04:35 +05:30
ljain112
6de7a8de10 fix: dynamic_link for party in customer and supplier dashboard
(cherry picked from commit c0a8800832)
2024-06-28 06:35:17 +00:00
Frappe PR Bot
b593f57637 chore: release v14 (#42023)
* fix(Sales Order): only show permitted actions

(cherry picked from commit c29d955371)

# Conflicts:
#	erpnext/selling/doctype/sales_order/sales_order.js

* fix(Delivery Note): only show permitted actions

(cherry picked from commit 418bdc1dcc)

# Conflicts:
#	erpnext/stock/doctype/delivery_note/delivery_note.js

* fix: consistent query field name in item wise purchase register with item wise sales register

* chore: resolve conflicts

* refactor: remove use of can_create for Payment Request (#41647)

(cherry picked from commit 47bc5691a1)

* fix: incorrect against_account upon reposting

(cherry picked from commit 20c4098399)

* fix: asset value correction in fixed asset register (#41943)

* fix: timeout while cancelling LCV (#42030)

fix: timeout while canelling LCV

---------

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
Co-authored-by: ljain112 <ljain112@gmail.com>
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
Co-authored-by: Khushi Rawat <142375893+khushi8112@users.noreply.github.com>
2024-06-26 18:02:23 +05:30
rohitwaghchaure
21bf7fd1f8 fix: timeout while cancelling LCV (#42030)
fix: timeout while canelling LCV
2024-06-25 17:38:03 +05:30
Khushi Rawat
a2ee4631cc fix: asset value correction in fixed asset register (#41943) 2024-06-25 16:04:20 +05:30
ruthra kumar
92ca6c6538 Merge pull request #41983 from frappe/mergify/bp/version-14-hotfix/pr-41981
fix: incorrect against_account upon reposting (backport #41981)
2024-06-21 19:10:41 +05:30
ruthra kumar
6028a19e6b fix: incorrect against_account upon reposting
(cherry picked from commit 20c4098399)
2024-06-21 12:30:39 +00:00
Raffael Meyer
87dc586543 Merge pull request #41440 from frappe/mergify/bp/version-14-hotfix/pr-41384
fix(SO, DN): only show permitted actions (backport #41384)
2024-06-20 15:51:18 +02:00
barredterra
22216b275c refactor: remove use of can_create for Payment Request (#41647)
(cherry picked from commit 47bc5691a1)
2024-06-20 14:21:30 +02:00
barredterra
0e6edf763e chore: resolve conflicts 2024-06-20 14:15:26 +02:00
barredterra
e77534ba2b Merge remote-tracking branch 'upstream/version-14-hotfix' into mergify/bp/version-14-hotfix/pr-41384 2024-06-20 13:47:58 +02:00
rohitwaghchaure
ae14b86a8c Merge pull request #41954 from ljain112/fix-41927
fix: consistent query field name in item wise purchase register with …
2024-06-20 14:03:12 +05:30
ljain112
9665212607 fix: consistent query field name in item wise purchase register with item wise sales register 2024-06-20 11:11:43 +05:30
Frappe PR Bot
5ae9ec2657 chore(release): Bumped to Version 14.70.7
## [14.70.7](https://github.com/frappe/erpnext/compare/v14.70.6...v14.70.7) (2024-06-19)

### Bug Fixes

* add LCV flag to determine negative expenses ([20b8ee1](20b8ee1e90))
* allow Auditor to read a Fiscal Year ([b1a911a](b1a911aa9c))
* allow Auditor to select a company ([18b6d50](18b6d50a31))
* allow Employee role to select Department (backport [#41877](https://github.com/frappe/erpnext/issues/41877)) ([#41880](https://github.com/frappe/erpnext/issues/41880)) ([245c6d8](245c6d8672))
* migrate lead notes ([8f5278e](8f5278e3d4))
* only show user and date if available ([598c581](598c581623))
* parameters for PI references ([d484553](d48455393e))
* regional overide for updating item valution ([6441bc7](6441bc7862))
* reposting validation related PCV ([bcfc83d](bcfc83d8d5))
* reset perpetual inventory flag after test ([eae5f27](eae5f27ec8))
2024-06-19 06:25:45 +00:00
ruthra kumar
890289563a Merge pull request #41942 from frappe/version-14-hotfix
chore: release v14
2024-06-19 11:54:25 +05:30
Raffael Meyer
ee49e83020 Merge pull request #41944 from frappe/mergify/bp/version-14-hotfix/pr-41421
fix: migrate lead notes (backport #41421)
2024-06-19 01:17:48 +02:00
barredterra
598c581623 fix: only show user and date if available
(cherry picked from commit 895aede590)
2024-06-18 22:57:20 +00:00
barredterra
8f5278e3d4 fix: migrate lead notes
(cherry picked from commit 382d0ff453)
2024-06-18 22:57:19 +00:00
Raffael Meyer
aa38f69a67 Merge pull request #40543 from frappe/mergify/bp/version-14-hotfix/pr-40542 2024-06-18 12:51:55 +02:00
ruthra kumar
57a81c4012 Merge pull request #41937 from frappe/mergify/bp/version-14-hotfix/pr-41900
refactor: ignore unreconcile doc for PO and SO on cancel/delete (backport #41900)
2024-06-18 11:57:27 +05:30
ruthra kumar
2fabcb0c50 chore: resolve conflicts 2024-06-18 10:43:07 +05:30
ljain112
f833923f2f refactor: ignore unreconcile doc for PO and SO on cancel/delete
(cherry picked from commit b618d685c6)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.js
#	erpnext/selling/doctype/sales_order/sales_order.js
2024-06-18 04:57:52 +00:00
rohitwaghchaure
077cb9e983 Merge pull request #41934 from frappe/mergify/bp/version-14-hotfix/pr-41931
fix: reposting validation related PCV (backport #41931)
2024-06-18 09:41:58 +05:30
Rohit Waghchaure
bcfc83d8d5 fix: reposting validation related PCV
(cherry picked from commit 194f1dc674)
2024-06-17 12:22:00 +00:00
ruthra kumar
a5d1feef02 Merge pull request #41912 from frappe/mergify/bp/version-14-hotfix/pr-40187
fix: valuation tax entries on LCV after billing PR (backport #40187)
2024-06-17 13:54:06 +05:30
ruthra kumar
b050110544 chore: resolve conflicts 2024-06-17 07:12:51 +05:30
Gursheen Anand
e8f5c45751 chore: resolve conflicts
(cherry picked from commit 54a58e9205)
2024-06-15 15:12:23 +00:00
Gursheen Anand
eae5f27ec8 fix: reset perpetual inventory flag after test
(cherry picked from commit 0b36cbe307)
2024-06-15 15:12:23 +00:00
Gursheen Anand
d48455393e fix: parameters for PI references
(cherry picked from commit 8b3d46610e)
2024-06-15 15:12:23 +00:00
Gursheen Anand
7c699c8a38 test: LCV entries after billing
(cherry picked from commit 53642e7417)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
2024-06-15 15:12:23 +00:00
Gursheen Anand
20b8ee1e90 fix: add LCV flag to determine negative expenses
(cherry picked from commit baa3fee1bf)

# Conflicts:
#	erpnext/controllers/stock_controller.py
2024-06-15 15:12:22 +00:00
Smit Vora
f9a7bb0544 Merge pull request #41889 from frappe/mergify/bp/version-14-hotfix/pr-41842
fix: regional overide for updating item valution (backport #41842)
2024-06-15 09:16:18 +05:30
ljain112
6441bc7862 fix: regional overide for updating item valution
(cherry picked from commit 1a10f0bcbd)
2024-06-13 08:09:01 +00:00
Raffael Meyer
a5df0f2c94 Merge pull request #41660 from frappe/mergify/bp/version-14-hotfix/pr-41659
fix: Auditor permissions (backport #41659)
2024-06-12 17:47:30 +02:00
mergify[bot]
e33416a4a7 Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr-41659 2024-06-12 12:13:11 +00:00
mergify[bot]
245c6d8672 fix: allow Employee role to select Department (backport #41877) (#41880)
* fix: allow Employee role to select Department (#41877)

(cherry picked from commit 56082f5a29)

# Conflicts:
#	erpnext/setup/doctype/department/department.json

* chore: fix conflicts

---------

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2024-06-12 17:19:16 +05:30
Frappe PR Bot
32fba94b2a chore(release): Bumped to Version 14.70.6
## [14.70.6](https://github.com/frappe/erpnext/compare/v14.70.5...v14.70.6) (2024-06-11)

### Bug Fixes

* Add additional condition application ([e79e9e9](e79e9e94d0))
* fixing Item-wise sales register ([5d97c7c](5d97c7cff9))
* fixing Item-wise sales register [#41373](https://github.com/frappe/erpnext/issues/41373) ([ab90b81](ab90b815e3))
* fixing Item-wise sales register and purchase register [#41373](https://github.com/frappe/erpnext/issues/41373) ([ee47440](ee47440063))
* Item-wise Sales and Purchase register with no item codes [#41373](https://github.com/frappe/erpnext/issues/41373) ([bc24e75](bc24e75c24))
* terms and conditions for material request (backport [#41834](https://github.com/frappe/erpnext/issues/41834)) ([#41836](https://github.com/frappe/erpnext/issues/41836)) ([7234625](7234625d65))
2024-06-11 13:07:24 +00:00
rohitwaghchaure
a6ed10b712 Merge pull request #41853 from frappe/version-14-hotfix
chore: release v14
2024-06-11 18:36:07 +05:30
mergify[bot]
7234625d65 fix: terms and conditions for material request (backport #41834) (#41836)
fix: terms and conditions for material request (#41834)

(cherry picked from commit 4b026d66dc)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-06-10 15:17:06 +05:30
Frappe PR Bot
0c4a2af9ab chore(release): Bumped to Version 14.70.5
## [14.70.5](https://github.com/frappe/erpnext/compare/v14.70.4...v14.70.5) (2024-06-10)

### Bug Fixes

* Add additional condition application ([810378c](810378c899))
* fixing Item-wise sales register ([3823e0e](3823e0e494))
* fixing Item-wise sales register [#41373](https://github.com/frappe/erpnext/issues/41373) ([e8286d7](e8286d7b3c))
* fixing Item-wise sales register and purchase register [#41373](https://github.com/frappe/erpnext/issues/41373) ([fd73a8a](fd73a8a348))
* Item-wise Sales and Purchase register with no item codes [#41373](https://github.com/frappe/erpnext/issues/41373) ([91de469](91de46922d))
2024-06-10 04:55:25 +00:00
Deepesh Garg
5ba0082bc7 Merge pull request #41832 from frappe/mergify/bp/version-14/pr-41829
fix: Item-wise Sales and Purchase register with no item codes (#41424)
2024-06-10 10:24:04 +05:30
Deepesh Garg
47b3e96a37 chore: resolve conflicts
(cherry picked from commit e9b7d00afb)
2024-06-10 04:53:29 +00:00
Deepesh Garg
810378c899 fix: Add additional condition application
(cherry picked from commit 8ec364df6f)

# Conflicts:
#	erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py
(cherry picked from commit e79e9e94d0)
2024-06-10 04:53:29 +00:00
Deepesh Garg
bdf198c94f chore: update condition queries in qb
(cherry picked from commit d2af36e1eb)

# Conflicts:
#	erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py
#	erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py
(cherry picked from commit e94e15259b)
2024-06-10 04:53:29 +00:00
Poorvi-R-Bhat
e8286d7b3c fix: fixing Item-wise sales register #41373
(cherry picked from commit eafa88b8e9)

# Conflicts:
#	erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py
(cherry picked from commit ab90b815e3)
2024-06-10 04:53:29 +00:00
Poorvi-R-Bhat
fd73a8a348 fix: fixing Item-wise sales register and purchase register #41373
(cherry picked from commit 76073ae228)

# Conflicts:
#	erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py
(cherry picked from commit ee47440063)
2024-06-10 04:53:29 +00:00
Poorvi-R-Bhat
91de46922d fix: Item-wise Sales and Purchase register with no item codes #41373
(cherry picked from commit 1b45ecfcae)

# Conflicts:
#	erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py
#	erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py
(cherry picked from commit bc24e75c24)
2024-06-10 04:53:29 +00:00
Poorvi
3823e0e494 fix: fixing Item-wise sales register
(cherry picked from commit c90185f533)
(cherry picked from commit 5d97c7cff9)
2024-06-10 04:53:28 +00:00
Deepesh Garg
625aa4ef6b Merge pull request #41829 from frappe/mergify/bp/version-14-hotfix/pr-41424
fix: Item-wise Sales and Purchase register with no item codes (#41424)
2024-06-09 22:38:15 +05:30
Deepesh Garg
e9b7d00afb chore: resolve conflicts 2024-06-09 22:17:30 +05:30
Deepesh Garg
e79e9e94d0 fix: Add additional condition application
(cherry picked from commit 8ec364df6f)

# Conflicts:
#	erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py
2024-06-09 14:13:27 +00:00
Deepesh Garg
e94e15259b chore: update condition queries in qb
(cherry picked from commit d2af36e1eb)

# Conflicts:
#	erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py
#	erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py
2024-06-09 14:13:27 +00:00
Poorvi-R-Bhat
ab90b815e3 fix: fixing Item-wise sales register #41373
(cherry picked from commit eafa88b8e9)

# Conflicts:
#	erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py
2024-06-09 14:13:25 +00:00
Poorvi-R-Bhat
ee47440063 fix: fixing Item-wise sales register and purchase register #41373
(cherry picked from commit 76073ae228)

# Conflicts:
#	erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py
2024-06-09 14:13:24 +00:00
Poorvi-R-Bhat
bc24e75c24 fix: Item-wise Sales and Purchase register with no item codes #41373
(cherry picked from commit 1b45ecfcae)

# Conflicts:
#	erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py
#	erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py
2024-06-09 14:13:23 +00:00
Poorvi
5d97c7cff9 fix: fixing Item-wise sales register
(cherry picked from commit c90185f533)
2024-06-09 14:13:23 +00:00
ruthra kumar
e38383a757 Merge pull request #41806 from frappe/mergify/bp/version-14-hotfix/pr-41804
chore: repost settings permission overhaul (backport #41804)
2024-06-06 16:34:18 +05:30
ruthra kumar
a5bda0180e chore: repost settings permission overhaul
(cherry picked from commit 458d8f5ed8)
2024-06-06 16:13:55 +05:30
Frappe PR Bot
b6648eebfa chore(release): Bumped to Version 14.70.4
## [14.70.4](https://github.com/frappe/erpnext/compare/v14.70.3...v14.70.4) (2024-06-05)

### Bug Fixes

* Filters in account balance report ([570985f](570985f40e))
* get assets received but not billed account only if any asset item is received ([#41734](https://github.com/frappe/erpnext/issues/41734)) ([39885b2](39885b2b01))
* Ignore disabling default currency field while creating new company (backport [#41699](https://github.com/frappe/erpnext/issues/41699)) ([#41760](https://github.com/frappe/erpnext/issues/41760)) ([5ab5bd1](5ab5bd138f))
* payment term when creating PO from SO (backport [#41376](https://github.com/frappe/erpnext/issues/41376)) ([#41743](https://github.com/frappe/erpnext/issues/41743)) ([dc32657](dc3265751c))
2024-06-05 01:17:52 +00:00
ruthra kumar
faa3c7c3a4 Merge pull request #41774 from frappe/version-14-hotfix
chore: release v14
2024-06-05 06:46:34 +05:30
mergify[bot]
5ab5bd138f fix: Ignore disabling default currency field while creating new company (backport #41699) (#41760)
fix: Ignore disabling default currency field while creating new company (#41699)

(cherry picked from commit 80f6228d45)

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2024-06-04 11:55:42 +05:30
mergify[bot]
dc3265751c fix: payment term when creating PO from SO (backport #41376) (#41743)
fix: payment term when creating PO from SO (#41376)

* fix: payment term when creating PO from SO

* fix: payment term when creating PO from SO

* fix: payment term when creating PO from SO

* fix: payment term when creating PO from SO

(cherry picked from commit 441596f795)

Co-authored-by: Nihantra C. Patel <141945075+Nihantra-Patel@users.noreply.github.com>
2024-06-03 18:37:26 +05:30
ruthra kumar
cf8f0e4096 Merge pull request #41745 from frappe/mergify/bp/version-14-hotfix/pr-41742
chore: System Manager should have  submit permission for repost doctypes (backport #41742)
2024-06-03 18:33:55 +05:30
ruthra kumar
8c09968e1b chore: Sys Manager shluld have submit permission for repost doctypes
(cherry picked from commit 4558f64c0f)
2024-06-03 12:20:56 +00:00
Nabin Hait
39885b2b01 fix: get assets received but not billed account only if any asset item is received (#41734)
fix: get assets received but not billed account only if any asset item received
2024-06-03 14:05:57 +05:30
Deepesh Garg
6a6a6971ba Merge pull request #41679 from frappe/mergify/bp/version-14-hotfix/pr-41676
fix: Filters in account balance report (#41676)
2024-05-31 20:02:35 +05:30
Frappe PR Bot
13dfbe3d80 chore(release): Bumped to Version 14.70.3
## [14.70.3](https://github.com/frappe/erpnext/compare/v14.70.2...v14.70.3) (2024-05-29)

### Bug Fixes

* add in some indices to speed up Purchase Order deletion ([c16c41e](c16c41ee59))
* Add to Cart button width for Mobile/Tablet ([819ced4](819ced4cb3))
* cost center filter according to the company in project ([7035969](7035969db7))
* cost center filter according to the company in project ([0cf97f2](0cf97f2559))
* cost center filter according to the company in project ([459d136](459d136368))
* dict can not be used as parameter ([#41598](https://github.com/frappe/erpnext/issues/41598)) ([649c192](649c192abe))
* Fetch outstanding and total amount for reference journal entry ([50f6afd](50f6afd588))
* set expense account as Assets RBNB only if it is booked in linked PR ([#41368](https://github.com/frappe/erpnext/issues/41368)) ([014486d](014486de39))
* Update depreciation schedule via asset repair ([#41344](https://github.com/frappe/erpnext/issues/41344)) ([eb418e8](eb418e8659))
2024-05-29 07:52:36 +00:00
ruthra kumar
7e3c15e0b6 Merge pull request #41665 from frappe/version-14-hotfix
chore: release v14
2024-05-29 13:21:18 +05:30
Deepesh Garg
570985f40e fix: Filters in account balance report
(cherry picked from commit 1c9fe691ea)
2024-05-29 07:20:48 +00:00
Nabin Hait
eb418e8659 fix: Update depreciation schedule via asset repair (#41344)
* fix: Update depreciation schedule via asset repair

* fix: test cases related to modified depreciation schedule
2024-05-29 11:07:03 +05:30
Nabin Hait
014486de39 fix: set expense account as Assets RBNB only if it is booked in linked PR (#41368)
* fix: set expense account as Assets RBNB only if it is booked in linked PR

* fix: broken translations
2024-05-29 10:46:06 +05:30
barredterra
a53a80f01d chore: resolve conflicts 2024-05-27 18:54:17 +02:00
barredterra
b1a911aa9c fix: allow Auditor to read a Fiscal Year
(cherry picked from commit eaa4efbc45)

# Conflicts:
#	erpnext/accounts/doctype/fiscal_year/fiscal_year.json
2024-05-27 16:50:26 +00:00
barredterra
18b6d50a31 fix: allow Auditor to select a company
(cherry picked from commit 06401cc84f)

# Conflicts:
#	erpnext/setup/doctype/company/company.json
2024-05-27 16:50:26 +00:00
Akhil Narang
fcb2f4f084 Merge pull request #41624 from frappe/mergify/bp/version-14-hotfix/pr-41601
fix: add in some indices to speed up Purchase Order deletion (backport #41601)
2024-05-27 13:31:51 +05:30
Akhil Narang
308f200793 Merge pull request #41610 from frappe/mergify/bp/version-14-hotfix/pr-41609
refactor: use `json` directly instead of using `frappe.json` (backport #41609)
2024-05-27 13:31:29 +05:30
Akhil Narang
4fcfbe6e9f Merge pull request #41597 from frappe/mergify/bp/version-14-hotfix/pr-41576
chore: sync ruff config with framework (backport #41576)
2024-05-27 13:31:22 +05:30
Akhil Narang
5b2c13dacf refactor: use json directly instead of using frappe.json (#41609)
(cherry picked from commit 3f06f1905f)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-05-27 07:26:24 +00:00
Ankush Menat
76b7884fb7 ci: ruff only fix imports
(cherry picked from commit 85b1a8001b)
2024-05-27 07:26:14 +00:00
Ankush Menat
518dad8ecb ci: dont auto apply fixes
I've personally encountered ~5 instances of bad auto fixes, let
developers apply the fixes.

(cherry picked from commit 3b4913ec81)
2024-05-27 07:26:14 +00:00
Akhil Narang
220ae118e8 chore: resolve conflicts 2024-05-27 07:25:29 +00:00
Akhil Narang
f1f2f6e338 chore: resolve conflicts 2024-05-27 07:25:29 +00:00
Akhil Narang
c16c41ee59 fix: add in some indices to speed up Purchase Order deletion
`tabSales Order`.`inter_company_order_reference`
`tabSales Invoice Item`.`purchase_order`

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 0303d7dbdc)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
#	erpnext/selling/doctype/sales_order/sales_order.json
2024-05-27 07:25:29 +00:00
ruthra kumar
dcffb3886b Merge pull request #41648 from frappe/mergify/bp/version-14-hotfix/pr-41401
fix: cost center filter according to the company in project (backport #41401)
2024-05-27 10:41:59 +05:30
Nihantra C. Patel
7035969db7 fix: cost center filter according to the company in project
(cherry picked from commit 501c6aa126)
2024-05-27 04:41:12 +00:00
Nihantra C. Patel
0cf97f2559 fix: cost center filter according to the company in project
(cherry picked from commit cfde8088b4)
2024-05-27 04:41:12 +00:00
Nihantra C. Patel
459d136368 fix: cost center filter according to the company in project
(cherry picked from commit 249e8264dd)
2024-05-27 04:41:11 +00:00
ruthra kumar
a2bfe31876 Merge pull request #40289 from Nihantra-Patel/fix_button_size_for_add_to_cart
fix: Add to Cart button width for Mobile/Tablet
2024-05-24 10:57:15 +05:30
ruthra kumar
75b021dc23 Merge pull request #41604 from frappe/mergify/bp/version-14-hotfix/pr-41603
refactor: remove 'format:' based naming in internal doctypes (backport #41603)
2024-05-24 10:54:45 +05:30
ruthra kumar
b2e2e951da Merge pull request #41606 from frappe/mergify/bp/version-14-hotfix/pr-41594
refactor: 'Payment Period Based On Invoice Date' report (backport #41594)
2024-05-24 10:54:07 +05:30
ruthra kumar
0f9b5074a6 chore: resolve conflicts 2024-05-23 17:47:47 +05:30
ruthra kumar
190900cd1b refactor: replace against_voucher with against_voucher_no
(cherry picked from commit c4e2abb973)
2024-05-23 12:16:41 +00:00
ruthra kumar
3512f7d528 refactor: remove debit and credit
(cherry picked from commit 014b542cf3)
2024-05-23 12:16:40 +00:00
ruthra kumar
0dc2f78a2e refactor: query payment ledger for payments
(cherry picked from commit cb3c20dcd3)
2024-05-23 12:16:40 +00:00
ruthra kumar
c834a9de85 refactor: remove 'format:' based naming in internal doctypes
(cherry picked from commit e2ec3e453a)

# Conflicts:
#	erpnext/accounts/doctype/repost_accounting_ledger/repost_accounting_ledger.json
#	erpnext/accounts/doctype/repost_payment_ledger/repost_payment_ledger.json
2024-05-23 12:15:21 +00:00
ruthra kumar
4d8c35aa5d Merge pull request #40957 from frappe/mergify/bp/version-14-hotfix/pr-40920
fix: Fetch correct outstanding and total amount for reference journal entry (backport #40920)
2024-05-23 16:08:14 +05:30
ruthra kumar
5230d411bf chore: resolve conflicts 2024-05-23 15:42:34 +05:30
ruthra kumar
a6bf7c1ebd chore: remove unused imports 2024-05-23 15:42:34 +05:30
Nabin Hait
50f6afd588 fix: Fetch outstanding and total amount for reference journal entry
(cherry picked from commit f331f9b15c)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.js
#	erpnext/accounts/doctype/payment_entry/payment_entry.py
2024-05-23 15:42:34 +05:30
rohitwaghchaure
649c192abe fix: dict can not be used as parameter (#41598) 2024-05-23 15:37:00 +05:30
barredterra
0aa246c39e fix(Delivery Note): only show permitted actions
(cherry picked from commit 418bdc1dcc)

# Conflicts:
#	erpnext/stock/doctype/delivery_note/delivery_note.js
2024-05-13 13:43:07 +00:00
barredterra
5468a3b0b7 fix(Sales Order): only show permitted actions
(cherry picked from commit c29d955371)

# Conflicts:
#	erpnext/selling/doctype/sales_order/sales_order.js
2024-05-13 13:43:07 +00:00
barredterra
d0a0a35d72 chore: remove accidentally added file 2024-03-19 12:53:20 +01:00
barredterra
3b2044dcd7 chore: resolve conflicts 2024-03-19 12:46:14 +01:00
barredterra
7f2a54d95b refactor: usage of in_list
(cherry picked from commit d238751e6b)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.js
#	erpnext/buying/doctype/purchase_order/purchase_order.js
#	erpnext/public/js/controllers/accounts.js
#	erpnext/public/js/controllers/buying.js
#	erpnext/public/js/controllers/transaction.js
#	erpnext/public/js/utils/sales_common.js
#	erpnext/templates/form_grid/item_grid.html
2024-03-19 11:12:58 +00:00
Nihantra C. Patel
819ced4cb3 fix: Add to Cart button width for Mobile/Tablet 2024-03-05 17:24:17 +05:30
294 changed files with 10459 additions and 1882 deletions

View File

@@ -23,7 +23,7 @@ jobs:
run: git clone --depth 1 https://github.com/frappe/semgrep-rules.git frappe-semgrep-rules
- name: Download semgrep
run: pip install semgrep==0.97.0
run: pip install semgrep
- name: Run Semgrep rules
run: semgrep ci --config ./frappe-semgrep-rules/rules --config r/python.lang.correctness

View File

@@ -69,12 +69,14 @@ repos:
rev: v0.2.0
hooks:
- id: ruff
name: "Run ruff linter and apply fixes"
args: ["--fix"]
name: "Run ruff import sorter"
args: ["--select=I", "--fix"]
- id: ruff
name: "Run ruff linter"
- id: ruff-format
name: "Format Python code"
name: "Run ruff formatter"
ci:
autoupdate_schedule: weekly

View File

@@ -4,22 +4,22 @@
# the repo. Unless a later match takes precedence,
erpnext/accounts/ @deepeshgarg007 @ruthra-kumar
erpnext/assets/ @anandbaburajan @deepeshgarg007
erpnext/assets/ @khushi8112 @deepeshgarg007
erpnext/loan_management/ @deepeshgarg007
erpnext/regional @deepeshgarg007 @ruthra-kumar
erpnext/selling @deepeshgarg007 @ruthra-kumar
erpnext/support/ @deepeshgarg007
pos*
erpnext/buying/ @rohitwaghchaure @s-aga-r
erpnext/maintenance/ @rohitwaghchaure @s-aga-r
erpnext/manufacturing/ @rohitwaghchaure @s-aga-r
erpnext/quality_management/ @rohitwaghchaure @s-aga-r
erpnext/stock/ @rohitwaghchaure @s-aga-r
erpnext/subcontracting @rohitwaghchaure @s-aga-r
erpnext/buying/ @rohitwaghchaure
erpnext/maintenance/ @rohitwaghchaure
erpnext/manufacturing/ @rohitwaghchaure
erpnext/quality_management/ @rohitwaghchaure
erpnext/stock/ @rohitwaghchaure
erpnext/subcontracting @rohitwaghchaure
erpnext/controllers/ @deepeshgarg007 @rohitwaghchaure
erpnext/patches/ @deepeshgarg007
.github/ @deepeshgarg007
pyproject.toml @ankush
pyproject.toml @akhilnarang

View File

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

View File

@@ -58,7 +58,7 @@ def build_conditions(process_type, account, company):
)
if account:
conditions += f"AND {deferred_account}='{account}'"
conditions += f"AND {deferred_account}={frappe.db.escape(account)}"
elif company:
conditions += f"AND p.company = {frappe.db.escape(company)}"
@@ -360,45 +360,45 @@ def book_deferred_income_or_expense(doc, deferred_process, posting_date=None):
)
if not amount:
return
gl_posting_date = end_date
prev_posting_date = None
# check if books nor frozen till endate:
if accounts_frozen_upto and getdate(end_date) <= getdate(accounts_frozen_upto):
gl_posting_date = get_last_day(add_days(accounts_frozen_upto, 1))
prev_posting_date = end_date
if via_journal_entry:
book_revenue_via_journal_entry(
doc,
credit_account,
debit_account,
amount,
base_amount,
gl_posting_date,
project,
account_currency,
item.cost_center,
item,
deferred_process,
submit_journal_entry,
)
else:
make_gl_entries(
doc,
credit_account,
debit_account,
against,
amount,
base_amount,
gl_posting_date,
project,
account_currency,
item.cost_center,
item,
deferred_process,
)
gl_posting_date = end_date
prev_posting_date = None
# check if books nor frozen till endate:
if accounts_frozen_upto and getdate(end_date) <= getdate(accounts_frozen_upto):
gl_posting_date = get_last_day(add_days(accounts_frozen_upto, 1))
prev_posting_date = end_date
if via_journal_entry:
book_revenue_via_journal_entry(
doc,
credit_account,
debit_account,
amount,
base_amount,
gl_posting_date,
project,
account_currency,
item.cost_center,
item,
deferred_process,
submit_journal_entry,
)
else:
make_gl_entries(
doc,
credit_account,
debit_account,
against,
amount,
base_amount,
gl_posting_date,
project,
account_currency,
item.cost_center,
item,
deferred_process,
)
# Returned in case of any errors because it tries to submit the same record again and again in case of errors
if frappe.flags.deferred_accounting_error:

View File

@@ -94,8 +94,8 @@ frappe.ui.form.on("Account", {
function () {
frappe.route_options = {
account: frm.doc.name,
from_date: frappe.sys_defaults.year_start_date,
to_date: frappe.sys_defaults.year_end_date,
from_date: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
to_date: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
company: frm.doc.company,
};
frappe.set_route("query-report", "General Ledger");

View File

@@ -279,8 +279,8 @@ frappe.treeview_settings["Account"] = {
click: function (node, btn) {
frappe.route_options = {
account: node.label,
from_date: frappe.sys_defaults.year_start_date,
to_date: frappe.sys_defaults.year_end_date,
from_date: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
to_date: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
company:
frappe.treeview_settings["Account"].treeview.page.fields_dict.company.get_value(),
};

View File

@@ -469,7 +469,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2023-11-20 09:37:47.650347",
"modified": "2024-01-22 12:10:10.151819",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",

View File

@@ -208,8 +208,49 @@
"label": "Disabled"
}
],
"links": [],
"modified": "2024-02-02 17:50:09.768835",
"links": [
{
"group": "Transactions",
"link_doctype": "Payment Request",
"link_fieldname": "bank_account"
},
{
"group": "Transactions",
"link_doctype": "Payment Order",
"link_fieldname": "bank_account"
},
{
"group": "Transactions",
"link_doctype": "Bank Guarantee",
"link_fieldname": "bank_account"
},
{
"group": "Transactions",
"link_doctype": "Bank Transaction",
"link_fieldname": "bank_account"
},
{
"group": "Accounting",
"link_doctype": "Payment Entry",
"link_fieldname": "bank_account"
},
{
"group": "Accounting",
"link_doctype": "Journal Entry",
"link_fieldname": "bank_account"
},
{
"group": "Party",
"link_doctype": "Customer",
"link_fieldname": "default_bank_account"
},
{
"group": "Party",
"link_doctype": "Supplier",
"link_fieldname": "default_bank_account"
}
],
"modified": "2024-10-30 09:41:14.113414",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Account",
@@ -246,4 +287,4 @@
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
}

View File

@@ -1,20 +0,0 @@
from frappe import _
def get_data():
return {
"fieldname": "bank_account",
"non_standard_fieldnames": {
"Customer": "default_bank_account",
"Supplier": "default_bank_account",
},
"transactions": [
{
"label": _("Payments"),
"items": ["Payment Entry", "Payment Request", "Payment Order", "Payroll Entry"],
},
{"label": _("Party"), "items": ["Customer", "Supplier"]},
{"items": ["Bank Guarantee"]},
{"items": ["Journal Entry"]},
],
}

View File

@@ -36,8 +36,12 @@ frappe.ui.form.on("Bank Clearance", {
refresh: function (frm) {
frm.disable_save();
frm.add_custom_button(__("Get Payment Entries"), () => frm.trigger("get_payment_entries"));
frm.change_custom_button_type("Get Payment Entries", null, "primary");
frm.change_custom_button_type(__("Get Payment Entries"), null, "primary");
if (frm.doc.payment_entries.length) {
frm.add_custom_button(__("Update Clearance Date"), () => frm.trigger("update_clearance_date"));
frm.change_custom_button_type(__("Get Payment Entries"), null, "default");
frm.change_custom_button_type(__("Update Clearance Date"), null, "primary");
}
},
update_clearance_date: function (frm) {
@@ -45,13 +49,7 @@ frappe.ui.form.on("Bank Clearance", {
method: "update_clearance_date",
doc: frm.doc,
callback: function (r, rt) {
frm.refresh_field("payment_entries");
frm.refresh_fields();
if (!frm.doc.payment_entries.length) {
frm.change_custom_button_type("Get Payment Entries", null, "primary");
frm.change_custom_button_type("Update Clearance Date", null, "default");
}
frm.refresh();
},
});
},
@@ -60,17 +58,8 @@ frappe.ui.form.on("Bank Clearance", {
return frappe.call({
method: "get_payment_entries",
doc: frm.doc,
callback: function (r, rt) {
frm.refresh_field("payment_entries");
if (frm.doc.payment_entries.length) {
frm.add_custom_button(__("Update Clearance Date"), () =>
frm.trigger("update_clearance_date")
);
frm.change_custom_button_type("Get Payment Entries", null, "default");
frm.change_custom_button_type("Update Clearance Date", null, "primary");
}
callback: function () {
frm.refresh();
},
});
},

View File

@@ -6,7 +6,7 @@ import frappe
from frappe import _, msgprint
from frappe.model.document import Document
from frappe.query_builder.custom import ConstantColumn
from frappe.utils import flt, fmt_money, getdate
from frappe.utils import flt, fmt_money, get_link_to_form, getdate
import erpnext
@@ -55,7 +55,7 @@ class BankClearance(Document):
"Payment Entry" as payment_document, name as payment_entry,
reference_no as cheque_number, reference_date as cheque_date,
if(paid_from=%(account)s, paid_amount + total_taxes_and_charges, 0) as credit,
if(paid_from=%(account)s, 0, received_amount) as debit,
if(paid_from=%(account)s, 0, received_amount + total_taxes_and_charges) as debit,
posting_date, ifnull(party,if(paid_from=%(account)s,paid_to,paid_from)) as against_account, clearance_date,
if(paid_to=%(account)s, paid_to_account_currency, paid_from_account_currency) as account_currency
from `tabPayment Entry`
@@ -210,8 +210,11 @@ class BankClearance(Document):
if d.cheque_date and getdate(d.clearance_date) < getdate(d.cheque_date):
frappe.throw(
_("Row #{0}: Clearance date {1} cannot be before Cheque Date {2}").format(
d.idx, d.clearance_date, d.cheque_date
_("Row #{0}: For {1} Clearance date {2} cannot be before Cheque Date {3}").format(
d.idx,
get_link_to_form(d.payment_document, d.payment_entry),
d.clearance_date,
d.cheque_date,
)
)

View File

@@ -2,6 +2,7 @@
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.model.docstatus import DocStatus
from frappe.utils import flt
@@ -156,13 +157,17 @@ class BankTransaction(StatusUpdater):
if self.party_type and self.party:
return
result = AutoMatchParty(
bank_party_account_number=self.bank_party_account_number,
bank_party_iban=self.bank_party_iban,
bank_party_name=self.bank_party_name,
description=self.description,
deposit=self.deposit,
).match()
result = None
try:
result = AutoMatchParty(
bank_party_account_number=self.bank_party_account_number,
bank_party_iban=self.bank_party_iban,
bank_party_name=self.bank_party_name,
description=self.description,
deposit=self.deposit,
).match()
except Exception:
frappe.log_error(title=_("Error in party matching for Bank Transaction {0}").format(self.name))
if result:
party_type, party = result

View File

@@ -22,8 +22,10 @@ class TestCostCenterAllocation(unittest.TestCase):
cost_centers = [
"Main Cost Center 1",
"Main Cost Center 2",
"Main Cost Center 3",
"Sub Cost Center 1",
"Sub Cost Center 2",
"Sub Cost Center 3",
]
for cc in cost_centers:
create_cost_center(cost_center_name=cc, company="_Test Company")
@@ -36,7 +38,7 @@ class TestCostCenterAllocation(unittest.TestCase):
)
jv = make_journal_entry(
"_Test Cash - _TC", "Sales - _TC", 100, cost_center="Main Cost Center 1 - _TC", submit=True
"Cash - _TC", "Sales - _TC", 100, cost_center="Main Cost Center 1 - _TC", submit=True
)
expected_values = [["Sub Cost Center 1 - _TC", 0.0, 60], ["Sub Cost Center 2 - _TC", 0.0, 40]]
@@ -120,7 +122,7 @@ class TestCostCenterAllocation(unittest.TestCase):
def test_valid_from_based_on_existing_gle(self):
# GLE posted against Sub Cost Center 1 on today
jv = make_journal_entry(
"_Test Cash - _TC",
"Cash - _TC",
"Sales - _TC",
100,
cost_center="Main Cost Center 1 - _TC",
@@ -141,6 +143,53 @@ class TestCostCenterAllocation(unittest.TestCase):
jv.cancel()
def test_multiple_cost_center_allocation_on_same_main_cost_center(self):
coa1 = create_cost_center_allocation(
"_Test Company",
"Main Cost Center 3 - _TC",
{"Sub Cost Center 1 - _TC": 30, "Sub Cost Center 2 - _TC": 30, "Sub Cost Center 3 - _TC": 40},
valid_from=add_days(today(), -5),
)
coa2 = create_cost_center_allocation(
"_Test Company",
"Main Cost Center 3 - _TC",
{"Sub Cost Center 1 - _TC": 50, "Sub Cost Center 2 - _TC": 50},
valid_from=add_days(today(), -1),
)
jv = make_journal_entry(
"Cash - _TC",
"Sales - _TC",
100,
cost_center="Main Cost Center 3 - _TC",
posting_date=today(),
submit=True,
)
expected_values = {"Sub Cost Center 1 - _TC": 50, "Sub Cost Center 2 - _TC": 50}
gle = frappe.qb.DocType("GL Entry")
gl_entries = (
frappe.qb.from_(gle)
.select(gle.cost_center, gle.debit, gle.credit)
.where(gle.voucher_type == "Journal Entry")
.where(gle.voucher_no == jv.name)
.where(gle.account == "Sales - _TC")
.orderby(gle.cost_center)
).run(as_dict=1)
self.assertTrue(gl_entries)
for gle in gl_entries:
self.assertTrue(gle.cost_center in expected_values)
self.assertEqual(gle.debit, 0)
self.assertEqual(gle.credit, expected_values[gle.cost_center])
coa1.cancel()
coa2.cancel()
jv.cancel()
def create_cost_center_allocation(
company,

View File

@@ -84,7 +84,7 @@ def get_api_endpoint(service_provider: str | None = None, use_http: bool = False
if service_provider == "exchangerate.host":
api = "api.exchangerate.host/convert"
elif service_provider == "frankfurter.app":
api = "frankfurter.app/{transaction_date}"
api = "api.frankfurter.app/{transaction_date}"
protocol = "https://"
if use_http:

View File

@@ -129,19 +129,31 @@ def calculate_interest_and_amount(outstanding_amount, rate_of_interest, dunning_
@frappe.whitelist()
def get_dunning_letter_text(dunning_type, doc, language=None):
def get_dunning_letter_text(dunning_type: str, doc: str | dict, language: str | None = None) -> dict:
DOCTYPE = "Dunning Letter Text"
FIELDS = ["body_text", "closing_text", "language"]
if isinstance(doc, str):
doc = json.loads(doc)
if not language:
language = doc.get("language")
if language:
filters = {"parent": dunning_type, "language": language}
else:
filters = {"parent": dunning_type, "is_default_language": 1}
letter_text = frappe.db.get_value(
"Dunning Letter Text", filters, ["body_text", "closing_text", "language"], as_dict=1
)
if letter_text:
return {
"body_text": frappe.render_template(letter_text.body_text, doc),
"closing_text": frappe.render_template(letter_text.closing_text, doc),
"language": letter_text.language,
}
letter_text = frappe.db.get_value(
DOCTYPE, {"parent": dunning_type, "language": language}, FIELDS, as_dict=1
)
if not letter_text:
letter_text = frappe.db.get_value(
DOCTYPE, {"parent": dunning_type, "is_default_language": 1}, FIELDS, as_dict=1
)
if not letter_text:
return {}
return {
"body_text": frappe.render_template(letter_text.body_text, doc),
"closing_text": frappe.render_template(letter_text.closing_text, doc),
"language": letter_text.language,
}

View File

@@ -52,6 +52,21 @@ class ExchangeRateRevaluation(Document):
if not (self.company and self.posting_date):
frappe.throw(_("Please select Company and Posting Date to getting entries"))
def before_submit(self):
self.remove_accounts_without_gain_loss()
def remove_accounts_without_gain_loss(self):
self.accounts = [account for account in self.accounts if account.gain_loss]
if not self.accounts:
frappe.throw(_("At least one account with exchange gain or loss is required"))
frappe.msgprint(
_("Removing rows without exchange gain or loss"),
alert=True,
indicator="yellow",
)
def on_cancel(self):
self.ignore_linked_doctypes = "GL Entry"
@@ -226,23 +241,23 @@ class ExchangeRateRevaluation(Document):
new_exchange_rate = get_exchange_rate(d.account_currency, company_currency, posting_date)
new_balance_in_base_currency = flt(d.balance_in_account_currency * new_exchange_rate)
gain_loss = flt(new_balance_in_base_currency, precision) - flt(d.balance, precision)
if gain_loss:
accounts.append(
{
"account": d.account,
"party_type": d.party_type,
"party": d.party,
"account_currency": d.account_currency,
"balance_in_base_currency": d.balance,
"balance_in_account_currency": d.balance_in_account_currency,
"zero_balance": d.zero_balance,
"current_exchange_rate": current_exchange_rate,
"new_exchange_rate": new_exchange_rate,
"new_balance_in_base_currency": new_balance_in_base_currency,
"new_balance_in_account_currency": d.balance_in_account_currency,
"gain_loss": gain_loss,
}
)
accounts.append(
{
"account": d.account,
"party_type": d.party_type,
"party": d.party,
"account_currency": d.account_currency,
"balance_in_base_currency": d.balance,
"balance_in_account_currency": d.balance_in_account_currency,
"zero_balance": d.zero_balance,
"current_exchange_rate": current_exchange_rate,
"new_exchange_rate": new_exchange_rate,
"new_balance_in_base_currency": new_balance_in_base_currency,
"new_balance_in_account_currency": d.balance_in_account_currency,
"gain_loss": gain_loss,
}
)
# Handle Accounts with '0' balance in Account/Base Currency
for d in [x for x in account_details if x.zero_balance]:
@@ -266,23 +281,22 @@ class ExchangeRateRevaluation(Document):
current_exchange_rate * d.balance_in_account_currency
)
if gain_loss:
accounts.append(
{
"account": d.account,
"party_type": d.party_type,
"party": d.party,
"account_currency": d.account_currency,
"balance_in_base_currency": d.balance,
"balance_in_account_currency": d.balance_in_account_currency,
"zero_balance": d.zero_balance,
"current_exchange_rate": current_exchange_rate,
"new_exchange_rate": new_exchange_rate,
"new_balance_in_base_currency": new_balance_in_base_currency,
"new_balance_in_account_currency": new_balance_in_account_currency,
"gain_loss": gain_loss,
}
)
accounts.append(
{
"account": d.account,
"party_type": d.party_type,
"party": d.party,
"account_currency": d.account_currency,
"balance_in_base_currency": d.balance,
"balance_in_account_currency": d.balance_in_account_currency,
"zero_balance": d.zero_balance,
"current_exchange_rate": current_exchange_rate,
"new_exchange_rate": new_exchange_rate,
"new_balance_in_base_currency": new_balance_in_base_currency,
"new_balance_in_account_currency": new_balance_in_account_currency,
"gain_loss": gain_loss,
}
)
return accounts

View File

@@ -82,7 +82,7 @@
"icon": "fa fa-calendar",
"idx": 1,
"links": [],
"modified": "2020-11-05 12:16:53.081573",
"modified": "2024-05-27 17:29:55.560840",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Fiscal Year",
@@ -126,6 +126,10 @@
{
"read": 1,
"role": "Stock Manager"
},
{
"read": 1,
"role": "Auditor"
}
],
"show_name_in_global_search": 1,

View File

@@ -171,7 +171,7 @@ frappe.ui.form.on("Journal Entry", {
!(frm.doc.accounts || []).length ||
((frm.doc.accounts || []).length === 1 && !frm.doc.accounts[0].account)
) {
if (in_list(["Bank Entry", "Cash Entry"], frm.doc.voucher_type)) {
if (["Bank Entry", "Cash Entry"].includes(frm.doc.voucher_type)) {
return frappe.call({
type: "GET",
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_default_bank_cash_account",
@@ -283,7 +283,7 @@ erpnext.accounts.JournalEntry = class JournalEntry extends frappe.ui.form.Contro
filters: [[jvd.reference_type, "docstatus", "=", 1]],
};
if (in_list(["Sales Invoice", "Purchase Invoice"], jvd.reference_type)) {
if (["Sales Invoice", "Purchase Invoice"].includes(jvd.reference_type)) {
out.filters.push([jvd.reference_type, "outstanding_amount", "!=", 0]);
// Filter by cost center
if (jvd.cost_center) {
@@ -295,7 +295,7 @@ erpnext.accounts.JournalEntry = class JournalEntry extends frappe.ui.form.Contro
out.filters.push([jvd.reference_type, party_account_field, "=", jvd.account]);
}
if (in_list(["Sales Order", "Purchase Order"], jvd.reference_type)) {
if (["Sales Order", "Purchase Order"].includes(jvd.reference_type)) {
// party_type and party mandatory
frappe.model.validate_missing(jvd, "party_type");
frappe.model.validate_missing(jvd, "party");

View File

@@ -557,7 +557,7 @@
"table_fieldname": "payment_entries"
}
],
"modified": "2023-11-23 12:11:04.128015",
"modified": "2024-07-18 15:32:29.413598",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry",

View File

@@ -153,7 +153,7 @@ class JournalEntry(AccountsController):
frappe.throw(_("Journal Entry type should be set as Depreciation Entry for asset depreciation"))
def validate_stock_accounts(self):
stock_accounts = get_stock_accounts(self.company, self.doctype, self.name)
stock_accounts = get_stock_accounts(self.company, accounts=self.accounts)
for account in stock_accounts:
account_bal, stock_bal, warehouse_list = get_stock_and_account_balance(
account, self.posting_date, self.company

View File

@@ -146,12 +146,12 @@ class TestJournalEntry(unittest.TestCase):
"credit_in_account_currency": 0 if diff > 0 else abs(diff),
},
)
jv.insert()
if account_bal == stock_bal:
self.assertRaises(StockAccountInvalidTransaction, jv.submit)
self.assertRaises(StockAccountInvalidTransaction, jv.insert)
frappe.db.rollback()
else:
jv.insert()
jv.submit()
jv.cancel()

View File

@@ -15,14 +15,23 @@ frappe.ui.form.on('Payment Entry', {
}
erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
if (frm.is_new()) {
set_default_party_type(frm);
}
},
setup: function(frm) {
frm.set_query("paid_from", function() {
frm.events.validate_company(frm);
var account_types = in_list(["Pay", "Internal Transfer"], frm.doc.payment_type) ?
var account_types = ["Pay", "Internal Transfer"].includes(frm.doc.payment_type) ?
["Bank", "Cash"] : [frappe.boot.party_account_types[frm.doc.party_type]];
if (frm.doc.party_type == "Shareholder") {
account_types.push("Equity");
}
return {
filters: {
"account_type": ["in", account_types],
@@ -75,8 +84,11 @@ frappe.ui.form.on('Payment Entry', {
frm.set_query("paid_to", function() {
frm.events.validate_company(frm);
var account_types = in_list(["Receive", "Internal Transfer"], frm.doc.payment_type) ?
var account_types = ["Receive", "Internal Transfer"].includes(frm.doc.payment_type) ?
["Bank", "Cash"] : [frappe.boot.party_account_types[frm.doc.party_type]];
if (frm.doc.party_type == "Shareholder") {
account_types.push("Equity");
}
return {
filters: {
"account_type": ["in", account_types],
@@ -121,7 +133,7 @@ frappe.ui.form.on('Payment Entry', {
frm.set_query('payment_term', 'references', function(frm, cdt, cdn) {
const child = locals[cdt][cdn];
if (in_list(['Purchase Invoice', 'Sales Invoice'], child.reference_doctype) && child.reference_name) {
if (['Purchase Invoice', 'Sales Invoice'].includes(child.reference_doctype) && child.reference_name) {
return {
query: "erpnext.controllers.queries.get_payment_terms_for_references",
filters: {
@@ -145,10 +157,50 @@ frappe.ui.form.on('Payment Entry', {
filters: filters
};
});
frm.set_query("payment_request", "references", function (doc, cdt, cdn) {
const row = frappe.get_doc(cdt, cdn);
return {
query: "erpnext.accounts.doctype.payment_request.payment_request.get_open_payment_requests_query",
filters: {
reference_doctype: row.reference_doctype,
reference_name: row.reference_name,
company: doc.company,
status: ["!=", "Paid"],
outstanding_amount: [">", 0], // for compatibility with old data
docstatus: 1,
},
};
});
frm.set_query("sales_taxes_and_charges_template", function () {
return {
filters: {
company: frm.doc.company,
disabled: false,
},
};
});
frm.set_query("purchase_taxes_and_charges_template", function () {
return {
filters: {
company: frm.doc.company,
disabled: false,
},
};
});
frm.add_fetch(
"payment_request",
"outstanding_amount",
"payment_request_outstanding",
"Payment Entry Reference"
);
},
refresh: function(frm) {
erpnext.hide_company();
refresh: function (frm) {
erpnext.hide_company(frm);
frm.events.hide_unhide_fields(frm);
frm.events.set_dynamic_labels(frm);
frm.events.show_general_ledger(frm);
@@ -159,6 +211,7 @@ frappe.ui.form.on('Payment Entry', {
}
erpnext.accounts.unreconcile_payment.add_unreconcile_btn(frm);
frappe.flags.allocate_payment_amount = true;
},
validate_company: (frm) => {
@@ -179,7 +232,7 @@ frappe.ui.form.on('Payment Entry', {
},
hide_unhide_fields: function(frm) {
var company_currency = frm.doc.company? frappe.get_doc(":Company", frm.doc.company).default_currency: "";
var company_currency = frm.doc.company? frappe.get_doc(":Company", frm.doc.company)?.default_currency: "";
frm.toggle_display("source_exchange_rate",
(frm.doc.paid_amount && frm.doc.paid_from_account_currency != company_currency));
@@ -225,7 +278,7 @@ frappe.ui.form.on('Payment Entry', {
},
set_dynamic_labels: function(frm) {
var company_currency = frm.doc.company? frappe.get_doc(":Company", frm.doc.company).default_currency: "";
var company_currency = frm.doc.company? frappe.get_doc(":Company", frm.doc.company)?.default_currency: "";
frm.set_currency_labels(["base_paid_amount", "base_received_amount", "base_total_allocated_amount",
"difference_amount", "base_paid_amount_after_tax", "base_received_amount_after_tax",
@@ -275,6 +328,7 @@ frappe.ui.form.on('Payment Entry', {
},
payment_type: function(frm) {
set_default_party_type(frm);
if(frm.doc.payment_type == "Internal Transfer") {
$.each(["party", "party_balance", "paid_from", "paid_to",
"references", "total_allocated_amount"], function(i, field) {
@@ -309,6 +363,12 @@ frappe.ui.form.on('Payment Entry', {
return {
query: "erpnext.controllers.queries.customer_query"
}
} else if (frm.doc.party_type == "Shareholder") {
return {
filters: {
company: frm.doc.company,
},
};
}
});
@@ -485,8 +545,8 @@ frappe.ui.form.on('Payment Entry', {
if (frm.doc.paid_from_account_currency == company_currency) {
frm.set_value("source_exchange_rate", 1);
} else if (frm.doc.paid_from){
if (in_list(["Internal Transfer", "Pay"], frm.doc.payment_type)) {
let company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
if (["Internal Transfer", "Pay"].includes(frm.doc.payment_type)) {
let company_currency = frappe.get_doc(":Company", frm.doc.company)?.default_currency;
frappe.call({
method: "erpnext.setup.utils.get_exchange_rate",
args: {
@@ -602,10 +662,9 @@ frappe.ui.form.on('Payment Entry', {
frm.set_value("base_received_amount",
flt(frm.doc.received_amount) * flt(frm.doc.target_exchange_rate));
if(frm.doc.payment_type == "Pay")
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.received_amount, 1);
else
frm.events.set_unallocated_amount(frm);
if (frm.doc.payment_type == "Pay")
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.received_amount, true);
else frm.events.set_unallocated_amount(frm);
frm.set_paid_amount_based_on_received_amount = false;
frm.events.hide_unhide_fields(frm);
@@ -623,10 +682,9 @@ frappe.ui.form.on('Payment Entry', {
frm.set_value("base_received_amount", frm.doc.base_paid_amount);
}
if(frm.doc.payment_type == "Receive")
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.paid_amount, 1);
else
frm.events.set_unallocated_amount(frm);
if (frm.doc.payment_type == "Receive")
frm.events.allocate_party_amount_against_ref_docs(frm, frm.doc.paid_amount, true);
else frm.events.set_unallocated_amount(frm);
},
get_outstanding_invoices_or_orders: function(frm, get_outstanding_invoices, get_orders_to_be_billed) {
@@ -770,6 +828,7 @@ frappe.ui.form.on('Payment Entry', {
c.outstanding_amount = d.outstanding_amount;
c.bill_no = d.bill_no;
c.payment_term = d.payment_term;
c.payment_term_outstanding = d.payment_term_outstanding;
c.allocated_amount = d.allocated_amount;
if(!in_list(frm.events.get_order_doctypes(frm), d.voucher_type)) {
@@ -811,10 +870,12 @@ frappe.ui.form.on('Payment Entry', {
}
}
frm.events.allocate_party_amount_against_ref_docs(frm,
(frm.doc.payment_type=="Receive" ? frm.doc.paid_amount : frm.doc.received_amount));
}
frm.events.allocate_party_amount_against_ref_docs(
frm,
frm.doc.payment_type == "Receive" ? frm.doc.paid_amount : frm.doc.received_amount,
false
);
},
});
},
@@ -826,76 +887,13 @@ frappe.ui.form.on('Payment Entry', {
return ["Sales Invoice", "Purchase Invoice"];
},
allocate_party_amount_against_ref_docs: function(frm, paid_amount, paid_amount_change) {
var total_positive_outstanding_including_order = 0;
var total_negative_outstanding = 0;
var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [],
function(d) { return flt(d.amount) }));
allocate_party_amount_against_ref_docs: async function (frm, paid_amount, paid_amount_change) {
await frm.call("allocate_amount_to_references", {
paid_amount: paid_amount,
paid_amount_change: paid_amount_change,
allocate_payment_amount: frappe.flags.allocate_payment_amount ?? false,
});
paid_amount -= total_deductions;
$.each(frm.doc.references || [], function(i, row) {
if(flt(row.outstanding_amount) > 0)
total_positive_outstanding_including_order += flt(row.outstanding_amount);
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") ||
(frm.doc.payment_type=="Pay" && frm.doc.party_type=="Supplier") ||
(frm.doc.payment_type=="Pay" && frm.doc.party_type=="Employee")
) {
if(total_positive_outstanding_including_order > paid_amount) {
var remaining_outstanding = total_positive_outstanding_including_order - paid_amount;
allocated_negative_outstanding = total_negative_outstanding < remaining_outstanding ?
total_negative_outstanding : remaining_outstanding;
}
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(
__("Cannot {0} {1} {2} without any negative outstanding invoice", [frm.doc.payment_type,
(frm.doc.party_type=="Customer" ? "to" : "from"), frm.doc.party_type])
);
return false
} else {
frappe.msgprint(
__("Paid Amount cannot be greater than total negative outstanding amount {0}", [total_negative_outstanding])
);
return false;
}
} else {
allocated_positive_outstanding = total_negative_outstanding - paid_amount;
allocated_negative_outstanding = paid_amount +
(total_positive_outstanding_including_order < allocated_positive_outstanding ?
total_positive_outstanding_including_order : allocated_positive_outstanding)
}
}
$.each(frm.doc.references || [], function(i, row) {
if (frappe.flags.allocate_payment_amount == 0) {
//If allocate payment amount checkbox is unchecked, set zero to allocate amount
row.allocated_amount = 0;
} else if (frappe.flags.allocate_payment_amount != 0 && (!row.allocated_amount || paid_amount_change)) {
if (row.outstanding_amount > 0 && allocated_positive_outstanding >= 0) {
row.allocated_amount = (row.outstanding_amount >= allocated_positive_outstanding) ?
allocated_positive_outstanding : row.outstanding_amount;
allocated_positive_outstanding -= flt(row.allocated_amount);
} else if (row.outstanding_amount < 0 && allocated_negative_outstanding) {
row.allocated_amount = (Math.abs(row.outstanding_amount) >= allocated_negative_outstanding) ?
-1*allocated_negative_outstanding : row.outstanding_amount;
allocated_negative_outstanding -= Math.abs(flt(row.allocated_amount));
}
}
})
frm.refresh_fields()
frm.events.set_total_allocated_amount(frm);
},
@@ -988,7 +986,7 @@ frappe.ui.form.on('Payment Entry', {
}
if(frm.doc.party_type=="Customer" &&
!in_list(["Sales Order", "Sales Invoice", "Journal Entry", "Dunning"], row.reference_doctype)
!["Sales Order", "Sales Invoice", "Journal Entry", "Dunning"].includes(row.reference_doctype)
) {
frappe.model.set_value(row.doctype, row.name, "reference_doctype", null);
frappe.msgprint(__("Row #{0}: Reference Document Type must be one of Sales Order, Sales Invoice, Journal Entry or Dunning", [row.idx]));
@@ -996,7 +994,7 @@ frappe.ui.form.on('Payment Entry', {
}
if(frm.doc.party_type=="Supplier" &&
!in_list(["Purchase Order", "Purchase Invoice", "Journal Entry"], row.reference_doctype)
!["Purchase Order", "Purchase Invoice", "Journal Entry"].includes(row.reference_doctype)
) {
frappe.model.set_value(row.doctype, row.name, "against_voucher_type", null);
frappe.msgprint(__("Row #{0}: Reference Document Type must be one of Purchase Order, Purchase Invoice or Journal Entry", [row.idx]));
@@ -1080,7 +1078,7 @@ frappe.ui.form.on('Payment Entry', {
bank_account: function(frm) {
const field = frm.doc.payment_type == "Pay" ? "paid_from":"paid_to";
if (frm.doc.bank_account && in_list(['Pay', 'Receive'], frm.doc.payment_type)) {
if (frm.doc.bank_account && ['Pay', 'Receive'].includes(frm.doc.payment_type)) {
frappe.call({
method: "erpnext.accounts.doctype.bank_account.bank_account.get_bank_account_details",
args: {
@@ -1378,6 +1376,62 @@ frappe.ui.form.on('Payment Entry', {
return current_tax_amount;
},
cost_center: function (frm) {
if (frm.doc.posting_date && (frm.doc.paid_from || frm.doc.paid_to)) {
return frappe.call({
method: "erpnext.accounts.doctype.payment_entry.payment_entry.get_party_and_account_balance",
args: {
company: frm.doc.company,
date: frm.doc.posting_date,
paid_from: frm.doc.paid_from,
paid_to: frm.doc.paid_to,
ptype: frm.doc.party_type,
pty: frm.doc.party,
cost_center: frm.doc.cost_center,
},
callback: function (r, rt) {
if (r.message) {
frappe.run_serially([
() => {
frm.set_value(
"paid_from_account_balance",
r.message.paid_from_account_balance
);
frm.set_value("paid_to_account_balance", r.message.paid_to_account_balance);
frm.set_value("party_balance", r.message.party_balance);
},
]);
}
},
});
}
},
after_save: function (frm) {
const { matched_payment_requests } = frappe.last_response;
if (!matched_payment_requests) return;
const COLUMN_LABEL = [
[__("Reference DocType"), __("Reference Name"), __("Allocated Amount"), __("Payment Request")],
];
frappe.msgprint({
title: __("Unset Matched Payment Request"),
message: COLUMN_LABEL.concat(matched_payment_requests),
as_table: true,
wide: true,
primary_action: {
label: __("Allocate Payment Request"),
action() {
frappe.hide_msgprint();
frm.call("set_matched_payment_requests", { matched_payment_requests }, () => {
frm.dirty();
});
},
},
});
},
});
@@ -1464,35 +1518,18 @@ frappe.ui.form.on('Payment Entry Deduction', {
deductions_remove: function(frm) {
frm.events.set_unallocated_amount(frm);
}
})
frappe.ui.form.on('Payment Entry', {
cost_center: function(frm){
if (frm.doc.posting_date && (frm.doc.paid_from||frm.doc.paid_to)) {
return frappe.call({
method: "erpnext.accounts.doctype.payment_entry.payment_entry.get_party_and_account_balance",
args: {
company: frm.doc.company,
date: frm.doc.posting_date,
paid_from: frm.doc.paid_from,
paid_to: frm.doc.paid_to,
ptype: frm.doc.party_type,
pty: frm.doc.party,
cost_center: frm.doc.cost_center
},
callback: function(r, rt) {
if(r.message) {
frappe.run_serially([
() => {
frm.set_value("paid_from_account_balance", r.message.paid_from_account_balance);
frm.set_value("paid_to_account_balance", r.message.paid_to_account_balance);
frm.set_value("party_balance", r.message.party_balance);
}
]);
}
}
});
}
},
})
});
function set_default_party_type(frm) {
if (frm.doc.party) return;
let party_type;
if (frm.doc.payment_type == "Receive") {
party_type = "Customer";
} else if (frm.doc.payment_type == "Pay") {
party_type = "Supplier";
}
if (party_type) frm.set_value("party_type", party_type);
}

View File

@@ -7,9 +7,11 @@ from functools import reduce
import frappe
from frappe import ValidationError, _, qb, scrub, throw
from frappe.query_builder import Tuple
from frappe.query_builder.functions import Count
from frappe.utils import cint, comma_or, flt, getdate, nowdate
from frappe.utils.data import comma_and, fmt_money
from pypika.functions import Sum
from frappe.utils.data import comma_and, fmt_money, get_link_to_form
from pypika.functions import Coalesce, Sum
import erpnext
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_dimensions
@@ -74,7 +76,6 @@ class PaymentEntry(AccountsController):
self.set_exchange_rate()
self.validate_mandatory()
self.validate_reference_documents()
self.set_tax_withholding()
self.set_amounts()
self.validate_amounts()
self.apply_taxes()
@@ -89,15 +90,20 @@ class PaymentEntry(AccountsController):
self.validate_allocated_amount()
self.validate_paid_invoices()
self.ensure_supplier_is_not_blocked()
self.set_tax_withholding()
self.set_status()
def before_save(self):
self.set_matched_unset_payment_requests_to_response()
def on_submit(self):
if self.difference_amount:
frappe.throw(_("Difference Amount must be zero"))
self.make_gl_entries()
self.update_outstanding_amounts()
self.update_advance_paid()
self.update_payment_schedule()
self.update_payment_requests()
self.update_advance_paid() # advance_paid_status depends on the payment request amount
self.set_status()
def on_cancel(self):
@@ -115,30 +121,34 @@ class PaymentEntry(AccountsController):
super().on_cancel()
self.make_gl_entries(cancel=1)
self.update_outstanding_amounts()
self.update_advance_paid()
self.delink_advance_entry_references()
self.update_payment_schedule(cancel=1)
self.set_payment_req_status()
self.update_payment_requests(cancel=True)
self.update_advance_paid() # advance_paid_status depends on the payment request amount
self.set_status()
def set_payment_req_status(self):
from erpnext.accounts.doctype.payment_request.payment_request import update_payment_req_status
def update_payment_requests(self, cancel=False):
from erpnext.accounts.doctype.payment_request.payment_request import (
update_payment_requests_as_per_pe_references,
)
update_payment_req_status(self, None)
update_payment_requests_as_per_pe_references(self.references, cancel=cancel)
def update_outstanding_amounts(self):
self.set_missing_ref_details(force=True)
def validate_duplicate_entry(self):
reference_names = []
reference_names = set()
for d in self.get("references"):
if (d.reference_doctype, d.reference_name, d.payment_term) in reference_names:
key = (d.reference_doctype, d.reference_name, d.payment_term, d.payment_request)
if key in reference_names:
frappe.throw(
_("Row #{0}: Duplicate entry in References {1} {2}").format(
d.idx, d.reference_doctype, d.reference_name
)
)
reference_names.append((d.reference_doctype, d.reference_name, d.payment_term))
reference_names.add(key)
def set_bank_account_data(self):
if self.bank_account:
@@ -164,6 +174,8 @@ class PaymentEntry(AccountsController):
if self.payment_type == "Internal Transfer":
return
self.validate_allocated_amount_as_per_payment_request()
if self.party_type in ("Customer", "Supplier"):
self.validate_allocated_amount_with_latest_data()
else:
@@ -176,6 +188,27 @@ class PaymentEntry(AccountsController):
if flt(d.allocated_amount) < 0 and flt(d.allocated_amount) < flt(d.outstanding_amount):
frappe.throw(fail_message.format(d.idx))
def validate_allocated_amount_as_per_payment_request(self):
"""
Allocated amount should not be greater than the outstanding amount of the Payment Request.
"""
if not self.references:
return
pr_outstanding_amounts = get_payment_request_outstanding_set_in_references(self.references)
if not pr_outstanding_amounts:
return
for ref in self.references:
if ref.payment_request and ref.allocated_amount > pr_outstanding_amounts[ref.payment_request]:
frappe.throw(
msg=_(
"Row #{0}: Allocated Amount cannot be greater than Outstanding Amount of Payment Request {1}"
).format(ref.idx, get_link_to_form("Payment Request", ref.payment_request)),
title=_("Invalid Allocated Amount"),
)
def term_based_allocation_enabled_for_reference(
self, reference_doctype: str, reference_name: str
) -> bool:
@@ -674,9 +707,7 @@ class PaymentEntry(AccountsController):
if not self.apply_tax_withholding_amount:
return
order_amount = self.get_order_net_total()
net_total = flt(order_amount) + flt(self.unallocated_amount)
net_total = self.calculate_tax_withholding_net_total()
# Adding args as purchase invoice to get TDS amount
args = frappe._dict(
@@ -720,7 +751,26 @@ class PaymentEntry(AccountsController):
for d in to_remove:
self.remove(d)
def get_order_net_total(self):
def calculate_tax_withholding_net_total(self):
net_total = 0
order_details = self.get_order_wise_tax_withholding_net_total()
for d in self.references:
tax_withholding_net_total = order_details.get(d.reference_name)
if not tax_withholding_net_total:
continue
net_taxable_outstanding = max(
0, d.outstanding_amount - (d.total_amount - tax_withholding_net_total)
)
net_total += min(net_taxable_outstanding, d.allocated_amount)
net_total += self.unallocated_amount
return net_total
def get_order_wise_tax_withholding_net_total(self):
if self.party_type == "Supplier":
doctype = "Purchase Order"
else:
@@ -728,12 +778,15 @@ class PaymentEntry(AccountsController):
docnames = [d.reference_name for d in self.references if d.reference_doctype == doctype]
tax_withholding_net_total = frappe.db.get_value(
doctype, {"name": ["in", docnames]}, ["sum(base_tax_withholding_net_total)"]
return frappe._dict(
frappe.db.get_all(
doctype,
filters={"name": ["in", docnames]},
fields=["name", "base_tax_withholding_net_total"],
as_list=True,
)
)
return tax_withholding_net_total
def apply_taxes(self):
self.initialize_taxes()
self.determine_exclusive_rate()
@@ -1402,6 +1455,380 @@ class PaymentEntry(AccountsController):
return current_tax_fraction
def set_matched_unset_payment_requests_to_response(self):
"""
Find matched Payment Requests for those references which have no Payment Request set.\n
And set to `frappe.response` to show in the frontend for allocation.
"""
if not self.references:
return
matched_payment_requests = get_matched_payment_request_of_references(
[row for row in self.references if not row.payment_request]
)
if not matched_payment_requests:
return
frappe.response["matched_payment_requests"] = matched_payment_requests
@frappe.whitelist()
def allocate_amount_to_references(self, paid_amount, paid_amount_change, allocate_payment_amount):
"""
Allocate `Allocated Amount` and `Payment Request` against `Reference` based on `Paid Amount` and `Outstanding Amount`.\n
:param paid_amount: Paid Amount / Received Amount.
:param paid_amount_change: Flag to check if `Paid Amount` is changed or not.
:param allocate_payment_amount: Flag to allocate amount or not. (Payment Request is also dependent on this flag)
"""
if not self.references:
return
if not allocate_payment_amount:
for ref in self.references:
ref.allocated_amount = 0
return
# calculating outstanding amounts
precision = self.precision("paid_amount")
total_positive_outstanding_including_order = 0
total_negative_outstanding = 0
paid_amount -= sum(flt(d.amount, precision) for d in self.deductions)
for ref in self.references:
reference_outstanding_amount = ref.outstanding_amount
abs_outstanding_amount = abs(reference_outstanding_amount)
if reference_outstanding_amount > 0:
total_positive_outstanding_including_order += abs_outstanding_amount
else:
total_negative_outstanding += abs_outstanding_amount
# calculating allocated outstanding amounts
allocated_negative_outstanding = 0
allocated_positive_outstanding = 0
# checking party type and payment type
if (self.payment_type == "Receive" and self.party_type == "Customer") or (
self.payment_type == "Pay" and self.party_type in ("Supplier", "Employee")
):
if total_positive_outstanding_including_order > paid_amount:
remaining_outstanding = flt(
total_positive_outstanding_including_order - paid_amount, precision
)
allocated_negative_outstanding = min(remaining_outstanding, total_negative_outstanding)
allocated_positive_outstanding = paid_amount + allocated_negative_outstanding
elif self.party_type in ("Supplier", "Employee"):
if paid_amount > total_negative_outstanding:
if total_negative_outstanding == 0:
frappe.msgprint(
_("Cannot {0} from {1} without any negative outstanding invoice").format(
self.payment_type,
self.party_type,
)
)
else:
frappe.msgprint(
_("Paid Amount cannot be greater than total negative outstanding amount {0}").format(
total_negative_outstanding
)
)
return
else:
allocated_positive_outstanding = flt(total_negative_outstanding - paid_amount, precision)
allocated_negative_outstanding = paid_amount + min(
total_positive_outstanding_including_order, allocated_positive_outstanding
)
# inner function to set `allocated_amount` to those row which have no PR
def _allocation_to_unset_pr_row(
row, outstanding_amount, allocated_positive_outstanding, allocated_negative_outstanding
):
if outstanding_amount > 0 and allocated_positive_outstanding >= 0:
row.allocated_amount = min(allocated_positive_outstanding, outstanding_amount)
allocated_positive_outstanding = flt(
allocated_positive_outstanding - row.allocated_amount, precision
)
elif outstanding_amount < 0 and allocated_negative_outstanding:
row.allocated_amount = min(allocated_negative_outstanding, abs(outstanding_amount)) * -1
allocated_negative_outstanding = flt(
allocated_negative_outstanding - abs(row.allocated_amount), precision
)
return allocated_positive_outstanding, allocated_negative_outstanding
# allocate amount based on `paid_amount` is changed or not
if not paid_amount_change:
for ref in self.references:
allocated_positive_outstanding, allocated_negative_outstanding = _allocation_to_unset_pr_row(
ref,
ref.outstanding_amount,
allocated_positive_outstanding,
allocated_negative_outstanding,
)
allocate_open_payment_requests_to_references(self.references, self.precision("paid_amount"))
else:
payment_request_outstanding_amounts = (
get_payment_request_outstanding_set_in_references(self.references) or {}
)
references_outstanding_amounts = get_references_outstanding_amount(self.references) or {}
remaining_references_allocated_amounts = references_outstanding_amounts.copy()
# Re allocate amount to those references which have PR set (Higher priority)
for ref in self.references:
if not ref.payment_request:
continue
# fetch outstanding_amount of `Reference` (Payment Term) and `Payment Request` to allocate new amount
key = (ref.reference_doctype, ref.reference_name, ref.get("payment_term"))
reference_outstanding_amount = references_outstanding_amounts[key]
pr_outstanding_amount = payment_request_outstanding_amounts[ref.payment_request]
if reference_outstanding_amount > 0 and allocated_positive_outstanding >= 0:
# allocate amount according to outstanding amounts
outstanding_amounts = (
allocated_positive_outstanding,
reference_outstanding_amount,
pr_outstanding_amount,
)
ref.allocated_amount = min(outstanding_amounts)
# update amounts to track allocation
allocated_amount = ref.allocated_amount
allocated_positive_outstanding = flt(
allocated_positive_outstanding - allocated_amount, precision
)
remaining_references_allocated_amounts[key] = flt(
remaining_references_allocated_amounts[key] - allocated_amount, precision
)
payment_request_outstanding_amounts[ref.payment_request] = flt(
payment_request_outstanding_amounts[ref.payment_request] - allocated_amount, precision
)
elif reference_outstanding_amount < 0 and allocated_negative_outstanding:
# allocate amount according to outstanding amounts
outstanding_amounts = (
allocated_negative_outstanding,
abs(reference_outstanding_amount),
pr_outstanding_amount,
)
ref.allocated_amount = min(outstanding_amounts) * -1
# update amounts to track allocation
allocated_amount = abs(ref.allocated_amount)
allocated_negative_outstanding = flt(
allocated_negative_outstanding - allocated_amount, precision
)
remaining_references_allocated_amounts[key] += allocated_amount # negative amount
payment_request_outstanding_amounts[ref.payment_request] = flt(
payment_request_outstanding_amounts[ref.payment_request] - allocated_amount, precision
)
# Re allocate amount to those references which have no PR (Lower priority)
for ref in self.references:
if ref.payment_request:
continue
key = (ref.reference_doctype, ref.reference_name, ref.get("payment_term"))
reference_outstanding_amount = remaining_references_allocated_amounts[key]
allocated_positive_outstanding, allocated_negative_outstanding = _allocation_to_unset_pr_row(
ref,
reference_outstanding_amount,
allocated_positive_outstanding,
allocated_negative_outstanding,
)
@frappe.whitelist()
def set_matched_payment_requests(self, matched_payment_requests):
"""
Set `Payment Request` against `Reference` based on `matched_payment_requests`.\n
:param matched_payment_requests: List of tuple of matched Payment Requests.
---
Example: [(reference_doctype, reference_name, allocated_amount, payment_request), ...]
"""
if not self.references or not matched_payment_requests:
return
if isinstance(matched_payment_requests, str):
matched_payment_requests = json.loads(matched_payment_requests)
# modify matched_payment_requests
# like (reference_doctype, reference_name, allocated_amount): payment_request
payment_requests = {}
for row in matched_payment_requests:
key = tuple(row[:3])
payment_requests[key] = row[3]
for ref in self.references:
if ref.payment_request:
continue
key = (ref.reference_doctype, ref.reference_name, ref.allocated_amount)
if key in payment_requests:
ref.payment_request = payment_requests[key]
del payment_requests[key] # to avoid duplicate allocation
def get_matched_payment_request_of_references(references=None):
"""
Get those `Payment Requests` which are matched with `References`.\n
- Amount must be same.
- Only single `Payment Request` available for this amount.
Example: [(reference_doctype, reference_name, allocated_amount, payment_request), ...]
"""
if not references:
return
# to fetch matched rows
refs = {
(row.reference_doctype, row.reference_name, row.allocated_amount)
for row in references
if row.reference_doctype and row.reference_name and row.allocated_amount
}
if not refs:
return
PR = frappe.qb.DocType("Payment Request")
# query to group by reference_doctype, reference_name, outstanding_amount
subquery = (
frappe.qb.from_(PR)
.select(
PR.reference_doctype,
PR.reference_name,
PR.outstanding_amount.as_("allocated_amount"),
PR.name.as_("payment_request"),
Count("*").as_("count"),
)
.where(Tuple(PR.reference_doctype, PR.reference_name, PR.outstanding_amount).isin(refs))
.where(PR.status != "Paid")
.where(PR.docstatus == 1)
.groupby(PR.reference_doctype, PR.reference_name, PR.outstanding_amount)
)
# query to fetch matched rows which are single
matched_prs = (
frappe.qb.from_(subquery)
.select(
subquery.reference_doctype,
subquery.reference_name,
subquery.allocated_amount,
subquery.payment_request,
)
.where(subquery.count == 1)
.run()
)
return matched_prs if matched_prs else None
def get_references_outstanding_amount(references=None):
"""
Fetch accurate outstanding amount of `References`.\n
- If `Payment Term` is set, then fetch outstanding amount from `Payment Schedule`.
- If `Payment Term` is not set, then fetch outstanding amount from `References` it self.
Example: {(reference_doctype, reference_name, payment_term): outstanding_amount, ...}
"""
if not references:
return
refs_with_payment_term = get_outstanding_of_references_with_payment_term(references) or {}
refs_without_payment_term = get_outstanding_of_references_with_no_payment_term(references) or {}
return {**refs_with_payment_term, **refs_without_payment_term}
def get_outstanding_of_references_with_payment_term(references=None):
"""
Fetch outstanding amount of `References` which have `Payment Term` set.\n
Example: {(reference_doctype, reference_name, payment_term): outstanding_amount, ...}
"""
if not references:
return
refs = {
(row.reference_doctype, row.reference_name, row.payment_term)
for row in references
if row.reference_doctype and row.reference_name and row.payment_term
}
if not refs:
return
PS = frappe.qb.DocType("Payment Schedule")
response = (
frappe.qb.from_(PS)
.select(PS.parenttype, PS.parent, PS.payment_term, PS.outstanding)
.where(Tuple(PS.parenttype, PS.parent, PS.payment_term).isin(refs))
).run(as_dict=True)
if not response:
return
return {(row.parenttype, row.parent, row.payment_term): row.outstanding for row in response}
def get_outstanding_of_references_with_no_payment_term(references):
"""
Fetch outstanding amount of `References` which have no `Payment Term` set.\n
- Fetch outstanding amount from `References` it self.
Note: `None` is used for allocation of `Payment Request`
Example: {(reference_doctype, reference_name, None): outstanding_amount, ...}
"""
if not references:
return
outstanding_amounts = {}
for ref in references:
if ref.payment_term:
continue
key = (ref.reference_doctype, ref.reference_name, None)
if key not in outstanding_amounts:
outstanding_amounts[key] = ref.outstanding_amount
return outstanding_amounts
def get_payment_request_outstanding_set_in_references(references=None):
"""
Fetch outstanding amount of `Payment Request` which are set in `References`.\n
Example: {payment_request: outstanding_amount, ...}
"""
if not references:
return
referenced_payment_requests = {row.payment_request for row in references if row.payment_request}
if not referenced_payment_requests:
return
PR = frappe.qb.DocType("Payment Request")
response = (
frappe.qb.from_(PR)
.select(PR.name, PR.outstanding_amount)
.where(PR.name.isin(referenced_payment_requests))
).run()
return dict(response) if response else None
def validate_inclusive_tax(tax, doc):
def _on_previous_row_error(row_range):
@@ -1543,7 +1970,7 @@ def get_outstanding_reference_documents(args):
d["bill_no"] = frappe.db.get_value(d.voucher_type, d.voucher_no, "bill_no")
# Get negative outstanding sales /purchase invoices
if args.get("party_type") != "Employee" and not args.get("voucher_no"):
if args.get("party_type") != "Employee":
negative_outstanding_invoices = get_negative_outstanding_invoices(
args.get("party_type"),
args.get("party"),
@@ -1843,7 +2270,9 @@ def get_party_details(company, party_type, party, date, cost_center=None):
account_balance = get_balance_on(party_account, date, cost_center=cost_center)
_party_name = "title" if party_type == "Shareholder" else party_type.lower() + "_name"
party_name = frappe.db.get_value(party_type, party, _party_name)
party_balance = get_balance_on(party_type=party_type, party=party, cost_center=cost_center)
party_balance = get_balance_on(
party_type=party_type, party=party, company=company, cost_center=cost_center
)
if party_type in ["Customer", "Supplier"]:
bank_account = get_party_bank_account(party_type, party)
@@ -1990,6 +2419,8 @@ def get_payment_entry(
party_type=None,
payment_type=None,
reference_date=None,
ignore_permissions=False,
created_from_payment_request=False,
):
doc = frappe.get_doc(dt, dn)
over_billing_allowance = frappe.db.get_single_value("Accounts Settings", "over_billing_allowance")
@@ -2140,9 +2571,180 @@ def get_payment_entry(
pe.set_difference_amount()
# If PE is created from PR directly, then no need to find open PRs for the references
if not created_from_payment_request:
allocate_open_payment_requests_to_references(pe.references, pe.precision("paid_amount"))
return pe
def get_open_payment_requests_for_references(references=None):
"""
Fetch all unpaid Payment Requests for the references. \n
- Each reference can have multiple Payment Requests. \n
Example: {("Sales Invoice", "SINV-00001"): {"PREQ-00001": 1000, "PREQ-00002": 2000}}
"""
if not references:
return
refs = {
(row.reference_doctype, row.reference_name)
for row in references
if row.reference_doctype and row.reference_name and row.allocated_amount
}
if not refs:
return
PR = frappe.qb.DocType("Payment Request")
response = (
frappe.qb.from_(PR)
.select(PR.name, PR.reference_doctype, PR.reference_name, PR.outstanding_amount)
.where(Tuple(PR.reference_doctype, PR.reference_name).isin(list(refs)))
.where(PR.status != "Paid")
.where(PR.docstatus == 1)
.where(PR.outstanding_amount > 0) # to avoid old PRs with 0 outstanding amount
.orderby(Coalesce(PR.transaction_date, PR.creation), order=frappe.qb.asc)
).run(as_dict=True)
if not response:
return
reference_payment_requests = {}
for row in response:
key = (row.reference_doctype, row.reference_name)
if key not in reference_payment_requests:
reference_payment_requests[key] = {row.name: row.outstanding_amount}
else:
reference_payment_requests[key][row.name] = row.outstanding_amount
return reference_payment_requests
def allocate_open_payment_requests_to_references(references=None, precision=None):
"""
Allocate unpaid Payment Requests to the references. \n
---
- Allocation based on below factors
- Reference Allocated Amount
- Reference Outstanding Amount (With Payment Terms or without Payment Terms)
- Reference Payment Request's outstanding amount
---
- Allocation based on below scenarios
- Reference's Allocated Amount == Payment Request's Outstanding Amount
- Allocate the Payment Request to the reference
- This PR will not be allocated further
- Reference's Allocated Amount < Payment Request's Outstanding Amount
- Allocate the Payment Request to the reference
- Reduce the PR's outstanding amount by the allocated amount
- This PR can be allocated further
- Reference's Allocated Amount > Payment Request's Outstanding Amount
- Allocate the Payment Request to the reference
- Reduce Allocated Amount of the reference by the PR's outstanding amount
- Create a new row for the remaining amount until the Allocated Amount is 0
- Allocate PR if available
---
- Note:
- Priority is given to the first Payment Request of respective references.
- Single Reference can have multiple rows.
- With Payment Terms or without Payment Terms
- With Payment Request or without Payment Request
"""
if not references:
return
# get all unpaid payment requests for the references
references_open_payment_requests = get_open_payment_requests_for_references(references)
if not references_open_payment_requests:
return
if not precision:
precision = references[0].precision("allocated_amount")
# to manage new rows
row_number = 1
MOVE_TO_NEXT_ROW = 1
TO_SKIP_NEW_ROW = 2
while row_number <= len(references):
row = references[row_number - 1]
reference_key = (row.reference_doctype, row.reference_name)
# update the idx to maintain the order
row.idx = row_number
# unpaid payment requests for the reference
reference_payment_requests = references_open_payment_requests.get(reference_key)
if not reference_payment_requests:
row_number += MOVE_TO_NEXT_ROW # to move to next reference row
continue
# get the first payment request and its outstanding amount
payment_request, pr_outstanding_amount = next(iter(reference_payment_requests.items()))
allocated_amount = row.allocated_amount
# allocate the payment request to the reference and PR's outstanding amount
row.payment_request = payment_request
if pr_outstanding_amount == allocated_amount:
del reference_payment_requests[payment_request]
row_number += MOVE_TO_NEXT_ROW
elif pr_outstanding_amount > allocated_amount:
# reduce the outstanding amount of the payment request
reference_payment_requests[payment_request] -= allocated_amount
row_number += MOVE_TO_NEXT_ROW
else:
# split the reference row to allocate the remaining amount
del reference_payment_requests[payment_request]
row.allocated_amount = pr_outstanding_amount
allocated_amount = flt(allocated_amount - pr_outstanding_amount, precision)
# set the remaining amount to the next row
while allocated_amount:
# create a new row for the remaining amount
new_row = frappe.copy_doc(row)
references.insert(row_number, new_row)
# get the first payment request and its outstanding amount
payment_request, pr_outstanding_amount = next(
iter(reference_payment_requests.items()), (None, None)
)
# update new row
new_row.idx = row_number + 1
new_row.payment_request = payment_request
new_row.allocated_amount = min(
pr_outstanding_amount if pr_outstanding_amount else allocated_amount, allocated_amount
)
if not payment_request or not pr_outstanding_amount:
row_number += TO_SKIP_NEW_ROW
break
elif pr_outstanding_amount == allocated_amount:
del reference_payment_requests[payment_request]
row_number += TO_SKIP_NEW_ROW
break
elif pr_outstanding_amount > allocated_amount:
reference_payment_requests[payment_request] -= allocated_amount
row_number += TO_SKIP_NEW_ROW
break
else:
allocated_amount = flt(allocated_amount - pr_outstanding_amount, precision)
del reference_payment_requests[payment_request]
row_number += MOVE_TO_NEXT_ROW
def update_accounting_dimensions(pe, doc):
"""
Updates accounting dimensions in Payment Entry based on the accounting dimensions in the reference document

View File

@@ -1365,6 +1365,79 @@ class TestPaymentEntry(FrappeTestCase):
expected_out_str = json.dumps(sorted(expected_pl_entries, key=json.dumps))
self.assertEqual(out_str, expected_out_str)
@change_settings("Accounts Settings", {"delete_linked_ledger_entries": 1})
def test_delete_linked_exchange_gain_loss_journal(self):
from erpnext.accounts.doctype.account.test_account import create_account
from erpnext.accounts.doctype.opening_invoice_creation_tool.test_opening_invoice_creation_tool import (
make_customer,
)
debtors = create_account(
account_name="Debtors USD",
parent_account="Accounts Receivable - _TC",
company="_Test Company",
account_currency="USD",
account_type="Receivable",
)
# create a customer
customer = make_customer(customer="_Test Party USD")
cust_doc = frappe.get_doc("Customer", customer)
cust_doc.default_currency = "USD"
test_account_details = {
"company": "_Test Company",
"account": debtors,
}
cust_doc.append("accounts", test_account_details)
cust_doc.save()
# create a sales invoice
si = create_sales_invoice(
customer=customer,
currency="USD",
conversion_rate=83.970000000,
debit_to=debtors,
do_not_save=1,
)
si.party_account_currency = "USD"
si.save()
si.submit()
# create a payment entry for the invoice
pe = get_payment_entry("Sales Invoice", si.name)
pe.reference_no = "1"
pe.reference_date = frappe.utils.nowdate()
pe.paid_amount = 100
pe.source_exchange_rate = 90
pe.append(
"deductions",
{
"account": "_Test Exchange Gain/Loss - _TC",
"cost_center": "_Test Cost Center - _TC",
"amount": 2710,
},
)
pe.save()
pe.submit()
# check creation of journal entry
jv = frappe.get_all(
"Journal Entry Account",
{"reference_type": pe.doctype, "reference_name": pe.name, "docstatus": 1},
pluck="parent",
)
self.assertTrue(jv)
# check cancellation of payment entry and journal entry
pe.cancel()
self.assertTrue(pe.docstatus == 2)
self.assertTrue(frappe.db.get_value("Journal Entry", {"name": jv[0]}, "docstatus") == 2)
# check deletion of payment entry and journal entry
pe.delete()
self.assertRaises(frappe.DoesNotExistError, frappe.get_doc, pe.doctype, pe.name)
self.assertRaises(frappe.DoesNotExistError, frappe.get_doc, "Journal Entry", jv[0])
def create_payment_entry(**args):
payment_entry = frappe.new_doc("Payment Entry")

View File

@@ -10,12 +10,15 @@
"due_date",
"bill_no",
"payment_term",
"payment_term_outstanding",
"column_break_4",
"total_amount",
"outstanding_amount",
"allocated_amount",
"exchange_rate",
"exchange_gain_loss"
"exchange_gain_loss",
"payment_request",
"payment_request_outstanding"
],
"fields": [
{
@@ -101,12 +104,33 @@
"label": "Exchange Gain/Loss",
"options": "Company:company:default_currency",
"read_only": 1
},
{
"fieldname": "payment_request",
"fieldtype": "Link",
"label": "Payment Request",
"options": "Payment Request"
},
{
"depends_on": "eval: doc.payment_term",
"fieldname": "payment_term_outstanding",
"fieldtype": "Float",
"label": "Payment Term Outstanding",
"read_only": 1
},
{
"depends_on": "eval: doc.payment_request && doc.payment_request_outstanding",
"fieldname": "payment_request_outstanding",
"fieldtype": "Float",
"is_virtual": 1,
"label": "Payment Request Outstanding",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2022-12-12 12:31:44.919895",
"modified": "2024-09-16 18:11:50.019343",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry Reference",

View File

@@ -1,9 +1,14 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
class PaymentEntryReference(Document):
pass
@property
def payment_request_outstanding(self):
if not self.payment_request:
return
return frappe.db.get_value("Payment Request", self.payment_request, "outstanding_amount")

View File

@@ -36,7 +36,7 @@ frappe.ui.form.on("Payment Order", {
// payment Entry
if (frm.doc.docstatus === 1 && frm.doc.payment_order_type === "Payment Request") {
frm.add_custom_button(__("Create Payment Entries"), function () {
frm.add_custom_button(__("Create Journal Entries"), function () {
frm.trigger("make_payment_records");
});
}

View File

@@ -144,12 +144,14 @@ class PaymentReconciliation(Document):
if self.get("cost_center"):
conditions.append(jea.cost_center == self.cost_center)
dr_or_cr = (
"credit_in_account_currency"
if erpnext.get_party_account_type(self.party_type) == "Receivable"
else "debit_in_account_currency"
)
conditions.append(jea[dr_or_cr].gt(0))
account_type = erpnext.get_party_account_type(self.party_type)
if account_type == "Receivable":
dr_or_cr = jea.credit_in_account_currency - jea.debit_in_account_currency
elif account_type == "Payable":
dr_or_cr = jea.debit_in_account_currency - jea.credit_in_account_currency
conditions.append(dr_or_cr.gt(0))
if self.bank_cash_account:
conditions.append(jea.against_account.like(f"%%{self.bank_cash_account}%%"))
@@ -164,7 +166,7 @@ class PaymentReconciliation(Document):
je.posting_date,
je.remark.as_("remarks"),
jea.name.as_("reference_row"),
jea[dr_or_cr].as_("amount"),
dr_or_cr.as_("amount"),
jea.is_advance,
jea.exchange_rate,
jea.account_currency.as_("currency"),
@@ -200,6 +202,7 @@ class PaymentReconciliation(Document):
conditions.append(doc.docstatus == 1)
conditions.append(doc[frappe.scrub(self.party_type)] == self.party)
conditions.append(doc.is_return == 1)
conditions.append(doc.outstanding_amount != 0)
if self.payment_name:
conditions.append(doc.name.like(f"%{self.payment_name}%"))
@@ -255,6 +258,7 @@ class PaymentReconciliation(Document):
"posting_date": inv.posting_date,
"currency": inv.currency,
"cost_center": inv.cost_center,
"remarks": inv.remarks,
}
)
)
@@ -297,6 +301,10 @@ class PaymentReconciliation(Document):
if self.invoice_limit:
non_reconciled_invoices = non_reconciled_invoices[: self.invoice_limit]
non_reconciled_invoices = sorted(
non_reconciled_invoices, key=lambda k: k["posting_date"] or getdate(nowdate())
)
self.add_invoice_entries(non_reconciled_invoices)
def add_invoice_entries(self, non_reconciled_invoices):

View File

@@ -615,6 +615,42 @@ class TestPaymentReconciliation(FrappeTestCase):
self.assertEqual(len(pr.get("invoices")), 0)
self.assertEqual(len(pr.get("payments")), 0)
def test_negative_debit_or_credit_journal_against_invoice(self):
transaction_date = nowdate()
amount = 100
si = self.create_sales_invoice(qty=1, rate=amount, posting_date=transaction_date)
# credit debtors account to record a payment
je = self.create_journal_entry(self.bank, self.debit_to, amount, transaction_date)
je.accounts[1].party_type = "Customer"
je.accounts[1].party = self.customer
je.accounts[1].credit_in_account_currency = 0
je.accounts[1].debit_in_account_currency = -1 * amount
je.save()
je.submit()
pr = self.create_payment_reconciliation()
pr.get_unreconciled_entries()
invoices = [x.as_dict() for x in pr.get("invoices")]
payments = [x.as_dict() for x in pr.get("payments")]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
# Difference amount should not be calculated for base currency accounts
for row in pr.allocation:
self.assertEqual(flt(row.get("difference_amount")), 0.0)
pr.reconcile()
# assert outstanding
si.reload()
self.assertEqual(si.status, "Paid")
self.assertEqual(si.outstanding_amount, 0)
# check PR tool output
self.assertEqual(len(pr.get("invoices")), 0)
self.assertEqual(len(pr.get("payments")), 0)
def test_journal_against_journal(self):
transaction_date = nowdate()
sales = "Sales - _PR"
@@ -937,6 +973,100 @@ class TestPaymentReconciliation(FrappeTestCase):
frappe.db.get_value("Journal Entry", jea_parent.parent, "voucher_type"), "Exchange Gain Or Loss"
)
def test_difference_amount_via_negative_debit_or_credit_journal_entry(self):
# Make Sale Invoice
si = self.create_sales_invoice(
qty=1, rate=100, posting_date=nowdate(), do_not_save=True, do_not_submit=True
)
si.customer = self.customer4
si.currency = "EUR"
si.conversion_rate = 85
si.debit_to = self.debtors_eur
si.save().submit()
# Make payment using Journal Entry
je1 = self.create_journal_entry("HDFC - _PR", self.debtors_eur, 100, nowdate())
je1.multi_currency = 1
je1.accounts[0].exchange_rate = 1
je1.accounts[0].credit_in_account_currency = -8000
je1.accounts[0].credit = -8000
je1.accounts[0].debit_in_account_currency = 0
je1.accounts[0].debit = 0
je1.accounts[1].party_type = "Customer"
je1.accounts[1].party = self.customer4
je1.accounts[1].exchange_rate = 80
je1.accounts[1].credit_in_account_currency = 100
je1.accounts[1].credit = 8000
je1.accounts[1].debit_in_account_currency = 0
je1.accounts[1].debit = 0
je1.save()
je1.submit()
je2 = self.create_journal_entry("HDFC - _PR", self.debtors_eur, 200, nowdate())
je2.multi_currency = 1
je2.accounts[0].exchange_rate = 1
je2.accounts[0].credit_in_account_currency = -16000
je2.accounts[0].credit = -16000
je2.accounts[0].debit_in_account_currency = 0
je2.accounts[0].debit = 0
je2.accounts[1].party_type = "Customer"
je2.accounts[1].party = self.customer4
je2.accounts[1].exchange_rate = 80
je2.accounts[1].credit_in_account_currency = 200
je1.accounts[1].credit = 16000
je1.accounts[1].debit_in_account_currency = 0
je1.accounts[1].debit = 0
je2.save()
je2.submit()
pr = self.create_payment_reconciliation()
pr.party = self.customer4
pr.receivable_payable_account = self.debtors_eur
pr.get_unreconciled_entries()
self.assertEqual(len(pr.invoices), 1)
self.assertEqual(len(pr.payments), 2)
# Test exact payment allocation
invoices = [x.as_dict() for x in pr.invoices]
payments = [pr.payments[0].as_dict()]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
self.assertEqual(pr.allocation[0].allocated_amount, 100)
self.assertEqual(pr.allocation[0].difference_amount, -500)
# Test partial payment allocation (with excess payment entry)
pr.set("allocation", [])
pr.get_unreconciled_entries()
invoices = [x.as_dict() for x in pr.invoices]
payments = [pr.payments[1].as_dict()]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
pr.allocation[0].difference_account = "Exchange Gain/Loss - _PR"
self.assertEqual(pr.allocation[0].allocated_amount, 100)
self.assertEqual(pr.allocation[0].difference_amount, -500)
# Check if difference journal entry gets generated for difference amount after reconciliation
pr.reconcile()
total_credit_amount = frappe.db.get_all(
"Journal Entry Account",
{"account": self.debtors_eur, "docstatus": 1, "reference_name": si.name},
"sum(credit) as amount",
group_by="reference_name",
)[0].amount
# total credit includes the exchange gain/loss amount
self.assertEqual(flt(total_credit_amount, 2), 8500)
jea_parent = frappe.db.get_all(
"Journal Entry Account",
filters={"account": self.debtors_eur, "docstatus": 1, "reference_name": si.name, "credit": 500},
fields=["parent"],
)[0]
self.assertEqual(
frappe.db.get_value("Journal Entry", jea_parent.parent, "voucher_type"), "Exchange Gain Or Loss"
)
def test_difference_amount_via_payment_entry(self):
# Make Sale Invoice
si = self.create_sales_invoice(
@@ -1335,6 +1465,46 @@ class TestPaymentReconciliation(FrappeTestCase):
# Should not raise frappe.exceptions.ValidationError: Payment Entry has been modified after you pulled it. Please pull it again.
pr.reconcile()
def test_cr_note_payment_limit_filter(self):
transaction_date = nowdate()
amount = 100
for _ in range(6):
self.create_sales_invoice(qty=1, rate=amount, posting_date=transaction_date)
cr_note = self.create_sales_invoice(
qty=-1, rate=amount, posting_date=transaction_date, do_not_save=True, do_not_submit=True
)
cr_note.is_return = 1
cr_note = cr_note.save().submit()
pr = self.create_payment_reconciliation()
pr.get_unreconciled_entries()
self.assertEqual(len(pr.invoices), 6)
self.assertEqual(len(pr.payments), 6)
invoices = [x.as_dict() for x in pr.get("invoices")]
payments = [x.as_dict() for x in pr.get("payments")]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
pr.reconcile()
pr.get_unreconciled_entries()
self.assertEqual(pr.get("invoices"), [])
self.assertEqual(pr.get("payments"), [])
self.create_sales_invoice(qty=1, rate=amount, posting_date=transaction_date)
cr_note = self.create_sales_invoice(
qty=-1, rate=amount, posting_date=transaction_date, do_not_save=True, do_not_submit=True
)
cr_note.is_return = 1
cr_note = cr_note.save().submit()
# Limit should not affect in fetching the unallocated cr_note
pr.invoice_limit = 5
pr.payment_limit = 5
pr.get_unreconciled_entries()
self.assertEqual(len(pr.invoices), 1)
self.assertEqual(len(pr.payments), 1)
def make_customer(customer_name, currency=None):
if not frappe.db.exists("Customer", customer_name):

View File

@@ -14,7 +14,7 @@
"amount",
"difference_amount",
"sec_break1",
"remark",
"remarks",
"currency",
"exchange_rate",
"cost_center"
@@ -74,12 +74,6 @@
"fieldname": "sec_break1",
"fieldtype": "Section Break"
},
{
"fieldname": "remark",
"fieldtype": "Small Text",
"label": "Remark",
"read_only": 1
},
{
"fieldname": "currency",
"fieldtype": "Link",
@@ -105,12 +99,18 @@
"fieldtype": "Link",
"label": "Cost Center",
"options": "Cost Center"
},
{
"fieldname": "remarks",
"fieldtype": "Small Text",
"label": "Remarks",
"read_only": 1
}
],
"is_virtual": 1,
"istable": 1,
"links": [],
"modified": "2023-11-17 17:33:34.818530",
"modified": "2024-10-29 16:24:43.021230",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation Payment",

View File

@@ -28,7 +28,7 @@ frappe.ui.form.on("Payment Request", "refresh", function (frm) {
if (
frm.doc.payment_request_type == "Inward" &&
frm.doc.payment_channel !== "Phone" &&
!in_list(["Initiated", "Paid"], frm.doc.status) &&
!["Initiated", "Paid"].includes(frm.doc.status) &&
!frm.doc.__islocal &&
frm.doc.docstatus == 1
) {
@@ -48,8 +48,8 @@ frappe.ui.form.on("Payment Request", "refresh", function (frm) {
}
if (
(!frm.doc.payment_gateway_account || frm.doc.payment_request_type == "Outward") &&
frm.doc.status == "Initiated"
frm.doc.payment_request_type == "Outward" &&
["Initiated", "Partially Paid"].includes(frm.doc.status)
) {
frm.add_custom_button(__("Create Payment Entry"), function () {
frappe.call({

View File

@@ -18,9 +18,11 @@
"reference_name",
"transaction_details",
"grand_total",
"currency",
"is_a_subscription",
"column_break_18",
"currency",
"outstanding_amount",
"party_account_currency",
"subscription_section",
"subscription_plans",
"bank_account_details",
@@ -68,6 +70,7 @@
{
"fieldname": "transaction_date",
"fieldtype": "Date",
"in_preview": 1,
"label": "Transaction Date"
},
{
@@ -132,7 +135,8 @@
"no_copy": 1,
"options": "reference_doctype",
"print_hide": 1,
"read_only": 1
"read_only": 1,
"search_index": 1
},
{
"fieldname": "transaction_details",
@@ -140,11 +144,14 @@
"label": "Transaction Details"
},
{
"description": "Amount in customer's currency",
"description": "Amount in transaction currency",
"fieldname": "grand_total",
"fieldtype": "Currency",
"in_preview": 1,
"label": "Amount",
"options": "currency"
"non_negative": 1,
"options": "currency",
"reqd": 1
},
{
"default": "0",
@@ -388,13 +395,31 @@
"fieldtype": "Link",
"label": "Project",
"options": "Project"
},
{
"depends_on": "eval: doc.docstatus === 1",
"description": "Amount in party's bank account currency",
"fieldname": "outstanding_amount",
"fieldtype": "Currency",
"in_preview": 1,
"label": "Outstanding Amount",
"non_negative": 1,
"options": "party_account_currency",
"read_only": 1
},
{
"fieldname": "party_account_currency",
"fieldtype": "Link",
"label": "Party Account Currency",
"options": "Currency",
"read_only": 1
}
],
"in_create": 1,
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2022-12-21 16:56:40.115737",
"modified": "2024-09-16 17:50:54.440090",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Request",
@@ -429,7 +454,8 @@
"write": 1
}
],
"show_preview_popup": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
}

View File

@@ -7,9 +7,11 @@ import json
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.query_builder.functions import Sum
from frappe.utils import flt, get_url, nowdate
from frappe.utils.background_jobs import enqueue
from erpnext import get_company_currency
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
get_accounting_dimensions,
)
@@ -19,7 +21,7 @@ from erpnext.accounts.doctype.payment_entry.payment_entry import (
)
from erpnext.accounts.doctype.subscription_plan.subscription_plan import get_plan_rate
from erpnext.accounts.party import get_party_account, get_party_bank_account
from erpnext.accounts.utils import get_account_currency
from erpnext.accounts.utils import get_account_currency, get_currency_precision
from erpnext.erpnext_integrations.stripe_integration import create_stripe_subscription
from erpnext.utilities import payment_app_import_guard
@@ -45,6 +47,12 @@ class PaymentRequest(Document):
frappe.throw(_("To create a Payment Request reference document is required"))
def validate_payment_request_amount(self):
if self.grand_total == 0:
frappe.throw(
_("{0} cannot be zero").format(self.get_label_from_fieldname("grand_total")),
title=_("Invalid Amount"),
)
existing_payment_request_amount = flt(
get_existing_payment_request_amount(self.reference_doctype, self.reference_name)
)
@@ -92,6 +100,29 @@ class PaymentRequest(Document):
).format(self.grand_total, amount)
)
def before_submit(self):
company = frappe.get_value(self.reference_doctype, self.reference_name, "company")
if (
self.currency != self.party_account_currency
and self.party_account_currency == get_company_currency(company)
):
# set outstanding amount in party account currency
invoice = frappe.get_value(
self.reference_doctype,
self.reference_name,
["rounded_total", "grand_total", "base_rounded_total", "base_grand_total"],
as_dict=1,
)
grand_total = invoice.get("rounded_total") or invoice.get("grand_total")
base_grand_total = invoice.get("base_rounded_total") or invoice.get("base_grand_total")
self.outstanding_amount = flt(
self.grand_total / grand_total * base_grand_total,
self.precision("outstanding_amount"),
)
else:
self.outstanding_amount = self.grand_total
def on_submit(self):
if self.payment_request_type == "Outward":
self.db_set("status", "Initiated")
@@ -207,12 +238,12 @@ class PaymentRequest(Document):
return controller.get_payment_url(
**{
"amount": flt(self.grand_total, self.precision("grand_total")),
"title": data.company.encode("utf-8"),
"description": self.subject.encode("utf-8"),
"title": data.company,
"description": self.subject,
"reference_doctype": "Payment Request",
"reference_docname": self.name,
"payer_email": self.email_to or frappe.session.user,
"payer_name": frappe.safe_encode(data.customer_name),
"payer_name": data.customer_name,
"order_id": self.name,
"currency": self.currency,
}
@@ -220,7 +251,7 @@ class PaymentRequest(Document):
def set_as_paid(self):
if self.payment_channel == "Phone":
self.db_set("status", "Paid")
self.db_set({"status": "Paid", "outstanding_amount": 0})
else:
payment_entry = self.create_payment_entry()
@@ -241,26 +272,32 @@ class PaymentRequest(Document):
else:
party_account = get_party_account("Customer", ref_doc.get("customer"), ref_doc.company)
party_account_currency = ref_doc.get("party_account_currency") or get_account_currency(party_account)
party_account_currency = (
self.get("party_account_currency")
or ref_doc.get("party_account_currency")
or get_account_currency(party_account)
)
party_amount = bank_amount = self.outstanding_amount
bank_amount = self.grand_total
if party_account_currency == ref_doc.company_currency and party_account_currency != self.currency:
party_amount = ref_doc.get("base_rounded_total") or ref_doc.get("base_grand_total")
else:
party_amount = self.grand_total
exchange_rate = ref_doc.get("conversion_rate")
bank_amount = flt(self.outstanding_amount / exchange_rate, self.precision("grand_total"))
# outstanding amount is already in Part's account currency
payment_entry = get_payment_entry(
self.reference_doctype,
self.reference_name,
party_amount=party_amount,
bank_account=self.payment_account,
bank_amount=bank_amount,
created_from_payment_request=True,
)
payment_entry.update(
{
"mode_of_payment": self.mode_of_payment,
"reference_no": self.name,
"reference_no": self.name, # to prevent validation error
"reference_date": nowdate(),
"remarks": "Payment Entry against {} {} via Payment Request {}".format(
self.reference_doctype, self.reference_name, self.name
@@ -268,6 +305,9 @@ class PaymentRequest(Document):
}
)
# Allocate payment_request for each reference in payment_entry (Payment Term can splits the row)
self._allocate_payment_request_to_pe_references(references=payment_entry.references)
# Update dimensions
payment_entry.update(
{
@@ -276,13 +316,16 @@ class PaymentRequest(Document):
}
)
if party_account_currency == ref_doc.company_currency and party_account_currency != self.currency:
amount = payment_entry.base_paid_amount
else:
amount = self.grand_total
payment_entry.received_amount = amount
payment_entry.get("references")[0].allocated_amount = amount
# Update 'Paid Amount' on Forex transactions
if self.currency != ref_doc.company_currency:
if (
self.payment_request_type == "Outward"
and payment_entry.paid_from_account_currency == ref_doc.company_currency
and payment_entry.paid_from_account_currency != payment_entry.paid_to_account_currency
):
payment_entry.paid_amount = payment_entry.base_paid_amount = (
payment_entry.target_exchange_rate * payment_entry.received_amount
)
for dimension in get_accounting_dimensions():
payment_entry.update({dimension: self.get(dimension)})
@@ -386,6 +429,62 @@ class PaymentRequest(Document):
if payment_provider == "stripe":
return create_stripe_subscription(gateway_controller, data)
def _allocate_payment_request_to_pe_references(self, references):
"""
Allocate the Payment Request to the Payment Entry references based on\n
- Allocated Amount.
- Outstanding Amount of Payment Request.\n
Payment Request is doc itself and references are the rows of Payment Entry.
"""
if len(references) == 1:
references[0].payment_request = self.name
return
precision = references[0].precision("allocated_amount")
outstanding_amount = self.outstanding_amount
# to manage rows
row_number = 1
MOVE_TO_NEXT_ROW = 1
TO_SKIP_NEW_ROW = 2
NEW_ROW_ADDED = False
while row_number <= len(references):
row = references[row_number - 1]
# update the idx to maintain the order
row.idx = row_number
if outstanding_amount == 0:
if not NEW_ROW_ADDED:
break
row_number += MOVE_TO_NEXT_ROW
continue
# allocate the payment request to the row
row.payment_request = self.name
if row.allocated_amount <= outstanding_amount:
outstanding_amount = flt(outstanding_amount - row.allocated_amount, precision)
row_number += MOVE_TO_NEXT_ROW
else:
remaining_allocated_amount = flt(row.allocated_amount - outstanding_amount, precision)
row.allocated_amount = outstanding_amount
outstanding_amount = 0
# create a new row without PR for remaining unallocated amount
new_row = frappe.copy_doc(row)
references.insert(row_number, new_row)
# update new row
new_row.idx = row_number + 1
new_row.payment_request = None
new_row.allocated_amount = remaining_allocated_amount
NEW_ROW_ADDED = True
row_number += TO_SKIP_NEW_ROW
@frappe.whitelist(allow_guest=True)
def make_payment_request(**args):
@@ -416,11 +515,15 @@ def make_payment_request(**args):
{"reference_doctype": args.dt, "reference_name": args.dn, "docstatus": 0},
)
existing_payment_request_amount = get_existing_payment_request_amount(args.dt, args.dn)
# fetches existing payment request `grand_total` amount
existing_payment_request_amount = get_existing_payment_request_amount(ref_doc.doctype, ref_doc.name)
if existing_payment_request_amount:
grand_total -= existing_payment_request_amount
if not grand_total:
frappe.throw(_("Payment Request is already created"))
if draft_payment_request:
frappe.db.set_value(
"Payment Request", draft_payment_request, "grand_total", grand_total, update_modified=False
@@ -434,6 +537,13 @@ def make_payment_request(**args):
"Outward" if args.get("dt") in ["Purchase Order", "Purchase Invoice"] else "Inward"
)
party_type = args.get("party_type") or "Customer"
party_account_currency = ref_doc.get("party_account_currency")
if not party_account_currency:
party_account = get_party_account(party_type, ref_doc.get(party_type.lower()), ref_doc.company)
party_account_currency = get_account_currency(party_account)
pr.update(
{
"payment_gateway_account": gateway_account.get("name"),
@@ -442,6 +552,7 @@ def make_payment_request(**args):
"payment_channel": gateway_account.get("payment_channel"),
"payment_request_type": args.get("payment_request_type"),
"currency": ref_doc.currency,
"party_account_currency": party_account_currency,
"grand_total": grand_total,
"mode_of_payment": args.mode_of_payment,
"email_to": args.recipient_id or ref_doc.owner,
@@ -449,7 +560,7 @@ def make_payment_request(**args):
"message": gateway_account.get("message") or get_dummy_message(ref_doc),
"reference_doctype": args.dt,
"reference_name": args.dn,
"party_type": args.get("party_type") or "Customer",
"party_type": party_type,
"party": args.get("party") or ref_doc.get("customer"),
"bank_account": bank_account,
}
@@ -492,9 +603,11 @@ def get_amount(ref_doc, payment_account=None):
elif dt in ["Sales Invoice", "Purchase Invoice"]:
if not ref_doc.get("is_pos"):
if ref_doc.party_account_currency == ref_doc.currency:
grand_total = flt(ref_doc.grand_total)
grand_total = flt(ref_doc.rounded_total or ref_doc.grand_total)
else:
grand_total = flt(ref_doc.base_grand_total) / ref_doc.conversion_rate
grand_total = flt(
flt(ref_doc.base_rounded_total or ref_doc.base_grand_total) / ref_doc.conversion_rate
)
elif dt == "Sales Invoice":
for pay in ref_doc.payments:
if pay.type == "Phone" and pay.account == payment_account:
@@ -509,31 +622,27 @@ def get_amount(ref_doc, payment_account=None):
grand_total = ref_doc.outstanding_amount
if grand_total > 0:
return grand_total
return flt(grand_total, get_currency_precision())
else:
frappe.throw(_("Payment Entry is already created"))
def get_existing_payment_request_amount(ref_dt, ref_dn):
"""
Get the existing payment request which are unpaid or partially paid for payment channel other than Phone
and get the summation of existing paid payment request for Phone payment channel.
Return the total amount of Payment Requests against a reference document.
"""
existing_payment_request_amount = frappe.db.sql(
"""
select sum(grand_total)
from `tabPayment Request`
where
reference_doctype = %s
and reference_name = %s
and docstatus = 1
and (status != 'Paid'
or (payment_channel = 'Phone'
and status = 'Paid'))
""",
(ref_dt, ref_dn),
PR = frappe.qb.DocType("Payment Request")
response = (
frappe.qb.from_(PR)
.select(Sum(PR.grand_total))
.where(PR.reference_doctype == ref_dt)
.where(PR.reference_name == ref_dn)
.where(PR.docstatus == 1)
.run()
)
return flt(existing_payment_request_amount[0][0]) if existing_payment_request_amount else 0
return response[0][0] if response[0] else 0
def get_gateway_details(args): # nosemgrep
@@ -581,41 +690,66 @@ def make_payment_entry(docname):
return doc.create_payment_entry(submit=False).as_dict()
def update_payment_req_status(doc, method):
from erpnext.accounts.doctype.payment_entry.payment_entry import get_reference_details
def update_payment_requests_as_per_pe_references(references=None, cancel=False):
"""
Update Payment Request's `Status` and `Outstanding Amount` based on Payment Entry Reference's `Allocated Amount`.
"""
if not references:
return
for ref in doc.references:
payment_request_name = frappe.db.get_value(
"Payment Request",
{
"reference_doctype": ref.reference_doctype,
"reference_name": ref.reference_name,
"docstatus": 1,
},
precision = references[0].precision("allocated_amount")
referenced_payment_requests = frappe.get_all(
"Payment Request",
filters={"name": ["in", {row.payment_request for row in references if row.payment_request}]},
fields=[
"name",
"grand_total",
"outstanding_amount",
"payment_request_type",
],
)
referenced_payment_requests = {pr.name: pr for pr in referenced_payment_requests}
for ref in references:
if not ref.payment_request:
continue
payment_request = referenced_payment_requests[ref.payment_request]
pr_outstanding = payment_request["outstanding_amount"]
# update outstanding amount
new_outstanding_amount = flt(
pr_outstanding + ref.allocated_amount if cancel else pr_outstanding - ref.allocated_amount,
precision,
)
if payment_request_name:
ref_details = get_reference_details(
ref.reference_doctype,
ref.reference_name,
doc.party_account_currency,
doc.party_type,
doc.party,
# to handle same payment request for the multiple allocations
payment_request["outstanding_amount"] = new_outstanding_amount
if not cancel and new_outstanding_amount < 0:
frappe.throw(
msg=_(
"The allocated amount is greater than the outstanding amount of Payment Request {0}"
).format(ref.payment_request),
title=_("Invalid Allocated Amount"),
)
pay_req_doc = frappe.get_doc("Payment Request", payment_request_name)
status = pay_req_doc.status
if status != "Paid" and not ref_details.outstanding_amount:
status = "Paid"
elif status != "Partially Paid" and ref_details.outstanding_amount != ref_details.total_amount:
status = "Partially Paid"
elif ref_details.outstanding_amount == ref_details.total_amount:
if pay_req_doc.payment_request_type == "Outward":
status = "Initiated"
elif pay_req_doc.payment_request_type == "Inward":
status = "Requested"
# update status
if new_outstanding_amount == payment_request["grand_total"]:
status = "Initiated" if payment_request["payment_request_type"] == "Outward" else "Requested"
elif new_outstanding_amount == 0:
status = "Paid"
elif new_outstanding_amount > 0:
status = "Partially Paid"
pay_req_doc.db_set("status", status)
# update database
frappe.db.set_value(
"Payment Request",
ref.payment_request,
{"outstanding_amount": new_outstanding_amount, "status": status},
)
def get_dummy_message(doc):
@@ -699,3 +833,31 @@ def validate_payment(doc, method=None):
doc.reference_docname
)
)
@frappe.whitelist()
def get_open_payment_requests_query(doctype, txt, searchfield, start, page_len, filters):
# permission checks in `get_list()`
filters = frappe._dict(filters)
if not filters.reference_doctype or not filters.reference_name:
return []
if txt:
filters.name = ["like", f"%{txt}%"]
open_payment_requests = frappe.get_list(
"Payment Request",
filters=filters,
fields=["name", "grand_total", "outstanding_amount"],
order_by="transaction_date ASC,creation ASC",
)
return [
(
pr.name,
_("<strong>Grand Total:</strong> {0}").format(pr.grand_total),
_("<strong>Outstanding Amount:</strong> {0}").format(pr.outstanding_amount),
)
for pr in open_payment_requests
]

View File

@@ -0,0 +1,14 @@
from frappe import _
def get_data():
return {
"fieldname": "payment_request",
"internal_links": {
"Payment Entry": ["references", "payment_request"],
"Payment Order": ["references", "payment_order"],
},
"transactions": [
{"label": _("Payment"), "items": ["Payment Entry", "Payment Order"]},
],
}

View File

@@ -1,19 +1,18 @@
const INDICATORS = {
"Partially Paid": "orange",
Cancelled: "red",
Draft: "gray",
Failed: "red",
Initiated: "green",
Paid: "blue",
Requested: "green",
};
frappe.listview_settings["Payment Request"] = {
add_fields: ["status"],
get_indicator: function (doc) {
if (doc.status == "Draft") {
return [__("Draft"), "gray", "status,=,Draft"];
}
if (doc.status == "Requested") {
return [__("Requested"), "green", "status,=,Requested"];
} else if (doc.status == "Initiated") {
return [__("Initiated"), "green", "status,=,Initiated"];
} else if (doc.status == "Partially Paid") {
return [__("Partially Paid"), "orange", "status,=,Partially Paid"];
} else if (doc.status == "Paid") {
return [__("Paid"), "blue", "status,=,Paid"];
} else if (doc.status == "Cancelled") {
return [__("Cancelled"), "red", "status,=,Cancelled"];
}
if (!doc.status || !INDICATORS[doc.status]) return;
return [__(doc.status), INDICATORS[doc.status], `status,=,${doc.status}`];
},
};

View File

@@ -1,18 +1,23 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import re
import unittest
import frappe
from frappe.tests.utils import FrappeTestCase, change_settings
from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_payment_terms_template
from erpnext.accounts.doctype.payment_request.payment_request import make_payment_request
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.setup.utils import get_exchange_rate
test_dependencies = ["Currency Exchange", "Journal Entry", "Contact", "Address"]
payment_gateway = {"doctype": "Payment Gateway", "gateway": "_Test Gateway"}
payment_method = [
@@ -32,7 +37,7 @@ payment_method = [
]
class TestPaymentRequest(unittest.TestCase):
class TestPaymentRequest(FrappeTestCase):
def setUp(self):
if not frappe.db.get_value("Payment Gateway", payment_gateway["gateway"], "name"):
frappe.get_doc(payment_gateway).insert(ignore_permissions=True)
@@ -260,3 +265,262 @@ class TestPaymentRequest(unittest.TestCase):
# Try to make Payment Request more than SO amount, should give validation
pr2.grand_total = 900
self.assertRaises(frappe.ValidationError, pr2.save)
def test_conversion_on_foreign_currency_accounts(self):
po_doc = create_purchase_order(supplier="_Test Supplier USD", currency="USD", do_not_submit=1)
po_doc.conversion_rate = 80
po_doc.items[0].qty = 1
po_doc.items[0].rate = 10
po_doc.save().submit()
pr = make_payment_request(dt=po_doc.doctype, dn=po_doc.name, recipient_id="nabin@erpnext.com")
pr = frappe.get_doc(pr).save().submit()
pe = pr.create_payment_entry()
self.assertEqual(pe.base_paid_amount, 800)
self.assertEqual(pe.paid_amount, 800)
self.assertEqual(pe.base_received_amount, 800)
self.assertEqual(pe.received_amount, 10)
def test_multiple_payment_if_partially_paid_for_same_currency(self):
so = make_sales_order(currency="INR", qty=1, rate=1000)
pr = make_payment_request(
dt="Sales Order",
dn=so.name,
mute_email=1,
submit_doc=1,
return_doc=1,
)
self.assertEqual(pr.grand_total, 1000)
self.assertEqual(pr.outstanding_amount, pr.grand_total)
self.assertEqual(pr.party_account_currency, pr.currency) # INR
so.load_from_db()
# to make partial payment
pe = pr.create_payment_entry(submit=False)
pe.paid_amount = 200
pe.references[0].allocated_amount = 200
pe.submit()
self.assertEqual(pe.references[0].payment_request, pr.name)
so.load_from_db()
pr.load_from_db()
self.assertEqual(pr.status, "Partially Paid")
self.assertEqual(pr.outstanding_amount, 800)
self.assertEqual(pr.grand_total, 1000)
# complete payment
pe = pr.create_payment_entry()
self.assertEqual(pe.paid_amount, 800) # paid amount set from pr's outstanding amount
self.assertEqual(pe.references[0].allocated_amount, 800)
self.assertEqual(pe.references[0].outstanding_amount, 800) # for Orders it is not zero
self.assertEqual(pe.references[0].payment_request, pr.name)
so.load_from_db()
pr.load_from_db()
self.assertEqual(pr.status, "Paid")
self.assertEqual(pr.outstanding_amount, 0)
self.assertEqual(pr.grand_total, 1000)
# creating a more payment Request must not allowed
self.assertRaisesRegex(
frappe.exceptions.ValidationError,
re.compile(r"Payment Request is already created"),
make_payment_request,
dt="Sales Order",
dn=so.name,
mute_email=1,
submit_doc=1,
return_doc=1,
)
@change_settings("Accounts Settings", {"allow_multi_currency_invoices_against_single_party_account": 1})
def test_multiple_payment_if_partially_paid_for_multi_currency(self):
pi = make_purchase_invoice(currency="USD", conversion_rate=50, qty=1, rate=100, do_not_save=1)
pi.credit_to = "Creditors - _TC"
pi.submit()
pr = make_payment_request(
dt="Purchase Invoice",
dn=pi.name,
mute_email=1,
submit_doc=1,
return_doc=1,
)
# 100 USD -> 5000 INR
self.assertEqual(pr.grand_total, 100)
self.assertEqual(pr.outstanding_amount, 5000)
self.assertEqual(pr.currency, "USD")
self.assertEqual(pr.party_account_currency, "INR")
self.assertEqual(pr.status, "Initiated")
# to make partial payment
pe = pr.create_payment_entry(submit=False)
pe.paid_amount = 2000
pe.references[0].allocated_amount = 2000
pe.submit()
self.assertEqual(pe.references[0].payment_request, pr.name)
pr.load_from_db()
self.assertEqual(pr.status, "Partially Paid")
self.assertEqual(pr.outstanding_amount, 3000)
self.assertEqual(pr.grand_total, 100)
# complete payment
pe = pr.create_payment_entry()
self.assertEqual(pe.paid_amount, 3000) # paid amount set from pr's outstanding amount
self.assertEqual(pe.references[0].allocated_amount, 3000)
self.assertEqual(pe.references[0].outstanding_amount, 0) # for Invoices it will zero
self.assertEqual(pe.references[0].payment_request, pr.name)
pr.load_from_db()
self.assertEqual(pr.status, "Paid")
self.assertEqual(pr.outstanding_amount, 0)
self.assertEqual(pr.grand_total, 100)
# creating a more payment Request must not allowed
self.assertRaisesRegex(
frappe.exceptions.ValidationError,
re.compile(r"Payment Request is already created"),
make_payment_request,
dt="Purchase Invoice",
dn=pi.name,
mute_email=1,
submit_doc=1,
return_doc=1,
)
def test_single_payment_with_payment_term_for_same_currency(self):
create_payment_terms_template()
po = create_purchase_order(do_not_save=1, currency="INR", qty=1, rate=20000)
po.payment_terms_template = "Test Receivable Template" # 84.746 and 15.254
po.save()
po.submit()
pr = make_payment_request(
dt="Purchase Order",
dn=po.name,
mute_email=1,
submit_doc=1,
return_doc=1,
)
self.assertEqual(pr.grand_total, 20000)
self.assertEqual(pr.outstanding_amount, pr.grand_total)
self.assertEqual(pr.party_account_currency, pr.currency) # INR
self.assertEqual(pr.status, "Initiated")
po.load_from_db()
pe = pr.create_payment_entry()
self.assertEqual(len(pe.references), 2)
self.assertEqual(pe.paid_amount, 20000)
# check 1st payment term
self.assertEqual(pe.references[0].allocated_amount, 16949.2)
self.assertEqual(pe.references[0].payment_request, pr.name)
# check 2nd payment term
self.assertEqual(pe.references[1].allocated_amount, 3050.8)
self.assertEqual(pe.references[1].payment_request, pr.name)
po.load_from_db()
pr.load_from_db()
self.assertEqual(pr.status, "Paid")
self.assertEqual(pr.outstanding_amount, 0)
self.assertEqual(pr.grand_total, 20000)
@change_settings("Accounts Settings", {"allow_multi_currency_invoices_against_single_party_account": 1})
def test_single_payment_with_payment_term_for_multi_currency(self):
create_payment_terms_template()
si = create_sales_invoice(
do_not_save=1, currency="USD", debit_to="Debtors - _TC", qty=1, rate=200, conversion_rate=50
)
si.payment_terms_template = "Test Receivable Template" # 84.746 and 15.254
si.save()
si.submit()
pr = make_payment_request(
dt="Sales Invoice",
dn=si.name,
mute_email=1,
submit_doc=1,
return_doc=1,
)
# 200 USD -> 10000 INR
self.assertEqual(pr.grand_total, 200)
self.assertEqual(pr.outstanding_amount, 10000)
self.assertEqual(pr.currency, "USD")
self.assertEqual(pr.party_account_currency, "INR")
pe = pr.create_payment_entry()
self.assertEqual(len(pe.references), 2)
self.assertEqual(pe.paid_amount, 10000)
# check 1st payment term
# convert it via dollar and conversion_rate
self.assertEqual(pe.references[0].allocated_amount, 8474.5) # multi currency conversion
self.assertEqual(pe.references[0].payment_request, pr.name)
# check 2nd payment term
self.assertEqual(pe.references[1].allocated_amount, 1525.5) # multi currency conversion
self.assertEqual(pe.references[1].payment_request, pr.name)
pr.load_from_db()
self.assertEqual(pr.status, "Paid")
self.assertEqual(pr.outstanding_amount, 0)
self.assertEqual(pr.grand_total, 200)
def test_payment_cancel_process(self):
so = make_sales_order(currency="INR", qty=1, rate=1000)
pr = make_payment_request(
dt="Sales Order",
dn=so.name,
mute_email=1,
submit_doc=1,
return_doc=1,
)
self.assertEqual(pr.grand_total, 1000)
self.assertEqual(pr.outstanding_amount, pr.grand_total)
so.load_from_db()
pe = pr.create_payment_entry(submit=False)
pe.paid_amount = 800
pe.references[0].allocated_amount = 800
pe.submit()
self.assertEqual(pe.references[0].payment_request, pr.name)
so.load_from_db()
pr.load_from_db()
self.assertEqual(pr.status, "Partially Paid")
self.assertEqual(pr.outstanding_amount, 200)
self.assertEqual(pr.grand_total, 1000)
# cancelling PE
pe.cancel()
pr.load_from_db()
self.assertEqual(pr.status, "Requested")
self.assertEqual(pr.outstanding_amount, 1000)
self.assertEqual(pr.grand_total, 1000)
so.load_from_db()

View File

@@ -40,7 +40,7 @@ class PeriodClosingVoucher(AccountsController):
)
if gle_count > 5000:
frappe.enqueue(
make_reverse_gl_entries,
process_cancellation,
voucher_type="Period Closing Voucher",
voucher_no=self.name,
queue="long",
@@ -51,9 +51,7 @@ class PeriodClosingVoucher(AccountsController):
alert=True,
)
else:
make_reverse_gl_entries(voucher_type="Period Closing Voucher", voucher_no=self.name)
self.delete_closing_entries()
process_cancellation(voucher_type="Period Closing Voucher", voucher_no=self.name)
def validate_future_closing_vouchers(self):
if frappe.db.exists(
@@ -66,12 +64,6 @@ class PeriodClosingVoucher(AccountsController):
)
)
def delete_closing_entries(self):
closing_balance = frappe.qb.DocType("Account Closing Balance")
frappe.qb.from_(closing_balance).delete().where(
closing_balance.period_closing_voucher == self.name
).run()
def validate_account_head(self):
closing_account_type = frappe.get_cached_value("Account", self.closing_account_head, "root_type")
@@ -136,14 +128,7 @@ class PeriodClosingVoucher(AccountsController):
closing_entries = self.get_grouped_gl_entries(get_opening_entries=get_opening_entries)
if len(gl_entries + closing_entries) > 3000:
frappe.enqueue(
process_gl_entries,
gl_entries=gl_entries,
voucher_name=self.name,
timeout=3000,
)
frappe.enqueue(
process_closing_entries,
process_gl_and_closing_entries,
gl_entries=gl_entries,
closing_entries=closing_entries,
voucher_name=self.name,
@@ -157,8 +142,9 @@ class PeriodClosingVoucher(AccountsController):
alert=True,
)
else:
process_gl_entries(gl_entries, self.name)
process_closing_entries(gl_entries, closing_entries, self.name, self.company, self.posting_date)
process_gl_and_closing_entries(
gl_entries, closing_entries, self.name, self.company, self.posting_date
)
def get_grouped_gl_entries(self, get_opening_entries=False):
closing_entries = []
@@ -323,9 +309,10 @@ class PeriodClosingVoucher(AccountsController):
if get_opening_entries:
query = query.where(
gl_entry.posting_date.between(self.get("year_start_date"), self.posting_date)
| gl_entry.is_opening
== "Yes"
( # noqa: UP034
(gl_entry.posting_date.between(self.get("year_start_date"), self.posting_date))
| (gl_entry.is_opening == "Yes")
)
)
else:
query = query.where(
@@ -343,12 +330,16 @@ class PeriodClosingVoucher(AccountsController):
return query.run(as_dict=1)
def process_gl_entries(gl_entries, voucher_name):
def process_gl_and_closing_entries(gl_entries, closing_entries, voucher_name, company, closing_date):
from erpnext.accounts.doctype.account_closing_balance.account_closing_balance import (
make_closing_entries,
)
from erpnext.accounts.general_ledger import make_gl_entries
try:
if gl_entries:
make_gl_entries(gl_entries, merge_entries=False)
make_closing_entries(gl_entries + closing_entries, voucher_name, company, closing_date)
frappe.db.set_value("Period Closing Voucher", voucher_name, "gle_processing_status", "Completed")
except Exception as e:
frappe.db.rollback()
@@ -356,26 +347,21 @@ def process_gl_entries(gl_entries, voucher_name):
frappe.db.set_value("Period Closing Voucher", voucher_name, "gle_processing_status", "Failed")
def process_closing_entries(gl_entries, closing_entries, voucher_name, company, closing_date):
from erpnext.accounts.doctype.account_closing_balance.account_closing_balance import (
make_closing_entries,
)
try:
if gl_entries + closing_entries:
make_closing_entries(gl_entries + closing_entries, voucher_name, company, closing_date)
except Exception as e:
frappe.db.rollback()
frappe.log_error(e)
def make_reverse_gl_entries(voucher_type, voucher_no):
def process_cancellation(voucher_type, voucher_no):
from erpnext.accounts.general_ledger import make_reverse_gl_entries
try:
make_reverse_gl_entries(voucher_type=voucher_type, voucher_no=voucher_no)
delete_closing_entries(voucher_no)
frappe.db.set_value("Period Closing Voucher", voucher_no, "gle_processing_status", "Completed")
except Exception as e:
frappe.db.rollback()
frappe.log_error(e)
frappe.db.set_value("Period Closing Voucher", voucher_no, "gle_processing_status", "Failed")
def delete_closing_entries(voucher_no):
closing_balance = frappe.qb.DocType("Account Closing Balance")
frappe.qb.from_(closing_balance).delete().where(
closing_balance.period_closing_voucher == voucher_no
).run()

View File

@@ -80,8 +80,10 @@ frappe.ui.form.on("POS Closing Entry", {
) {
reset_values(frm);
frappe.run_serially([
() => frappe.dom.freeze(__("Loading Invoices! Please Wait...")),
() => frm.trigger("set_opening_amounts"),
() => frm.trigger("get_pos_invoices"),
() => frappe.dom.unfreeze(),
]);
}
},

View File

@@ -33,7 +33,7 @@ class POSClosingEntry(StatusUpdater):
for key, value in pos_occurences.items():
if len(value) > 1:
error_list.append(
_(f"{frappe.bold(key)} is added multiple times on rows: {frappe.bold(value)}")
_("{0} is added multiple times on rows: {1}").format(frappe.bold(key), frappe.bold(value))
)
if error_list:

View File

@@ -48,6 +48,7 @@
"shipping_address",
"company_address",
"company_address_display",
"company_contact_person",
"currency_and_price_list",
"currency",
"conversion_rate",
@@ -1557,12 +1558,19 @@
"fieldname": "update_billed_amount_in_delivery_note",
"fieldtype": "Check",
"label": "Update Billed Amount in Delivery Note"
},
{
"fieldname": "company_contact_person",
"fieldtype": "Link",
"label": "Company Contact Person",
"options": "Contact",
"print_hide": 1
}
],
"icon": "fa fa-file-text",
"is_submittable": 1,
"links": [],
"modified": "2024-03-20 16:00:34.268756",
"modified": "2024-11-26 13:10:50.309570",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice",

View File

@@ -379,7 +379,7 @@ class POSInvoice(SalesInvoice):
if self.is_return and entry.amount > 0:
frappe.throw(_("Row #{0} (Payment Table): Amount must be negative").format(entry.idx))
if self.is_return:
if self.is_return and self.docstatus != 0:
invoice_total = self.rounded_total or self.grand_total
if total_amount_in_payments and total_amount_in_payments < invoice_total:
frappe.throw(_("Total payments amount can't be greater than {}").format(-invoice_total))

View File

@@ -87,7 +87,7 @@ class TestPOSInvoice(unittest.TestCase):
inv.save()
self.assertEqual(inv.net_total, 4298.25)
self.assertEqual(inv.net_total, 4298.24)
self.assertEqual(inv.grand_total, 4900.00)
def test_tax_calculation_with_multiple_items(self):

View File

@@ -29,7 +29,7 @@ class POSInvoiceMergeLog(Document):
for key, value in pos_occurences.items():
if len(value) > 1:
error_list.append(
_(f"{frappe.bold(key)} is added multiple times on rows: {frappe.bold(value)}")
_("{0} is added multiple times on rows: {1}").format(frappe.bold(key), frappe.bold(value))
)
if error_list:
@@ -389,7 +389,9 @@ def split_invoices(invoices):
if not item.serial_no:
continue
return_against_is_added = any(d for d in _invoices if d.pos_invoice == pos_invoice.return_against)
return_against_is_added = any(
d for d in _invoices if d and d[0].pos_invoice == pos_invoice.return_against
)
if return_against_is_added:
break
@@ -441,7 +443,7 @@ def create_merge_logs(invoice_by_customer, closing_entry=None):
if closing_entry:
closing_entry.set_status(update=True, status="Failed")
if isinstance(error_message, list):
error_message = frappe.json.dumps(error_message)
error_message = json.dumps(error_message)
closing_entry.db_set("error_message", error_message)
raise

View File

@@ -340,7 +340,7 @@ class TestPOSInvoiceMergeLog(unittest.TestCase):
inv.load_from_db()
consolidated_invoice = frappe.get_doc("Sales Invoice", inv.consolidated_invoice)
self.assertEqual(consolidated_invoice.status, "Return")
self.assertEqual(consolidated_invoice.rounding_adjustment, -0.001)
self.assertEqual(consolidated_invoice.rounding_adjustment, -0.002)
finally:
frappe.set_user("Administrator")

View File

@@ -419,7 +419,8 @@
"depends_on": "eval:doc.rate_or_discount==\"Rate\"",
"fieldname": "rate",
"fieldtype": "Currency",
"label": "Rate"
"label": "Rate",
"options": "currency"
},
{
"default": "0",
@@ -647,7 +648,7 @@
"icon": "fa fa-gift",
"idx": 1,
"links": [],
"modified": "2024-05-17 13:16:34.496704",
"modified": "2024-09-16 18:14:51.314765",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pricing Rule",
@@ -709,4 +710,4 @@
"sort_order": "DESC",
"states": [],
"title_field": "title"
}
}

View File

@@ -31,6 +31,7 @@ class PricingRule(Document):
self.validate_price_list_with_currency()
self.validate_dates()
self.validate_condition()
self.validate_mixed_with_recursion()
if not self.margin_type:
self.margin_rate_or_amount = 0.0
@@ -201,6 +202,10 @@ class PricingRule(Document):
):
frappe.throw(_("Invalid condition expression"))
def validate_mixed_with_recursion(self):
if self.mixed_conditions and self.is_recursive:
frappe.throw(_("Recursive Discounts with Mixed condition is not supported by the system"))
# --------------------------------------------------------------------------------
@@ -354,7 +359,20 @@ def get_pricing_rule_for_item(args, doc=None, for_validate=False):
if isinstance(pricing_rule, str):
pricing_rule = frappe.get_cached_doc("Pricing Rule", pricing_rule)
update_pricing_rule_uom(pricing_rule, args)
pricing_rule.apply_rule_on_other_items = get_pricing_rule_items(pricing_rule) or []
fetch_other_item = True if pricing_rule.apply_rule_on_other else False
pricing_rule.apply_rule_on_other_items = (
get_pricing_rule_items(pricing_rule, other_items=fetch_other_item) or []
)
if pricing_rule.coupon_code_based == 1:
if not args.coupon_code:
return item_details
coupon_code = frappe.db.get_value(
doctype="Coupon Code", filters={"pricing_rule": pricing_rule.name}, fieldname="name"
)
if args.coupon_code != coupon_code:
continue
if pricing_rule.get("suggestion"):
continue
@@ -381,9 +399,6 @@ def get_pricing_rule_for_item(args, doc=None, for_validate=False):
pricing_rule.apply_rule_on_other_items
)
if pricing_rule.coupon_code_based == 1 and args.coupon_code is None:
return item_details
if not pricing_rule.validate_applied_rule:
if pricing_rule.price_or_product_discount == "Price":
apply_price_discount_rule(pricing_rule, item_details, args)

View File

@@ -5,14 +5,17 @@
import unittest
import frappe
from frappe.tests.utils import FrappeTestCase, change_settings
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.controllers.sales_and_purchase_return import make_return_doc
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
from erpnext.stock.doctype.item.test_item import make_item
from erpnext.stock.get_item_details import get_item_details
class TestPricingRule(unittest.TestCase):
class TestPricingRule(FrappeTestCase):
def setUp(self):
delete_existing_pricing_rules()
setup_pricing_rule_data()
@@ -978,6 +981,51 @@ class TestPricingRule(unittest.TestCase):
self.assertEqual(so.items[1].item_code, "_Test Item")
self.assertEqual(so.items[1].qty, 3)
so = make_sales_order(item_code="_Test Item", qty=5, do_not_submit=1)
so.items[0].qty = 1
del so.items[-1]
so.save()
self.assertEqual(len(so.items), 1)
def test_pricing_rule_for_product_free_item_round_free_qty(self):
frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule")
test_record = {
"doctype": "Pricing Rule",
"title": "_Test Pricing Rule",
"apply_on": "Item Code",
"currency": "USD",
"items": [
{
"item_code": "_Test Item",
}
],
"selling": 1,
"rate": 0,
"min_qty": 100,
"max_qty": 0,
"price_or_product_discount": "Product",
"same_item": 1,
"free_qty": 10,
"round_free_qty": 1,
"is_recursive": 1,
"recurse_for": 100,
"company": "_Test Company",
}
frappe.get_doc(test_record.copy()).insert()
# With pricing rule
so = make_sales_order(item_code="_Test Item", qty=100)
so.load_from_db()
self.assertEqual(so.items[1].is_free_item, 1)
self.assertEqual(so.items[1].item_code, "_Test Item")
self.assertEqual(so.items[1].qty, 10)
so = make_sales_order(item_code="_Test Item", qty=150)
so.load_from_db()
self.assertEqual(so.items[1].is_free_item, 1)
self.assertEqual(so.items[1].item_code, "_Test Item")
self.assertEqual(so.items[1].qty, 10)
def test_apply_multiple_pricing_rules_for_discount_percentage_and_amount(self):
frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule 1")
frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule 2")
@@ -1087,6 +1135,81 @@ class TestPricingRule(unittest.TestCase):
frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule 1")
frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule 2")
def test_validation_on_mixed_condition_with_recursion(self):
pricing_rule = make_pricing_rule(
discount_percentage=10,
selling=1,
priority=2,
min_qty=4,
title="_Test Pricing Rule with Min Qty - 2",
)
pricing_rule.mixed_conditions = True
pricing_rule.is_recursive = True
self.assertRaises(frappe.ValidationError, pricing_rule.save)
def test_ignore_pricing_rule_for_credit_note(self):
frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule")
pricing_rule = make_pricing_rule(
discount_percentage=20,
selling=1,
buying=1,
priority=1,
title="_Test Pricing Rule",
)
si = create_sales_invoice(do_not_submit=True, customer="_Test Customer 1", qty=1)
item = si.items[0]
si.submit()
self.assertEqual(item.discount_percentage, 20)
self.assertEqual(item.rate, 80)
# change discount on pricing rule
pricing_rule.discount_percentage = 30
pricing_rule.save()
credit_note = make_return_doc(si.doctype, si.name)
credit_note.save()
self.assertEqual(credit_note.ignore_pricing_rule, 1)
self.assertEqual(credit_note.pricing_rules, [])
self.assertEqual(credit_note.items[0].discount_percentage, 20)
self.assertEqual(credit_note.items[0].rate, 80)
self.assertEqual(credit_note.items[0].pricing_rules, None)
credit_note.delete()
si.cancel()
def test_ignore_pricing_rule_for_debit_note(self):
frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule")
pricing_rule = make_pricing_rule(
discount_percentage=20,
buying=1,
priority=1,
title="_Test Pricing Rule",
)
pi = make_purchase_invoice(do_not_submit=True, supplier="_Test Supplier 1", qty=1)
item = pi.items[0]
pi.submit()
self.assertEqual(item.discount_percentage, 20)
self.assertEqual(item.rate, 40)
# change discount on pricing rule
pricing_rule.discount_percentage = 30
pricing_rule.save()
# create debit note from purchase invoice
debit_note = make_return_doc(pi.doctype, pi.name)
debit_note.save()
self.assertEqual(debit_note.ignore_pricing_rule, 1)
self.assertEqual(debit_note.pricing_rules, [])
self.assertEqual(debit_note.items[0].discount_percentage, 20)
self.assertEqual(debit_note.items[0].rate, 40)
self.assertEqual(debit_note.items[0].pricing_rules, None)
debit_note.delete()
pi.cancel()
test_dependencies = ["Campaign"]

View File

@@ -485,7 +485,7 @@ def get_qty_and_rate_for_other_item(doc, pr_doc, pricing_rules, row_item):
continue
stock_qty = row.get("qty") * (row.get("conversion_factor") or 1.0)
amount = stock_qty * (row.get("price_list_rate") or row.get("rate"))
amount = stock_qty * (flt(row.get("price_list_rate")) or flt(row.get("rate")))
pricing_rules = filter_pricing_rules_for_qty_amount(stock_qty, amount, pricing_rules, row)
if pricing_rules and pricing_rules[0]:
@@ -642,7 +642,10 @@ def get_product_discount_rule(pricing_rule, item_details, args=None, doc=None):
if transaction_qty:
qty = flt(transaction_qty) * qty / pricing_rule.recurse_for
if pricing_rule.round_free_qty:
qty = math.floor(qty)
qty = (flt(transaction_qty) // pricing_rule.recurse_for) * (pricing_rule.free_qty or 1)
if not qty:
return
free_item_data_args = {
"item_code": free_item,
@@ -712,14 +715,11 @@ def get_pricing_rule_items(pr_doc, other_items=False) -> list:
def validate_coupon_code(coupon_name):
coupon = frappe.get_doc("Coupon Code", coupon_name)
if coupon.valid_from:
if coupon.valid_from > getdate(today()):
frappe.throw(_("Sorry, this coupon code's validity has not started"))
elif coupon.valid_upto:
if coupon.valid_upto < getdate(today()):
frappe.throw(_("Sorry, this coupon code's validity has expired"))
elif coupon.used >= coupon.maximum_use:
if coupon.valid_from and coupon.valid_from > getdate(today()):
frappe.throw(_("Sorry, this coupon code's validity has not started"))
elif coupon.valid_upto and coupon.valid_upto < getdate(today()):
frappe.throw(_("Sorry, this coupon code's validity has expired"))
elif coupon.maximum_use and coupon.used >= coupon.maximum_use:
frappe.throw(_("Sorry, this coupon code is no longer valid"))

View File

@@ -20,6 +20,17 @@ frappe.ui.form.on("Process Payment Reconciliation", {
},
};
});
frm.set_query("default_advance_account", function (doc) {
return {
filters: {
company: doc.company,
is_group: 0,
account_type: doc.party_type == "Customer" ? "Receivable" : "Payable",
root_type: doc.party_type == "Customer" ? "Liability" : "Asset",
},
};
});
frm.set_query("cost_center", function (doc) {
return {
filters: {
@@ -102,6 +113,7 @@ frappe.ui.form.on("Process Payment Reconciliation", {
company(frm) {
frm.set_value("party", "");
frm.set_value("receivable_payable_account", "");
frm.set_value("default_advance_account", "");
},
party_type(frm) {
frm.set_value("party", "");
@@ -109,6 +121,7 @@ frappe.ui.form.on("Process Payment Reconciliation", {
party(frm) {
frm.set_value("receivable_payable_account", "");
frm.set_value("default_advance_account", "");
if (!frm.doc.receivable_payable_account && frm.doc.party_type && frm.doc.party) {
return frappe.call({
method: "erpnext.accounts.party.get_party_account",
@@ -116,10 +129,16 @@ frappe.ui.form.on("Process Payment Reconciliation", {
company: frm.doc.company,
party_type: frm.doc.party_type,
party: frm.doc.party,
include_advance: 1,
},
callback: (r) => {
if (!r.exc && r.message) {
frm.set_value("receivable_payable_account", r.message);
if (typeof r.message === "string") {
frm.set_value("receivable_payable_account", r.message);
} else if (Array.isArray(r.message)) {
frm.set_value("receivable_payable_account", r.message[0]);
frm.set_value("default_advance_account", r.message[1]);
}
}
frm.refresh();
},

View File

@@ -13,6 +13,7 @@
"column_break_io6c",
"party",
"receivable_payable_account",
"default_advance_account",
"filter_section",
"from_invoice_date",
"to_invoice_date",
@@ -141,12 +142,23 @@
{
"fieldname": "section_break_a8yx",
"fieldtype": "Section Break"
},
{
"depends_on": "eval:doc.party",
"description": "Only 'Payment Entries' made against this advance account are supported.",
"documentation_url": "https://docs.erpnext.com/docs/user/manual/en/advance-in-separate-party-account",
"fieldname": "default_advance_account",
"fieldtype": "Link",
"label": "Default Advance Account",
"mandatory_depends_on": "doc.party_type",
"options": "Account",
"reqd": 1
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2023-08-11 10:56:51.699137",
"modified": "2024-08-27 14:48:56.715320",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Payment Reconciliation",
@@ -180,4 +192,4 @@
"sort_order": "DESC",
"states": [],
"title_field": "company"
}
}

View File

@@ -1,6 +1,8 @@
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import json
import frappe
from frappe import _, qb
from frappe.model.document import Document
@@ -74,6 +76,7 @@ def get_pr_instance(doc: str):
"party_type",
"party",
"receivable_payable_account",
"default_advance_account",
"from_invoice_date",
"to_invoice_date",
"from_payment_date",
@@ -479,7 +482,7 @@ def is_any_doc_running(for_filter: str | dict | None = None) -> str | None:
running_doc = None
if for_filter:
if isinstance(for_filter, str):
for_filter = frappe.json.loads(for_filter)
for_filter = json.loads(for_filter)
running_doc = frappe.db.get_value(
"Process Payment Reconciliation",

View File

@@ -16,6 +16,7 @@
"cost_center",
"territory",
"ignore_exchange_rate_revaluation_journals",
"ignore_cr_dr_notes",
"column_break_14",
"to_date",
"finance_book",
@@ -24,6 +25,7 @@
"payment_terms_template",
"sales_partner",
"sales_person",
"show_remarks",
"based_on_payment_terms",
"section_break_3",
"customer_collection",
@@ -381,10 +383,22 @@
"fieldname": "ignore_exchange_rate_revaluation_journals",
"fieldtype": "Check",
"label": "Ignore Exchange Rate Revaluation Journals"
},
{
"default": "0",
"fieldname": "ignore_cr_dr_notes",
"fieldtype": "Check",
"label": "Ignore System Generated Credit / Debit Notes"
},
{
"default": "0",
"fieldname": "show_remarks",
"fieldtype": "Check",
"label": "Show Remarks"
}
],
"links": [],
"modified": "2023-12-18 12:20:08.965120",
"modified": "2024-10-18 17:51:39.108481",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Statement Of Accounts",

View File

@@ -79,6 +79,9 @@ def get_statement_dict(doc, get_statement_dict=False):
if doc.ignore_exchange_rate_revaluation_journals:
filters.update({"ignore_err": True})
if doc.ignore_cr_dr_notes:
filters.update({"ignore_cr_dr_notes": True})
if doc.report == "General Ledger":
filters.update(get_gl_filters(doc, entry, tax_id, presentation_currency))
col, res = get_soa(filters)
@@ -129,6 +132,7 @@ def get_common_filters(doc):
"finance_book": doc.finance_book if doc.finance_book else None,
"account": [doc.account] if doc.account else None,
"cost_center": [cc.cost_center_name for cc in doc.cost_center],
"show_remarks": doc.show_remarks,
}
)

View File

@@ -5,6 +5,8 @@
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.query_builder import Criterion
from frappe.query_builder.functions import IfNull
pricing_rule_fields = [
"apply_on",
@@ -77,6 +79,7 @@ class PromotionalScheme(Document):
self.validate_applicable_for()
self.validate_pricing_rules()
self.validate_mixed_with_recursion()
def validate_applicable_for(self):
if self.applicable_for:
@@ -90,24 +93,53 @@ class PromotionalScheme(Document):
if self.is_new():
return
transaction_exists = False
docnames = []
invalid_pricing_rule = self.get_invalid_pricing_rules()
# If user has changed applicable for
if self._doc_before_save.applicable_for == self.applicable_for:
if not invalid_pricing_rule:
return
docnames = frappe.get_all("Pricing Rule", filters={"promotional_scheme": self.name})
if frappe.db.exists(
"Pricing Rule Detail",
{
"pricing_rule": ["in", invalid_pricing_rule],
"docstatus": ["<", 2],
},
):
raise_for_transaction_exists(self.name)
for docname in docnames:
if frappe.db.exists("Pricing Rule Detail", {"pricing_rule": docname.name, "docstatus": ("<", 2)}):
raise_for_transaction_exists(self.name)
for doc in invalid_pricing_rule:
frappe.delete_doc("Pricing Rule", doc)
if docnames and not transaction_exists:
for docname in docnames:
frappe.delete_doc("Pricing Rule", docname.name)
frappe.msgprint(
_("The following invalid Pricing Rules are deleted:")
+ "<br><br><ul><li>"
+ "</li><li>".join(invalid_pricing_rule)
+ "</li></ul>"
)
def get_invalid_pricing_rules(self):
pr = frappe.qb.DocType("Pricing Rule")
conditions = []
conditions.append(pr.promotional_scheme == self.name)
if self.applicable_for:
applicable_for = frappe.scrub(self.applicable_for)
applicable_for_list = [d.get(applicable_for) for d in self.get(applicable_for)]
conditions.append(
(IfNull(pr.applicable_for, "") != self.applicable_for)
| (
(IfNull(pr.applicable_for, "") == self.applicable_for)
& IfNull(pr[applicable_for], "").notin(applicable_for_list)
)
)
else:
conditions.append(IfNull(pr.applicable_for, "") != "")
return frappe.qb.from_(pr).select(pr.name).where(Criterion.all(conditions)).run(pluck=True)
def on_update(self):
self.validate()
pricing_rules = (
frappe.get_all(
"Pricing Rule",
@@ -119,6 +151,15 @@ class PromotionalScheme(Document):
)
self.update_pricing_rules(pricing_rules)
def validate_mixed_with_recursion(self):
if self.mixed_conditions:
if self.product_discount_slabs:
for slab in self.product_discount_slabs:
if slab.is_recursive:
frappe.throw(
_("Recursive Discounts with Mixed condition is not supported by the system")
)
def update_pricing_rules(self, pricing_rules):
rules = {}
count = 0

View File

@@ -90,6 +90,31 @@ class TestPromotionalScheme(unittest.TestCase):
price_rules = frappe.get_all("Pricing Rule", filters={"promotional_scheme": ps.name})
self.assertEqual(price_rules, [])
def test_change_applicable_for_values_in_promotional_scheme(self):
ps = make_promotional_scheme(applicable_for="Customer", customer="_Test Customer")
ps.append("customer", {"customer": "_Test Customer 2"})
ps.save()
price_rules = frappe.get_all(
"Pricing Rule", filters={"promotional_scheme": ps.name, "applicable_for": "Customer"}
)
self.assertTrue(len(price_rules), 2)
ps.set("customer", [])
ps.append("customer", {"customer": "_Test Customer 2"})
ps.save()
price_rules = frappe.get_all(
"Pricing Rule",
filters={
"promotional_scheme": ps.name,
"applicable_for": "Customer",
"customer": "_Test Customer",
},
)
self.assertEqual(price_rules, [])
frappe.delete_doc("Promotional Scheme", ps.name)
def test_min_max_amount_configuration(self):
ps = make_promotional_scheme()
ps.price_discount_slabs[0].min_amount = 10
@@ -107,6 +132,25 @@ class TestPromotionalScheme(unittest.TestCase):
price_rules = frappe.get_all("Pricing Rule", filters={"promotional_scheme": ps.name})
self.assertEqual(price_rules, [])
def test_validation_on_recurse_with_mixed_condition(self):
ps = make_promotional_scheme()
ps.set("price_discount_slabs", [])
ps.set(
"product_discount_slabs",
[
{
"rule_description": "12+1",
"min_qty": 12,
"free_item": "_Test Item 2",
"free_qty": 1,
"is_recursive": 1,
"recurse_for": 12,
}
],
)
ps.mixed_conditions = True
self.assertRaises(frappe.ValidationError, ps.save)
def make_promotional_scheme(**args):
args = frappe._dict(args)

View File

@@ -25,6 +25,13 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
}
};
});
this.frm.set_query("expense_account", "items", function () {
return {
query: "erpnext.controllers.queries.get_expense_account",
filters: { company: doc.company },
};
});
}
onload() {
@@ -59,25 +66,6 @@ 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(
@@ -322,8 +310,11 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
party_type: "Supplier",
account: this.frm.doc.credit_to,
price_list: this.frm.doc.buying_price_list,
fetch_payment_terms_template: cint(!this.frm.doc.ignore_default_payment_terms_template)
}, function() {
fetch_payment_terms_template: cint(
(this.frm.doc.is_return == 0) & !this.frm.doc.ignore_default_payment_terms_template
),
},
function () {
me.apply_pricing_rule();
me.frm.doc.apply_tds = me.frm.supplier_tds ? 1 : 0;
me.frm.doc.tax_withholding_category = me.frm.supplier_tds;
@@ -488,13 +479,6 @@ cur_frm.fields_dict['select_print_heading'].get_query = function(doc, cdt, cdn)
}
}
cur_frm.set_query("expense_account", "items", function(doc) {
return {
query: "erpnext.controllers.queries.get_expense_account",
filters: {'company': doc.company }
}
});
cur_frm.set_query("wip_composite_asset", "items", function() {
return {
filters: {'is_composite_asset': 1, 'docstatus': 0 }

View File

@@ -170,7 +170,6 @@
"against_expense_account",
"column_break_63",
"unrealized_profit_loss_account",
"repost_required",
"subscription_section",
"auto_repeat",
"update_auto_repeat_reference",
@@ -361,7 +360,8 @@
"description": "Once set, this invoice will be on hold till the set date",
"fieldname": "release_date",
"fieldtype": "Date",
"label": "Release Date"
"label": "Release Date",
"search_index": 1
},
{
"fieldname": "cb_17",
@@ -1128,12 +1128,14 @@
"label": "Payment Terms"
},
{
"depends_on": "eval:(!doc.is_paid && !doc.is_return)",
"fieldname": "payment_terms_template",
"fieldtype": "Link",
"label": "Payment Terms Template",
"options": "Payment Terms Template"
},
{
"depends_on": "eval:(!doc.is_paid && !doc.is_return)",
"fieldname": "payment_schedule",
"fieldtype": "Table",
"label": "Payment Schedule",
@@ -1265,6 +1267,7 @@
"fieldtype": "Select",
"in_standard_filter": 1,
"label": "Status",
"no_copy": 1,
"options": "\nDraft\nReturn\nDebit Note Issued\nSubmitted\nPaid\nPartly Paid\nUnpaid\nOverdue\nCancelled\nInternal Transfer",
"print_hide": 1
},
@@ -1590,15 +1593,6 @@
"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",
@@ -1619,7 +1613,7 @@
"idx": 204,
"is_submittable": 1,
"links": [],
"modified": "2024-03-20 15:57:00.736868",
"modified": "2024-10-25 18:13:01.944477",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",

View File

@@ -284,7 +284,7 @@ class PurchaseInvoice(BuyingController):
stock_not_billed_account = self.get_company_default("stock_received_but_not_billed")
stock_items = self.get_stock_items()
asset_received_but_not_billed = None
self.asset_received_but_not_billed = None
if self.update_stock:
self.validate_item_code()
@@ -367,26 +367,60 @@ class PurchaseInvoice(BuyingController):
frappe.msgprint(msg, title=_("Expense Head Changed"))
item.expense_account = stock_not_billed_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 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(
account_type, item=item.item_code, company=self.company
)
if not asset_category_account:
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"),
account = None
if not item.pr_detail and item.po_detail:
receipt_item = frappe.get_cached_value(
"Purchase Receipt Item",
{
"purchase_order": item.purchase_order,
"purchase_order_item": item.po_detail,
"docstatus": 1,
},
["name", "parent"],
as_dict=1,
)
item.expense_account = asset_category_account
if receipt_item:
item.pr_detail = receipt_item.name
item.purchase_receipt = receipt_item.parent
if item.pr_detail:
if not self.asset_received_but_not_billed:
self.asset_received_but_not_billed = self.get_company_default(
"asset_received_but_not_billed"
)
# check if 'Asset Received But Not Billed' account is credited in Purchase receipt or not
arbnb_booked_in_pr = frappe.db.get_value(
"GL Entry",
{
"voucher_type": "Purchase Receipt",
"voucher_no": item.purchase_receipt,
"account": self.asset_received_but_not_billed,
},
"name",
)
if arbnb_booked_in_pr:
account = self.asset_received_but_not_billed
if not account:
account_type = (
"capital_work_in_progress_account"
if is_cwip_accounting_enabled(item.asset_category)
else "fixed_asset_account"
)
account = get_asset_category_account(
account_type, item=item.item_code, company=self.company
)
if not account:
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 = account
elif not item.expense_account and for_validate:
throw(_("Expense account is mandatory for item {0}").format(item.item_code or item.item_name))
@@ -394,7 +428,7 @@ class PurchaseInvoice(BuyingController):
for item in self.get("items"):
validate_account_head(item.idx, item.expense_account, self.company, "Expense")
def set_against_expense_account(self):
def set_against_expense_account(self, force=False):
against_accounts = []
for item in self.get("items"):
if item.expense_account and (item.expense_account not in against_accounts):
@@ -402,6 +436,10 @@ class PurchaseInvoice(BuyingController):
self.against_expense_account = ",".join(against_accounts)
def force_set_against_expense_account(self):
self.set_against_expense_account()
frappe.db.set_value(self.doctype, self.name, "against_expense_account", self.against_expense_account)
def po_required(self):
if frappe.db.get_value("Buying Settings", None, "po_required") == "Yes":
if frappe.get_value(
@@ -567,17 +605,17 @@ class PurchaseInvoice(BuyingController):
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)
fields_to_check = [
"cash_bank_account",
"write_off_account",
"unrealized_profit_loss_account",
"is_opening",
]
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.repost_accounting_entries()
def make_gl_entries(self, gl_entries=None, from_repost=False):
update_outstanding = "No" if (cint(self.is_paid) or self.write_off_account) else "Yes"
@@ -1475,6 +1513,9 @@ class PurchaseInvoice(BuyingController):
self.db_set("release_date", None)
def set_tax_withholding(self):
self.set("advance_tax", [])
self.set("tax_withheld_vouchers", [])
if not self.apply_tds:
return
@@ -1516,8 +1557,6 @@ class PurchaseInvoice(BuyingController):
self.remove(d)
## Add pending vouchers on which tax was withheld
self.set("tax_withheld_vouchers", [])
for voucher_no, voucher_details in voucher_wise_amount.items():
self.append(
"tax_withheld_vouchers",
@@ -1532,7 +1571,6 @@ class PurchaseInvoice(BuyingController):
self.calculate_taxes_and_totals()
def allocate_advance_tds(self, tax_withholding_details, advance_taxes):
self.set("advance_tax", [])
for tax in advance_taxes:
allocated_amount = 0
pending_amount = flt(tax.tax_amount - tax.allocated_amount)

View File

@@ -10,7 +10,10 @@ import erpnext
from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from erpnext.buying.doctype.purchase_order.purchase_order import get_mapped_purchase_invoice
from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order
from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_invoice as make_pi_from_po
from erpnext.buying.doctype.purchase_order.test_purchase_order import (
create_purchase_order,
)
from erpnext.buying.doctype.supplier.test_supplier import create_supplier
from erpnext.controllers.accounts_controller import get_payment_terms
from erpnext.controllers.buying_controller import QtyMismatchError
@@ -1640,6 +1643,30 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
frappe.db.set_single_value("Buying Settings", "set_landed_cost_based_on_purchase_invoice_rate", 1)
# Cost of Item is zero in Purchase Receipt
pr = make_purchase_receipt(qty=1, rate=0)
stock_value_difference = frappe.db.get_value(
"Stock Ledger Entry",
{"voucher_type": "Purchase Receipt", "voucher_no": pr.name},
"stock_value_difference",
)
self.assertEqual(stock_value_difference, 0)
pi = create_purchase_invoice_from_receipt(pr.name)
for row in pi.items:
row.rate = 150
pi.save()
pi.submit()
stock_value_difference = frappe.db.get_value(
"Stock Ledger Entry",
{"voucher_type": "Purchase Receipt", "voucher_no": pr.name},
"stock_value_difference",
)
self.assertEqual(stock_value_difference, 150)
# Increase the cost of the item
pr = make_purchase_receipt(qty=1, rate=100)
@@ -1908,18 +1935,15 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
check_gl_entries(self, pi.name, expected_gle, nowdate())
pi.items[0].expense_account = "Service - _TC"
# Ledger reposted implicitly upon 'Update After Submit'
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

View File

@@ -1,7 +1,5 @@
{
"actions": [],
"allow_rename": 1,
"autoname": "format:ACC-REPOST-{#####}",
"creation": "2023-07-04 13:07:32.923675",
"default_view": "List",
"doctype": "DocType",
@@ -55,14 +53,15 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2023-09-26 14:21:27.362567",
"modified": "2024-06-03 17:30:37.012593",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Repost Accounting Ledger",
"naming_rule": "Expression",
"owner": "Administrator",
"permissions": [
{
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
@@ -71,7 +70,9 @@
"read": 1,
"report": 1,
"role": "System Manager",
"select": 1,
"share": 1,
"submit": 1,
"write": 1
}
],

View File

@@ -27,7 +27,7 @@ class RepostAccountingLedger(Document):
latest_pcv = (
frappe.db.get_all(
"Period Closing Voucher",
filters={"company": self.company},
filters={"company": self.company, "docstatus": 1},
order_by="posting_date desc",
pluck="posting_date",
limit=1,
@@ -149,6 +149,10 @@ def start_repost(account_repost_doc=str) -> None:
doc.make_gl_entries_on_cancel()
doc.docstatus = 1
if doc.doctype == "Sales Invoice":
doc.force_set_against_income_account()
else:
doc.force_set_against_expense_account()
doc.make_gl_entries()
elif doc.doctype in ["Payment Entry", "Journal Entry", "Expense Claim"]:

View File

@@ -17,7 +17,7 @@
"in_create": 1,
"issingle": 1,
"links": [],
"modified": "2023-11-07 14:24:13.321522",
"modified": "2024-06-06 13:56:37.908879",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Repost Accounting Ledger Settings",
@@ -30,13 +30,17 @@
"print": 1,
"read": 1,
"role": "Administrator",
"select": 1,
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"read": 1,
"role": "System Manager",
"select": 1
"select": 1,
"write": 1
}
],
"sort_field": "modified",

View File

@@ -1,6 +1,5 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2022-10-19 21:59:33.553852",
"doctype": "DocType",
"editable_grid": 1,
@@ -99,13 +98,15 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2023-09-26 14:21:35.719727",
"modified": "2024-06-03 17:31:04.472279",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Repost Payment Ledger",
"owner": "Administrator",
"permissions": [
{
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
@@ -114,7 +115,9 @@
"read": 1,
"report": 1,
"role": "System Manager",
"select": 1,
"share": 1,
"submit": 1,
"write": 1
},
{

View File

@@ -49,25 +49,6 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e
this.frm.toggle_reqd("due_date", !this.frm.doc.is_return);
if (this.frm.doc.repost_required && this.frm.doc.docstatus===1) {
this.frm.set_intro(__("Accounting entries for this invoice needs 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 (this.frm.doc.is_return) {
this.frm.return_print_format = "Sales Invoice Return";
}
@@ -200,7 +181,7 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e
if(cur_frm.meta._default_print_format) {
cur_frm.meta.default_print_format = cur_frm.meta._default_print_format;
cur_frm.meta._default_print_format = null;
} else if(in_list([cur_frm.pos_print_format, cur_frm.return_print_format], cur_frm.meta.default_print_format)) {
} else if([cur_frm.pos_print_format, cur_frm.return_print_format].includes(cur_frm.meta.default_print_format)) {
cur_frm.meta.default_print_format = null;
cur_frm.meta._default_print_format = null;
}
@@ -299,8 +280,12 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e
party_type: "Customer",
account: this.frm.doc.debit_to,
price_list: this.frm.doc.selling_price_list,
pos_profile: pos_profile
}, function() {
pos_profile: pos_profile,
fetch_payment_terms_template: cint(
(this.frm.doc.is_return == 0) & !this.frm.doc.ignore_default_payment_terms_template
),
},
function () {
me.apply_pricing_rule();
});
@@ -428,12 +413,16 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e
frappe.msgprint(__("Please specify Company to proceed"));
} else {
var me = this;
const for_validate = me.frm.doc.is_return ? true : false;
return this.frm.call({
doc: me.frm.doc,
method: "set_missing_values",
callback: function(r) {
if(!r.exc) {
if(r.message && r.message.print_format) {
args: {
for_validate: for_validate,
},
callback: function (r) {
if (!r.exc) {
if (r.message && r.message.print_format) {
me.frm.pos_print_format = r.message.print_format;
}
me.frm.trigger("update_stock");
@@ -678,20 +667,6 @@ frappe.ui.form.on('Sales Invoice', {
}
}
frm.set_query('company_address', function(doc) {
if(!doc.company) {
frappe.throw(__('Please set Company'));
}
return {
query: 'frappe.contacts.doctype.address.address.address_query',
filters: {
link_doctype: 'Company',
link_name: doc.company
}
};
});
frm.set_query('pos_profile', function(doc) {
if(!doc.company) {
frappe.throw(_('Please set Company'));

View File

@@ -160,8 +160,9 @@
"dispatch_address",
"company_address_section",
"company_address",
"company_addr_col_break",
"company_address_display",
"company_addr_col_break",
"company_contact_person",
"terms_tab",
"payment_schedule_section",
"ignore_default_payment_terms_template",
@@ -213,7 +214,6 @@
"is_internal_customer",
"is_discounted",
"remarks",
"repost_required",
"connections_tab"
],
"fields": [
@@ -2172,6 +2172,13 @@
"label": "Update Outstanding for Self",
"no_copy": 1,
"print_hide": 1
},
{
"fieldname": "company_contact_person",
"fieldtype": "Link",
"label": "Company Contact Person",
"options": "Contact",
"print_hide": 1
}
],
"icon": "fa fa-file-text",
@@ -2184,7 +2191,7 @@
"link_fieldname": "consolidated_invoice"
}
],
"modified": "2024-05-08 18:02:28.549041",
"modified": "2024-11-26 12:34:09.110690",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",

View File

@@ -170,6 +170,7 @@ class SalesInvoice(SellingController):
):
validate_loyalty_points(self, self.loyalty_points)
self.allow_write_off_only_on_pos()
self.reset_default_field_value("set_warehouse", "items", "warehouse")
def validate_accounts(self):
@@ -385,7 +386,6 @@ class SalesInvoice(SellingController):
self.repost_future_sle_and_gle()
self.db_set("status", "Cancelled")
self.db_set("repost_required", 0)
if frappe.db.get_single_value("Selling Settings", "sales_update_frequency") == "Each Transaction":
update_company_current_month_sales(self.company)
@@ -532,23 +532,23 @@ class SalesInvoice(SellingController):
data.sales_invoice = sales_invoice
def on_update_after_submit(self):
if hasattr(self, "repost_required"):
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)
fields_to_check = [
"additional_discount_account",
"cash_bank_account",
"account_for_change_amount",
"write_off_account",
"loyalty_redemption_account",
"unrealized_profit_loss_account",
"is_opening",
]
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.repost_accounting_entries()
def set_paid_amount(self):
paid_amount = 0.0
@@ -768,6 +768,10 @@ class SalesInvoice(SellingController):
against_acc.append(d.income_account)
self.against_income_account = ",".join(against_acc)
def force_set_against_income_account(self):
self.set_against_income_account()
frappe.db.set_value(self.doctype, self.name, "against_income_account", self.against_income_account)
def add_remarks(self):
if not self.remarks:
if self.po_no and self.po_date:
@@ -847,6 +851,10 @@ class SalesInvoice(SellingController):
raise_exception=1,
)
def allow_write_off_only_on_pos(self):
if not self.is_pos and self.write_off_account:
self.write_off_account = None
def validate_write_off_account(self):
if flt(self.write_off_amount) and not self.write_off_account:
self.write_off_account = frappe.get_cached_value("Company", self.company, "write_off_account")
@@ -1291,6 +1299,10 @@ 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)
against_voucher = self.name
if self.is_return and self.return_against and not self.update_outstanding_for_self:
against_voucher = self.return_against
if payment_mode.base_amount:
# POS, make payment entries
gl_entries.append(
@@ -1304,7 +1316,7 @@ class SalesInvoice(SellingController):
"credit_in_account_currency": payment_mode.base_amount
if self.party_account_currency == self.company_currency
else payment_mode.amount,
"against_voucher": self.name,
"against_voucher": against_voucher,
"against_voucher_type": self.doctype,
"cost_center": self.cost_center,
},
@@ -1544,8 +1556,12 @@ class SalesInvoice(SellingController):
)
def update_project(self):
if self.project:
project = frappe.get_doc("Project", self.project)
unique_projects = list(set([d.project for d in self.get("items") if d.project]))
if self.project and self.project not in unique_projects:
unique_projects.append(self.project)
for p in unique_projects:
project = frappe.get_doc("Project", p)
project.update_billed_amount()
project.db_update()

View File

@@ -2,8 +2,10 @@
# License: GNU General Public License v3. See license.txt
import copy
import json
import frappe
from frappe import qb
from frappe.model.dynamic_links import get_dynamic_link_map
from frappe.model.naming import make_autoname
from frappe.tests.utils import FrappeTestCase, change_settings
@@ -305,7 +307,8 @@ class TestSalesInvoice(FrappeTestCase):
si.insert()
# with inclusive tax
self.assertEqual(si.items[0].net_amount, 3947.368421052631)
self.assertEqual(si.items[0].net_amount, 3947.37)
self.assertEqual(si.net_total, si.base_net_total)
self.assertEqual(si.net_total, 3947.37)
self.assertEqual(si.grand_total, 5000)
@@ -412,8 +415,8 @@ class TestSalesInvoice(FrappeTestCase):
for i, k in enumerate(expected_values["keys"]):
self.assertEqual(d.get(k), expected_values[d.account_head][i])
self.assertEqual(si.base_grand_total, 1500)
self.assertEqual(si.grand_total, 1500)
self.assertEqual(si.base_grand_total, 1500.01)
self.assertEqual(si.grand_total, 1500.01)
self.assertEqual(si.rounding_adjustment, -0.01)
def test_discount_amount_gl_entry(self):
@@ -649,7 +652,7 @@ class TestSalesInvoice(FrappeTestCase):
62.5,
625.0,
50,
499.97600115194473,
499.98,
],
"_Test Item Home Desktop 200": [
190.66,
@@ -660,7 +663,7 @@ class TestSalesInvoice(FrappeTestCase):
190.66,
953.3,
150,
749.9968530500239,
750,
],
}
@@ -673,20 +676,21 @@ class TestSalesInvoice(FrappeTestCase):
self.assertEqual(d.get(k), expected_values[d.item_code][i])
# check net total
self.assertEqual(si.net_total, 1249.97)
self.assertEqual(si.base_net_total, si.net_total)
self.assertEqual(si.net_total, 1249.98)
self.assertEqual(si.total, 1578.3)
# check tax calculation
expected_values = {
"keys": ["tax_amount", "total"],
"_Test Account Excise Duty - _TC": [140, 1389.97],
"_Test Account Education Cess - _TC": [2.8, 1392.77],
"_Test Account S&H Education Cess - _TC": [1.4, 1394.17],
"_Test Account CST - _TC": [27.88, 1422.05],
"_Test Account VAT - _TC": [156.25, 1578.30],
"_Test Account Customs Duty - _TC": [125, 1703.30],
"_Test Account Shipping Charges - _TC": [100, 1803.30],
"_Test Account Discount - _TC": [-180.33, 1622.97],
"_Test Account Excise Duty - _TC": [140, 1389.98],
"_Test Account Education Cess - _TC": [2.8, 1392.78],
"_Test Account S&H Education Cess - _TC": [1.4, 1394.18],
"_Test Account CST - _TC": [27.88, 1422.06],
"_Test Account VAT - _TC": [156.25, 1578.31],
"_Test Account Customs Duty - _TC": [125, 1703.31],
"_Test Account Shipping Charges - _TC": [100, 1803.31],
"_Test Account Discount - _TC": [-180.33, 1622.98],
}
for d in si.get("taxes"):
@@ -722,7 +726,7 @@ class TestSalesInvoice(FrappeTestCase):
"base_rate": 2500,
"base_amount": 25000,
"net_rate": 40,
"net_amount": 399.9808009215558,
"net_amount": 399.98,
"base_net_rate": 2000,
"base_net_amount": 19999,
},
@@ -736,7 +740,7 @@ class TestSalesInvoice(FrappeTestCase):
"base_rate": 7500,
"base_amount": 37500,
"net_rate": 118.01,
"net_amount": 590.0531205155963,
"net_amount": 590.05,
"base_net_rate": 5900.5,
"base_net_amount": 29502.5,
},
@@ -774,8 +778,13 @@ class TestSalesInvoice(FrappeTestCase):
self.assertEqual(si.base_grand_total, 60795)
self.assertEqual(si.grand_total, 1215.90)
self.assertEqual(si.rounding_adjustment, 0.01)
self.assertEqual(si.base_rounding_adjustment, 0.50)
# no rounding adjustment as the Smallest Currency Fraction Value of USD is 0.01
if frappe.db.get_value("Currency", "USD", "smallest_currency_fraction_value") < 0.01:
self.assertEqual(si.rounding_adjustment, 0.10)
self.assertEqual(si.base_rounding_adjustment, 5.0)
else:
self.assertEqual(si.rounding_adjustment, 0.0)
self.assertEqual(si.base_rounding_adjustment, 0.0)
def test_outstanding(self):
w = self.make()
@@ -2097,7 +2106,7 @@ class TestSalesInvoice(FrappeTestCase):
self.assertEqual(si.net_total, 19453.13)
self.assertEqual(si.grand_total, 24900)
self.assertEqual(si.total_taxes_and_charges, 5446.88)
self.assertEqual(si.rounding_adjustment, -0.01)
self.assertEqual(si.rounding_adjustment, 0.00)
expected_values = dict(
(d[0], d)
@@ -2124,7 +2133,7 @@ class TestSalesInvoice(FrappeTestCase):
def test_rounding_adjustment_2(self):
si = create_sales_invoice(rate=400, do_not_save=True)
for rate in [400, 600, 100]:
for rate in [400.25, 600.30, 100.65]:
si.append(
"items",
{
@@ -2150,17 +2159,18 @@ class TestSalesInvoice(FrappeTestCase):
)
si.save()
si.submit()
self.assertEqual(si.net_total, 1271.19)
self.assertEqual(si.grand_total, 1500)
self.assertEqual(si.total_taxes_and_charges, 228.82)
self.assertEqual(si.rounding_adjustment, -0.01)
self.assertEqual(si.net_total, si.base_net_total)
self.assertEqual(si.net_total, 1272.20)
self.assertEqual(si.grand_total, 1501.20)
self.assertEqual(si.total_taxes_and_charges, 229)
self.assertEqual(si.rounding_adjustment, -0.20)
expected_values = [
["_Test Account Service Tax - _TC", 0.0, 114.41],
["_Test Account VAT - _TC", 0.0, 114.41],
[si.debit_to, 1500, 0.0],
["Round Off - _TC", 0.01, 0.01],
["Sales - _TC", 0.0, 1271.18],
["_Test Account Service Tax - _TC", 0.0, 114.50],
["_Test Account VAT - _TC", 0.0, 114.50],
[si.debit_to, 1501, 0.0],
["Round Off - _TC", 0.20, 0.0],
["Sales - _TC", 0.0, 1272.20],
]
gl_entries = frappe.db.sql(
@@ -2218,7 +2228,8 @@ class TestSalesInvoice(FrappeTestCase):
si.save()
si.submit()
self.assertEqual(si.net_total, 4007.16)
self.assertEqual(si.net_total, si.base_net_total)
self.assertEqual(si.net_total, 4007.15)
self.assertEqual(si.grand_total, 4488.02)
self.assertEqual(si.total_taxes_and_charges, 480.86)
self.assertEqual(si.rounding_adjustment, -0.02)
@@ -2230,7 +2241,7 @@ class TestSalesInvoice(FrappeTestCase):
["_Test Account Service Tax - _TC", 0.0, 240.43],
["_Test Account VAT - _TC", 0.0, 240.43],
["Sales - _TC", 0.0, 4007.15],
["Round Off - _TC", 0.02, 0.01],
["Round Off - _TC", 0.01, 0.0],
]
)
@@ -2883,13 +2894,9 @@ class TestSalesInvoice(FrappeTestCase):
si.items[0].income_account = "Service - _TC"
si.additional_discount_account = "_Test Account Sales - _TC"
si.taxes[0].account_head = "TDS Payable - _TC"
# Ledger reposted implicitly upon 'Update After Submit'
si.save()
si.load_from_db()
self.assertTrue(si.repost_required)
si.repost_accounting_entries()
expected_gle = [
["_Test Account Sales - _TC", 22.0, 0.0, nowdate()],
["Debtors - _TC", 88, 0.0, nowdate()],
@@ -2899,9 +2906,6 @@ class TestSalesInvoice(FrappeTestCase):
check_gl_entries(self, si.name, expected_gle, add_days(nowdate(), -1))
si.load_from_db()
self.assertFalse(si.repost_required)
def test_asset_depreciation_on_sale_with_pro_rata(self):
"""
Tests if an Asset set to depreciate yearly on June 30, that gets sold on Sept 30, creates an additional depreciation entry on its date of sale.
@@ -2978,10 +2982,8 @@ class TestSalesInvoice(FrappeTestCase):
["2021-06-30", 20000.0, 21366.12, True],
["2022-06-30", 20000.0, 41366.12, False],
["2023-06-30", 20000.0, 61366.12, False],
["2024-06-30", 20000.0, 81366.12, False],
["2025-06-06", 18633.88, 100000.0, False],
["2024-06-06", 38633.88, 100000.0, False],
]
for i, schedule in enumerate(asset.schedules):
self.assertEqual(getdate(expected_values[i][0]), schedule.schedule_date)
self.assertEqual(expected_values[i][1], schedule.depreciation_amount)
@@ -3033,6 +3035,128 @@ class TestSalesInvoice(FrappeTestCase):
party_link.delete()
frappe.db.set_value("Accounts Settings", None, "enable_common_party_accounting", 0)
def test_sales_invoice_against_supplier_usd_with_dimensions(self):
from erpnext.accounts.doctype.opening_invoice_creation_tool.test_opening_invoice_creation_tool import (
make_customer,
)
from erpnext.accounts.doctype.party_link.party_link import create_party_link
from erpnext.buying.doctype.supplier.test_supplier import create_supplier
# create a customer
customer = make_customer(customer="_Test Common Supplier USD")
cust_doc = frappe.get_doc("Customer", customer)
cust_doc.default_currency = "USD"
cust_doc.save()
# create a supplier
supplier = create_supplier(supplier_name="_Test Common Supplier USD").name
supp_doc = frappe.get_doc("Supplier", supplier)
supp_doc.default_currency = "USD"
supp_doc.save()
# create a party link between customer & supplier
party_link = create_party_link("Supplier", supplier, customer)
# enable common party accounting
frappe.db.set_single_value("Accounts Settings", "enable_common_party_accounting", 1)
# create a dimension and make it mandatory
if not frappe.get_all("Accounting Dimension", filters={"document_type": "Department"}):
dim = frappe.get_doc(
{
"doctype": "Accounting Dimension",
"document_type": "Department",
"dimension_defaults": [{"company": "_Test Company", "mandatory_for_bs": True}],
}
)
dim.save()
else:
dim = frappe.get_doc(
"Accounting Dimension",
frappe.get_all("Accounting Dimension", filters={"document_type": "Department"})[0],
)
dim.disabled = False
dim.dimension_defaults = []
dim.append("dimension_defaults", {"company": "_Test Company", "mandatory_for_bs": True})
dim.save()
# create a sales invoice
si = create_sales_invoice(
customer=customer, parent_cost_center="_Test Cost Center - _TC", do_not_submit=True
)
si.department = "All Departments"
si.save().submit()
# check outstanding of sales invoice
si.reload()
self.assertEqual(si.status, "Paid")
self.assertEqual(flt(si.outstanding_amount), 0.0)
# check creation of journal entry
jv = frappe.get_all(
"Journal Entry Account",
{
"account": si.debit_to,
"party_type": "Customer",
"party": si.customer,
"reference_type": si.doctype,
"reference_name": si.name,
"department": "All Departments",
},
pluck="credit_in_account_currency",
)
self.assertTrue(jv)
self.assertEqual(jv[0], si.grand_total)
dim.disabled = True
dim.save()
party_link.delete()
frappe.db.set_single_value("Accounts Settings", "enable_common_party_accounting", 0)
def test_sales_invoice_cancel_with_common_party_advance_jv(self):
from erpnext.accounts.doctype.opening_invoice_creation_tool.test_opening_invoice_creation_tool import (
make_customer,
)
from erpnext.accounts.doctype.party_link.party_link import create_party_link
from erpnext.buying.doctype.supplier.test_supplier import create_supplier
# create a customer
customer = make_customer(customer="_Test Common Supplier")
# create a supplier
supplier = create_supplier(supplier_name="_Test Common Supplier").name
# create a party link between customer & supplier
party_link = create_party_link("Supplier", supplier, customer)
# enable common party accounting
frappe.db.set_single_value("Accounts Settings", "enable_common_party_accounting", 1)
# create a sales invoice
si = create_sales_invoice(customer=customer)
# check creation of journal entry
jv = frappe.db.get_value(
"Journal Entry Account",
filters={
"reference_type": si.doctype,
"reference_name": si.name,
"docstatus": 1,
},
fieldname="parent",
)
self.assertTrue(jv)
# cancel sales invoice
si.cancel()
# check cancellation of journal entry
jv_status = frappe.db.get_value("Journal Entry", jv, "docstatus")
self.assertEqual(jv_status, 2)
party_link.delete()
frappe.db.set_single_value("Accounts Settings", "enable_common_party_accounting", 0)
def test_payment_statuses(self):
from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
@@ -3479,9 +3603,9 @@ class TestSalesInvoice(FrappeTestCase):
map_docs(
method="erpnext.stock.doctype.delivery_note.delivery_note.make_sales_invoice",
source_names=frappe.json.dumps([dn1.name, dn2.name]),
source_names=json.dumps([dn1.name, dn2.name]),
target_doc=si,
args=frappe.json.dumps({"customer": dn1.customer, "merge_taxes": 1, "filtered_children": []}),
args=json.dumps({"customer": dn1.customer, "merge_taxes": 1, "filtered_children": []}),
)
si.save().submit()
@@ -3520,6 +3644,218 @@ class TestSalesInvoice(FrappeTestCase):
]
self.assertEqual(expected, actual)
def test_pos_returns_without_update_outstanding_for_self(self):
from erpnext.accounts.doctype.sales_invoice.sales_invoice import make_sales_return
pos_profile = make_pos_profile()
pos_profile.payments = []
pos_profile.append("payments", {"default": 1, "mode_of_payment": "Cash"})
pos_profile.save()
pos = create_sales_invoice(qty=10, do_not_save=True)
pos.is_pos = 1
pos.pos_profile = pos_profile.name
pos.append(
"payments", {"mode_of_payment": "Bank Draft", "account": "_Test Bank - _TC", "amount": 500}
)
pos.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 500})
pos.save().submit()
pos_return = make_sales_return(pos.name)
pos_return.update_outstanding_for_self = False
pos_return.save().submit()
gle = qb.DocType("GL Entry")
res = (
qb.from_(gle)
.select(gle.against_voucher)
.distinct()
.where(
gle.is_cancelled.eq(0) & gle.voucher_no.eq(pos_return.name) & gle.against_voucher.notnull()
)
.run(as_list=1)
)
self.assertEqual(len(res), 1)
self.assertEqual(res[0][0], pos_return.return_against)
@change_settings("Accounts Settings", {"enable_common_party_accounting": True})
def test_common_party_with_foreign_currency_jv(self):
from erpnext.accounts.doctype.account.test_account import create_account
from erpnext.accounts.doctype.opening_invoice_creation_tool.test_opening_invoice_creation_tool import (
make_customer,
)
from erpnext.accounts.doctype.party_link.party_link import create_party_link
from erpnext.buying.doctype.supplier.test_supplier import create_supplier
from erpnext.setup.utils import get_exchange_rate
creditors = create_account(
account_name="Creditors USD",
parent_account="Accounts Payable - _TC",
company="_Test Company",
account_currency="USD",
account_type="Payable",
)
debtors = create_account(
account_name="Debtors USD",
parent_account="Accounts Receivable - _TC",
company="_Test Company",
account_currency="USD",
account_type="Receivable",
)
# create a customer
customer = make_customer(customer="_Test Common Party USD")
cust_doc = frappe.get_doc("Customer", customer)
cust_doc.default_currency = "USD"
test_account_details = {
"company": "_Test Company",
"account": debtors,
}
cust_doc.append("accounts", test_account_details)
cust_doc.save()
# create a supplier
supplier = create_supplier(supplier_name="_Test Common Party USD").name
supp_doc = frappe.get_doc("Supplier", supplier)
supp_doc.default_currency = "USD"
test_account_details = {
"company": "_Test Company",
"account": creditors,
}
supp_doc.append("accounts", test_account_details)
supp_doc.save()
# create a party link between customer & supplier
create_party_link("Supplier", supplier, customer)
# create a sales invoice
si = create_sales_invoice(
customer=customer,
currency="USD",
conversion_rate=get_exchange_rate("USD", "INR"),
debit_to=debtors,
do_not_save=1,
)
si.party_account_currency = "USD"
si.save()
si.submit()
# check outstanding of sales invoice
si.reload()
self.assertEqual(si.status, "Paid")
self.assertEqual(flt(si.outstanding_amount), 0.0)
# check creation of journal entry
jv = frappe.get_all(
"Journal Entry Account",
{
"account": si.debit_to,
"party_type": "Customer",
"party": si.customer,
"reference_type": si.doctype,
"reference_name": si.name,
},
pluck="credit_in_account_currency",
)
self.assertTrue(jv)
self.assertEqual(jv[0], si.grand_total)
@change_settings("Accounts Settings", {"enable_common_party_accounting": True})
def test_common_party_with_different_currency_in_debtor_and_creditor(self):
from erpnext.accounts.doctype.account.test_account import create_account
from erpnext.accounts.doctype.opening_invoice_creation_tool.test_opening_invoice_creation_tool import (
make_customer,
)
from erpnext.accounts.doctype.party_link.party_link import create_party_link
from erpnext.buying.doctype.supplier.test_supplier import create_supplier
from erpnext.setup.utils import get_exchange_rate
creditors = create_account(
account_name="Creditors INR",
parent_account="Accounts Payable - _TC",
company="_Test Company",
account_currency="INR",
account_type="Payable",
)
debtors = create_account(
account_name="Debtors USD",
parent_account="Accounts Receivable - _TC",
company="_Test Company",
account_currency="USD",
account_type="Receivable",
)
# create a customer
customer = make_customer(customer="_Test Common Party USD")
cust_doc = frappe.get_doc("Customer", customer)
cust_doc.default_currency = "USD"
test_account_details = {
"company": "_Test Company",
"account": debtors,
}
cust_doc.append("accounts", test_account_details)
cust_doc.save()
# create a supplier
supplier = create_supplier(supplier_name="_Test Common Party INR").name
supp_doc = frappe.get_doc("Supplier", supplier)
supp_doc.default_currency = "INR"
test_account_details = {
"company": "_Test Company",
"account": creditors,
}
supp_doc.append("accounts", test_account_details)
supp_doc.save()
# create a party link between customer & supplier
create_party_link("Supplier", supplier, customer)
# create a sales invoice
si = create_sales_invoice(
customer=customer,
currency="USD",
conversion_rate=get_exchange_rate("USD", "INR"),
debit_to=debtors,
do_not_save=1,
)
si.party_account_currency = "USD"
si.save()
si.submit()
# check outstanding of sales invoice
si.reload()
self.assertEqual(si.status, "Paid")
self.assertEqual(flt(si.outstanding_amount), 0.0)
# check creation of journal entry
jv = frappe.get_all(
"Journal Entry Account",
{
"account": si.debit_to,
"party_type": "Customer",
"party": si.customer,
"reference_type": si.doctype,
"reference_name": si.name,
},
pluck="credit_in_account_currency",
)
self.assertTrue(jv)
self.assertEqual(jv[0], si.grand_total)
def test_total_billed_amount(self):
si = create_sales_invoice(do_not_submit=True)
project = frappe.new_doc("Project")
project.project_name = "Test Total Billed Amount"
project.save()
si.project = project.name
si.save()
si.submit()
doc = frappe.get_doc("Project", project.name)
self.assertEqual(doc.total_billed_amount, si.grand_total)
def check_gl_entries(doc, voucher_no, expected_gle, posting_date):
gl_entries = frappe.db.sql(

View File

@@ -867,7 +867,8 @@
"label": "Purchase Order",
"options": "Purchase Order",
"print_hide": 1,
"read_only": 1
"read_only": 1,
"search_index": 1
},
{
"fieldname": "column_break_92",
@@ -892,7 +893,7 @@
"idx": 1,
"istable": 1,
"links": [],
"modified": "2023-11-14 18:34:10.479329",
"modified": "2024-05-23 16:36:18.970862",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",

View File

@@ -147,6 +147,7 @@
"fieldname": "amount",
"fieldtype": "Currency",
"label": "Amount",
"options": "Company:company:default_currency",
"read_only": 1
},
{

View File

@@ -37,6 +37,12 @@ frappe.ui.form.on("Subscription", {
frm.add_custom_button(__("Fetch Subscription Updates"), () =>
frm.events.get_subscription_updates(frm)
);
frm.add_custom_button(
__("Force-Fetch Subscription Updates"),
() => frm.trigger("force_fetch_subscription_updates"),
__("Actions")
);
} else if (frm.doc.status === "Cancelled") {
frm.add_custom_button(__("Restart Subscription"), () =>
frm.events.renew_this_subscription(frm)
@@ -96,4 +102,11 @@ frappe.ui.form.on("Subscription", {
},
});
},
force_fetch_subscription_updates: function (frm) {
frm.call("force_fetch_subscription_updates").then((r) => {
if (!r.exec) {
frm.reload_doc();
}
});
},
});

View File

@@ -674,6 +674,28 @@ class Subscription(Document):
if invoice:
return invoice.precision("grand_total")
@frappe.whitelist()
def force_fetch_subscription_updates(self):
"""
Process Subscription and create Invoices even if current date doesn't lie between current_invoice_start and currenct_invoice_end
It makes use of 'Proces Subscription' to force processing in a specific 'posting_date'
"""
# Don't process future subscriptions
if nowdate() < self.current_invoice_start:
frappe.msgprint(_("Subscription for Future dates cannot be processed."))
return
processing_date = None
if self.generate_invoice_at == "Beginning of the current subscription period":
processing_date = self.current_invoice_start
elif self.generate_invoice_at == "End of the current subscription period":
processing_date = self.current_invoice_end
elif self.generate_invoice_at == "Days before the current subscription period":
processing_date = add_days(self.current_invoice_start, -self.number_of_days)
self.process(posting_date=processing_date)
def get_calendar_months(billing_interval):
calendar_months = []

View File

@@ -712,3 +712,18 @@ class TestSubscription(FrappeTestCase):
self.assertEqual(pi.total, 55333.33)
subscription.delete()
def test_future_subscription(self):
"""Force-Fetch should not process future subscriptions"""
subscription = frappe.new_doc("Subscription")
subscription.party_type = "Customer"
subscription.party = "_Test Customer"
subscription.generate_invoice_at_period_start = 1
subscription.generate_new_invoices_past_due_date = 1
subscription.start_date = add_months(nowdate(), 1)
subscription.append("plans", {"plan": "_Test Plan Name", "qty": 1})
subscription.save()
subscription.force_fetch_subscription_updates()
subscription.reload()
self.assertEqual(len(subscription.invoices), 0)

View File

@@ -236,6 +236,11 @@ def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=N
vouchers, voucher_wise_amount = get_invoice_vouchers(
parties, tax_details, inv.company, party_type=party_type
)
payment_entry_vouchers = get_payment_entry_vouchers(
parties, tax_details, inv.company, party_type=party_type
)
advance_vouchers = get_advance_vouchers(
parties,
company=inv.company,
@@ -243,7 +248,8 @@ def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=N
to_date=tax_details.to_date,
party_type=party_type,
)
taxable_vouchers = vouchers + advance_vouchers
taxable_vouchers = vouchers + advance_vouchers + payment_entry_vouchers
tax_deducted_on_advances = 0
if inv.doctype == "Purchase Invoice":
@@ -289,7 +295,7 @@ def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=N
tax_amount = 0
else:
# if no TCS has been charged in FY,
# then chargeable value is "prev invoices + advances" value which cross the threshold
# then chargeable value is "prev invoices + advances - advance_adjusted" value which cross the threshold
tax_amount = get_tcs_amount(parties, inv, tax_details, vouchers, advance_vouchers)
if cint(tax_details.round_off_tax_amount):
@@ -337,12 +343,14 @@ def get_invoice_vouchers(parties, tax_details, company, party_type="Supplier"):
AND ja.party in %s
AND j.apply_tds = 1
AND j.tax_withholding_category = %s
AND j.company = %s
""",
(
tax_details.from_date,
tax_details.to_date,
tuple(parties),
tax_details.get("tax_withholding_category"),
company,
),
as_dict=1,
)
@@ -355,11 +363,28 @@ def get_invoice_vouchers(parties, tax_details, company, party_type="Supplier"):
return vouchers, voucher_wise_amount
def get_payment_entry_vouchers(parties, tax_details, company, party_type="Supplier"):
payment_entry_filters = {
"party_type": party_type,
"party": ("in", parties),
"docstatus": 1,
"apply_tax_withholding_amount": 1,
"posting_date": ["between", (tax_details.from_date, tax_details.to_date)],
"tax_withholding_category": tax_details.get("tax_withholding_category"),
"company": company,
}
return frappe.db.get_all("Payment Entry", filters=payment_entry_filters, pluck="name")
def get_advance_vouchers(parties, company=None, from_date=None, to_date=None, party_type="Supplier"):
"""
Use Payment Ledger to fetch unallocated Advance Payments
"""
if party_type == "Supplier":
return []
ple = qb.DocType("Payment Ledger Entry")
conditions = []
@@ -445,6 +470,7 @@ def get_tds_amount(ldc, parties, inv, tax_details, vouchers):
"unallocated_amount": (">", 0),
"posting_date": ["between", (tax_details.from_date, tax_details.to_date)],
"tax_withholding_category": tax_details.get("tax_withholding_category"),
"company": inv.company,
}
field = "sum(tax_withholding_net_total)"
@@ -456,7 +482,7 @@ def get_tds_amount(ldc, parties, inv, tax_details, vouchers):
payment_entry_filters.pop("apply_tax_withholding_amount", None)
payment_entry_filters.pop("tax_withholding_category", None)
supp_credit_amt = frappe.db.get_value("Purchase Invoice", invoice_filters, field) or 0.0
supp_inv_credit_amt = frappe.db.get_value("Purchase Invoice", invoice_filters, field) or 0.0
supp_jv_credit_amt = (
frappe.db.get_value(
@@ -480,7 +506,7 @@ def get_tds_amount(ldc, parties, inv, tax_details, vouchers):
group_by="payment_type",
)
supp_credit_amt += supp_jv_credit_amt
supp_credit_amt = supp_jv_credit_amt
supp_credit_amt += inv.tax_withholding_net_total
for type in payment_entry_amounts:
@@ -498,19 +524,19 @@ def get_tds_amount(ldc, parties, inv, tax_details, vouchers):
tax_withholding_net_total = inv.tax_withholding_net_total
if (threshold and tax_withholding_net_total >= threshold) or (
cumulative_threshold and supp_credit_amt >= cumulative_threshold
cumulative_threshold and (supp_credit_amt + supp_inv_credit_amt) >= cumulative_threshold
):
# Get net total again as TDS is calculated on net total
# Grand is used to just check for threshold breach
net_total = (
frappe.db.get_value("Purchase Invoice", invoice_filters, "sum(tax_withholding_net_total)") or 0.0
)
supp_credit_amt += net_total
if (cumulative_threshold and supp_credit_amt >= cumulative_threshold) and cint(
tax_details.tax_on_excess_amount
):
# Get net total again as TDS is calculated on net total
# Grand is used to just check for threshold breach
net_total = (
frappe.db.get_value("Purchase Invoice", invoice_filters, "sum(tax_withholding_net_total)")
or 0.0
)
net_total += inv.tax_withholding_net_total
supp_credit_amt = net_total - cumulative_threshold
supp_credit_amt = net_total + tax_withholding_net_total - cumulative_threshold
if ldc and is_valid_certificate(ldc, inv.get("posting_date") or inv.get("transaction_date"), 0):
tds_amount = get_lower_deduction_amount(
@@ -552,8 +578,6 @@ def get_tcs_amount(parties, inv, tax_details, vouchers, adv_vouchers):
conditions.append(ple.voucher_no == ple.against_voucher_no)
conditions.append(ple.company == inv.company)
(qb.from_(ple).select(Abs(Sum(ple.amount))).where(Criterion.all(conditions)).run(as_list=1))
advance_amt = (
qb.from_(ple).select(Abs(Sum(ple.amount))).where(Criterion.all(conditions)).run()[0][0] or 0.0
)
@@ -576,9 +600,12 @@ def get_tcs_amount(parties, inv, tax_details, vouchers, adv_vouchers):
)
cumulative_threshold = tax_details.get("cumulative_threshold", 0)
advance_adjusted = get_advance_adjusted_in_invoice(inv)
current_invoice_total = get_invoice_total_without_tcs(inv, tax_details)
total_invoiced_amt = current_invoice_total + invoiced_amt + advance_amt - credit_note_amt
total_invoiced_amt = (
current_invoice_total + invoiced_amt + advance_amt - credit_note_amt - advance_adjusted
)
if cumulative_threshold and total_invoiced_amt >= cumulative_threshold:
chargeable_amt = total_invoiced_amt - cumulative_threshold
@@ -587,6 +614,14 @@ def get_tcs_amount(parties, inv, tax_details, vouchers, adv_vouchers):
return tcs_amount
def get_advance_adjusted_in_invoice(inv):
advances_adjusted = 0
for row in inv.get("advances", []):
advances_adjusted += row.allocated_amount
return advances_adjusted
def get_invoice_total_without_tcs(inv, tax_details):
tcs_tax_row = [d for d in inv.taxes if d.account_head == tax_details.account_head]
tcs_tax_row_amount = tcs_tax_row[0].base_tax_amount if tcs_tax_row else 0

View File

@@ -121,6 +121,85 @@ class TestTaxWithholdingCategory(FrappeTestCase):
for d in reversed(invoices):
d.cancel()
def test_cumulative_threshold_with_party_ledger_amount_on_net_total(self):
invoices = []
frappe.db.set_value(
"Supplier", "Test TDS Supplier3", "tax_withholding_category", "Advance TDS Category"
)
# Invoice with tax and without exceeding single and cumulative thresholds
for _ in range(2):
pi = create_purchase_invoice(supplier="Test TDS Supplier3", rate=1000, do_not_save=True)
pi.apply_tds = 1
pi.append(
"taxes",
{
"category": "Total",
"charge_type": "Actual",
"account_head": "_Test Account VAT - _TC",
"cost_center": "Main - _TC",
"tax_amount": 500,
"description": "Test",
"add_deduct_tax": "Add",
},
)
pi.save()
pi.submit()
invoices.append(pi)
# Third Invoice exceeds single threshold and not exceeding cumulative threshold
pi1 = create_purchase_invoice(supplier="Test TDS Supplier3", rate=6000)
pi1.apply_tds = 1
pi1.save()
pi1.submit()
invoices.append(pi1)
# Cumulative threshold is 10,000
# Threshold calculation should be only on the third invoice
self.assertEqual(pi1.taxes[0].tax_amount, 800)
for d in reversed(invoices):
d.cancel()
def test_cumulative_threshold_with_tax_on_excess_amount(self):
invoices = []
frappe.db.set_value("Supplier", "Test TDS Supplier3", "tax_withholding_category", "New TDS Category")
# Invoice with tax and without exceeding single and cumulative thresholds
for _ in range(2):
pi = create_purchase_invoice(supplier="Test TDS Supplier3", rate=10000, do_not_save=True)
pi.apply_tds = 1
pi.append(
"taxes",
{
"category": "Total",
"charge_type": "Actual",
"account_head": "_Test Account VAT - _TC",
"cost_center": "Main - _TC",
"tax_amount": 500,
"description": "Test",
"add_deduct_tax": "Add",
},
)
pi.save()
pi.submit()
invoices.append(pi)
# Third Invoice exceeds single threshold and not exceeding cumulative threshold
pi1 = create_purchase_invoice(supplier="Test TDS Supplier3", rate=20000)
pi1.apply_tds = 1
pi1.save()
pi1.submit()
invoices.append(pi1)
# Cumulative threshold is 10,000
# Threshold calculation should be only on the third invoice
self.assertTrue(len(pi1.taxes) > 0)
self.assertEqual(pi1.taxes[0].tax_amount, 1000)
for d in reversed(invoices):
d.cancel()
def test_cumulative_threshold_tcs(self):
frappe.db.set_value(
"Customer", "Test TCS Customer", "tax_withholding_category", "Cumulative Threshold TCS"
@@ -214,6 +293,50 @@ class TestTaxWithholdingCategory(FrappeTestCase):
d.reload()
d.cancel()
@change_settings(
"Accounts Settings",
{"unlink_payment_on_cancellation_of_invoice": 1},
)
def test_tcs_on_allocated_advance_payments(self):
frappe.db.set_value(
"Customer", "Test TCS Customer", "tax_withholding_category", "Cumulative Threshold TCS"
)
vouchers = []
# create advance payment
pe = create_payment_entry(
payment_type="Receive", party_type="Customer", party="Test TCS Customer", paid_amount=30000
)
pe.paid_from = "Debtors - _TC"
pe.paid_to = "Cash - _TC"
pe.submit()
vouchers.append(pe)
si = create_sales_invoice(customer="Test TCS Customer", rate=50000)
advances = si.get_advance_entries()
si.append(
"advances",
{
"reference_type": advances[0].reference_type,
"reference_name": advances[0].reference_name,
"advance_amount": advances[0].amount,
"allocated_amount": 30000,
},
)
si.submit()
vouchers.append(si)
# assert tax collection on total invoice ,advance payment adjusted should be excluded.
tcs_charged = sum([d.base_tax_amount for d in si.taxes if d.account_head == "TCS - _TC"])
# tcs = (inv amt)50000+(adv amt)30000-(adv adj) 30000 - threshold(30000) * rate 10%
self.assertEqual(tcs_charged, 2000)
# cancel invoice and payments to avoid clashing
for d in reversed(vouchers):
d.reload()
d.cancel()
def test_tds_calculation_on_net_total(self):
frappe.db.set_value(
"Supplier", "Test TDS Supplier4", "tax_withholding_category", "Cumulative Threshold TDS"

View File

@@ -1,7 +1,5 @@
{
"actions": [],
"allow_rename": 1,
"autoname": "format:UNREC-{#####}",
"creation": "2023-08-22 10:26:34.421423",
"default_view": "List",
"doctype": "DocType",
@@ -58,11 +56,10 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2023-08-28 17:42:50.261377",
"modified": "2024-10-10 12:03:50.022444",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Unreconcile Payment",
"naming_rule": "Expression",
"owner": "Administrator",
"permissions": [
{

View File

@@ -1,6 +1,8 @@
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import json
import frappe
from frappe import _, qb
from frappe.model.document import Document
@@ -142,7 +144,7 @@ def get_linked_payments_for_doc(
@frappe.whitelist()
def create_unreconcile_doc_for_selection(selections=None):
if selections:
selections = frappe.json.loads(selections)
selections = json.loads(selections)
# assuming each row is a unique voucher
for row in selections:
unrecon = frappe.new_doc("Unreconcile Payment")

View File

@@ -179,50 +179,53 @@ def process_gl_map(gl_map, merge_entries=True, precision=None):
def distribute_gl_based_on_cost_center_allocation(gl_map, precision=None):
cost_center_allocation = get_cost_center_allocation_data(gl_map[0]["company"], gl_map[0]["posting_date"])
if not cost_center_allocation:
return gl_map
new_gl_map = []
for d in gl_map:
cost_center = d.get("cost_center")
# Validate budget against main cost center
validate_expense_against_budget(d, expense_amount=flt(d.debit, precision) - flt(d.credit, precision))
if cost_center and cost_center_allocation.get(cost_center):
for sub_cost_center, percentage in cost_center_allocation.get(cost_center, {}).items():
gle = copy.deepcopy(d)
gle.cost_center = sub_cost_center
for field in ("debit", "credit", "debit_in_account_currency", "credit_in_account_currency"):
gle[field] = flt(flt(d.get(field)) * percentage / 100, precision)
new_gl_map.append(gle)
else:
cost_center_allocation = get_cost_center_allocation_data(
gl_map[0]["company"], gl_map[0]["posting_date"], cost_center
)
if not cost_center_allocation:
new_gl_map.append(d)
continue
for sub_cost_center, percentage in cost_center_allocation:
gle = copy.deepcopy(d)
gle.cost_center = sub_cost_center
for field in ("debit", "credit", "debit_in_account_currency", "credit_in_account_currency"):
gle[field] = flt(flt(d.get(field)) * percentage / 100, precision)
new_gl_map.append(gle)
return new_gl_map
def get_cost_center_allocation_data(company, posting_date):
par = frappe.qb.DocType("Cost Center Allocation")
child = frappe.qb.DocType("Cost Center Allocation Percentage")
def get_cost_center_allocation_data(company, posting_date, cost_center):
cost_center_allocation = frappe.db.get_value(
"Cost Center Allocation",
{
"docstatus": 1,
"company": company,
"valid_from": ("<=", posting_date),
"main_cost_center": cost_center,
},
pluck="name",
order_by="valid_from desc",
)
records = (
frappe.qb.from_(par)
.inner_join(child)
.on(par.name == child.parent)
.select(par.main_cost_center, child.cost_center, child.percentage)
.where(par.docstatus == 1)
.where(par.company == company)
.where(par.valid_from <= posting_date)
.orderby(par.valid_from, order=frappe.qb.desc)
).run(as_dict=True)
if not cost_center_allocation:
return []
cc_allocation = frappe._dict()
for d in records:
cc_allocation.setdefault(d.main_cost_center, frappe._dict()).setdefault(d.cost_center, d.percentage)
records = frappe.db.get_all(
"Cost Center Allocation Percentage",
{"parent": cost_center_allocation},
["cost_center", "percentage"],
as_list=True,
)
return cc_allocation
return records
def merge_similar_entries(gl_map, precision=None):

View File

@@ -29,6 +29,12 @@ from erpnext.accounts.utils import get_fiscal_year
from erpnext.exceptions import InvalidAccountCurrency, PartyDisabled, PartyFrozen
from erpnext.utilities.regional import temporary_flag
try:
from frappe.contacts.doctype.address.address import render_address as _render_address
except ImportError:
# Older frappe versions where this function is not available
from frappe.contacts.doctype.address.address import get_address_display as _render_address
PURCHASE_TRANSACTION_TYPES = {
"Supplier Quotation",
"Purchase Order",
@@ -68,7 +74,7 @@ def get_party_details(
pos_profile=None,
):
if not party:
return {}
return frappe._dict()
if not frappe.db.exists(party_type, party):
frappe.throw(_("{0}: {1} does not exists").format(party_type, party))
return _get_party_details(
@@ -985,10 +991,4 @@ def add_party_account(party_type, party, company, account):
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)
return frappe.call(_render_address, address, check_permissions=check_permissions)

View File

@@ -49,7 +49,6 @@ def get_conditions(filters):
if filters.account_type:
conditions["account_type"] = filters.account_type
return conditions
if filters.company:
conditions["company"] = filters.company

View File

@@ -162,6 +162,11 @@ frappe.query_reports["Accounts Payable"] = {
label: __("Group by Voucher"),
fieldtype: "Check",
},
{
fieldname: "handle_employee_advances",
label: __("Handle Employee Advances"),
fieldtype: "Check",
},
],
formatter: function (value, row, column, data, default_formatter) {

View File

@@ -7,7 +7,7 @@ from erpnext.accounts.report.accounts_payable.accounts_payable import execute
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase):
class TestAccountsPayable(AccountsTestMixin, FrappeTestCase):
def setUp(self):
self.create_company()
self.create_customer()

View File

@@ -112,6 +112,26 @@ class ReceivablePayableReport:
self.build_data()
def build_voucher_dict(self, ple):
return frappe._dict(
voucher_type=ple.voucher_type,
voucher_no=ple.voucher_no,
party=ple.party,
party_account=ple.account,
posting_date=ple.posting_date,
account_currency=ple.account_currency,
remarks=ple.remarks,
invoiced=0.0,
paid=0.0,
credit_note=0.0,
outstanding=0.0,
invoiced_in_account_currency=0.0,
paid_in_account_currency=0.0,
credit_note_in_account_currency=0.0,
outstanding_in_account_currency=0.0,
cost_center=ple.cost_center,
)
def init_voucher_balance(self):
# build all keys, since we want to exclude vouchers beyond the report date
for ple in self.ple_entries:
@@ -123,23 +143,8 @@ class ReceivablePayableReport:
key = (ple.account, ple.voucher_type, ple.voucher_no, ple.party)
if key not in self.voucher_balance:
self.voucher_balance[key] = frappe._dict(
voucher_type=ple.voucher_type,
voucher_no=ple.voucher_no,
party=ple.party,
party_account=ple.account,
posting_date=ple.posting_date,
account_currency=ple.account_currency,
remarks=ple.remarks,
invoiced=0.0,
paid=0.0,
credit_note=0.0,
outstanding=0.0,
invoiced_in_account_currency=0.0,
paid_in_account_currency=0.0,
credit_note_in_account_currency=0.0,
outstanding_in_account_currency=0.0,
)
self.voucher_balance[key] = self.build_voucher_dict(ple)
self.get_invoices(ple)
if self.filters.get("group_by_party"):
@@ -207,6 +212,18 @@ class ReceivablePayableReport:
row = self.voucher_balance.get(key)
# Build and use a separate row for Employee Advances.
# This allows Payments or Journals made against Emp Advance to be processed.
if (
not row
and ple.against_voucher_type == "Employee Advance"
and self.filters.handle_employee_advances
):
_d = self.build_voucher_dict(ple)
_d.voucher_type = ple.against_voucher_type
_d.voucher_no = ple.against_voucher_no
row = self.voucher_balance[key] = _d
if not row:
# no invoice, this is an invoice / stand-alone payment / credit note
if self.filters.get("ignore_accounts"):
@@ -253,7 +270,7 @@ class ReceivablePayableReport:
row.paid -= amount
row.paid_in_account_currency -= amount_in_account_currency
if ple.cost_center:
if not row.cost_center and ple.cost_center:
row.cost_center = str(ple.cost_center)
def update_sub_total_row(self, row, party):
@@ -288,13 +305,13 @@ class ReceivablePayableReport:
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
if (abs(row.outstanding) >= 1.0 / 10**self.currency_precision) or (
abs(row.outstanding_in_account_currency) >= 1.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)
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
@@ -483,7 +500,8 @@ class ReceivablePayableReport:
from `tab{row.voucher_type}` si, `tabPayment Schedule` ps
where
si.name = ps.parent and
si.name = %s
si.name = %s and
si.is_return = 0
order by ps.paid_amount desc, due_date
""",
row.voucher_no,
@@ -986,22 +1004,29 @@ class ReceivablePayableReport:
def get_columns(self):
self.columns = []
self.add_column("Posting Date", fieldtype="Date")
self.add_column(_("Posting Date"), fieldname="posting_date", fieldtype="Date")
self.add_column(
label="Party Type",
label=_("Party Type"),
fieldname="party_type",
fieldtype="Data",
width=100,
)
self.add_column(
label="Party",
label=_("Party"),
fieldname="party",
fieldtype="Dynamic Link",
options="party_type",
width=180,
)
if self.account_type == "Receivable":
label = _("Receivable Account")
elif self.account_type == "Payable":
label = _("Payable Account")
else:
label = _("Party Account")
self.add_column(
label=self.account_type + " Account",
label=label,
fieldname="party_account",
fieldtype="Link",
options="Account",
@@ -1010,10 +1035,10 @@ class ReceivablePayableReport:
if self.party_naming_by == "Naming Series":
if self.account_type == "Payable":
label = "Supplier Name"
label = _("Supplier Name")
fieldname = "supplier_name"
else:
label = "Customer Name"
label = _("Customer Name")
fieldname = "customer_name"
self.add_column(
label=label,
@@ -1039,7 +1064,7 @@ class ReceivablePayableReport:
width=180,
)
self.add_column(label="Due Date", fieldtype="Date")
self.add_column(label=_("Due Date"), fieldname="due_date", fieldtype="Date")
if self.account_type == "Payable":
self.add_column(label=_("Bill No"), fieldname="bill_no", fieldtype="Data")

View File

@@ -53,11 +53,13 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase):
si = si.submit()
return si
def create_payment_entry(self, docname):
def create_payment_entry(self, docname, do_not_submit=False):
pe = get_payment_entry("Sales Invoice", docname, bank_account=self.cash, party_amount=40)
pe.paid_from = self.debit_to
pe.insert()
pe.submit()
if not do_not_submit:
pe.submit()
return pe
def create_credit_note(self, docname, do_not_submit=False):
credit_note = create_sales_invoice(
@@ -955,3 +957,69 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase):
self.assertEqual(
expected_data, [row.invoiced, row.outstanding, row.remaining_balance, row.future_amount]
)
def test_accounts_receivable_output_for_minor_outstanding(self):
"""
AR/AP should report miniscule outstanding of 0.01. Or else there will be slight difference with General Ledger/Trial Balance
"""
filters = {
"company": self.company,
"report_date": today(),
"range1": 30,
"range2": 60,
"range3": 90,
"range4": 120,
}
# check invoice grand total and invoiced column's value for 3 payment terms
si = self.create_sales_invoice(no_payment_schedule=True)
pe = get_payment_entry("Sales Invoice", si.name, bank_account=self.cash, party_amount=99.99)
pe.paid_from = self.debit_to
pe.save().submit()
report = execute(filters)
expected_data_after_payment = [100, 100, 99.99, 0.01]
self.assertEqual(len(report[1]), 1)
row = report[1][0]
self.assertEqual(
expected_data_after_payment,
[row.invoice_grand_total, row.invoiced, row.paid, row.outstanding],
)
def test_cost_center_on_report_output(self):
filters = {
"company": self.company,
"report_date": today(),
"range1": 30,
"range2": 60,
"range3": 90,
"range4": 120,
}
# check invoice grand total and invoiced column's value for 3 payment terms
si = self.create_sales_invoice(no_payment_schedule=True, do_not_submit=True)
si.cost_center = self.cost_center
si.save().submit()
new_cc = frappe.get_doc(
{
"doctype": "Cost Center",
"cost_center_name": "East Wing",
"parent_cost_center": self.company + " - " + self.company_abbr,
"company": self.company,
}
)
new_cc.save()
# check invoice grand total, invoiced, paid and outstanding column's value after payment
pe = self.create_payment_entry(si.name, do_not_submit=True)
pe.cost_center = new_cc.name
pe.save().submit()
report = execute(filters)
expected_data_after_payment = [si.name, si.cost_center, 60]
self.assertEqual(len(report[1]), 1)
row = report[1][0]
self.assertEqual(expected_data_after_payment, [row.voucher_no, row.cost_center, row.outstanding])

View File

@@ -7,6 +7,7 @@ from frappe import _
from frappe.utils import cint, flt
from erpnext.accounts.report.financial_statements import (
compute_growth_view_data,
get_columns,
get_data,
get_filtered_list_for_consolidated_report,
@@ -95,12 +96,15 @@ def execute(filters=None):
filters.periodicity, period_list, filters.accumulated_values, company=filters.company
)
chart = get_chart_data(filters, columns, asset, liability, equity)
chart = get_chart_data(filters, columns, asset, liability, equity, currency)
report_summary, primitive_summary = get_report_summary(
period_list, asset, liability, equity, provisional_profit_loss, currency, filters
)
if filters.get("selected_view") == "Growth":
compute_growth_view_data(data, period_list)
return columns, data, message, chart, report_summary, primitive_summary
@@ -219,7 +223,7 @@ def get_report_summary(
], (net_asset - net_liability + net_equity)
def get_chart_data(filters, columns, asset, liability, equity):
def get_chart_data(filters, columns, asset, liability, equity, currency):
labels = [d.get("label") for d in columns[2:]]
asset_data, liability_data, equity_data = [], [], []
@@ -247,4 +251,8 @@ def get_chart_data(filters, columns, asset, liability, equity):
else:
chart["type"] = "line"
chart["fieldtype"] = "Currency"
chart["options"] = "currency"
chart["currency"] = currency
return chart

View File

@@ -46,4 +46,20 @@ frappe.query_reports["Bank Reconciliation Statement"] = {
fieldtype: "Check",
},
],
formatter: function (value, row, column, data, default_formatter, filter) {
if (column.fieldname == "payment_entry" && value == __("Cheques and Deposits incorrectly cleared")) {
column.link_onclick =
"frappe.query_reports['Bank Reconciliation Statement'].open_utility_report()";
}
return default_formatter(value, row, column, data);
},
open_utility_report: function () {
frappe.route_options = {
company: frappe.query_report.get_filter_value("company"),
account: frappe.query_report.get_filter_value("account"),
report_date: frappe.query_report.get_filter_value("report_date"),
};
frappe.open_in_new_tab = true;
frappe.set_route("query-report", "Cheques and Deposits Incorrectly cleared");
},
};

View File

@@ -150,8 +150,8 @@ def get_payment_entries(filters):
select
"Payment Entry" as payment_document, name as payment_entry,
reference_no, reference_date as ref_date,
if(paid_to=%(account)s, received_amount, 0) as debit,
if(paid_from=%(account)s, paid_amount, 0) as credit,
if(paid_to=%(account)s, received_amount_after_tax, 0) as debit,
if(paid_from=%(account)s, paid_amount_after_tax, 0) as credit,
posting_date, ifnull(party,if(paid_from=%(account)s,paid_to,paid_from)) as against_account, clearance_date,
if(paid_to=%(account)s, paid_to_account_currency, paid_from_account_currency) as account_currency
from `tabPayment Entry`

View File

@@ -43,7 +43,7 @@ function get_filters() {
label: __("From Fiscal Year"),
fieldtype: "Link",
options: "Fiscal Year",
default: frappe.sys_defaults.fiscal_year,
default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
reqd: 1,
},
{
@@ -51,7 +51,7 @@ function get_filters() {
label: __("To Fiscal Year"),
fieldtype: "Link",
options: "Fiscal Year",
default: frappe.sys_defaults.fiscal_year,
default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
reqd: 1,
},
{

View File

@@ -116,7 +116,7 @@ def execute(filters=None):
)
columns = get_columns(filters.periodicity, period_list, filters.accumulated_values, filters.company)
chart = get_chart_data(columns, data)
chart = get_chart_data(columns, data, company_currency)
report_summary = get_report_summary(summary_data, company_currency)
@@ -257,7 +257,7 @@ def get_report_summary(summary_data, currency):
return report_summary
def get_chart_data(columns, data):
def get_chart_data(columns, data, currency):
labels = [d.get("label") for d in columns[2:]]
datasets = [
{
@@ -272,5 +272,7 @@ def get_chart_data(columns, data):
chart = {"data": {"labels": labels, "datasets": datasets}, "type": "bar"}
chart["fieldtype"] = "Currency"
chart["options"] = "currency"
chart["currency"] = currency
return chart

View File

@@ -0,0 +1,44 @@
// Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.query_reports["Cheques and Deposits Incorrectly cleared"] = {
filters: [
{
fieldname: "company",
label: __("Company"),
fieldtype: "Link",
options: "Company",
reqd: 1,
default: frappe.defaults.get_user_default("Company"),
},
{
fieldname: "account",
label: __("Bank Account"),
fieldtype: "Link",
options: "Account",
default: frappe.defaults.get_user_default("Company")
? locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]
: "",
reqd: 1,
get_query: function () {
var company = frappe.query_report.get_filter_value("company");
return {
query: "erpnext.controllers.queries.get_account_list",
filters: [
["Account", "account_type", "in", "Bank, Cash"],
["Account", "is_group", "=", 0],
["Account", "disabled", "=", 0],
["Account", "company", "=", company],
],
};
},
},
{
fieldname: "report_date",
label: __("Date"),
fieldtype: "Date",
default: frappe.datetime.get_today(),
reqd: 1,
},
],
};

View File

@@ -0,0 +1,29 @@
{
"add_total_row": 0,
"columns": [],
"creation": "2024-07-30 17:20:07.570971",
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 0,
"is_standard": "Yes",
"letterhead": null,
"modified": "2024-07-30 17:20:07.570971",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Cheques and Deposits Incorrectly cleared",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "Payment Entry",
"report_name": "Cheques and Deposits Incorrectly cleared",
"report_type": "Script Report",
"roles": [
{
"role": "Accounts User"
},
{
"role": "Accounts Manager"
}
]
}

View File

@@ -0,0 +1,153 @@
# Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _, qb
from frappe.query_builder import CustomFunction
from frappe.query_builder.custom import ConstantColumn
def execute(filters=None):
columns = get_columns()
data = build_data(filters)
return columns, data
def build_payment_entry_dict(row: dict) -> dict:
row_dict = frappe._dict()
row_dict.update(
{
"payment_document": row.get("doctype"),
"payment_entry": row.get("name"),
"posting_date": row.get("posting_date"),
"clearance_date": row.get("clearance_date"),
}
)
if row.get("payment_type") == "Receive" and row.get("party_type") in ["Customer", "Supplier"]:
row_dict.update(
{
"debit": row.get("amount"),
"credit": 0,
}
)
else:
row_dict.update(
{
"debit": 0,
"credit": row.get("amount"),
}
)
return row_dict
def build_journal_entry_dict(row: dict) -> dict:
row_dict = frappe._dict()
row_dict.update(
{
"payment_document": row.get("doctype"),
"payment_entry": row.get("name"),
"posting_date": row.get("posting_date"),
"clearance_date": row.get("clearance_date"),
"debit": row.get("debit_in_account_currency"),
"credit": row.get("credit_in_account_currency"),
}
)
return row_dict
def build_data(filters):
vouchers = get_amounts_not_reflected_in_system_for_bank_reconciliation_statement(filters)
data = []
for x in vouchers:
if x.doctype == "Payment Entry":
data.append(build_payment_entry_dict(x))
elif x.doctype == "Journal Entry":
data.append(build_journal_entry_dict(x))
return data
def get_amounts_not_reflected_in_system_for_bank_reconciliation_statement(filters):
je = qb.DocType("Journal Entry")
jea = qb.DocType("Journal Entry Account")
doctype_name = ConstantColumn("Journal Entry")
journals = (
qb.from_(je)
.inner_join(jea)
.on(je.name == jea.parent)
.select(
doctype_name.as_("doctype"),
je.name,
jea.debit_in_account_currency,
jea.credit_in_account_currency,
je.posting_date,
je.clearance_date,
)
.where(
je.docstatus.eq(1)
& jea.account.eq(filters.account)
& je.posting_date.gt(filters.report_date)
& je.clearance_date.lte(filters.report_date)
& (je.is_opening.isnull() | je.is_opening.eq("No"))
)
.run(as_dict=1)
)
ifelse = CustomFunction("IF", ["condition", "then", "else"])
pe = qb.DocType("Payment Entry")
doctype_name = ConstantColumn("Payment Entry")
payments = (
qb.from_(pe)
.select(
doctype_name.as_("doctype"),
pe.name,
ifelse(pe.paid_from.eq(filters.account), pe.paid_amount, pe.received_amount).as_("amount"),
pe.payment_type,
pe.party_type,
pe.posting_date,
pe.clearance_date,
)
.where(
pe.docstatus.eq(1)
& (pe.paid_from.eq(filters.account) | pe.paid_to.eq(filters.account))
& pe.posting_date.gt(filters.report_date)
& pe.clearance_date.lte(filters.report_date)
)
.run(as_dict=1)
)
return journals + payments
def get_columns():
return [
{
"fieldname": "payment_document",
"label": _("Payment Document Type"),
"fieldtype": "Data",
"width": 220,
},
{
"fieldname": "payment_entry",
"label": _("Payment Document"),
"fieldtype": "Dynamic Link",
"options": "payment_document",
"width": 220,
},
{
"fieldname": "debit",
"label": _("Debit"),
"fieldtype": "Currency",
"options": "account_currency",
"width": 120,
},
{
"fieldname": "credit",
"label": _("Credit"),
"fieldtype": "Currency",
"options": "account_currency",
"width": 120,
},
{"fieldname": "posting_date", "label": _("Posting Date"), "fieldtype": "Date", "width": 110},
{"fieldname": "clearance_date", "label": _("Clearance Date"), "fieldtype": "Date", "width": 110},
]

View File

@@ -109,7 +109,7 @@ def get_balance_sheet_data(fiscal_year, companies, columns, filters):
if total_credit:
data.append(total_credit)
report_summary = get_bs_summary(
report_summary, primitive_summary = get_bs_summary(
companies,
asset,
liability,
@@ -120,7 +120,7 @@ def get_balance_sheet_data(fiscal_year, companies, columns, filters):
True,
)
chart = get_chart_data(filters, columns, asset, liability, equity)
chart = get_chart_data(filters, columns, asset, liability, equity, company_currency)
return data, message, chart, report_summary
@@ -178,9 +178,9 @@ def get_profit_loss_data(fiscal_year, companies, columns, filters):
if net_profit_loss:
data.append(net_profit_loss)
chart = get_pl_chart_data(filters, columns, income, expense, net_profit_loss)
chart = get_pl_chart_data(filters, columns, income, expense, net_profit_loss, company_currency)
report_summary = get_pl_summary(
report_summary, primitive_summary = get_pl_summary(
companies, "", income, expense, net_profit_loss, company_currency, filters, True
)
@@ -474,10 +474,13 @@ def update_parent_account_names(accounts):
for d in accounts:
if d.account_number:
account_name = d.account_number + " - " + d.account_name
account_key = d.account_number + " - " + d.account_name
else:
account_name = d.account_name
name_to_account_map[d.name] = account_name
account_key = d.account_name
d.account_key = account_key
name_to_account_map[d.name] = account_key
for account in accounts:
if account.parent_account:
@@ -510,33 +513,26 @@ def get_subsidiary_companies(company):
def get_accounts(root_type, companies):
accounts = []
added_accounts = []
for company in companies:
for account in frappe.get_all(
"Account",
fields=[
"name",
"is_group",
"company",
"parent_account",
"lft",
"rgt",
"root_type",
"report_type",
"account_name",
"account_number",
],
filters={"company": company, "root_type": root_type},
):
if account.account_number:
account_key = account.account_number + "-" + account.account_name
else:
account_key = account.account_name
if account_key not in added_accounts:
accounts.append(account)
added_accounts.append(account_key)
accounts.extend(
frappe.get_all(
"Account",
fields=[
"name",
"is_group",
"company",
"parent_account",
"lft",
"rgt",
"root_type",
"report_type",
"account_name",
"account_number",
],
filters={"company": company, "root_type": root_type},
)
)
return accounts
@@ -775,15 +771,17 @@ def add_total_row(out, root_type, balance_must_be, companies, company_currency):
def filter_accounts(accounts, depth=10):
parent_children_map = {}
accounts_by_name = {}
for d in accounts:
if d.account_number:
account_name = d.account_number + " - " + d.account_name
else:
account_name = d.account_name
d["company_wise_opening_bal"] = defaultdict(float)
accounts_by_name[account_name] = d
added_accounts = []
parent_children_map.setdefault(d.parent_account or None, []).append(d)
for d in accounts:
if d.account_key in added_accounts:
continue
added_accounts.append(d.account_key)
d["company_wise_opening_bal"] = defaultdict(float)
accounts_by_name[d.account_key] = d
parent_children_map.setdefault(d.parent_account_name or None, []).append(d)
filtered_accounts = []
@@ -795,7 +793,7 @@ def filter_accounts(accounts, depth=10):
for child in children:
child.indent = level
filtered_accounts.append(child)
add_to_list(child.name, level + 1)
add_to_list(child.account_key, level + 1)
add_to_list(None, 0)

View File

@@ -122,21 +122,24 @@ class Deferred_Item:
"""
simulate future posting by creating dummy gl entries. starts from the last posting date.
"""
if self.service_start_date != self.service_end_date:
if add_days(self.last_entry_date, 1) < self.period_list[-1].to_date:
self.estimate_for_period_list = get_period_list(
self.filters.from_fiscal_year,
self.filters.to_fiscal_year,
add_days(self.last_entry_date, 1),
self.period_list[-1].to_date,
"Date Range",
"Monthly",
company=self.filters.company,
)
for period in self.estimate_for_period_list:
amount = self.calculate_amount(period.from_date, period.to_date)
gle = self.make_dummy_gle(period.key, period.to_date, amount)
self.gle_entries.append(gle)
if (
self.service_start_date != self.service_end_date
and add_days(self.last_entry_date, 1) < self.service_end_date
):
self.estimate_for_period_list = get_period_list(
self.filters.from_fiscal_year,
self.filters.to_fiscal_year,
add_days(self.last_entry_date, 1),
self.service_end_date,
"Date Range",
"Monthly",
company=self.filters.company,
)
for period in self.estimate_for_period_list:
amount = self.calculate_amount(period.from_date, period.to_date)
gle = self.make_dummy_gle(period.key, period.to_date, amount)
self.gle_entries.append(gle)
def calculate_item_revenue_expense_for_period(self):
"""

View File

@@ -279,3 +279,79 @@ class TestDeferredRevenueAndExpense(FrappeTestCase, AccountsTestMixin):
{"key": "aug_2021", "total": 0, "actual": 0},
]
self.assertEqual(report.period_total, expected)
@change_settings(
"Accounts Settings",
{"book_deferred_entries_based_on": "Months", "book_deferred_entries_via_journal_entry": 0},
)
def test_zero_amount(self):
self.create_item("_Test Office Desk", 0, self.warehouse, self.company)
item = frappe.get_doc("Item", self.item)
item.enable_deferred_expense = 1
item.item_defaults[0].deferred_expense_account = self.deferred_expense_account
item.no_of_months_exp = 12
item.save()
pi = make_purchase_invoice(
item=self.item,
company=self.company,
supplier=self.supplier,
is_return=False,
update_stock=False,
posting_date=frappe.utils.datetime.date(2021, 12, 30),
parent_cost_center=self.cost_center,
cost_center=self.cost_center,
do_not_save=True,
rate=3910,
price_list_rate=3910,
warehouse=self.warehouse,
qty=1,
)
pi.set_posting_time = True
pi.items[0].enable_deferred_expense = 1
pi.items[0].service_start_date = "2021-12-30"
pi.items[0].service_end_date = "2022-12-30"
pi.items[0].deferred_expense_account = self.deferred_expense_account
pi.items[0].expense_account = self.expense_account
pi.save()
pi.submit()
pda = frappe.get_doc(
doctype="Process Deferred Accounting",
posting_date=nowdate(),
start_date="2022-01-01",
end_date="2022-01-31",
type="Expense",
company=self.company,
)
pda.insert()
pda.submit()
# execute report
fiscal_year = frappe.get_doc("Fiscal Year", get_fiscal_year(date="2022-01-31"))
self.filters = frappe._dict(
{
"company": self.company,
"filter_based_on": "Date Range",
"period_start_date": "2022-01-01",
"period_end_date": "2022-01-31",
"from_fiscal_year": fiscal_year.year,
"to_fiscal_year": fiscal_year.year,
"periodicity": "Monthly",
"type": "Expense",
"with_upcoming_postings": False,
}
)
report = Deferred_Revenue_and_Expense_Report(filters=self.filters)
report.run()
# fetch the invoice from deferred invoices list
inv = [d for d in report.deferred_invoices if d.name == pi.name]
# make sure the list isn't empty
self.assertTrue(inv)
# calculate the total deferred expense for the period
inv = inv[0].calculate_invoice_revenue_expense_for_period()
deferred_exp = sum([inv[idx].actual for idx in range(len(report.period_list))])
# make sure the total deferred expense is greater than 0
self.assertLess(deferred_exp, 0)

View File

@@ -2,6 +2,7 @@
# License: GNU General Public License v3. See license.txt
import copy
import functools
import math
import re
@@ -653,3 +654,67 @@ def get_filtered_list_for_consolidated_report(filters, period_list):
filtered_summary_list.append(period)
return filtered_summary_list
def compute_growth_view_data(data, columns):
data_copy = copy.deepcopy(data)
for row_idx in range(len(data_copy)):
for column_idx in range(1, len(columns)):
previous_period_key = columns[column_idx - 1].get("key")
current_period_key = columns[column_idx].get("key")
current_period_value = data_copy[row_idx].get(current_period_key)
previous_period_value = data_copy[row_idx].get(previous_period_key)
annual_growth = 0
if current_period_value is None:
data[row_idx][current_period_key] = None
continue
if previous_period_value == 0 and current_period_value > 0:
annual_growth = 1
elif previous_period_value > 0:
annual_growth = (current_period_value - previous_period_value) / previous_period_value
growth_percent = round(annual_growth * 100, 2)
data[row_idx][current_period_key] = growth_percent
def compute_margin_view_data(data, columns, accumulated_values):
if not columns:
return
if not accumulated_values:
columns.append({"key": "total"})
data_copy = copy.deepcopy(data)
base_row = None
for row in data_copy:
if row.get("account_name") == _("Income"):
base_row = row
break
if not base_row:
return
for row_idx in range(len(data_copy)):
# Taking the total income from each column (for all the financial years) as the base (100%)
row = data_copy[row_idx]
if not row:
continue
for column in columns:
curr_period = column.get("key")
base_value = base_row[curr_period]
curr_value = row[curr_period]
if curr_value is None or base_value <= 0:
data[row_idx][curr_period] = None
continue
margin_percent = round((curr_value / base_value) * 100, 2)
data[row_idx][curr_period] = margin_percent

View File

@@ -199,8 +199,7 @@ class General_Payment_Ledger_Comparison:
dict(
label=_("Voucher Type"),
fieldname="voucher_type",
fieldtype="Link",
options="DocType",
fieldtype="Data",
width="100",
)
)
@@ -219,8 +218,7 @@ class General_Payment_Ledger_Comparison:
dict(
label=_("Party Type"),
fieldname="party_type",
fieldtype="Link",
options="DocType",
fieldtype="Data",
width="100",
)
)

View File

@@ -199,6 +199,11 @@ frappe.query_reports["General Ledger"] = {
label: __("Ignore Exchange Rate Revaluation Journals"),
fieldtype: "Check",
},
{
fieldname: "ignore_cr_dr_notes",
label: __("Ignore System Generated Credit / Debit Notes"),
fieldtype: "Check",
},
],
};

View File

@@ -234,6 +234,23 @@ def get_conditions(filters):
if err_journals:
filters.update({"voucher_no_not_in": [x[0] for x in err_journals]})
if filters.get("ignore_cr_dr_notes"):
system_generated_cr_dr_journals = frappe.db.get_all(
"Journal Entry",
filters={
"company": filters.get("company"),
"docstatus": 1,
"voucher_type": ("in", ["Credit Note", "Debit Note"]),
"is_system_generated": 1,
},
as_list=True,
)
if system_generated_cr_dr_journals:
vouchers_to_ignore = (filters.get("voucher_no_not_in") or []) + [
x[0] for x in system_generated_cr_dr_journals
]
filters.update({"voucher_no_not_in": vouchers_to_ignore})
if filters.get("voucher_no_not_in"):
conditions.append("voucher_no not in %(voucher_no_not_in)s")
@@ -320,9 +337,17 @@ def get_accounts_with_children(accounts):
return list(set(all_accounts)) if all_accounts else None
def set_bill_no(gl_entries):
inv_details = get_supplier_invoice_details()
for gl in gl_entries:
gl["bill_no"] = inv_details.get(gl.get("against_voucher"), "")
def get_data_with_opening_closing(filters, account_details, accounting_dimensions, gl_entries):
data = []
set_bill_no(gl_entries)
gle_map = initialize_gle_map(gl_entries, filters)
totals, entries = get_accountwise_gle(filters, accounting_dimensions, gl_entries, gle_map)
@@ -496,7 +521,6 @@ def get_account_type_map(company):
def get_result_as_list(data, filters):
balance, _balance_in_account_currency = 0, 0
inv_details = get_supplier_invoice_details()
for d in data:
if not d.get("posting_date"):
@@ -506,7 +530,6 @@ def get_result_as_list(data, filters):
d["balance"] = balance
d["account_currency"] = filters.account_currency
d["bill_no"] = inv_details.get(d.get("against_voucher"), "")
return data

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