Compare commits

..

1343 Commits

Author SHA1 Message Date
Frappe PR Bot
ad45063c76 chore(release): Bumped to Version 15.71.1
## [15.71.1](https://github.com/frappe/erpnext/compare/v15.71.0...v15.71.1) (2025-07-24)

### Bug Fixes

* call hooks after gle & sle rename ([#48706](https://github.com/frappe/erpnext/issues/48706)) ([3d7185f](3d7185fad7))
2025-07-24 01:39:52 +00:00
ruthra kumar
c3188ff9a3 Merge pull request #48762 from frappe/mergify/bp/version-15/pr-48706
fix: call hooks on gle and sle rename (backport #48706)
2025-07-24 07:08:24 +05:30
Kitti U. @ Ecosoft
3d7185fad7 fix: call hooks after gle & sle rename (#48706)
(cherry picked from commit ed79adebc4)
2025-07-24 06:34:51 +05:30
Frappe PR Bot
32029f4dca chore(release): Bumped to Version 15.71.0
# [15.71.0](https://github.com/frappe/erpnext/compare/v15.70.2...v15.71.0) (2025-07-23)

### Bug Fixes

* add alias for order by field ([4bef3cc](4bef3cc92f))
* add validation for account key ([90fa7db](90fa7db13c))
* added serial no condition ([467fe1d](467fe1d72f))
* carry forward the delivered_by_supplier check to PO ([6fddf4c](6fddf4c5aa))
* do not consider cancelled SLEs in report ([32915cf](32915cf2b7))
* fetch sales invoice based on mode_of_payment in item-wise sales register ([d04c256](d04c256b73))
* job card linter error (backport [#47561](https://github.com/frappe/erpnext/issues/47561)) ([#48695](https://github.com/frappe/erpnext/issues/48695)) ([a139cd4](a139cd4b5e))
* performance issue while submitting the purchase invoice ([b9e6f52](b9e6f524e5))
* **period closing voucher:** closing account head debit and debit in account currency should be equal ([98bd880](98bd880c73))
* pos customer selection on new order ([#48623](https://github.com/frappe/erpnext/issues/48623)) ([a46cafe](a46cafe652))
* precision issue for Sales Incoming Rate ([3e53660](3e53660bba))
* **production plan:** add company filter to sub assembly warehouse ([e683703](e68370359f))
* resolve bundle item into line item if againt default supplier checked ([725f9ea](725f9ea012))
* resolve sql syntax on accounting dimension ([96a1444](96a1444e92))
* sales partner in pos invoice ([#48670](https://github.com/frappe/erpnext/issues/48670)) ([65efc7e](65efc7e950)), closes [#48667](https://github.com/frappe/erpnext/issues/48667) [#48669](https://github.com/frappe/erpnext/issues/48669)
* set delivery date if missing ([8f23ca5](8f23ca5c6b))
* show amount for exchange gain or loss account ([38b223e](38b223e732))
* stand-alone credit note gl entries ([93c2a67](93c2a67930))
* **transaction:** recalculate tax and total when quantity changes (backport [#48565](https://github.com/frappe/erpnext/issues/48565)) ([#48625](https://github.com/frappe/erpnext/issues/48625)) ([2b1fdba](2b1fdba7fd))
* update outstanding amount on payment reconcillation ([0d496bb](0d496bb05f))
* view ledger button of company on chart of accounts (backport [#48677](https://github.com/frappe/erpnext/issues/48677)) ([#48678](https://github.com/frappe/erpnext/issues/48678)) ([56f5ec9](56f5ec961f))

### Features

* consider process less when calculating pending qty in work order ([2b42848](2b42848376))

### Reverts

* do not set pay_to_recd_from to None ([ab79e5d](ab79e5d946))
2025-07-23 02:54:26 +00:00
ruthra kumar
f25aff7b97 Merge pull request #48745 from frappe/version-15-hotfix
chore: release v15
2025-07-23 08:23:03 +05:30
ruthra kumar
3825490f0d Merge pull request #48752 from frappe/mergify/bp/version-15-hotfix/pr-48650
fix: update outstanding amount on payment reconcillation (backport #48650)
2025-07-23 07:24:53 +05:30
ruthra kumar
0a1b815546 Merge pull request #48751 from frappe/mergify/bp/version-15-hotfix/pr-48732
fix: resolve sql syntax on accounting dimension (backport #48732)
2025-07-23 07:24:18 +05:30
ruthra kumar
3a94c6c86c Merge pull request #48747 from frappe/mergify/bp/version-15-hotfix/pr-48733
fix: add alias for order by field (backport #48733)
2025-07-23 06:53:15 +05:30
ravibharathi656
0d496bb05f fix: update outstanding amount on payment reconcillation
(cherry picked from commit 478766c600)
2025-07-23 01:23:13 +00:00
l0gesh29
96a1444e92 fix: resolve sql syntax on accounting dimension
(cherry picked from commit 1662b7c311)
2025-07-23 01:15:13 +00:00
ruthra kumar
f9d8f510a0 Merge pull request #48725 from frappe/mergify/bp/version-15-hotfix/pr-48671
revert: do not set pay_to_recd_from to None (backport #48671)
2025-07-22 17:57:46 +05:30
ruthra kumar
35bc733d28 Merge pull request #48726 from frappe/mergify/bp/version-15-hotfix/pr-48690
fix: set delivery date if missing (backport #48690)
2025-07-22 17:56:10 +05:30
l0gesh29
4bef3cc92f fix: add alias for order by field
(cherry picked from commit feaf39a812)
2025-07-22 12:25:17 +00:00
ruthra kumar
d95306fd60 Merge pull request #48741 from frappe/mergify/bp/version-15-hotfix/pr-48665
fix: show amount for exchange gain or loss account (backport #48665)
2025-07-22 12:55:57 +05:30
l0gesh29
90fa7db13c fix: add validation for account key
(cherry picked from commit b6da350c20)
2025-07-22 06:44:06 +00:00
l0gesh29
38b223e732 fix: show amount for exchange gain or loss account
(cherry picked from commit 4f90f50eb2)
2025-07-22 06:44:06 +00:00
rohitwaghchaure
526c1e7c9a Merge pull request #48727 from frappe/mergify/bp/version-15-hotfix/pr-48704
fix(production plan): add company filter to sub assembly warehouse (backport #48704)
2025-07-21 20:04:42 +05:30
ravibharathi656
e68370359f fix(production plan): add company filter to sub assembly warehouse
(cherry picked from commit 1728a95111)
2025-07-21 14:27:40 +00:00
ravibharathi656
8f23ca5c6b fix: set delivery date if missing
(cherry picked from commit cf6913891a)

# Conflicts:
#	erpnext/selling/doctype/sales_order/sales_order.py
2025-07-21 19:51:02 +05:30
ravibharathi656
e3ccdbb20b test: add test for pay_to_recd_from
(cherry picked from commit 7e12332ea5)
2025-07-21 14:10:08 +00:00
ravibharathi656
ab79e5d946 revert: do not set pay_to_recd_from to None
(cherry picked from commit 03d6550db3)
2025-07-21 14:10:08 +00:00
Mihir Kandoi
b607448fd8 Merge pull request #48699 from frappe/mergify/bp/version-15-hotfix/pr-48695 2025-07-18 21:50:00 +05:30
mergify[bot]
a139cd4b5e fix: job card linter error (backport #47561) (#48695)
* fix: job card linter error (#47561)

(cherry picked from commit 4174269091)

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

* chore: resolve conflicts

---------

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
(cherry picked from commit 4794e7acff)
2025-07-18 16:01:34 +00:00
Mihir Kandoi
8e91e6ac2c Merge pull request #48698 from frappe/revert-48695-mergify/bp/version-15-hotfix/pr-47561
Revert "fix: job card linter error (backport #47561)"
2025-07-18 21:27:35 +05:30
Mihir Kandoi
9501149bd8 Revert "fix: job card linter error (backport #47561) (#48695)"
This reverts commit 4794e7acff.
2025-07-18 21:26:28 +05:30
mergify[bot]
4794e7acff fix: job card linter error (backport #47561) (#48695)
* fix: job card linter error (#47561)

(cherry picked from commit 4174269091)

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

* chore: resolve conflicts

---------

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-07-18 21:26:21 +05:30
Mihir Kandoi
969c3a2b4d Merge pull request #48679 from frappe/mergify/bp/version-15-hotfix/pr-48631
feat: consider process less when calculating pending qty in work order (backport #48631)
2025-07-18 16:04:14 +05:30
Mihir Kandoi
2b42848376 feat: consider process less when calculating pending qty in work order
(cherry picked from commit 74c4ca68e5)
2025-07-18 10:24:04 +00:00
mergify[bot]
56f5ec961f fix: view ledger button of company on chart of accounts (backport #48677) (#48678)
fix: view ledger button of company on chart of accounts

(cherry picked from commit 98eb115746)

Co-authored-by: diptanilsaha <diptanil@frappe.io>
2025-07-18 15:48:39 +05:30
Diptanil Saha
65efc7e950 fix: sales partner in pos invoice (#48670)
* Merge pull request #48667 from diptanilsaha/fix_pos_sales_partner

fix: sales partner on pos invoice

* fix: remove incorrect report conditions and unset sales partner on consolidated sales invoice (#48669)

* fix: undo query changes for sales partner related reports

* fix: patch to remove sales partner from consolidated sales invoice
2025-07-18 11:09:32 +05:30
Frappe PR Bot
196c3fc656 chore(release): Bumped to Version 15.70.2
## [15.70.2](https://github.com/frappe/erpnext/compare/v15.70.1...v15.70.2) (2025-07-17)

### Bug Fixes

* stand-alone credit note gl entries ([84cf5ad](84cf5ad601))
2025-07-17 11:26:04 +00:00
rohitwaghchaure
1759e02c35 Merge pull request #48661 from frappe/mergify/bp/version-15/pr-48652
fix: stand-alone credit note gl entries (backport #48616) (backport #48652)
2025-07-17 16:54:50 +05:30
rohitwaghchaure
b83535bc31 Merge pull request #48658 from frappe/mergify/bp/version-15-hotfix/pr-48655
fix: precision issue for Sales Incoming Rate (backport #48655)
2025-07-17 16:23:35 +05:30
Rohit Waghchaure
84cf5ad601 fix: stand-alone credit note gl entries
(cherry picked from commit f3d6a64156)
(cherry picked from commit 93c2a67930)
2025-07-17 10:45:16 +00:00
Rohit Waghchaure
3e53660bba fix: precision issue for Sales Incoming Rate
(cherry picked from commit 7b99275ceb)
2025-07-17 10:05:43 +00:00
rohitwaghchaure
904cecfa91 Merge pull request #48652 from frappe/mergify/bp/version-15-hotfix/pr-48616
fix: stand-alone credit note gl entries (backport #48616)
2025-07-17 15:34:14 +05:30
Rohit Waghchaure
93c2a67930 fix: stand-alone credit note gl entries
(cherry picked from commit f3d6a64156)
2025-07-17 08:29:20 +00:00
Mihir Kandoi
179444f51e Merge pull request #48646 from frappe/mergify/bp/version-15-hotfix/pr-48645
fix: do not consider cancelled SLEs in report (backport #48645)
2025-07-17 12:01:31 +05:30
Mihir Kandoi
32915cf2b7 fix: do not consider cancelled SLEs in report
(cherry picked from commit 71578cb2ef)
2025-07-17 06:09:41 +00:00
Frappe PR Bot
83ab16b161 chore(release): Bumped to Version 15.70.1
## [15.70.1](https://github.com/frappe/erpnext/compare/v15.70.0...v15.70.1) (2025-07-16)

### Bug Fixes

* **period closing voucher:** closing account head debit and debit in account currency should be equal ([c554e2c](c554e2cce7))
2025-07-16 15:12:00 +00:00
ruthra kumar
8e16da08d0 Merge pull request #48641 from frappe/mergify/bp/version-15/pr-48612
fix(period closing voucher): closing account head debit and debit in account currency should be equal (backport #48612)
2025-07-16 20:40:46 +05:30
ruthra kumar
e8be903ed9 Merge pull request #48639 from frappe/mergify/bp/version-15-hotfix/pr-48612
fix(period closing voucher): closing account head debit and debit in account currency should be equal (backport #48612)
2025-07-16 20:31:21 +05:30
venkat102
c554e2cce7 fix(period closing voucher): closing account head debit and debit in account currency should be equal
(cherry picked from commit d6fd613272)
2025-07-16 14:46:26 +00:00
venkat102
98bd880c73 fix(period closing voucher): closing account head debit and debit in account currency should be equal
(cherry picked from commit d6fd613272)
2025-07-16 14:44:15 +00:00
rohitwaghchaure
7c2b32fb74 Merge pull request #48635 from frappe/mergify/bp/version-15-hotfix/pr-48633
fix: performance issue while submitting the purchase invoice (backport #48633)
2025-07-16 17:10:35 +05:30
Rohit Waghchaure
b9e6f524e5 fix: performance issue while submitting the purchase invoice
(cherry picked from commit 47979871de)
2025-07-16 11:16:36 +00:00
Khushi Rawat
7d686abe37 Merge pull request #48603 from frappe/mergify/bp/version-15-hotfix/pr-48360
fix: fetch sales invoice based on mode_of_payment in item-wise sales register (backport #48360)
2025-07-16 12:28:10 +05:30
mergify[bot]
2b1fdba7fd fix(transaction): recalculate tax and total when quantity changes (backport #48565) (#48625)
fix(transaction): recalculate tax and total when quantity changes

(cherry picked from commit ac7b6c6a3d)

Co-authored-by: Bhavan23 <bhavansathru.it@gmail.com>
2025-07-16 12:09:58 +05:30
Diptanil Saha
a46cafe652 fix: pos customer selection on new order (#48623) 2025-07-16 11:08:29 +05:30
Diptanil Saha
6b96a26462 Merge pull request #48614 from diptanilsaha/backport_48411
fix: employee search based on the fields mentioned in the employee doctype search fields (backport #48411)
2025-07-15 18:51:51 +05:30
rohitwaghchaure
01ed30ec01 Merge pull request #48599 from frappe/mergify/bp/version-15-hotfix/pr-48408
fix: resolve bundle item into line item if againt default supplier ch… (backport #48408)
2025-07-15 18:41:35 +05:30
rohitwaghchaure
34d4c32dfd Merge pull request #48613 from frappe/mergify/bp/version-15-hotfix/pr-48610
fix: added serial no condition (backport #48610)
2025-07-15 18:35:16 +05:30
Frappe PR Bot
b35f5aca91 chore(release): Bumped to Version 15.70.0
# [15.70.0](https://github.com/frappe/erpnext/compare/v15.69.2...v15.70.0) (2025-07-15)

### Bug Fixes

* employee_exit_translatability ([c894b18](c894b18165))
* **Employee:** add context to status in List View (backport [#48576](https://github.com/frappe/erpnext/issues/48576)) ([#48577](https://github.com/frappe/erpnext/issues/48577)) ([0e67487](0e67487508))
* error in available serial no report is no serial no present in company ([f1ff5a3](f1ff5a39ae))
* fetch item tax template after setting `base_net_rate` ([b5c4f61](b5c4f61fef))
* field name of price_list in material request ([ee6ef03](ee6ef03e24))
* fix party account field access ([54275db](54275dbe38))
* gross margin not set in project on submission of stock entry ([81e244b](81e244be55))
* handle cases where distributed discount amount is not set ([78df526](78df52606f))
* incorrect if condition ([a195152](a195152cc8))
* incorrect last sle for no batch wise valuation ([f2af2fe](f2af2fe63b))
* incorrect stock reco sle ([1322cc1](1322cc1378))
* incorrect test ([c57ca1a](c57ca1ae29))
* indicator in material_request_list.js ([4eb9f73](4eb9f73a52))
* invalid comparison error in sabb.py ([7ac5463](7ac546333a))
* make labels in serial_batch_prompt translatable ([c20a5b0](c20a5b01b4))
* missing parameter in precision function ([f80ad4e](f80ad4ee58))
* no attribute error in old subcontracting flow ([5fce819](5fce8191f9))
* pos adding item multiple times on item group filter ([3a70b5d](3a70b5d7fc))
* prevent creation of root accounts in account tree view ([817bcc7](817bcc78a0))
* prevent unnecessary db.commit ([00d39eb](00d39eb208))
* prevent unnecessary db.commit for contact insert [Linters] ([5cfeb29](5cfeb2978b))
* resolve sql error on dimension-wise accounts balance report (backport [#48477](https://github.com/frappe/erpnext/issues/48477)) ([#48478](https://github.com/frappe/erpnext/issues/48478)) ([243b533](243b533150))
* set value after depreciation when creating test asset ([4383d29](4383d29d7b))
* sort available batches based on expiry when merging SLEs with SABB and those without (backport [#48471](https://github.com/frappe/erpnext/issues/48471)) ([#48473](https://github.com/frappe/erpnext/issues/48473)) ([7a4c8d8](7a4c8d81e2))
* split and set value after depreciation ([3488ba0](3488ba05eb))
* stock settings save issue ([a5c49d1](a5c49d1e08))
* system was allowing credit notes with serial numbers for any customer ([4b6444e](4b6444e93b))
* updated test ([f35fd98](f35fd9842e))
* use `flt` value of bin qty ([fc8d451](fc8d451c55))
* use planned_qty instead of pending_qty to check if WO should be created against PP ([89660c9](89660c9070))

### Features

* add calculate_ageing_with option in summary reports ([72e154f](72e154fbb7))
* batch rate (valuation) in Batch-Wise Balance History report ([facd202](facd2027c3))
* **BOM:** improve tree display with item_name and qty (backport [#48176](https://github.com/frappe/erpnext/issues/48176)) ([#48494](https://github.com/frappe/erpnext/issues/48494)) ([fdd79c7](fdd79c7677))
* parent item group support in Stock Projected Qty report ([db525c2](db525c2538))
* update the modified date of the SLE after reposting ([8c77ea1](8c77ea16cf))

### Performance Improvements

* optimize code for subcontracting ([9aef305](9aef3058a6))
* use `cached_doc` for Account Settings ([f1cdd76](f1cdd76fc1))
2025-07-15 12:52:04 +00:00
ruthra kumar
e101849fb2 Merge pull request #48602 from frappe/version-15-hotfix
chore: release v15
2025-07-15 18:20:37 +05:30
rohitwaghchaure
873e0a4219 chore: fix conflicts 2025-07-15 18:05:31 +05:30
Rohit Waghchaure
467fe1d72f fix: added serial no condition
(cherry picked from commit bb7ddd11f1)
2025-07-15 12:35:27 +00:00
Sagar Vora
6b68a50cc4 Merge pull request #48608 from frappe/mergify/bp/version-15-hotfix/pr-48607
fix: fix party account field access (backport #48607)
2025-07-15 11:28:24 +00:00
ljain112
54275dbe38 fix: fix party account field access
(cherry picked from commit 0da8ed2daa)
2025-07-15 11:25:17 +00:00
rohitwaghchaure
9070c4302d Merge pull request #48598 from frappe/mergify/bp/version-15-hotfix/pr-48595
fix: system was allowing credit notes with serial numbers for any customer (backport #48595)
2025-07-15 16:35:29 +05:30
Khushi Rawat
47878758fc Merge pull request #48589 from khushi8112/update-value-after-depreciation-when-asset-splitting
fix: update value after depreciation when asset splitting
2025-07-15 15:54:08 +05:30
ravibharathi656
d04c256b73 fix: fetch sales invoice based on mode_of_payment in item-wise sales register
(cherry picked from commit 39cd7a29df)
2025-07-15 10:21:05 +00:00
khushi8112
c57ca1ae29 fix: incorrect test 2025-07-15 15:36:13 +05:30
ruthra kumar
0a9f45aacf Merge pull request #48600 from frappe/mergify/bp/version-15-hotfix/pr-48535
fix: handle cases where distributed discount amount is not set (backport #48535)
2025-07-15 15:34:45 +05:30
ljain112
78df52606f fix: handle cases where distributed discount amount is not set
(cherry picked from commit 816b84be02)
2025-07-15 09:38:01 +00:00
l0gesh29
6fddf4c5aa fix: carry forward the delivered_by_supplier check to PO
(cherry picked from commit f3460ec840)

# Conflicts:
#	erpnext/stock/doctype/packed_item/packed_item.json
2025-07-15 09:37:02 +00:00
l0gesh29
725f9ea012 fix: resolve bundle item into line item if againt default supplier checked
(cherry picked from commit ec07549d5e)
2025-07-15 09:37:02 +00:00
rohitwaghchaure
3100099cfa chore: fix conflicts 2025-07-15 15:04:18 +05:30
rohitwaghchaure
9aeb08f968 chore: fix conflicts 2025-07-15 15:03:41 +05:30
Rohit Waghchaure
4b6444e93b fix: system was allowing credit notes with serial numbers for any customer
(cherry picked from commit e073075834)

# Conflicts:
#	erpnext/stock/doctype/delivery_note/delivery_note.py
#	erpnext/stock/doctype/serial_no/serial_no.json
2025-07-15 09:28:35 +00:00
rohitwaghchaure
0151733a25 Merge pull request #48596 from frappe/mergify/bp/version-15-hotfix/pr-48588
perf: optimize code for subcontracting (backport #48588)
2025-07-15 14:55:57 +05:30
khushi8112
4383d29d7b fix: set value after depreciation when creating test asset 2025-07-15 14:34:00 +05:30
Mihir Kandoi
9aef3058a6 perf: optimize code for subcontracting
(cherry picked from commit bc6f69ad54)
2025-07-15 08:45:36 +00:00
khushi8112
68162f79a1 chore: run pre-commit 2025-07-15 13:40:00 +05:30
khushi8112
f35fd9842e fix: updated test 2025-07-15 13:30:35 +05:30
ruthra kumar
ba63f27e3c Merge pull request #48587 from frappe/mergify/bp/version-15-hotfix/pr-48582
fix: make labels in serial_batch_prompt translatable (backport #48582)
2025-07-15 12:23:51 +05:30
khushi8112
3488ba05eb fix: split and set value after depreciation 2025-07-15 12:22:50 +05:30
barredterra
c20a5b01b4 fix: make labels in serial_batch_prompt translatable
(cherry picked from commit 8757800888)
2025-07-15 06:25:37 +00:00
ruthra kumar
c20c9031f4 Merge pull request #48574 from frappe/mergify/bp/version-15-hotfix/pr-47892
refactor: use sql for building voucher balance in Receivable report (backport #47892)
2025-07-15 07:20:37 +05:30
Mihir Kandoi
16cb147d86 Merge pull request #48569 from frappe/mergify/bp/version-15-hotfix/pr-48542
fix: field name of price_list in material request (backport #48542)
2025-07-14 21:31:54 +05:30
mergify[bot]
0e67487508 fix(Employee): add context to status in List View (backport #48576) (#48577)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
fix(Employee): add context to status in List View (#48576)
2025-07-14 15:42:30 +02:00
rohitwaghchaure
2a8b8aa71d Merge pull request #48570 from frappe/mergify/bp/version-15-hotfix/pr-48568
fix: recalculate qty issue for stock reco (backport #48568)
2025-07-14 18:16:48 +05:30
ruthra kumar
3b38c6708c chore: rename method
(cherry picked from commit fc8ca7d82c)
2025-07-14 12:33:08 +00:00
ruthra kumar
72b9684742 refactor: build and pass match conditions as qb criterion
(cherry picked from commit 7efeed54de)
2025-07-14 12:33:08 +00:00
ruthra kumar
1d18a3b1a3 chore: drop unused utility method
(cherry picked from commit 52c0df24e3)
2025-07-14 12:33:08 +00:00
ruthra kumar
0bf5d3dae3 refactor: dynamic DB field types
(cherry picked from commit 9d0ebe3427)
2025-07-14 12:33:07 +00:00
ruthra kumar
d9b36ea37c refactor: better variable name
(cherry picked from commit 1a90c0d031)
2025-07-14 12:33:07 +00:00
ruthra kumar
2d2ca049fa refactor: prefix-ed names for easy distinction
(cherry picked from commit c5e35cc330)
2025-07-14 12:33:07 +00:00
ruthra kumar
1afb27231c refactor: utility to drop existing procedures and include cost center
(cherry picked from commit da32bb5f51)
2025-07-14 12:33:06 +00:00
ruthra kumar
a173c77859 refactor: order by posting date
(cherry picked from commit 7b7440d44a)
2025-07-14 12:33:06 +00:00
ruthra kumar
5d0d0c3102 refactor: call procedures based on config
(cherry picked from commit e90c6a33bd)
2025-07-14 12:33:06 +00:00
ruthra kumar
92d58a4e4c refactor: introduce sql option for data fetch
(cherry picked from commit 8cf8f6abad)
2025-07-14 12:33:05 +00:00
ruthra kumar
fee646fbe2 refactor: better readability
(cherry picked from commit 097e74979f)
2025-07-14 12:33:05 +00:00
ruthra kumar
c6d82b241e refactor: using sql procedures for AR report
- dynamic filters are passed

(cherry picked from commit e5920c57aa)
2025-07-14 12:33:04 +00:00
Mihir Kandoi
e3f7915c38 Merge pull request #48571 from frappe/mergify/bp/version-15-hotfix/pr-48526
fix: gross margin not set in project on submission of stock entry (backport #48526)
2025-07-14 17:31:46 +05:30
Mihir Kandoi
c39993a3ba chore: resolve conflicts 2025-07-14 17:22:00 +05:30
Mihir Kandoi
d8212d98ca chore: resolve conflicts 2025-07-14 17:20:28 +05:30
Mihir Kandoi
e3ba4320d6 chore: resolve conflicts 2025-07-14 17:19:40 +05:30
Mihir Kandoi
81e244be55 fix: gross margin not set in project on submission of stock entry
(cherry picked from commit ec578ba231)
2025-07-14 11:43:16 +00:00
Mihir Kandoi
a195152cc8 fix: incorrect if condition
(cherry picked from commit 668574e4f0)
2025-07-14 11:38:10 +00:00
Mihir Kandoi
1322cc1378 fix: incorrect stock reco sle
(cherry picked from commit 597d5aff02)
2025-07-14 11:38:09 +00:00
Mihir Kandoi
ee6ef03e24 fix: field name of price_list in material request
(cherry picked from commit adb9a6bc15)

# Conflicts:
#	erpnext/patches.txt
#	erpnext/stock/doctype/material_request/material_request.py
#	erpnext/stock/doctype/packed_item/packed_item.py
2025-07-14 11:14:53 +00:00
ruthra kumar
6e10b53e24 Merge pull request #48567 from frappe/mergify/bp/version-15-hotfix/pr-48321
fix: fetch item tax template after setting `base_net_rate` (backport #48321)
2025-07-14 15:06:32 +05:30
ljain112
b5c4f61fef fix: fetch item tax template after setting base_net_rate
(cherry picked from commit db654d5e59)
2025-07-14 09:32:56 +00:00
ruthra kumar
9750eba9db Merge pull request #48566 from frappe/mergify/bp/version-15-hotfix/pr-48435
fix: prevent creation of root accounts in account tree view (backport #48435)
2025-07-14 14:51:17 +05:30
ljain112
817bcc78a0 fix: prevent creation of root accounts in account tree view
(cherry picked from commit 3600f2f91b)
2025-07-14 09:15:45 +00:00
ruthra kumar
69f2d751a2 Merge pull request #48562 from frappe/mergify/bp/version-15-hotfix/pr-48540
feat: add calculate_ageing_with option in summary reports (backport #48540)
2025-07-14 11:42:13 +05:30
ruthra kumar
9287e9a2ca Merge pull request #48556 from frappe/mergify/bp/version-15-hotfix/pr-48550
chore: fix flacky test and remove redundant code (backport #48550)
2025-07-14 11:41:36 +05:30
l0gesh29
72e154fbb7 feat: add calculate_ageing_with option in summary reports
(cherry picked from commit a3834eef46)
2025-07-14 06:08:52 +00:00
Sagar Vora
d5faae3e7c Merge pull request #48081 from frappe/mergify/bp/version-15-hotfix/pr-48048
fix: use `flt` value of bin qty (backport #48048)
2025-07-14 05:17:07 +00:00
Sagar Vora
f4a79bb760 Merge pull request #48537 from frappe/mergify/bp/version-15-hotfix/pr-48495 2025-07-14 05:15:01 +00:00
ljain112
153df4eca5 chore: resolve conflicts 2025-07-13 18:16:49 +05:30
ljain112
8f6cd40c7b chore: return doc if item already exists for test
(cherry picked from commit e6b9e82b2f)
2025-07-13 11:51:32 +00:00
ljain112
567f7b4d71 chore: fix flacky test and remove redundant code
(cherry picked from commit de8c3ba968)

# Conflicts:
#	erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py
2025-07-13 11:51:32 +00:00
Frappe PR Bot
cad5f39b7f chore(release): Bumped to Version 15.69.2
## [15.69.2](https://github.com/frappe/erpnext/compare/v15.69.1...v15.69.2) (2025-07-11)

### Bug Fixes

* incorrect last sle for no batch wise valuation ([35451fd](35451fd298))
2025-07-11 09:55:30 +00:00
rohitwaghchaure
1e2845c277 Merge pull request #48527 from frappe/mergify/bp/version-15/pr-48525
fix: incorrect last sle for no batch wise valuation (backport #48512) (backport #48525)
2025-07-11 15:23:58 +05:30
ljain112
f1cdd76fc1 perf: use cached_doc for Account Settings
(cherry picked from commit 751f3abd95)
2025-07-11 09:15:52 +00:00
Asmita Hase
715f4025cc Merge pull request #48531 from frappe/mergify/bp/version-15-hotfix/pr-48395
fix: employee_exit_translatability (backport #48395)
2025-07-11 12:37:17 +05:30
mahsem
c894b18165 fix: employee_exit_translatability
(cherry picked from commit 80d6779210)
2025-07-11 06:33:22 +00:00
Rohit Waghchaure
35451fd298 fix: incorrect last sle for no batch wise valuation
(cherry picked from commit 93d3eb662f)
(cherry picked from commit f2af2fe63b)
2025-07-11 05:49:11 +00:00
rohitwaghchaure
43e4c00e1c Merge pull request #48525 from frappe/mergify/bp/version-15-hotfix/pr-48512
fix: incorrect last sle for no batch wise valuation (backport #48512)
2025-07-11 11:18:09 +05:30
Rohit Waghchaure
f2af2fe63b fix: incorrect last sle for no batch wise valuation
(cherry picked from commit 93d3eb662f)
2025-07-11 05:33:01 +00:00
Mihir Kandoi
76fe861281 Merge pull request #48516 from frappe/mergify/bp/version-15-hotfix/pr-48514
fix: no attribute error in old subcontracting flow (backport #48514)
2025-07-11 10:23:39 +05:30
Mihir Kandoi
39e2c87955 Merge pull request #48515 from frappe/mergify/bp/version-15-hotfix/pr-48513
fix: error in available serial no report if no serial no present in company (backport #48513)
2025-07-11 10:23:10 +05:30
Mihir Kandoi
5fce8191f9 fix: no attribute error in old subcontracting flow
(cherry picked from commit 51751a7a05)
2025-07-10 17:33:10 +00:00
Mihir Kandoi
f1ff5a39ae fix: error in available serial no report is no serial no present in company
(cherry picked from commit 0ae60b8b61)
2025-07-10 17:21:58 +00:00
Mihir Kandoi
f70ce62f2a Merge pull request #48504 from frappe/mergify/bp/version-15-hotfix/pr-48503
fix: invalid comparison error in sabb.py (backport #48503)
2025-07-10 21:36:56 +05:30
Mihir Kandoi
36af50b2ce Merge pull request #48511 from frappe/mergify/bp/version-15-hotfix/pr-48510
fix: missing parameter in precision function (backport #48510)
2025-07-10 21:36:08 +05:30
Mihir Kandoi
f80ad4ee58 fix: missing parameter in precision function
(cherry picked from commit 3886641887)
2025-07-10 13:39:28 +00:00
Diptanil Saha
5f41abbdf7 Merge pull request #48507 from frappe/mergify/bp/version-15-hotfix/pr-48506
fix: pos adding item multiple times on applying item group filter (backport #48506)
2025-07-10 12:42:00 +05:30
diptanilsaha
3a70b5d7fc fix: pos adding item multiple times on item group filter
(cherry picked from commit e9f99e5a3f)
2025-07-10 07:09:28 +00:00
ruthra kumar
0a447caa8e Merge pull request #48505 from frappe/mergify/bp/version-15-hotfix/pr-45300
fix: prevent unnecessary db.commit for contact insert (backport #45300)
2025-07-10 11:34:12 +05:30
HarryPaulo
5cfeb2978b fix: prevent unnecessary db.commit for contact insert [Linters]
(cherry picked from commit 87de5c7450)
2025-07-10 05:43:14 +00:00
HarryPaulo
00d39eb208 fix: prevent unnecessary db.commit
(cherry picked from commit 5f15b0b65b)
2025-07-10 05:43:14 +00:00
Mihir Kandoi
7ac546333a fix: invalid comparison error in sabb.py
(cherry picked from commit ec1faf02ed)
2025-07-10 05:35:48 +00:00
Mihir Kandoi
c1334ea2cb Merge pull request #48501 from frappe/mergify/bp/version-15-hotfix/pr-48499 2025-07-09 21:44:35 +05:30
Mihir Kandoi
89660c9070 fix: use planned_qty instead of pending_qty to check if WO should be created against PP
(cherry picked from commit b11bf8eb79)
2025-07-09 15:56:34 +00:00
Frappe PR Bot
76f7eb0f9f chore(release): Bumped to Version 15.69.1
## [15.69.1](https://github.com/frappe/erpnext/compare/v15.69.0...v15.69.1) (2025-07-09)

### Bug Fixes

* use planned_qty instead of pending_qty to check if WO should be created against PP ([9967b1c](9967b1ce4a))
2025-07-09 15:40:37 +00:00
Mihir Kandoi
9c34b90328 Merge pull request #48500 from frappe/mergify/bp/version-15/pr-48499
fix: use planned_qty instead of pending_qty to check if WO should be created against PP (backport #48499)
2025-07-09 21:09:06 +05:30
Mihir Kandoi
9967b1ce4a fix: use planned_qty instead of pending_qty to check if WO should be created against PP
(cherry picked from commit b11bf8eb79)
2025-07-09 15:35:22 +00:00
Frappe PR Bot
0854333e42 chore(release): Bumped to Version 15.69.0
# [15.69.0](https://github.com/frappe/erpnext/compare/v15.68.0...v15.69.0) (2025-07-09)

### Features

* batch rate (valuation) in Batch-Wise Balance History report ([ba7e0b9](ba7e0b9506))
2025-07-09 15:16:52 +00:00
rohitwaghchaure
48e0ce1132 Merge pull request #48498 from frappe/mergify/bp/version-15/pr-48489
feat: batch rate (valuation) in Batch-Wise Balance History report (backport #48487) (backport #48489)
2025-07-09 20:44:29 +05:30
Rohit Waghchaure
ba7e0b9506 feat: batch rate (valuation) in Batch-Wise Balance History report
(cherry picked from commit 8a2a845a16)
(cherry picked from commit facd2027c3)
2025-07-09 14:16:27 +00:00
rohitwaghchaure
4d10cb2727 Merge pull request #48497 from frappe/mergify/bp/version-15-hotfix/pr-48490
feat: update the modified date of the SLE after reposting (backport #48490)
2025-07-09 19:45:12 +05:30
Rohit Waghchaure
8c77ea16cf feat: update the modified date of the SLE after reposting
(cherry picked from commit c2cd4934e7)
2025-07-09 13:52:15 +00:00
rohitwaghchaure
2c59874fd8 Merge pull request #48492 from frappe/mergify/bp/version-15-hotfix/pr-48488
feat: parent item group support in Stock Projected Qty report (backport #48488)
2025-07-09 18:59:38 +05:30
mergify[bot]
fdd79c7677 feat(BOM): improve tree display with item_name and qty (backport #48176) (#48494)
Co-authored-by: Patrick Eißler <77415730+PatrickDEissler@users.noreply.github.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-07-09 14:13:24 +02:00
Rohit Waghchaure
db525c2538 feat: parent item group support in Stock Projected Qty report
(cherry picked from commit 6e80d89d13)
2025-07-09 11:20:04 +00:00
rohitwaghchaure
142de2e2a7 Merge pull request #48489 from frappe/mergify/bp/version-15-hotfix/pr-48487
feat: batch rate (valuation) in Batch-Wise Balance History report (backport #48487)
2025-07-09 16:48:05 +05:30
Rohit Waghchaure
facd2027c3 feat: batch rate (valuation) in Batch-Wise Balance History report
(cherry picked from commit 8a2a845a16)
2025-07-09 10:59:11 +00:00
rohitwaghchaure
90979860cb Merge pull request #48482 from frappe/mergify/bp/version-15-hotfix/pr-48481
fix: stock settings save issue (backport #48481)
2025-07-09 14:16:18 +05:30
Rohit Waghchaure
a5c49d1e08 fix: stock settings save issue
(cherry picked from commit 64ae1ec367)
2025-07-09 06:34:10 +00:00
mergify[bot]
243b533150 fix: resolve sql error on dimension-wise accounts balance report (backport #48477) (#48478)
fix: resolve sql error on dimension-wise accounts balance report (#48477)

(cherry picked from commit c714b724da)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-07-08 23:50:20 +05:30
Mihir Kandoi
85cb234376 Merge pull request #48476 from frappe/mergify/bp/version-15-hotfix/pr-48475
fix: indicator in material_request_list.js (backport #48475)
2025-07-08 23:07:32 +05:30
Mihir Kandoi
4eb9f73a52 fix: indicator in material_request_list.js
(cherry picked from commit d10647a592)
2025-07-08 16:46:16 +00:00
mergify[bot]
7a4c8d81e2 fix: sort available batches based on expiry when merging SLEs with SABB and those without (backport #48471) (#48473)
* fix: sort available batches based on expiry

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-07-08 21:23:30 +05:30
Frappe PR Bot
a94a13a7c1 chore(release): Bumped to Version 15.68.0
# [15.68.0](https://github.com/frappe/erpnext/compare/v15.67.0...v15.68.0) (2025-07-08)

### Bug Fixes

* add company field on POS Invoice Merge Log (backport [#48357](https://github.com/frappe/erpnext/issues/48357)) ([#48414](https://github.com/frappe/erpnext/issues/48414)) ([26db582](26db582499))
* Add company validation to company related fields in Process Statement Of Accounts ([5362648](536264896e))
* add not specified key for None respresented customer_group and territory ([8371daf](8371dafb1a))
* add selling price validation on update item ([a10e394](a10e3948b2))
* address not found when creating internal PR from DN ([f1621d1](f1621d15ff))
* consider empty string in previous doc validation ([b2de9cd](b2de9cdef2))
* cost center for payment entry against advance payment doctypes in accounts Payable/Receivable report ([3f004db](3f004db14f))
* duplicate items being created when fetching items from warehouse in stock reco ([818ddc0](818ddc0b8c))
* fetch from parent optional in inventory dimension ([ed77c15](ed77c15ebc))
* get fiscal year based on date ([177b23c](177b23c624))
* incorrect pending qty when creating PI from PO and PI rates differ from PO (backport [#48173](https://github.com/frappe/erpnext/issues/48173)) ([#48340](https://github.com/frappe/erpnext/issues/48340)) ([8eede1d](8eede1d266))
* item list and project not being set in work order when created from material request ([5cd36c3](5cd36c318b))
* job card material request/transfer buttons UI overlap ([09f8660](09f866022b))
* LCV from PR order mismatch ([74948aa](74948aabda))
* make labels in error message translatable (backport [#48327](https://github.com/frappe/erpnext/issues/48327)) ([#48436](https://github.com/frappe/erpnext/issues/48436)) ([6b41dc2](6b41dc2fed))
* multiple fixes related Deferred Accounting ([a4633d6](a4633d6e75))
* pos recent order display customer code and name (backport [#48379](https://github.com/frappe/erpnext/issues/48379)) ([#48388](https://github.com/frappe/erpnext/issues/48388)) ([f25097d](f25097da1d))
* **Quotation:** hide buttons if user cannot use them (backport [#48115](https://github.com/frappe/erpnext/issues/48115)) ([#48405](https://github.com/frappe/erpnext/issues/48405)) ([a2436e4](a2436e4b6e))
* rate not being fetched for product bundles in material request ([cfedaf5](cfedaf5dc1))
* rename journal entry title on update ([b7b5f6a](b7b5f6acf3))
* unnecessary primary button ([b1abcd5](b1abcd5577))
* update condition for blank tree fields in pricing rule ([f2d644b](f2d644ba29))
* update item reference in quality inspection ([65c277f](65c277fd27))
* update payment request outstanding on unreconciliation ([450061c](450061c7db))
* use default buying price list when price list is falsy ([a336e19](a336e19bb8))
* valuation rate of raw materials in subcontracting receipt ([4545213](4545213adc))

### Features

* add price list field to material request (backport [#48425](https://github.com/frappe/erpnext/issues/48425)) ([#48429](https://github.com/frappe/erpnext/issues/48429)) ([d4700e5](d4700e5560))
* add subject field to project ([#48368](https://github.com/frappe/erpnext/issues/48368)) ([9a538c6](9a538c6843))

### Reverts

* do not convert exchange gain/loss amount to foreign currency ([d0d1d63](d0d1d63d31))
* Revert "fix: stock reco qty with inventory dimension ([#47918](https://github.com/frappe/erpnext/issues/47918))" ([9a99ccc](9a99ccc166))
2025-07-08 13:01:14 +00:00
ruthra kumar
e573c6094a Merge pull request #48462 from frappe/version-15-hotfix
chore: release v15
2025-07-08 18:29:42 +05:30
ruthra kumar
524619e0b4 Merge pull request #48467 from frappe/mergify/bp/version-15-hotfix/pr-48259
fix: add not specified key for None respresented customer_group and t… (backport #48259)
2025-07-08 17:48:30 +05:30
ruthra kumar
5f5fa2f8e1 Merge pull request #48466 from frappe/mergify/bp/version-15-hotfix/pr-48378
fix: update item reference in quality inspection (backport #48378)
2025-07-08 17:48:17 +05:30
pugazhendhivelu
65c277fd27 fix: update item reference in quality inspection
(cherry picked from commit 9da5010265)

# Conflicts:
#	erpnext/public/js/controllers/transaction.js
2025-07-08 17:16:50 +05:30
l0gesh29
8371dafb1a fix: add not specified key for None respresented customer_group and territory
(cherry picked from commit 24cc711a70)

# Conflicts:
#	erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py
2025-07-08 17:13:30 +05:30
ruthra kumar
f8bc0e47ff Merge pull request #48464 from frappe/mergify/bp/version-15-hotfix/pr-48402
fix: rename journal entry title on update (backport #48402)
2025-07-08 17:11:27 +05:30
ruthra kumar
d3a95f04cc Merge pull request #48470 from frappe/mergify/bp/version-15-hotfix/pr-48469
chore: better label for checkbox (backport #48469)
2025-07-08 17:10:50 +05:30
ruthra kumar
5f63794739 chore: better label for checkbox
(cherry picked from commit 8c2e40e291)
2025-07-08 11:40:08 +00:00
ruthra kumar
41bca34f6a Merge pull request #48468 from frappe/mergify/bp/version-15-hotfix/pr-48427
fix: Add company validation to company related fields in Process Statement Of Accounts (backport #48427)
2025-07-08 16:23:47 +05:30
ruthra kumar
f4b7093838 Merge pull request #48465 from frappe/mergify/bp/version-15-hotfix/pr-48359
fix: get fiscal year based on date (backport #48359)
2025-07-08 16:21:03 +05:30
ljain112
536264896e fix: Add company validation to company related fields in Process Statement Of Accounts
(cherry picked from commit 4e45e69247)
2025-07-08 10:37:17 +00:00
l0gesh29
177b23c624 fix: get fiscal year based on date
(cherry picked from commit efb8e7c0e4)
2025-07-08 10:26:26 +00:00
ravibharathi656
f81dba6380 chore: add none value
(cherry picked from commit 9e633bddef)
2025-07-08 10:25:18 +00:00
ravibharathi656
b7b5f6acf3 fix: rename journal entry title on update
(cherry picked from commit acb9829159)
2025-07-08 10:25:18 +00:00
ruthra kumar
d60d8a2625 Merge pull request #48457 from frappe/mergify/bp/version-15-hotfix/pr-48361
revert: do not convert exchange gain/loss amount to foreign currency (backport #48361)
2025-07-08 15:45:34 +05:30
ruthra kumar
e0efe922a6 Merge pull request #48459 from frappe/mergify/bp/version-15-hotfix/pr-48328
fix: update condition for blank tree fields in pricing rule (backport #48328)
2025-07-08 15:44:42 +05:30
mergify[bot]
500972e8aa refactor: remove do_reposting_for_each_stock_transaction feature (backport #48444) (#48452)
* refactor: remove do_reposting_for_each_stock_transaction feature

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-07-08 15:05:35 +05:30
Mihir Kandoi
b833dfab9d Merge pull request #48460 from frappe/mergify/bp/version-15-hotfix/pr-48456
fix: duplicate items being created when fetching items from warehouse in stock reco (backport #48456)
2025-07-08 15:05:11 +05:30
Mihir Kandoi
818ddc0b8c fix: duplicate items being created when fetching items from warehouse in stock reco
(cherry picked from commit 73f6c29559)
2025-07-08 09:01:47 +00:00
venkat102
d0d1d63d31 revert: do not convert exchange gain/loss amount to foreign currency
(cherry picked from commit c17ae703c7)

# Conflicts:
#	erpnext/accounts/report/general_ledger/test_general_ledger.py
2025-07-08 14:30:10 +05:30
ljain112
f2d644ba29 fix: update condition for blank tree fields in pricing rule
(cherry picked from commit 7e0e9db4d2)
2025-07-08 08:53:35 +00:00
ruthra kumar
9e831bbfc6 Merge pull request #48448 from frappe/mergify/bp/version-15-hotfix/pr-48326
fix: cost center for payment entry against advance payment doctypes in accounts payable/rece (backport #48326)
2025-07-08 14:06:28 +05:30
ruthra kumar
7690efa4f7 Merge pull request #48454 from frappe/mergify/bp/version-15-hotfix/pr-48416
refactor: remove duplicate reconciliation date logic (backport #48416)
2025-07-08 13:50:32 +05:30
ljain112
00669661e5 chore: resolve conflicts 2025-07-08 13:19:03 +05:30
ljain112
2ab1b42033 refactor: remove duplicate reconciliation date logic
(cherry picked from commit 398406082a)
2025-07-08 07:34:23 +00:00
ruthra kumar
2c156b58f0 Merge pull request #48453 from frappe/mergify/bp/version-15-hotfix/pr-48343
fix: consider empty string in previous doc validation (backport #48343)
2025-07-08 12:59:52 +05:30
Diptanil Saha
c617b343b3 Merge pull request #48449 from frappe/mergify/bp/version-15-hotfix/pr-48403
fix: add selling price validation on update item (backport #48403)
2025-07-08 12:41:58 +05:30
l0gesh29
b2de9cdef2 fix: consider empty string in previous doc validation
(cherry picked from commit dd43594ad6)
2025-07-08 07:11:51 +00:00
rohitwaghchaure
ae59908f0a Merge pull request #48443 from frappe/mergify/bp/version-15-hotfix/pr-48441
Revert "fix: stock reco qty with inventory dimension" (backport #48441)
2025-07-08 12:30:40 +05:30
l0gesh29
a10e3948b2 fix: add selling price validation on update item
(cherry picked from commit 327d067305)
2025-07-08 06:45:18 +00:00
Mihir Kandoi
fbe1f449d8 Merge pull request #48447 from frappe/mergify/bp/version-15-hotfix/pr-48332
fix: valuation rate of raw materials in subcontracting receipt (backport #48332)
2025-07-08 12:14:53 +05:30
Mihir Kandoi
b3fa0ac596 Merge pull request #48446 from frappe/mergify/bp/version-15-hotfix/pr-48445
fix: use default buying price list when price list is falsy (backport #48445)
2025-07-08 12:14:36 +05:30
ljain112
82d03e2617 refactor: function to fetch advance payment doctypes
(cherry picked from commit 48e8e85617)

# Conflicts:
#	erpnext/accounts/doctype/journal_entry/journal_entry.py
#	erpnext/accounts/doctype/payment_entry/payment_entry.py
#	erpnext/accounts/doctype/payment_request/payment_request.py
#	erpnext/accounts/doctype/unreconcile_payment/unreconcile_payment.py
#	erpnext/accounts/utils.py
#	erpnext/controllers/accounts_controller.py
2025-07-08 06:36:06 +00:00
ljain112
3f004db14f fix: cost center for payment entry against advance payment doctypes in accounts Payable/Receivable report
(cherry picked from commit 8f19f14004)
2025-07-08 06:36:06 +00:00
Mihir Kandoi
4545213adc fix: valuation rate of raw materials in subcontracting receipt
(cherry picked from commit 84ea6afd01)
2025-07-08 06:28:44 +00:00
Mihir Kandoi
a336e19bb8 fix: use default buying price list when price list is falsy
(cherry picked from commit 27c73cf9e9)
2025-07-08 06:26:09 +00:00
rohitwaghchaure
9a99ccc166 Revert "fix: stock reco qty with inventory dimension (#47918)"
This reverts commit 342cebc778.

(cherry picked from commit 8ba66c9833)
2025-07-08 05:08:04 +00:00
ruthra kumar
9935f04bde Merge pull request #48440 from frappe/mergify/bp/version-15-hotfix/pr-48324
fix: update payment request outstanding on unreconciliation (backport #48324)
2025-07-08 10:33:36 +05:30
ruthra kumar
cc5c4a3f9a chore: resolve conflict 2025-07-08 10:17:43 +05:30
rohitwaghchaure
0fefccc128 Merge pull request #48434 from frappe/mergify/bp/version-15-hotfix/pr-48432
fix: fetch from parent optional in inventory dimension (backport #48432)
2025-07-08 09:58:27 +05:30
ljain112
a8448f9e60 chore: fix test case for payment request
(cherry picked from commit 31d12517f0)
2025-07-08 04:16:41 +00:00
ljain112
450061c7db fix: update payment request outstanding on unreconciliation
(cherry picked from commit 8098229b55)

# Conflicts:
#	erpnext/accounts/doctype/payment_request/test_payment_request.py
2025-07-08 04:16:40 +00:00
rohitwaghchaure
5df8ad6ef1 chore: fix conflicts 2025-07-08 08:33:33 +05:30
mergify[bot]
6b41dc2fed fix: make labels in error message translatable (backport #48327) (#48436)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
fix: make labels in error message translatable (#48327)
2025-07-07 22:36:48 +02:00
Rohit Waghchaure
ed77c15ebc fix: fetch from parent optional in inventory dimension
(cherry picked from commit 8aac6a6b18)

# Conflicts:
#	erpnext/stock/doctype/inventory_dimension/inventory_dimension.json
2025-07-07 11:52:53 +00:00
mergify[bot]
d4700e5560 feat: add price list field to material request (backport #48425) (#48429)
* feat: add price list field to material request

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-07-07 15:50:04 +05:30
Mihir Kandoi
f4c9a6e59c Merge pull request #48430 from frappe/mergify/bp/version-15-hotfix/pr-48428
fix: address not found when creating internal PR from DN (backport #48428)
2025-07-07 15:43:22 +05:30
Mihir Kandoi
f1621d15ff fix: address not found when creating internal PR from DN
(cherry picked from commit 97c48ed6d2)
2025-07-07 09:51:19 +00:00
Mihir Kandoi
8638654c13 Merge pull request #48426 from frappe/mergify/bp/version-15-hotfix/pr-48424
fix: item list and project not being set in work order when created from material request (backport #48424)
2025-07-07 15:05:15 +05:30
Mihir Kandoi
5cd36c318b fix: item list and project not being set in work order when created from material request
(cherry picked from commit 099a5fbad9)
2025-07-07 08:49:26 +00:00
mergify[bot]
8eede1d266 fix: incorrect pending qty when creating PI from PO and PI rates differ from PO (backport #48173) (#48340)
* fix: incorrect pending qty when creating PI from PO and PI rates differ from PO

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-07-06 21:40:26 +05:30
mergify[bot]
26db582499 fix: add company field on POS Invoice Merge Log (backport #48357) (#48414)
* fix: add company field on POS Invoice Merge Log

(cherry picked from commit 109658731b)

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

* fix: patch for updating company name on existing pos merge log records

(cherry picked from commit d46b68230c)

# Conflicts:
#	erpnext/patches.txt

* fix: pass company on create_merge_logs

(cherry picked from commit b4b473185f)

* test: test company fetching from POS Closing Entry

(cherry picked from commit 9548f341bf)

# Conflicts:
#	erpnext/accounts/doctype/pos_invoice_merge_log/test_pos_invoice_merge_log.py

* chore: remove conflicts

---------

Co-authored-by: Kavin <78342682+kavin0411@users.noreply.github.com>
Co-authored-by: diptanilsaha <diptanil@frappe.io>
2025-07-06 15:25:59 +05:30
ruthra kumar
89458f07c9 Merge pull request #48415 from frappe/mergify/bp/version-15-hotfix/pr-47805
fix: multiple fixes related Deferred Accounting (backport #47805)
2025-07-06 15:25:16 +05:30
Lakshit Jain
a4633d6e75 fix: multiple fixes related Deferred Accounting
(cherry picked from commit 277c1101fc)
2025-07-06 14:59:23 +05:30
Mihir Kandoi
dbe107345c Merge pull request #48404 from frappe/mergify/bp/version-15-hotfix/pr-48368
feat: add subject field to project (backport #48368)
2025-07-05 12:07:00 +05:30
mergify[bot]
a2436e4b6e fix(Quotation): hide buttons if user cannot use them (backport #48115) (#48405)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
fix(Quotation): hide buttons if user cannot use them (#48115)
2025-07-04 20:10:27 +02:00
Mihir Kandoi
9a538c6843 feat: add subject field to project (#48368)
* feat: add subject field to project

(cherry picked from commit 407fdab487)
2025-07-04 16:10:19 +00:00
Mihir Kandoi
d8f5924eb2 Merge pull request #48373 from mihir-kandoi/st42781
fix: LCV from PR order mismatch
2025-07-04 15:30:29 +05:30
Mihir Kandoi
9312a5b762 Merge pull request #48396 from frappe/mergify/bp/version-15-hotfix/pr-48372
fix: rate not being fetched for product bundles in material request (backport #48372)
2025-07-04 15:30:09 +05:30
Mihir Kandoi
edef03ac22 chore: resolve conflict 2025-07-04 12:49:45 +05:30
Mihir Kandoi
74948aabda fix: LCV from PR order mismatch 2025-07-04 12:48:15 +05:30
Mihir Kandoi
cfedaf5dc1 fix: rate not being fetched for product bundles in material request
(cherry picked from commit 45c7bac2d0)

# Conflicts:
#	erpnext/stock/doctype/packed_item/packed_item.py
2025-07-04 07:16:39 +00:00
mergify[bot]
f25097da1d fix: pos recent order display customer code and name (backport #48379) (#48388)
fix: pos recent order display customer code and name (#48379)

(cherry picked from commit 5f721f01d3)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-07-04 12:40:19 +05:30
mergify[bot]
3952f5d913 chore: fix flaky test in Tax Withholding Details (backport #48375) (#48394)
* chore: fix flaky test in Tax Withholding Details

(cherry picked from commit 14a2f98521)

* fix: sort tax withhodling details report by section code and transaction date

(cherry picked from commit 7ee2418f60)

* fix(test): flaky budget test case

(cherry picked from commit 704223e5d0)

* fix(test): import get_accumulated_monthly_budget

---------

Co-authored-by: ljain112 <ljain112@gmail.com>
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
Co-authored-by: diptanilsaha <diptanil@frappe.io>
2025-07-04 12:05:55 +05:30
Mihir Kandoi
9d23199c25 Merge pull request #48377 from mihir-kandoi/fix-job-card-buttons-d
fix: job card material request/transfer buttons UI overlap
2025-07-04 11:22:46 +05:30
Mihir Kandoi
b1abcd5577 fix: unnecessary primary button 2025-07-04 08:29:29 +05:30
Mihir Kandoi
09f866022b fix: job card material request/transfer buttons UI overlap 2025-07-03 14:05:07 +05:30
Frappe PR Bot
f087da927a chore(release): Bumped to Version 15.67.0
# [15.67.0](https://github.com/frappe/erpnext/compare/v15.66.1...v15.67.0) (2025-07-01)

### Bug Fixes

* accounting entries for standalone credit notes ([cfc8c61](cfc8c610fa))
* better integration of Pick List with Delivery Note (backport [#47831](https://github.com/frappe/erpnext/issues/47831)) ([#48158](https://github.com/frappe/erpnext/issues/48158)) ([8f47505](8f47505604))
* customer section on pos item cart (backport [#48284](https://github.com/frappe/erpnext/issues/48284)) ([#48285](https://github.com/frappe/erpnext/issues/48285)) ([b6e0953](b6e09531d7))
* customer_group import from lead to customer ([#48266](https://github.com/frappe/erpnext/issues/48266)) ([5463a8b](5463a8b6cf))
* default UOMs by new stock Entry created by Stock Level section button ([f1062c6](f1062c61f6))
* disassemble qty calculation & max calculation to be allowed to create it ([bf78f61](bf78f6173c))
* failing test case ([bde63ed](bde63ed0e5))
* func parameters ([c69bb74](c69bb746ce))
* not able to save material request ([0e2bca4](0e2bca4b34))
* option to pick serial / batch for asset repair ([7de15b7](7de15b74d4))
* **pos invoice:** search using customer name (backport [#48279](https://github.com/frappe/erpnext/issues/48279)) ([#48323](https://github.com/frappe/erpnext/issues/48323)) ([ab20b96](ab20b965ca))
* saperated validations for each purpose of validation ([0c07dfa](0c07dfadfe))
* update salvage value after value adjustment (backport [#48228](https://github.com/frappe/erpnext/issues/48228)) ([#48248](https://github.com/frappe/erpnext/issues/48248)) ([ef202d7](ef202d7cd0))
* use company default currency in amount_eligible_for_commission ([9b8fffd](9b8fffd1d4))
* use gain_loss_posting_date instead of today ([ff36284](ff362843cb))
* use label "State/Province" for translatability (backport [#48273](https://github.com/frappe/erpnext/issues/48273)) ([#48286](https://github.com/frappe/erpnext/issues/48286)) ([af55ce0](af55ce0f6c))
* validate asset before repair ([a1eab1d](a1eab1db74))

### Features

* added Transfer and Issue option in purpose ([1f7eccd](1f7eccdac5))

### Performance Improvements

* use set_value for updating bank clearance_date ([a0db227](a0db227a7a))
2025-07-01 12:02:06 +00:00
ruthra kumar
171d86a3ab Merge pull request #48338 from frappe/version-15-hotfix
chore: release v15
2025-07-01 17:30:39 +05:30
ruthra kumar
58c6031c1f Merge pull request #48339 from frappe/mergify/bp/version-15-hotfix/pr-48244
fix: use gain_loss_posting_date instead of today (backport #48244)
2025-07-01 16:20:01 +05:30
ravibharathi656
ff362843cb fix: use gain_loss_posting_date instead of today
(cherry picked from commit 0585bc5aef)
2025-07-01 10:12:35 +00:00
rohitwaghchaure
86b14dd4be Merge pull request #48319 from frappe/mergify/bp/version-15-hotfix/pr-48298
fix: default UOMs by new Stock Entry created by Stock Level section button (when Item is batch or serial) (backport #48298)
2025-07-01 13:24:29 +05:30
ruthra kumar
037ef10fcb Merge pull request #48292 from ljain112/fix-bank-cleareance-v15
perf: use set_value for updating bank clearance_date
2025-07-01 11:58:13 +05:30
mergify[bot]
ab20b965ca fix(pos invoice): search using customer name (backport #48279) (#48323)
* fix(pos invoice): search using customer name

(cherry picked from commit 20fd071c4e)

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

* refactor: use or_filters for customer and customer_name

(cherry picked from commit 6a401bcfbb)

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

* refactor: refactored for version 15

---------

Co-authored-by: ravibharathi656 <ravibharathi656@gmail.com>
Co-authored-by: diptanilsaha <diptanil@frappe.io>
2025-06-30 14:51:47 +05:30
rohitwaghchaure
e1a726bdd4 Merge pull request #48294 from frappe/mergify/bp/version-15-hotfix/pr-48293
fix: option to pick serial / batch for asset repair (backport #48293)
2025-06-30 13:27:29 +05:30
rohitwaghchaure
221e5a2190 Merge pull request #48320 from frappe/mergify/bp/version-15-hotfix/pr-48184
fix: Disassembly order items calculation in stock entry & track it in work order (backport #48184)
2025-06-30 13:16:30 +05:30
rohitwaghchaure
f0724f2f04 Merge pull request #48317 from frappe/mergify/bp/version-15-hotfix/pr-48240
refactor: bom stock report (backport #48240)
2025-06-30 13:15:37 +05:30
rohitwaghchaure
c404faaa6d chore: fix issue 2025-06-30 12:46:52 +05:30
rohitwaghchaure
abfe3c8365 chore: fix conflicts 2025-06-30 12:45:04 +05:30
iamkhanraheel
61f4547860 test: added test case for disassembly order
(cherry picked from commit aee26c3550)
2025-06-30 06:57:52 +00:00
iamkhanraheel
c69bb746ce fix: func parameters
(cherry picked from commit ce6ace4b8a)
2025-06-30 06:57:51 +00:00
iamkhanraheel
bf78f6173c fix: disassemble qty calculation & max calculation to be allowed to create it
(cherry picked from commit 3e4d160626)

# Conflicts:
#	erpnext/manufacturing/doctype/work_order/work_order.json
#	erpnext/stock/doctype/stock_entry/stock_entry.py
2025-06-30 06:57:51 +00:00
ruthra kumar
e628a37b99 Merge pull request #48318 from frappe/mergify/bp/version-15-hotfix/pr-48304
chore: fix translation message (backport #48304)
2025-06-30 12:22:58 +05:30
Florian HENRY
f1062c61f6 fix: default UOMs by new stock Entry created by Stock Level section button
(cherry picked from commit e7da4992f3)
2025-06-30 05:40:15 +00:00
Abdallah A. Zaqout
f479675ce6 chore: fix translation message
(cherry picked from commit bc002937ad)
2025-06-30 05:34:05 +00:00
Mihir Kandoi
ce7dbf3090 refactor: bom stock report
(cherry picked from commit ee4e0c646d)
2025-06-30 05:32:04 +00:00
rohitwaghchaure
ac587b9c94 chore: fix conflicts 2025-06-30 10:55:56 +05:30
ruthra kumar
1ea3daeb17 Merge pull request #48267 from frappe/mergify/bp/version-15-hotfix/pr-48266
fix: customer_group import from lead to customer (backport #48266)
2025-06-30 10:48:20 +05:30
ruthra kumar
b2f6fed42c Merge pull request #48315 from frappe/mergify/bp/version-15-hotfix/pr-48271
fix: use company default currency in amount_eligible_for_commission (backport #48271)
2025-06-30 10:34:49 +05:30
rohitwaghchaure
352642096e chore: fix conflicts 2025-06-30 10:12:54 +05:30
rohitwaghchaure
ab61b46a01 chore: fix conflicts 2025-06-30 10:09:59 +05:30
ravibharathi656
9b8fffd1d4 fix: use company default currency in amount_eligible_for_commission
(cherry picked from commit 7c7b392789)
2025-06-30 04:39:08 +00:00
rohitwaghchaure
46243fdb5f Merge pull request #48314 from frappe/mergify/bp/version-15-hotfix/pr-48310
fix: accounting entries for standalone credit notes (backport #48310)
2025-06-30 10:07:36 +05:30
Rohit Waghchaure
cfc8c610fa fix: accounting entries for standalone credit notes
(cherry picked from commit 52177cffcd)
2025-06-30 04:09:56 +00:00
Khushi Rawat
d73ff810d9 Merge pull request #48312 from frappe/mergify/bp/version-15-hotfix/pr-48311
fix: validate asset status for repair (backport #48311)
2025-06-30 01:31:45 +05:30
Khushi Rawat
2b37287b19 chore: resolved conflicts 2025-06-30 01:04:54 +05:30
Khushi Rawat
f31b008502 chore: resolved conflicts 2025-06-30 01:03:49 +05:30
khushi8112
6f24c02121 test: asset status validation
(cherry picked from commit cfe04a2aaf)

# Conflicts:
#	erpnext/assets/doctype/asset_repair/test_asset_repair.py
2025-06-29 19:26:03 +00:00
khushi8112
a1eab1db74 fix: validate asset before repair
(cherry picked from commit c6baa34812)

# Conflicts:
#	erpnext/assets/doctype/asset_repair/asset_repair.json
2025-06-29 19:26:03 +00:00
Frappe PR Bot
fcf9f82092 chore(release): Bumped to Version 15.66.1
## [15.66.1](https://github.com/frappe/erpnext/compare/v15.66.0...v15.66.1) (2025-06-27)

### Bug Fixes

* not able to save material request ([a49026e](a49026e9d2))
2025-06-27 12:28:50 +00:00
rohitwaghchaure
e817561dce Merge pull request #48300 from frappe/mergify/bp/version-15/pr-48297
fix: not able to save material request (backport #48296) (backport #48297)
2025-06-27 17:57:24 +05:30
Rohit Waghchaure
a49026e9d2 fix: not able to save material request
(cherry picked from commit c5e36eb323)
(cherry picked from commit 0e2bca4b34)
2025-06-27 11:18:10 +00:00
rohitwaghchaure
7574069af2 Merge pull request #48297 from frappe/mergify/bp/version-15-hotfix/pr-48296
fix: not able to save material request (backport #48296)
2025-06-27 16:47:17 +05:30
Rohit Waghchaure
0e2bca4b34 fix: not able to save material request
(cherry picked from commit c5e36eb323)
2025-06-27 10:55:48 +00:00
Rohit Waghchaure
7de15b74d4 fix: option to pick serial / batch for asset repair
(cherry picked from commit ae77c609ff)

# Conflicts:
#	erpnext/assets/doctype/asset_repair/asset_repair.py
#	erpnext/assets/doctype/asset_repair_consumed_item/asset_repair_consumed_item.json
2025-06-27 09:59:22 +00:00
ljain112
a0db227a7a perf: use set_value for updating bank clearance_date 2025-06-27 14:12:14 +05:30
mergify[bot]
af55ce0f6c fix: use label "State/Province" for translatability (backport #48273) (#48286)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
fix: use label "State/Province" for translatability (#48273)
2025-06-26 20:49:06 +02:00
0xD0M1M0
894bb703f6 chore: improve some german translations (#48283) 2025-06-26 20:23:35 +02:00
mergify[bot]
b6e09531d7 fix: customer section on pos item cart (backport #48284) (#48285)
* fix: customer section on pos item cart (#48284)

* fix: customer recent transactions

* fix: pos customer section display customer_name instead of customer name

(cherry picked from commit e1d9f863c6)

# Conflicts:
#	erpnext/public/scss/point-of-sale.scss
#	erpnext/selling/page/point_of_sale/point_of_sale.py
#	erpnext/selling/page/point_of_sale/pos_item_cart.js

* chore: resolve conflict

* chore: resolve conflict

* chore: resolve conflict

---------

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-06-26 23:20:38 +05:30
mergify[bot]
8f47505604 fix: better integration of Pick List with Delivery Note (backport #47831) (#48158)
* fix: better integration of Pick List with Delivery Note (#47831)

Co-authored-by: priyanshshah2442 <priyanshshah2442@gmail.com>
(cherry picked from commit 527cfe9c7d)

# Conflicts:
#	erpnext/patches.txt
#	erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
#	erpnext/stock/doctype/pick_list/pick_list.py
#	erpnext/stock/doctype/pick_list_item/pick_list_item.json

* chore: resolve conflicts

* fix: setting status correctly as per v15 utility

* fix: get items from Pick List to DN even if not linked to Sales Order

---------

Co-authored-by: Smit Vora <smitvora203@gmail.com>
Co-authored-by: Priyansh Shah <108476017+priyanshshah2442@users.noreply.github.com>
2025-06-26 18:25:53 +05:30
0xD0M1M0
5463a8b6cf fix: customer_group import from lead to customer (#48266)
In case customization happens and the lead has the field "customer_group", the get_mapped_doc function would fail and be overwritten by the default value.

(cherry picked from commit 1b18105bce)
2025-06-25 21:26:40 +00:00
Khushi Rawat
b8a773e3e1 Merge pull request #48253 from frappe/mergify/bp/version-15-hotfix/pr-47901
feat: Asset Transfer and Issue in single asset movement record (backport #47901)
2025-06-25 15:23:54 +05:30
khushi8112
dc642fbc41 chore: linters check 2025-06-25 15:04:17 +05:30
Khushi Rawat
ddbdcbb026 chore: resolved conflicts 2025-06-25 14:47:47 +05:30
Khushi Rawat
df938f24d4 chore: resolved conflicts 2025-06-25 14:47:00 +05:30
Khushi Rawat
bde63ed0e5 fix: failing test case
(cherry picked from commit 7d3bec8ef8)
2025-06-25 09:08:24 +00:00
Khushi Rawat
1c3ac9c1fd refactor: split set_latest_location_and_custodian_in_asset into smaller functions
(cherry picked from commit 7e52cb2856)
2025-06-25 09:08:24 +00:00
Khushi Rawat
0c07dfadfe fix: saperated validations for each purpose of validation
(cherry picked from commit 07d1a0ed9c)

# Conflicts:
#	erpnext/assets/doctype/asset_movement/asset_movement.py
2025-06-25 09:08:24 +00:00
Khushi Rawat
1f7eccdac5 feat: added Transfer and Issue option in purpose
(cherry picked from commit f5e5146021)

# Conflicts:
#	erpnext/assets/doctype/asset_movement/asset_movement.json
2025-06-25 09:08:23 +00:00
Khushi Rawat
ef202d7cd0 fix: update salvage value after value adjustment (backport #48228) (#48248)
fix: update salvage value after value adjustment
2025-06-25 11:43:18 +05:30
Frappe PR Bot
de03618b09 chore(release): Bumped to Version 15.66.0
# [15.66.0](https://github.com/frappe/erpnext/compare/v15.65.4...v15.66.0) (2025-06-25)

### Bug Fixes

* add descendants item groups to fetch the barcode items ([5cabdbf](5cabdbfe06))
* add is_group filter for warehouse ([ad0819f](ad0819feee))
* add party and party_name columns to trend reports ([ceab26d](ceab26d5f1))
* add validation for exchange gain/loss entries ([153ed04](153ed04161))
* **asset-invoice:** handle asset invoice cancellation ([d3daeaf](d3daeaf475))
* auto append_taxes_from_item_tax_template in backend ([2bf8dff](2bf8dffb60))
* coa reset root_type on unchecking is_group on new_node (backport [#48156](https://github.com/frappe/erpnext/issues/48156)) ([#48160](https://github.com/frappe/erpnext/issues/48160)) ([7c2bf02](7c2bf026ef))
* contract autoname ([1223f55](1223f5551f))
* fallback expense account and cost center in subcontracting receipt ([ac22c42](ac22c422c8))
* get already billed amount from current doc instead of database ([#48079](https://github.com/frappe/erpnext/issues/48079)) ([c2c5e45](c2c5e45bc6))
* incoming rate for the stand-alone credit note ([ad40bfe](ad40bfe4ea))
* modify query to fetch valid return qty ([764c71d](764c71d3e1))
* naming series field in bank transaction (backport [#48121](https://github.com/frappe/erpnext/issues/48121)) ([#48149](https://github.com/frappe/erpnext/issues/48149)) ([f0ddf1b](f0ddf1b223))
* **open_opportunity:** remove company=null filter (backport [#48222](https://github.com/frappe/erpnext/issues/48222)) ([#48224](https://github.com/frappe/erpnext/issues/48224)) ([2d7a7d9](2d7a7d9988))
* permission issue during reposting ([6896216](6896216276))
* pos item details fetch uoms on stock settings allow_uom_with_conversion_rate_defined_in_item configuration (backport [#48178](https://github.com/frappe/erpnext/issues/48178)) ([#48179](https://github.com/frappe/erpnext/issues/48179)) ([991ddfe](991ddfe187))
* pos item price in get_item and item search (backport [#47925](https://github.com/frappe/erpnext/issues/47925)) ([#48217](https://github.com/frappe/erpnext/issues/48217)) ([f8cfbda](f8cfbda4e0))
* resolved conflicts ([881dcf8](881dcf817f))
* SABB validation during the LCV ([b3d337a](b3d337a45b))
* setup wizard load chart of accounts and fiscal year on change of country (backport [#48125](https://github.com/frappe/erpnext/issues/48125)) ([#48128](https://github.com/frappe/erpnext/issues/48128)) ([f85b08d](f85b08d2f5))
* stock adjustment entry to make stock balance zero (backport [#48245](https://github.com/frappe/erpnext/issues/48245)) ([#48247](https://github.com/frappe/erpnext/issues/48247)) ([41d22d0](41d22d0255))
* stock reconciliation validation for serial and batch ([89376dd](89376ddf8d))
* target inventory dimension for stock entry ([4e70005](4e70005937))
* Update indexing to populate correct values in trends report chart ([24f892d](24f892d582))
* update journal entry title on amend ([4341ac7](4341ac7e7a))
* Update transaction currency to company currency to show correct currency symbol ([651b952](651b9521b9))
* use currency from opportunity while creating quotation ([#45540](https://github.com/frappe/erpnext/issues/45540)) ([a6c5738](a6c5738f4b))
* use set_query on sales_order link field in work order ([b33bec4](b33bec4dad))

### Features

* add naming series for Contract Doctype ([b3c43e8](b3c43e8527))
* add search field for contract doctype ([27b5d94](27b5d9493a))
2025-06-25 04:48:04 +00:00
ruthra kumar
ecd30c5809 Merge pull request #48229 from frappe/version-15-hotfix
chore: release v15
2025-06-25 10:16:37 +05:30
mergify[bot]
41d22d0255 fix: stock adjustment entry to make stock balance zero (backport #48245) (#48247)
fix: stock adjustment entry to make stock balance zero (#48245)

(cherry picked from commit 66eeda6410)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-06-24 22:16:24 +05:30
ruthra kumar
a913cfea7e Merge pull request #48239 from frappe/mergify/bp/version-15-hotfix/pr-45540
fix: use currency from opportunity while creating quotation (backport #45540)
2025-06-24 19:35:10 +05:30
Sugesh G
a6c5738f4b fix: use currency from opportunity while creating quotation (#45540)
(cherry picked from commit d748b491ee)
2025-06-24 12:10:24 +00:00
ruthra kumar
3a6956ba05 Merge pull request #48230 from frappe/mergify/bp/version-15-hotfix/pr-47627
fix: auto append_taxes_from_item_tax_template in backend (backport #47627)
2025-06-24 17:38:14 +05:30
ruthra kumar
1deadb8daa Merge pull request #48236 from frappe/mergify/bp/version-15-hotfix/pr-48226
Trends reports (backport #48226)
2025-06-24 17:36:44 +05:30
ruthra kumar
463ad0a163 Merge pull request #48235 from frappe/mergify/bp/version-15-hotfix/pr-48079
fix: get already billed amount from current doc instead of database (backport #48079)
2025-06-24 17:35:37 +05:30
ljain112
f6bb86574e chore: fix test case for auto tax appending 2025-06-24 16:45:41 +05:30
Khushi Rawat
889a14b557 Merge pull request #48120 from aerele/fix/asset-invoice-cancel-validation
fix(asset-invoice): handle asset invoice cancellation
2025-06-24 16:24:18 +05:30
ljain112
0b96e1e3ef chore: resolve conflicts 2025-06-24 15:52:24 +05:30
Karuppasamy923
24f892d582 fix: Update indexing to populate correct values in trends report chart
(cherry picked from commit b08d66113c)
2025-06-24 10:18:44 +00:00
Karuppasamy923
651b9521b9 fix: Update transaction currency to company currency to show correct currency symbol
(cherry picked from commit b0e201a332)
2025-06-24 10:18:44 +00:00
Lakshit Jain
c2c5e45bc6 fix: get already billed amount from current doc instead of database (#48079)
* fix: get already billed amount from current doc instead of database

* fix: throw overbilling validation for all items in single call

* refactor: minor fixes

---------

Co-authored-by: Sagar Vora <16315650+sagarvora@users.noreply.github.com>
(cherry picked from commit 47c3c4808e)
2025-06-24 10:11:43 +00:00
ljain112
1ccdb67c55 chore: resolve conflicts 2025-06-24 15:31:34 +05:30
ljain112
2bf8dffb60 fix: auto append_taxes_from_item_tax_template in backend
(cherry picked from commit 4cb1fa2b6b)

# Conflicts:
#	erpnext/controllers/accounts_controller.py
#	erpnext/controllers/tests/test_accounts_controller.py
2025-06-24 09:48:21 +00:00
mergify[bot]
6511eb4c7c refactor: track completed app setup wizards and re-run the setup wizard upon new app installation. (backport #47691) (#48223)
* refactor: track completed app setup wizards and re-run the setup wizard upon new app installation. (#47691)

(cherry picked from commit 75b5ba6e67)

# Conflicts:
#	erpnext/hooks.py
#	erpnext/setup/install.py

* chore: fix conflicts

* chore: fix conflicts

* chore: fix conflicts

* fix: permission issue

* fix: space

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-06-24 14:51:15 +05:30
Mihir Kandoi
5aed023434 Merge pull request #48225 from frappe/mergify/bp/version-15-hotfix/pr-48078
fix: fallback expense account and cost center in subcontracting receipt (backport #48078)
2025-06-24 12:14:28 +05:30
rohitwaghchaure
764c81a146 Merge pull request #48215 from frappe/mergify/bp/version-15-hotfix/pr-48195
fix: incoming rate for the stand-alone credit note (backport #48195)
2025-06-24 12:02:17 +05:30
mergify[bot]
2d7a7d9988 fix(open_opportunity): remove company=null filter (backport #48222) (#48224)
* fix(open_opportunity): remove company=null filter (#48222)

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

# Conflicts:
#	erpnext/crm/number_card/open_opportunity/open_opportunity.json

* chore: resolve conflicts

---------

Co-authored-by: Akhil Narang <me@akhilnarang.dev>
2025-06-24 11:56:08 +05:30
Mihir Kandoi
ac22c422c8 fix: fallback expense account and cost center in subcontracting receipt
(cherry picked from commit cf1d4362e5)
2025-06-24 06:20:50 +00:00
rohitwaghchaure
f560286610 chore: fix conflicts 2025-06-24 11:34:04 +05:30
ruthra kumar
19a6ce3605 Merge pull request #48220 from frappe/mergify/bp/version-15-hotfix/pr-48180
fix: update journal entry title on amend (backport #48180)
2025-06-24 10:11:28 +05:30
ravibharathi656
4341ac7e7a fix: update journal entry title on amend
(cherry picked from commit 4a3ee4df29)
2025-06-24 04:04:04 +00:00
ruthra kumar
866780b383 Merge pull request #48212 from frappe/mergify/bp/version-15-hotfix/pr-48162
fix: add validation for exchange gain/loss entries (backport #48162)
2025-06-24 09:19:14 +05:30
ruthra kumar
ca2f4e801e Merge pull request #48213 from frappe/mergify/bp/version-15-hotfix/pr-48053
fix: add descendants item groups to fetch the barcode items (backport #48053)
2025-06-24 09:18:19 +05:30
mergify[bot]
f8cfbda4e0 fix: pos item price in get_item and item search (backport #47925) (#48217)
fix: pos item price in get_item and item search (#47925)

* fix: pos get item and item search

* refactor: resolved linter issue and renamed variables

* fix: uom on get_item

* fix: incorrect item quantity on pos selector

* refactor: remove unused import

(cherry picked from commit 919684a787)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-06-23 22:42:47 +05:30
Rohit Waghchaure
ad40bfe4ea fix: incoming rate for the stand-alone credit note
(cherry picked from commit b06eca8dcb)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
2025-06-23 15:40:49 +00:00
pugazhendhivelu
5cabdbfe06 fix: add descendants item groups to fetch the barcode items
(cherry picked from commit 4b82fe2611)
2025-06-23 14:01:23 +00:00
i-am-vimal
153ed04161 fix: add validation for exchange gain/loss entries
(cherry picked from commit 5c9eddd31e)
2025-06-23 14:00:09 +00:00
ruthra kumar
78013d3d8f Merge pull request #48209 from frappe/mergify/bp/version-15-hotfix/pr-48200
chore: better label and desciption for pegged currency flag (backport #48200)
2025-06-23 19:29:40 +05:30
ruthra kumar
b6dda08290 chore: better label and desciption for pegged currency flag
(cherry picked from commit c5cd7d91c4)
2025-06-23 12:14:42 +00:00
ruthra kumar
1ea876bc7a Merge pull request #48199 from frappe/mergify/bp/version-15-hotfix/pr-48096
fix: add party and party_name columns to trend reports (backport #48096)
2025-06-23 15:58:34 +05:30
ruthra kumar
b92662a095 Merge pull request #48197 from frappe/mergify/bp/version-15-hotfix/pr-48186
fix: add is_group filter for warehouse (backport #48186)
2025-06-23 15:44:29 +05:30
Karuppasamy923
ceab26d5f1 fix: add party and party_name columns to trend reports
(cherry picked from commit d05204a960)
2025-06-23 10:12:18 +00:00
Karuppasamy923
ad0819feee fix: add is_group filter for warehouse
(cherry picked from commit a29ae9cf90)
2025-06-23 10:07:10 +00:00
rohitwaghchaure
c5bf889391 Merge pull request #48182 from frappe/mergify/bp/version-15-hotfix/pr-48181
fix: SABB validation during the LCV (backport #48181)
2025-06-22 12:17:04 +05:30
Khushi Rawat
7303ee4bea Merge pull request #48175 from frappe/mergify/bp/version-15-hotfix/pr-48151
fix: duplicate naming issue in contract doctype (backport #48151)
2025-06-22 00:47:47 +05:30
Rohit Waghchaure
b3d337a45b fix: SABB validation during the LCV
(cherry picked from commit e958f886d3)
2025-06-20 15:55:02 +00:00
mergify[bot]
991ddfe187 fix: pos item details fetch uoms on stock settings allow_uom_with_conversion_rate_defined_in_item configuration (backport #48178) (#48179)
fix: pos item details fetch uoms on stock settings allow_uom_with_conversion_rate_defined_in_item configuration (#48178)

(cherry picked from commit 4aa4942a17)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-06-20 16:23:42 +05:30
Khushi Rawat
881dcf817f fix: resolved conflicts 2025-06-20 14:23:02 +05:30
khushi8112
c07d5b6dec chore: remove unused import
(cherry picked from commit a1c0727d7b)
2025-06-20 07:29:35 +00:00
khushi8112
4c2f555379 refactor: remove test case
(cherry picked from commit 4a027125bc)
2025-06-20 07:29:35 +00:00
khushi8112
27b5d9493a feat: add search field for contract doctype
(cherry picked from commit 0665691b88)
2025-06-20 07:29:35 +00:00
khushi
b3c43e8527 feat: add naming series for Contract Doctype
(cherry picked from commit bf56c73c6c)

# Conflicts:
#	erpnext/crm/doctype/contract/contract.json
2025-06-20 07:29:35 +00:00
khushi
1005ee64cd refactor: remove autoname
(cherry picked from commit a4bb7c4e95)
2025-06-20 07:29:34 +00:00
khushi
8150638519 chore: linters check
(cherry picked from commit f7e63936a9)
2025-06-20 07:29:34 +00:00
khushi
194e15fe6e chore: test contract autoname
(cherry picked from commit b55d1e61c7)
2025-06-20 07:29:34 +00:00
khushi
1223f5551f fix: contract autoname
(cherry picked from commit e13e2bffe2)
2025-06-20 07:29:33 +00:00
mergify[bot]
f0ddf1b223 fix: naming series field in bank transaction (backport #48121) (#48149)
fix: naming series field in bank transaction (#48121)

* fix: naming series field in bank transaction

* fix: default naming_series

(cherry picked from commit c94764ab52)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-06-20 11:52:53 +05:30
Frappe PR Bot
bd128d3b3a chore(release): Bumped to Version 15.65.4
## [15.65.4](https://github.com/frappe/erpnext/compare/v15.65.3...v15.65.4) (2025-06-19)

### Bug Fixes

* target inventory dimension for stock entry ([0958a3b](0958a3b643))
2025-06-19 16:33:57 +00:00
rohitwaghchaure
42460980b2 Merge pull request #48167 from frappe/mergify/bp/version-15/pr-48166
fix: target inventory dimension for stock entry (backport #48165) (backport #48166)
2025-06-19 22:02:27 +05:30
Rohit Waghchaure
0958a3b643 fix: target inventory dimension for stock entry
(cherry picked from commit d65cb56d66)
(cherry picked from commit 4e70005937)
2025-06-19 15:13:19 +00:00
rohitwaghchaure
f5adfe3f0f Merge pull request #48166 from frappe/mergify/bp/version-15-hotfix/pr-48165
fix: target inventory dimension for stock entry (backport #48165)
2025-06-19 20:41:35 +05:30
Rohit Waghchaure
4e70005937 fix: target inventory dimension for stock entry
(cherry picked from commit d65cb56d66)
2025-06-19 14:24:39 +00:00
rohitwaghchaure
4eff2b58e6 Merge pull request #48159 from frappe/mergify/bp/version-15-hotfix/pr-48131
fix: permission issue during reposting (backport #48131)
2025-06-19 18:08:10 +05:30
mergify[bot]
7c2bf026ef fix: coa reset root_type on unchecking is_group on new_node (backport #48156) (#48160)
fix: coa reset root_type on unchecking is_group on new_node (#48156)

(cherry picked from commit 2f8893439f)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-06-19 17:54:08 +05:30
Rohit Waghchaure
6896216276 fix: permission issue during reposting
(cherry picked from commit dcc9fc2fec)
2025-06-19 12:14:44 +00:00
mergify[bot]
bf61014fe5 test: purchase invoice provisional accounting entry (backport #48112) (#48134)
test: purchase invoice provisional accounting entry (#48112)

* test: fixed purchase invoice provisional accounting entry

* test: added tests for multi currency

(cherry picked from commit 80f992c87f)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-06-19 13:01:51 +05:30
Frappe PR Bot
e0ca060475 chore(release): Bumped to Version 15.65.3
## [15.65.3](https://github.com/frappe/erpnext/compare/v15.65.2...v15.65.3) (2025-06-19)

### Bug Fixes

* stock reconciliation validation for serial and batch ([3057f6c](3057f6ce35))
* use set_query on sales_order link field in work order ([6a6130e](6a6130e06c))
2025-06-19 05:30:19 +00:00
rohitwaghchaure
84d348b3d4 Merge pull request #48145 from frappe/mergify/bp/version-15/pr-48107
fix: use set_query on sales_order link field in work order (backport #48077) (backport #48107)
2025-06-19 10:58:59 +05:30
rohitwaghchaure
a63457e5b0 Merge pull request #48144 from frappe/mergify/bp/version-15/pr-48113
fix: stock reconciliation validation for serial nos (backport #47988) (backport #48113)
2025-06-19 10:58:43 +05:30
Mihir Kandoi
6a6130e06c fix: use set_query on sales_order link field in work order
(cherry picked from commit 6def182e1a)
(cherry picked from commit b33bec4dad)
2025-06-19 04:37:39 +00:00
Rohit Waghchaure
3057f6ce35 fix: stock reconciliation validation for serial and batch
(cherry picked from commit 69d54d2e0f)
(cherry picked from commit 89376ddf8d)
2025-06-19 04:36:35 +00:00
rohitwaghchaure
7fbefef72a Merge pull request #48135 from aerele/handle-return-qty
fix: modify query to fetch valid return qty
2025-06-18 20:24:46 +05:30
Bhavan23
ea3015a450 test(sales-invoice): add test case for asset invoice cancellation 2025-06-18 19:21:14 +05:30
ravibharathi656
9146bd95a4 test: update import for change_settings 2025-06-18 18:41:01 +05:30
ravibharathi656
4576fcd96f test: add test for validating sales invoice qty after return 2025-06-18 18:16:06 +05:30
ravibharathi656
764c71d3e1 fix: modify query to fetch valid return qty 2025-06-18 18:16:06 +05:30
mergify[bot]
f85b08d2f5 fix: setup wizard load chart of accounts and fiscal year on change of country (backport #48125) (#48128)
fix: setup wizard load chart of accounts and fiscal year on change of country (#48125)

(cherry picked from commit 14f0569a39)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-06-18 17:26:55 +05:30
Mihir Kandoi
f0ae90011b Merge pull request #48107 from frappe/mergify/bp/version-15-hotfix/pr-48077 2025-06-18 11:08:43 +05:30
Bhavan23
d3daeaf475 fix(asset-invoice): handle asset invoice cancellation 2025-06-18 10:54:24 +05:30
rohitwaghchaure
79a9d583d9 Merge pull request #48113 from frappe/mergify/bp/version-15-hotfix/pr-47988
fix: stock reconciliation validation for serial nos (backport #47988)
2025-06-17 23:18:24 +05:30
Rohit Waghchaure
89376ddf8d fix: stock reconciliation validation for serial and batch
(cherry picked from commit 69d54d2e0f)
2025-06-17 17:31:05 +00:00
Frappe PR Bot
d2ac603fd7 chore(release): Bumped to Version 15.65.2
## [15.65.2](https://github.com/frappe/erpnext/compare/v15.65.1...v15.65.2) (2025-06-17)

### Bug Fixes

* add validation for calculate ageing with filter for summary and other reports ([23db22a](23db22ac0b))
* add validation for exchange gain/loss entries ([97f1304](97f13049ee))
* add validation for party type ([baa08ce](baa08ce496))
* batch page length ([994454b](994454bfc3))
* budget naming series (backport [#48075](https://github.com/frappe/erpnext/issues/48075)) ([#48080](https://github.com/frappe/erpnext/issues/48080)) ([4d18fd0](4d18fd0e80))
* do not allow capitalization from connection tab for submitted asset ([7b5e2a6](7b5e2a6af0))
* do not reset party account for return doc ([ad5421a](ad5421a413))
* float division by zero ([40504b8](40504b8da2))
* incorrect condition for setting party account on change of company ([f2b9e73](f2b9e73819))
* incorrect warehouse set from SO to MR ([e9365d7](e9365d7272))
* pos invoice consolidation row refer issue (backport [#48057](https://github.com/frappe/erpnext/issues/48057)) ([#48058](https://github.com/frappe/erpnext/issues/48058)) ([db9f0b6](db9f0b6f38))
* prevent saving negative quantity in BOM ([1c9032a](1c9032a4c2))
* unpack non-iterable NoneType object error ([dd39d24](dd39d24da0))
* update asset status after making asset value adjustment record ([ee30357](ee30357835))
2025-06-17 14:51:34 +00:00
ruthra kumar
3340b19c5d Merge pull request #48100 from frappe/version-15-hotfix
chore: release v15
2025-06-17 20:20:01 +05:30
Mihir Kandoi
b33bec4dad fix: use set_query on sales_order link field in work order
(cherry picked from commit 6def182e1a)
2025-06-17 12:09:08 +00:00
Sagar Vora
4d1022182d Merge pull request #48105 from frappe/mergify/bp/version-15-hotfix/pr-48104
fix: incorrect condition for setting party account on change of company (backport #48104)
2025-06-17 11:26:35 +00:00
ljain112
f2b9e73819 fix: incorrect condition for setting party account on change of company
(cherry picked from commit 20565f5f19)
2025-06-17 11:26:13 +00:00
ruthra kumar
31cb78e3f3 Merge pull request #48101 from frappe/mergify/bp/version-15-hotfix/pr-47898
Pegged currency (backport #47898)
2025-06-17 16:00:54 +05:30
ruthra kumar
789cd20d2d Merge pull request #48102 from frappe/mergify/bp/version-15-hotfix/pr-48098
fix: do not reset party account for return doc (backport #48098)
2025-06-17 15:42:32 +05:30
Karuppasamy
cb58d05777 Merge pull request #47898 from aerele/pegged-currency
Pegged currency

(cherry picked from commit cec0ffad06)

# Conflicts:
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.json
#	erpnext/patches.txt
#	erpnext/setup/install.py
2025-06-17 15:32:36 +05:30
ljain112
ad5421a413 fix: do not reset party account for return doc
(cherry picked from commit 7e758a9d5b)
2025-06-17 09:59:44 +00:00
ruthra kumar
84f9a1fb2d Merge pull request #48094 from frappe/mergify/bp/version-15-hotfix/pr-48082
fix:add validation for party type (backport #48082)
2025-06-17 15:14:34 +05:30
ruthra kumar
7d88b8bbb9 Merge pull request #48093 from frappe/mergify/bp/version-15-hotfix/pr-47879
fix: add validation for exchange gain/loss entries (backport #47879)
2025-06-17 13:59:08 +05:30
AlcinSnowlina
baa08ce496 fix: add validation for party type
(cherry picked from commit 7c9d6aaae2)
2025-06-17 08:26:07 +00:00
ruthra kumar
7031a5033c Merge pull request #48092 from frappe/mergify/bp/version-15-hotfix/pr-48076
fix: Prevent saving negative quantity in BOM (backport #48076)
2025-06-17 13:47:20 +05:30
l0gesh29
1f1e88d52e test: add test for debit/credit calculations in exchange gain/loss account filter in GL
(cherry picked from commit 6ea32a8762)

# Conflicts:
#	erpnext/accounts/report/general_ledger/test_general_ledger.py
2025-06-17 13:42:02 +05:30
l0gesh29
97f13049ee fix: add validation for exchange gain/loss entries
(cherry picked from commit d992f67658)
2025-06-17 08:04:57 +00:00
iamkhanraheel
1c9032a4c2 fix: prevent saving negative quantity in BOM
(cherry picked from commit e52d83e756)
2025-06-17 07:50:27 +00:00
Khushi Rawat
323a91ddd7 Merge pull request #48090 from khushi8112/update-asset-status-after-revaluation-v15-backport
fix: update asset status after making asset value adjustment record
2025-06-17 13:06:50 +05:30
Khushi Rawat
ee30357835 fix: update asset status after making asset value adjustment record 2025-06-17 12:35:44 +05:30
mergify[bot]
4d18fd0e80 fix: budget naming series (backport #48075) (#48080)
* fix: budget naming series (#48075)

(cherry picked from commit c4bdf2a721)

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

* chore: resolve conflict

---------

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-06-17 11:21:54 +05:30
Abdeali Chharchhoda
fc8d451c55 fix: use flt value of bin qty
(cherry picked from commit 0a8e42a358)
2025-06-16 12:54:44 +00:00
rohitwaghchaure
d054486495 Merge pull request #48065 from frappe/mergify/bp/version-15-hotfix/pr-48061
fix: incorrect warehouse set from SO to MR (backport #48061)
2025-06-16 14:52:44 +05:30
Rohit Waghchaure
e9365d7272 fix: incorrect warehouse set from SO to MR
(cherry picked from commit 0da8d9c869)
2025-06-16 04:42:27 +00:00
ruthra kumar
b3578ecf09 Merge pull request #48063 from frappe/mergify/bp/version-15-hotfix/pr-48036
fix: add validation for calculate ageing with filter for summary and … (backport #48036)
2025-06-16 09:52:37 +05:30
l0gesh29
23db22ac0b fix: add validation for calculate ageing with filter for summary and other reports
(cherry picked from commit c630aa9fe8)
2025-06-16 03:10:11 +00:00
rohitwaghchaure
85099a3a68 Merge pull request #48044 from frappe/mergify/bp/version-15-hotfix/pr-48037
fix: float division by zero (backport #48037)
2025-06-15 18:29:02 +05:30
mergify[bot]
db9f0b6f38 fix: pos invoice consolidation row refer issue (backport #48057) (#48058)
fix: pos invoice consolidation row refer issue (#48057)

(cherry picked from commit 4178d9e2a1)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-06-13 20:08:22 +05:30
mergify[bot]
56311e6e1e build(deps): bump rapidfuzz (backport #47503) (#48051)
build(deps): bump rapidfuzz (#47503)


(cherry picked from commit c275c55d6c)

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Co-authored-by: Akhil Narang <me@akhilnarang.dev>
2025-06-13 16:01:08 +05:30
Rohit Waghchaure
40504b8da2 fix: float division by zero
(cherry picked from commit 59cbe85817)
2025-06-13 02:50:28 +00:00
rohitwaghchaure
379def5f0f Merge pull request #48022 from frappe/mergify/bp/version-15-hotfix/pr-48018
fix: batch page length (backport #48018)
2025-06-12 15:47:24 +05:30
Khushi Rawat
ab6a534df2 Merge pull request #48032 from frappe/mergify/bp/version-15-hotfix/pr-48031
fix: do not allow capitalization from connection tab for submitted asset (backport #48031)
2025-06-12 15:22:06 +05:30
Khushi Rawat
7b5e2a6af0 fix: do not allow capitalization from connection tab for submitted asset
(cherry picked from commit 27bec4cde5)
2025-06-12 09:48:10 +00:00
Rohit Waghchaure
994454bfc3 fix: batch page length
(cherry picked from commit 338256b799)
2025-06-11 14:33:13 +00:00
Frappe PR Bot
9febca2981 chore(release): Bumped to Version 15.65.1
## [15.65.1](https://github.com/frappe/erpnext/compare/v15.65.0...v15.65.1) (2025-06-11)

### Bug Fixes

* unpack non-iterable NoneType object error ([f92b5b9](f92b5b9a2e))
2025-06-11 12:51:34 +00:00
Sagar Vora
62efd09f2f Merge pull request #48021 from frappe/mergify/bp/version-15/pr-48019
fix: unpack non-iterable NoneType object error in patch (backport #48019)
2025-06-11 12:50:06 +00:00
Sagar Vora
b8f1c8f6b1 Merge pull request #48020 from frappe/mergify/bp/version-15-hotfix/pr-48019
fix: unpack non-iterable NoneType object error in patch (backport #48019)
2025-06-11 12:49:27 +00:00
priyanshshah2442
f92b5b9a2e fix: unpack non-iterable NoneType object error
(cherry picked from commit 7d940faa4f)
2025-06-11 12:49:17 +00:00
priyanshshah2442
dd39d24da0 fix: unpack non-iterable NoneType object error
(cherry picked from commit 7d940faa4f)
2025-06-11 12:49:05 +00:00
Frappe PR Bot
dc8bb792d7 chore(release): Bumped to Version 15.65.0
# [15.65.0](https://github.com/frappe/erpnext/compare/v15.64.1...v15.65.0) (2025-06-10)

### Bug Fixes

* add .length in list validation ([#47974](https://github.com/frappe/erpnext/issues/47974)) ([66f41d4](66f41d44c4))
* add change log for bug fix in Additional Discount functionality ([f27e591](f27e591d88))
* add draft transactions also in calculated mismatch report ([23b5d2d](23b5d2db2c))
* add user permission while fetching ple ([a2cdd91](a2cdd91a0d))
* **asset:** make purchase date mandatory ([a5e5553](a5e5553520))
* AttributeError due to incorrect object ([43d4e26](43d4e26ac5))
* available qty in BOM Stock Report ([84b2f87](84b2f871ba))
* better description of tab name ([#44697](https://github.com/frappe/erpnext/issues/44697)) ([d05b49b](d05b49b0f8))
* changes in report ([78c6386](78c63869e0))
* changes to report and patch ([5237ff8](5237ff8d94))
* conflicts ([aa29c5d](aa29c5dde2))
* consider expired batches in the stock reco (backport [#47909](https://github.com/frappe/erpnext/issues/47909)) ([#47919](https://github.com/frappe/erpnext/issues/47919)) ([2e78e14](2e78e14c7e))
* consider user permission while populating the data ([617b065](617b0658b8))
* do not create repeat work orders ([795108c](795108c1dd))
* do not remove item which has zero qty and zero valuation ([ef77791](ef77791bd6))
* ensure proper float conversion for discount values ([d24c2c4](d24c2c4cca))
* fetch correct item tax template on item rate update ([#47973](https://github.com/frappe/erpnext/issues/47973)) ([f88e682](f88e68230a))
* fieldtype to Currency for discount amounts ([59dd5fe](59dd5fee26))
* incorrect warehouse in MR ([8156d89](8156d89903))
* key-error for COGS By Item Group report (backport [#47914](https://github.com/frappe/erpnext/issues/47914)) ([#47915](https://github.com/frappe/erpnext/issues/47915)) ([996fb75](996fb7552a))
* patch to set discount percentange in case of mismatch ([039c47e](039c47e3f2))
* pos permission error on strict permission (backport [#47896](https://github.com/frappe/erpnext/issues/47896)) ([#47897](https://github.com/frappe/erpnext/issues/47897)) ([0314a39](0314a39fab))
* Project argument is passed correctly for MR creation ([e98ad4c](e98ad4ce27))
* remove currency col ([35035c2](35035c2a31))
* remove use sales invoice check ([#47908](https://github.com/frappe/erpnext/issues/47908)) ([1b15507](1b1550708d))
* **report:** include descendants when filtering by parent item group ([d21bfa2](d21bfa219d))
* **sales order:** error message on creation of work order from sales order ([129cd7a](129cd7ae8a))
* stock adjustment entry during reposting (backport [#47878](https://github.com/frappe/erpnext/issues/47878)) ([#47883](https://github.com/frappe/erpnext/issues/47883)) ([e5d06f8](e5d06f8c86))
* stock reco qty with inventory dimension (backport [#47918](https://github.com/frappe/erpnext/issues/47918)) ([#47922](https://github.com/frappe/erpnext/issues/47922)) ([6d2c14c](6d2c14c75e))
* test case to verify correct setting of discount amount and percentage ([06ea957](06ea957ae5))
* throw permission error ([#47976](https://github.com/frappe/erpnext/issues/47976)) ([9167d2e](9167d2ef64))
* typo ([8b4824f](8b4824fef5))
* update currency based on transaction ([eaeb18c](eaeb18c651))
* zero division error in purchase receipt ([b99f8fd](b99f8fd021))

### Features

* Add hook to update gl dict by apps ([76c2477](76c2477d23))
* add validation for inter company transactions ([9a47c50](9a47c507c0))
* populate Timer dialog project field from Timesheet parent_project (backport [#47971](https://github.com/frappe/erpnext/issues/47971)) ([#48001](https://github.com/frappe/erpnext/issues/48001)) ([66b0426](66b0426155))
* report to verify discount amount mismatch ([b3eb49d](b3eb49d39d))

### Performance Improvements

* Batch GLE/SLE rename commits (backport [#47950](https://github.com/frappe/erpnext/issues/47950)) ([#47951](https://github.com/frappe/erpnext/issues/47951)) ([f490de9](f490de9285))

### Reverts

* Revert "fix: calculate discount percentage if discount amount is specified (#…" ([5a5449c](5a5449c60c))
2025-06-10 14:33:55 +00:00
ruthra kumar
bd11146f02 Merge pull request #47996 from frappe/version-15-hotfix
chore: release v15
2025-06-10 20:02:19 +05:30
rohitwaghchaure
33f1d7a5fe Merge pull request #48004 from frappe/mergify/bp/version-15-hotfix/pr-47998
fix: incorrect warehouse in MR (backport #47998)
2025-06-10 18:41:17 +05:30
rohitwaghchaure
60de0474a1 chore: fix conflicts 2025-06-10 18:19:27 +05:30
Rohit Waghchaure
8156d89903 fix: incorrect warehouse in MR
(cherry picked from commit 2b9ca79291)

# Conflicts:
#	erpnext/manufacturing/doctype/production_plan/production_plan.py
2025-06-10 12:41:26 +00:00
mergify[bot]
66b0426155 feat: populate Timer dialog project field from Timesheet parent_project (backport #47971) (#48001)
feat: populate Timer dialog project field from Timesheet parent_project (#47971)

* feat: default parent project in timer dialog > project

* chore: fix formatting

* fix: remove unnecessary or condition

---------


(cherry picked from commit bc87609264)

Co-authored-by: Rahul Agrawal <12agrawalrahul@gmail.com>
Co-authored-by: Rahul Agrawal <deathstarconsole@Rahuls-MacBook-Air.local>
2025-06-10 18:07:28 +05:30
rohitwaghchaure
60b12b8319 Merge pull request #47992 from frappe/mergify/bp/version-15-hotfix/pr-47969
fix: do not create repeat work orders (backport #47969)
2025-06-10 16:40:54 +05:30
ruthra kumar
112d40db22 Merge pull request #47994 from frappe/mergify/bp/version-15-hotfix/pr-47981
refactor(Work Order): query_sales_order (backport #47981)
2025-06-10 15:01:09 +05:30
ruthra kumar
0d0b05bf6c Merge pull request #47991 from frappe/mergify/bp/version-15-hotfix/pr-47923
fix: update currency based on transaction (backport #47923)
2025-06-10 14:42:05 +05:30
rohitwaghchaure
c2d7e8c471 chore: fix conflicts 2025-06-10 14:38:18 +05:30
rohitwaghchaure
ccb0f7ac42 chore: fix conflicts 2025-06-10 14:36:31 +05:30
rohitwaghchaure
781b66e252 chore: fix conflicts 2025-06-10 14:35:23 +05:30
barredterra
efd3b1c966 refactor(Work Order): query_sales_order
- Use `get_list` instead of `db.sql_list`

    The method is used for setting link options in the frontend and the Link field doesn't ignore permissions, so get_list should be fine here.

- Added type hints to enable argument validation

(cherry picked from commit 2dbdacf905)
2025-06-10 09:03:18 +00:00
Rohit Waghchaure
795108c1dd fix: do not create repeat work orders
(cherry picked from commit 384f4e120a)

# Conflicts:
#	erpnext/manufacturing/doctype/production_plan/production_plan.js
#	erpnext/manufacturing/doctype/production_plan/test_production_plan.py
#	erpnext/manufacturing/doctype/production_plan_sub_assembly_item/production_plan_sub_assembly_item.json
2025-06-10 09:00:27 +00:00
rohitwaghchaure
7348778220 Merge pull request #47941 from frappe/mergify/bp/version-15-hotfix/pr-47888
fix: do not remove item which has zero qty and zero valuation (backport #47888)
2025-06-10 14:29:54 +05:30
DHINESH00
eaeb18c651 fix: update currency based on transaction
(cherry picked from commit fc4f38eed1)
2025-06-10 08:56:37 +00:00
rohitwaghchaure
78607b5812 Merge pull request #47987 from frappe/mergify/bp/version-15-hotfix/pr-47942
fix: available qty in BOM Stock Report (backport #47942)
2025-06-10 14:02:43 +05:30
Sagar Vora
823cfeaf4f Merge pull request #47978 from frappe/mergify/bp/version-15-hotfix/pr-47976
fix: throw permission error (backport #47976)
2025-06-10 07:37:10 +00:00
Sagar Vora
aa29c5dde2 fix: conflicts 2025-06-10 13:05:37 +05:30
ruthra kumar
713b17c3a5 Merge pull request #47990 from frappe/mergify/bp/version-15-hotfix/pr-47989
fix: Include draft transactions in the `Calculated Discount Mismatch` report (backport #47989)
2025-06-10 12:58:05 +05:30
priyanshshah2442
23b5d2db2c fix: add draft transactions also in calculated mismatch report
(cherry picked from commit 4e1abc1814)
2025-06-10 07:12:03 +00:00
Rohit Waghchaure
84b2f871ba fix: available qty in BOM Stock Report
(cherry picked from commit ea689bbe3f)
2025-06-10 06:50:51 +00:00
Sagar Vora
ac78bfb55b Merge pull request #47985 from frappe/mergify/bp/version-15-hotfix/pr-47946
fix: patch and report for incorrect discount values (backport #47946)
2025-06-10 06:10:23 +00:00
priyanshshah2442
59dd5fee26 fix: fieldtype to Currency for discount amounts
(cherry picked from commit f781a39dbe)
2025-06-10 06:04:09 +00:00
Sagar Vora
35035c2a31 fix: remove currency col
(cherry picked from commit 9bf9b34ac4)
2025-06-10 06:04:08 +00:00
Sagar Vora
78c63869e0 fix: changes in report
(cherry picked from commit 33e793354c)
2025-06-10 06:04:08 +00:00
priyanshshah2442
06ea957ae5 fix: test case to verify correct setting of discount amount and percentage
(cherry picked from commit 3f0c5be5d9)
2025-06-10 06:04:08 +00:00
priyanshshah2442
f27e591d88 fix: add change log for bug fix in Additional Discount functionality
(cherry picked from commit 9120927a65)
2025-06-10 06:04:08 +00:00
priyanshshah2442
d24c2c4cca fix: ensure proper float conversion for discount values
(cherry picked from commit 3dcb801a37)
2025-06-10 06:04:07 +00:00
Sagar Vora
5237ff8d94 fix: changes to report and patch
(cherry picked from commit daad6137f8)
2025-06-10 06:04:07 +00:00
priyanshshah2442
b3eb49d39d feat: report to verify discount amount mismatch
(cherry picked from commit 62dd6df24f)
2025-06-10 06:04:07 +00:00
priyanshshah2442
039c47e3f2 fix: patch to set discount percentange in case of mismatch
(cherry picked from commit f7eda8a156)
2025-06-10 06:04:06 +00:00
ruthra kumar
7ecb4d3d6f Merge pull request #47968 from aerele/validate-intercompany-rate
Add validation for inter company transactions rate
2025-06-10 11:12:26 +05:30
ruthra kumar
76a9e45ff8 Merge pull request #47982 from frappe/mergify/bp/version-15-hotfix/pr-47974
fix: add .length in list validation (backport #47974)
2025-06-10 10:25:21 +05:30
ruthra kumar
c69a0f150d Merge pull request #47934 from thomasantony12/so_bug_on_wo
fix(sales order): error message on creation of work order from sales order
2025-06-10 10:19:33 +05:30
l0gesh29
66f41d44c4 fix: add .length in list validation (#47974)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
(cherry picked from commit c8cec8cedf)
2025-06-09 23:16:36 +00:00
Khushi Rawat
7393a9f470 Merge pull request #47980 from frappe/mergify/bp/version-15-hotfix/pr-47979
fix: AttributeError due to incorrect object (backport #47979)
2025-06-10 00:31:45 +05:30
Khushi Rawat
43d4e26ac5 fix: AttributeError due to incorrect object
(cherry picked from commit 351796bce6)
2025-06-09 18:46:03 +00:00
Aayush Dalal
9167d2ef64 fix: throw permission error (#47976)
Co-authored-by: Sagar Vora <16315650+sagarvora@users.noreply.github.com>
(cherry picked from commit 8b6a8d0c4f)

# Conflicts:
#	erpnext/stock/utils.py
2025-06-09 17:29:58 +00:00
Diptanil Saha
f88e68230a fix: fetch correct item tax template on item rate update (#47973) 2025-06-09 19:23:33 +05:30
ravibharathi656
3aee14176c test: pass sales invoice name instead of doc 2025-06-09 19:12:51 +05:30
ravibharathi656
d6796da464 test: add unit test for inter company transaction rate validation 2025-06-09 19:12:51 +05:30
ravibharathi656
9a47c507c0 feat: add validation for inter company transactions 2025-06-09 19:12:51 +05:30
ruthra kumar
95d1d7047d Merge pull request #47967 from frappe/mergify/bp/version-15-hotfix/pr-47865
fix: consider user permission while populating the data (backport #47865)
2025-06-09 15:41:37 +05:30
l0gesh29
a2cdd91a0d fix: add user permission while fetching ple
(cherry picked from commit 1a4bb30923)
2025-06-09 09:53:13 +00:00
l0gesh29
617b0658b8 fix: consider user permission while populating the data
(cherry picked from commit 074dc6d7dd)
2025-06-09 09:53:13 +00:00
Khushi Rawat
d8e9ed417d Merge pull request #47943 from frappe/mergify/bp/version-15-hotfix/pr-47547
fix(asset): make purchase date mandatory (backport #47547)
2025-06-09 14:48:57 +05:30
ruthra kumar
eb7eadc16f Merge pull request #47590 from FathihMohammed/show_descedants
fix(report): include descendants when filtering by parent item group
2025-06-09 13:31:41 +05:30
FATHIH MOHAMMED
d21bfa219d fix(report): include descendants when filtering by parent item group 2025-06-09 11:54:32 +05:30
ruthra kumar
198089cac1 Merge pull request #47958 from frappe/mergify/bp/version-15-hotfix/pr-44697
fix: better description of tab name (backport #44697)
2025-06-09 10:17:31 +05:30
mahsem
d05b49b0f8 fix: better description of tab name (#44697)
(cherry picked from commit 6119d4384a)
2025-06-08 20:15:11 +00:00
mergify[bot]
f490de9285 perf: Batch GLE/SLE rename commits (backport #47950) (#47951)
perf: Batch GLE/SLE rename commits (#47950)

(cherry picked from commit bb693c0a4f)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2025-06-06 21:00:49 +05:30
RAVIBHARATHI P C
a5e5553520 fix(asset): make purchase date mandatory
(cherry picked from commit e6f47be4b0)
2025-06-06 12:10:43 +00:00
rohitwaghchaure
ea393ef008 chore: fix conflicts 2025-06-06 15:38:10 +05:30
Rohit Waghchaure
ef77791bd6 fix: do not remove item which has zero qty and zero valuation
(cherry picked from commit 86e4a658a5)

# Conflicts:
#	erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
2025-06-06 10:03:14 +00:00
Frappe PR Bot
63d165c48a chore(release): Bumped to Version 15.64.1
## [15.64.1](https://github.com/frappe/erpnext/compare/v15.64.0...v15.64.1) (2025-06-06)

### Reverts

* Revert "fix: calculate discount percentage if discount amount is specified (#…" ([29d7593](29d7593fa7))
2025-06-06 07:07:12 +00:00
thomasantony12
129cd7ae8a fix(sales order): error message on creation of work order from sales order 2025-06-06 12:36:30 +05:30
Sagar Vora
83a57909d3 Merge pull request #47933 from frappe/mergify/bp/version-15/pr-47927
fix: calculate discount percentage if discount amount is specified" (backport #47927)
2025-06-06 07:05:40 +00:00
Sagar Vora
29d7593fa7 Revert "fix: calculate discount percentage if discount amount is specified (#…"
This reverts commit bb474f4f42.

(cherry picked from commit 27dc0f5b70)
2025-06-06 07:05:26 +00:00
Sagar Vora
a8e1c4f6cd Merge pull request #47928 from frappe/mergify/bp/version-15-hotfix/pr-47927
fix: calculate discount percentage if discount amount is specified" (backport #47927)
2025-06-06 06:07:35 +00:00
Sagar Vora
5a5449c60c Revert "fix: calculate discount percentage if discount amount is specified (#…"
This reverts commit bb474f4f42.

(cherry picked from commit 27dc0f5b70)
2025-06-06 06:07:15 +00:00
mergify[bot]
6d2c14c75e fix: stock reco qty with inventory dimension (backport #47918) (#47922)
fix: stock reco qty with inventory dimension (#47918)

(cherry picked from commit 342cebc778)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-06-06 09:51:23 +05:30
mergify[bot]
2e78e14c7e fix: consider expired batches in the stock reco (backport #47909) (#47919)
fix: consider expired batches in the stock reco (#47909)

(cherry picked from commit 8fa3473945)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-06-05 17:35:23 +05:30
mergify[bot]
996fb7552a fix: key-error for COGS By Item Group report (backport #47914) (#47915)
fix: key-error for COGS By Item Group report (#47914)

fix: keyerror for COGS By Item Group report
(cherry picked from commit 997ce4eaa7)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-06-05 17:18:30 +05:30
Deepesh Garg
04349b61bd Merge pull request #47917 from frappe/mergify/bp/version-15-hotfix/pr-47907
feat: Add hook to update gl dict by apps (backport #47907)
2025-06-05 16:51:20 +05:30
Deepesh Garg
d3202068d9 style: Linting issues
(cherry picked from commit c4aecb15ce)
2025-06-05 11:03:52 +00:00
Deepesh Garg
76c2477d23 feat: Add hook to update gl dict by apps
(cherry picked from commit 10ff369ff2)
2025-06-05 11:03:51 +00:00
Diptanil Saha
1b1550708d fix: remove use sales invoice check (#47908) 2025-06-05 14:08:37 +05:30
ruthra kumar
425674e164 Merge pull request #47906 from frappe/mergify/bp/version-15-hotfix/pr-47665
fix: Project argument is not passed correctly for MR creation (backport #47665)
2025-06-05 11:53:22 +05:30
Syed Mujeer Hashmi
e98ad4ce27 fix: Project argument is passed correctly for MR creation
(cherry picked from commit 9eab434ae8)
2025-06-05 06:21:32 +00:00
mergify[bot]
0314a39fab fix: pos permission error on strict permission (backport #47896) (#47897)
fix: pos permission error on strict permission (#47896)

(cherry picked from commit bb903a4bef)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-06-04 16:11:07 +05:30
mergify[bot]
e5d06f8c86 fix: stock adjustment entry during reposting (backport #47878) (#47883)
fix: stock adjustment entry during reposting (#47878)

fix: stock adjustment entry
(cherry picked from commit cbcd580daa)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-06-04 12:51:10 +05:30
ruthra kumar
fb5d60eeb6 Merge pull request #47873 from frappe/mergify/bp/version-15-hotfix/pr-47872
fix: typo (backport #47872)
2025-06-03 19:49:47 +05:30
Mihir Kandoi
8d7be8a536 Merge pull request #47876 from frappe/mergify/bp/version-15-hotfix/pr-47874 2025-06-03 19:09:52 +05:30
Mihir Kandoi
b99f8fd021 fix: zero division error in purchase receipt
(cherry picked from commit 32229fb646)
2025-06-03 13:09:28 +00:00
Ayush Marhatta
8b4824fef5 fix: typo
(cherry picked from commit a243abb5fd)
2025-06-03 12:09:06 +00:00
Frappe PR Bot
916511ef1a chore(release): Bumped to Version 15.64.0
# [15.64.0](https://github.com/frappe/erpnext/compare/v15.63.0...v15.64.0) (2025-06-03)

### Bug Fixes

* Accounts receivable shouldn't fetch DN for employees ([9f5cfdd](9f5cfdd65b))
* add company filter to cost center and project in process statement of accounts ([5ebf1b9](5ebf1b9cc4))
* add internal link field in Sales Order connections for internal transactions ([3c697e9](3c697e90a3))
* calculate discount percentage if discount amount is specified ([#47806](https://github.com/frappe/erpnext/issues/47806)) ([ba8a316](ba8a316b06))
* cash flow report fixes ([4a1966c](4a1966c680))
* check return_against exists before api call ([8623a56](8623a5650b))
* decimal issue ([#47839](https://github.com/frappe/erpnext/issues/47839)) ([34b62d2](34b62d226c))
* ensure backend response is awaited before saving ([5a23d7c](5a23d7cdca))
* GL entries for rejected returned materials ([#47612](https://github.com/frappe/erpnext/issues/47612)) ([5bac652](5bac652b5f))
* Handle duplicate Items qty in Quotation ([4c1b415](4c1b415b9d))
* improved indexing for SLE queries. (backport [#47194](https://github.com/frappe/erpnext/issues/47194)) ([#47822](https://github.com/frappe/erpnext/issues/47822)) ([3879cbd](3879cbd86d))
* incorrect actual qty in product bundle balance report (backport [#47791](https://github.com/frappe/erpnext/issues/47791)) ([#47814](https://github.com/frappe/erpnext/issues/47814)) ([9df3b9b](9df3b9b059))
* **Timesheet:** Only update to_time if it's more than 1 second off ([#47702](https://github.com/frappe/erpnext/issues/47702)) ([470534a](470534af78))
* use `query.walk() `for escaping special chars in receiable/payable report ([2e3ebec](2e3ebec53c))
* use user default for company instead of global default in purchase order analysis report ([7d828dc](7d828dc17e))

### Features

* add column "Item Name" to "BOM Stock Report" (backport [#47116](https://github.com/frappe/erpnext/issues/47116)) ([#47485](https://github.com/frappe/erpnext/issues/47485)) ([9192913](9192913832))
* allow to set valuation rate for Rejected Materials (backport [#47582](https://github.com/frappe/erpnext/issues/47582)) ([#47869](https://github.com/frappe/erpnext/issues/47869)) ([3582b32](3582b32f03))
* show item name for raw materials in BOM creator ([0c612be](0c612be6fe))
* specify expense account and cost center for raw materials in Su… (backport [#47756](https://github.com/frappe/erpnext/issues/47756)) ([#47861](https://github.com/frappe/erpnext/issues/47861)) ([01dd733](01dd7337a2))
2025-06-03 11:54:42 +00:00
ruthra kumar
c614ff419b Merge pull request #47868 from frappe/version-15-hotfix
chore: release v15
2025-06-03 17:23:19 +05:30
ruthra kumar
d5163ed502 Merge pull request #47870 from frappe/mergify/bp/version-15-hotfix/pr-47612
fix: GL entries for rejected returned materials (backport #47612)
2025-06-03 16:45:02 +05:30
rohitwaghchaure
5bac652b5f fix: GL entries for rejected returned materials (#47612)
(cherry picked from commit 3e098da01f)
2025-06-03 10:57:14 +00:00
mergify[bot]
3582b32f03 feat: allow to set valuation rate for Rejected Materials (backport #47582) (#47869)
feat: allow to set valuation rate for Rejected Materials (#47582)

(cherry picked from commit ca0e53dd78)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-06-03 16:25:53 +05:30
ruthra kumar
2815a0d827 Merge pull request #47864 from frappe/mergify/bp/version-15-hotfix/pr-47854
fix: use user default for company instead of global default in purchase order analysis report (backport #47854)
2025-06-03 13:22:23 +05:30
Ayush Marhatta
7d828dc17e fix: use user default for company instead of global default in purchase order analysis report
(cherry picked from commit 49f23513e0)
2025-06-03 07:48:19 +00:00
mergify[bot]
01dd7337a2 feat: specify expense account and cost center for raw materials in Su… (backport #47756) (#47861) 2025-06-03 12:28:12 +05:30
Marc Ramser
470534af78 fix(Timesheet): Only update to_time if it's more than 1 second off (#47702)
* Fix: Only update to_time if it's more than 1 second off

Before, to_time was updated even when it was almost the same as the expected time (like 17:20 vs 17:19:59.998). This causes problems because of small rounding errors and caused valid times like 17:20 to be reset. Now, to_time is only updated if the difference is greater than 1 second.

To reproduce the current error:
* From Time 09:00:00
* To Time 17:20:00
Save 
To Time is 17:19:59

* Update erpnext/projects/doctype/timesheet/timesheet.py

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

* Update timesheet.py

---------

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-06-03 11:59:13 +05:30
ruthra kumar
a4fe89f65c Merge pull request #47860 from frappe/mergify/bp/version-15-hotfix/pr-47809
fix: cash flow report fixes (backport #47809)
2025-06-03 11:47:50 +05:30
Lakshit Jain
4a1966c680 fix: cash flow report fixes
(cherry picked from commit 20b87512d1)
2025-06-03 05:53:23 +00:00
ruthra kumar
cd7462dd87 Merge pull request #47852 from frappe/mergify/bp/version-15-hotfix/pr-47780
fix: add internal link field in Sales Order connections for internal … (backport #47780)
2025-06-03 09:59:31 +05:30
Karuppasamy923
3c697e90a3 fix: add internal link field in Sales Order connections for internal transactions
(cherry picked from commit e3e6503076)
2025-06-02 11:17:45 +00:00
ruthra kumar
6dde327713 Merge pull request #47849 from frappe/mergify/bp/version-15-hotfix/pr-47502
fix: Handle duplicate Items qty in Quotation (backport #47502)
2025-06-02 15:11:46 +05:30
ruthra kumar
16b10274cf Merge pull request #47840 from frappe/mergify/bp/version-15-hotfix/pr-47839
fix: decimal issue (backport #47839)
2025-06-02 14:51:08 +05:30
Abdeali Chharchhodawala
4c1b415b9d fix: Handle duplicate Items qty in Quotation
fix: Handle duplicate Items qty in Quotation
(cherry picked from commit 39f6d8ffb6)
2025-06-02 09:20:41 +00:00
ruthra kumar
d7124779bf Merge pull request #47842 from frappe/mergify/bp/version-15-hotfix/pr-47821
Accounts receivable show delivery note (backport #47821)
2025-06-02 14:02:05 +05:30
ruthra kumar
053a5b93ca Merge pull request #47844 from frappe/mergify/bp/version-15-hotfix/pr-47781
fix: add company filter to cost center and project in process statement of accounts (backport #47781)
2025-06-02 13:41:21 +05:30
l0gesh29
9f5cfdd65b fix: Accounts receivable shouldn't fetch DN for employees
* fix: reorder function call

* fix: Add condition to fetch return entries for specific party types

(cherry picked from commit c8e052f3c6)
2025-06-02 13:40:20 +05:30
ljain112
5ebf1b9cc4 fix: add company filter to cost center and project in process statement of accounts
(cherry picked from commit 14313b162a)
2025-06-02 08:08:42 +00:00
rohitwaghchaure
34b62d226c fix: decimal issue (#47839)
(cherry picked from commit 0dbd9efc91)
2025-06-02 07:55:28 +00:00
Mihir Kandoi
9bf8904c80 Merge pull request #47832 from frappe/mergify/bp/version-15-hotfix/pr-47806 2025-05-31 21:18:29 +05:30
Mihir Kandoi
ba8a316b06 fix: calculate discount percentage if discount amount is specified (#47806)
(cherry picked from commit bb474f4f42)
2025-05-31 15:23:21 +00:00
mergify[bot]
3879cbd86d fix: improved indexing for SLE queries. (backport #47194) (#47822)
* fix: improved indexing for SLE queries. (#47194)

(cherry picked from commit b49a835b4c)

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

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-05-30 15:36:51 +05:30
mergify[bot]
9df3b9b059 fix: incorrect actual qty in product bundle balance report (backport #47791) (#47814)
fix: incorrect actual qty in product bundle balance report (#47791)

(cherry picked from commit c544c3e018)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-05-30 14:01:32 +05:30
ruthra kumar
0131800df2 Merge pull request #47808 from frappe/mergify/bp/version-15-hotfix/pr-47794
fix: use `query.walk() `for escaping special chars in receiable/payable report (backport #47794)
2025-05-29 14:07:34 +05:30
ljain112
2e3ebec53c fix: use query.walk() for escaping special chars in receiable/payable report
(cherry picked from commit a0a51b5074)
2025-05-29 08:21:18 +00:00
mergify[bot]
ef9ccd7a57 chore: removed orphaned function (backport #47796) (#47804)
chore: removed orphaned function (#47796)

(cherry picked from commit cb9e6f6655)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-05-29 12:25:08 +05:30
Mihir Kandoi
903d9b50fe Merge pull request #47798 from frappe/mergify/bp/version-15-hotfix/pr-47792
feat: show item name for raw materials in BOM creator (backport #47792)
2025-05-28 20:28:51 +05:30
Mihir Kandoi
0c612be6fe feat: show item name for raw materials in BOM creator
(cherry picked from commit 90ba4ad1e1)
2025-05-28 14:23:24 +00:00
ruthra kumar
893a86e173 Merge pull request #47777 from frappe/mergify/bp/version-15-hotfix/pr-47041
fix: Check `return_against` and Await API Call (backport #47041)
2025-05-28 10:57:56 +05:30
Sanket322
5a23d7cdca fix: ensure backend response is awaited before saving
(cherry picked from commit c48db0b7c0)
2025-05-28 03:56:00 +00:00
Sanket322
8623a5650b fix: check return_against exists before api call
(cherry picked from commit 00b6b97197)
2025-05-28 03:56:00 +00:00
mergify[bot]
73bc57f53e Revert "fix: translate_pos_buttons" (backport #47773) (#47774)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
fix: translate_pos_buttons" (#47773)
2025-05-27 21:11:49 +02:00
mergify[bot]
9192913832 feat: add column "Item Name" to "BOM Stock Report" (backport #47116) (#47485)
Co-authored-by: Patrick Eißler <77415730+PatrickDEissler@users.noreply.github.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-05-27 19:21:41 +02:00
Frappe PR Bot
f59093c6b7 chore(release): Bumped to Version 15.63.0
# [15.63.0](https://github.com/frappe/erpnext/compare/v15.62.0...v15.63.0) (2025-05-27)

### Bug Fixes

* absence of rounding causing discrepancy in the valuation rate calculation (backport [#47700](https://github.com/frappe/erpnext/issues/47700)) ([#47711](https://github.com/frappe/erpnext/issues/47711)) ([f41bcc6](f41bcc6fec))
* add no_copy for lost reasons ([db97dbd](db97dbd394))
* create Quality Inspection button not showing (backport [#47746](https://github.com/frappe/erpnext/issues/47746)) ([#47750](https://github.com/frappe/erpnext/issues/47750)) ([60dfe36](60dfe36195))
* display stock value in currency format in chart warehouse wise stock value ([ba009f4](ba009f4626))
* do not update same field twice ([63ba27e](63ba27e359))
* exchange rate not being fetched when creating supplier quotation from MR ([2c22615](2c22615b6b))
* filter of item for manufacture type material request (backport [#47712](https://github.com/frappe/erpnext/issues/47712)) ([#47717](https://github.com/frappe/erpnext/issues/47717)) ([2961e59](2961e595c2))
* handle multiselect filters for tree doctypes in Customer Ledger Summary Report ([f783bf6](f783bf60a4))
* Headline rendered twice on first save ([f94a14c](f94a14c06a))
* include rejected amount in PI/PR overbilling validation logic ([#47572](https://github.com/frappe/erpnext/issues/47572)) ([cd1c10a](cd1c10a43f))
* incorrect inventory dimension for material transfer (backport [#47592](https://github.com/frappe/erpnext/issues/47592)) ([#47644](https://github.com/frappe/erpnext/issues/47644)) ([9a78283](9a78283ecb))
* incorrect valuation rate due to positive qty (backport [#47686](https://github.com/frappe/erpnext/issues/47686)) ([#47688](https://github.com/frappe/erpnext/issues/47688)) ([62aa1cd](62aa1cdb33))
* linter ([c44493f](c44493fd7e))
* Linter (due to conflicts resolved on gh) ([37f4cf5](37f4cf5367))
* Linters ([91e167f](91e167fe72))
* made changes specifically for value adjustment entry ([74e29f1](74e29f1218))
* Merge conflicts ([3deb11e](3deb11e5b2))
* only include advances within the tcs period ([a2f5975](a2f5975133))
* party account based on party type's account type ([d3d22f6](d3d22f699e))
* patch to rename group_by filter in custom reports (backport [#47709](https://github.com/frappe/erpnext/issues/47709)) ([#47730](https://github.com/frappe/erpnext/issues/47730)) ([a137944](a137944955))
* patch to set status cancelled for already cancelled pos invoices (backport [#47725](https://github.com/frappe/erpnext/issues/47725)) ([#47759](https://github.com/frappe/erpnext/issues/47759)) ([4fd1af2](4fd1af2118))
* **portal:** User cannot create 0 qty SQ from RFQ ([f95a3f5](f95a3f5b8b))
* pos invoice status not updating on cancel (backport [#47556](https://github.com/frappe/erpnext/issues/47556)) ([#47657](https://github.com/frappe/erpnext/issues/47657)) ([db318a4](db318a4e9b))
* prettier ([0f22646](0f2264658f))
* prettier ([2c8db09](2c8db092a0))
* Relabel unit price settings for more clarity ([8891f46](8891f46a22))
* setting paid amount to 0 when is_paid is unchecked in purchase invoice ([895231a](895231a8a7))
* show general ledger in doc currency in Process Statement Of Accounts ([b3cbbf2](b3cbbf2ce3))
* skip drop ship items (backport [#47670](https://github.com/frappe/erpnext/issues/47670)) ([#47718](https://github.com/frappe/erpnext/issues/47718)) ([e058885](e05888502f))
* skip last purchase rate for free item (backport [#47693](https://github.com/frappe/erpnext/issues/47693)) ([#47696](https://github.com/frappe/erpnext/issues/47696)) ([f17b7b5](f17b7b5ee9))
* space ([fe78bb6](fe78bb60c4))
* space ([194e41a](194e41a2d9))
* translate_pos_buttons ([01b0d10](01b0d1057e))
* Treat rows as Unit Price rows only until the qty is 0 ([d963601](d9636018f5))
* typo in TREE_DOCTYPES list "Terrirtory" should be "Territory" ([3d2d1ba](3d2d1ba072))
* updated value after depreciation after value adjustment ([8ed6e98](8ed6e98565))
* use pypika object `LiteralValue` for adding match conditions ([fb2df77](fb2df77da2))

### Features

* add validation for Item Tax Template on rate change ([92d5e91](92d5e91e1f))
* Unit Price Contract ([33366fc](33366fce6c))
* Unit Price Items in Buying (RFQ, SQ, PO) ([f8fa775](f8fa775af3))
2025-05-27 14:56:33 +00:00
ruthra kumar
7ede5392bd Merge pull request #47758 from frappe/version-15-hotfix
chore: release v15
2025-05-27 20:24:59 +05:30
ruthra kumar
0f5c7d95a0 Merge pull request #47772 from frappe/mergify/bp/version-15-hotfix/pr-47766
fix: handle multiselect filters for tree doctypes in Customer Ledger Summary Report (backport #47766)
2025-05-27 20:09:05 +05:30
ljain112
f783bf60a4 fix: handle multiselect filters for tree doctypes in Customer Ledger Summary Report
(cherry picked from commit 536f7d5ff8)
2025-05-27 14:24:08 +00:00
ruthra kumar
4c49ab19d6 Merge pull request #47769 from frappe/mergify/bp/version-15-hotfix/pr-47765
fix: use pypika object `LiteralValue` for adding match conditions (backport #47765)
2025-05-27 19:52:20 +05:30
ruthra kumar
de1afee75a Merge pull request #47770 from frappe/mergify/bp/version-15-hotfix/pr-47767
fix: add no_copy for lost reasons (backport #47767)
2025-05-27 19:52:04 +05:30
l0gesh29
db97dbd394 fix: add no_copy for lost reasons
(cherry picked from commit 98e889a516)
2025-05-27 12:33:50 +00:00
ljain112
fb2df77da2 fix: use pypika object LiteralValue for adding match conditions
(cherry picked from commit 9093e5e363)
2025-05-27 12:31:16 +00:00
ruthra kumar
260073f14a Merge pull request #47764 from frappe/mergify/bp/version-15-hotfix/pr-47763
feat: add validation for Item Tax Template on rate change (backport #47763)
2025-05-27 17:14:54 +05:30
Karuppasamy923
92d5e91e1f feat: add validation for Item Tax Template on rate change
(cherry picked from commit a9a957edc7)
2025-05-27 11:30:15 +00:00
mergify[bot]
4fd1af2118 fix: patch to set status cancelled for already cancelled pos invoices (backport #47725) (#47759)
* fix: patch to set status cancelled for already cancelled pos invoices (#47725)

(cherry picked from commit 4d1d66e579)

# Conflicts:
#	erpnext/patches.txt

* chore: resolve conflict

---------

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-05-27 15:55:40 +05:30
Khushi Rawat
5997e37454 Merge pull request #47754 from khushi8112/asset-value-adjustment-of-zero-cost
fix: updated value after depreciation after value adjustment
2025-05-27 15:28:11 +05:30
Khushi Rawat
63ba27e359 fix: do not update same field twice 2025-05-27 15:10:51 +05:30
ruthra kumar
fd19f284c4 Merge pull request #47755 from frappe/mergify/bp/version-15-hotfix/pr-47679
fix: setting paid amount to 0 when is_paid is unchecked in purchase invoice (backport #47679)
2025-05-27 14:37:21 +05:30
Khushi Rawat
74e29f1218 fix: made changes specifically for value adjustment entry 2025-05-27 14:14:30 +05:30
ruthra kumar
5dee1d40ac Merge pull request #47753 from frappe/mergify/bp/version-15-hotfix/pr-47736
fix: only include advances within the tcs period (backport #47736)
2025-05-27 14:11:01 +05:30
ljain112
895231a8a7 fix: setting paid amount to 0 when is_paid is unchecked in purchase invoice
(cherry picked from commit e358a9e53f)
2025-05-27 08:32:33 +00:00
Khushi Rawat
8ed6e98565 fix: updated value after depreciation after value adjustment 2025-05-27 13:34:03 +05:30
ruthra kumar
70f9c13f3c Merge pull request #47751 from frappe/mergify/bp/version-15-hotfix/pr-47737
fix: party account based on party type's account type (backport #47737)
2025-05-27 13:31:39 +05:30
ljain112
a2f5975133 fix: only include advances within the tcs period
(cherry picked from commit 477ec9fdcc)
2025-05-27 07:49:19 +00:00
ljain112
d3d22f699e fix: party account based on party type's account type
(cherry picked from commit 19b1650522)
2025-05-27 07:44:13 +00:00
mergify[bot]
60dfe36195 fix: create Quality Inspection button not showing (backport #47746) (#47750)
fix: create Quality Inspection button not showing (#47746)

(cherry picked from commit d8cb073eaf)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-05-27 13:06:32 +05:30
ruthra kumar
b9698366c3 Merge pull request #47747 from frappe/mergify/bp/version-15-hotfix/pr-47654
fix: show general ledger in doc currency in Process Statement Of Accounts (backport #47654)
2025-05-27 12:01:48 +05:30
ruthra kumar
1fb4ac44fe Merge pull request #47748 from frappe/mergify/bp/version-15-hotfix/pr-47659
fix: translate_pos_buttons (backport #47659)
2025-05-27 11:52:27 +05:30
mahsem
0f2264658f fix: prettier
(cherry picked from commit 2839fc9460)
2025-05-27 06:12:19 +00:00
mahsem
fe78bb60c4 fix: space
(cherry picked from commit 50a5b51909)
2025-05-27 06:12:19 +00:00
mahsem
194e41a2d9 fix: space
(cherry picked from commit a442ec4e80)
2025-05-27 06:12:19 +00:00
mahsem
2c8db092a0 fix: prettier
(cherry picked from commit 1953c8489c)
2025-05-27 06:12:19 +00:00
mahsem
c44493fd7e fix: linter
(cherry picked from commit 4a6b5b9993)
2025-05-27 06:12:18 +00:00
mahsem
01b0d1057e fix: translate_pos_buttons
(cherry picked from commit ce45d1664d)
2025-05-27 06:12:18 +00:00
ljain112
9d2f396d75 chore: update test case because currency is auto set to system currency
(cherry picked from commit 22a94d6817)
2025-05-27 06:11:09 +00:00
ljain112
b3cbbf2ce3 fix: show general ledger in doc currency in Process Statement Of Accounts
(cherry picked from commit 998f6a29a4)
2025-05-27 06:11:09 +00:00
ruthra kumar
0cbb7223be Merge pull request #47742 from frappe/mergify/bp/version-15-hotfix/pr-47697
refactor: Fetch party name for contract (backport #47697)
2025-05-26 19:56:31 +05:30
ruthra kumar
c09b258d57 chore: resolve conflicts 2025-05-26 17:48:11 +05:30
ruthra kumar
d5d1a51b92 refactor: patch old contract with full party name
(cherry picked from commit 8e2221178b)

# Conflicts:
#	erpnext/patches.txt
2025-05-26 12:11:31 +00:00
ruthra kumar
9abac4c6df refactor: fetch party name on selection
(cherry picked from commit 752024e222)
2025-05-26 12:11:31 +00:00
ruthra kumar
48f786e493 refactor: full name field in contract
(cherry picked from commit 016924361a)

# Conflicts:
#	erpnext/crm/doctype/contract/contract.json
2025-05-26 12:11:30 +00:00
mergify[bot]
a137944955 fix: patch to rename group_by filter in custom reports (backport #47709) (#47730)
* fix: patch to rename group_by filter in custom reports

(cherry picked from commit 0d19c18c06)

# Conflicts:
#	erpnext/patches.txt

* fix: using python instead of sql query

(cherry picked from commit 48eccb1f73)

* chore: resolve conflict

---------

Co-authored-by: diptanilsaha <diptanil@frappe.io>
2025-05-26 13:29:41 +05:30
ruthra kumar
bb54bebe94 Merge pull request #47726 from frappe/mergify/bp/version-15-hotfix/pr-47253
fix: display stock value in currency format in chart warehouse wise stock value (backport #47253)
2025-05-26 11:35:46 +05:30
Prateek Karamchandani
ba009f4626 fix: display stock value in currency format in chart warehouse wise stock value
(cherry picked from commit 7a5cbc759c)
2025-05-26 05:49:56 +00:00
mergify[bot]
e05888502f fix: skip drop ship items (backport #47670) (#47718)
fix: skip drop ship items (#47670)

(cherry picked from commit 67c86ec028)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-05-26 07:53:55 +05:30
mergify[bot]
2961e595c2 fix: filter of item for manufacture type material request (backport #47712) (#47717)
fix: filter of item for manufacture type material request (#47712)

(cherry picked from commit 874750f9ce)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-05-25 20:51:14 +05:30
mergify[bot]
f41bcc6fec fix: absence of rounding causing discrepancy in the valuation rate calculation (backport #47700) (#47711)
fix: absence of rounding causing discrepancy in the valuation rate calculation (#47700)

(cherry picked from commit 1e8ed22421)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-05-24 17:27:20 +05:30
Marica
a6b1bdc78b Merge pull request #47410 from frappe/mergify/bp/version-15-hotfix/pr-46214
feat: Unit Price Items (backport #46214)
2025-05-23 17:42:33 +02:00
mergify[bot]
f17b7b5ee9 fix: skip last purchase rate for free item (backport #47693) (#47696)
fix: skip last purchase rate for free item (#47693)

(cherry picked from commit c3b17024bd)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-05-23 09:49:51 +05:30
ruthra kumar
5529a17831 Merge pull request #47685 from frappe/mergify/bp/version-15-hotfix/pr-47675
fix: typo in TREE_DOCTYPES list "Terrirtory" should be "Territory" (backport #47675)
2025-05-22 16:25:15 +05:30
mergify[bot]
62aa1cdb33 fix: incorrect valuation rate due to positive qty (backport #47686) (#47688)
fix: incorrect valuation rate due to positive qty (#47686)

(cherry picked from commit 6ed97b5fda)

Co-authored-by: Khushi Rawat <142375893+khushi8112@users.noreply.github.com>
2025-05-22 16:17:18 +05:30
ljain112
3d2d1ba072 fix: typo in TREE_DOCTYPES list "Terrirtory" should be "Territory"
(cherry picked from commit 51162cb1a3)
2025-05-22 10:27:05 +00:00
Mihir Kandoi
f3bc80c89d Merge pull request #47678 from frappe/mergify/bp/version-15-hotfix/pr-47658
fix: exchange rate not being fetched when creating supplier quotation… (backport #47658)
2025-05-22 14:36:37 +05:30
Mihir Kandoi
6892994ef6 Merge pull request #47677 from frappe/mergify/bp/version-15-hotfix/pr-47572
fix: include rejected amount in PI/PR overbilling validation logic (backport #47572)
2025-05-22 14:36:19 +05:30
Mihir Kandoi
2c22615b6b fix: exchange rate not being fetched when creating supplier quotation from MR
(cherry picked from commit 9d12ae071a)
2025-05-22 07:26:50 +00:00
Mihir Kandoi
cd1c10a43f fix: include rejected amount in PI/PR overbilling validation logic (#47572)
* fix: include rejected amount in PI/PR overbilling validation logic

* fix: add check if amount is 0

* fix: unneccessary condition

(cherry picked from commit 8d9888b1b6)
2025-05-22 07:23:46 +00:00
mergify[bot]
db318a4e9b fix: pos invoice status not updating on cancel (backport #47556) (#47657)
fix: pos invoice status not updating on cancel (#47556)

(cherry picked from commit 8c86def018)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-05-21 15:09:48 +05:30
mergify[bot]
9a78283ecb fix: incorrect inventory dimension for material transfer (backport #47592) (#47644)
fix: incorrect inventory dimension for material transfer (#47592)

(cherry picked from commit 738cb6a0c1)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-05-20 20:46:57 +05:30
Frappe PR Bot
52a5cd9702 chore(release): Bumped to Version 15.62.0
# [15.62.0](https://github.com/frappe/erpnext/compare/v15.61.1...v15.62.0) (2025-05-20)

### Bug Fixes

* alias name and parent to prevent child row mapping issues ([612fa7c](612fa7c672))
* allow FG as RM by default (backport [#47543](https://github.com/frappe/erpnext/issues/47543)) ([#47550](https://github.com/frappe/erpnext/issues/47550)) ([9355782](9355782397))
* asset cancellation issue (backport [#47639](https://github.com/frappe/erpnext/issues/47639)) ([#47641](https://github.com/frappe/erpnext/issues/47641)) ([ce9da48](ce9da48a5e))
* asset image field updation issue (backport [#47615](https://github.com/frappe/erpnext/issues/47615)) ([#47617](https://github.com/frappe/erpnext/issues/47617)) ([35c7af1](35c7af1b9d))
* better validation message with solution for BOM recursion (backport [#47472](https://github.com/frappe/erpnext/issues/47472)) ([#47477](https://github.com/frappe/erpnext/issues/47477)) ([a450f4c](a450f4ce64))
* Broken test + use `super()` appropriately ([5b50d5a](5b50d5abf2))
* Conflicts ([9cede83](9cede83de1))
* correct expense amount in party ledger summary. ([09a46fc](09a46fcf0e))
* date formatting in process_statement_of_accounts accounts_receivable print format ([cf354c0](cf354c0da3))
* include only invoices with update_stock = 0  for billed amt in delivery note. ([70e190d](70e190dbbb))
* incorrect qty during reset (backport [#47593](https://github.com/frappe/erpnext/issues/47593)) ([#47595](https://github.com/frappe/erpnext/issues/47595)) ([72ae80e](72ae80e2e3))
* mapping of dispatch address when creating PO from SO (backport [#47552](https://github.com/frappe/erpnext/issues/47552)) ([#47553](https://github.com/frappe/erpnext/issues/47553)) ([30ec69c](30ec69c977))
* POS Invoice can't use Loyalty Points when Global Rounded Total is Disabled (backport [#47491](https://github.com/frappe/erpnext/issues/47491)) ([#47564](https://github.com/frappe/erpnext/issues/47564)) ([926c0c5](926c0c5cf4))
* pos item group filter fetching wrong items (backport [#47545](https://github.com/frappe/erpnext/issues/47545)) ([#47546](https://github.com/frappe/erpnext/issues/47546)) ([5a3eff0](5a3eff05a1))
* **quotation:** use `Text Editor` field in alternative items dialog for item description ([32eeeda](32eeedac24))
* remove hardcoded doctype in `make_return_doc` ([1a69d81](1a69d8137f))
* removed invalid child param to prevent callback failure ([073d06c](073d06c44f))
* **SalesAnalytics:** Ignore opening entries ([be280a4](be280a408e))
* set no_copy to party_balance field in Payment Entry ([da4ed5c](da4ed5cc18))
* set no_copy to party_balance field in Payment Entry ([52cab02](52cab02a5c))
* validate inter-company transaction address links ([86aa072](86aa072235))
* validation message format (backport [#47542](https://github.com/frappe/erpnext/issues/47542)) ([#47549](https://github.com/frappe/erpnext/issues/47549)) ([f225e19](f225e1986e))

### Features

* add checbox for validating time logs in job card ([80c7661](80c76618ae))
* add option to calculate ageing based on report date or today date ([69337cf](69337cf18b))
2025-05-20 13:54:53 +00:00
ruthra kumar
f3052a446f Merge pull request #47636 from frappe/version-15-hotfix
chore: release v15
2025-05-20 19:23:12 +05:30
mergify[bot]
ce9da48a5e fix: asset cancellation issue (backport #47639) (#47641)
fix: asset cancellation issue (#47639)

(cherry picked from commit 33ab64dec2)

Co-authored-by: Khushi Rawat <142375893+khushi8112@users.noreply.github.com>
2025-05-20 17:21:48 +05:30
mergify[bot]
a450f4ce64 fix: better validation message with solution for BOM recursion (backport #47472) (#47477)
fix: better validation message with solution for BOM recursion

(cherry picked from commit 7103cdd84a)

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
2025-05-20 16:15:23 +05:30
ruthra kumar
a029f2e8a3 Merge pull request #47633 from frappe/mergify/bp/version-15-hotfix/pr-47632
fix(quotation): use `Text Editor` field in alternative items dialog (backport #47632)
2025-05-20 14:25:10 +05:30
Akhil Narang
32eeedac24 fix(quotation): use Text Editor field in alternative items dialog for item description
`Data` causes text to overflow - the field is originally a `Text Editor` field

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit c7ea91073e)
2025-05-20 08:52:05 +00:00
ruthra kumar
ecb2bab70f Merge pull request #47631 from frappe/mergify/bp/version-15-hotfix/pr-47629
fix: date formatting in process_statement_of_accounts accounts_receivable print format (backport #47629)
2025-05-20 14:06:20 +05:30
ljain112
cf354c0da3 fix: date formatting in process_statement_of_accounts accounts_receivable print format
(cherry picked from commit 67c32ce3c9)

# Conflicts:
#	erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts_accounts_receivable.html
2025-05-20 13:57:47 +05:30
ruthra kumar
73fc8c374f Merge pull request #47628 from frappe/mergify/bp/version-15-hotfix/pr-47580
feat: add option to calculate ageing based on report date or today's date (backport #47580)
2025-05-20 13:53:04 +05:30
ruthra kumar
8c4ce03f44 Merge pull request #47623 from frappe/mergify/bp/version-15-hotfix/pr-47486
fix(SalesAnalytics): Ignore opening entries (backport #47486)
2025-05-20 13:21:36 +05:30
l0gesh29
69337cf18b feat: add option to calculate ageing based on report date or today date
(cherry picked from commit c67ba2d49b)
2025-05-20 07:48:39 +00:00
ruthra kumar
b773b494a0 Merge pull request #47625 from frappe/mergify/bp/version-15-hotfix/pr-47559
fix: include only invoices with update_stock = 0  for billed amt in delivery note. (backport #47559)
2025-05-20 11:25:06 +05:30
ljain112
70e190dbbb fix: include only invoices with update_stock = 0 for billed amt in delivery note.
(cherry picked from commit 6dc459db58)
2025-05-20 05:31:56 +00:00
l0gesh29
be280a408e fix(SalesAnalytics): Ignore opening entries
(cherry picked from commit 6d269b4409)
2025-05-20 05:20:43 +00:00
ruthra kumar
9584c80857 Merge pull request #47622 from frappe/mergify/bp/version-15-hotfix/pr-47614
fix: remove hardcoded doctype in `make_return_doc` (backport #47614)
2025-05-20 10:14:57 +05:30
barredterra
1a69d8137f fix: remove hardcoded doctype in make_return_doc
(cherry picked from commit 45a5c19dd4)
2025-05-20 04:30:11 +00:00
mergify[bot]
35c7af1b9d fix: asset image field updation issue (backport #47615) (#47617)
fix: asset image field updation issue (#47615)

(cherry picked from commit ff2ccf9bce)

Co-authored-by: Khushi Rawat <142375893+khushi8112@users.noreply.github.com>
2025-05-20 01:28:45 +05:30
ruthra kumar
da4ed5cc18 fix: set no_copy to party_balance field in Payment Entry 2025-05-19 16:15:16 +05:30
ruthra kumar
927d0f686f Merge pull request #47600 from frappe/mergify/bp/version-15-hotfix/pr-47505
fix: validate inter company transaction address links (backport #47505)
2025-05-19 13:25:08 +05:30
Bhavan23
8ee9a46d96 test: add test case to validate inter-company transaction address links
(cherry picked from commit 0caa757dd6)
2025-05-19 07:39:50 +00:00
Bhavan23
86aa072235 fix: validate inter-company transaction address links
(cherry picked from commit aed46ad5b9)
2025-05-19 07:39:50 +00:00
mergify[bot]
72ae80e2e3 fix: incorrect qty during reset (backport #47593) (#47595)
fix: incorrect qty during reset (#47593)

(cherry picked from commit a058fe7319)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-05-19 12:02:29 +05:30
Mihir Kandoi
829550cd99 Merge pull request #47577 from frappe/mergify/bp/version-15-hotfix/pr-47570
feat: add checkbox for validating time logs in job card (backport #47570)
2025-05-17 00:34:56 +05:30
Mihir Kandoi
249d18962c chore: resolve conflicts 2025-05-17 00:08:39 +05:30
Khushi Rawat
b9f12ed4c7 Merge pull request #47576 from frappe/mergify/bp/version-15-hotfix/pr-47573
fix: alias 'name' and 'parent' to prevent child row mapping issues (backport #47573)
2025-05-16 15:52:37 +05:30
Mihir Kandoi
80c76618ae feat: add checbox for validating time logs in job card
(cherry picked from commit 2d9a6a4de8)

# Conflicts:
#	erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.json
2025-05-16 10:05:52 +00:00
Khushi Rawat
073d06c44f fix: removed invalid child param to prevent callback failure
(cherry picked from commit 1ca51e4f14)
2025-05-16 10:05:51 +00:00
Khushi Rawat
612fa7c672 fix: alias name and parent to prevent child row mapping issues
(cherry picked from commit a418e377f4)
2025-05-16 10:05:51 +00:00
marination
e7dc31191c Merge branch 'version-15-hotfix' into mergify/bp/version-15-hotfix/pr-46214 2025-05-15 18:50:58 +02:00
mergify[bot]
926c0c5cf4 fix: POS Invoice can't use Loyalty Points when Global Rounded Total is Disabled (backport #47491) (#47564)
fix: POS Invoice can't use Loyalty Points when Global Rounded Total is Disabled (#47491)

(cherry picked from commit b541b536c3)

Co-authored-by: Kitti U. @ Ecosoft <kittiu@gmail.com>
2025-05-15 19:35:03 +05:30
ljain112
52cab02a5c fix: set no_copy to party_balance field in Payment Entry 2025-05-15 18:03:25 +05:30
Frappe PR Bot
31fa1c9a58 chore(release): Bumped to Version 15.61.1
## [15.61.1](https://github.com/frappe/erpnext/compare/v15.61.0...v15.61.1) (2025-05-15)

### Bug Fixes

* correct expense amount in party ledger summary. ([67741f1](67741f1a21))
2025-05-15 06:05:18 +00:00
ruthra kumar
631a9bfa7c Merge pull request #47557 from frappe/mergify/bp/version-15/pr-47541
fix: correct expense amount in party ledger summary. (backport #47541)
2025-05-15 11:33:53 +05:30
ljain112
67741f1a21 fix: correct expense amount in party ledger summary.
(cherry picked from commit 09a46fcf0e)
2025-05-15 05:47:32 +00:00
mergify[bot]
f225e1986e fix: validation message format (backport #47542) (#47549)
fix: validation message format (#47542)

(cherry picked from commit a18e1cffa7)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-05-15 10:31:28 +05:30
mergify[bot]
9355782397 fix: allow FG as RM by default (backport #47543) (#47550)
fix: allow FG as RM by default (#47543)

(cherry picked from commit 4241bfd4bc)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-05-15 10:31:12 +05:30
mergify[bot]
30ec69c977 fix: mapping of dispatch address when creating PO from SO (backport #47552) (#47553)
fix: mapping of dispatch address when creating PO from SO (#47552)

* fix: mapping of dispatch address when creating PO from SO

* fix: add to default supplier function as well

(cherry picked from commit 82161e9cb5)

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-05-14 20:52:04 +05:30
ruthra kumar
b22831bd94 Merge pull request #47541 from ljain112/fix-cls
fix: correct expense amount in party ledger summary.
2025-05-14 17:56:22 +05:30
mergify[bot]
5a3eff05a1 fix: pos item group filter fetching wrong items (backport #47545) (#47546)
fix: pos item group filter fetching wrong items (#47545)

(cherry picked from commit 5c28e01590)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-05-14 17:41:36 +05:30
ljain112
09a46fcf0e fix: correct expense amount in party ledger summary. 2025-05-14 12:38:38 +05:30
marination
37f4cf5367 fix: Linter (due to conflicts resolved on gh) 2025-05-13 17:18:40 +02:00
marination
f95a3f5b8b fix(portal): User cannot create 0 qty SQ from RFQ
- The portal uses `create_supplier_quotation` for SQ creation which excludes 0 qty items
2025-05-13 17:13:41 +02:00
marination
0286788e97 chore: Relabel according to review changes 2025-05-13 17:13:41 +02:00
marination
8891f46a22 fix: Relabel unit price settings for more clarity 2025-05-13 17:13:41 +02:00
Marica
890ce4a676 Merge branch 'version-15-hotfix' into mergify/bp/version-15-hotfix/pr-46214 2025-05-13 17:07:43 +02:00
Marica
2960d0dce1 Merge pull request #47537 from frappe/mergify/bp/version-15-hotfix/pr-38530
refactor: Consolidate duplicate zero-quantity Items checks for transactions. (backport #38530)
2025-05-13 16:55:54 +02:00
Frappe PR Bot
6e699178ae chore(release): Bumped to Version 15.61.0
# [15.61.0](https://github.com/frappe/erpnext/compare/v15.60.2...v15.61.0) (2025-05-13)

### Bug Fixes

* accumulate values for all the fiscal years in Profit And Loss Statement ([6dbdc36](6dbdc36af9))
* added PR/PI overbilling validation (backport [#47385](https://github.com/frappe/erpnext/issues/47385)) ([#47497](https://github.com/frappe/erpnext/issues/47497)) ([309ea7b](309ea7b9cf))
* broken test suite due to incorrect OR filter ([4a37f2a](4a37f2a925))
* condition for advance_account assignment ([b6e5e33](b6e5e3347d))
* do not mandate depreciation accounts for non depreciable asset category ([a75931c](a75931c90f))
* dont auto-fetch latest exchange rate ([0adb715](0adb7156cd))
* error while making SABB for backdated stock reco ([7ba7d1a](7ba7d1a2a4))
* ignore "Account Closing Balance" doctype on Period Closing Voucher cancellation ([39c0291](39c029133f))
* only depreciable category assets are allowed for depreciation ([242a119](242a119f95))
* **payment-reconciliation:** use reconciliation_takes_effect_on from company ([25fabda](25fabda40a))
* POS non-stock item mistakenly hidden as unavailable (backport [#47493](https://github.com/frappe/erpnext/issues/47493)) ([#47506](https://github.com/frappe/erpnext/issues/47506)) ([b18692c](b18692c120))
* resolved conflicts ([dcfae61](dcfae61a7a))
* timesheet portal showing total billing hours ([64ae4e1](64ae4e1fec))
* typo ([d61a85e](d61a85e316))
* typo in event.js ([67d24e9](67d24e9635))
* warning message for COGS account in the stock entry ([7abe199](7abe199e2a))

### Features

* add non depreciable category checkbox in asset category ([96d3bfd](96d3bfd2d9))
* add routing/sequencing to work order operations (backport [#46975](https://github.com/frappe/erpnext/issues/46975)) ([#47534](https://github.com/frappe/erpnext/issues/47534)) ([56d0357](56d0357f6f))

### Performance Improvements

* Skip link checking on repost's remove_attached_file (backport [#45061](https://github.com/frappe/erpnext/issues/45061)) ([#47450](https://github.com/frappe/erpnext/issues/47450)) ([09e7bfb](09e7bfbacb))
2025-05-13 14:04:07 +00:00
ruthra kumar
0f350ef24d Merge pull request #47528 from frappe/version-15-hotfix
chore: release v15
2025-05-13 19:32:35 +05:30
mergify[bot]
56d0357f6f feat: add routing/sequencing to work order operations (backport #46975) (#47534)
* feat: add routing/sequencing to work order operations (#46975)

* feat: add routing/sequencing to work order operations

* fix: add validation and remove reorderin for non sequence id operations

* chore: readability

* fix: logical error

* fix: logical error

* chore: added row number in error message

(cherry picked from commit f1159b6ea6)

# Conflicts:
#	erpnext/manufacturing/doctype/work_order_operation/work_order_operation.json

* chore: resolve conflicts

---------

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-05-13 19:02:01 +05:30
marination
5b50d5abf2 fix: Broken test + use super() appropriately
- test: Remove `test_bom_qty`. It had invalid code. Its been removed from develop. There wasn't a strong case being tested.
2025-05-13 14:42:57 +02:00
marination
9cede83de1 fix: Conflicts 2025-05-13 14:26:54 +02:00
Bernd Oliver Sünderhauf
a8b982dd0a chore: Adapt translations to reworded message.
(cherry picked from commit 3688d9412e)

# Conflicts:
#	erpnext/translations/tr.csv
2025-05-13 12:13:56 +00:00
Bernd Oliver Sünderhauf
cf45ffdabe refactor: Consolidate duplicate zero-quantity transaction Items checks.
(cherry picked from commit 4918aeb4c6)

# Conflicts:
#	erpnext/stock/doctype/stock_entry/stock_entry.py
2025-05-13 12:13:47 +00:00
Bernd Oliver Sünderhauf
e91a0acbb3 test: Add, expand and refine test-cases for zero-quantity transactions.
(cherry picked from commit b2d8a44199)

# Conflicts:
#	erpnext/selling/doctype/sales_order/test_sales_order.py
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
#	erpnext/stock/doctype/stock_entry/stock_entry.py
2025-05-13 12:13:46 +00:00
Khushi Rawat
fbbae80f92 Merge pull request #47533 from frappe/mergify/bp/version-15-hotfix/pr-47530
feat: non depreciable asset category (backport #47530)
2025-05-13 17:23:09 +05:30
Khushi Rawat
dcfae61a7a fix: resolved conflicts 2025-05-13 17:07:14 +05:30
marination
3deb11e5b2 fix: Merge conflicts 2025-05-13 13:35:19 +02:00
Khushi Rawat
242a119f95 fix: only depreciable category assets are allowed for depreciation
(cherry picked from commit d715db1226)
2025-05-13 11:34:35 +00:00
Khushi Rawat
a75931c90f fix: do not mandate depreciation accounts for non depreciable asset category
(cherry picked from commit 32cb7d6388)
2025-05-13 11:34:35 +00:00
Khushi Rawat
96d3bfd2d9 feat: add non depreciable category checkbox in asset category
(cherry picked from commit fbbfd6531b)

# Conflicts:
#	erpnext/assets/doctype/asset_category/asset_category.json
2025-05-13 11:34:35 +00:00
ruthra kumar
165a4fcef6 Merge pull request #47527 from frappe/mergify/bp/version-15-hotfix/pr-47520
fix: ignore "Account Closing Balance" doctype on Period Closing Voucher cancellation (backport #47520)
2025-05-13 15:10:13 +05:30
ruthra kumar
29b35d6eb0 Merge pull request #47522 from frappe/mergify/bp/version-15-hotfix/pr-47468
fix(payment-reconciliation): use reconciliation_takes_effect_on from company (backport #47468)
2025-05-13 15:03:59 +05:30
ljain112
39c029133f fix: ignore "Account Closing Balance" doctype on Period Closing Voucher cancellation
(cherry picked from commit d6602d63fc)
2025-05-13 09:21:31 +00:00
ruthra kumar
7f55d59a7b chore: drop redundant patch 2025-05-13 14:45:51 +05:30
ruthra kumar
95f21e5ecd Merge pull request #47523 from frappe/mergify/bp/version-15-hotfix/pr-47521
fix: condition for advance_account assignment (backport #47521)
2025-05-13 14:31:29 +05:30
Bhavan23
bafd9ed15e chore: simplify repeated condition checks
(cherry picked from commit 7bc62cedc6)
2025-05-13 14:14:13 +05:30
Bhavan23
25fabda40a fix(payment-reconciliation): use reconciliation_takes_effect_on from company
(cherry picked from commit 19f1ffbdc2)
2025-05-13 14:14:10 +05:30
ljain112
b6e5e3347d fix: condition for advance_account assignment
(cherry picked from commit ded46ce3d8)
2025-05-13 08:43:18 +00:00
ruthra kumar
2868446292 Merge pull request #47517 from frappe/mergify/bp/version-15-hotfix/pr-47367
fix: Use `Currency` instead of `Float` in GL report to show details (backport #47367)
2025-05-13 13:08:32 +05:30
Abdeali Chharchhodawala
811fe4fee6 Merge pull request #47367 from Abdeali099/gl-report-field-float-to-currency
fix: Use `Currency` instead of `Float` in GL report to show details
(cherry picked from commit e4e0bb68ec)
2025-05-13 05:57:49 +00:00
mergify[bot]
b6bf13ff02 refactor: available serial no report (backport #47333) (#47500)
* refactor: available serial no report

(cherry picked from commit 74eb611563)

* chore: further optimizations

(cherry picked from commit 653e0a2e3a)

---------

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-05-12 23:29:51 +05:30
ruthra kumar
b82e2585d5 Merge pull request #47508 from frappe/mergify/bp/version-15-hotfix/pr-47243
fix: accumulate values for all the fiscal years in Profit And Loss Statement (backport #47243)
2025-05-12 17:09:57 +05:30
ruthra kumar
9ca96a63c3 refactor(test): don't default to accumulate
(cherry picked from commit 54e4e7918e)
2025-05-12 16:54:14 +05:30
ruthra kumar
98cb9c6b96 test: accumulate filter on P&L report
(cherry picked from commit afff6b84ce)
2025-05-12 16:54:09 +05:30
ruthra kumar
d61a85e316 fix: typo
(cherry picked from commit 61d13ce232)
2025-05-12 11:17:32 +00:00
ljain112
6dbdc36af9 fix: accumulate values for all the fiscal years in Profit And Loss Statement
(cherry picked from commit 6851322361)
2025-05-12 11:17:32 +00:00
mergify[bot]
b18692c120 fix: POS non-stock item mistakenly hidden as unavailable (backport #47493) (#47506)
fix: POS non-stock item mistakenly hidden as unavailable (#47493)

(cherry picked from commit 57f3489dfa)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-05-12 15:10:11 +05:30
mergify[bot]
309ea7b9cf fix: added PR/PI overbilling validation (backport #47385) (#47497)
* fix: added PR/PI overbilling validation

(cherry picked from commit f4ffc57b51)

* test: added test

(cherry picked from commit b406ec724b)

* fix: linter error

(cherry picked from commit 27e842ba02)

---------

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-05-11 14:31:46 +05:30
Mihir Kandoi
775b2432ab Merge pull request #47494 from frappe/mergify/bp/version-15-hotfix/pr-47481
fix: timesheet portal showing total billing hours (backport #47481)
2025-05-10 12:04:04 +05:30
Mihir Kandoi
64ae4e1fec fix: timesheet portal showing total billing hours
(cherry picked from commit b04a07fda0)
2025-05-10 06:09:25 +00:00
ruthra kumar
005014ef6a Merge pull request #47482 from frappe/mergify/bp/version-15-hotfix/pr-47380
fix: broken CI - uae vat 201 tests failing (backport #47380)
2025-05-09 15:00:55 +05:30
ruthra kumar
4a37f2a925 fix: broken test suite due to incorrect OR filter
(cherry picked from commit 37d74e387d)
2025-05-09 09:13:26 +00:00
ruthra kumar
870be7a79b Merge pull request #47467 from frappe/mergify/bp/version-15-hotfix/pr-47462
Update event.js (backport #47462)
2025-05-08 14:13:19 +05:30
Yaiphalemba Mangshatabam
67d24e9635 fix: typo in event.js
"Sales Partners" -> "Sales Partner"

(cherry picked from commit edee75c757)
2025-05-08 08:40:56 +00:00
rohitwaghchaure
3ba7bb3ab7 Merge pull request #47454 from frappe/mergify/bp/version-15-hotfix/pr-47452
fix: warning message for COGS account in the stock entry (backport #47452)
2025-05-08 13:58:08 +05:30
rohitwaghchaure
72ec3f3d18 Merge pull request #47458 from frappe/mergify/bp/version-15-hotfix/pr-47457
fix: error while making SABB for backdated stock reco (backport #47457)
2025-05-08 13:57:43 +05:30
Rohit Waghchaure
7ba7d1a2a4 fix: error while making SABB for backdated stock reco
(cherry picked from commit ad25636afb)
2025-05-07 15:49:10 +00:00
Rohit Waghchaure
7abe199e2a fix: warning message for COGS account in the stock entry
(cherry picked from commit bba6b0ff45)
2025-05-07 10:50:21 +00:00
mergify[bot]
09e7bfbacb perf: Skip link checking on repost's remove_attached_file (backport #45061) (#47450)
perf: Skip link checking on repost's remove_attached_file (#45061)

This is internal detail, doesn't need to do horrible link checks in
framework.

(cherry picked from commit 4f690affc9)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2025-05-07 14:04:12 +05:30
ruthra kumar
ef7b09fc11 Merge pull request #47448 from frappe/mergify/bp/version-15-hotfix/pr-47447
fix: dont auto-fetch latest exchange rate (backport #47447)
2025-05-07 11:22:50 +05:30
ruthra kumar
0adb7156cd fix: dont auto-fetch latest exchange rate
- also use correct currency field for comparison

(cherry picked from commit 4ccd0a7407)
2025-05-07 05:47:33 +00:00
Frappe PR Bot
7fb557197a chore(release): Bumped to Version 15.60.2
## [15.60.2](https://github.com/frappe/erpnext/compare/v15.60.1...v15.60.2) (2025-05-06)

### Bug Fixes

* 'time to resolve: failed' on issue (backport [#47406](https://github.com/frappe/erpnext/issues/47406)) ([#47407](https://github.com/frappe/erpnext/issues/47407)) ([21612fc](21612fc230))
* backward compatibility for renamed group_by filter on reports (backport [#47362](https://github.com/frappe/erpnext/issues/47362)) ([#47403](https://github.com/frappe/erpnext/issues/47403)) ([0e5c709](0e5c709f7b))
* change shipping address fetching condition ([0aabe4f](0aabe4fd1e))
* completed transactions showing in the list (backport [#47374](https://github.com/frappe/erpnext/issues/47374)) ([#47379](https://github.com/frappe/erpnext/issues/47379)) ([1ef7da8](1ef7da837f))
* do not allocate amount when ref's doctype or name are not set ([c2e36da](c2e36daa32))
* do not mandate depreciation account for assets without depreciation (backport [#47427](https://github.com/frappe/erpnext/issues/47427)) ([#47428](https://github.com/frappe/erpnext/issues/47428)) ([01e975b](01e975b481))
* not able to submit the stock entry ([#47383](https://github.com/frappe/erpnext/issues/47383)) ([035394a](035394ae6a))
* party name in Ledger Summary ([4fc14b3](4fc14b3097))
* precision issue ([b6908a7](b6908a79bd))
* rename unchanged group_by filter related to general ledger report (backport [#47366](https://github.com/frappe/erpnext/issues/47366)) ([#47405](https://github.com/frappe/erpnext/issues/47405)) ([8d1e855](8d1e855dc8))
* renaming group by fieldname and value in reports (backport [#47352](https://github.com/frappe/erpnext/issues/47352)) ([#47360](https://github.com/frappe/erpnext/issues/47360)) ([85a8adf](85a8adf804))
* show party type in due date exceeding message ([f73e99e](f73e99e9d2))
* stock reco recalculate qty not works for opening stock reco ([2bd30e3](2bd30e3c46))
* update accounts on change of mode of payment in sales invoice payment (backport [#47381](https://github.com/frappe/erpnext/issues/47381)) ([#47400](https://github.com/frappe/erpnext/issues/47400)) ([afb44a6](afb44a677c))
* validation for difference account ([f4a43d0](f4a43d07b0))
* warning message before changing the valuation method (backport [#47340](https://github.com/frappe/erpnext/issues/47340)) ([#47342](https://github.com/frappe/erpnext/issues/47342)) ([4ef2b77](4ef2b77973))
2025-05-06 14:11:12 +00:00
ruthra kumar
7733e417a4 Merge pull request #47429 from frappe/version-15-hotfix
chore: release v15
2025-05-06 19:39:35 +05:30
rohitwaghchaure
d8fb11009f Merge pull request #47440 from frappe/mergify/bp/version-15-hotfix/pr-47435
fix: stock reco recalculate qty not works for opening stock reco (backport #47435)
2025-05-06 18:45:43 +05:30
Rohit Waghchaure
2bd30e3c46 fix: stock reco recalculate qty not works for opening stock reco
(cherry picked from commit 97095c7d24)
2025-05-06 12:57:56 +00:00
rohitwaghchaure
fb56db1166 Merge pull request #47437 from frappe/mergify/bp/version-15-hotfix/pr-47397
fix: precision issue (backport #47397)
2025-05-06 17:50:26 +05:30
Rohit Waghchaure
b6908a79bd fix: precision issue
(cherry picked from commit 69bee93bfd)
2025-05-06 11:59:50 +00:00
mergify[bot]
f4551bb918 feat!: configure which rate is used to auto-update price list (backport #47417)
Co-authored-by: Sagar Vora <16315650+sagarvora@users.noreply.github.com>
2025-05-06 17:00:03 +05:30
mergify[bot]
01e975b481 fix: do not mandate depreciation account for assets without depreciation (backport #47427) (#47428)
fix: do not mandate depreciation account for assets without depreciation (#47427)

(cherry picked from commit 51ea33e743)

Co-authored-by: Khushi Rawat <142375893+khushi8112@users.noreply.github.com>
2025-05-06 15:21:14 +05:30
ruthra kumar
91cbf2ec4f Merge pull request #47426 from frappe/mergify/bp/version-15-hotfix/pr-47337
fix: do not allocate amount when ref's doctype or name are not set (backport #47337)
2025-05-06 15:00:46 +05:30
Abdeali Chharchhoda
c2e36daa32 fix: do not allocate amount when ref's doctype or name are not set
(cherry picked from commit b9a02b466b)
2025-05-06 09:04:52 +00:00
ruthra kumar
74caf8134c Merge pull request #47416 from frappe/mergify/bp/version-15-hotfix/pr-47408
fix: show party type in due date exceeding message (backport #47408)
2025-05-06 14:32:52 +05:30
ruthra kumar
40faa7f7b9 chore: resolve conflicts and pass all parameters 2025-05-06 14:14:41 +05:30
Abdeali Chharchhoda
f73e99e9d2 fix: show party type in due date exceeding message
(cherry picked from commit b6d9134014)

# Conflicts:
#	erpnext/accounts/party.py
2025-05-06 06:28:48 +00:00
ruthra kumar
2d77e056bc Merge pull request #47414 from frappe/mergify/bp/version-15-hotfix/pr-47358
fix: change shipping address fetching condition (backport #47358)
2025-05-06 11:28:56 +05:30
Vimal
0aabe4fd1e fix: change shipping address fetching condition
(cherry picked from commit 0b4add2f2b)
2025-05-06 05:29:00 +00:00
marination
f94a14c06a fix: Headline rendered twice on first save
- `refresh` gets triggered twice and that renders the note twice
- Remove any existing note before rendering

(cherry picked from commit bf62f9ad57)
2025-05-05 16:59:18 +00:00
marination
d9636018f5 fix: Treat rows as Unit Price rows only until the qty is 0
- The unit price check should depend on the row qty being 0
- Once the row ceases to be 0, it is treated as an ordinary row
- test: PO, SO and Quotation

(cherry picked from commit 0447c7be0a)

# Conflicts:
#	erpnext/selling/doctype/quotation/test_quotation.py
#	erpnext/selling/doctype/sales_order/test_sales_order.py
2025-05-05 16:59:17 +00:00
marination
2d96a62530 test: Sales Order + fix: Mapping of Items from Quotation & SO
(cherry picked from commit 55981c8358)

# Conflicts:
#	erpnext/selling/doctype/sales_order/test_sales_order.py
2025-05-05 16:59:17 +00:00
marination
eba73df88e test: Purchase Order with Unit Price Items
- chore: Fix error message in accounts controller

(cherry picked from commit eea758f5b2)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/test_purchase_order.py
#	erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py
2025-05-05 16:59:16 +00:00
marination
c19065e675 test: Zero Qty in RFQ and Supplier Quotation
(cherry picked from commit 8f96c0b546)

# Conflicts:
#	erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py
#	erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py
2025-05-05 16:59:16 +00:00
marination
f8fa775af3 feat: Unit Price Items in Buying (RFQ, SQ, PO)
- chore: Extract `set_unit_price_items_note` into a util

(cherry picked from commit e403d3f153)

# Conflicts:
#	erpnext/buying/doctype/buying_settings/buying_settings.json
#	erpnext/buying/doctype/purchase_order/purchase_order.json
#	erpnext/buying/doctype/request_for_quotation/request_for_quotation.json
#	erpnext/selling/doctype/quotation/quotation.json
#	erpnext/selling/doctype/selling_settings/selling_settings.json
2025-05-05 16:59:16 +00:00
marination
91e167fe72 fix: Linters
(cherry picked from commit 71f65bab5e)

# Conflicts:
#	erpnext/selling/doctype/sales_order/sales_order.py
2025-05-05 16:59:15 +00:00
marination
33366fce6c feat: Unit Price Contract
(cherry picked from commit c1e4e7af28)

# Conflicts:
#	erpnext/controllers/accounts_controller.py
#	erpnext/selling/doctype/quotation/quotation.json
#	erpnext/selling/doctype/sales_order/sales_order.py
#	erpnext/selling/doctype/selling_settings/selling_settings.json
2025-05-05 16:59:15 +00:00
mergify[bot]
8d1e855dc8 fix: rename unchanged group_by filter related to general ledger report (backport #47366) (#47405)
fix: rename unchanged group_by filter related to general ledger report (#47366)

(cherry picked from commit 3de249dcba)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-05-05 18:01:51 +05:30
mergify[bot]
0e5c709f7b fix: backward compatibility for renamed group_by filter on reports (backport #47362) (#47403)
fix: backward compatibility for renamed group_by filter on reports (#47362)

* fix: backward compatibility for renamed group_by filter in general ledger report

* fix: backward compatibility for renamed group_by filter in supplier quotation comparison report

(cherry picked from commit d4ffa54136)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-05-05 18:01:29 +05:30
mergify[bot]
21612fc230 fix: 'time to resolve: failed' on issue (backport #47406) (#47407)
fix: 'time to resolve: failed' on issue (#47406)

* fix: 'time to resolve: failed' on issue

* fix: sla_resolution_date

(cherry picked from commit 45393d51a2)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-05-05 17:50:36 +05:30
mergify[bot]
afb44a677c fix: update accounts on change of mode of payment in sales invoice payment (backport #47381) (#47400)
* fix: update accounts on change of mode of payment in sales invoice payment (#47381)

* fix: update accounts on change of mode of payment in sales invoice payment

* test: fixed tests

(cherry picked from commit 8067799692)

# Conflicts:
#	erpnext/accounts/doctype/mode_of_payment/test_mode_of_payment.py
#	erpnext/accounts/doctype/pos_invoice/test_pos_invoice.py
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py

* chore: resolve conflict

* chore: remove unused library

* chore: resolve conflict

* chore: resolve conflict

* chore: resolve linter issue

---------

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-05-05 16:35:31 +05:30
ruthra kumar
4f6aee3f22 Merge pull request #47399 from frappe/mergify/bp/version-15-hotfix/pr-47145
refactor: make AR / AP report more memory efficient (backport #47145)
2025-05-05 16:03:36 +05:30
ruthra kumar
fc1b1ca5e2 chore: resolve conflict 2025-05-05 15:47:39 +05:30
ruthra kumar
f69b8d7e2d refactor: set default for fetch methods
(cherry picked from commit ca1e81e1b5)
2025-05-05 10:14:49 +00:00
ruthra kumar
2147441e64 refactor: use fetch method based on configuration
(cherry picked from commit b5bb6f3508)
2025-05-05 10:14:49 +00:00
ruthra kumar
5e5cf68b32 refactor: configurable fetch method for AR / AP report
(cherry picked from commit 66fd639b52)

# Conflicts:
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.json
2025-05-05 10:14:49 +00:00
ruthra kumar
7c8245d299 refactor: use unbuffered cursor for fetching
(cherry picked from commit 08903459c2)
2025-05-05 10:14:48 +00:00
rohitwaghchaure
a4c9707fdf Merge pull request #47390 from frappe/mergify/bp/version-15-hotfix/pr-47376
fix: validation for difference account (backport #47376)
2025-05-05 14:11:07 +05:30
Rohit Waghchaure
f4a43d07b0 fix: validation for difference account
(cherry picked from commit fb819c558e)
2025-05-03 07:52:58 +00:00
Frappe PR Bot
c1ed750bcb chore(release): Bumped to Version 15.60.1
## [15.60.1](https://github.com/frappe/erpnext/compare/v15.60.0...v15.60.1) (2025-05-02)

### Bug Fixes

* not able to submit the stock entry ([#47383](https://github.com/frappe/erpnext/issues/47383)) ([73a418a](73a418a2bd))
2025-05-02 13:44:13 +00:00
rohitwaghchaure
1d139eb94a Merge pull request #47384 from frappe/mergify/bp/version-15/pr-47383
fix: not able to submit the stock entry (backport #47383)
2025-05-02 19:12:43 +05:30
rohitwaghchaure
73a418a2bd fix: not able to submit the stock entry (#47383)
(cherry picked from commit 035394ae6a)
2025-05-02 13:06:32 +00:00
rohitwaghchaure
035394ae6a fix: not able to submit the stock entry (#47383) 2025-05-02 18:34:47 +05:30
mergify[bot]
1ef7da837f fix: completed transactions showing in the list (backport #47374) (#47379)
fix: completed transactions showing in the list (#47374)

(cherry picked from commit 97db9da10e)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-05-02 15:28:45 +05:30
mergify[bot]
85a8adf804 fix: renaming group by fieldname and value in reports (backport #47352) (#47360)
* fix: renaming group by fieldname and value in reports (#47352)

* fix: renaming in general ledger report

* fix: renaming in supplier quotation comparison report

* fix: renaming group by to categorize by in process statement of accounts

* fix: added patch

* fix: patch update to all documents

* chore: added patches to patch.txt

* chore: removing patch from v14

(cherry picked from commit 13a84e7f82)

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

* chore: resolve conflict

---------

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-04-30 17:19:43 +05:30
Mihir Kandoi
d3445b3079 Merge pull request #47357 from frappe/mergify/bp/version-15-hotfix/pr-47336
refactor: portal query in timesheet.py (backport #47336)
2025-04-30 16:35:11 +05:30
Mihir Kandoi
ada7821a49 refactor: portal query in timesheet.py (#47336)
* refactor: portal query in timesheet.py

* fix: use criterion.any to fix query

(cherry picked from commit 4fc7a8b71d)
2025-04-30 10:45:02 +00:00
Nihantra C. Patel
3f7dcedf3d Merge pull request #47354 from frappe/mergify/bp/version-15-hotfix/pr-47351
fix: party name in Ledger Summary (backport #47351)
2025-04-30 14:05:47 +05:30
Nihantra Patel
4fc14b3097 fix: party name in Ledger Summary
(cherry picked from commit 70bc86a4c6)
2025-04-30 08:13:52 +00:00
mergify[bot]
4ef2b77973 fix: warning message before changing the valuation method (backport #47340) (#47342)
fix: warning message before changing the valuation method (#47340)

(cherry picked from commit ffdc4347e8)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-04-30 08:45:39 +05:30
Frappe PR Bot
96996bd8a9 chore(release): Bumped to Version 15.60.0
# [15.60.0](https://github.com/frappe/erpnext/compare/v15.59.0...v15.60.0) (2025-04-29)

### Bug Fixes

* add transaction_date in field_no_map when creating PO from SQ (backport [#47257](https://github.com/frappe/erpnext/issues/47257)) ([#47313](https://github.com/frappe/erpnext/issues/47313)) ([afb67f1](afb67f1f0c))
* allow selling asset at zero rate (backport [#47326](https://github.com/frappe/erpnext/issues/47326)) ([#47332](https://github.com/frappe/erpnext/issues/47332)) ([171b687](171b687611))
* allow to change valuation method from FIFO to Moving Average ([b2294ed](b2294ed6e3))
* allow to make quality inspection after Purchase / Delivery ([e0cea49](e0cea49236))
* cancel pos closing entry failure for return pos invoices (backport [#47248](https://github.com/frappe/erpnext/issues/47248)) ([#47249](https://github.com/frappe/erpnext/issues/47249)) ([10d843e](10d843e490))
* commas in rfq portal js ([954fec1](954fec16f4))
* compare total debit/credit with precision for Inter Company Journal Entry ([0927155](0927155171))
* consolidating pos invoices on the basis of accounting dimensions (backport [#46961](https://github.com/frappe/erpnext/issues/46961)) ([#47265](https://github.com/frappe/erpnext/issues/47265)) ([f8da159](f8da1599bb))
* correct query for dispatch_address; remove unnecessary code; increase reusability; ([ac3b2ba](ac3b2ba003))
* do not check for permission if values are not changed in employee doctype ([#47238](https://github.com/frappe/erpnext/issues/47238)) ([0caba9f](0caba9f70d))
* enable use serial / batch fields on batch selection ([925cc40](925cc40efa))
* enhance dispatch address query logic and add supplier address query ([290f0b9](290f0b94e5))
* fix sub assembly qty calculation in production plan when bom level >= 1 (backport [#47296](https://github.com/frappe/erpnext/issues/47296)) ([#47315](https://github.com/frappe/erpnext/issues/47315)) ([d15b7ca](d15b7ca9af))
* make asset quantity and amount editable (backport [#47226](https://github.com/frappe/erpnext/issues/47226)) ([#47227](https://github.com/frappe/erpnext/issues/47227)) ([c140fd0](c140fd0f12))
* map dispatch address correctly for inter company transactions ([d8c0e71](d8c0e7156e))
* missing else statement ([8a30a31](8a30a31302))
* **payment request:** get advance amount based on transaction currency ([c2235e2](c2235e2d17))
* **PE:** Set account types in get_payment_entry (backport [#47246](https://github.com/frappe/erpnext/issues/47246)) ([#47266](https://github.com/frappe/erpnext/issues/47266)) ([3e733f6](3e733f6ba1))
* prevent cancellation of last asset movement (backport [#47291](https://github.com/frappe/erpnext/issues/47291)) ([#47312](https://github.com/frappe/erpnext/issues/47312)) ([2edd12b](2edd12b26d))
* price currency in supplier quotation comparison ([6b1b30a](6b1b30a4a6))
* prohibit consolidated sales invoice return (backport [#47251](https://github.com/frappe/erpnext/issues/47251)) ([#47252](https://github.com/frappe/erpnext/issues/47252)) ([4bcea55](4bcea55563))
* QI reference not set if 'Action If Quality Inspection Is Not Sub… (backport [#47294](https://github.com/frappe/erpnext/issues/47294)) ([#47295](https://github.com/frappe/erpnext/issues/47295)) ([b0399fe](b0399fe948))
* Re-insert missing "Serial No Warranty Expiry" Report ([727c32d](727c32d789))
* remove invalid email account creation (backport [#47318](https://github.com/frappe/erpnext/issues/47318)) ([#47323](https://github.com/frappe/erpnext/issues/47323)) ([fc8a8b5](fc8a8b5433))
* remove use of cur_frm ([5c300b8](5c300b893b))
* **Rename Tool:** allow more than 500 rows (backport [#47117](https://github.com/frappe/erpnext/issues/47117)) ([#47225](https://github.com/frappe/erpnext/issues/47225)) ([c0ae133](c0ae1336f4))
* require email OR phone in shipment doctype not both (backport [#47300](https://github.com/frappe/erpnext/issues/47300)) ([#47330](https://github.com/frappe/erpnext/issues/47330)) ([0056fb1](0056fb1d0f))
* set billing hours to hours ([0763a8d](0763a8d42d))
* set billing hours to hours in timesheet (backport [#47289](https://github.com/frappe/erpnext/issues/47289)) ([#47290](https://github.com/frappe/erpnext/issues/47290)) ([74bdc82](74bdc82bfa))
* update additional cost and total asset cost after asset repair (backport [#47233](https://github.com/frappe/erpnext/issues/47233)) ([#47235](https://github.com/frappe/erpnext/issues/47235)) ([4a29a54](4a29a54804))
* update billing hours when hours is changed ([a9df1f5](a9df1f5f6b))
* update quantity validation using asset quantity field instead of… (backport [#46731](https://github.com/frappe/erpnext/issues/46731)) ([#47284](https://github.com/frappe/erpnext/issues/47284)) ([2e6112f](2e6112f21b))
* validate if from and to time are present on submission of job card ([#47325](https://github.com/frappe/erpnext/issues/47325)) ([d640c79](d640c79c1c))
* validation if no stock ledger entries against stock reco (backport [#47292](https://github.com/frappe/erpnext/issues/47292)) ([#47293](https://github.com/frappe/erpnext/issues/47293)) ([91bcefe](91bcefef8c))

### Features

* add dispatch address fields to purchase doctypes ([5f101e7](5f101e7635))
* add dispatch address support in party details and controllers ([1fe1563](1fe1563dab))
* add display dispatch address when dispatch address is selected ([93ea2f9](93ea2f93b6))
* change sabb qty automatically incase of internal transfer PR if sabb only has 1 batch ([#47256](https://github.com/frappe/erpnext/issues/47256)) ([9495a2a](9495a2ac9d))
2025-04-29 13:12:18 +00:00
ruthra kumar
a9e40bc0d8 Merge pull request #47328 from frappe/version-15-hotfix
chore: release v15
2025-04-29 18:40:46 +05:30
mergify[bot]
d15b7ca9af fix: fix sub assembly qty calculation in production plan when bom level >= 1 (backport #47296) (#47315)
* fix: fix sub assembly qty calculation in production plan when bom level >= 1

(cherry picked from commit bfc4ce1d5d)

* fix: logical error

(cherry picked from commit ee10afc074)

---------

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-04-29 18:12:36 +05:30
mergify[bot]
171b687611 fix: allow selling asset at zero rate (backport #47326) (#47332)
fix: allow selling asset at zero rate (#47326)

(cherry picked from commit 05afad78fc)

Co-authored-by: Khushi Rawat <142375893+khushi8112@users.noreply.github.com>
2025-04-29 17:12:51 +05:30
ruthra kumar
cc8418b7e4 Merge pull request #47329 from frappe/mergify/bp/version-15-hotfix/pr-47325
fix: validate if from and to time are present on submission of job card (backport #47325)
2025-04-29 16:46:34 +05:30
mergify[bot]
0056fb1d0f fix: require email OR phone in shipment doctype not both (backport #47300) (#47330)
fix: require email OR phone in shipment doctype not both (#47300)

(cherry picked from commit fc02a6510e)

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-04-29 16:27:56 +05:30
Mihir Kandoi
d640c79c1c fix: validate if from and to time are present on submission of job card (#47325)
(cherry picked from commit 7499c25a3c)
2025-04-29 10:52:56 +00:00
mergify[bot]
2edd12b26d fix: prevent cancellation of last asset movement (backport #47291) (#47312)
fix: prevent cancellation of last asset movement (#47291)

* fix: prevent cancellation of last asset movement

* test: movement cancellation

* fix: allow cancellation of asset movement when cancelling asset

(cherry picked from commit 9dee4ac891)

Co-authored-by: Khushi Rawat <142375893+khushi8112@users.noreply.github.com>
2025-04-29 12:51:18 +05:30
ruthra kumar
71482261c7 Merge pull request #47324 from frappe/mergify/bp/version-15-hotfix/pr-47241
fix: compare total debit/credit with precision for Inter Company Journal Entry (backport #47241)
2025-04-29 12:43:42 +05:30
Mihir Kandoi
9df5727ea4 Merge pull request #47317 from frappe/mergify/bp/version-15-hotfix/pr-47256
feat: change sabb qty automatically incase of internal transfer PR if… (backport #47256)
2025-04-29 12:40:53 +05:30
mergify[bot]
fc8a8b5433 fix: remove invalid email account creation (backport #47318) (#47323)
fix: remove invalid email account creation (#47318)

(cherry picked from commit 7423e4187f)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-04-29 12:40:45 +05:30
Mihir Kandoi
409831183b Merge pull request #47314 from frappe/mergify/bp/version-15-hotfix/pr-47234
fix: price currency in supplier quotation comparison (backport #47234)
2025-04-29 12:40:31 +05:30
mergify[bot]
afb67f1f0c fix: add transaction_date in field_no_map when creating PO from SQ (backport #47257) (#47313)
* fix: add transaction_date in field_no_map when creating PO from SQ

(cherry picked from commit 3790c6c551)

* fix: test case

(cherry picked from commit acd1529780)

# Conflicts:
#	erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py

* fix: remove unused import

(cherry picked from commit 9e640341fd)

# Conflicts:
#	erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py

* chore: fix conflicts

* chore: remove unused imports

---------

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-04-29 12:40:10 +05:30
ruthra kumar
7bc39349b0 Merge pull request #47321 from frappe/mergify/bp/version-15-hotfix/pr-47231
fix(payment request): get advance amount based on transaction currency (backport #47231)
2025-04-29 12:25:54 +05:30
ljain112
0927155171 fix: compare total debit/credit with precision for Inter Company Journal Entry
(cherry picked from commit 5fe247557e)
2025-04-29 06:48:08 +00:00
venkat102
c2235e2d17 fix(payment request): get advance amount based on transaction currency
(cherry picked from commit b570d97b4d)
2025-04-29 06:37:54 +00:00
Mihir Kandoi
9495a2ac9d feat: change sabb qty automatically incase of internal transfer PR if sabb only has 1 batch (#47256)
* feat: change sabb qty automatically incase of internal transfer PR if sabb only has 1 batch

* fix: prevent creation of SABB on every save

* perf: optimize code

* fix: remove unnecessary conditon

* refactor: change if to elif

* fix: remove dn_item_qty and set to item.qty

* test: added test

(cherry picked from commit 47927b38a9)
2025-04-29 06:17:04 +00:00
Mihir Kandoi
cb61e0bd18 Merge pull request #47316 from frappe/mergify/bp/version-15-hotfix/pr-47302
fix: commas in rfq portal js (backport #47302)
2025-04-29 11:46:31 +05:30
Mihir Kandoi
954fec16f4 fix: commas in rfq portal js
(cherry picked from commit bd727e069b)
2025-04-29 06:07:50 +00:00
Mihir Kandoi
6b1b30a4a6 fix: price currency in supplier quotation comparison
(cherry picked from commit 88926eb2a7)
2025-04-29 06:06:38 +00:00
mergify[bot]
b0399fe948 fix: QI reference not set if 'Action If Quality Inspection Is Not Sub… (backport #47294) (#47295)
fix: QI reference not set if 'Action If Quality Inspection Is Not Sub… (#47294)

fix: qi reference not set if 'Action If Quality Inspection Is Not Submitted' is blank
(cherry picked from commit 0701a8cf5a)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-04-28 22:01:57 +05:30
mergify[bot]
91bcefef8c fix: validation if no stock ledger entries against stock reco (backport #47292) (#47293)
fix: validation if no stock ledger entries against stock reco (#47292)

(cherry picked from commit 3d36d0b1df)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-04-28 19:38:27 +05:30
mergify[bot]
74bdc82bfa fix: set billing hours to hours in timesheet (backport #47289) (#47290)
* fix: set billing hours to hours

(cherry picked from commit 0763a8d42d)

* fix: update billing hours when hours is changed

(cherry picked from commit a9df1f5f6b)

* fix: missing else statement

(cherry picked from commit 8a30a31302)

---------

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-04-28 16:33:40 +05:30
rohitwaghchaure
5b32bb7468 Merge pull request #47289 from frappe/st37102-2
fix: set billing hours to hours in timesheet
2025-04-28 16:27:33 +05:30
Mihir Kandoi
8a30a31302 fix: missing else statement 2025-04-28 16:08:40 +05:30
Mihir Kandoi
a9df1f5f6b fix: update billing hours when hours is changed 2025-04-28 16:07:54 +05:30
Mihir Kandoi
0763a8d42d fix: set billing hours to hours 2025-04-28 15:43:13 +05:30
rohitwaghchaure
c02a4a4591 Merge pull request #47286 from frappe/mergify/bp/version-15-hotfix/pr-47285
fix: allow to make quality inspection after Purchase / Delivery (backport #47285)
2025-04-28 15:29:16 +05:30
ruthra kumar
1cbcf7532c Merge pull request #47281 from frappe/mergify/bp/version-15-hotfix/pr-46993
feat: add dispatch address fields to purchase doctypes (backport #46993)
2025-04-28 14:47:02 +05:30
Rohit Waghchaure
e0cea49236 fix: allow to make quality inspection after Purchase / Delivery
(cherry picked from commit fad1a32e63)
2025-04-28 09:00:14 +00:00
mergify[bot]
2e6112f21b fix: update quantity validation using asset quantity field instead of… (backport #46731) (#47284)
* fix: update quantity validation using asset quantity field instead of… (#46731)

* fix: update quantity validation using asset quantity field instead of total records

* fix: update throw message

(cherry picked from commit eae08bc619)

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

* chore: resolved conflicts

---------

Co-authored-by: l0gesh29 <logeshperiyasamy24@gmail.com>
Co-authored-by: Khushi Rawat <142375893+khushi8112@users.noreply.github.com>
2025-04-28 14:18:51 +05:30
ruthra kumar
feb4038c06 chore: resolve conflicts 2025-04-28 11:36:24 +05:30
Smit Vora
d8c0e7156e fix: map dispatch address correctly for inter company transactions
(cherry picked from commit ceaba4220b)
2025-04-28 05:28:20 +00:00
Smit Vora
7baa8f50fb refactor: set address details for transactions
(cherry picked from commit fb3b7d8c34)
2025-04-28 05:28:20 +00:00
Smit Vora
62261a276f refactor: address field position
(cherry picked from commit 8ccd7a3e61)

# Conflicts:
#	erpnext/public/scss/erpnext.scss
2025-04-28 05:28:20 +00:00
Karm Soni
ac3b2ba003 fix: correct query for dispatch_address; remove unnecessary code; increase reusability;
(cherry picked from commit 999ffe86a7)
2025-04-28 05:28:19 +00:00
Karm Soni
93ea2f93b6 feat: add display dispatch address when dispatch address is selected
(cherry picked from commit d12998e524)
2025-04-28 05:28:19 +00:00
Karm Soni
5c300b893b fix: remove use of cur_frm
(cherry picked from commit c4bd3123fb)
2025-04-28 05:28:19 +00:00
Karm Soni
290f0b94e5 fix: enhance dispatch address query logic and add supplier address query
(cherry picked from commit 9a859e54b6)
2025-04-28 05:28:18 +00:00
Karm Soni
1fe1563dab feat: add dispatch address support in party details and controllers
(cherry picked from commit 53d0b7be23)
2025-04-28 05:28:18 +00:00
Karm Soni
5f101e7635 feat: add dispatch address fields to purchase doctypes
(cherry picked from commit 54b5205221)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
#	erpnext/buying/doctype/purchase_order/purchase_order.json
2025-04-28 05:28:18 +00:00
mergify[bot]
3e733f6ba1 fix(PE): Set account types in get_payment_entry (backport #47246) (#47266)
Co-authored-by: Corentin Forler <10946971+cogk@users.noreply.github.com>
fix(PE): Set account types in get_payment_entry (#47246)
2025-04-27 15:24:59 +02:00
rohitwaghchaure
5c4dc7a16e Merge pull request #47277 from frappe/mergify/bp/version-15-hotfix/pr-47259
fix: enable use serial / batch fields on batch selection (backport #47259)
2025-04-27 18:41:32 +05:30
Rohit Waghchaure
925cc40efa fix: enable use serial / batch fields on batch selection
(cherry picked from commit a4471865a9)
2025-04-27 13:06:21 +00:00
rohitwaghchaure
d947beec88 Merge pull request #47276 from frappe/mergify/bp/version-15-hotfix/pr-47268
fix: allow to change valuation method from FIFO to Moving Average (backport #47268)
2025-04-27 18:23:16 +05:30
Rohit Waghchaure
b2294ed6e3 fix: allow to change valuation method from FIFO to Moving Average
(cherry picked from commit b454ed4b8f)
2025-04-27 12:16:36 +00:00
mergify[bot]
f8da1599bb fix: consolidating pos invoices on the basis of accounting dimensions (backport #46961) (#47265)
fix: consolidating pos invoices on the basis of accounting dimensions (#46961)

* fix: consolidating pos invoices on the basis of accounting dimensions

* fix: project field

(cherry picked from commit c85edc3346)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-04-25 17:59:15 +05:30
Marica
636e9e0998 Merge pull request #47261 from frappe/mergify/bp/version-15-hotfix/pr-47232
fix: Re-insert missing "Serial No Warranty Expiry" Report (backport #47232)
2025-04-25 15:13:55 +05:30
marination
727c32d789 fix: Re-insert missing "Serial No Warranty Expiry" Report
(cherry picked from commit deefac0abf)
2025-04-25 09:28:36 +00:00
mergify[bot]
4bcea55563 fix: prohibit consolidated sales invoice return (backport #47251) (#47252)
fix: prohibit consolidated sales invoice return (#47251)

(cherry picked from commit 483c4a3271)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-04-25 11:33:04 +05:30
mergify[bot]
10d843e490 fix: cancel pos closing entry failure for return pos invoices (backport #47248) (#47249)
fix: cancel pos closing entry failure for return pos invoices (#47248)

(cherry picked from commit c8ee5d9a4e)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-04-24 23:23:08 +05:30
Lakshit Jain
0caba9f70d fix: do not check for permission if values are not changed in employee doctype (#47238) 2025-04-24 17:03:30 +02:00
mergify[bot]
4a29a54804 fix: update additional cost and total asset cost after asset repair (backport #47233) (#47235)
fix: update additional cost and total asset cost after asset repair (#47233)

* fix: add consumed stock's cost to the asset value after repair

* fix: do not copy additional cost and total asset cost

(cherry picked from commit ed8a8532e1)

Co-authored-by: Khushi Rawat <142375893+khushi8112@users.noreply.github.com>
2025-04-24 16:36:53 +05:30
mergify[bot]
c140fd0f12 fix: make asset quantity and amount editable (backport #47226) (#47227)
fix: make asset quantity and amount editable (#47226)

(cherry picked from commit 0d53e6ed7c)

Co-authored-by: Khushi Rawat <142375893+khushi8112@users.noreply.github.com>
2025-04-24 11:36:18 +05:30
mergify[bot]
c0ae1336f4 fix(Rename Tool): allow more than 500 rows (backport #47117) (#47225)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
fix(Rename Tool): allow more than 500 rows (#47117)
2025-04-23 20:26:03 +02:00
Frappe PR Bot
4c3044cd70 chore(release): Bumped to Version 15.59.0
# [15.59.0](https://github.com/frappe/erpnext/compare/v15.58.2...v15.59.0) (2025-04-22)

### Bug Fixes

* `TypeError` in group field filter in supplier ledger summary ([3b349f4](3b349f44b1))
* add group by after user permission condition ([f07c3d9](f07c3d9124))
* backslash in url ([f6edd5a](f6edd5aa7d))
* change get_url_to_form to get_link_to_form ([982a68b](982a68b71a))
* cherry pick ([20aba54](20aba541c4))
* consider per_ordered instead of per_billed when creating PO from MR ([be154a4](be154a469f))
* correct error message in validate_internal_transfer_qty ([b8a7f6d](b8a7f6dac1))
* create default warehouse (backport [#47125](https://github.com/frappe/erpnext/issues/47125)) ([#47131](https://github.com/frappe/erpnext/issues/47131)) ([ad177e0](ad177e08b8))
* disbaled UOM showing in the list ([3d4f3e1](3d4f3e1be7))
* distributed discounts on si ([ad05e6d](ad05e6dec2))
* **Employee:** remove User Permissions if create_user_permission is unchecked ([7ab81b7](7ab81b7e54))
* expense account in stock entry ([2f1f229](2f1f229144))
* get total without rounding off tax amounts for distributing discount (backport [#47155](https://github.com/frappe/erpnext/issues/47155)) ([8050e65](8050e653ab))
* group sub assemblies in production plan ([73683b2](73683b2754))
* import error ([924e9b9](924e9b94b6))
* keep per_billed 100 for billed delivery note after return ([680c221](680c221f05))
* linter ([c58800a](c58800a929))
* logic and added test case ([b3e852a](b3e852adfc))
* Modify .json from desk to change `modified` ([1dc9812](1dc98124dc))
* only update User Permissions if a relevant field has changed ([b0f3d62](b0f3d62dd0))
* pos disable customer selection at payment (backport [#47169](https://github.com/frappe/erpnext/issues/47169)) ([#47170](https://github.com/frappe/erpnext/issues/47170)) ([7adba1f](7adba1f0f3))
* provision to recalculate the qty in the Bin ([5535eb4](5535eb4817))
* rate based on posting date in Tax Withholding Report ([9184c40](9184c40371))
* remove invalid parameter ([2431141](2431141062))
* remove unused import ([4fba4d4](4fba4d49d2))
* respect field "ignore_user_permissions" property in employee query ([a450ce2](a450ce25b9))
* respect mapped accounting dimensions ([846b24b](846b24ba52))
* revert unintended changes ([a09ab90](a09ab902e5))
* set correct paid/receive amount if doc currency is different from party account currency ([5dc63f9](5dc63f97a1))
* set default company address in Sales Doctype on change of company ([05d4c1e](05d4c1e6ca))
* show button only when RFQ is submitted ([9655bfa](9655bfa199))
* test cases ([dedb19e](dedb19e3e9))
* test cases error ([13d3b27](13d3b27a1f))
* update country wise fiscal year (backport [#47141](https://github.com/frappe/erpnext/issues/47141)) ([#47176](https://github.com/frappe/erpnext/issues/47176)) ([390780d](390780d871))
* use get_url_to_form instead ([ad35021](ad35021666))

### Features

* add button to show request for comparison report directly from RFQ ([cb2b956](cb2b9563e0))
* add unit tests for distributed_discount_amount ([6f6574c](6f6574c5ac))

### Reverts

* disable customer if creating from opportunity ([99735e0](99735e0af4))
2025-04-22 13:47:39 +00:00
ruthra kumar
f7efd006c2 Merge pull request #47204 from frappe/version-15-hotfix
chore: release v15
2025-04-22 19:16:15 +05:30
mergify[bot]
8050e653ab fix: get total without rounding off tax amounts for distributing discount (backport #47155)
Co-authored-by: Sagar Vora <16315650+sagarvora@users.noreply.github.com>
2025-04-22 17:53:10 +05:30
ruthra kumar
2ba6c78e5e Merge pull request #47210 from frappe/mergify/bp/version-15-hotfix/pr-47178
fix: keep per_billed 100 for billed delivery note after return (backport #47178)
2025-04-22 17:30:33 +05:30
Sugesh393
04a1578b53 refactor: update base_outstanding calculation
(cherry picked from commit 02356029a8)
2025-04-22 11:42:13 +00:00
Sugesh393
2b05ccfa6f test: add new unit test to keep per_billed 100 for billed delivery note
(cherry picked from commit fe5898a151)
2025-04-22 11:42:12 +00:00
Sugesh393
680c221f05 fix: keep per_billed 100 for billed delivery note after return
(cherry picked from commit 8290a83591)
2025-04-22 11:42:12 +00:00
ruthra kumar
bbbbb4da55 Merge pull request #47209 from frappe/mergify/bp/version-15-hotfix/pr-47183
fix: backslash in url (backport #47183)
2025-04-22 17:07:23 +05:30
ruthra kumar
e2f8ca5f87 chore: resolve conflict 2025-04-22 16:46:57 +05:30
ruthra kumar
6671f4df41 Merge pull request #47208 from frappe/mergify/bp/version-15-hotfix/pr-46717
fix: respect field "ignore_user_permissions" property in employee query (backport #46717)
2025-04-22 16:40:28 +05:30
Mihir Kandoi
4fba4d49d2 fix: remove unused import
(cherry picked from commit c3d172fac3)
2025-04-22 10:46:37 +00:00
Mihir Kandoi
982a68b71a fix: change get_url_to_form to get_link_to_form
(cherry picked from commit 5d07beee61)
2025-04-22 10:46:37 +00:00
Mihir Kandoi
a09ab902e5 fix: revert unintended changes
(cherry picked from commit eaaf34cda6)

# Conflicts:
#	erpnext/stock/doctype/material_request/material_request.json
2025-04-22 10:46:37 +00:00
Mihir Kandoi
ad35021666 fix: use get_url_to_form instead
(cherry picked from commit 7a82b37f76)
2025-04-22 10:46:36 +00:00
Mihir Kandoi
f6edd5aa7d fix: backslash in url
(cherry picked from commit ecf15130ba)

# Conflicts:
#	erpnext/stock/doctype/material_request/material_request.json
2025-04-22 10:46:36 +00:00
ljain112
e752f3f914 chore: added test case for employee query with user permissions
(cherry picked from commit 4be975f87c)

# Conflicts:
#	erpnext/controllers/tests/test_queries.py
2025-04-22 16:00:00 +05:30
ruthra kumar
31af933c1c Merge pull request #47207 from frappe/mergify/bp/version-15-hotfix/pr-47171
fix: set correct paid/receive amount if doc currency is different from party account currency (backport #47171)
2025-04-22 15:58:28 +05:30
ljain112
a450ce25b9 fix: respect field "ignore_user_permissions" property in employee query
(cherry picked from commit 91d7bc55be)
2025-04-22 10:12:30 +00:00
Soham Kulkarni
e152c72a7b Merge pull request #47201 from frappe/mergify/bp/version-15-hotfix/pr-47175
fix: add grand_total to show correct status in quick list widget (backport #47175)
2025-04-22 15:41:49 +05:30
ljain112
5dc63f97a1 fix: set correct paid/receive amount if doc currency is different from party account currency
(cherry picked from commit 9612521894)
2025-04-22 10:07:17 +00:00
rohitwaghchaure
8bc00ffbb4 Merge pull request #47206 from frappe/mergify/bp/version-15-hotfix/pr-47184
feat: add button to view Supplier Quotation Comparison directly from RFQ (backport #47184)
2025-04-22 15:16:01 +05:30
Mihir Kandoi
9655bfa199 fix: show button only when RFQ is submitted
(cherry picked from commit ef57d2b328)
2025-04-22 09:43:41 +00:00
Mihir Kandoi
cb2b9563e0 feat: add button to show request for comparison report directly from RFQ
(cherry picked from commit b4aa88b59b)
2025-04-22 09:43:41 +00:00
ruthra kumar
bb71b91d4a Merge pull request #47203 from frappe/mergify/bp/version-15-hotfix/pr-47180
fix: set default company address in selling Doctype on change of company (backport #47180)
2025-04-22 15:12:20 +05:30
ljain112
05d4c1e6ca fix: set default company address in Sales Doctype on change of company
(cherry picked from commit a31075692c)
2025-04-22 08:59:04 +00:00
Soham Kulkarni
d7556069e4 Merge pull request #47175 from sokumon/purchase-receipt-quick-list
fix: add grand_total to show correct status in quick list widget
(cherry picked from commit 68ca4a77c9)
2025-04-22 08:52:51 +00:00
ruthra kumar
a3821cf182 Merge pull request #47199 from frappe/mergify/bp/version-15-hotfix/pr-47138
fix: rate based on posting date in Tax Withholding Report (backport #47138)
2025-04-22 14:07:08 +05:30
ruthra kumar
18e3171cc9 Merge pull request #47197 from frappe/mergify/bp/version-15-hotfix/pr-47191
fix: expense account in stock entry (backport #47191)
2025-04-22 13:34:01 +05:30
ljain112
1f8fce253d chore: added test case for date period in multiple tax withholding rules
(cherry picked from commit 515fe340a8)

# Conflicts:
#	erpnext/accounts/report/tax_withholding_details/test_tax_withholding_details.py
2025-04-22 13:31:28 +05:30
ljain112
9184c40371 fix: rate based on posting date in Tax Withholding Report
(cherry picked from commit a32a79e90a)
2025-04-22 07:59:58 +00:00
Rohit Waghchaure
2f1f229144 fix: expense account in stock entry
(cherry picked from commit 75874b4986)
2025-04-22 07:46:37 +00:00
ruthra kumar
393e4462f8 Merge pull request #47195 from frappe/mergify/bp/version-15-hotfix/pr-47124
fix: `TypeError` in group field filter in supplier ledger summary (backport #47124)
2025-04-22 12:44:05 +05:30
ljain112
3b349f44b1 fix: TypeError in group field filter in supplier ledger summary
(cherry picked from commit 872e94a316)
2025-04-22 06:51:57 +00:00
rohitwaghchaure
c430ce96b3 Merge pull request #47185 from frappe/mergify/bp/version-15-hotfix/pr-47144
fix: provision to recalculate the qty in the Bin (backport #47144)
2025-04-22 12:20:46 +05:30
rohitwaghchaure
7b5297bb7f Merge pull request #47188 from frappe/mergify/bp/version-15-hotfix/pr-47186
fix: disabled UOM showing in the list (backport #47186)
2025-04-22 12:20:34 +05:30
Rohit Waghchaure
3d4f3e1be7 fix: disbaled UOM showing in the list
(cherry picked from commit 3745825052)
2025-04-21 16:43:17 +00:00
Rohit Waghchaure
5535eb4817 fix: provision to recalculate the qty in the Bin
(cherry picked from commit 36081413d8)
2025-04-21 15:49:11 +00:00
ruthra kumar
af35e43555 Merge pull request #47095 from frappe/mergify/bp/version-15-hotfix/pr-47007
chore: Fix typo "Item Wise Tax Detail " (backport #47007)
2025-04-21 16:50:22 +05:30
ruthra kumar
f53a45cfef chore: resolve conflict 2025-04-21 16:30:20 +05:30
ruthra kumar
19045bcace Merge pull request #47177 from frappe/mergify/bp/version-15-hotfix/pr-47067
fix: correct error message in validate_internal_transfer_qty (backport #47067)
2025-04-21 16:24:11 +05:30
ljain112
b8a7f6dac1 fix: correct error message in validate_internal_transfer_qty
(cherry picked from commit 5063f1174e)
2025-04-21 10:28:27 +00:00
ruthra kumar
f2c3150687 Merge pull request #47013 from frappe/mergify/bp/version-15-hotfix/pr-45924
fix(Employee): remove User Permissions if create_user_permission is unchecked (backport #45924)
2025-04-21 15:55:03 +05:30
mergify[bot]
390780d871 fix: update country wise fiscal year (backport #47141) (#47176)
fix: update country wise fiscal year (#47141)

(cherry picked from commit cb2ad4acdb)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-04-21 14:26:47 +05:30
mergify[bot]
7adba1f0f3 fix: pos disable customer selection at payment (backport #47169) (#47170)
fix: pos disable customer selection at payment (#47169)

(cherry picked from commit f52cbf6165)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-04-21 11:56:54 +05:30
Sagar Vora
d6d042868d Merge pull request #43067 from frappe/mergify/bp/version-15-hotfix/pr-41721
fix: distributed discounts on si (backport #41721)
2025-04-19 16:35:12 +05:30
Sagar Vora
f764b9713b Merge branch 'version-15-hotfix' into mergify/bp/version-15-hotfix/pr-41721 2025-04-19 16:18:37 +05:30
Sagar Vora
16877fade8 Merge pull request #47157 from frappe/mergify/bp/version-15-hotfix/pr-47154
fix: respect mapped accounting dimensions (backport #47154)
2025-04-19 13:04:01 +05:30
Sagar Vora
846b24ba52 fix: respect mapped accounting dimensions
(cherry picked from commit 7dbe27da19)
2025-04-19 07:22:45 +00:00
mergify[bot]
451b1a19a8 chore: migrate pre-commit config (backport #47132) (#47134)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-04-17 14:18:00 +02:00
mergify[bot]
ad177e08b8 fix: create default warehouse (backport #47125) (#47131)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
fix: create default warehouse (#47125)
2025-04-17 13:40:05 +02:00
Frappe PR Bot
00a8503dd7 chore(release): Bumped to Version 15.58.2
## [15.58.2](https://github.com/frappe/erpnext/compare/v15.58.1...v15.58.2) (2025-04-17)

### Bug Fixes

* add group by after user permission condition ([0287f34](0287f34928))
2025-04-17 10:54:22 +00:00
ruthra kumar
76a2eb69a0 Merge pull request #47127 from frappe/mergify/bp/version-15/pr-47118
fix: add group by after user permission condition (backport #47118)
2025-04-17 16:22:18 +05:30
ruthra kumar
673694ae48 Merge pull request #47128 from frappe/mergify/bp/version-15-hotfix/pr-47118
fix: add group by after user permission condition (backport #47118)
2025-04-17 16:22:07 +05:30
venkat102
0287f34928 fix: add group by after user permission condition
(cherry picked from commit 756d496235)
2025-04-17 10:36:57 +00:00
venkat102
f07c3d9124 fix: add group by after user permission condition
(cherry picked from commit 756d496235)
2025-04-17 10:36:57 +00:00
rohitwaghchaure
d18266d839 Merge pull request #47048 from frappe/mergify/bp/version-15-hotfix/pr-46938
fix: group sub assemblies in production plan (backport #46938)
2025-04-17 15:31:08 +05:30
rohitwaghchaure
0c714e2bd9 Merge pull request #47114 from frappe/mergify/bp/version-15-hotfix/pr-47050
fix: consider per_ordered instead of per_billed when creating PO from MR (backport #47050)
2025-04-16 22:49:24 +05:30
Mihir Kandoi
20aba541c4 fix: cherry pick 2025-04-16 20:32:05 +05:30
Mihir Kandoi
be154a469f fix: consider per_ordered instead of per_billed when creating PO from MR
(cherry picked from commit 5a524854de)

# Conflicts:
#	erpnext/stock/doctype/material_request/material_request.js
2025-04-16 10:58:52 +00:00
Frappe PR Bot
741f29e57a chore(release): Bumped to Version 15.58.1
## [15.58.1](https://github.com/frappe/erpnext/compare/v15.58.0...v15.58.1) (2025-04-16)

### Bug Fixes

* revert [#46903](https://github.com/frappe/erpnext/issues/46903) - disable changing customer on opportunity ([5c04d18](5c04d183bf))
2025-04-16 05:15:20 +00:00
ruthra kumar
5090108718 Merge pull request #47110 from frappe/mergify/bp/version-15/pr-47108
revert: disable customer if creating from opportunity (backport #47108)
2025-04-16 10:44:01 +05:30
Shariq Ansari
5c04d183bf fix: revert #46903 - disable changing customer on opportunity
(cherry picked from commit fc16199a49)
2025-04-16 10:38:17 +05:30
Shariq Ansari
bb6d6c3edf Merge pull request #47109 from frappe/mergify/bp/version-15-hotfix/pr-47108 2025-04-16 10:22:33 +05:30
Shariq Ansari
99735e0af4 revert: disable customer if creating from opportunity
(cherry picked from commit fc16199a49)
2025-04-16 04:51:33 +00:00
Frappe PR Bot
929d177b7d chore(release): Bumped to Version 15.58.0
# [15.58.0](https://github.com/frappe/erpnext/compare/v15.57.5...v15.58.0) (2025-04-16)

### Bug Fixes

* added missing project field on pos profile ([8e9ddb7](8e9ddb7a69))
* allow to use batchwise valuation for moving average items ([e479975](e479975f54))
* backport translations from develop ([#47104](https://github.com/frappe/erpnext/issues/47104)) ([188c4f8](188c4f896a))
* batchwise valuation for MA item ([debfcdc](debfcdc61f))
* bypass validation during reposting ([01aad96](01aad96b10))
* child values for tree doctypes and query refactor ([537a8ef](537a8efe7a))
* clarify confirmation message ([35daf66](35daf669fe))
* condition for use_batchwise_valuation ([0ff7465](0ff7465e27))
* configuration to accept partial payment in pos invoice ([#47052](https://github.com/frappe/erpnext/issues/47052)) ([a944853](a944853b56))
* consider negative stock qty in stock reco ([603f737](603f737c99))
* correct doctype in item_wise_purchase register ([b2fb4fb](b2fb4fba51))
* correct function name ([393d245](393d2459b9))
* correct outstanding amount for invoice in dunning ([b7c3fa2](b7c3fa23d2))
* current batch qty showing zero in the stock reconciliation ([24c8a06](24c8a06520))
* enabled allow on submit for asset name field (backport [#47093](https://github.com/frappe/erpnext/issues/47093)) ([#47094](https://github.com/frappe/erpnext/issues/47094)) ([3f652bd](3f652bd4e1))
* fetch exchange rate while creating inter-company order and invoice ([aa0b93d](aa0b93d0b2))
* go for lower case "on" because we already have translations for that ([7cf83ff](7cf83ffce7))
* Group GLs by account for TB generation ([416d9bc](416d9bce2c))
* item code not showing in the error message ([663e2b7](663e2b7e6c))
* make report's "printed on" translatable ([18e9a98](18e9a9881c))
* map tax table while creating purchase order from sales order ([127c7b9](127c7b93ac))
* **Payment Entry:** set account type if missing (backport [#47069](https://github.com/frappe/erpnext/issues/47069)) ([#47070](https://github.com/frappe/erpnext/issues/47070)) ([8e02a9b](8e02a9bc28))
* precision issue on qty_to_be_reserved ([c8691b6](c8691b6516))
* recognize trigger from child table ([cf00d42](cf00d42799))
* Recreate Stock Ledgers issue ([b819e0a](b819e0a61b))
* remove get_items query.run outside of if condition ([e7b5303](e7b5303782))
* remove redundant letter head ([7896f8a](7896f8a855))
* removed display depends on ([00b2553](00b25537f4))
* resolved conflicts ([bde55d2](bde55d2a07))
* revert [#46900](https://github.com/frappe/erpnext/issues/46900) - against_voucher filter in general ledger ([da65f44](da65f44a47))
* test file for v15 ([cc7756d](cc7756dd49))
* translatability ([79ed02b](79ed02bb2c))
* update the modified date in for SLEs and GLs after rename ([21f0dcb](21f0dcbcc3))
* use source_fieldname to validate inventory dimension ([250b670](250b67076d))
* use the actual field label ([0c260ba](0c260baacd))
* wording ([db647a4](db647a4e42))

### Features

* Allow to Make Quality Inspection after Purchase / Delivery ([2e6ba91](2e6ba91589))
* available serial no report ([c472af8](c472af87b2))
* clear payment terms and schedule ([830290c](830290c859))
* fetch source_fieldname for inventory dimension ([2ed6c21](2ed6c211f9))
* **regional:** Address Template for Germany & Add Switzerland Template ([#46737](https://github.com/frappe/erpnext/issues/46737)) ([42479d9](42479d9a7f))
* update due date in payment schedule ([0b0a6b8](0b0a6b8cfa))

### Performance Improvements

* refactored customer ledger summary for performance ([50b2196](50b2196020))
* take query out of loop ([9af5052](9af50528f1))
2025-04-16 04:05:56 +00:00
ruthra kumar
7555d27d82 Merge pull request #47091 from frappe/version-15-hotfix
chore: release v15
2025-04-16 09:34:34 +05:30
ruthra kumar
4a7b91352b Merge pull request #47099 from frappe/mergify/bp/version-15-hotfix/pr-46770
fix: correct outstanding amount for invoice in dunning (backport #46770)
2025-04-16 07:44:32 +05:30
Raffael Meyer
188c4f896a fix: backport translations from develop (#47104) 2025-04-15 19:30:17 +02:00
rohitwaghchaure
9bdeacbbfa Merge pull request #47097 from frappe/mergify/bp/version-15-hotfix/pr-46973
fix: precision issue on qty_to_be_reserved (backport #46973)
2025-04-15 22:01:34 +05:30
ljain112
c42f76b15a chore: added test for Fetch Overdue Payments in dunning
(cherry picked from commit 3b613c44a6)

# Conflicts:
#	erpnext/accounts/doctype/dunning/test_dunning.py
2025-04-15 20:35:09 +05:30
Diptanil Saha
a944853b56 fix: configuration to accept partial payment in pos invoice (#47052) 2025-04-15 19:03:55 +05:30
ljain112
b7c3fa23d2 fix: correct outstanding amount for invoice in dunning
(cherry picked from commit c2bdd30e6d)
2025-04-15 12:21:58 +00:00
ruthra kumar
073a7a6ca6 Merge pull request #47096 from frappe/mergify/bp/version-15-hotfix/pr-47001
fix: fetch exchange rate while creating inter-company order and invoice (backport #47001)
2025-04-15 17:46:38 +05:30
Dany Robert
c8691b6516 fix: precision issue on qty_to_be_reserved
(cherry picked from commit 860699ee7b)

# Conflicts:
#	erpnext/stock/doctype/stock_reservation_entry/stock_reservation_entry.py
2025-04-15 17:42:30 +05:30
venkat102
aa0b93d0b2 fix: fetch exchange rate while creating inter-company order and invoice
(cherry picked from commit 145a6c5e2a)
2025-04-15 12:07:54 +00:00
mergify[bot]
3f652bd4e1 fix: enabled allow on submit for asset name field (backport #47093) (#47094)
fix: enabled allow on submit for asset name field (#47093)

(cherry picked from commit e41720f1a3)

Co-authored-by: Khushi Rawat <142375893+khushi8112@users.noreply.github.com>
2025-04-15 17:33:58 +05:30
marination
1dc98124dc fix: Modify .json from desk to change modified
(cherry picked from commit be556167b1)

# Conflicts:
#	erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.json
2025-04-15 11:32:47 +00:00
Himanshu Shivhare
5cb8e5dfbd chore: Fix typo "Item Wise Tax Detail "
(cherry picked from commit 9624d56abd)
2025-04-15 11:32:46 +00:00
ruthra kumar
f816934a28 Merge pull request #47086 from frappe/mergify/bp/version-15-hotfix/pr-46640
perf: refactored customer ledger summary for performance (backport #46640)
2025-04-15 13:46:55 +05:30
ruthra kumar
1e340ccd9c chore: use correct Test class 2025-04-15 13:29:22 +05:30
ruthra kumar
21e94148db chore: resolve conflict 2025-04-15 13:20:56 +05:30
ruthra kumar
233a2c08a1 test: basic supplier ledger summary
(cherry picked from commit 71f0f7a0b5)
2025-04-15 13:20:56 +05:30
ruthra kumar
11566e20b5 test: basic output of customer ledger summary report
(cherry picked from commit 9a3a80dfd3)
2025-04-15 13:20:56 +05:30
ljain112
393d2459b9 fix: correct function name
(cherry picked from commit 038355f87b)
2025-04-15 13:20:56 +05:30
ljain112
537a8efe7a fix: child values for tree doctypes and query refactor
(cherry picked from commit fca46e0b2d)

# Conflicts:
#	erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py
2025-04-15 13:20:56 +05:30
ljain112
50b2196020 perf: refactored customer ledger summary for performance
(cherry picked from commit e84e49345a)

# Conflicts:
#	erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py
2025-04-15 13:20:56 +05:30
ruthra kumar
0ad8935f2c Merge pull request #47081 from frappe/mergify/bp/version-15-hotfix/pr-46789
fix: map tax table while creating purchase order from sales order (backport #46789)
2025-04-15 12:10:21 +05:30
ruthra kumar
148287d8a1 Merge pull request #46935 from frappe/mergify/bp/version-15-hotfix/pr-46171
Fix validation mismatch in inventory dimension fields (backport #46171)
2025-04-15 11:54:24 +05:30
ruthra kumar
f4854a9a02 Merge pull request #46816 from frappe/mergify/bp/version-15-hotfix/pr-46737
feat(regional): Address Template for Germany & Add Switzerland Template (backport #46737)
2025-04-15 11:51:17 +05:30
ruthra kumar
b7cbc66a28 chore: resolve conflict 2025-04-15 11:45:17 +05:30
Sugesh393
5a20b9e94f test: add unit test to validate tax values in Purchase Order from Sales Order
(cherry picked from commit a393195866)

# Conflicts:
#	erpnext/selling/doctype/sales_order/test_sales_order.py
2025-04-15 06:13:11 +00:00
Sugesh393
127c7b93ac fix: map tax table while creating purchase order from sales order
(cherry picked from commit 1e18569be7)
2025-04-15 06:13:11 +00:00
mergify[bot]
c77f7f4ff0 test(Payment Entry): account type is set (backport #47071) (#47073)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-04-14 19:26:11 +02:00
mergify[bot]
8e02a9bc28 fix(Payment Entry): set account type if missing (backport #47069) (#47070)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
fix(Payment Entry): set account type if missing (#47069)
2025-04-14 18:54:12 +02:00
rohitwaghchaure
640012429e Merge pull request #47063 from frappe/mergify/bp/version-15-hotfix/pr-47058
fix: consider negative stock qty in stock reconciliation (backport #47058)
2025-04-14 20:30:25 +05:30
Rohit Waghchaure
603f737c99 fix: consider negative stock qty in stock reco
(cherry picked from commit 15272d0e56)
2025-04-14 12:39:35 +00:00
ruthra kumar
4fd99ed763 Merge pull request #46773 from frappe/mergify/bp/version-15-hotfix/pr-46683
fix: Set complete contact details for `Employee` in PE (backport #46683)
2025-04-14 17:30:51 +05:30
Frappe PR Bot
2eb7a688cb chore(release): Bumped to Version 15.57.5
## [15.57.5](https://github.com/frappe/erpnext/compare/v15.57.4...v15.57.5) (2025-04-14)

### Bug Fixes

* revert [#46900](https://github.com/frappe/erpnext/issues/46900) - against_voucher filter in general ledger ([969c354](969c3549d5))
2025-04-14 08:24:20 +00:00
ruthra kumar
19a5b923b9 Merge pull request #47053 from frappe/mergify/bp/version-15/pr-47049
Revert "fix: remove against_voucher and against_voucher_type column from General Ledger Report" (backport #47049)
2025-04-14 13:52:55 +05:30
ruthra kumar
77bbaef5a6 Merge pull request #47055 from frappe/mergify/bp/version-15-hotfix/pr-47049
Revert "fix: remove against_voucher and against_voucher_type column from General Ledger Report" (backport #47049)
2025-04-14 13:52:05 +05:30
Mihir Kandoi
c58800a929 fix: linter 2025-04-14 13:33:48 +05:30
Mihir Kandoi
924e9b94b6 fix: import error 2025-04-14 13:28:06 +05:30
ruthra kumar
6bfb3c6905 chore: resolve conflict 2025-04-14 13:26:32 +05:30
ruthra kumar
a0908522c1 chore: resolve conflict 2025-04-14 13:21:33 +05:30
ruthra kumar
da65f44a47 fix: revert #46900 - against_voucher filter in general ledger
(cherry picked from commit adb331ef71)

# Conflicts:
#	erpnext/accounts/report/general_ledger/general_ledger.py
2025-04-14 07:50:28 +00:00
ruthra kumar
969c3549d5 fix: revert #46900 - against_voucher filter in general ledger
(cherry picked from commit adb331ef71)

# Conflicts:
#	erpnext/accounts/report/general_ledger/general_ledger.py
2025-04-14 07:49:32 +00:00
Mihir Kandoi
13d3b27a1f fix: test cases error
(cherry picked from commit 8df18762a9)
2025-04-14 06:41:28 +00:00
Mihir Kandoi
dedb19e3e9 fix: test cases
(cherry picked from commit a7394329ca)
2025-04-14 06:41:27 +00:00
Mihir Kandoi
b3e852adfc fix: logic and added test case
(cherry picked from commit f071255340)
2025-04-14 06:41:27 +00:00
Mihir Kandoi
73683b2754 fix: group sub assemblies in production plan
(cherry picked from commit f58abed935)
2025-04-14 06:41:27 +00:00
Frappe PR Bot
1da2577035 chore(release): Bumped to Version 15.57.4
## [15.57.4](https://github.com/frappe/erpnext/compare/v15.57.3...v15.57.4) (2025-04-13)

### Bug Fixes

* Group GLs by account for TB generation ([70fa366](70fa366216))
2025-04-13 14:13:43 +00:00
Deepesh Garg
e5d0ab6bab Merge pull request #47045 from frappe/mergify/bp/version-15/pr-47044
fix: Group GLs by account for TB generation
2025-04-13 19:42:19 +05:30
Deepesh Garg
70fa366216 fix: Group GLs by account for TB generation
(cherry picked from commit f894c6d275)
(cherry picked from commit 416d9bce2c)
2025-04-13 14:02:23 +00:00
Deepesh Garg
f1254e51e5 Merge pull request #47044 from frappe/mergify/bp/version-15-hotfix/pr-47043
fix: Group GLs by account for TB generation (backport #47043)
2025-04-13 19:31:29 +05:30
Deepesh Garg
416d9bce2c fix: Group GLs by account for TB generation
(cherry picked from commit f894c6d275)
2025-04-13 13:57:23 +00:00
Frappe PR Bot
065c9fa85f chore(release): Bumped to Version 15.57.3
## [15.57.3](https://github.com/frappe/erpnext/compare/v15.57.2...v15.57.3) (2025-04-12)

### Bug Fixes

* correct doctype in item_wise_purchase register ([cd68832](cd68832aa0))
2025-04-12 02:01:06 +00:00
ruthra kumar
bcb45ce8ef Merge pull request #47031 from frappe/mergify/bp/version-15/pr-47012
fix: correct doctype in item_wise_purchase register (backport #47012)
2025-04-12 07:29:44 +05:30
ruthra kumar
f5fd255e82 Merge pull request #47033 from frappe/mergify/bp/version-15-hotfix/pr-47012
fix: correct doctype in item_wise_purchase register (backport #47012)
2025-04-12 07:29:14 +05:30
ljain112
b2fb4fba51 fix: correct doctype in item_wise_purchase register
(cherry picked from commit b8b8dce733)
2025-04-12 01:42:25 +00:00
ljain112
cd68832aa0 fix: correct doctype in item_wise_purchase register
(cherry picked from commit b8b8dce733)
2025-04-12 01:41:15 +00:00
rohitwaghchaure
1b8a317de9 Merge pull request #47027 from frappe/mergify/bp/version-15-hotfix/pr-47026
fix: batchwise valuation for MA item (backport #47026)
2025-04-11 22:56:25 +05:30
Rohit Waghchaure
debfcdc61f fix: batchwise valuation for MA item
(cherry picked from commit 504b8c0a68)
2025-04-11 16:27:52 +00:00
Frappe PR Bot
8a33866a8c chore(release): Bumped to Version 15.57.2
## [15.57.2](https://github.com/frappe/erpnext/compare/v15.57.1...v15.57.2) (2025-04-11)

### Bug Fixes

* condition for use_batchwise_valuation ([18dd128](18dd128838))
* removed display depends on ([b8436db](b8436dbd21))
2025-04-11 15:16:34 +00:00
rohitwaghchaure
d3a987800b Merge pull request #47025 from frappe/mergify/bp/version-15/pr-47021
fix: removed display depends on (backport #47020) (backport #47021)
2025-04-11 20:45:07 +05:30
rohitwaghchaure
1e19bc7f3f Merge pull request #47024 from frappe/mergify/bp/version-15/pr-47023
fix: condition for use_batchwise_valuation (backport #47022) (backport #47023)
2025-04-11 20:44:54 +05:30
rohitwaghchaure
fa7675488d chore: fix conflicts 2025-04-11 20:26:43 +05:30
Rohit Waghchaure
b8436dbd21 fix: removed display depends on
(cherry picked from commit e0bf45e03b)
(cherry picked from commit 00b25537f4)

# Conflicts:
#	erpnext/stock/doctype/stock_settings/stock_settings.json
2025-04-11 14:24:37 +00:00
Rohit Waghchaure
18dd128838 fix: condition for use_batchwise_valuation
(cherry picked from commit cc171d9706)
(cherry picked from commit 0ff7465e27)
2025-04-11 14:24:31 +00:00
rohitwaghchaure
706092061b Merge pull request #47021 from frappe/mergify/bp/version-15-hotfix/pr-47020
fix: removed display depends on (backport #47020)
2025-04-11 19:53:43 +05:30
rohitwaghchaure
c6c8aa02eb Merge pull request #47023 from frappe/mergify/bp/version-15-hotfix/pr-47022
fix: condition for use_batchwise_valuation (backport #47022)
2025-04-11 19:53:22 +05:30
Rohit Waghchaure
0ff7465e27 fix: condition for use_batchwise_valuation
(cherry picked from commit cc171d9706)
2025-04-11 14:06:08 +00:00
Rohit Waghchaure
00b25537f4 fix: removed display depends on
(cherry picked from commit e0bf45e03b)
2025-04-11 13:46:39 +00:00
Frappe PR Bot
ff41ed534b chore(release): Bumped to Version 15.57.1
## [15.57.1](https://github.com/frappe/erpnext/compare/v15.57.0...v15.57.1) (2025-04-11)

### Bug Fixes

* allow to use batchwise valuation for moving average items ([dded682](dded682feb))
2025-04-11 12:22:21 +00:00
rohitwaghchaure
f2684d9b4c Merge pull request #47018 from frappe/mergify/bp/version-15/pr-47017
fix: allow to use batch-wise valuation for moving average items (backport #47015) (backport #47017)
2025-04-11 17:50:55 +05:30
rohitwaghchaure
6dee592ba7 Merge pull request #47004 from frappe/mergify/bp/version-15-hotfix/pr-47002
feat: Allow to Make Quality Inspection after Purchase / Delivery (backport #47002)
2025-04-11 17:26:53 +05:30
Rohit Waghchaure
dded682feb fix: allow to use batchwise valuation for moving average items
(cherry picked from commit 65ba79bb85)
(cherry picked from commit e479975f54)
2025-04-11 11:56:35 +00:00
rohitwaghchaure
8233aadd50 Merge pull request #47017 from frappe/mergify/bp/version-15-hotfix/pr-47015
fix: allow to use batch-wise valuation for moving average items (backport #47015)
2025-04-11 17:25:29 +05:30
Rohit Waghchaure
e479975f54 fix: allow to use batchwise valuation for moving average items
(cherry picked from commit 65ba79bb85)
2025-04-11 11:38:32 +00:00
barredterra
2431141062 fix: remove invalid parameter 2025-04-11 13:07:44 +02:00
Patrick Eissler
b0e8f85a27 refactor: make linter happy 2025-04-11 12:25:58 +02:00
Patrick Eissler
b0f3d62dd0 fix: only update User Permissions if a relevant field has changed 2025-04-11 12:25:26 +02:00
Patrick Eissler
e47d07d98c chore: use existing utility function 2025-04-11 12:24:25 +02:00
Patrick Eissler
7ab81b7e54 fix(Employee): remove User Permissions if create_user_permission is unchecked 2025-04-11 12:24:04 +02:00
rohitwaghchaure
5e1d3f77bb chore: fix conflicts 2025-04-11 15:35:36 +05:30
rohitwaghchaure
00ac8597b0 chore: fix conflicts 2025-04-11 15:34:45 +05:30
rohitwaghchaure
4163b18ec3 Merge pull request #47005 from frappe/mergify/bp/version-15-hotfix/pr-46997
fix: update the modified date in for SLEs and GLs after rename (backport #46997)
2025-04-11 14:43:02 +05:30
Rohit Waghchaure
21f0dcbcc3 fix: update the modified date in for SLEs and GLs after rename
(cherry picked from commit dc5a5ef258)
2025-04-10 12:10:48 +00:00
Rohit Waghchaure
2e6ba91589 feat: Allow to Make Quality Inspection after Purchase / Delivery
(cherry picked from commit 8eaa2afeb7)

# Conflicts:
#	erpnext/stock/doctype/stock_settings/stock_settings.json
2025-04-10 12:10:47 +00:00
rohitwaghchaure
14a502c956 Merge pull request #46998 from frappe/mergify/bp/version-15-hotfix/pr-46831
fix: current batch qty showing zero in the stock reconciliation (backport #46831)
2025-04-10 15:39:34 +05:30
Rohit Waghchaure
24c8a06520 fix: current batch qty showing zero in the stock reconciliation
(cherry picked from commit a5c62f8623)
2025-04-10 08:30:28 +00:00
Frappe PR Bot
1326ba5326 chore(release): Bumped to Version 15.57.0
# [15.57.0](https://github.com/frappe/erpnext/compare/v15.56.0...v15.57.0) (2025-04-10)

### Bug Fixes

* bypass validation during reposting ([eaaac6e](eaaac6e596))
* item code not showing in the error message ([837509a](837509ae47))
* Recreate Stock Ledgers issue ([3db70fe](3db70febe1))
* remove get_items query.run outside of if condition ([bff4902](bff4902993))
* test file for v15 ([88f1cf2](88f1cf2943))

### Features

* available serial no report ([0f6a7ed](0f6a7edb53))

### Performance Improvements

* take query out of loop ([c7fead6](c7fead6bb0))
2025-04-10 07:31:47 +00:00
rohitwaghchaure
d047c965c6 Merge pull request #46990 from frappe/mergify/bp/version-15/pr-46947
feat: available serial no report (backport #46383) (backport #46947)
2025-04-10 12:59:58 +05:30
rohitwaghchaure
72e9844d27 Merge pull request #46987 from frappe/mergify/bp/version-15/pr-46985
fix: item code not showing in the error message (backport #46933) (backport #46985)
2025-04-10 12:59:36 +05:30
rohitwaghchaure
528b7534f7 Merge pull request #46991 from frappe/mergify/bp/version-15/pr-46989
fix: Recreate Stock Ledgers issue (backport #46965) (backport #46989)
2025-04-10 12:59:23 +05:30
rohitwaghchaure
3141e4a54f Merge pull request #46992 from frappe/mergify/bp/version-15/pr-46988
fix: bypass validation during reposting (backport #46978) (backport #46988)
2025-04-10 12:59:02 +05:30
Rohit Waghchaure
eaaac6e596 fix: bypass validation during reposting
(cherry picked from commit 3697b9fd9b)
(cherry picked from commit 01aad96b10)
2025-04-10 06:52:18 +00:00
Rohit Waghchaure
3db70febe1 fix: Recreate Stock Ledgers issue
(cherry picked from commit 229a4cef45)
(cherry picked from commit b819e0a61b)
2025-04-10 06:52:17 +00:00
rohitwaghchaure
13f73b59df Merge pull request #46988 from frappe/mergify/bp/version-15-hotfix/pr-46978
fix: bypass validation during reposting (backport #46978)
2025-04-10 12:21:36 +05:30
rohitwaghchaure
b4efba80a7 Merge pull request #46989 from frappe/mergify/bp/version-15-hotfix/pr-46965
fix: Recreate Stock Ledgers issue (backport #46965)
2025-04-10 12:21:00 +05:30
Mihir Kandoi
88f1cf2943 fix: test file for v15
(cherry picked from commit cc7756dd49)
2025-04-10 06:14:40 +00:00
Mihir Kandoi
81f3f43e14 refactor: split and clean execute function to be more readable
(cherry picked from commit 036af54d54)
(cherry picked from commit 6fedb7b9db)
2025-04-10 06:14:40 +00:00
Mihir Kandoi
c7fead6bb0 perf: take query out of loop
(cherry picked from commit 26de902496)
(cherry picked from commit 9af50528f1)
2025-04-10 06:14:40 +00:00
Mihir Kandoi
bff4902993 fix: remove get_items query.run outside of if condition
(cherry picked from commit 80c17cc005)
(cherry picked from commit e7b5303782)
2025-04-10 06:14:39 +00:00
Mihir Kandoi
9cdd32ad6b refactor: import functions in new report instead of redundant code
(cherry picked from commit 501f07803e)
(cherry picked from commit 0ec026ec7e)
2025-04-10 06:14:39 +00:00
Mihir Kandoi
0f6a7edb53 feat: available serial no report
(cherry picked from commit 5592d8e87f)
(cherry picked from commit c472af87b2)
2025-04-10 06:14:39 +00:00
Rohit Waghchaure
b819e0a61b fix: Recreate Stock Ledgers issue
(cherry picked from commit 229a4cef45)
2025-04-10 06:13:44 +00:00
Rohit Waghchaure
01aad96b10 fix: bypass validation during reposting
(cherry picked from commit 3697b9fd9b)
2025-04-10 06:13:26 +00:00
Rohit Waghchaure
837509ae47 fix: item code not showing in the error message
(cherry picked from commit 86dee69c2f)
(cherry picked from commit 663e2b7e6c)
2025-04-10 06:02:32 +00:00
rohitwaghchaure
860aba47ef Merge pull request #46985 from frappe/mergify/bp/version-15-hotfix/pr-46933
fix: item code not showing in the error message (backport #46933)
2025-04-10 11:31:59 +05:30
rohitwaghchaure
1b6c4b6b4b Merge pull request #46947 from frappe/mergify/bp/version-15-hotfix/pr-46383
feat: available serial no report (backport #46383)
2025-04-10 11:29:02 +05:30
Rohit Waghchaure
663e2b7e6c fix: item code not showing in the error message
(cherry picked from commit 86dee69c2f)
2025-04-10 05:35:55 +00:00
Mihir Kandoi
cc7756dd49 fix: test file for v15 2025-04-09 20:47:10 +05:30
Diptanil Saha
d79de4a434 Merge pull request #46969 from frappe/mergify/bp/version-15-hotfix/pr-46964
fix: added missing project field on pos profile (backport #46964)
2025-04-09 15:57:57 +05:30
Diptanil Saha
b8ef83e1ea chore: resolve conflict 2025-04-09 15:39:15 +05:30
diptanilsaha
8e9ddb7a69 fix: added missing project field on pos profile
(cherry picked from commit 821d64241a)

# Conflicts:
#	erpnext/accounts/doctype/pos_profile/pos_profile.json
2025-04-09 10:05:23 +00:00
Raffael Meyer
d43ce7f8e0 Merge pull request #46960 from frappe/mergify/bp/version-15-hotfix/pr-46959
fix: interaction with due date / payment terms / payment schedule (backport #46959)
2025-04-08 21:34:53 +02:00
barredterra
b5353e4ad1 chore: add german translation 2025-04-08 21:19:34 +02:00
barredterra
14efeb4acd chore: add context
(cherry picked from commit c00f62d54a)
2025-04-08 19:01:35 +00:00
barredterra
35daf669fe fix: clarify confirmation message
(cherry picked from commit 57be8a85d6)
2025-04-08 19:01:34 +00:00
barredterra
0c260baacd fix: use the actual field label
(cherry picked from commit 8a4db69581)
2025-04-08 19:01:34 +00:00
barredterra
cf00d42799 fix: recognize trigger from child table
(cherry picked from commit c55c77f4e9)
2025-04-08 19:01:34 +00:00
barredterra
b06a86541b refactor: use doc parameter instead of this.frm.doc
(cherry picked from commit 87c21a89fe)
2025-04-08 19:01:34 +00:00
Raffael Meyer
f762f7ec3e Merge pull request #46957 from barredterra/update-due-date
feat: update due date in payment schedule
2025-04-08 20:47:13 +02:00
Raffael Meyer
12bd9af3aa Merge pull request #46826 from frappe/mergify/bp/version-15-hotfix/pr-40050
fix: handle due date change (backport #40050)
2025-04-08 20:33:22 +02:00
barredterra
0b0a6b8cfa feat: update due date in payment schedule
Partial backport of b629356b7c
2025-04-08 20:12:25 +02:00
barredterra
830290c859 feat: clear payment terms and schedule 2025-04-08 20:10:31 +02:00
barredterra
98b75aaa38 Merge remote-tracking branch 'upstream/version-15-hotfix' into mergify/bp/version-15-hotfix/pr-40050 2025-04-08 19:59:34 +02:00
Raffael Meyer
d319d89988 Merge pull request #46949 from frappe/mergify/bp/version-15-hotfix/pr-46913
fix: improve translatability of query report print formats (backport #46913)
2025-04-08 16:11:18 +02:00
barredterra
d94ebd0c78 chore: add missing german translation 2025-04-08 15:56:48 +02:00
barredterra
7896f8a855 fix: remove redundant letter head 2025-04-08 15:33:12 +02:00
barredterra
7cf83ffce7 fix: go for lower case "on" because we already have translations for that 2025-04-08 15:31:25 +02:00
barredterra
18e9a9881c fix: make report's "printed on" translatable 2025-04-08 15:30:54 +02:00
Frappe PR Bot
52257c946e chore(release): Bumped to Version 15.56.0
# [15.56.0](https://github.com/frappe/erpnext/compare/v15.55.5...v15.56.0) (2025-04-08)

### Bug Fixes

* **accounting:** update outstanding amount based on update_outstanding_for_self ([fb06f88](fb06f886d2))
* add `Not Cancelled` filter for `payment_entry` in Bank Transaction ([5d47db7](5d47db78e6))
* check payments against orders for getting request amount ([cf7252d](cf7252d3e7))
* condition to update the last puurchase rate ([353fa0c](353fa0cbc3))
* correct mapping(schedule_date) sales order to material request ([e2c8ed2](e2c8ed2afd))
* correct payment request amount ([23c76aa](23c76aa530))
* decimal values causing incorrect batch picking ([c5efdda](c5efddae16))
* do not use self object for setting party and party type ([d1311e6](d1311e619d))
* **Dunning:** undefined variable (backport [#46868](https://github.com/frappe/erpnext/issues/46868)) ([#46869](https://github.com/frappe/erpnext/issues/46869)) ([f63595c](f63595cf0c))
* empty party filter on change of party type in General Ledger Report. ([95cc282](95cc2827c6))
* expense account in the stock entry ([62f342e](62f342ef8b))
* Fix fieldtype in UnReconcile dialog ([7dfff8d](7dfff8d3a2))
* for deadlock issue keep status as In Progress ([34e66b1](34e66b1b27))
* ignore backflush setting on subcontracting return ([ca56150](ca56150918))
* improved rounding adjustment when applying discount (backport [#46720](https://github.com/frappe/erpnext/issues/46720)) ([7b864be](7b864bece8))
* include auto_reconcile_vouchers flag in background job ([26f93f5](26f93f57b8))
* incorrect condition ([502b8f2](502b8f25b3))
* inventory dimensions columns visibility depends on filter ([fe0e5c2](fe0e5c2d48))
* make message translatable (backport [#46863](https://github.com/frappe/erpnext/issues/46863)) ([#46866](https://github.com/frappe/erpnext/issues/46866)) ([d7bb4a2](d7bb4a288c))
* multiple Bank Reconciliation Tool issues ([#46644](https://github.com/frappe/erpnext/issues/46644)) ([e168483](e168483a58))
* **payment term:** allocate payment amount when payment term is fetched from order ([1b9980b](1b9980bb86))
* **portal:** context pay_amount for button ([b7ae17a](b7ae17aaaf))
* **portal:** payment amount for orders ([b0302d7](b0302d71b7))
* pos checking opened entry closed or not (backport [#46726](https://github.com/frappe/erpnext/issues/46726)) ([#46830](https://github.com/frappe/erpnext/issues/46830)) ([80f144a](80f144ac22))
* pos closed dialog on pos closing entry (backport [#46881](https://github.com/frappe/erpnext/issues/46881)) ([#46882](https://github.com/frappe/erpnext/issues/46882)) ([c1fe8f6](c1fe8f6000))
* pos opening entry's status not getting updated on cancel (backport [#46909](https://github.com/frappe/erpnext/issues/46909)) ([#46911](https://github.com/frappe/erpnext/issues/46911)) ([8b11d13](8b11d13cd4))
* remove against_voucher from General Ledger Report ([ba1e7e1](ba1e7e17fb))
* remove all serial/batch fields when use button is unselected ([13f1afa](13f1afa141))
* removed customer_group query in customer.js ([1aac8d3](1aac8d31f4))
* removed hardcoded search fields to fix performance issue ([48822f6](48822f6fee))
* resolve conflicts ([4d8984e](4d8984e4e9))
* restrict customer change if creating from opportunity ([2661147](26611475f6))
* set draft QC in purchase document on creation of qc ([54159b9](54159b9e5e))
* slow query ([23dc9d5](23dc9d5872))
* slow query ([af0fb13](af0fb131a2))
* stock entry repack amount calculation ([8c61639](8c61639062))
* Translate UnReconcile dialog title (backport [#46818](https://github.com/frappe/erpnext/issues/46818)) ([#46861](https://github.com/frappe/erpnext/issues/46861)) ([fcade5d](fcade5d8cd))
* update outstanding with precision ([e115409](e1154090f6))
* update payment amount if automatically_fetch_payment_terms is enabled ([ea289a4](ea289a40fb))
* update posting date before running validations ([2bf44dc](2bf44dc326))
* use `grand_total_diff` instead of `rounding_adjustment` in `taxes_and_totals` ([55b17b9](55b17b918f))
* use docstatus for status filter ([ab52524](ab52524f12))
* use get instead of dot operator to access dict value ([f2df8e5](f2df8e531d))
* use work_order bom_no if no bom present in operation ([c6979ab](c6979ab260))
* user permissions in sales and purchase report ([c705623](c705623fdc))
* validate if pos is opened before pos invoice creation (backport [#46907](https://github.com/frappe/erpnext/issues/46907)) ([#46910](https://github.com/frappe/erpnext/issues/46910)) ([999ab28](999ab28bf0))
* valuation rate not updating for raw materials ([454dd3a](454dd3a2f1))

### Features

* allow UOMs to select for which converstion rate defined in item master ([288aad6](288aad6f5d))
* **Customer:** add Dunning to dashboard ([1128b5f](1128b5f09c))
* option to recreate Stock Ledger Entries against stock transactions ([64fdcb7](64fdcb752d))

### Performance Improvements

* reduce query when validating any doc ([890abf6](890abf6b90))
* Stock entry cancel is slow ([1bdfd33](1bdfd33816))
2025-04-08 13:08:39 +00:00
ruthra kumar
c4ab17b947 Merge pull request #46940 from frappe/version-15-hotfix
chore: release v15
2025-04-08 18:37:09 +05:30
rohitwaghchaure
10cf575bba Merge pull request #46946 from frappe/mergify/bp/version-15-hotfix/pr-46942
fix: ignore backflush setting on subcontracting return (backport #46942)
2025-04-08 18:12:52 +05:30
Mihir Kandoi
6fedb7b9db refactor: split and clean execute function to be more readable
(cherry picked from commit 036af54d54)
2025-04-08 12:17:05 +00:00
Mihir Kandoi
9af50528f1 perf: take query out of loop
(cherry picked from commit 26de902496)
2025-04-08 12:17:05 +00:00
Mihir Kandoi
e7b5303782 fix: remove get_items query.run outside of if condition
(cherry picked from commit 80c17cc005)
2025-04-08 12:17:05 +00:00
Mihir Kandoi
0ec026ec7e refactor: import functions in new report instead of redundant code
(cherry picked from commit 501f07803e)
2025-04-08 12:17:04 +00:00
Mihir Kandoi
c472af87b2 feat: available serial no report
(cherry picked from commit 5592d8e87f)
2025-04-08 12:17:04 +00:00
Mihir Kandoi
ca56150918 fix: ignore backflush setting on subcontracting return
(cherry picked from commit 7479e1ec32)
2025-04-08 12:15:44 +00:00
ruthra kumar
617bebfa8f Merge pull request #46945 from frappe/mergify/bp/version-15-hotfix/pr-46892
fix: use get instead of dot operator to access dict value to prevent no attribute error (backport #46892)
2025-04-08 17:20:45 +05:30
Mihir Kandoi
f2df8e531d fix: use get instead of dot operator to access dict value
(cherry picked from commit 7fb75f0482)
2025-04-08 11:34:11 +00:00
ruthra kumar
c47b3c3642 Merge pull request #46932 from frappe/mergify/bp/version-15-hotfix/pr-46626
fix: correct payment request amount (backport #46626)
2025-04-08 16:56:25 +05:30
ruthra kumar
e271933e43 chore: resolve conflict 2025-04-08 16:33:07 +05:30
ljain112
23c76aa530 fix: correct payment request amount
(cherry picked from commit 913c60d77b)

# Conflicts:
#	erpnext/accounts/doctype/payment_request/payment_request.py
2025-04-08 16:33:07 +05:30
ruthra kumar
bed960df36 Merge pull request #46939 from frappe/mergify/bp/version-15-hotfix/pr-39701
fix: check order paid amount before payment request (backport #39701)
2025-04-08 16:30:28 +05:30
ruthra kumar
36bc87270c Merge pull request #46936 from frappe/mergify/bp/version-15-hotfix/pr-46631
fix: update outstanding for self (backport #46631)
2025-04-08 16:21:49 +05:30
ljain112
4d8984e4e9 fix: resolve conflicts 2025-04-08 15:54:44 +05:30
ruthra kumar
4eb0f39af7 chore: pass doctype and name 2025-04-08 15:15:24 +05:30
Gursheen Anand
b7ae17aaaf fix(portal): context pay_amount for button
(cherry picked from commit 7efb5a8cb5)

# Conflicts:
#	erpnext/templates/pages/order.html
2025-04-08 09:33:20 +00:00
Gursheen Anand
b0302d71b7 fix(portal): payment amount for orders
(cherry picked from commit c18ff5bd25)

# Conflicts:
#	erpnext/templates/pages/order.py
2025-04-08 09:33:20 +00:00
Gursheen Anand
cf7252d3e7 fix: check payments against orders for getting request amount
(cherry picked from commit f7face43cd)

# Conflicts:
#	erpnext/accounts/doctype/payment_request/payment_request.py
2025-04-08 09:33:19 +00:00
ruthra kumar
d6b488f529 chore: resolve conflict 2025-04-08 14:36:15 +05:30
Bhavan23
88e11d6fd9 test: add unit test to validate outstanding amount for update_outstanding_for_self checkbox enabled
(cherry picked from commit 7b0882600a)
2025-04-08 08:59:04 +00:00
Bhavan23
fb06f886d2 fix(accounting): update outstanding amount based on update_outstanding_for_self
fix(accounting): against voucher has been already paid show proper message and update update_outstanding_for_self as 1

(cherry picked from commit 222f1834f1)

# Conflicts:
#	erpnext/controllers/accounts_controller.py
2025-04-08 08:59:04 +00:00
JK1117
250b67076d fix: use source_fieldname to validate inventory dimension
(cherry picked from commit daa5bebdd0)
2025-04-08 08:57:59 +00:00
JK1117
2ed6c211f9 feat: fetch source_fieldname for inventory dimension
(cherry picked from commit 4e63ee1a70)
2025-04-08 08:57:59 +00:00
rohitwaghchaure
bbc9cedf4d Merge pull request #46916 from frappe/mergify/bp/version-15-hotfix/pr-46898
fix: removed hardcoded search fields to fix performance issue (backport #46898)
2025-04-08 14:18:16 +05:30
rohitwaghchaure
b824038d37 chore: fix conflicts 2025-04-08 13:32:49 +05:30
ruthra kumar
b730fdd007 Merge pull request #46930 from frappe/mergify/bp/version-15-hotfix/pr-46821
fix: removed customer_group query in customer.js (backport #46821)
2025-04-08 13:09:37 +05:30
Shariq Ansari
df744135ff Merge pull request #46927 from frappe/mergify/bp/version-15-hotfix/pr-46903
fix: restrict customer change if creating from opportunity (backport #46903)
2025-04-08 13:08:34 +05:30
ljain112
1aac8d31f4 fix: removed customer_group query in customer.js
(cherry picked from commit f49adfdd98)
2025-04-08 07:28:31 +00:00
Shariq Ansari
26611475f6 fix: restrict customer change if creating from opportunity
(cherry picked from commit dc4819e897)
2025-04-08 06:37:36 +00:00
ruthra kumar
5b3ae9508a Merge pull request #46925 from frappe/mergify/bp/version-15-hotfix/pr-46709
fix: user permissions in sales and purchase report (backport #46709)
2025-04-08 11:52:46 +05:30
ruthra kumar
81f061634e Merge pull request #46926 from frappe/mergify/bp/version-15-hotfix/pr-46819
fix: Fix fieldtype in UnReconcile dialog (backport #46819)
2025-04-08 11:51:56 +05:30
rohitwaghchaure
1e4918fb17 Merge pull request #46918 from frappe/mergify/bp/version-15-hotfix/pr-46893
fix: inventory dimensions columns visibility depends on filter (backport #46893)
2025-04-08 11:48:20 +05:30
Corentin Forler
7dfff8d3a2 fix: Fix fieldtype in UnReconcile dialog
(cherry picked from commit 665645721b)
2025-04-08 05:56:37 +00:00
ljain112
c705623fdc fix: user permissions in sales and purchase report
(cherry picked from commit f4bc1dfd00)
2025-04-08 05:41:01 +00:00
ruthra kumar
6ba4c092ba Merge pull request #46921 from frappe/mergify/bp/version-15-hotfix/pr-46804
fix: update outstanding with precision (backport #46804)
2025-04-08 11:08:09 +05:30
ljain112
e1154090f6 fix: update outstanding with precision
(cherry picked from commit aadda9f606)
2025-04-08 04:29:48 +00:00
Rohit Waghchaure
fe0e5c2d48 fix: inventory dimensions columns visibility depends on filter
(cherry picked from commit 2b411fb7f5)
2025-04-08 03:21:15 +00:00
Rohit Waghchaure
48822f6fee fix: removed hardcoded search fields to fix performance issue
(cherry picked from commit 216bf2456e)

# Conflicts:
#	erpnext/manufacturing/doctype/bom/bom.py
2025-04-08 03:20:13 +00:00
Raffael Meyer
8276e8e8b3 chore: fix german translations (#46912) 2025-04-08 02:39:04 +02:00
mergify[bot]
8b11d13cd4 fix: pos opening entry's status not getting updated on cancel (backport #46909) (#46911)
fix: pos opening entry's status not getting updated on cancel (#46909)

(cherry picked from commit 6fae98afda)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-04-07 21:03:20 +05:30
mergify[bot]
999ab28bf0 fix: validate if pos is opened before pos invoice creation (backport #46907) (#46910)
fix: validate if pos is opened before pos invoice creation (#46907)

* fix: validate if pos is opened before pos invoice creation

* fix: added title on throw dialog

* test: fixed failing test

(cherry picked from commit 3de1b22480)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-04-07 20:54:23 +05:30
ruthra kumar
ed36fc0530 Merge pull request #46905 from frappe/mergify/bp/version-15-hotfix/pr-46895
fix: empty party filter on change of party type in General Ledger Report (backport #46895)
2025-04-07 17:56:07 +05:30
ljain112
95cc2827c6 fix: empty party filter on change of party type in General Ledger Report.
(cherry picked from commit 9c68bc22fa)
2025-04-07 12:13:16 +00:00
ruthra kumar
03aa5a1294 Merge pull request #46902 from frappe/mergify/bp/version-15-hotfix/pr-46900
fix: remove against_voucher and against_voucher_type column from General Ledger Report (backport #46900)
2025-04-07 17:36:42 +05:30
ljain112
ba1e7e17fb fix: remove against_voucher from General Ledger Report
(cherry picked from commit 6d1f119a0f)
2025-04-07 17:14:07 +05:30
ruthra kumar
6adf79b8a5 Merge pull request #46897 from frappe/mergify/bp/version-15-hotfix/pr-46728
fix: update posting date before running validations (backport #46728)
2025-04-07 14:49:14 +05:30
Dany Robert
2bf44dc326 fix: update posting date before running validations
(cherry picked from commit d04dbd8ed9)
2025-04-07 09:01:59 +00:00
ruthra kumar
1500691bca Merge pull request #46844 from frappe/mergify/bp/version-15-hotfix/pr-46823
chore: update links to Frappe School (backport #46823)
2025-04-07 11:45:25 +05:30
ruthra kumar
3d57916832 chore: resolve conflict 2025-04-07 11:28:39 +05:30
ruthra kumar
4e9a3b687f Merge pull request #46891 from frappe/mergify/bp/version-15-hotfix/pr-46637
fix(payment term): allocate payment amount when payment term is fetched from order (backport #46637)
2025-04-07 11:25:45 +05:30
rohitwaghchaure
3181dc8ed1 Merge pull request #46885 from frappe/mergify/bp/version-15-hotfix/pr-46836
fix: remove all serial/batch fields when use button is unselected (backport #46836)
2025-04-07 11:07:12 +05:30
venkat102
ea289a40fb fix: update payment amount if automatically_fetch_payment_terms is enabled
(cherry picked from commit 7bf1a39861)
2025-04-07 05:34:25 +00:00
venkat102
3b66c48479 test: validate payment schedule based on invoice amount
(cherry picked from commit 7785296573)
2025-04-07 05:34:25 +00:00
venkat102
1b9980bb86 fix(payment term): allocate payment amount when payment term is fetched from order
(cherry picked from commit 5618859bd8)
2025-04-07 05:34:25 +00:00
ruthra kumar
d54b39b3a7 Merge pull request #46889 from frappe/mergify/bp/version-15-hotfix/pr-46784
fix: correct mapping(schedule_date) sales order to material request (backport #46784)
2025-04-07 11:03:43 +05:30
MohsinAli
e2c8ed2afd fix: correct mapping(schedule_date) sales order to material request
(cherry picked from commit 732e950265)
2025-04-07 05:15:13 +00:00
Frappe PR Bot
9397a57d4d chore(release): Bumped to Version 15.55.5
## [15.55.5](https://github.com/frappe/erpnext/compare/v15.55.4...v15.55.5) (2025-04-07)

### Bug Fixes

* set draft QC in purchase document on creation of qc ([bf3349a](bf3349a432))
* slow query ([b172ae0](b172ae0557))
2025-04-07 05:14:16 +00:00
rohitwaghchaure
d70050931b Merge pull request #46887 from frappe/mergify/bp/version-15/pr-46842
fix: set draft QC in purchase document on creation of qc (backport #46832) (backport #46842)
2025-04-07 10:42:55 +05:30
rohitwaghchaure
1875d69f60 Merge pull request #46888 from frappe/mergify/bp/version-15/pr-46880
fix: slow query (backport #46845) (backport #46880)
2025-04-07 10:42:41 +05:30
ruthra kumar
0c6c654a39 Merge pull request #46886 from frappe/mergify/bp/version-15-hotfix/pr-46743
fix: include auto_reconcile_vouchers flag in background job (backport #46743)
2025-04-07 10:40:30 +05:30
rohitwaghchaure
b2d71b44cf chore: fix conflicts
(cherry picked from commit 4bcf052220)
2025-04-07 04:56:07 +00:00
Rohit Waghchaure
b172ae0557 fix: slow query
(cherry picked from commit f82c8ea5eb)

# Conflicts:
#	erpnext/stock/deprecated_serial_batch.py
(cherry picked from commit 23dc9d5872)
2025-04-07 04:56:07 +00:00
Rohit Waghchaure
bf3349a432 fix: set draft QC in purchase document on creation of qc
(cherry picked from commit 2553dea78e)
(cherry picked from commit 54159b9e5e)
2025-04-07 04:55:58 +00:00
venkat102
26f93f57b8 fix: include auto_reconcile_vouchers flag in background job
(cherry picked from commit 35fbbc2057)
2025-04-07 04:51:00 +00:00
Mihir Kandoi
13f1afa141 fix: remove all serial/batch fields when use button is unselected
(cherry picked from commit 22ffdb9e77)
2025-04-07 04:50:55 +00:00
rohitwaghchaure
f3eeb77ef3 Merge pull request #46838 from frappe/st35124
fix: use work_order bom_no if no bom present in operation
2025-04-07 10:18:20 +05:30
ruthra kumar
83b72dc1b3 Merge pull request #46883 from frappe/mergify/bp/version-15-hotfix/pr-46727
fix: use docstatus for status filter (backport #46727)
2025-04-07 10:18:08 +05:30
rethik
ab52524f12 fix: use docstatus for status filter
(cherry picked from commit 31e59354c9)
2025-04-07 04:43:47 +00:00
mergify[bot]
c1fe8f6000 fix: pos closed dialog on pos closing entry (backport #46881) (#46882)
fix: pos closed dialog on pos closing entry (#46881)

(cherry picked from commit 21954b9f9c)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-04-06 21:32:17 +05:30
rohitwaghchaure
79e8bfe213 Merge pull request #46880 from frappe/mergify/bp/version-15-hotfix/pr-46845
fix: slow query (backport #46845)
2025-04-06 18:52:15 +05:30
ruthra kumar
8d3fef3195 Merge pull request #46878 from frappe/mergify/bp/version-15-hotfix/pr-46716
feat(Customer): add Dunning to dashboard (backport #46716)
2025-04-06 16:52:07 +05:30
rohitwaghchaure
7c3467d1ff Merge pull request #46879 from frappe/mergify/bp/version-15-hotfix/pr-46875
perf: Stock entry cancel is slow (backport #46875)
2025-04-06 16:25:54 +05:30
rohitwaghchaure
4bcf052220 chore: fix conflicts 2025-04-06 16:25:20 +05:30
Rohit Waghchaure
23dc9d5872 fix: slow query
(cherry picked from commit f82c8ea5eb)

# Conflicts:
#	erpnext/stock/deprecated_serial_batch.py
2025-04-06 10:41:44 +00:00
Türker Tunalı
1bdfd33816 perf: Stock entry cancel is slow
Some queries still use "timestamp" function instead of "posting_datetime". In my instance single stock entry cancel ends with request timeout. Using "posting_datetime" field directly improves the situation.

cont: https://github.com/frappe/erpnext/pull/46293
(cherry picked from commit ddbb44c6a2)
2025-04-06 10:40:32 +00:00
rohitwaghchaure
c5710dcbe2 Merge pull request #46873 from frappe/mergify/bp/version-15-hotfix/pr-46853
fix: stock entry repack amount calculation (backport #46853)
2025-04-06 16:09:57 +05:30
barredterra
1128b5f09c feat(Customer): add Dunning to dashboard
(cherry picked from commit 638d825d8c)
2025-04-06 10:21:31 +00:00
ruthra kumar
8617ea5685 Merge pull request #46877 from frappe/mergify/bp/version-15-hotfix/pr-46658
chore: adjusted dimension placement in Accounts Payable (backport #46658)
2025-04-06 15:44:19 +05:30
Sruthy
6b3e64c0cc chore: adjusted dimension placement in Accounts Payable
(cherry picked from commit 361a55a703)
2025-04-06 10:10:33 +00:00
Rohit Waghchaure
8c61639062 fix: stock entry repack amount calculation
(cherry picked from commit 544ceb93cd)
2025-04-06 04:16:16 +00:00
rohitwaghchaure
51c18217fa Merge pull request #46842 from frappe/mergify/bp/version-15-hotfix/pr-46832
fix: set draft QC in purchase document on creation of qc (backport #46832)
2025-04-06 09:45:25 +05:30
Sagar Vora
679397528a Merge pull request #46871 from frappe/mergify/bp/version-15-hotfix/pr-46870
perf: reduce query when validating any doc (backport #46870)
2025-04-05 23:42:18 +05:30
Sagar Vora
890abf6b90 perf: reduce query when validating any doc
(cherry picked from commit b863296e53)
2025-04-05 18:10:06 +00:00
mergify[bot]
86853224c3 refactor(Payment Entry): reduce indentation (backport #46864) (#46867)
refactor(Payment Entry): reduce indentation (#46864)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-04-05 17:39:42 +02:00
mergify[bot]
d7bb4a288c fix: make message translatable (backport #46863) (#46866)
fix: make message translatable (#46863)

(cherry picked from commit 7d12e9afd4)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-04-05 17:37:36 +02:00
mergify[bot]
fcade5d8cd fix: Translate UnReconcile dialog title (backport #46818) (#46861)
fix: Translate UnReconcile dialog title

(cherry picked from commit f2cfb03c2c)

Co-authored-by: Corentin Forler <corentin@dokos.io>
2025-04-05 17:37:08 +02:00
mergify[bot]
f63595cf0c fix(Dunning): undefined variable (backport #46868) (#46869)
fix(Dunning): undefined variable (#46868)

(cherry picked from commit 04df09cfca)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-04-05 17:36:43 +02:00
ruthra kumar
e8efa6d331 Merge pull request #46857 from frappe/mergify/bp/version-15-hotfix/pr-46625
refactor: Update Bank Transaction `set_query` implemetation (backport #46625)
2025-04-05 07:36:37 +05:30
ruthra kumar
a6834f3875 chore: resolve conflict 2025-04-05 07:32:15 +05:30
Abdeali Chharchhoda
3dc29cbec8 chore: formatting
(cherry picked from commit 4ae11d4384)

# Conflicts:
#	erpnext/accounts/doctype/bank_transaction/bank_transaction.js
2025-04-05 01:35:11 +00:00
Abdeali Chharchhoda
5d47db78e6 fix: add Not Cancelled filter for payment_entry in Bank Transaction
(cherry picked from commit 85dd1dd4c7)
2025-04-05 01:35:11 +00:00
Abdeali Chharchhoda
a19eece881 refactor: move payment_document query to setup
(cherry picked from commit 257802aeda)

# Conflicts:
#	erpnext/accounts/doctype/bank_transaction/bank_transaction.js
2025-04-05 01:35:11 +00:00
Md Hussain Nagaria
2dfe13e183 chore: update links to Frappe School (#46823)
(cherry picked from commit ef4f662c31)

# Conflicts:
#	erpnext/accounts/workspace/accounting/accounting.json
#	erpnext/buying/workspace/buying/buying.json
#	erpnext/manufacturing/workspace/manufacturing/manufacturing.json
#	erpnext/projects/workspace/projects/projects.json
#	erpnext/selling/workspace/selling/selling.json
#	erpnext/stock/workspace/stock/stock.json
2025-04-02 06:46:29 +00:00
Rohit Waghchaure
54159b9e5e fix: set draft QC in purchase document on creation of qc
(cherry picked from commit 2553dea78e)
2025-04-01 14:17:39 +00:00
ljain112
bde55d2a07 fix: resolved conflicts 2025-04-01 18:51:10 +05:30
Sagar Vora
36aa308bce Merge pull request #46834 from frappe/mergify/bp/version-15-hotfix/pr-46829
fix: use `grand_total_diff` instead of `rounding_adjustment` in `taxes_and_totals` (backport #46829)
2025-04-01 14:47:03 +05:30
Mihir Kandoi
c6979ab260 fix: use work_order bom_no if no bom present in operation 2025-04-01 14:45:24 +05:30
mergify[bot]
80f144ac22 fix: pos checking opened entry closed or not (backport #46726) (#46830)
fix: pos checking opened entry closed or not (#46726)

* fix: pos checking opened entry closed or not

* fix: linter issue

* fix: linter issue

(cherry picked from commit 5d5b6acc79)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-04-01 13:54:29 +05:30
vishakhdesai
55b17b918f fix: use grand_total_diff instead of rounding_adjustment in taxes_and_totals
(cherry picked from commit fd252da6b1)
2025-04-01 13:34:30 +05:30
rohitwaghchaure
27ea95236f Merge pull request #46817 from frappe/mergify/bp/version-15-hotfix/pr-46815
feat: allow UOMs to select for which conversion rate defined in item (backport #46815)
2025-04-01 08:31:52 +05:30
rohitwaghchaure
c762a8903b Merge pull request #46824 from frappe/mergify/bp/version-15-hotfix/pr-46808
fix: condition to update the last purchase rate (backport #46808)
2025-04-01 08:31:30 +05:30
barredterra
db647a4e42 fix: wording 2025-03-31 21:38:34 +02:00
barredterra
79ed02bb2c fix: translatability
(cherry picked from commit 6d43d46fbc)
2025-03-31 19:23:41 +00:00
Rohit Waghchaure
353fa0cbc3 fix: condition to update the last puurchase rate
(cherry picked from commit bad901e7da)
2025-03-31 15:15:20 +00:00
rohitwaghchaure
2b854377b1 chore: fix conflicts 2025-03-31 20:43:34 +05:30
Rohit Waghchaure
288aad6f5d feat: allow UOMs to select for which converstion rate defined in item master
(cherry picked from commit b1dfbbe85e)

# Conflicts:
#	erpnext/stock/doctype/stock_settings/stock_settings.json
2025-03-31 10:53:11 +00:00
rohitwaghchaure
a60acbc592 Merge pull request #46807 from frappe/mergify/bp/version-15-hotfix/pr-46806
feat: option to recreate Stock Ledger Entries against stock transactions (backport #46806)
2025-03-31 16:06:42 +05:30
Marc Ramser
42479d9a7f feat(regional): Address Template for Germany & Add Switzerland Template (#46737)
* Add Address template for Switzerland

* Fix address template for germany

If an ERPNext instance is set to German and used by a business outside Germany (e.g., in Switzerland or Austria), customer addresses in Germany are displayed in their national format. However, for postal services, the international format (including the country) is required.".

This is just a workaround. IMHO the correct fix would be to check where the company is located and based on that use the national or the international template.

(cherry picked from commit 21b8ad6aa5)
2025-03-31 10:34:00 +00:00
Sagar Vora
62275d09da Merge pull request #46814 from frappe/mergify/bp/version-15-hotfix/pr-46812
fix: revert resetting `rounding_adjustment` (backport #46812)
2025-03-31 15:56:08 +05:30
Vishakh Desai
96af1ccffb Merge pull request #46812 from vishakhdesai/fix-taxes-and-totals
fix: revert resetting `rounding_adjustment`
(cherry picked from commit 3a9dca0563)
2025-03-31 10:25:00 +00:00
mergify[bot]
7b864bece8 fix: improved rounding adjustment when applying discount (backport #46720)
* fix: improved rounding adjustment when applying discount (#46720)

* fix: rounding adjustment in apply_discount_amount taxes_and_totals

* refactor: minor changes

* fix: set the rounding difference while calculating tax total in the last tax row and add test case

* fix: failing test case

* fix: made changes in get_total_for_discount_amount in taxes_and_totals

* fix: failing test cases

* fix: changes as per review

* refactor: remove unnecessary use of flt

* refactor: improve logic

* refactor: minor change

* refactor: minor changes

* fix: add a test case for applying discount with previous row total in taxes

* fix: failing test case

* refactor: flatter code, remove `flt` usage for accuracy

---------

Co-authored-by: Vishakh Desai <78500008+vishakhdesai@users.noreply.github.com>
Co-authored-by: Sagar Vora <sagar@resilient.tech>
2025-03-31 15:54:42 +05:30
rohitwaghchaure
604b185bd3 chore: fix conflicts 2025-03-31 15:05:10 +05:30
Rohit Waghchaure
64fdcb752d feat: option to recreate Stock Ledger Entries against stock transactions
(cherry picked from commit 218dbd6911)

# Conflicts:
#	erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.json
2025-03-31 08:44:38 +00:00
Sagar Vora
37adb9187f Merge pull request #46803 from frappe/mergify/bp/version-15-hotfix/pr-46644
fix: multiple Bank Reconciliation Tool issues (backport #46644)
2025-03-31 11:37:36 +05:30
Vishakh Desai
e168483a58 fix: multiple Bank Reconciliation Tool issues (#46644)
* fix: bank reconciliation tool issue

* refactor: separate Bank Transaction linking from other logic

* fix: delink old pe on update_after_submit in bank transaction

* fix: failing test case fixed

* fix: changes as per review

* refactor: rename `gles` to `gl_entries`

---------

Co-authored-by: Sagar Vora <sagar@resilient.tech>
(cherry picked from commit 646cf54679)
2025-03-31 05:57:08 +00:00
Frappe PR Bot
5dd99f896e chore(release): Bumped to Version 15.55.4
## [15.55.4](https://github.com/frappe/erpnext/compare/v15.55.3...v15.55.4) (2025-03-29)

### Bug Fixes

* valuation rate not updating for raw materials ([57e2619](57e2619cf1))
2025-03-29 20:07:32 +00:00
rohitwaghchaure
7579e00425 Merge pull request #46790 from frappe/mergify/bp/version-15/pr-46778
fix: valuation rate not updating for raw materials (backport #46760) (backport #46778)
2025-03-30 01:36:12 +05:30
rohitwaghchaure
c22869fed9 chore: fix conflicts
(cherry picked from commit 5079519863)
2025-03-29 15:31:21 +00:00
Rohit Waghchaure
57e2619cf1 fix: valuation rate not updating for raw materials
(cherry picked from commit 5af8378471)

# Conflicts:
#	erpnext/manufacturing/doctype/work_order/test_work_order.py
(cherry picked from commit 454dd3a2f1)
2025-03-29 15:31:21 +00:00
Frappe PR Bot
66d0ad1bc6 chore(release): Bumped to Version 15.55.3
## [15.55.3](https://github.com/frappe/erpnext/compare/v15.55.2...v15.55.3) (2025-03-29)

### Bug Fixes

* incorrect condition ([0721816](0721816763))
2025-03-29 07:03:05 +00:00
rohitwaghchaure
3395e7c2cd Merge pull request #46785 from frappe/mergify/bp/version-15/pr-46781
fix: incorrect condition (backport #46777) (backport #46781)
2025-03-29 12:31:36 +05:30
Rohit Waghchaure
0721816763 fix: incorrect condition
(cherry picked from commit 0c1a8e9c58)
(cherry picked from commit 502b8f25b3)
2025-03-29 06:48:03 +00:00
rohitwaghchaure
5315769b1f Merge pull request #46781 from frappe/mergify/bp/version-15-hotfix/pr-46777
fix: incorrect condition (backport #46777)
2025-03-29 12:17:09 +05:30
rohitwaghchaure
9fa5afd215 Merge pull request #46779 from frappe/mergify/bp/version-15-hotfix/pr-46775
fix: for deadlock issue keep status as In Progress (backport #46775)
2025-03-29 12:16:55 +05:30
rohitwaghchaure
88ff17f467 Merge pull request #46778 from frappe/mergify/bp/version-15-hotfix/pr-46760
fix: valuation rate not updating for raw materials (backport #46760)
2025-03-29 12:16:35 +05:30
Rohit Waghchaure
502b8f25b3 fix: incorrect condition
(cherry picked from commit 0c1a8e9c58)
2025-03-28 18:19:53 +00:00
rohitwaghchaure
5079519863 chore: fix conflicts 2025-03-28 23:47:43 +05:30
Rohit Waghchaure
34e66b1b27 fix: for deadlock issue keep status as In Progress
(cherry picked from commit e6ff7f0e9f)
2025-03-28 18:16:41 +00:00
Rohit Waghchaure
454dd3a2f1 fix: valuation rate not updating for raw materials
(cherry picked from commit 5af8378471)

# Conflicts:
#	erpnext/manufacturing/doctype/work_order/test_work_order.py
2025-03-28 18:15:42 +00:00
Abdeali Chharchhodawala
6f94ba599b Merge pull request #46683 from Abdeali099/set-employee-contact-details
fix: Set complete contact details for `Employee` in PE
(cherry picked from commit 8c9d630ee4)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.json
#	erpnext/accounts/doctype/payment_entry/payment_entry.py
2025-03-28 12:49:20 +00:00
rohitwaghchaure
e45d0779ef Merge pull request #46752 from frappe/mergify/bp/version-15/pr-46749
Revert "perf: timeout while renaming cost center (backport #46641)" (backport #46749)
2025-03-27 13:13:17 +05:30
rohitwaghchaure
c6ce76170b Revert "perf: timeout while renaming cost center (backport #46641)"
(cherry picked from commit 326126e741)
2025-03-27 06:54:18 +00:00
rohitwaghchaure
f3cff68713 Merge pull request #46749 from frappe/revert-46647-mergify/bp/version-15-hotfix/pr-46641
Revert "perf: timeout while renaming cost center (backport #46641)"
2025-03-27 12:23:13 +05:30
rohitwaghchaure
326126e741 Revert "perf: timeout while renaming cost center (backport #46641)" 2025-03-27 11:58:02 +05:30
Frappe PR Bot
de3e6922b5 chore(release): Bumped to Version 15.55.2
## [15.55.2](https://github.com/frappe/erpnext/compare/v15.55.1...v15.55.2) (2025-03-27)

### Bug Fixes

* do not use self object for setting party and party type ([7795030](7795030b7b))
2025-03-27 06:05:55 +00:00
ruthra kumar
ae6d3f27a2 Merge pull request #46747 from frappe/mergify/bp/version-15/pr-46719
fix: do not use self object for setting party and party type  (backport #46719)
2025-03-27 11:34:32 +05:30
ruthra kumar
b22d0a5804 Merge pull request #46746 from frappe/mergify/bp/version-15-hotfix/pr-46719
fix: do not use self object for setting party and party type  (backport #46719)
2025-03-27 11:34:17 +05:30
ljain112
7795030b7b fix: do not use self object for setting party and party type
(cherry picked from commit 80b746d4dd)
2025-03-27 05:39:52 +00:00
ljain112
d1311e619d fix: do not use self object for setting party and party type
(cherry picked from commit 80b746d4dd)
2025-03-27 05:38:38 +00:00
Frappe PR Bot
9bac43acff chore(release): Bumped to Version 15.55.1
## [15.55.1](https://github.com/frappe/erpnext/compare/v15.55.0...v15.55.1) (2025-03-27)

### Bug Fixes

* decimal values causing incorrect batch picking ([1b6aeba](1b6aeba267))
* expense account in the stock entry ([e393ce9](e393ce9a47))
* slow query ([f3ba5a8](f3ba5a81ab))
2025-03-27 03:45:26 +00:00
rohitwaghchaure
1e987153c9 Merge pull request #46735 from frappe/mergify/bp/version-15/pr-46730
fix: expense account in the stock entry (backport #46710) (backport #46730)
2025-03-27 09:14:05 +05:30
rohitwaghchaure
d36a7c2389 Merge pull request #46741 from frappe/mergify/bp/version-15/pr-46734
fix: decimal values causing incorrect batch picking (backport #46733) (backport #46734)
2025-03-27 09:13:56 +05:30
rohitwaghchaure
b548cc411d Merge pull request #46742 from frappe/mergify/bp/version-15/pr-46740
fix: slow query (backport #46739) (backport #46740)
2025-03-27 09:13:47 +05:30
rohitwaghchaure
ad3f985dc4 chore: fix conflicts
(cherry picked from commit 41f20a9c64)
2025-03-26 17:09:42 +00:00
Rohit Waghchaure
f3ba5a81ab fix: slow query
(cherry picked from commit 5ddb36af87)

# Conflicts:
#	erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json
(cherry picked from commit af0fb131a2)
2025-03-26 17:09:42 +00:00
rohitwaghchaure
8b5ed20225 Merge pull request #46740 from frappe/mergify/bp/version-15-hotfix/pr-46739
fix: slow query (backport #46739)
2025-03-26 22:38:38 +05:30
Rohit Waghchaure
1b6aeba267 fix: decimal values causing incorrect batch picking
(cherry picked from commit 7bfe703b04)
(cherry picked from commit c5efddae16)
2025-03-26 16:43:35 +00:00
rohitwaghchaure
af3b871989 Merge pull request #46734 from frappe/mergify/bp/version-15-hotfix/pr-46733
fix: decimal values causing incorrect batch picking (backport #46733)
2025-03-26 22:12:07 +05:30
rohitwaghchaure
41f20a9c64 chore: fix conflicts 2025-03-26 22:11:43 +05:30
Rohit Waghchaure
af0fb131a2 fix: slow query
(cherry picked from commit 5ddb36af87)

# Conflicts:
#	erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json
2025-03-26 16:40:32 +00:00
Rohit Waghchaure
e393ce9a47 fix: expense account in the stock entry
(cherry picked from commit 89569d4b32)
(cherry picked from commit 62f342ef8b)
2025-03-26 10:18:49 +00:00
Rohit Waghchaure
c5efddae16 fix: decimal values causing incorrect batch picking
(cherry picked from commit 7bfe703b04)
2025-03-26 10:13:40 +00:00
rohitwaghchaure
2ed29d06d3 Merge pull request #46730 from frappe/mergify/bp/version-15-hotfix/pr-46710
fix: expense account in the stock entry (backport #46710)
2025-03-26 12:16:59 +05:30
Rohit Waghchaure
62f342ef8b fix: expense account in the stock entry
(cherry picked from commit 89569d4b32)
2025-03-26 06:30:40 +00:00
Frappe PR Bot
8951efb457 chore(release): Bumped to Version 15.55.0
# [15.55.0](https://github.com/frappe/erpnext/compare/v15.54.5...v15.55.0) (2025-03-25)

### Bug Fixes

* add base_outstanding and base_paid_amount in payment schedule table ([412e6be](412e6be502))
* add patch to update base_outstanding and base_paid_amount ([c3221c4](c3221c4e93))
* correct accumulated depreciation calculation for disposed assets (backport [#46660](https://github.com/frappe/erpnext/issues/46660)) ([#46661](https://github.com/frappe/erpnext/issues/46661)) ([4df5f18](4df5f18d85))
* correct invoice order in payment reconcillaiton ([2a70791](2a70791bba))
* customer credit limit check based on `bypass_credit_limit_check` in Journal Entry ([6c443bd](6c443bd85a))
* date added to wrong patch ([2bfaf64](2bfaf64fff))
* do not validate if conversion rate is 1 for different currency ([391b5c4](391b5c4226))
* don't filter payment entries on Bank Account in Payment Clearance ([dc3b5e2](dc3b5e2f3a))
* **Payment Entry:** get contact details from existing contact ([#40556](https://github.com/frappe/erpnext/issues/40556)) ([f964178](f964178008))
* unwired order_by argument in get_transaction_list (backport [#46636](https://github.com/frappe/erpnext/issues/46636)) ([#46643](https://github.com/frappe/erpnext/issues/46643)) ([2ebea88](2ebea8866a))

### Features

* **accounting:** allow chart_of_account.get_chart to be whilelist ([e69c722](e69c722534))
* **projects:** add option to hide timesheets for project users ([#46173](https://github.com/frappe/erpnext/issues/46173)) ([3834d6f](3834d6fbce))
* repost accounting ledger for purchase receipt ([4edfc6f](4edfc6f125))

### Performance Improvements

* timeout while renaming cost center ([58eb184](58eb1849d7))
2025-03-25 13:50:33 +00:00
ruthra kumar
5db2a19778 Merge pull request #46715 from frappe/version-15-hotfix
chore: release v15
2025-03-25 19:16:44 +05:30
ruthra kumar
288206bdcd Merge pull request #46634 from frappe/mergify/bp/version-15-hotfix/pr-46627
fix: date added to wrong patch (backport #46627)
2025-03-25 18:45:21 +05:30
ruthra kumar
b3c3733286 chore: resolve conflict 2025-03-25 17:53:29 +05:30
ruthra kumar
b2b49446d4 Merge pull request #46713 from frappe/mergify/bp/version-15-hotfix/pr-46616
fix: do not validate if conversion rate is 1 for different currency (backport #46616)
2025-03-25 14:29:09 +05:30
ljain112
391b5c4226 fix: do not validate if conversion rate is 1 for different currency
(cherry picked from commit e8a66d03bc)
2025-03-25 08:42:31 +00:00
ruthra kumar
ce454d5202 Merge pull request #46707 from frappe/mergify/bp/version-15-hotfix/pr-46617
refactor: removed redundant message display for each item row cost center update (backport #46617)
2025-03-25 12:28:43 +05:30
ljain112
f93feb18fb refactor: removed redundant message display for each item row cost center update
(cherry picked from commit 4376ca5f1d)
2025-03-25 06:47:13 +00:00
ruthra kumar
0793213981 Merge pull request #46705 from frappe/mergify/bp/version-15-hotfix/pr-46622
feat: repost accounting ledger for purchase receipt (backport #46622)
2025-03-25 12:13:56 +05:30
ljain112
4edfc6f125 feat: repost accounting ledger for purchase receipt
(cherry picked from commit b36e356469)
2025-03-25 06:19:43 +00:00
mergify[bot]
98df0614ab ci: apply label "skip-release-notes" based on PR title (backport #46694) (#46697)
ci: apply label "skip-release-notes" based on PR title (#46694)

Workflow copied from frappe/frappe

(cherry picked from commit eb350012b0)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-03-24 16:55:11 +01:00
Sagar Vora
59d0ff493f Merge pull request #46688 from frappe/mergify/bp/version-15-hotfix/pr-46669
fix: don't filter payment entries on Bank Account in Payment Clearance (backport #46669)
2025-03-24 18:17:59 +05:30
vishakhdesai
dc3b5e2f3a fix: don't filter payment entries on Bank Account in Payment Clearance
(cherry picked from commit fa2fd5bf88)
2025-03-24 12:22:09 +00:00
ruthra kumar
058a2f0c42 Merge pull request #46677 from frappe/mergify/bp/version-15-hotfix/pr-46577
fix: customer credit limit check based on `bypass_credit_limit_check` in Journal Entry (backport #46577)
2025-03-24 13:58:10 +05:30
ljain112
6c443bd85a fix: customer credit limit check based on bypass_credit_limit_check in Journal Entry
(cherry picked from commit 8a84faebed)
2025-03-24 08:02:17 +00:00
ruthra kumar
a228d1edc5 Merge pull request #46672 from frappe/mergify/bp/version-15-hotfix/pr-46574
fix: correct invoice order in payment reconcillaiton (backport #46574)
2025-03-24 13:13:35 +05:30
ruthra kumar
87628835bf Merge pull request #46673 from frappe/mergify/bp/version-15-hotfix/pr-46386
feat(accounting/regional): allow chart_of_account.get_chart to be whilelist (backport #46386)
2025-03-24 13:13:06 +05:30
Florian HENRY
e69c722534 feat(accounting): allow chart_of_account.get_chart to be whilelist
(cherry picked from commit 49dcd96909)
2025-03-24 07:03:37 +00:00
ruthra kumar
326c37a051 chore: resolve conflict 2025-03-24 12:29:52 +05:30
ljain112
2a70791bba fix: correct invoice order in payment reconcillaiton
(cherry picked from commit 5c34a5aaed)

# Conflicts:
#	erpnext/accounts/utils.py
2025-03-24 06:54:24 +00:00
ruthra kumar
e5fb77c65f Merge pull request #46670 from frappe/mergify/bp/version-15-hotfix/pr-46440
fix: add base_outstanding and base_paid_amount in payment schedule table (backport #46440)
2025-03-24 12:13:51 +05:30
ruthra kumar
4a7d401dc5 chore: resolve conflict 2025-03-24 11:53:14 +05:30
Sugesh393
c3221c4e93 fix: add patch to update base_outstanding and base_paid_amount
(cherry picked from commit 7e92e4967a)
2025-03-24 06:14:41 +00:00
Sugesh393
412e6be502 fix: add base_outstanding and base_paid_amount in payment schedule table
(cherry picked from commit 6c2f9a563e)

# Conflicts:
#	erpnext/accounts/doctype/payment_schedule/payment_schedule.json
2025-03-24 06:14:41 +00:00
mergify[bot]
4df5f18d85 fix: correct accumulated depreciation calculation for disposed assets (backport #46660) (#46661)
fix: correct accumulated depreciation calculation for disposed assets (#46660)

(cherry picked from commit eec2e7e833)

Co-authored-by: Khushi Rawat <142375893+khushi8112@users.noreply.github.com>
2025-03-23 18:53:49 +05:30
rohitwaghchaure
d58e527b6b Merge pull request #46647 from frappe/mergify/bp/version-15-hotfix/pr-46641
perf: timeout while renaming cost center (backport #46641)
2025-03-22 20:49:18 +05:30
Rohit Waghchaure
58eb1849d7 perf: timeout while renaming cost center
(cherry picked from commit 92be7cbbbf)
2025-03-21 12:38:51 +00:00
mergify[bot]
2ebea8866a fix: unwired order_by argument in get_transaction_list (backport #46636) (#46643)
* fix: unwired order_by argument

* lol on how it was updated from modified in both the places (version 15), but wasn't fixed

(cherry picked from commit 2c1077d332)

# Conflicts:
#	erpnext/controllers/website_list_for_contact.py

* fix: merge conflicts

* fix: sort by creation only

---------

Co-authored-by: Hussain Nagaria <hussainbhaitech@gmail.com>
Co-authored-by: Md Hussain Nagaria <34810212+NagariaHussain@users.noreply.github.com>
2025-03-21 16:27:05 +05:30
Smit Vora
4e65b7873d Merge pull request #46638 from frappe/mergify/bp/version-15-hotfix/pr-40556
fix(Payment Entry): get contact details from existing contact (backport #40556)
2025-03-21 15:22:44 +05:30
Smit Vora
7dc23d9733 chore: resolve conflicts #39748 2025-03-21 14:09:21 +05:30
David Arnold
f964178008 fix(Payment Entry): get contact details from existing contact (#40556)
(cherry picked from commit 462204fc65)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.py
2025-03-21 08:28:59 +00:00
Mihir Kandoi
2bfaf64fff fix: date added to wrong patch
(cherry picked from commit dc45c3b39c)

# Conflicts:
#	erpnext/patches.txt
2025-03-20 18:26:02 +00:00
ruthra kumar
6da00319e6 Merge pull request #46612 from frappe/mergify/bp/version-15-hotfix/pr-46173
feat(projects): add option to hide timesheets for project users (backport #46173)
2025-03-19 16:50:42 +05:30
Frappe PR Bot
35ac96f1ec chore(release): Bumped to Version 15.54.5
## [15.54.5](https://github.com/frappe/erpnext/compare/v15.54.4...v15.54.5) (2025-03-19)

### Bug Fixes

* add parenttype condition to payment schedule query in accounts receivable report (backport [#46370](https://github.com/frappe/erpnext/issues/46370)) ([#46499](https://github.com/frappe/erpnext/issues/46499)) ([32335da](32335da839))
* add validation to rename_subcontracting_fields patch ([bc408d9](bc408d979a))
* also consider CRM Deal as party type for ERPNext CRM Integration ([65a80cf](65a80cffe7))
* dashboard link for QC from PR ([426222d](426222d8e0))
* Debit and Credit not equal for Purchase Invoice ([46b6e62](46b6e621c2))
* debit in transaction currency ([8e19b46](8e19b46bd9))
* ensure qty conversion when creating production plan from SO ([8162fb3](8162fb3e5d))
* exclude current doc when checking for duplicate ([b638aed](b638aed758))
* fetch bom_no when updating items in sales order ([41d8b26](41d8b26dd2))
* fetch quality inspection parameter group ([cd0abba](cd0abbae51))
* get bom_no from sales order item and material request item ([e241810](e2418101ab))
* hide subcontracted qty field if PO is not subcontracted ([62feec5](62feec5cc3))
* incorrect production item and bom no in job card ([d071a6c](d071a6c900))
* not able to make PR against stand alone Debit Note ([d62960e](d62960e925))
* not able to select the item in the BOM ([59c653e](59c653ef3f))
* patch ([36ffc2e](36ffc2ee67))
* performance issue for item list view ([34d6e4b](34d6e4bdaa))
* remove duplicate ([e5b2801](e5b2801830))
* repost future sle and gle after capitalization ([#46576](https://github.com/frappe/erpnext/issues/46576)) ([2144f89](2144f89624))
* SABB validation for packed items ([2d6626e](2d6626e906))
* set correct currency for offset account gl entries ([e6dd3f3](e6dd3f3e64))
* set landed cost based on purchase invoice rate ([56bc26a](56bc26aecc))
* set stock adjustment account in difference account ([6202e30](6202e302b1))
* take function call outside loop ([ec1a3a1](ec1a3a1e6b))
* **Transaction Deletion Record:** sql syntax error while fetching lead address ([ea68cae](ea68caec7d))
* UOM conversion error when creating pick list from material transfer request ([2f3dcc2](2f3dcc2137))
* use base currency total ([3e2749d](3e2749d6d5))
* use party explicitly ([5dd5784](5dd5784716))
* use shipping_address_name for address validation in sales invoice ([#46473](https://github.com/frappe/erpnext/issues/46473)) ([38dabdf](38dabdf584))
* using `in` for lookup in list instead of directly assigning ([#46492](https://github.com/frappe/erpnext/issues/46492)) ([950656d](950656d6f7))
* valuation for moving average with batches ([5f1bb1f](5f1bb1f1ba))
* wrong field mapping ([be3e083](be3e083e7d))

### Performance Improvements

* faster count estimation (backport [#46550](https://github.com/frappe/erpnext/issues/46550)) ([#46551](https://github.com/frappe/erpnext/issues/46551)) ([01bab8f](01bab8f22b))
2025-03-19 11:18:07 +00:00
ruthra kumar
187ebaaecd Merge pull request #46582 from frappe/version-15-hotfix
chore: release v15
2025-03-19 16:46:43 +05:30
rohitwaghchaure
a2cb9c1791 Merge pull request #46615 from frappe/mergify/bp/version-15-hotfix/pr-46608
fix: fetch bom_no when updating items in sales order (backport #46608)
2025-03-19 16:31:38 +05:30
rohitwaghchaure
0d8842e387 Merge pull request #46614 from frappe/mergify/bp/version-15-hotfix/pr-46573
Fix set landed cost based on pi (backport #46573)
2025-03-19 16:31:09 +05:30
rohitwaghchaure
38213b31da chore: fix conflicts 2025-03-19 15:47:43 +05:30
Mihir Kandoi
e5b2801830 fix: remove duplicate
(cherry picked from commit 386df968c2)

# Conflicts:
#	erpnext/public/js/utils.js
2025-03-19 10:15:18 +00:00
Mihir Kandoi
41d8b26dd2 fix: fetch bom_no when updating items in sales order
(cherry picked from commit 508727a57a)

# Conflicts:
#	erpnext/public/js/utils.js
2025-03-19 10:15:18 +00:00
rohitwaghchaure
5b802ae527 chore: fix conflicts 2025-03-19 15:35:26 +05:30
rohitwaghchaure
1b8e8e92ae Merge pull request #46611 from frappe/mergify/bp/version-15-hotfix/pr-46595
fix: not able to make PR against stand alone Debit Note (backport #46595)
2025-03-19 15:28:57 +05:30
Mihir Kandoi
ec1a3a1e6b fix: take function call outside loop
(cherry picked from commit b3c400f998)
2025-03-19 09:52:28 +00:00
Mihir Kandoi
36ffc2ee67 fix: patch
(cherry picked from commit 7e669c0728)
2025-03-19 09:52:28 +00:00
Mihir Kandoi
56bc26aecc fix: set landed cost based on purchase invoice rate
(cherry picked from commit 75ab5f2bd0)

# Conflicts:
#	erpnext/patches.txt
2025-03-19 09:52:27 +00:00
Marc Ramser
3834d6fbce feat(projects): add option to hide timesheets for project users (#46173)
* feat: add option to hide timesheets for project users

* Added a new "Hide timesheets" checkbox field to Project User doctype that allows to control timesheet visibility for specific users. When enabled, the timesheets section will not be displayed on the project page for that user.

* Update projects.html

(cherry picked from commit f4aba561ce)
2025-03-19 08:05:42 +00:00
Rohit Waghchaure
d62960e925 fix: not able to make PR against stand alone Debit Note
(cherry picked from commit 6a52c30591)
2025-03-19 08:05:33 +00:00
ruthra kumar
c6de50b2a5 Merge pull request #46606 from frappe/mergify/bp/version-15-hotfix/pr-46596
fix: debit in transaction currency (backport #46596)
2025-03-19 12:11:09 +05:30
Rohit Waghchaure
8e19b46bd9 fix: debit in transaction currency
(cherry picked from commit e4acf20a62)
2025-03-19 06:26:26 +00:00
rohitwaghchaure
f6a4855e7f Merge pull request #46594 from frappe/mergify/bp/version-15-hotfix/pr-46593
test: test case for FIFO batch valuation (backport #46593)
2025-03-18 21:23:03 +05:30
Rohit Waghchaure
95718acc9a test: test case for FIFO batch valuation
(cherry picked from commit ad9ac1f058)
2025-03-18 13:50:36 +00:00
rohitwaghchaure
2528acd803 Merge pull request #46592 from frappe/mergify/bp/version-15-hotfix/pr-46588
fix: SABB validation for packed items (backport #46588)
2025-03-18 18:38:50 +05:30
Rohit Waghchaure
2d6626e906 fix: SABB validation for packed items
(cherry picked from commit 3756bf231b)
2025-03-18 12:03:18 +00:00
rohitwaghchaure
a07eb556cf Merge pull request #46584 from frappe/mergify/bp/version-15-hotfix/pr-46575
fix: fetch quality inspection parameter group (backport #46575)
2025-03-18 17:28:33 +05:30
rohitwaghchaure
48edc86845 Merge pull request #46587 from frappe/mergify/bp/version-15-hotfix/pr-46576
fix: repost future sle and gle after capitalization (backport #46576)
2025-03-18 17:27:56 +05:30
rohitwaghchaure
7f5ce4f29d Merge pull request #46585 from frappe/mergify/bp/version-15-hotfix/pr-46554
fix: add validation to rename_subcontracting_fields patch (backport #46554)
2025-03-18 17:27:20 +05:30
rohitwaghchaure
cd7056842d Merge pull request #46589 from frappe/mergify/bp/version-15-hotfix/pr-46579
fix: valuation for moving average with batches (backport #46579)
2025-03-18 17:26:41 +05:30
Rohit Waghchaure
5f1bb1f1ba fix: valuation for moving average with batches
(cherry picked from commit cdfbc73f4c)
2025-03-18 11:05:06 +00:00
rohitwaghchaure
79dacfdef8 Merge pull request #46560 from frappe/mergify/bp/version-15-hotfix/pr-46555
fix: performance issue for item list view (backport #46555)
2025-03-18 16:34:00 +05:30
Khushi Rawat
2144f89624 fix: repost future sle and gle after capitalization (#46576)
(cherry picked from commit 29d77aa19f)
2025-03-18 10:31:47 +00:00
Mihir Kandoi
bc408d979a fix: add validation to rename_subcontracting_fields patch
(cherry picked from commit 6c3117dc0d)
2025-03-18 10:30:41 +00:00
rohitwaghchaure
496f43e7e9 Merge pull request #46556 from frappe/st33974
fix: incorrect production item and bom no in job card
2025-03-18 15:58:26 +05:30
Mihir Kandoi
cd0abbae51 fix: fetch quality inspection parameter group
(cherry picked from commit 0a482c7ea8)
2025-03-18 10:27:30 +00:00
Smit Vora
004ecc53e5 Merge pull request #46578 from frappe/mergify/bp/version-15-hotfix/pr-46515
fix: ensure qty conversion when creating production plan from SO (backport #46515)
2025-03-18 15:00:34 +05:30
Smit Vora
8162fb3e5d fix: ensure qty conversion when creating production plan from SO
(cherry picked from commit 75882cc81c)
2025-03-18 08:56:21 +00:00
rohitwaghchaure
e8047ab2ca chore: fix conflicts 2025-03-18 12:01:11 +05:30
rohitwaghchaure
8dc371dac2 Merge pull request #46558 from frappe/mergify/bp/version-15-hotfix/pr-46553
fix: not able to select the item in the BOM (backport #46553)
2025-03-18 11:59:56 +05:30
rohitwaghchaure
0351faa8c0 Merge pull request #46559 from frappe/mergify/bp/version-15-hotfix/pr-46552
fix: Debit and Credit not equal for Purchase Invoice (backport #46552)
2025-03-18 11:59:38 +05:30
ruthra kumar
7e46845fea Merge pull request #46572 from frappe/mergify/bp/version-15-hotfix/pr-46566
fix: set correct currency for offset account gl entries (backport #46566)
2025-03-18 11:32:05 +05:30
ruthra kumar
e84333e5f2 Merge pull request #46571 from frappe/mergify/bp/version-15-hotfix/pr-46508
fix: use base currency total for UAE VAT 201 report (backport #46508)
2025-03-18 11:24:29 +05:30
ruthra kumar
e6dd3f3e64 fix: set correct currency for offset account gl entries
(cherry picked from commit c32e11e69d)
2025-03-18 05:45:13 +00:00
ruthra kumar
ec43ca97cb test: report ouput on foreign currency PI
(cherry picked from commit e80129627a)
2025-03-18 05:30:10 +00:00
ruthra kumar
3e2749d6d5 fix: use base currency total
(cherry picked from commit 46f4babcd0)
2025-03-18 05:30:09 +00:00
mergify[bot]
01bab8f22b perf: faster count estimation (backport #46550) (#46551)
perf: faster count estimation (#46550)

These count queries themselves take quite a long time. `estimate_count`
uses info_schema stats to guess the time.

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
(cherry picked from commit e47a87839b)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2025-03-17 21:23:30 +05:30
Ejaaz Khan
972c96b682 Merge pull request #46565 from frappe/mergify/bp/version-15-hotfix/pr-46564
refactor: remove default print format from sales invoice (backport #46564)
2025-03-17 20:52:46 +05:30
Ejaaz Khan
7cfd7e6539 refactor: remove default print format from sales invoice
(cherry picked from commit f10d1f2b1f)
2025-03-17 14:38:43 +00:00
ruthra kumar
bcd9fd090d Merge pull request #46562 from frappe/mergify/bp/version-15-hotfix/pr-46557
fix(Transaction Deletion Record): sql syntax error while deleting lead address (backport #46557)
2025-03-17 17:00:37 +05:30
venkat102
ea68caec7d fix(Transaction Deletion Record): sql syntax error while fetching lead address
(cherry picked from commit af0d6eeae8)
2025-03-17 11:09:38 +00:00
Rohit Waghchaure
34d6e4bdaa fix: performance issue for item list view
(cherry picked from commit d758fde881)

# Conflicts:
#	erpnext/stock/doctype/item_default/item_default.json
2025-03-17 11:08:38 +00:00
rohitwaghchaure
c7b8514c24 Merge pull request #46549 from frappe/mergify/bp/version-15-hotfix/pr-46504
fix: dashboard link for QC from PR (backport #46504)
2025-03-17 16:37:21 +05:30
Rohit Waghchaure
46b6e621c2 fix: Debit and Credit not equal for Purchase Invoice
(cherry picked from commit ecb31b7c9f)
2025-03-17 11:07:17 +00:00
Rohit Waghchaure
59c653ef3f fix: not able to select the item in the BOM
(cherry picked from commit 96d0cd23f1)
2025-03-17 11:07:16 +00:00
Mihir Kandoi
d071a6c900 fix: incorrect production item and bom no in job card 2025-03-17 16:06:54 +05:30
ruthra kumar
61e126901e Merge pull request #46523 from frappe/revert-46475-mergify/bp/version-15-hotfix/pr-46417
Revert "fix: error when creating delivery note from pick list (backport #46417)"
2025-03-17 15:15:10 +05:30
Rohit Waghchaure
426222d8e0 fix: dashboard link for QC from PR
(cherry picked from commit 551f89f14b)
2025-03-17 04:36:59 +00:00
Sagar Vora
ad24867699 Merge pull request #46534 from frappe/mergify/bp/version-15-hotfix/pr-46533
fix: exclude current doc when checking for duplicate (backport #46533)
2025-03-15 00:37:55 +05:30
Sagar Vora
b638aed758 fix: exclude current doc when checking for duplicate
(cherry picked from commit d8ef5e4d58)
2025-03-14 18:37:47 +00:00
Shariq Ansari
1a9873bc55 Merge pull request #46530 from frappe/mergify/bp/version-15-hotfix/pr-46529
fix: also consider CRM Deal as party type for ERPNext CRM Integration (backport #46529)
2025-03-14 16:07:27 +05:30
Shariq Ansari
65a80cffe7 fix: also consider CRM Deal as party type for ERPNext CRM Integration
(cherry picked from commit 04edbf7efe)
2025-03-14 10:34:11 +00:00
Mihir Kandoi
18e29de0c8 Merge pull request #46527 from frappe/mergify/bp/version-15-hotfix/pr-46513 2025-03-14 13:27:30 +05:30
Mihir Kandoi
e2418101ab fix: get bom_no from sales order item and material request item
(cherry picked from commit ac354505ef)
2025-03-14 07:36:47 +00:00
Mihir Kandoi
62c9181651 Merge pull request #46525 from frappe/mergify/bp/version-15-hotfix/pr-46514
fix: UOM conversion error when creating pick list from material trans… (backport #46514)
2025-03-14 13:04:43 +05:30
Mihir Kandoi
d0008ac6df Merge pull request #46524 from frappe/mergify/bp/version-15-hotfix/pr-46512
fix: hide subcontracted qty field if PO is not subcontracted (backport #46512)
2025-03-14 13:04:10 +05:30
Mihir Kandoi
be3e083e7d fix: wrong field mapping
(cherry picked from commit 8411e2e01f)
2025-03-14 07:13:46 +00:00
Mihir Kandoi
2f3dcc2137 fix: UOM conversion error when creating pick list from material transfer request
(cherry picked from commit 840ea070a9)
2025-03-14 07:13:46 +00:00
Mihir Kandoi
62feec5cc3 fix: hide subcontracted qty field if PO is not subcontracted
(cherry picked from commit 6e8521d761)
2025-03-14 07:12:44 +00:00
Nabin Hait
0852533751 Revert "fix: error when creating delivery note from pick list (backport #46417)" 2025-03-14 12:33:37 +05:30
ruthra kumar
99f59c0410 Merge pull request #46521 from frappe/mergify/bp/version-15-hotfix/pr-46497
fix: use `party` explicitly instead of party_field (backport #46497)
2025-03-14 11:08:05 +05:30
Sanket322
5dd5784716 fix: use party explicitly
(cherry picked from commit 5057e3fe30)
2025-03-14 04:52:33 +00:00
ruthra kumar
5ad3e5b5c8 Merge pull request #46520 from frappe/mergify/bp/version-15-hotfix/pr-46488
refactor: replace get_list with get_all for dynamic link child access (backport #46488)
2025-03-14 10:11:05 +05:30
Sugesh393
7fb26f802c refactor: replace get_list with get_all for dynamic link child access
(cherry picked from commit 8f7f0b81f6)
2025-03-14 04:22:25 +00:00
ruthra kumar
27d6659962 Merge pull request #46480 from frappe/mergify/bp/version-15-hotfix/pr-46473
fix: use shipping_address_name for address validation in sales invoice (backport #46473)
2025-03-14 09:50:37 +05:30
ruthra kumar
3737b4a300 refactor(test): unset billing address 2025-03-14 09:29:43 +05:30
ruthra kumar
1065e483b2 Merge pull request #46510 from aerele/fix/item-stock-difference-account
fix: set stock adjustment account in difference account (backport #45606)
2025-03-14 09:23:46 +05:30
Bhavan23
6202e302b1 fix: set stock adjustment account in difference account 2025-03-13 16:45:18 +05:30
mergify[bot]
2a788a4fb1 refactor: print receipt on order complete on pos (backport #46501) (#46507)
* refactor: print receipt on order complete on pos (#46501)

(cherry picked from commit 0552209310)

# Conflicts:
#	erpnext/selling/page/point_of_sale/pos_past_order_summary.js

* chore: resolve conflict

---------

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-03-13 14:30:38 +05:30
mergify[bot]
32335da839 fix: add parenttype condition to payment schedule query in accounts receivable report (backport #46370) (#46499)
Fix: add parenttype condition to payment schedule query in accounts receivable report (#46370)

fix: add parenttype condition to payment schedule query in accounts receivable report
(cherry picked from commit f311a0fc1c)

Co-authored-by: Shanuka Hewage <89955436+Shanuka-98@users.noreply.github.com>
2025-03-13 12:03:46 +05:30
ruthra kumar
c47cc0572b Merge pull request #46493 from frappe/mergify/bp/version-15-hotfix/pr-46492
fix: using `in` for lookup in list instead of directly assigning (backport #46492)
2025-03-13 08:41:22 +05:30
ruthra kumar
1ec971f805 Merge pull request #46496 from frappe/mergify/bp/version-15/pr-46423
Revert "fix: Show Credit Note amount in credit note column" (backport #46423)
2025-03-13 08:20:53 +05:30
ruthra kumar
a6e92d7d16 Merge pull request #46495 from frappe/mergify/bp/version-15-hotfix/pr-46423
Revert "fix: Show Credit Note amount in credit note column" (backport #46423)
2025-03-13 08:12:37 +05:30
ruthra kumar
4d7071299e Revert "fix: Show Credit Note amount in credit note column"
(cherry picked from commit 5a9767ca67)
2025-03-13 02:35:11 +00:00
ruthra kumar
0223651b5b Revert "fix: Show Credit Note amount in credit note column"
(cherry picked from commit 5a9767ca67)
2025-03-13 02:28:08 +00:00
Sanket Shah
950656d6f7 fix: using in for lookup in list instead of directly assigning (#46492)
fix: using in for lookup in list instead of assigning

Co-authored-by: Sanket322 <shahsanket322003.com>
(cherry picked from commit 38955af802)
2025-03-12 17:08:05 +00:00
Frappe PR Bot
08f47b626c chore(release): Bumped to Version 15.54.4
## [15.54.4](https://github.com/frappe/erpnext/compare/v15.54.3...v15.54.4) (2025-03-12)

### Bug Fixes

* `base_net_rate` Required to Check Valid Range (backport [#46332](https://github.com/frappe/erpnext/issues/46332)) ([#46382](https://github.com/frappe/erpnext/issues/46382)) ([877d5bd](877d5bd3aa))
* **account:** update account number from parent company ([428aedc](428aedc29c))
* Allow rename prospect doctype ([#46352](https://github.com/frappe/erpnext/issues/46352)) ([de46165](de46165768))
* auto email report creation ([#46343](https://github.com/frappe/erpnext/issues/46343)) ([5cc251a](5cc251a172))
* backport translations from develop ([#46428](https://github.com/frappe/erpnext/issues/46428)) ([9c70376](9c703765a1))
* calculate due date based on payment term (backport [#46416](https://github.com/frappe/erpnext/issues/46416)) ([#46479](https://github.com/frappe/erpnext/issues/46479)) ([7f14744](7f147446df))
* change fieldname for cash_flow to export (backport [#46353](https://github.com/frappe/erpnext/issues/46353)) ([#46366](https://github.com/frappe/erpnext/issues/46366)) ([23c4252](23c4252b9b))
* check if set_landed_cost_based_on_purchase_invoice_rate is enabled before running patch ([7047fe2](7047fe2681))
* clear cashe on employee hierarchy change to reflect updated permissions ([4dfdb2b](4dfdb2b0a1))
* consider account freeze date in recalculate_amount_difference_field patch ([8b67527](8b67527900))
* consider stock freeze date in recalculate_amount_difference_field patch ([8264d42](8264d42cd9))
* credit note creation during pos invoice consolidation (backport [#46277](https://github.com/frappe/erpnext/issues/46277)) ([#46469](https://github.com/frappe/erpnext/issues/46469)) ([a4b8b4c](a4b8b4c771))
* do not recalculate qty for batch items during reposting ([bac36f3](bac36f342d))
* doctype name ([1dcbdf3](1dcbdf3257))
* enable no copy for serial no field ([3f9df2f](3f9df2fb2d))
* error in production analytics report ([db6ae61](db6ae61935))
* error when creating delivery note from pick list ([#46417](https://github.com/frappe/erpnext/issues/46417)) ([0b92101](0b921016ff))
* filter batches that going to be zero ([ac97489](ac97489a32))
* incorrect category in list ([002685f](002685fc89))
* make 'company_tax_id' and 'company_fiscal_code' as mandatory ([229f4d3](229f4d3d92))
* not able to save work order with alternative item ([9554a49](9554a49bbd))
* **payment entry:** fetch default bank account based on company (backport [#46379](https://github.com/frappe/erpnext/issues/46379)) ([#46471](https://github.com/frappe/erpnext/issues/46471)) ([1371199](13711993fe))
* pricing rule not ignored in Sales Order ([#46248](https://github.com/frappe/erpnext/issues/46248)) ([8def42f](8def42f751))
* rare precision issue preventing submission of subcontracting order ([6419d02](6419d020a1))
* recalculate_amount_difference_field patch ([f247f02](f247f02e49))
* remove no copy for serial no field of purchase receipt item ([baa564f](baa564fc94))
* rename sla fields patch ([73f11cf](73f11cf19e))
* rename sla fields patch ([#46465](https://github.com/frappe/erpnext/issues/46465)) ([5edbd88](5edbd8851a))
* rename_sla_fields patch ([7bc7557](7bc7557018))
* run bank reconciliation as a background job to prevent request timeout ([739cd18](739cd18604))
* set correct account currency for deferred expence account in PI ([f96848a](f96848a3b9))
* show remaining qty on 'Complete Job' button instead of full qty ([79e6550](79e6550321))
* sla fields patch ([0d044bc](0d044bc5bb))
* stock balance in and out value ([c2001e9](c2001e9c67))
* **test:** incorrect transaction exchange rate in test case ([b76c968](b76c96820e))
* typo in sales_invoice_print ([b610621](b6106212c1))
* uom reverts to default upon selecting do not explode ([#45693](https://github.com/frappe/erpnext/issues/45693)) ([6b1d209](6b1d20970e))
* validate accounting dimension company in Journal Entry & Stock Entry (backport [#46204](https://github.com/frappe/erpnext/issues/46204)) ([#46369](https://github.com/frappe/erpnext/issues/46369)) ([c816f9b](c816f9bd0a))
* validate last_gl_update exists before comparing (backport [#46464](https://github.com/frappe/erpnext/issues/46464)) ([#46468](https://github.com/frappe/erpnext/issues/46468)) ([3cef94e](3cef94e2ed))
* validations and account type filter for `Tax Withholding Category` ([#46207](https://github.com/frappe/erpnext/issues/46207)) ([cc30a01](cc30a01898))
2025-03-12 14:37:29 +00:00
ruthra kumar
0283f7526c Merge pull request #46444 from frappe/version-15-hotfix
chore: release v15
2025-03-12 20:05:56 +05:30
ruthra kumar
3ad451dd6e Merge branch 'version-15' into version-15-hotfix 2025-03-12 19:48:08 +05:30
rohitwaghchaure
9e409bde2e Merge pull request #46486 from frappe/st33357
fix: enable no copy for serial no field
2025-03-12 19:39:32 +05:30
ruthra kumar
8459166323 Merge pull request #46482 from frappe/mergify/bp/version-15-hotfix/pr-46207
fix: validations and account type filter for `Tax Withholding Category` (backport #46207)
2025-03-12 17:46:04 +05:30
ruthra kumar
e1328de712 Merge pull request #46487 from frappe/mergify/bp/version-15-hotfix/pr-46251
fix(bank-reconciliation): run bank reconciliation as a background job (backport #46251)
2025-03-12 17:45:45 +05:30
mergify[bot]
d3a2350b3e fix(invoice):validate return invoice qty (backport #46451) (#46481)
fix(invoice):validate return invoice qty (#46451)

* fix(invoice): validate return quantity when update stock is unchecked

* test: add unit test for validating fully returned invoice quantity

(cherry picked from commit ba96c86576)

Co-authored-by: Bhavansathru <122002510+Bhavan23@users.noreply.github.com>
2025-03-12 17:23:26 +05:30
Bhavan23
739cd18604 fix: run bank reconciliation as a background job to prevent request timeout
(cherry picked from commit a29c6a5aea)
2025-03-12 11:52:26 +00:00
ruthra kumar
e61cc9b12e Merge pull request #46483 from frappe/mergify/bp/version-15-hotfix/pr-46248
fix: pricing rule not ignored in Sales Order (backport #46248)
2025-03-12 17:13:13 +05:30
Mihir Kandoi
baa564fc94 fix: remove no copy for serial no field of purchase receipt item 2025-03-12 17:11:14 +05:30
rohitwaghchaure
a55ec56fbf Merge pull request #46484 from frappe/45440
fix: show remaining qty on 'Complete Job' button instead of full qty
2025-03-12 16:44:57 +05:30
Mihir Kandoi
3f9df2fb2d fix: enable no copy for serial no field 2025-03-12 16:35:50 +05:30
mergify[bot]
7f147446df fix: calculate due date based on payment term (backport #46416) (#46479)
fix: calculate due date based on payment term (#46416)

(cherry picked from commit 9e808c832f)

Co-authored-by: Sudharsanan Ashok <135326972+Sudharsanan11@users.noreply.github.com>
2025-03-12 16:30:14 +05:30
Sugesh G
8def42f751 fix: pricing rule not ignored in Sales Order (#46248)
* fix: pricing rule not ignored in Sales Order

* test: update parameter do_not_submit to do_not_save

(cherry picked from commit f8c659d8d5)
2025-03-12 10:58:47 +00:00
Mihir Kandoi
79e6550321 fix: show remaining qty on 'Complete Job' button instead of full qty 2025-03-12 16:27:33 +05:30
Priyansh Shah
cc30a01898 fix: validations and account type filter for Tax Withholding Category (#46207)
fix: validations and account type filter for tax withholding category
(cherry picked from commit d371236684)
2025-03-12 10:52:32 +00:00
Sugesh G
38dabdf584 fix: use shipping_address_name for address validation in sales invoice (#46473)
* fix: validate address and contact related to party

* fix: solve unboundlocal error

* refactor: improve variable scope

* refactor: translatable strings

* fix: use shipping_address_name for address validation in sales invoice

* test: add new unit test for address and contact validation

* chore: to avoid keyerror

---------

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
(cherry picked from commit 0bdb81db53)
2025-03-12 10:44:37 +00:00
Ninad Parikh
877d5bd3aa fix: base_net_rate Required to Check Valid Range (backport #46332) (#46382)
fix: `base_net_rate` required to check valid range
2025-03-12 16:12:44 +05:30
Mihir Kandoi
0b53bd3e9a Merge pull request #46475 from frappe/mergify/bp/version-15-hotfix/pr-46417
fix: error when creating delivery note from pick list (backport #46417)
2025-03-12 16:09:50 +05:30
Mihir Kandoi
3606fe8fba Merge pull request #46467 from frappe/mergify/bp/version-15-hotfix/pr-46465
fix: rename sla fields patch (backport #46465)
2025-03-12 16:09:37 +05:30
Mihir Kandoi
0b921016ff fix: error when creating delivery note from pick list (#46417)
(cherry picked from commit 67e9389a02)
2025-03-12 10:00:53 +00:00
rohitwaghchaure
4d49608a68 Merge pull request #46474 from frappe/mergify/bp/version-15-hotfix/pr-46470
fix: do not recalculate qty for batch items during reposting (backport #46470)
2025-03-12 12:39:06 +05:30
Rohit Waghchaure
bac36f342d fix: do not recalculate qty for batch items during reposting
(cherry picked from commit 0753c018d2)
2025-03-12 06:48:00 +00:00
mergify[bot]
a4b8b4c771 fix: credit note creation during pos invoice consolidation (backport #46277) (#46469)
* fix: credit note creation during pos invoice consolidation (#46277)

* fix: credit note creation during pos invoice consolidation

* fix: added check to skip merging empty list of return pos invoices

* fix: sql query

* fix: using return invoice name instead of return invoice object

* fix: added pos invoice field in sales invoice item

(cherry picked from commit 8ba4ac3b86)

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

* chore: resolve conflict

---------

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-03-12 11:41:41 +05:30
mergify[bot]
3cef94e2ed fix: validate last_gl_update exists before comparing (backport #46464) (#46468)
fix: validate last_gl_update exists before comparing (#46464)

(cherry picked from commit 0a5ca0c35f)

Co-authored-by: Dany Robert <rtdany10@gmail.com>
2025-03-12 11:05:24 +05:30
mergify[bot]
13711993fe fix(payment entry): fetch default bank account based on company (backport #46379) (#46471)
fix(payment entry): fetch default bank account based on company (#46379)

(cherry picked from commit b72f6f5a3d)

Co-authored-by: Venkatesh <47534423+venkat102@users.noreply.github.com>
2025-03-12 11:05:08 +05:30
Nabin Hait
24678b0e24 chore: conflicts 2025-03-12 10:38:26 +05:30
Mihir Kandoi
5edbd8851a fix: rename sla fields patch (#46465)
* fix: rename sla fields patch

* fix: rerun patch

(cherry picked from commit 8bce42e633)

# Conflicts:
#	erpnext/patches.txt
2025-03-12 05:04:52 +00:00
rohitwaghchaure
6582e4c5f9 Merge pull request #46462 from frappe/mergify/bp/version-15-hotfix/pr-46455
fix: error in production analytics report (backport #46455)
2025-03-12 09:50:35 +05:30
rohitwaghchaure
fd1c1ba35e Merge pull request #46461 from frappe/mergify/bp/version-15-hotfix/pr-46460
fix: rename sla fields patch (backport #46460)
2025-03-12 09:49:46 +05:30
Mihir Kandoi
db6ae61935 fix: error in production analytics report
(cherry picked from commit 03e66468f6)
2025-03-11 19:00:35 +00:00
Mihir Kandoi
73f11cf19e fix: rename sla fields patch
(cherry picked from commit b6c18849c5)
2025-03-11 18:57:17 +00:00
rohitwaghchaure
8f7dc827ea Merge pull request #46459 from frappe/mergify/bp/version-15-hotfix/pr-46452
fix: sla fields patch (backport #46452)
2025-03-12 00:01:35 +05:30
Mihir Kandoi
0d044bc5bb fix: sla fields patch
(cherry picked from commit d653899372)
2025-03-11 18:08:24 +00:00
rohitwaghchaure
14ee2d239a Merge pull request #46441 from frappe/mergify/bp/version-15-hotfix/pr-46436
fix: filter batches that going to be zero (backport #46436)
2025-03-11 23:38:21 +05:30
Raffael Meyer
fc8eeaf4f6 Merge pull request #46457 from frappe/mergify/bp/version-15-hotfix/pr-46453
ci: ignore PRs labeled with "skip-release-notes" when generating release notes (backport #46453)
2025-03-11 17:51:58 +01:00
barredterra
aad8c88532 ci: ignore PRs labeled with "skip-release-notes" when generating release notes
(cherry picked from commit 57007bf937)
2025-03-11 16:35:20 +00:00
ruthra kumar
e783536ba0 Merge pull request #46450 from frappe/mergify/bp/version-15-hotfix/pr-46398
chore: rename print and stationery account (backport #46398)
2025-03-11 18:12:19 +05:30
chethank1407
ee3feba386 chore: rename print and stationery account
(cherry picked from commit 615997b774)
2025-03-11 12:03:42 +00:00
ruthra kumar
cb9be11448 Merge pull request #46447 from frappe/mergify/bp/version-15-hotfix/pr-46344
fix: make 'company_tax_id' and 'company_fiscal_code' as mandatory (backport #46344)
2025-03-11 17:31:19 +05:30
ruthra kumar
31dc6021e2 chore: translatable strings
(cherry picked from commit 121798ba85)
2025-03-11 11:42:30 +00:00
Bhavan23
229f4d3d92 fix: make 'company_tax_id' and 'company_fiscal_code' as mandatory
(cherry picked from commit abd044eb0d)
2025-03-11 11:42:19 +00:00
ruthra kumar
c25862a85f Merge pull request #46446 from frappe/mergify/bp/version-15-hotfix/pr-45818
fix: set correct account currency for deferred expense account (backport #45818)
2025-03-11 16:50:55 +05:30
vishakhdesai
f96848a3b9 fix: set correct account currency for deferred expence account in PI
(cherry picked from commit 398083853c)
2025-03-11 11:06:14 +00:00
Rohit Waghchaure
ac97489a32 fix: filter batches that going to be zero
(cherry picked from commit aba512c1c6)
2025-03-11 08:02:49 +00:00
ruthra kumar
02ff406b7c Merge pull request #46439 from frappe/mergify/bp/version-15-hotfix/pr-46372
fix(account): update account number from parent company (backport #46372)
2025-03-11 11:19:33 +05:30
venkat102
428aedc29c fix(account): update account number from parent company
(cherry picked from commit 4a4894bc01)
2025-03-11 05:32:15 +00:00
ruthra kumar
6af24dca6e Merge pull request #46432 from frappe/mergify/bp/version-15-hotfix/pr-46427
fix: not able to save work order with alternative item (backport #46414) (backport #46427)
2025-03-11 11:02:04 +05:30
ruthra kumar
8980eb9b9d Merge pull request #46437 from frappe/mergify/bp/version-15-hotfix/pr-46426
fix: clear cashe on employee hierarchy change (backport #46426)
2025-03-11 10:58:50 +05:30
Asmita Hase
4dfdb2b0a1 fix: clear cashe on employee hierarchy change to reflect updated permissions
(cherry picked from commit 6789578b27)
2025-03-11 05:13:04 +00:00
Rohit Waghchaure
9554a49bbd fix: not able to save work order with alternative item
(cherry picked from commit 6ca1f9bc73)
(cherry picked from commit ac7fc608aa)
2025-03-10 17:44:57 +00:00
rohitwaghchaure
5b69445294 Merge pull request #46420 from frappe/mergify/bp/version-15-hotfix/pr-46418
fix: stock balance in and out value (backport #46418)
2025-03-10 23:13:37 +05:30
Raffael Meyer
9c703765a1 fix: backport translations from develop (#46428) 2025-03-10 14:32:19 +01:00
rohitwaghchaure
043539fcdb chore: fix conflicts 2025-03-10 17:37:29 +05:30
ruthra kumar
54a76d8932 Merge pull request #46425 from frappe/mergify/bp/version-15-hotfix/pr-46407
fix: typo in sales_invoice_print (backport #46407)
2025-03-10 16:55:28 +05:30
mahsem
b6106212c1 fix: typo in sales_invoice_print
(cherry picked from commit f7bcae83e4)
2025-03-10 11:18:23 +00:00
Rohit Waghchaure
c2001e9c67 fix: stock balance in and out value
(cherry picked from commit e917bd5334)

# Conflicts:
#	erpnext/stock/report/stock_balance/stock_balance.py
2025-03-10 10:06:09 +00:00
Frappe PR Bot
47429095a2 chore(release): Bumped to Version 15.54.3
## [15.54.3](https://github.com/frappe/erpnext/compare/v15.54.2...v15.54.3) (2025-03-09)

### Bug Fixes

* consider account freeze date in recalculate_amount_difference_field patch ([34f03d6](34f03d608a))
* consider stock freeze date in recalculate_amount_difference_field patch ([a18721d](a18721d21c))
2025-03-09 11:04:11 +00:00
rohitwaghchaure
2f3f87fe7e Merge pull request #46403 from frappe/mergify/bp/version-15/pr-46402
fix: consider account freeze date in recalculate_amount_difference_fi… (backport #46395) (backport #46402)
2025-03-09 16:32:52 +05:30
Mihir Kandoi
2b4dfca3ff chore: resolve conflicts
(cherry picked from commit 985fb5dfdc)
2025-03-08 17:16:43 +00:00
Mihir Kandoi
a18721d21c fix: consider stock freeze date in recalculate_amount_difference_field patch
(cherry picked from commit cd72532789)
(cherry picked from commit 8264d42cd9)
2025-03-08 17:16:43 +00:00
Mihir Kandoi
34f03d608a fix: consider account freeze date in recalculate_amount_difference_field patch
(cherry picked from commit 696f931678)

# Conflicts:
#	erpnext/patches/v15_0/recalculate_amount_difference_field.py
(cherry picked from commit 8b67527900)
2025-03-08 17:16:43 +00:00
rohitwaghchaure
b786cd30e6 Merge pull request #46402 from frappe/mergify/bp/version-15-hotfix/pr-46395
fix: consider account freeze date in recalculate_amount_difference_fi… (backport #46395)
2025-03-08 22:45:06 +05:30
Mihir Kandoi
985fb5dfdc chore: resolve conflicts 2025-03-08 22:22:12 +05:30
Mihir Kandoi
8264d42cd9 fix: consider stock freeze date in recalculate_amount_difference_field patch
(cherry picked from commit cd72532789)
2025-03-08 16:28:33 +00:00
Mihir Kandoi
8b67527900 fix: consider account freeze date in recalculate_amount_difference_field patch
(cherry picked from commit 696f931678)

# Conflicts:
#	erpnext/patches/v15_0/recalculate_amount_difference_field.py
2025-03-08 16:28:32 +00:00
Frappe PR Bot
2ce8299bc8 chore(release): Bumped to Version 15.54.2
## [15.54.2](https://github.com/frappe/erpnext/compare/v15.54.1...v15.54.2) (2025-03-08)

### Bug Fixes

* incorrect category in list ([3bdd4ce](3bdd4ce116))
* **test:** incorrect transaction exchange rate in test case ([3015628](3015628519))
2025-03-08 07:42:44 +00:00
ruthra kumar
84b03485d6 Merge pull request #46397 from frappe/mergify/bp/version-15/pr-46064
fix: Debit and Credit mismatch on transaction currency debit and credit values (backport #46064)
2025-03-08 13:11:25 +05:30
ruthra kumar
d0b14f1907 chore: resolve conflict 2025-03-08 12:28:49 +05:30
ruthra kumar
cd1803a74d refactor: internal transfer gl
(cherry picked from commit f1d8feec15)
2025-03-08 06:56:37 +00:00
ruthra kumar
a1cf27ec17 test: assert total debit and credit for trx currency
(cherry picked from commit 55d0636123)
2025-03-08 06:56:37 +00:00
ruthra kumar
61880a311a refactor: handle rounding diff for trx currency dr and cr
(cherry picked from commit 455a55b2ce)
2025-03-08 06:56:37 +00:00
ruthra kumar
2d290b153d refactor: trx currency dr and cr for tax rows and item rows
(cherry picked from commit 4cd3f3531c)
2025-03-08 06:56:36 +00:00
ruthra kumar
cacb720556 refactor: convert tax amount using exchange rate
(cherry picked from commit 7528ef147a)
2025-03-08 06:56:36 +00:00
ruthra kumar
3bdd4ce116 fix: incorrect category in list
(cherry picked from commit 6545467aec)
2025-03-08 06:56:36 +00:00
ruthra kumar
c479998cd6 chore: typo
(cherry picked from commit bc792c61e9)
2025-03-08 06:56:36 +00:00
ruthra kumar
501e388186 refactor: isolate to specific doctypes
(cherry picked from commit b348aa3b37)
2025-03-08 06:56:35 +00:00
ruthra kumar
af45ec0d6d refactor(test): save first to let the tax table populate
(cherry picked from commit 23d465805b)
2025-03-08 06:56:35 +00:00
ruthra kumar
3015628519 fix(test): incorrect transaction exchange rate in test case
(cherry picked from commit a31770d122)
2025-03-08 06:56:35 +00:00
ruthra kumar
8b6eea6349 refactor: set transaction currency and rate before gl map
(cherry picked from commit ceca5b4c72)
2025-03-08 06:56:34 +00:00
ruthra kumar
81c29e8f8c refactor: handle payment entry
(cherry picked from commit 5c86e3ce85)
2025-03-08 06:56:34 +00:00
ruthra kumar
04758d3de3 refactor: handle Journal entries
(cherry picked from commit 9f3847c0f8)
2025-03-08 06:56:34 +00:00
ruthra kumar
615b0c40a3 refactor: move utility method to controller
(cherry picked from commit d1d06885dc)
2025-03-08 06:56:34 +00:00
ruthra kumar
231abab321 refactor: set transaction currency dr/cr in sales invoice
(cherry picked from commit 3e292ef2cb)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.py
2025-03-08 06:56:33 +00:00
ruthra kumar
fff3b1e84e refactor: handle stocked items
(cherry picked from commit ee93ed8c97)
2025-03-08 06:56:33 +00:00
ruthra kumar
5299a1032b refactor: handle stocked items
(cherry picked from commit 7ff3977394)
2025-03-08 06:56:33 +00:00
ruthra kumar
1e5fbc0a48 refactor: set tr currency dr & cr directly on parent document
(cherry picked from commit e9af567033)
2025-03-08 06:56:32 +00:00
ruthra kumar
5c47c35a0f refactor: use highest precision for storing exc rate
(cherry picked from commit b115bf2e2a)
2025-03-08 06:56:32 +00:00
ruthra kumar
2bf910a786 Merge pull request #46396 from frappe/mergify/bp/version-15-hotfix/pr-46064
fix: Debit and Credit mismatch on transaction currency debit and credit values (backport #46064)
2025-03-08 12:25:57 +05:30
ruthra kumar
0b8673777a chore: resolve conflict 2025-03-08 12:11:54 +05:30
ruthra kumar
8f4c1e7169 refactor: internal transfer gl
(cherry picked from commit f1d8feec15)
2025-03-08 06:36:37 +00:00
ruthra kumar
f303245fae test: assert total debit and credit for trx currency
(cherry picked from commit 55d0636123)
2025-03-08 06:36:37 +00:00
ruthra kumar
cd21e5c652 refactor: handle rounding diff for trx currency dr and cr
(cherry picked from commit 455a55b2ce)
2025-03-08 06:36:37 +00:00
ruthra kumar
57e0f73595 refactor: trx currency dr and cr for tax rows and item rows
(cherry picked from commit 4cd3f3531c)
2025-03-08 06:36:37 +00:00
ruthra kumar
2c73e31742 refactor: convert tax amount using exchange rate
(cherry picked from commit 7528ef147a)
2025-03-08 06:36:36 +00:00
ruthra kumar
002685fc89 fix: incorrect category in list
(cherry picked from commit 6545467aec)
2025-03-08 06:36:36 +00:00
ruthra kumar
38a3a43ba5 chore: typo
(cherry picked from commit bc792c61e9)
2025-03-08 06:36:36 +00:00
ruthra kumar
07f938cc10 refactor: isolate to specific doctypes
(cherry picked from commit b348aa3b37)
2025-03-08 06:36:35 +00:00
ruthra kumar
5c013172f9 refactor(test): save first to let the tax table populate
(cherry picked from commit 23d465805b)
2025-03-08 06:36:35 +00:00
ruthra kumar
b76c96820e fix(test): incorrect transaction exchange rate in test case
(cherry picked from commit a31770d122)
2025-03-08 06:36:35 +00:00
ruthra kumar
1d56931050 refactor: set transaction currency and rate before gl map
(cherry picked from commit ceca5b4c72)
2025-03-08 06:36:34 +00:00
ruthra kumar
66dc79ceb5 refactor: handle payment entry
(cherry picked from commit 5c86e3ce85)
2025-03-08 06:36:34 +00:00
ruthra kumar
00cbc89b5f refactor: handle Journal entries
(cherry picked from commit 9f3847c0f8)
2025-03-08 06:36:33 +00:00
ruthra kumar
d7baa451e3 refactor: move utility method to controller
(cherry picked from commit d1d06885dc)
2025-03-08 06:36:33 +00:00
ruthra kumar
e0b5386bf0 refactor: set transaction currency dr/cr in sales invoice
(cherry picked from commit 3e292ef2cb)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.py
2025-03-08 06:36:33 +00:00
ruthra kumar
133dca1824 refactor: handle stocked items
(cherry picked from commit ee93ed8c97)
2025-03-08 06:36:32 +00:00
ruthra kumar
eb0df50f1b refactor: handle stocked items
(cherry picked from commit 7ff3977394)
2025-03-08 06:36:32 +00:00
ruthra kumar
5761cfb3d5 refactor: set tr currency dr & cr directly on parent document
(cherry picked from commit e9af567033)
2025-03-08 06:36:32 +00:00
ruthra kumar
568b582b6a refactor: use highest precision for storing exc rate
(cherry picked from commit b115bf2e2a)
2025-03-08 06:36:31 +00:00
Shariq Ansari
d115c1c156 Merge pull request #46365 from frappe/mergify/bp/version-15-hotfix/pr-46352
fix: Allow rename prospect doctype (backport #46352)
2025-03-07 17:12:22 +05:30
Nabin Hait
4e688778dc chore: linter issue 2025-03-07 10:28:52 +05:30
Mihir Kandoi
b5890c1d55 Merge pull request #46376 from frappe/mergify/bp/version-15-hotfix/pr-46374 2025-03-06 23:00:13 +05:30
Mihir Kandoi
6419d020a1 fix: rare precision issue preventing submission of subcontracting order
(cherry picked from commit 33b71544db)
2025-03-06 16:46:04 +00:00
Nabin Hait
60364f6dc9 chore: conflicts 2025-03-06 18:14:09 +05:30
mergify[bot]
23c4252b9b fix: change fieldname for cash_flow to export (backport #46353) (#46366)
fix: change fieldname for cash_flow to export (#46353)

fix: change fieldname for cash_flow

Co-authored-by: Sanket322 <shahsanket322003.com>
(cherry picked from commit 606dcb0ad1)

Co-authored-by: Sanket Shah <113279972+Sanket322@users.noreply.github.com>
2025-03-06 18:12:31 +05:30
mergify[bot]
c816f9bd0a fix: validate accounting dimension company in Journal Entry & Stock Entry (backport #46204) (#46369)
fix: validate accounting dimension company in Journal Entry & Stock Entry (#46204)

* fix: validate accounting dimension company in journal entry and stock entry

* test: update test cases to validate company-based accounting dimension

* fix(test): ensure 'Pick List' company matches 'Delivery Note' to prevent test failures

* chore: remove redundant lines of code

(cherry picked from commit 7b6ebad9e6)

Co-authored-by: Bhavansathru <122002510+Bhavan23@users.noreply.github.com>
2025-03-06 18:12:06 +05:30
Shariq Ansari
de46165768 fix: Allow rename prospect doctype (#46352)
fix: allow rename prospect doctype
(cherry picked from commit 884709deb8)

# Conflicts:
#	erpnext/crm/doctype/prospect/prospect.json
2025-03-06 11:50:08 +00:00
Justine Jay
5cc251a172 fix: auto email report creation (#46343)
* fix(financial_statements): mandatory based on filter_based_on value

* fix(financial_statements.js): include options for multiselect
2025-03-06 17:18:26 +05:30
Frappe PR Bot
7c8b34fd8f chore(release): Bumped to Version 15.54.1
## [15.54.1](https://github.com/frappe/erpnext/compare/v15.54.0...v15.54.1) (2025-03-06)

### Bug Fixes

* check if set_landed_cost_based_on_purchase_invoice_rate is enabled before running patch ([12bf31d](12bf31df87))
* recalculate_amount_difference_field patch ([041335f](041335f318))
* rename_sla_fields patch ([bb553c2](bb553c27ab))
2025-03-06 11:05:55 +00:00
rohitwaghchaure
83320c97fa Merge pull request #46360 from frappe/mergify/bp/version-15/pr-46357
fix: rename_sla_fields patch (backport #46355) (backport #46357)
2025-03-06 16:34:33 +05:30
rohitwaghchaure
b004865240 Merge pull request #46362 from frappe/mergify/bp/version-15/pr-46358
fix: recalculate_amount_difference_field patch (backport #46354) (backport #46358)
2025-03-06 16:34:20 +05:30
Mihir Kandoi
525780645a chore: resolve conflicts
(cherry picked from commit 8e65b0ec0c)
2025-03-06 10:42:01 +00:00
Mihir Kandoi
12bf31df87 fix: check if set_landed_cost_based_on_purchase_invoice_rate is enabled before running patch
(cherry picked from commit 95d1976931)

# Conflicts:
#	erpnext/patches/v15_0/recalculate_amount_difference_field.py
(cherry picked from commit 7047fe2681)
2025-03-06 10:42:01 +00:00
Mihir Kandoi
041335f318 fix: recalculate_amount_difference_field patch
(cherry picked from commit 0492b941ff)

# Conflicts:
#	erpnext/patches/v15_0/recalculate_amount_difference_field.py
(cherry picked from commit f247f02e49)
2025-03-06 10:42:00 +00:00
rohitwaghchaure
9c9c8c9356 Merge pull request #46358 from frappe/mergify/bp/version-15-hotfix/pr-46354
fix: recalculate_amount_difference_field patch (backport #46354)
2025-03-06 14:53:08 +05:30
Mihir Kandoi
8e65b0ec0c chore: resolve conflicts 2025-03-06 14:13:55 +05:30
Mihir Kandoi
bb553c27ab fix: rename_sla_fields patch
(cherry picked from commit e8d4a487c6)
(cherry picked from commit 7bc7557018)
2025-03-06 08:20:30 +00:00
rohitwaghchaure
7080e1422d Merge pull request #46357 from frappe/mergify/bp/version-15-hotfix/pr-46355
fix: rename_sla_fields patch (backport #46355)
2025-03-06 13:48:54 +05:30
Mihir Kandoi
7047fe2681 fix: check if set_landed_cost_based_on_purchase_invoice_rate is enabled before running patch
(cherry picked from commit 95d1976931)

# Conflicts:
#	erpnext/patches/v15_0/recalculate_amount_difference_field.py
2025-03-06 07:58:38 +00:00
Mihir Kandoi
f247f02e49 fix: recalculate_amount_difference_field patch
(cherry picked from commit 0492b941ff)

# Conflicts:
#	erpnext/patches/v15_0/recalculate_amount_difference_field.py
2025-03-06 07:58:37 +00:00
Mihir Kandoi
7bc7557018 fix: rename_sla_fields patch
(cherry picked from commit e8d4a487c6)
2025-03-06 07:49:12 +00:00
rohitwaghchaure
e72264f448 Merge pull request #46346 from frappe/mergify/bp/version-15-hotfix/pr-46339
fix: doctype name (backport #46339)
2025-03-05 21:44:40 +05:30
Rohit Waghchaure
1dcbdf3257 fix: doctype name
(cherry picked from commit d039310d80)
2025-03-05 15:48:13 +00:00
Mihir Kandoi
5d6730a059 Merge pull request #46345 from frappe/mergify/bp/version-15-hotfix/pr-45693
fix: uom reverts to default upon selecting do not explode (backport #45693)
2025-03-05 21:09:04 +05:30
Mihir Kandoi
6b1d20970e fix: uom reverts to default upon selecting do not explode (#45693)
* fix: uom reverts to default upon selecting do not explode

* fix: logical error failing tests

(cherry picked from commit 58ed697ba5)
2025-03-05 15:21:58 +00:00
David (aider)
6f6574c5ac feat: add unit tests for distributed_discount_amount
(cherry picked from commit a464bd861b)
2024-09-05 10:08:39 +00:00
David
ad05e6dec2 fix: distributed discounts on si
(cherry picked from commit 0bab6f34c1)

# Conflicts:
#	erpnext/buying/doctype/purchase_order_item/purchase_order_item.json
#	erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json
#	erpnext/selling/doctype/quotation_item/quotation_item.json
#	erpnext/selling/doctype/sales_order_item/sales_order_item.json
#	erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
2024-09-05 10:08:39 +00:00
507 changed files with 25796 additions and 4652 deletions

4
.github/release.yml vendored Normal file
View File

@@ -0,0 +1,4 @@
changelog:
exclude:
labels:
- skip-release-notes

View File

@@ -0,0 +1,30 @@
name: "Auto-label PRs based on title"
on:
pull_request_target:
types: [opened, reopened]
jobs:
add-label-if-prefix-matches:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Check PR title and add label if it matches prefixes
uses: actions/github-script@v7
continue-on-error: true
with:
script: |
const title = context.payload.pull_request.title.toLowerCase();
const prefixes = ['chore', 'ci', 'style', 'test', 'refactor'];
// Check if the PR title starts with any of the prefixes
if (prefixes.some(prefix => title.startsWith(prefix))) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
labels: ['skip-release-notes']
});
}

View File

@@ -1,5 +1,5 @@
exclude: 'node_modules|.git'
default_stages: [commit]
default_stages: [pre-commit]
fail_fast: false

View File

@@ -62,7 +62,7 @@ New passwords will be created for the ERPNext "Administrator" user, the MariaDB
## Learning and community
1. [Frappe School](https://frappe.school) - Learn Frappe Framework and ERPNext from the various courses by the maintainers or from the community.
1. [Frappe School](https://school.frappe.io) - Learn Frappe Framework and ERPNext from the various courses by the maintainers or from the community.
2. [Official documentation](https://docs.erpnext.com/) - Extensive documentation for ERPNext.
3. [Discussion Forum](https://discuss.erpnext.com/) - Engage with community of ERPNext users and service providers.
4. [Telegram Group](https://erpnext_public.t.me) - Get instant help from huge community of users.

View File

@@ -4,7 +4,7 @@ import inspect
import frappe
from frappe.utils.user import is_website_user
__version__ = "15.54.0"
__version__ = "15.71.1"
def get_default_company(user=None):

View File

@@ -502,7 +502,7 @@ def update_account_number(name, account_name, account_number=None, from_descenda
"name",
)
if old_name:
if old_name and not from_descendant:
# same account in parent company exists
allow_child_account_creation = _("Allow Account Creation Against Child Company")
@@ -607,6 +607,7 @@ def _ensure_idle_system():
if frappe.flags.in_test:
return
last_gl_update = None
try:
# We also lock inserts to GL entry table with for_update here.
last_gl_update = frappe.db.get_value("GL Entry", {}, "modified", for_update=True, wait=False)
@@ -614,6 +615,9 @@ def _ensure_idle_system():
# wait=False fails immediately if there's an active transaction.
last_gl_update = add_to_date(None, seconds=-1)
if not last_gl_update:
return
if last_gl_update > add_to_date(None, minutes=-5):
frappe.throw(
_(

View File

@@ -138,6 +138,11 @@ frappe.treeview_settings["Account"] = {
description: __(
"Further accounts can be made under Groups, but entries can be made against non-Groups"
),
onchange: function () {
if (!this.value) {
this.layout.set_value("root_type", "");
}
},
},
{
fieldtype: "Select",
@@ -247,6 +252,10 @@ frappe.treeview_settings["Account"] = {
root_company,
]);
} else {
const node = treeview.tree.get_selected_node();
if (node.is_root) {
frappe.throw(__("Cannot create root account."));
}
treeview.new_node();
}
},
@@ -265,7 +274,8 @@ frappe.treeview_settings["Account"] = {
].treeview.page.fields_dict.root_company.get_value() ||
frappe.flags.ignore_root_company_validation) &&
node.expandable &&
!node.hide_add
!node.hide_add &&
!node.is_root
);
},
click: function () {
@@ -281,12 +291,14 @@ frappe.treeview_settings["Account"] = {
label: __("View Ledger"),
click: function (node, btn) {
frappe.route_options = {
account: node.label,
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(),
};
if (node.parent_label) {
frappe.route_options["account"] = node.label;
}
frappe.set_route("query-report", "General Ledger");
},
btnClass: "hidden-xs",

View File

@@ -116,6 +116,7 @@ def identify_is_group(child):
return is_group
@frappe.whitelist()
def get_chart(chart_template, existing_company=None):
chart = {}
if existing_company:

View File

@@ -98,7 +98,7 @@
"Office Maintenance Expenses": {},
"Office Rent": {},
"Postal Expenses": {},
"Print and Stationary": {},
"Print and Stationery": {},
"Rounded Off": {
"account_type": "Round Off"
},

View File

@@ -22,4 +22,32 @@ frappe.ui.form.on("Accounts Settings", {
}
);
},
add_taxes_from_taxes_and_charges_template(frm) {
toggle_tax_settings(frm, "add_taxes_from_taxes_and_charges_template");
},
add_taxes_from_item_tax_template(frm) {
toggle_tax_settings(frm, "add_taxes_from_item_tax_template");
},
drop_ar_procedures: function (frm) {
frm.call({
doc: frm.doc,
method: "drop_ar_sql_procedures",
callback: function (r) {
frappe.show_alert(__("Procedures dropped"), 5);
},
});
},
});
function toggle_tax_settings(frm, field_name) {
if (frm.doc[field_name]) {
const other_field =
field_name === "add_taxes_from_item_tax_template"
? "add_taxes_from_taxes_and_charges_template"
: "add_taxes_from_item_tax_template";
frm.set_value(other_field, 0);
}
}

View File

@@ -31,6 +31,7 @@
"determine_address_tax_category_from",
"column_break_19",
"add_taxes_from_item_tax_template",
"add_taxes_from_taxes_and_charges_template",
"book_tax_discount_loss",
"round_row_wise_tax",
"print_settings",
@@ -38,8 +39,14 @@
"show_taxes_as_table_in_print",
"column_break_12",
"show_payment_schedule_in_print",
"item_price_settings_section",
"maintain_same_internal_transaction_rate",
"column_break_feyo",
"maintain_same_rate_action",
"role_to_override_stop_action",
"currency_exchange_section",
"allow_stale",
"allow_pegged_currencies_exchange_rates",
"column_break_yuug",
"stale_days",
"section_break_jpd0",
@@ -77,9 +84,14 @@
"reports_tab",
"remarks_section",
"general_ledger_remarks_length",
"ignore_is_opening_check_for_reporting",
"column_break_lvjk",
"receivable_payable_remarks_length",
"accounts_receivable_payable_tuning_section",
"receivable_payable_fetch_method",
"column_break_ntmi",
"drop_ar_procedures",
"legacy_section",
"ignore_is_opening_check_for_reporting",
"payment_request_settings",
"create_pr_in_draft_status"
],
@@ -532,6 +544,84 @@
"fieldtype": "Select",
"label": "Posting Date Inheritance for Exchange Gain / Loss",
"options": "Invoice\nPayment\nReconciliation Date"
},
{
"fieldname": "column_break_xrnd",
"fieldtype": "Column Break"
},
{
"default": "Buffered Cursor",
"fieldname": "receivable_payable_fetch_method",
"fieldtype": "Select",
"label": "Data Fetch Method",
"options": "Buffered Cursor\nUnBuffered Cursor\nRaw SQL"
},
{
"fieldname": "accounts_receivable_payable_tuning_section",
"fieldtype": "Section Break",
"label": "Accounts Receivable / Payable Tuning"
},
{
"fieldname": "legacy_section",
"fieldtype": "Section Break",
"label": "Legacy Fields"
},
{
"default": "0",
"fieldname": "maintain_same_internal_transaction_rate",
"fieldtype": "Check",
"label": "Maintain Same Rate Throughout Internal Transaction"
},
{
"default": "Stop",
"depends_on": "maintain_same_internal_transaction_rate",
"fieldname": "maintain_same_rate_action",
"fieldtype": "Select",
"label": "Action if Same Rate is Not Maintained Throughout Internal Transaction",
"mandatory_depends_on": "maintain_same_internal_transaction_rate",
"options": "Stop\nWarn"
},
{
"depends_on": "eval: doc.maintain_same_internal_transaction_rate && doc.maintain_same_rate_action == 'Stop'",
"fieldname": "role_to_override_stop_action",
"fieldtype": "Link",
"label": "Role Allowed to Override Stop Action",
"options": "Role"
},
{
"fieldname": "item_price_settings_section",
"fieldtype": "Section Break",
"label": "Item Price Settings"
},
{
"fieldname": "column_break_feyo",
"fieldtype": "Column Break"
},
{
"default": "0",
"description": "System will do an implicit conversion using the pegged currency. <br>\nEx: Instead of AED -&gt; INR, system will do AED -&gt; USD -&gt; INR using the pegged exchange rate of AED against USD.",
"documentation_url": "/app/pegged-currencies/Pegged Currencies",
"fieldname": "allow_pegged_currencies_exchange_rates",
"fieldtype": "Check",
"label": "Allow Implicit Pegged Currency Conversion"
},
{
"default": "0",
"description": "If no taxes are set, and Taxes and Charges Template is selected, the system will automatically apply the taxes from the chosen template.",
"fieldname": "add_taxes_from_taxes_and_charges_template",
"fieldtype": "Check",
"label": "Automatically Add Taxes from Taxes and Charges Template"
},
{
"fieldname": "column_break_ntmi",
"fieldtype": "Column Break"
},
{
"depends_on": "eval:doc.receivable_payable_fetch_method == \"Raw SQL\"",
"description": "Drops existing SQL Procedures and Function setup by Accounts Receivable report",
"fieldname": "drop_ar_procedures",
"fieldtype": "Button",
"label": "Drop Procedures"
}
],
"icon": "icon-cog",
@@ -539,7 +629,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2025-01-23 13:15:44.077853",
"modified": "2025-06-23 15:55:33.346398",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",
@@ -568,4 +658,4 @@
"sort_order": "ASC",
"states": [],
"track_changes": 1
}
}

View File

@@ -25,7 +25,9 @@ class AccountsSettings(Document):
acc_frozen_upto: DF.Date | None
add_taxes_from_item_tax_template: DF.Check
add_taxes_from_taxes_and_charges_template: DF.Check
allow_multi_currency_invoices_against_single_party_account: DF.Check
allow_pegged_currencies_exchange_rates: DF.Check
allow_stale: DF.Check
auto_reconcile_payments: DF.Check
auto_reconciliation_job_trigger: DF.Int
@@ -50,13 +52,17 @@ class AccountsSettings(Document):
general_ledger_remarks_length: DF.Int
ignore_account_closing_balance: DF.Check
ignore_is_opening_check_for_reporting: DF.Check
maintain_same_internal_transaction_rate: DF.Check
maintain_same_rate_action: DF.Literal["Stop", "Warn"]
make_payment_via_journal_entry: DF.Check
merge_similar_account_heads: DF.Check
over_billing_allowance: DF.Currency
post_change_gl_entries: DF.Check
receivable_payable_fetch_method: DF.Literal["Buffered Cursor", "UnBuffered Cursor", "Raw SQL"]
receivable_payable_remarks_length: DF.Int
reconciliation_queue_size: DF.Int
role_allowed_to_over_bill: DF.Link | None
role_to_override_stop_action: DF.Link | None
round_row_wise_tax: DF.Check
show_balance_in_coa: DF.Check
show_inclusive_tax_in_print: DF.Check
@@ -69,6 +75,7 @@ class AccountsSettings(Document):
# end: auto-generated types
def validate(self):
self.validate_auto_tax_settings()
old_doc = self.get_doc_before_save()
clear_cache = False
@@ -135,3 +142,21 @@ class AccountsSettings(Document):
if self.has_value_changed("reconciliation_queue_size"):
if cint(self.reconciliation_queue_size) < 5 or cint(self.reconciliation_queue_size) > 100:
frappe.throw(_("Queue Size should be between 5 and 100"))
def validate_auto_tax_settings(self):
if self.add_taxes_from_item_tax_template and self.add_taxes_from_taxes_and_charges_template:
frappe.throw(
_("You cannot enable both the settings '{0}' and '{1}'.").format(
frappe.bold(_(self.meta.get_label("add_taxes_from_item_tax_template"))),
frappe.bold(_(self.meta.get_label("add_taxes_from_taxes_and_charges_template"))),
),
title=_("Auto Tax Settings Error"),
)
@frappe.whitelist()
def drop_ar_sql_procedures(self):
from erpnext.accounts.report.accounts_receivable.accounts_receivable import InitSQLProceduresForAR
frappe.db.sql(f"drop function if exists {InitSQLProceduresForAR.genkey_function_name}")
frappe.db.sql(f"drop procedure if exists {InitSQLProceduresForAR.init_procedure_name}")
frappe.db.sql(f"drop procedure if exists {InitSQLProceduresForAR.allocate_procedure_name}")

View File

@@ -118,8 +118,9 @@ class BankClearance(Document):
else:
# using db_set to trigger notification
payment_entry = frappe.get_doc(d.payment_document, d.payment_entry)
payment_entry.db_set("clearance_date", d.clearance_date)
frappe.db.set_value(
d.payment_document, d.payment_entry, "clearance_date", d.clearance_date
)
clearance_date_updated = True
@@ -159,9 +160,6 @@ def get_payment_entries_for_bank_clearance(
as_dict=1,
)
if bank_account:
condition += "and bank_account = %(bank_account)s"
payment_entries = frappe.db.sql(
f"""
select
@@ -183,7 +181,6 @@ def get_payment_entries_for_bank_clearance(
"account": account,
"from": from_date,
"to": to_date,
"bank_account": bank_account,
},
as_dict=1,
)

View File

@@ -7,6 +7,9 @@ import frappe
from frappe.utils import add_months, getdate
from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
from erpnext.accounts.doctype.mode_of_payment.test_mode_of_payment import (
set_default_account_for_mode_of_payment,
)
from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
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
@@ -191,11 +194,13 @@ def make_pos_sales_invoice():
customer = make_customer(customer="_Test Customer")
mode_of_payment = frappe.get_doc("Mode of Payment", "Wire Transfer")
set_default_account_for_mode_of_payment(mode_of_payment, "_Test Company", "_Test Bank Clearance - _TC")
si = create_sales_invoice(customer=customer, item="_Test Item", is_pos=1, qty=1, rate=1000, do_not_save=1)
si.set("payments", [])
si.append(
"payments", {"mode_of_payment": "Cash", "account": "_Test Bank Clearance - _TC", "amount": 1000}
)
si.append("payments", {"mode_of_payment": "Wire Transfer", "amount": 1000})
si.insert()
si.submit()

View File

@@ -8,6 +8,7 @@ import frappe
from frappe import _
from frappe.model.document import Document
from frappe.query_builder.custom import ConstantColumn
from frappe.query_builder.functions import Sum
from frappe.utils import cint, flt
from erpnext import get_default_cost_center
@@ -373,10 +374,37 @@ def auto_reconcile_vouchers(
from_reference_date=None,
to_reference_date=None,
):
frappe.flags.auto_reconcile_vouchers = True
reconciled, partially_reconciled = set(), set()
bank_transactions = get_bank_transactions(bank_account)
if len(bank_transactions) > 10:
frappe.enqueue(
method="erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.start_auto_reconcile",
queue="long",
bank_transactions=bank_transactions,
from_date=from_date,
to_date=to_date,
filter_by_reference_date=filter_by_reference_date,
from_reference_date=from_reference_date,
to_reference_date=to_reference_date,
)
frappe.msgprint(_("Auto Reconciliation has started in the background"))
else:
start_auto_reconcile(
bank_transactions,
from_date,
to_date,
filter_by_reference_date,
from_reference_date,
to_reference_date,
)
def start_auto_reconcile(
bank_transactions, from_date, to_date, filter_by_reference_date, from_reference_date, to_reference_date
):
frappe.flags.auto_reconcile_vouchers = True
reconciled, partially_reconciled = set(), set()
for transaction in bank_transactions:
linked_payments = get_linked_payments(
transaction.name,
@@ -414,7 +442,6 @@ def auto_reconcile_vouchers(
frappe.msgprint(title=_("Auto Reconciliation"), msg=alert_message, indicator=indicator)
frappe.flags.auto_reconcile_vouchers = False
return reconciled, partially_reconciled
def get_auto_reconcile_message(partially_reconciled, reconciled):
@@ -491,16 +518,23 @@ def subtract_allocations(gl_account, vouchers):
voucher_allocated_amounts = get_total_allocated_amount(voucher_docs)
for voucher in vouchers:
rows = voucher_allocated_amounts.get((voucher.get("doctype"), voucher.get("name"))) or []
filtered_row = list(filter(lambda row: row.get("gl_account") == gl_account, rows))
if amount := None if not filtered_row else filtered_row[0]["total"]:
if amount := get_allocated_amount(voucher_allocated_amounts, voucher, gl_account):
voucher["paid_amount"] -= amount
copied.append(voucher)
return copied
def get_allocated_amount(voucher_allocated_amounts, voucher, gl_account):
if not (voucher_details := voucher_allocated_amounts.get((voucher.get("doctype"), voucher.get("name")))):
return
if not (row := voucher_details.get(gl_account)):
return
return row.get("total")
def check_matching(
bank_account,
company,
@@ -770,26 +804,20 @@ def get_je_matching_query(
je = frappe.qb.DocType("Journal Entry")
jea = frappe.qb.DocType("Journal Entry Account")
ref_condition = je.cheque_no == transaction.reference_number
ref_rank = frappe.qb.terms.Case().when(ref_condition, 1).else_(0)
amount_field = f"{cr_or_dr}_in_account_currency"
amount_equality = getattr(jea, amount_field) == transaction.unallocated_amount
amount_rank = frappe.qb.terms.Case().when(amount_equality, 1).else_(0)
filter_by_date = je.posting_date.between(from_date, to_date)
if cint(filter_by_reference_date):
filter_by_date = je.cheque_date.between(from_reference_date, to_reference_date)
query = (
subquery = (
frappe.qb.from_(jea)
.join(je)
.on(jea.parent == je.name)
.select(
(ref_rank + amount_rank + 1).as_("rank"),
Sum(getattr(jea, amount_field)).as_("paid_amount"),
ConstantColumn("Journal Entry").as_("doctype"),
je.name,
getattr(jea, amount_field).as_("paid_amount"),
je.cheque_no.as_("reference_no"),
je.cheque_date.as_("reference_date"),
je.pay_to_recd_from.as_("party"),
@@ -801,13 +829,26 @@ def get_je_matching_query(
.where(je.voucher_type != "Opening Entry")
.where(je.clearance_date.isnull())
.where(jea.account == common_filters.bank_account)
.where(amount_equality if exact_match else getattr(jea, amount_field) > 0.0)
.where(filter_by_date)
.groupby(je.name)
.orderby(je.cheque_date if cint(filter_by_reference_date) else je.posting_date)
)
if frappe.flags.auto_reconcile_vouchers is True:
query = query.where(ref_condition)
subquery = subquery.where(je.cheque_no == transaction.reference_number)
ref_rank = frappe.qb.terms.Case().when(subquery.reference_no == transaction.reference_number, 1).else_(0)
amount_equality = subquery.paid_amount == transaction.unallocated_amount
amount_rank = frappe.qb.terms.Case().when(amount_equality, 1).else_(0)
query = (
frappe.qb.from_(subquery)
.select(
"*",
(ref_rank + amount_rank + 1).as_("rank"),
)
.where(amount_equality if exact_match else subquery.paid_amount > 0.0)
)
return query

View File

@@ -277,7 +277,7 @@ def get_import_status(docname):
@frappe.whitelist()
def get_import_logs(docname: str):
frappe.has_permission("Bank Statement Import")
frappe.has_permission("Bank Statement Import", throw=True)
return frappe.get_all(
"Data Import Log",

View File

@@ -1,6 +1,7 @@
import frappe
from frappe.utils import flt
from rapidfuzz import fuzz, process
from rapidfuzz.utils import default_process
class AutoMatchParty:
@@ -132,6 +133,7 @@ class AutoMatchbyPartyNameDescription:
query=self.get(field),
choices={row.get("name"): row.get("party_name") for row in names},
scorer=fuzz.token_set_ratio,
processor=default_process,
)
party_name, skip = self.process_fuzzy_result(result)

View File

@@ -2,27 +2,6 @@
// For license information, please see license.txt
frappe.ui.form.on("Bank Transaction", {
onload(frm) {
frm.set_query("payment_document", "payment_entries", function () {
const payment_doctypes = frm.events.get_payment_doctypes(frm);
return {
filters: {
name: ["in", payment_doctypes],
},
};
});
},
refresh(frm) {
if (!frm.is_dirty() && frm.doc.payment_entries.length > 0) {
frm.add_custom_button(__("Unreconcile Transaction"), () => {
frm.call("remove_payment_entries").then(() => frm.refresh());
});
}
},
bank_account: function (frm) {
set_bank_statement_filter(frm);
},
setup: function (frm) {
frm.set_query("party_type", function () {
return {
@@ -31,6 +10,41 @@ frappe.ui.form.on("Bank Transaction", {
},
};
});
frm.set_query("bank_account", function () {
return {
filters: { is_company_account: 1 },
};
});
frm.set_query("payment_document", "payment_entries", function () {
const payment_doctypes = frm.events.get_payment_doctypes(frm);
return {
filters: {
name: ["in", payment_doctypes],
},
};
});
frm.set_query("payment_entry", "payment_entries", function () {
return {
filters: {
docstatus: ["!=", 2],
},
};
});
},
refresh(frm) {
if (!frm.is_dirty() && frm.doc.payment_entries.length > 0) {
frm.add_custom_button(__("Unreconcile Transaction"), () => {
frm.call("remove_payment_entries").then(() => frm.refresh());
});
}
},
bank_account: function (frm) {
set_bank_statement_filter(frm);
},
get_payment_doctypes: function () {
@@ -39,31 +53,6 @@ frappe.ui.form.on("Bank Transaction", {
},
});
frappe.ui.form.on("Bank Transaction Payments", {
payment_entries_remove: function (frm, cdt, cdn) {
update_clearance_date(frm, cdt, cdn);
},
});
const update_clearance_date = (frm, cdt, cdn) => {
if (frm.doc.docstatus === 1) {
frappe
.xcall("erpnext.accounts.doctype.bank_transaction.bank_transaction.unclear_reference_payment", {
doctype: cdt,
docname: cdn,
bt_name: frm.doc.name,
})
.then((e) => {
if (e == "success") {
frappe.show_alert({
message: __("Document {0} successfully uncleared", [e]),
indicator: "green",
});
}
});
}
};
function set_bank_statement_filter(frm) {
frm.set_query("bank_statement", function () {
return {

View File

@@ -45,7 +45,6 @@
"default": "ACC-BTN-.YYYY.-",
"fieldname": "naming_series",
"fieldtype": "Select",
"hidden": 1,
"label": "Series",
"no_copy": 1,
"options": "ACC-BTN-.YYYY.-",
@@ -236,9 +235,10 @@
"fieldtype": "Column Break"
}
],
"grid_page_length": 50,
"is_submittable": 1,
"links": [],
"modified": "2023-11-18 18:32:47.203694",
"modified": "2025-06-18 17:24:57.044666",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Transaction",
@@ -287,9 +287,10 @@
"write": 1
}
],
"row_format": "Dynamic",
"sort_field": "date",
"sort_order": "DESC",
"states": [],
"title_field": "bank_account",
"track_changes": 1
}
}

View File

@@ -5,7 +5,7 @@ import frappe
from frappe import _
from frappe.model.docstatus import DocStatus
from frappe.model.document import Document
from frappe.utils import flt
from frappe.utils import flt, getdate
class BankTransaction(Document):
@@ -84,16 +84,16 @@ class BankTransaction(Document):
if not self.payment_entries:
return
pe = []
references = set()
for row in self.payment_entries:
reference = (row.payment_document, row.payment_entry)
if reference in pe:
if reference in references:
frappe.throw(
_("{0} {1} is allocated twice in this Bank Transaction").format(
row.payment_document, row.payment_entry
)
)
pe.append(reference)
references.add(reference)
def update_allocated_amount(self):
allocated_amount = (
@@ -104,6 +104,19 @@ class BankTransaction(Document):
self.allocated_amount = flt(allocated_amount, self.precision("allocated_amount"))
self.unallocated_amount = flt(unallocated_amount, self.precision("unallocated_amount"))
def delink_old_payment_entries(self):
if self.flags.updating_linked_bank_transaction:
return
old_doc = self.get_doc_before_save()
payment_entry_names = set(pe.name for pe in self.payment_entries)
for old_pe in old_doc.payment_entries:
if old_pe.name in payment_entry_names:
continue
self.delink_payment_entry(old_pe)
def before_submit(self):
self.allocate_payment_entries()
self.set_status()
@@ -113,13 +126,14 @@ class BankTransaction(Document):
def before_update_after_submit(self):
self.validate_duplicate_references()
self.allocate_payment_entries()
self.update_allocated_amount()
self.delink_old_payment_entries()
self.allocate_payment_entries()
self.set_status()
def on_cancel(self):
for payment_entry in self.payment_entries:
self.clear_linked_payment_entry(payment_entry, for_cancel=True)
self.delink_payment_entry(payment_entry)
self.set_status()
@@ -152,43 +166,55 @@ class BankTransaction(Document):
- 0 > a: Error: already over-allocated
- clear means: set the latest transaction date as clearance date
"""
if self.flags.updating_linked_bank_transaction or not self.payment_entries:
return
remaining_amount = self.unallocated_amount
to_remove = []
payment_entry_docs = [(pe.payment_document, pe.payment_entry) for pe in self.payment_entries]
pe_bt_allocations = get_total_allocated_amount(payment_entry_docs)
gl_entries = get_related_bank_gl_entries(payment_entry_docs)
gl_bank_account = frappe.db.get_value("Bank Account", self.bank_account, "account")
for payment_entry in self.payment_entries:
if payment_entry.allocated_amount == 0.0:
unallocated_amount, should_clear, latest_transaction = get_clearance_details(
self,
payment_entry,
pe_bt_allocations.get((payment_entry.payment_document, payment_entry.payment_entry))
or [],
for payment_entry in list(self.payment_entries):
if payment_entry.allocated_amount != 0:
continue
allocable_amount, should_clear, clearance_date = get_clearance_details(
self,
payment_entry,
pe_bt_allocations.get((payment_entry.payment_document, payment_entry.payment_entry)) or {},
gl_entries.get((payment_entry.payment_document, payment_entry.payment_entry)) or {},
gl_bank_account,
)
if allocable_amount < 0:
frappe.throw(_("Voucher {0} is over-allocated by {1}").format(allocable_amount))
if remaining_amount <= 0:
self.remove(payment_entry)
continue
if allocable_amount == 0:
if should_clear:
self.clear_linked_payment_entry(payment_entry, clearance_date=clearance_date)
self.remove(payment_entry)
continue
should_clear = should_clear and allocable_amount <= remaining_amount
payment_entry.allocated_amount = min(allocable_amount, remaining_amount)
remaining_amount = flt(
remaining_amount - payment_entry.allocated_amount,
self.precision("unallocated_amount"),
)
if payment_entry.payment_document == "Bank Transaction":
self.update_linked_bank_transaction(
payment_entry.payment_entry, payment_entry.allocated_amount
)
elif should_clear:
self.clear_linked_payment_entry(payment_entry, clearance_date=clearance_date)
if 0.0 == unallocated_amount:
if should_clear:
latest_transaction.clear_linked_payment_entry(payment_entry)
to_remove.append(payment_entry)
elif remaining_amount <= 0.0:
to_remove.append(payment_entry)
elif 0.0 < unallocated_amount <= remaining_amount:
payment_entry.allocated_amount = unallocated_amount
remaining_amount -= unallocated_amount
if should_clear:
latest_transaction.clear_linked_payment_entry(payment_entry)
elif 0.0 < unallocated_amount:
payment_entry.allocated_amount = remaining_amount
remaining_amount = 0.0
elif 0.0 > unallocated_amount:
frappe.throw(_("Voucher {0} is over-allocated by {1}").format(unallocated_amount))
for payment_entry in to_remove:
self.remove(payment_entry)
self.update_allocated_amount()
@frappe.whitelist()
def remove_payment_entries(self):
@@ -199,14 +225,64 @@ class BankTransaction(Document):
def remove_payment_entry(self, payment_entry):
"Clear payment entry and clearance"
self.clear_linked_payment_entry(payment_entry, for_cancel=True)
self.delink_payment_entry(payment_entry)
self.remove(payment_entry)
def clear_linked_payment_entry(self, payment_entry, for_cancel=False):
clearance_date = None if for_cancel else self.date
set_voucher_clearance(
payment_entry.payment_document, payment_entry.payment_entry, clearance_date, self
)
def delink_payment_entry(self, payment_entry):
if payment_entry.payment_document == "Bank Transaction":
self.update_linked_bank_transaction(payment_entry.payment_entry, allocated_amount=None)
else:
self.clear_linked_payment_entry(payment_entry, clearance_date=None)
def clear_linked_payment_entry(self, payment_entry, clearance_date=None):
doctype = payment_entry.payment_document
docname = payment_entry.payment_entry
# might be a bank transaction
if doctype not in get_doctypes_for_bank_reconciliation():
return
if doctype == "Sales Invoice":
frappe.db.set_value(
"Sales Invoice Payment",
dict(parenttype=doctype, parent=docname),
"clearance_date",
clearance_date,
)
return
frappe.db.set_value(doctype, docname, "clearance_date", clearance_date)
def update_linked_bank_transaction(self, bank_transaction_name, allocated_amount=None):
"""For when a second bank transaction has fixed another, e.g. refund"""
bt = frappe.get_doc(self.doctype, bank_transaction_name)
if allocated_amount:
bt.append(
"payment_entries",
{
"payment_document": self.doctype,
"payment_entry": self.name,
"allocated_amount": allocated_amount,
},
)
else:
pe = next(
(
pe
for pe in bt.payment_entries
if pe.payment_document == self.doctype and pe.payment_entry == self.name
),
None,
)
if not pe:
return
bt.flags.updating_linked_bank_transaction = True
bt.remove(pe)
bt.save()
def auto_set_party(self):
from erpnext.accounts.doctype.bank_transaction.auto_match_party import AutoMatchParty
@@ -238,71 +314,107 @@ def get_doctypes_for_bank_reconciliation():
return frappe.get_hooks("bank_reconciliation_doctypes")
def get_clearance_details(transaction, payment_entry, bt_allocations):
def get_clearance_details(transaction, payment_entry, bt_allocations, gl_entries, gl_bank_account):
"""
There should only be one bank gle for a voucher.
Could be none for a Bank Transaction.
But if a JE, could affect two banks.
Should only clear the voucher if all bank gles are allocated.
There should only be one bank gl entry for a voucher, except for JE.
For JE, there can be multiple bank gl entries for the same account.
In this case, the allocable_amount will be the sum of amounts of all gl entries of the account.
There will be no gl entry for a Bank Transaction so return the unallocated amount.
Should only clear the voucher if all bank gl entries are allocated.
"""
gl_bank_account = frappe.db.get_value("Bank Account", transaction.bank_account, "account")
gles = get_related_bank_gl_entries(payment_entry.payment_document, payment_entry.payment_entry)
unallocated_amount = min(
transaction.unallocated_amount,
get_paid_amount(payment_entry, transaction.currency, gl_bank_account),
)
unmatched_gles = len(gles)
latest_transaction = transaction
for gle in gles:
if gle["gl_account"] == gl_bank_account:
if gle["amount"] <= 0.0:
frappe.throw(
_("Voucher {0} value is broken: {1}").format(payment_entry.payment_entry, gle["amount"])
transaction_date = getdate(transaction.date)
if payment_entry.payment_document == "Bank Transaction":
bt = frappe.db.get_value(
"Bank Transaction",
payment_entry.payment_entry,
("unallocated_amount", "bank_account"),
as_dict=True,
)
if bt.bank_account != gl_bank_account:
frappe.throw(
_("Bank Account {} in Bank Transaction {} is not matching with Bank Account {}").format(
bt.bank_account, payment_entry.payment_entry, gl_bank_account
)
)
unmatched_gles -= 1
unallocated_amount = gle["amount"]
for a in bt_allocations:
if a["gl_account"] == gle["gl_account"]:
unallocated_amount = gle["amount"] - a["total"]
if frappe.utils.getdate(transaction.date) < a["latest_date"]:
latest_transaction = frappe.get_doc("Bank Transaction", a["latest_name"])
else:
# Must be a Journal Entry affecting more than one bank
for a in bt_allocations:
if a["gl_account"] == gle["gl_account"] and a["total"] == gle["amount"]:
unmatched_gles -= 1
return abs(bt.unallocated_amount), True, transaction_date
return unallocated_amount, unmatched_gles == 0, latest_transaction
if gl_bank_account not in gl_entries:
frappe.throw(
_("{} {} is not affecting bank account {}").format(
payment_entry.payment_document, payment_entry.payment_entry, gl_bank_account
)
)
allocable_amount = gl_entries.pop(gl_bank_account) or 0
if allocable_amount <= 0.0:
frappe.throw(
_("Invalid amount in accounting entries of {} {} for Account {}: {}").format(
payment_entry.payment_document, payment_entry.payment_entry, gl_bank_account, allocable_amount
)
)
matching_bt_allocaion = bt_allocations.pop(gl_bank_account, {})
allocable_amount = flt(
allocable_amount - matching_bt_allocaion.get("total", 0), transaction.precision("unallocated_amount")
)
should_clear = all(
gl_entries[gle_account] == bt_allocations.get(gle_account, {}).get("total", 0)
for gle_account in gl_entries
)
bt_allocation_date = matching_bt_allocaion.get("latest_date", None)
clearance_date = transaction_date if not bt_allocation_date else max(transaction_date, bt_allocation_date)
return allocable_amount, should_clear, clearance_date
def get_related_bank_gl_entries(doctype, docname):
def get_related_bank_gl_entries(docs):
# nosemgrep: frappe-semgrep-rules.rules.frappe-using-db-sql
return frappe.db.sql(
if not docs:
return {}
result = frappe.db.sql(
"""
SELECT
ABS(gle.credit_in_account_currency - gle.debit_in_account_currency) AS amount,
gle.account AS gl_account
FROM
`tabGL Entry` gle
LEFT JOIN
`tabAccount` ac ON ac.name=gle.account
WHERE
ac.account_type = 'Bank'
AND gle.voucher_type = %(doctype)s
AND gle.voucher_no = %(docname)s
AND is_cancelled = 0
""",
dict(doctype=doctype, docname=docname),
SELECT
gle.voucher_type AS doctype,
gle.voucher_no AS docname,
gle.account AS gl_account,
SUM(ABS(gle.credit_in_account_currency - gle.debit_in_account_currency)) AS amount
FROM
`tabGL Entry` gle
LEFT JOIN
`tabAccount` ac ON ac.name = gle.account
WHERE
ac.account_type = 'Bank'
AND (gle.voucher_type, gle.voucher_no) IN %(docs)s
AND gle.is_cancelled = 0
GROUP BY
gle.voucher_type, gle.voucher_no, gle.account
""",
{"docs": docs},
as_dict=True,
)
entries = {}
for row in result:
key = (row["doctype"], row["docname"])
if key not in entries:
entries[key] = {}
entries[key][row["gl_account"]] = row["amount"]
return entries
def get_total_allocated_amount(docs):
"""
Gets the sum of allocations for a voucher on each bank GL account
along with the latest bank transaction name & date
along with the latest bank transaction date
NOTE: query may also include just saved vouchers/payments but with zero allocated_amount
"""
if not docs:
@@ -311,11 +423,10 @@ def get_total_allocated_amount(docs):
# nosemgrep: frappe-semgrep-rules.rules.frappe-using-db-sql
result = frappe.db.sql(
"""
SELECT total, latest_name, latest_date, gl_account, payment_document, payment_entry FROM (
SELECT total, latest_date, gl_account, payment_document, payment_entry FROM (
SELECT
ROW_NUMBER() OVER w AS rownum,
SUM(btp.allocated_amount) OVER(PARTITION BY ba.account, btp.payment_document, btp.payment_entry) AS total,
FIRST_VALUE(bt.name) OVER w AS latest_name,
FIRST_VALUE(bt.date) OVER w AS latest_date,
ba.account AS gl_account,
btp.payment_document,
@@ -338,104 +449,14 @@ def get_total_allocated_amount(docs):
payment_allocation_details = {}
for row in result:
# Why is this *sometimes* a byte string?
if isinstance(row["latest_name"], bytes):
row["latest_name"] = row["latest_name"].decode()
row["latest_date"] = frappe.utils.getdate(row["latest_date"])
payment_allocation_details.setdefault((row["payment_document"], row["payment_entry"]), []).append(row)
row["latest_date"] = getdate(row["latest_date"])
payment_allocation_details.setdefault((row["payment_document"], row["payment_entry"]), {})[
row["gl_account"]
] = row
return payment_allocation_details
def get_paid_amount(payment_entry, currency, gl_bank_account):
if payment_entry.payment_document in ["Payment Entry", "Sales Invoice", "Purchase Invoice"]:
paid_amount_field = "paid_amount"
if payment_entry.payment_document == "Payment Entry":
doc = frappe.get_doc("Payment Entry", payment_entry.payment_entry)
if doc.payment_type == "Receive":
paid_amount_field = (
"received_amount" if doc.paid_to_account_currency == currency else "base_received_amount"
)
elif doc.payment_type == "Pay":
paid_amount_field = (
"paid_amount" if doc.paid_from_account_currency == currency else "base_paid_amount"
)
return frappe.db.get_value(
payment_entry.payment_document, payment_entry.payment_entry, paid_amount_field
)
elif payment_entry.payment_document == "Journal Entry":
return abs(
frappe.db.get_value(
"Journal Entry Account",
{"parent": payment_entry.payment_entry, "account": gl_bank_account},
"sum(debit_in_account_currency-credit_in_account_currency)",
)
or 0
)
elif payment_entry.payment_document == "Expense Claim":
return frappe.db.get_value(
payment_entry.payment_document, payment_entry.payment_entry, "total_amount_reimbursed"
)
elif payment_entry.payment_document == "Loan Disbursement":
return frappe.db.get_value(
payment_entry.payment_document, payment_entry.payment_entry, "disbursed_amount"
)
elif payment_entry.payment_document == "Loan Repayment":
return frappe.db.get_value(payment_entry.payment_document, payment_entry.payment_entry, "amount_paid")
elif payment_entry.payment_document == "Bank Transaction":
dep, wth = frappe.db.get_value(
"Bank Transaction", payment_entry.payment_entry, ("deposit", "withdrawal")
)
return abs(flt(wth) - flt(dep))
else:
frappe.throw(
f"Please reconcile {payment_entry.payment_document}: {payment_entry.payment_entry} manually"
)
def set_voucher_clearance(doctype, docname, clearance_date, self):
if doctype in get_doctypes_for_bank_reconciliation():
if (
doctype == "Payment Entry"
and frappe.db.get_value("Payment Entry", docname, "payment_type") == "Internal Transfer"
and len(get_reconciled_bank_transactions(doctype, docname)) < 2
):
return
if doctype == "Sales Invoice":
frappe.db.set_value(
"Sales Invoice Payment",
dict(parenttype=doctype, parent=docname),
"clearance_date",
clearance_date,
)
return
frappe.db.set_value(doctype, docname, "clearance_date", clearance_date)
elif doctype == "Bank Transaction":
# For when a second bank transaction has fixed another, e.g. refund
bt = frappe.get_doc(doctype, docname)
if clearance_date:
vouchers = [{"payment_doctype": "Bank Transaction", "payment_name": self.name}]
bt.add_payment_entries(vouchers)
bt.save()
else:
for pe in bt.payment_entries:
if pe.payment_document == self.doctype and pe.payment_entry == self.name:
bt.remove(pe)
bt.save()
break
def get_reconciled_bank_transactions(doctype, docname):
return frappe.get_all(
"Bank Transaction Payments",
@@ -444,13 +465,6 @@ def get_reconciled_bank_transactions(doctype, docname):
)
@frappe.whitelist()
def unclear_reference_payment(doctype, docname, bt_name):
bt = frappe.get_doc("Bank Transaction", bt_name)
set_voucher_clearance(doctype, docname, None, bt)
return docname
def remove_from_bank_transaction(doctype, docname):
"""Remove a (cancelled) voucher from all Bank Transactions."""
for bt_name in get_reconciled_bank_transactions(doctype, docname):

View File

@@ -12,6 +12,9 @@ from erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool
get_linked_payments,
reconcile_vouchers,
)
from erpnext.accounts.doctype.mode_of_payment.test_mode_of_payment import (
set_default_account_for_mode_of_payment,
)
from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice
@@ -434,15 +437,13 @@ def add_vouchers(gl_account="_Test Bank - _TC"):
except frappe.DuplicateEntryError:
pass
mode_of_payment = frappe.get_doc({"doctype": "Mode of Payment", "name": "Cash"})
mode_of_payment = frappe.get_doc({"doctype": "Mode of Payment", "name": "Wire Transfer"})
if not frappe.db.get_value("Mode of Payment Account", {"company": "_Test Company", "parent": "Cash"}):
mode_of_payment.append("accounts", {"company": "_Test Company", "default_account": gl_account})
mode_of_payment.save()
set_default_account_for_mode_of_payment(mode_of_payment, "_Test Company", gl_account)
si = create_sales_invoice(customer="Fayva", qty=1, rate=109080, do_not_save=1)
si.is_pos = 1
si.append("payments", {"mode_of_payment": "Cash", "account": gl_account, "amount": 109080})
si.append("payments", {"mode_of_payment": "Wire Transfer", "amount": 109080})
si.insert()
si.submit()

View File

@@ -7,10 +7,10 @@
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"naming_series",
"budget_against",
"company",
"cost_center",
"naming_series",
"project",
"fiscal_year",
"column_break_3",
@@ -195,19 +195,19 @@
},
{
"fieldname": "naming_series",
"fieldtype": "Data",
"hidden": 1,
"fieldtype": "Select",
"label": "Series",
"no_copy": 1,
"options": "BUDGET-.YYYY.-",
"print_hide": 1,
"read_only": 1,
"reqd": 1,
"set_only_once": 1
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2022-10-10 22:14:36.361509",
"modified": "2025-06-16 15:57:13.114981",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Budget",
@@ -235,4 +235,4 @@
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
}

View File

@@ -48,7 +48,7 @@ class Budget(Document):
cost_center: DF.Link | None
fiscal_year: DF.Link
monthly_distribution: DF.Link | None
naming_series: DF.Data | None
naming_series: DF.Literal["BUDGET-.YYYY.-"]
project: DF.Link | None
# end: auto-generated types
@@ -136,9 +136,6 @@ class Budget(Document):
):
self.applicable_on_booking_actual_expenses = 1
def before_naming(self):
self.naming_series = f"{{{frappe.scrub(self.budget_against)}}}./.{self.fiscal_year}/.###"
def validate_expense_against_budget(args, expense_amount=0):
args = frappe._dict(args)

View File

@@ -6,7 +6,11 @@ import unittest
import frappe
from frappe.utils import now_datetime, nowdate
from erpnext.accounts.doctype.budget.budget import BudgetError, get_actual_expense
from erpnext.accounts.doctype.budget.budget import (
BudgetError,
get_accumulated_monthly_budget,
get_actual_expense,
)
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
from erpnext.accounts.utils import get_fiscal_year
from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order
@@ -96,6 +100,10 @@ class TestBudget(unittest.TestCase):
frappe.db.set_value("Budget", budget.name, "action_if_accumulated_monthly_budget_exceeded", "Stop")
frappe.db.set_value("Budget", budget.name, "fiscal_year", fiscal_year)
accumulated_limit = get_accumulated_monthly_budget(
budget.monthly_distribution, nowdate(), budget.fiscal_year, budget.accounts[0].budget_amount
)
mr = frappe.get_doc(
{
"doctype": "Material Request",
@@ -109,7 +117,7 @@ class TestBudget(unittest.TestCase):
"uom": "_Test UOM",
"warehouse": "_Test Warehouse - _TC",
"schedule_date": nowdate(),
"rate": 100000,
"rate": accumulated_limit + 1,
"expense_account": "_Test Account Cost for Goods Sold - _TC",
"cost_center": "_Test Cost Center - _TC",
}

View File

@@ -128,7 +128,7 @@ class TestCouponCode(unittest.TestCase):
item_code="_Test Tesla Car",
rate=5000,
qty=1,
do_not_submit=True,
do_not_save=True,
)
self.assertEqual(so.items[0].rate, 5000)

View File

@@ -220,6 +220,7 @@ def get_dunning_letter_text(dunning_type: str, doc: str | dict, language: str |
if not language:
language = doc.get("language")
letter_text = None
if language:
letter_text = frappe.db.get_value(
DOCTYPE, {"parent": dunning_type, "language": language}, FIELDS, as_dict=1

View File

@@ -1,6 +1,9 @@
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import json
import frappe
from frappe.model import mapper
from frappe.tests.utils import FrappeTestCase
from frappe.utils import add_days, nowdate, today
@@ -68,6 +71,36 @@ class TestDunning(FrappeTestCase):
dunning.reload()
self.assertEqual(dunning.status, "Resolved")
def test_fetch_overdue_payments(self):
"""
Create SI with overdue payment. Check if overdue payment is fetched in Dunning.
"""
si1 = create_sales_invoice_against_cost_center(
posting_date=add_days(today(), -1 * 6),
qty=1,
rate=100,
)
si2 = create_sales_invoice_against_cost_center(
posting_date=add_days(today(), -1 * 6),
qty=1,
rate=300,
)
dunning = create_dunning_from_sales_invoice(si1.name)
dunning.overdue_payments = []
method = "erpnext.accounts.doctype.sales_invoice.sales_invoice.create_dunning"
updated_dunning = mapper.map_docs(method, json.dumps([si1.name, si2.name]), dunning)
self.assertEqual(len(updated_dunning.overdue_payments), 2)
self.assertEqual(updated_dunning.overdue_payments[0].sales_invoice, si1.name)
self.assertEqual(updated_dunning.overdue_payments[0].outstanding, si1.outstanding_amount)
self.assertEqual(updated_dunning.overdue_payments[1].sales_invoice, si2.name)
self.assertEqual(updated_dunning.overdue_payments[1].outstanding, si2.outstanding_amount)
def test_dunning_and_payment_against_partially_due_invoice(self):
"""
Create SI with first installment overdue. Check impact of Dunning and Payment Entry.

View File

@@ -279,7 +279,8 @@
{
"fieldname": "transaction_exchange_rate",
"fieldtype": "Float",
"label": "Transaction Exchange Rate"
"label": "Transaction Exchange Rate",
"precision": "9"
},
{
"fieldname": "debit_in_transaction_currency",
@@ -357,7 +358,7 @@
"idx": 1,
"in_create": 1,
"links": [],
"modified": "2024-08-22 13:03:39.997475",
"modified": "2025-02-21 14:36:49.431166",
"modified_by": "Administrator",
"module": "Accounts",
"name": "GL Entry",

View File

@@ -7,7 +7,7 @@ from frappe import _
from frappe.model.document import Document
from frappe.model.meta import get_field_precision
from frappe.model.naming import set_name_from_naming_options
from frappe.utils import flt, fmt_money
from frappe.utils import create_batch, flt, fmt_money, now
import erpnext
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
@@ -451,12 +451,20 @@ def rename_gle_sle_docs():
def rename_temporarily_named_docs(doctype):
"""Rename temporarily named docs using autoname options"""
docs_to_rename = frappe.get_all(doctype, {"to_rename": "1"}, order_by="creation", limit=50000)
for doc in docs_to_rename:
oldname = doc.name
set_name_from_naming_options(frappe.get_meta(doctype).autoname, doc)
newname = doc.name
frappe.db.sql(
f"UPDATE `tab{doctype}` SET name = %s, to_rename = 0 where name = %s",
(newname, oldname),
auto_commit=True,
)
autoname = frappe.get_meta(doctype).autoname
for batch in create_batch(docs_to_rename, 100):
for doc in batch:
oldname = doc.name
set_name_from_naming_options(autoname, doc)
newname = doc.name
frappe.db.sql(
f"UPDATE `tab{doctype}` SET name = %s, to_rename = 0, modified = %s where name = %s",
(newname, now(), oldname),
)
for hook_type in ("on_gle_rename", "on_sle_rename"):
for hook in frappe.get_hooks(hook_type):
frappe.call(hook, newname=newname, oldname=oldname)
frappe.db.commit()

View File

@@ -197,7 +197,7 @@ frappe.ui.form.on("Invoice Discounting", {
from_date: frm.doc.posting_date,
to_date: moment(frm.doc.modified).format("YYYY-MM-DD"),
company: frm.doc.company,
group_by: "Group by Voucher (Consolidated)",
categorize_by: "Categorize by Voucher (Consolidated)",
show_cancelled_entries: frm.doc.docstatus === 2,
};
frappe.set_route("query-report", "General Ledger");

View File

@@ -35,7 +35,7 @@ frappe.ui.form.on("Journal Entry", {
to_date: moment(frm.doc.modified).format("YYYY-MM-DD"),
company: frm.doc.company,
finance_book: frm.doc.finance_book,
group_by: "",
categorize_by: "",
show_cancelled_entries: frm.doc.docstatus === 2,
};
frappe.set_route("query-report", "General Ledger");

View File

@@ -24,6 +24,7 @@ from erpnext.accounts.party import get_party_account
from erpnext.accounts.utils import (
cancel_exchange_gain_loss_journal,
get_account_currency,
get_advance_payment_doctypes,
get_balance_on,
get_stock_accounts,
get_stock_and_account_balance,
@@ -141,12 +142,12 @@ class JournalEntry(AccountsController):
self.validate_empty_accounts_table()
self.validate_inter_company_accounts()
self.validate_depr_entry_voucher_type()
self.validate_company_in_accounting_dimension()
self.validate_advance_accounts()
if self.docstatus == 0:
self.apply_tax_withholding()
if not self.title:
if self.is_new() or not self.title:
self.title = self.get_title()
def validate_advance_accounts(self):
@@ -238,9 +239,10 @@ class JournalEntry(AccountsController):
def update_advance_paid(self):
advance_paid = frappe._dict()
advance_payment_doctypes = get_advance_payment_doctypes()
for d in self.get("accounts"):
if d.is_advance:
if d.reference_type in frappe.get_hooks("advance_payment_doctypes"):
if d.reference_type in advance_payment_doctypes:
advance_paid.setdefault(d.reference_type, []).append(d.reference_name)
for voucher_type, order_list in advance_paid.items():
@@ -249,11 +251,20 @@ class JournalEntry(AccountsController):
def validate_inter_company_accounts(self):
if self.voucher_type == "Inter Company Journal Entry" and self.inter_company_journal_entry_reference:
doc = frappe.get_doc("Journal Entry", self.inter_company_journal_entry_reference)
doc = frappe.db.get_value(
"Journal Entry",
self.inter_company_journal_entry_reference,
["company", "total_debit", "total_credit"],
as_dict=True,
)
account_currency = frappe.get_cached_value("Company", self.company, "default_currency")
previous_account_currency = frappe.get_cached_value("Company", doc.company, "default_currency")
if account_currency == previous_account_currency:
if self.total_credit != doc.total_debit or self.total_debit != doc.total_credit:
credit_precision = self.precision("total_credit")
debit_precision = self.precision("total_debit")
if (flt(self.total_credit, credit_precision) != flt(doc.total_debit, debit_precision)) or (
flt(self.total_debit, debit_precision) != flt(doc.total_credit, credit_precision)
):
frappe.throw(_("Total Credit/ Debit Amount should be same as linked Journal Entry"))
def validate_depr_entry_voucher_type(self):
@@ -575,8 +586,22 @@ class JournalEntry(AccountsController):
if customers:
from erpnext.selling.doctype.customer.customer import check_credit_limit
customer_details = frappe._dict(
frappe.db.get_all(
"Customer Credit Limit",
filters={
"parent": ["in", customers],
"parenttype": ["=", "Customer"],
"company": ["=", self.company],
},
fields=["parent", "bypass_credit_limit_check"],
as_list=True,
)
)
for customer in customers:
check_credit_limit(customer, self.company)
ignore_outstanding_sales_order = bool(customer_details.get(customer))
check_credit_limit(customer, self.company, ignore_outstanding_sales_order)
def validate_cheque_info(self):
if self.voucher_type in ["Bank Entry"]:
@@ -1059,14 +1084,15 @@ class JournalEntry(AccountsController):
gl_map = []
company_currency = erpnext.get_company_currency(self.company)
self.transaction_currency = company_currency
self.transaction_exchange_rate = 1
if self.multi_currency:
for row in self.get("accounts"):
if row.account_currency != company_currency:
self.currency = row.account_currency
self.conversion_rate = row.exchange_rate
# Journal assumes the first foreign currency as transaction currency
self.transaction_currency = row.account_currency
self.transaction_exchange_rate = row.exchange_rate
break
else:
self.currency = company_currency
for d in self.get("accounts"):
if d.debit or d.credit or (self.voucher_type == "Exchange Gain Or Loss"):
@@ -1091,6 +1117,18 @@ class JournalEntry(AccountsController):
"credit_in_account_currency": flt(
d.credit_in_account_currency, d.precision("credit_in_account_currency")
),
"transaction_currency": self.transaction_currency,
"transaction_exchange_rate": self.transaction_exchange_rate,
"debit_in_transaction_currency": flt(
d.debit_in_account_currency, d.precision("debit_in_account_currency")
)
if self.transaction_currency == d.account_currency
else flt(d.debit, d.precision("debit")) / self.transaction_exchange_rate,
"credit_in_transaction_currency": flt(
d.credit_in_account_currency, d.precision("credit_in_account_currency")
)
if self.transaction_currency == d.account_currency
else flt(d.credit, d.precision("credit")) / self.transaction_exchange_rate,
"against_voucher_type": d.reference_type,
"against_voucher": d.reference_name,
"remarks": remarks,

View File

@@ -575,11 +575,23 @@ class TestJournalEntry(unittest.TestCase):
order_by="account",
)
expected = [
{"account": "_Test Bank - _TC", "transaction_exchange_rate": 1.0},
{"account": "_Test Bank - _TC", "transaction_exchange_rate": 85.0},
{"account": "_Test Receivable USD - _TC", "transaction_exchange_rate": 85.0},
]
self.assertEqual(expected, actual)
def test_pay_to_recd_from(self):
jv = make_journal_entry("_Test Cash - _TC", "_Test Bank - _TC", 100, save=False)
jv.pay_to_recd_from = "_Test Receiver"
jv.save()
self.assertEqual(jv.pay_to_recd_from, "_Test Receiver")
jv.pay_to_recd_from = "_Test Receiver 2"
jv.save()
jv.submit()
self.assertEqual(jv.pay_to_recd_from, "_Test Receiver 2")
def make_journal_entry(
account1,
@@ -591,13 +603,14 @@ def make_journal_entry(
save=True,
submit=False,
project=None,
company=None,
):
if not cost_center:
cost_center = "_Test Cost Center - _TC"
jv = frappe.new_doc("Journal Entry")
jv.posting_date = posting_date or nowdate()
jv.company = "_Test Company"
jv.company = company or "_Test Company"
jv.user_remark = "test"
jv.multi_currency = 1
jv.set(

View File

@@ -168,8 +168,9 @@ def validate_loyalty_points(ref_doc, points_to_redeem):
loyalty_amount = flt(points_to_redeem * loyalty_program_details.conversion_factor)
if loyalty_amount > ref_doc.rounded_total:
frappe.throw(_("You can't redeem Loyalty Points having more value than the Rounded Total."))
total_amount = ref_doc.grand_total if ref_doc.is_rounded_total_disabled() else ref_doc.rounded_total
if loyalty_amount > total_amount:
frappe.throw(_("You can't redeem Loyalty Points having more value than the Total Amount."))
if not ref_doc.loyalty_amount and ref_doc.loyalty_amount != loyalty_amount:
ref_doc.loyalty_amount = loyalty_amount

View File

@@ -3,8 +3,25 @@
import unittest
# test_records = frappe.get_test_records('Mode of Payment')
import frappe
class TestModeofPayment(unittest.TestCase):
pass
def set_default_account_for_mode_of_payment(mode_of_payment, company, account):
mode_of_payment.reload()
if frappe.db.exists(
"Mode of Payment Account", {"parent": mode_of_payment.mode_of_payment, "company": company}
):
frappe.db.set_value(
"Mode of Payment Account",
{"parent": mode_of_payment.mode_of_payment, "company": company},
"default_account",
account,
)
return
mode_of_payment.append("accounts", {"company": company, "default_account": account})
mode_of_payment.save()

View File

@@ -411,7 +411,7 @@ frappe.ui.form.on("Payment Entry", {
from_date: frm.doc.posting_date,
to_date: moment(frm.doc.modified).format("YYYY-MM-DD"),
company: frm.doc.company,
group_by: "",
categorize_by: "",
show_cancelled_entries: frm.doc.docstatus === 2,
};
frappe.set_route("query-report", "General Ledger");

View File

@@ -21,7 +21,6 @@
"party_name",
"book_advance_payments_in_separate_party_account",
"reconcile_on_advance_payment_date",
"advance_reconciliation_takes_effect_on",
"column_break_11",
"bank_account",
"party_bank_account",
@@ -203,14 +202,14 @@
"fieldtype": "Column Break"
},
{
"depends_on": "party",
"depends_on": "eval: doc.party && doc.party_type !== \"Employee\"",
"fieldname": "contact_person",
"fieldtype": "Link",
"label": "Contact",
"options": "Contact"
},
{
"depends_on": "contact_person",
"depends_on": "eval: (doc.contact_person || doc.party_type === \"Employee\") && doc.contact_email",
"fieldname": "contact_email",
"fieldtype": "Data",
"label": "Email",
@@ -229,6 +228,7 @@
"fieldname": "party_balance",
"fieldtype": "Currency",
"label": "Party Balance",
"no_copy": 1,
"print_hide": 1,
"read_only": 1
},
@@ -786,18 +786,9 @@
"options": "No\nYes",
"print_hide": 1,
"search_index": 1
},
{
"default": "Oldest Of Invoice Or Advance",
"fetch_from": "company.reconciliation_takes_effect_on",
"fieldname": "advance_reconciliation_takes_effect_on",
"fieldtype": "Select",
"hidden": 1,
"label": "Advance Reconciliation Takes Effect On",
"no_copy": 1,
"options": "Advance Payment Date\nOldest Of Invoice Or Advance\nReconciliation Date"
}
],
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [
@@ -809,7 +800,7 @@
"table_fieldname": "payment_entries"
}
],
"modified": "2025-01-31 17:27:28.555246",
"modified": "2025-05-15 18:01:04.013025",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry",
@@ -849,6 +840,7 @@
"write": 1
}
],
"row_format": "Dynamic",
"show_name_in_global_search": 1,
"sort_field": "modified",
"sort_order": "DESC",

View File

@@ -7,6 +7,7 @@ from functools import reduce
import frappe
from frappe import ValidationError, _, qb, scrub, throw
from frappe.model.meta import get_field_precision
from frappe.query_builder import Tuple
from frappe.query_builder.functions import Count
from frappe.utils import cint, comma_or, flt, getdate, nowdate
@@ -37,12 +38,18 @@ from erpnext.accounts.general_ledger import (
make_reverse_gl_entries,
process_gl_map,
)
from erpnext.accounts.party import get_party_account
from erpnext.accounts.party import (
complete_contact_details,
get_default_contact,
get_party_account,
)
from erpnext.accounts.utils import (
cancel_exchange_gain_loss_journal,
get_account_currency,
get_advance_payment_doctypes,
get_balance_on,
get_outstanding_invoices,
get_reconciliation_effect_date,
)
from erpnext.controllers.accounts_controller import (
AccountsController,
@@ -248,16 +255,18 @@ class PaymentEntry(AccountsController):
reference_names.add(key)
def set_bank_account_data(self):
if self.bank_account:
bank_data = get_bank_account_details(self.bank_account)
if not self.bank_account:
return
field = "paid_from" if self.payment_type == "Pay" else "paid_to"
bank_data = get_bank_account_details(self.bank_account)
self.bank = bank_data.bank
self.bank_account_no = bank_data.bank_account_no
field = "paid_from" if self.payment_type == "Pay" else "paid_to"
if not self.get(field):
self.set(field, bank_data.account)
self.bank = bank_data.bank
self.bank_account_no = bank_data.bank_account_no
if not self.get(field):
self.set(field, bank_data.account)
def validate_payment_type_with_outstanding(self):
total_outstanding = sum(d.allocated_amount for d in self.get("references"))
@@ -275,15 +284,16 @@ class PaymentEntry(AccountsController):
if self.party_type in ("Customer", "Supplier"):
self.validate_allocated_amount_with_latest_data()
else:
fail_message = _("Row #{0}: Allocated Amount cannot be greater than outstanding amount.")
for d in self.get("references"):
if (flt(d.allocated_amount)) > 0 and flt(d.allocated_amount) > flt(d.outstanding_amount):
frappe.throw(fail_message.format(d.idx))
return
# Check for negative outstanding invoices as well
if flt(d.allocated_amount) < 0 and flt(d.allocated_amount) < flt(d.outstanding_amount):
frappe.throw(fail_message.format(d.idx))
fail_message = _("Row #{0}: Allocated Amount cannot be greater than outstanding amount.")
for d in self.get("references"):
if (flt(d.allocated_amount)) > 0 and flt(d.allocated_amount) > flt(d.outstanding_amount):
frappe.throw(fail_message.format(d.idx))
# Check for negative outstanding invoices as well
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):
"""
@@ -321,91 +331,89 @@ class PaymentEntry(AccountsController):
return False
def validate_allocated_amount_with_latest_data(self):
if self.references:
uniq_vouchers = set([(x.reference_doctype, x.reference_name) for x in self.references])
vouchers = [frappe._dict({"voucher_type": x[0], "voucher_no": x[1]}) for x in uniq_vouchers]
latest_references = get_outstanding_reference_documents(
{
"posting_date": self.posting_date,
"company": self.company,
"party_type": self.party_type,
"payment_type": self.payment_type,
"party": self.party,
"party_account": self.paid_from if self.payment_type == "Receive" else self.paid_to,
"get_outstanding_invoices": True,
"get_orders_to_be_billed": True,
"vouchers": vouchers,
"book_advance_payments_in_separate_party_account": self.book_advance_payments_in_separate_party_account,
},
validate=True,
)
if not self.references:
return
# Group latest_references by (voucher_type, voucher_no)
latest_lookup = {}
for d in latest_references:
d = frappe._dict(d)
latest_lookup.setdefault((d.voucher_type, d.voucher_no), frappe._dict())[d.payment_term] = d
uniq_vouchers = {(x.reference_doctype, x.reference_name) for x in self.references}
vouchers = [frappe._dict({"voucher_type": x[0], "voucher_no": x[1]}) for x in uniq_vouchers]
latest_references = get_outstanding_reference_documents(
{
"posting_date": self.posting_date,
"company": self.company,
"party_type": self.party_type,
"payment_type": self.payment_type,
"party": self.party,
"party_account": self.paid_from if self.payment_type == "Receive" else self.paid_to,
"get_outstanding_invoices": True,
"get_orders_to_be_billed": True,
"vouchers": vouchers,
"book_advance_payments_in_separate_party_account": self.book_advance_payments_in_separate_party_account,
},
validate=True,
)
for idx, d in enumerate(self.get("references"), start=1):
latest = latest_lookup.get((d.reference_doctype, d.reference_name)) or frappe._dict()
# Group latest_references by (voucher_type, voucher_no)
latest_lookup = {}
for d in latest_references:
d = frappe._dict(d)
latest_lookup.setdefault((d.voucher_type, d.voucher_no), frappe._dict())[d.payment_term] = d
# If term based allocation is enabled, throw
if (
d.payment_term is None or d.payment_term == ""
) and self.term_based_allocation_enabled_for_reference(d.reference_doctype, d.reference_name):
frappe.throw(
_(
"{0} has Payment Term based allocation enabled. Select a Payment Term for Row #{1} in Payment References section"
).format(frappe.bold(d.reference_name), frappe.bold(idx))
)
for idx, d in enumerate(self.get("references"), start=1):
latest = latest_lookup.get((d.reference_doctype, d.reference_name)) or frappe._dict()
# if no payment template is used by invoice and has a custom term(no `payment_term`), then invoice outstanding will be in 'None' key
latest = latest.get(d.payment_term) or latest.get(None)
# The reference has already been fully paid
if not latest:
frappe.throw(
_("{0} {1} has already been fully paid.").format(
_(d.reference_doctype), d.reference_name
)
)
# The reference has already been partly paid
elif (
latest.outstanding_amount < latest.invoice_amount
and flt(d.outstanding_amount, d.precision("outstanding_amount"))
!= flt(latest.outstanding_amount, d.precision("outstanding_amount"))
and d.payment_term == ""
):
frappe.throw(
_(
"{0} {1} has already been partly paid. Please use the 'Get Outstanding Invoice' or the 'Get Outstanding Orders' button to get the latest outstanding amounts."
).format(_(d.reference_doctype), d.reference_name)
)
# If term based allocation is enabled, throw
if (
d.payment_term is None or d.payment_term == ""
) and self.term_based_allocation_enabled_for_reference(d.reference_doctype, d.reference_name):
frappe.throw(
_(
"{0} has Payment Term based allocation enabled. Select a Payment Term for Row #{1} in Payment References section"
).format(frappe.bold(d.reference_name), frappe.bold(idx))
)
fail_message = _("Row #{0}: Allocated Amount cannot be greater than outstanding amount.")
# if no payment template is used by invoice and has a custom term(no `payment_term`), then invoice outstanding will be in 'None' key
latest = latest.get(d.payment_term) or latest.get(None)
# The reference has already been fully paid
if not latest:
frappe.throw(
_("{0} {1} has already been fully paid.").format(_(d.reference_doctype), d.reference_name)
)
# The reference has already been partly paid
elif (
latest.outstanding_amount < latest.invoice_amount
and flt(d.outstanding_amount, d.precision("outstanding_amount"))
!= flt(latest.outstanding_amount, d.precision("outstanding_amount"))
and d.payment_term == ""
):
frappe.throw(
_(
"{0} {1} has already been partly paid. Please use the 'Get Outstanding Invoice' or the 'Get Outstanding Orders' button to get the latest outstanding amounts."
).format(_(d.reference_doctype), d.reference_name)
)
if (
d.payment_term
and (
(flt(d.allocated_amount)) > 0
and latest.payment_term_outstanding
and (flt(d.allocated_amount) > flt(latest.payment_term_outstanding))
)
and self.term_based_allocation_enabled_for_reference(
d.reference_doctype, d.reference_name
)
):
frappe.throw(
_(
"Row #{0}: Allocated amount:{1} is greater than outstanding amount:{2} for Payment Term {3}"
).format(d.idx, d.allocated_amount, latest.payment_term_outstanding, d.payment_term)
)
fail_message = _("Row #{0}: Allocated Amount cannot be greater than outstanding amount.")
if (flt(d.allocated_amount)) > 0 and flt(d.allocated_amount) > flt(latest.outstanding_amount):
frappe.throw(fail_message.format(d.idx))
if (
d.payment_term
and (
(flt(d.allocated_amount)) > 0
and latest.payment_term_outstanding
and (flt(d.allocated_amount) > flt(latest.payment_term_outstanding))
)
and self.term_based_allocation_enabled_for_reference(d.reference_doctype, d.reference_name)
):
frappe.throw(
_(
"Row #{0}: Allocated amount:{1} is greater than outstanding amount:{2} for Payment Term {3}"
).format(d.idx, d.allocated_amount, latest.payment_term_outstanding, d.payment_term)
)
# Check for negative outstanding invoices as well
if flt(d.allocated_amount) < 0 and flt(d.allocated_amount) < flt(latest.outstanding_amount):
frappe.throw(fail_message.format(d.idx))
if (flt(d.allocated_amount)) > 0 and flt(d.allocated_amount) > flt(latest.outstanding_amount):
frappe.throw(fail_message.format(d.idx))
# Check for negative outstanding invoices as well
if flt(d.allocated_amount) < 0 and flt(d.allocated_amount) < flt(latest.outstanding_amount):
frappe.throw(fail_message.format(d.idx))
def delink_advance_entry_references(self):
for reference in self.references:
@@ -439,6 +447,12 @@ class PaymentEntry(AccountsController):
self.party_name = frappe.db.get_value(self.party_type, self.party, "name")
if self.party:
if self.party_type == "Employee":
self.contact_person = None
elif not self.contact_person:
self.contact_person = get_default_contact(self.party_type, self.party)
complete_contact_details(self)
if not self.party_balance:
self.party_balance = get_balance_on(
party_type=self.party_type, party=self.party, date=self.posting_date, company=self.company
@@ -449,15 +463,25 @@ class PaymentEntry(AccountsController):
self.set(self.party_account_field, party_account)
self.party_account = party_account
if self.paid_from and not (self.paid_from_account_currency or self.paid_from_account_balance):
if self.paid_from and (
not self.paid_from_account_currency
or not self.paid_from_account_balance
or not self.paid_from_account_type
):
acc = get_account_details(self.paid_from, self.posting_date, self.cost_center)
self.paid_from_account_currency = acc.account_currency
self.paid_from_account_balance = acc.account_balance
self.paid_from_account_type = acc.account_type
if self.paid_to and not (self.paid_to_account_currency or self.paid_to_account_balance):
if self.paid_to and (
not self.paid_to_account_currency
or not self.paid_to_account_balance
or not self.paid_to_account_type
):
acc = get_account_details(self.paid_to, self.posting_date, self.cost_center)
self.paid_to_account_currency = acc.account_currency
self.paid_to_account_balance = acc.account_balance
self.paid_to_account_type = acc.account_type
self.party_account_currency = (
self.paid_from_account_currency
@@ -472,47 +496,48 @@ class PaymentEntry(AccountsController):
reference_exchange_details: dict | None = None,
) -> None:
for d in self.get("references"):
if d.allocated_amount:
if update_ref_details_only_for and (
(d.reference_doctype, d.reference_name) not in update_ref_details_only_for
):
if not d.allocated_amount:
continue
if update_ref_details_only_for and (
(d.reference_doctype, d.reference_name) not in update_ref_details_only_for
):
continue
ref_details = get_reference_details(
d.reference_doctype,
d.reference_name,
self.party_account_currency,
self.party_type,
self.party,
)
# Only update exchange rate when the reference is Journal Entry
if (
reference_exchange_details
and d.reference_doctype == reference_exchange_details.reference_doctype
and d.reference_name == reference_exchange_details.reference_name
):
ref_details.update({"exchange_rate": reference_exchange_details.exchange_rate})
for field, value in ref_details.items():
if d.exchange_gain_loss:
# for cases where gain/loss is booked into invoice
# exchange_gain_loss is calculated from invoice & populated
# and row.exchange_rate is already set to payment entry's exchange rate
# refer -> `update_reference_in_payment_entry()` in utils.py
continue
ref_details = get_reference_details(
d.reference_doctype,
d.reference_name,
self.party_account_currency,
self.party_type,
self.party,
)
# Only update exchange rate when the reference is Journal Entry
if (
reference_exchange_details
and d.reference_doctype == reference_exchange_details.reference_doctype
and d.reference_name == reference_exchange_details.reference_name
):
ref_details.update({"exchange_rate": reference_exchange_details.exchange_rate})
for field, value in ref_details.items():
if d.exchange_gain_loss:
# for cases where gain/loss is booked into invoice
# exchange_gain_loss is calculated from invoice & populated
# and row.exchange_rate is already set to payment entry's exchange rate
# refer -> `update_reference_in_payment_entry()` in utils.py
continue
if field == "exchange_rate" or not d.get(field) or force:
d.db_set(field, value)
if field == "exchange_rate" or not d.get(field) or force:
d.db_set(field, value)
def validate_payment_type(self):
if self.payment_type not in ("Receive", "Pay", "Internal Transfer"):
frappe.throw(_("Payment Type must be one of Receive, Pay and Internal Transfer"))
def validate_party_details(self):
if self.party:
if not frappe.db.exists(self.party_type, self.party):
frappe.throw(_("{0} {1} does not exist").format(_(self.party_type), self.party))
if self.party and not frappe.db.exists(self.party_type, self.party):
frappe.throw(_("{0} {1} does not exist").format(_(self.party_type), self.party))
def set_exchange_rate(self, ref_doc=None):
self.set_source_exchange_rate(ref_doc)
@@ -522,12 +547,8 @@ class PaymentEntry(AccountsController):
if self.paid_from:
if self.paid_from_account_currency == self.company_currency:
self.source_exchange_rate = 1
else:
if ref_doc:
if self.paid_from_account_currency == ref_doc.currency:
self.source_exchange_rate = ref_doc.get("exchange_rate") or ref_doc.get(
"conversion_rate"
)
elif ref_doc and self.paid_from_account_currency == ref_doc.currency:
self.source_exchange_rate = ref_doc.get("exchange_rate") or ref_doc.get("conversion_rate")
if not self.source_exchange_rate:
self.source_exchange_rate = get_exchange_rate(
@@ -538,9 +559,8 @@ class PaymentEntry(AccountsController):
if self.paid_from_account_currency == self.paid_to_account_currency:
self.target_exchange_rate = self.source_exchange_rate
elif self.paid_to and not self.target_exchange_rate:
if ref_doc:
if self.paid_to_account_currency == ref_doc.currency:
self.target_exchange_rate = ref_doc.get("exchange_rate") or ref_doc.get("conversion_rate")
if ref_doc and self.paid_to_account_currency == ref_doc.currency:
self.target_exchange_rate = ref_doc.get("exchange_rate") or ref_doc.get("conversion_rate")
if not self.target_exchange_rate:
self.target_exchange_rate = get_exchange_rate(
@@ -550,7 +570,7 @@ class PaymentEntry(AccountsController):
def validate_mandatory(self):
for field in ("paid_amount", "received_amount", "source_exchange_rate", "target_exchange_rate"):
if not self.get(field):
frappe.throw(_("{0} is mandatory").format(self.meta.get_label(field)))
frappe.throw(_("{0} is mandatory").format(_(self.meta.get_label(field))))
def validate_reference_documents(self):
valid_reference_doctypes = self.get_valid_reference_doctypes()
@@ -571,63 +591,61 @@ class PaymentEntry(AccountsController):
elif d.reference_name:
if not frappe.db.exists(d.reference_doctype, d.reference_name):
frappe.throw(_("{0} {1} does not exist").format(d.reference_doctype, d.reference_name))
else:
ref_doc = frappe.get_doc(d.reference_doctype, d.reference_name)
if d.reference_doctype != "Journal Entry":
if self.party != ref_doc.get(scrub(self.party_type)):
frappe.throw(
_("{0} {1} is not associated with {2} {3}").format(
_(d.reference_doctype), d.reference_name, _(self.party_type), self.party
)
)
else:
self.validate_journal_entry()
ref_doc = frappe.get_doc(d.reference_doctype, d.reference_name)
if d.reference_doctype in frappe.get_hooks("invoice_doctypes"):
if self.party_type == "Customer":
ref_party_account = (
get_party_account_based_on_invoice_discounting(d.reference_name)
or ref_doc.debit_to
)
elif self.party_type == "Supplier":
ref_party_account = ref_doc.credit_to
elif self.party_type == "Employee":
ref_party_account = ref_doc.payable_account
if (
ref_party_account != self.party_account
and not self.book_advance_payments_in_separate_party_account
):
frappe.throw(
_("{0} {1} is associated with {2}, but Party Account is {3}").format(
_(d.reference_doctype),
d.reference_name,
ref_party_account,
self.party_account,
)
)
if ref_doc.doctype == "Purchase Invoice" and ref_doc.get("on_hold"):
frappe.throw(
_("{0} {1} is on hold").format(_(d.reference_doctype), d.reference_name),
title=_("Invalid Purchase Invoice"),
)
if ref_doc.docstatus != 1:
if d.reference_doctype != "Journal Entry":
if self.party != ref_doc.get(scrub(self.party_type)):
frappe.throw(
_("{0} {1} must be submitted").format(_(d.reference_doctype), d.reference_name)
_("{0} {1} is not associated with {2} {3}").format(
_(d.reference_doctype), d.reference_name, _(self.party_type), self.party
)
)
else:
self.validate_journal_entry()
if d.reference_doctype in frappe.get_hooks("invoice_doctypes"):
if self.party_type == "Customer":
ref_party_account = (
get_party_account_based_on_invoice_discounting(d.reference_name)
or ref_doc.debit_to
)
elif self.party_type == "Supplier":
ref_party_account = ref_doc.credit_to
elif self.party_type == "Employee":
ref_party_account = ref_doc.payable_account
if (
ref_party_account != self.party_account
and not self.book_advance_payments_in_separate_party_account
):
frappe.throw(
_("{0} {1} is associated with {2}, but Party Account is {3}").format(
_(d.reference_doctype),
d.reference_name,
ref_party_account,
self.party_account,
)
)
if ref_doc.doctype == "Purchase Invoice" and ref_doc.get("on_hold"):
frappe.throw(
_("{0} {1} is on hold").format(_(d.reference_doctype), d.reference_name),
title=_("Invalid Purchase Invoice"),
)
if ref_doc.docstatus != 1:
frappe.throw(
_("{0} {1} must be submitted").format(_(d.reference_doctype), d.reference_name)
)
def get_valid_reference_doctypes(self):
if self.party_type == "Customer":
return ("Sales Order", "Sales Invoice", "Journal Entry", "Dunning", "Payment Entry")
elif self.party_type in ["Shareholder", "Employee"]:
return ("Journal Entry",)
elif self.party_type == "Supplier":
return ("Purchase Order", "Purchase Invoice", "Journal Entry", "Payment Entry")
elif self.party_type == "Shareholder":
return ("Journal Entry",)
elif self.party_type == "Employee":
return ("Journal Entry",)
def validate_paid_invoices(self):
no_oustanding_refs = {}
@@ -693,37 +711,39 @@ class PaymentEntry(AccountsController):
invoice_paid_amount_map = {}
for ref in self.get("references"):
if ref.payment_term and ref.reference_name:
key = (ref.payment_term, ref.reference_name, ref.reference_doctype)
invoice_payment_amount_map.setdefault(key, 0.0)
invoice_payment_amount_map[key] += ref.allocated_amount
if not ref.payment_term or not ref.reference_name:
continue
if not invoice_paid_amount_map.get(key):
payment_schedule = frappe.get_all(
"Payment Schedule",
filters={"parent": ref.reference_name},
fields=[
"paid_amount",
"payment_amount",
"payment_term",
"discount",
"outstanding",
"discount_type",
],
)
for term in payment_schedule:
invoice_key = (term.payment_term, ref.reference_name, ref.reference_doctype)
invoice_paid_amount_map.setdefault(invoice_key, {})
invoice_paid_amount_map[invoice_key]["outstanding"] = term.outstanding
if not (term.discount_type and term.discount):
continue
key = (ref.payment_term, ref.reference_name, ref.reference_doctype)
invoice_payment_amount_map.setdefault(key, 0.0)
invoice_payment_amount_map[key] += ref.allocated_amount
if term.discount_type == "Percentage":
invoice_paid_amount_map[invoice_key]["discounted_amt"] = ref.total_amount * (
term.discount / 100
)
else:
invoice_paid_amount_map[invoice_key]["discounted_amt"] = term.discount
if not invoice_paid_amount_map.get(key):
payment_schedule = frappe.get_all(
"Payment Schedule",
filters={"parent": ref.reference_name},
fields=[
"paid_amount",
"payment_amount",
"payment_term",
"discount",
"outstanding",
"discount_type",
],
)
for term in payment_schedule:
invoice_key = (term.payment_term, ref.reference_name, ref.reference_doctype)
invoice_paid_amount_map.setdefault(invoice_key, {})
invoice_paid_amount_map[invoice_key]["outstanding"] = term.outstanding
if not (term.discount_type and term.discount):
continue
if term.discount_type == "Percentage":
invoice_paid_amount_map[invoice_key]["discounted_amt"] = ref.total_amount * (
term.discount / 100
)
else:
invoice_paid_amount_map[invoice_key]["discounted_amt"] = term.discount
for idx, (key, allocated_amount) in enumerate(invoice_payment_amount_map.items(), 1):
if not invoice_paid_amount_map.get(key):
@@ -736,16 +756,39 @@ class PaymentEntry(AccountsController):
outstanding = flt(invoice_paid_amount_map.get(key, {}).get("outstanding"))
discounted_amt = flt(invoice_paid_amount_map.get(key, {}).get("discounted_amt"))
conversion_rate = frappe.db.get_value(key[2], {"name": key[1]}, "conversion_rate")
base_paid_amount_precision = get_field_precision(
frappe.get_meta("Payment Schedule").get_field("base_paid_amount")
)
base_outstanding_precision = get_field_precision(
frappe.get_meta("Payment Schedule").get_field("base_outstanding")
)
base_paid_amount = flt(
(allocated_amount - discounted_amt) * conversion_rate, base_paid_amount_precision
)
base_outstanding = flt(allocated_amount * conversion_rate, base_outstanding_precision)
if cancel:
frappe.db.sql(
"""
UPDATE `tabPayment Schedule`
SET
paid_amount = `paid_amount` - %s,
base_paid_amount = `base_paid_amount` - %s,
discounted_amount = `discounted_amount` - %s,
outstanding = `outstanding` + %s
outstanding = `outstanding` + %s,
base_outstanding = `base_outstanding` - %s
WHERE parent = %s and payment_term = %s""",
(allocated_amount - discounted_amt, discounted_amt, allocated_amount, key[1], key[0]),
(
allocated_amount - discounted_amt,
base_paid_amount,
discounted_amt,
allocated_amount,
base_outstanding,
key[1],
key[0],
),
)
else:
if allocated_amount > outstanding:
@@ -761,10 +804,20 @@ class PaymentEntry(AccountsController):
UPDATE `tabPayment Schedule`
SET
paid_amount = `paid_amount` + %s,
base_paid_amount = `base_paid_amount` + %s,
discounted_amount = `discounted_amount` + %s,
outstanding = `outstanding` - %s
outstanding = `outstanding` - %s,
base_outstanding = `base_outstanding` - %s
WHERE parent = %s and payment_term = %s""",
(allocated_amount - discounted_amt, discounted_amt, allocated_amount, key[1], key[0]),
(
allocated_amount - discounted_amt,
base_paid_amount,
discounted_amt,
allocated_amount,
base_outstanding,
key[1],
key[0],
),
)
def get_allocated_amount_in_transaction_currency(
@@ -937,14 +990,14 @@ class PaymentEntry(AccountsController):
applicable_tax = 0
base_applicable_tax = 0
for tax in self.get("taxes"):
if not tax.included_in_paid_amount:
amount = -1 * tax.tax_amount if tax.add_deduct_tax == "Deduct" else tax.tax_amount
base_amount = (
-1 * tax.base_tax_amount if tax.add_deduct_tax == "Deduct" else tax.base_tax_amount
)
if tax.included_in_paid_amount:
continue
applicable_tax += amount
base_applicable_tax += base_amount
amount = -1 * tax.tax_amount if tax.add_deduct_tax == "Deduct" else tax.tax_amount
base_amount = -1 * tax.base_tax_amount if tax.add_deduct_tax == "Deduct" else tax.base_tax_amount
applicable_tax += amount
base_applicable_tax += base_amount
self.paid_amount_after_tax = flt(
flt(self.paid_amount) + flt(applicable_tax), self.precision("paid_amount_after_tax")
@@ -977,7 +1030,7 @@ class PaymentEntry(AccountsController):
def calculate_base_allocated_amount_for_reference(self, d) -> float:
base_allocated_amount = 0
if d.reference_doctype in frappe.get_hooks("advance_payment_doctypes"):
if d.reference_doctype in get_advance_payment_doctypes():
# When referencing Sales/Purchase Order, use the source/target exchange rate depending on payment type.
# This is so there are no Exchange Gain/Loss generated for such doctypes
@@ -1217,15 +1270,22 @@ class PaymentEntry(AccountsController):
self.set("remarks", "\n".join(remarks))
def set_transaction_currency_and_rate(self):
company_currency = erpnext.get_company_currency(self.company)
self.transaction_currency = company_currency
self.transaction_exchange_rate = 1
if self.paid_from_account_currency != company_currency:
self.transaction_currency = self.paid_from_account_currency
self.transaction_exchange_rate = self.source_exchange_rate
elif self.paid_to_account_currency != company_currency:
self.transaction_currency = self.paid_to_account_currency
self.transaction_exchange_rate = self.target_exchange_rate
def build_gl_map(self):
if self.payment_type in ("Receive", "Pay") and not self.get("party_account_field"):
self.setup_party_account_field()
company_currency = erpnext.get_company_currency(self.company)
if self.paid_from_account_currency != company_currency:
self.currency = self.paid_from_account_currency
elif self.paid_to_account_currency != company_currency:
self.currency = self.paid_to_account_currency
self.set_transaction_currency_and_rate()
gl_entries = []
self.add_party_gl_entries(gl_entries)
@@ -1250,8 +1310,7 @@ class PaymentEntry(AccountsController):
if not self.party_account:
return
advance_payment_doctypes = frappe.get_hooks("advance_payment_doctypes")
advance_payment_doctypes = get_advance_payment_doctypes()
if self.payment_type == "Receive":
against_account = self.paid_to
else:
@@ -1304,6 +1363,9 @@ class PaymentEntry(AccountsController):
"cost_center": cost_center,
dr_or_cr + "_in_account_currency": d.allocated_amount,
dr_or_cr: allocated_amount_in_company_currency,
dr_or_cr + "_in_transaction_currency": d.allocated_amount
if self.transaction_currency == self.party_account_currency
else allocated_amount_in_company_currency / self.transaction_exchange_rate,
},
item=self,
)
@@ -1348,6 +1410,9 @@ class PaymentEntry(AccountsController):
"account_currency": self.party_account_currency,
"cost_center": self.cost_center,
dr_or_cr + "_in_account_currency": self.unallocated_amount,
dr_or_cr + "_in_transaction_currency": self.unallocated_amount
if self.party_account_currency == self.transaction_currency
else base_unallocated_amount / self.transaction_exchange_rate,
dr_or_cr: base_unallocated_amount,
},
item=self,
@@ -1365,6 +1430,7 @@ class PaymentEntry(AccountsController):
def make_advance_gl_entries(
self, entry: object | dict = None, cancel: bool = 0, update_outstanding: str = "Yes"
):
self.set_transaction_currency_and_rate()
gl_entries = []
self.add_advance_gl_entries(gl_entries, entry)
@@ -1427,26 +1493,20 @@ class PaymentEntry(AccountsController):
else:
# For backwards compatibility
# Supporting reposting on payment entries reconciled before select field introduction
if self.advance_reconciliation_takes_effect_on == "Advance Payment Date":
posting_date = self.posting_date
elif self.advance_reconciliation_takes_effect_on == "Oldest Of Invoice Or Advance":
date_field = "posting_date"
if invoice.reference_doctype in ["Sales Order", "Purchase Order"]:
date_field = "transaction_date"
posting_date = frappe.db.get_value(
invoice.reference_doctype, invoice.reference_name, date_field
)
if getdate(posting_date) < getdate(self.posting_date):
posting_date = self.posting_date
elif self.advance_reconciliation_takes_effect_on == "Reconciliation Date":
posting_date = nowdate()
posting_date = get_reconciliation_effect_date(invoice, self.company, self.posting_date)
frappe.db.set_value("Payment Entry Reference", invoice.name, "reconcile_effect_on", posting_date)
dr_or_cr, account = self.get_dr_and_account_for_advances(invoice)
base_allocated_amount = self.calculate_base_allocated_amount_for_reference(invoice)
args_dict["account"] = account
args_dict[dr_or_cr] = self.calculate_base_allocated_amount_for_reference(invoice)
args_dict[dr_or_cr] = base_allocated_amount
args_dict[dr_or_cr + "_in_account_currency"] = invoice.allocated_amount
args_dict[dr_or_cr + "_in_transaction_currency"] = (
invoice.allocated_amount
if self.party_account_currency == self.transaction_currency
else base_allocated_amount / self.transaction_exchange_rate
)
args_dict.update(
{
"against_voucher_type": invoice.reference_doctype,
@@ -1464,8 +1524,13 @@ class PaymentEntry(AccountsController):
args_dict[dr_or_cr + "_in_account_currency"] = 0
dr_or_cr = "debit" if dr_or_cr == "credit" else "credit"
args_dict["account"] = self.party_account
args_dict[dr_or_cr] = self.calculate_base_allocated_amount_for_reference(invoice)
args_dict[dr_or_cr] = base_allocated_amount
args_dict[dr_or_cr + "_in_account_currency"] = invoice.allocated_amount
args_dict[dr_or_cr + "_in_transaction_currency"] = (
invoice.allocated_amount
if self.party_account_currency == self.transaction_currency
else base_allocated_amount / self.transaction_exchange_rate
)
args_dict.update(
{
"against_voucher_type": "Payment Entry",
@@ -1487,6 +1552,9 @@ class PaymentEntry(AccountsController):
"account_currency": self.paid_from_account_currency,
"against": self.party if self.payment_type == "Pay" else self.paid_to,
"credit_in_account_currency": self.paid_amount,
"credit_in_transaction_currency": self.paid_amount
if self.paid_from_account_currency == self.transaction_currency
else self.base_paid_amount / self.transaction_exchange_rate,
"credit": self.base_paid_amount,
"cost_center": self.cost_center,
"post_net_value": True,
@@ -1502,6 +1570,9 @@ class PaymentEntry(AccountsController):
"account_currency": self.paid_to_account_currency,
"against": self.party if self.payment_type == "Receive" else self.paid_from,
"debit_in_account_currency": self.received_amount,
"debit_in_transaction_currency": self.received_amount
if self.paid_to_account_currency == self.transaction_currency
else self.base_received_amount / self.transaction_exchange_rate,
"debit": self.base_received_amount,
"cost_center": self.cost_center,
},
@@ -1537,6 +1608,8 @@ class PaymentEntry(AccountsController):
dr_or_cr + "_in_account_currency": base_tax_amount
if account_currency == self.company_currency
else d.tax_amount,
dr_or_cr + "_in_transaction_currency": base_tax_amount
/ self.transaction_exchange_rate,
"cost_center": d.cost_center,
"post_net_value": True,
},
@@ -1562,6 +1635,8 @@ class PaymentEntry(AccountsController):
rev_dr_or_cr + "_in_account_currency": base_tax_amount
if account_currency == self.company_currency
else d.tax_amount,
rev_dr_or_cr + "_in_transaction_currency": base_tax_amount
/ self.transaction_exchange_rate,
"cost_center": self.cost_center,
"post_net_value": True,
},
@@ -1572,24 +1647,27 @@ class PaymentEntry(AccountsController):
def add_deductions_gl_entries(self, gl_entries):
for d in self.get("deductions"):
if d.amount:
account_currency = get_account_currency(d.account)
if account_currency != self.company_currency:
frappe.throw(_("Currency for {0} must be {1}").format(d.account, self.company_currency))
if not d.amount:
continue
gl_entries.append(
self.get_gl_dict(
{
"account": d.account,
"account_currency": account_currency,
"against": self.party or self.paid_from,
"debit_in_account_currency": d.amount,
"debit": d.amount,
"cost_center": d.cost_center,
},
item=d,
)
account_currency = get_account_currency(d.account)
if account_currency != self.company_currency:
frappe.throw(_("Currency for {0} must be {1}").format(d.account, self.company_currency))
gl_entries.append(
self.get_gl_dict(
{
"account": d.account,
"account_currency": account_currency,
"against": self.party or self.paid_from,
"debit_in_account_currency": d.amount,
"debit_in_transaction_currency": d.amount / self.transaction_exchange_rate,
"debit": d.amount,
"cost_center": d.cost_center,
},
item=d,
)
)
def get_party_account_for_taxes(self):
if self.payment_type == "Receive":
@@ -1606,12 +1684,15 @@ class PaymentEntry(AccountsController):
return flt(gl_dict.get(field, 0) / (conversion_rate or 1))
def update_advance_paid(self):
if self.payment_type in ("Receive", "Pay") and self.party:
for d in self.get("references"):
if d.allocated_amount and d.reference_doctype in frappe.get_hooks("advance_payment_doctypes"):
frappe.get_doc(
d.reference_doctype, d.reference_name, for_update=True
).set_total_advance_paid()
if self.payment_type not in ("Receive", "Pay") or not self.party:
return
advance_payment_doctypes = get_advance_payment_doctypes()
for d in self.get("references"):
if d.allocated_amount and d.reference_doctype in advance_payment_doctypes:
frappe.get_doc(
d.reference_doctype, d.reference_name, for_update=True
).set_total_advance_paid()
def on_recurring(self, reference_doc, auto_repeat_doc):
self.reference_no = reference_doc.name
@@ -1904,7 +1985,7 @@ class PaymentEntry(AccountsController):
# Re allocate amount to those references which have PR set (Higher priority)
for ref in self.references:
if not ref.payment_request:
if not (ref.reference_doctype and ref.reference_name and ref.payment_request):
continue
# fetch outstanding_amount of `Reference` (Payment Term) and `Payment Request` to allocate new amount
@@ -1955,7 +2036,7 @@ class PaymentEntry(AccountsController):
)
# Re allocate amount to those references which have no PR (Lower priority)
for ref in self.references:
if ref.payment_request:
if ref.payment_request or not (ref.reference_doctype and ref.reference_name):
continue
key = (ref.reference_doctype, ref.reference_name, ref.get("payment_term"))
@@ -2271,7 +2352,7 @@ def get_outstanding_reference_documents(args, validate=False):
accounts = get_party_account(
args.get("party_type"), args.get("party"), args.get("company"), include_advance=True
)
advance_account = accounts[1] if len(accounts) >= 1 else None
advance_account = accounts[1] if len(accounts) > 1 else None
if party_account == advance_account:
party_account = accounts[0]
@@ -2842,7 +2923,7 @@ def get_payment_entry(
pe.party_type = party_type
pe.party = doc.get(scrub(party_type))
pe.contact_person = doc.get("contact_person")
pe.contact_email = doc.get("contact_email")
complete_contact_details(pe)
pe.ensure_supplier_is_not_blocked()
pe.paid_from = party_account if payment_type == "Receive" else bank.account
@@ -2851,10 +2932,14 @@ def get_payment_entry(
party_account_currency if payment_type == "Receive" else bank.account_currency
)
pe.paid_to_account_currency = party_account_currency if payment_type == "Pay" else bank.account_currency
pe.paid_from_account_type = frappe.db.get_value("Account", pe.paid_from, "account_type")
pe.paid_to_account_type = frappe.db.get_value("Account", pe.paid_to, "account_type")
pe.paid_amount = paid_amount
pe.received_amount = received_amount
pe.letter_head = doc.get("letter_head")
pe.bank_account = frappe.db.get_value("Bank Account", {"is_company_account": 1, "is_default": 1}, "name")
pe.bank_account = frappe.db.get_value(
"Bank Account", {"is_company_account": 1, "is_default": 1, "company": doc.company}, "name"
)
if dt in ["Purchase Order", "Sales Order", "Sales Invoice", "Purchase Invoice"]:
pe.project = doc.get("project") or reduce(
@@ -3208,26 +3293,25 @@ def set_paid_amount_and_received_amount(
if party_account_currency == bank.account_currency:
paid_amount = received_amount = abs(outstanding_amount)
else:
company_currency = frappe.get_cached_value("Company", doc.get("company"), "default_currency")
if payment_type == "Receive":
paid_amount = abs(outstanding_amount)
if bank_amount:
received_amount = bank_amount
else:
if bank and company_currency != bank.account_currency:
received_amount = paid_amount / doc.get("conversion_rate", 1)
else:
received_amount = paid_amount * doc.get("conversion_rate", 1)
# settings if it is for receive
paid_amount = abs(outstanding_amount)
if bank_amount:
received_amount = bank_amount
else:
received_amount = abs(outstanding_amount)
if bank_amount:
paid_amount = bank_amount
company_currency = frappe.get_cached_value("Company", doc.get("company"), "default_currency")
if bank and company_currency != bank.account_currency:
# doc currency can be different from bank currency
posting_date = doc.get("posting_date") or doc.get("transaction_date")
conversion_rate = get_exchange_rate(
bank.account_currency, party_account_currency, posting_date
)
received_amount = paid_amount / conversion_rate
else:
if bank and company_currency != bank.account_currency:
paid_amount = received_amount / doc.get("conversion_rate", 1)
else:
# if party account currency and bank currency is different then populate paid amount as well
paid_amount = received_amount * doc.get("conversion_rate", 1)
received_amount = paid_amount * doc.get("conversion_rate", 1)
# if payment type is pay, then paid amount and received amount are swapped
if payment_type == "Pay":
paid_amount, received_amount = received_amount, paid_amount
return paid_amount, received_amount

View File

@@ -49,6 +49,8 @@ class TestPaymentEntry(FrappeTestCase):
pe.insert()
pe.submit()
self.assertEqual(pe.paid_to_account_type, "Cash")
expected_gle = dict(
(d[0], d) for d in [["Debtors - _TC", 0, 1000, so.name], ["_Test Cash - _TC", 1000.0, 0, None]]
)
@@ -560,6 +562,8 @@ class TestPaymentEntry(FrappeTestCase):
pe.insert()
pe.submit()
self.assertEqual(pe.paid_from_account_type, "Bank")
outstanding_amount, status = frappe.db.get_value(
"Purchase Invoice", pi.name, ["outstanding_amount", "status"]
)

View File

@@ -589,7 +589,7 @@ class PaymentReconciliation(Document):
def check_mandatory_to_fetch(self):
for fieldname in ["company", "party_type", "party", "receivable_payable_account"]:
if not self.get(fieldname):
frappe.throw(_("Please select {0} first").format(self.meta.get_label(fieldname)))
frappe.throw(_("Please select {0} first").format(_(self.meta.get_label(fieldname))))
def validate_entries(self):
if not self.get("invoices"):
@@ -826,7 +826,7 @@ def reconcile_dr_cr_note(dr_cr_notes, company, active_dimensions=None):
create_gain_loss_journal(
company,
today(),
inv.difference_posting_date,
inv.party_type,
inv.party,
inv.account,

View File

@@ -1,9 +1,9 @@
import json
import frappe
from frappe import _, qb
from frappe import _
from frappe.model.document import Document
from frappe.query_builder.functions import Abs, Sum
from frappe.query_builder.functions import Sum
from frappe.utils import flt, nowdate
from frappe.utils.background_jobs import enqueue
@@ -12,7 +12,6 @@ from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
get_accounting_dimensions,
)
from erpnext.accounts.doctype.payment_entry.payment_entry import (
get_company_defaults,
get_payment_entry,
)
from erpnext.accounts.doctype.subscription_plan.subscription_plan import get_plan_rate
@@ -120,13 +119,13 @@ class PaymentRequest(Document):
title=_("Invalid Amount"),
)
existing_payment_request_amount = flt(
get_existing_payment_request_amount(self.reference_doctype, self.reference_name)
)
ref_doc = frappe.get_doc(self.reference_doctype, self.reference_name)
if not hasattr(ref_doc, "order_type") or ref_doc.order_type != "Shopping Cart":
ref_amount = get_amount(ref_doc, self.payment_account)
if not ref_amount:
frappe.throw(_("Payment Entry is already created"))
existing_payment_request_amount = flt(get_existing_payment_request_amount(ref_doc))
if existing_payment_request_amount + flt(self.grand_total) > ref_amount:
frappe.throw(
@@ -544,6 +543,8 @@ def make_payment_request(**args):
gateway_account = get_gateway_details(args) or frappe._dict()
grand_total = get_amount(ref_doc, gateway_account.get("payment_account"))
if not grand_total:
frappe.throw(_("Payment Entry is already created"))
if args.loyalty_points and args.dt == "Sales Order":
from erpnext.accounts.doctype.loyalty_program.loyalty_program import validate_loyalty_points
@@ -554,19 +555,8 @@ def make_payment_request(**args):
frappe.db.set_value("Sales Order", args.dn, "loyalty_amount", loyalty_amount, update_modified=False)
grand_total = grand_total - loyalty_amount
bank_account = (
get_party_bank_account(args.get("party_type"), args.get("party")) if args.get("party_type") else ""
)
draft_payment_request = frappe.db.get_value(
"Payment Request",
{"reference_doctype": args.dt, "reference_name": args.dn, "docstatus": 0},
)
# fetches existing payment request `grand_total` amount
existing_payment_request_amount = get_existing_payment_request_amount(ref_doc.doctype, ref_doc.name)
existing_paid_amount = get_existing_paid_amount(ref_doc.doctype, ref_doc.name)
existing_payment_request_amount = get_existing_payment_request_amount(ref_doc)
def validate_and_calculate_grand_total(grand_total, existing_payment_request_amount):
grand_total -= existing_payment_request_amount
@@ -578,7 +568,7 @@ def make_payment_request(**args):
if args.order_type == "Shopping Cart":
# If Payment Request is in an advanced stage, then create for remaining amount.
if get_existing_payment_request_amount(
ref_doc.doctype, ref_doc.name, ["Initiated", "Partially Paid", "Payment Ordered", "Paid"]
ref_doc, ["Initiated", "Partially Paid", "Payment Ordered", "Paid"]
):
grand_total = validate_and_calculate_grand_total(grand_total, existing_payment_request_amount)
else:
@@ -587,14 +577,10 @@ def make_payment_request(**args):
else:
grand_total = validate_and_calculate_grand_total(grand_total, existing_payment_request_amount)
if existing_paid_amount:
if ref_doc.party_account_currency == ref_doc.currency:
if ref_doc.conversion_rate:
grand_total -= flt(existing_paid_amount / ref_doc.conversion_rate)
else:
grand_total -= flt(existing_paid_amount)
else:
grand_total -= flt(existing_paid_amount / ref_doc.conversion_rate)
draft_payment_request = frappe.db.get_value(
"Payment Request",
{"reference_doctype": ref_doc.doctype, "reference_name": ref_doc.name, "docstatus": 0},
)
if draft_payment_request:
frappe.db.set_value(
@@ -602,6 +588,11 @@ def make_payment_request(**args):
)
pr = frappe.get_doc("Payment Request", draft_payment_request)
else:
bank_account = (
get_party_bank_account(args.get("party_type"), args.get("party"))
if args.get("party_type")
else ""
)
pr = frappe.new_doc("Payment Request")
if not args.get("payment_request_type"):
@@ -675,22 +666,40 @@ def make_payment_request(**args):
def get_amount(ref_doc, payment_account=None):
"""get amount based on doctype"""
grand_total = 0
dt = ref_doc.doctype
if dt in ["Sales Order", "Purchase Order"]:
grand_total = flt(ref_doc.rounded_total) or flt(ref_doc.grand_total)
advance_amount = flt(ref_doc.advance_paid)
if ref_doc.party_account_currency != ref_doc.currency:
advance_amount = flt(flt(ref_doc.advance_paid) / ref_doc.conversion_rate)
grand_total = (flt(ref_doc.rounded_total) or flt(ref_doc.grand_total)) - advance_amount
elif dt in ["Sales Invoice", "Purchase Invoice"]:
if not ref_doc.get("is_pos"):
if (
dt == "Sales Invoice"
and ref_doc.is_pos
and ref_doc.payments
and any(
[
payment.type == "Phone" and payment.account == payment_account
for payment in ref_doc.payments
]
)
):
grand_total = sum(
[
payment.amount
for payment in ref_doc.payments
if payment.type == "Phone" and payment.account == payment_account
]
)
else:
if ref_doc.party_account_currency == ref_doc.currency:
grand_total = flt(ref_doc.rounded_total or ref_doc.grand_total)
grand_total = flt(ref_doc.outstanding_amount)
else:
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:
grand_total = pay.amount
break
grand_total = flt(flt(ref_doc.outstanding_amount) / ref_doc.conversion_rate)
elif dt == "POS Invoice":
for pay in ref_doc.payments:
if pay.type == "Phone" and pay.account == payment_account:
@@ -699,10 +708,7 @@ def get_amount(ref_doc, payment_account=None):
elif dt == "Fees":
grand_total = ref_doc.outstanding_amount
if grand_total > 0:
return flt(grand_total, get_currency_precision())
else:
frappe.throw(_("Payment Entry is already created"))
return flt(grand_total, get_currency_precision()) if grand_total > 0 else 0
def get_irequest_status(payment_requests: None | list = None) -> list:
@@ -745,7 +751,7 @@ def cancel_old_payment_requests(ref_dt, ref_dn):
frappe.db.set_value("Integration Request", ireq.name, "status", "Cancelled")
def get_existing_payment_request_amount(ref_dt, ref_dn, statuses: list | None = None) -> list:
def get_existing_payment_request_amount(ref_doc, statuses: list | None = None) -> list:
"""
Return the total amount of Payment Requests against a reference document.
"""
@@ -753,9 +759,9 @@ def get_existing_payment_request_amount(ref_dt, ref_dn, statuses: list | None =
query = (
frappe.qb.from_(PR)
.select(Sum(PR.grand_total))
.where(PR.reference_doctype == ref_dt)
.where(PR.reference_name == ref_dn)
.select(Sum(PR.outstanding_amount))
.where(PR.reference_doctype == ref_doc.doctype)
.where(PR.reference_name == ref_doc.name)
.where(PR.docstatus == 1)
)
@@ -764,43 +770,12 @@ def get_existing_payment_request_amount(ref_dt, ref_dn, statuses: list | None =
response = query.run()
return response[0][0] if response[0] else 0
os_amount_in_transaction_currency = flt(response[0][0] if response[0] else 0)
if ref_doc.currency != ref_doc.party_account_currency:
os_amount_in_transaction_currency = flt(os_amount_in_transaction_currency / ref_doc.conversion_rate)
def get_existing_paid_amount(doctype, name):
PLE = frappe.qb.DocType("Payment Ledger Entry")
PER = frappe.qb.DocType("Payment Entry Reference")
query = (
frappe.qb.from_(PLE)
.left_join(PER)
.on(
(PLE.against_voucher_type == PER.reference_doctype)
& (PLE.against_voucher_no == PER.reference_name)
& (PLE.voucher_type == PER.parenttype)
& (PLE.voucher_no == PER.parent)
)
.select(
Abs(Sum(PLE.amount)).as_("total_amount"),
Abs(Sum(frappe.qb.terms.Case().when(PER.payment_request.isnotnull(), PLE.amount).else_(0))).as_(
"request_paid_amount"
),
)
.where(
(PLE.voucher_type.isin([doctype, "Journal Entry", "Payment Entry"]))
& (PLE.against_voucher_type == doctype)
& (PLE.against_voucher_no == name)
& (PLE.delinked == 0)
& (PLE.docstatus == 1)
& (PLE.amount < 0)
)
)
result = query.run()
ledger_amount = flt(result[0][0]) if result else 0
request_paid_amount = flt(result[0][1]) if result else 0
return ledger_amount - request_paid_amount
return os_amount_in_transaction_currency
def get_gateway_details(args): # nosemgrep
@@ -854,8 +829,7 @@ def update_payment_requests_as_per_pe_references(references=None, cancel=False):
if not references:
return
precision = references[0].precision("allocated_amount")
precision = frappe.get_precision("Payment Entry Reference", "allocated_amount")
referenced_payment_requests = frappe.get_all(
"Payment Request",
filters={"name": ["in", {row.payment_request for row in references if row.payment_request}]},

View File

@@ -313,6 +313,16 @@ class TestPaymentRequest(FrappeTestCase):
self.assertEqual(pr.outstanding_amount, 800)
self.assertEqual(pr.grand_total, 1000)
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,
)
# complete payment
pe = pr.create_payment_entry()
@@ -331,7 +341,7 @@ class TestPaymentRequest(FrappeTestCase):
# creating a more payment Request must not allowed
self.assertRaisesRegex(
frappe.exceptions.ValidationError,
re.compile(r"Payment Request is already created"),
re.compile(r"Payment Entry is already created"),
make_payment_request,
dt="Sales Order",
dn=so.name,
@@ -361,6 +371,17 @@ class TestPaymentRequest(FrappeTestCase):
self.assertEqual(pr.party_account_currency, "INR")
self.assertEqual(pr.status, "Initiated")
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,
)
# to make partial payment
pe = pr.create_payment_entry(submit=False)
pe.paid_amount = 2000
@@ -389,7 +410,7 @@ class TestPaymentRequest(FrappeTestCase):
# creating a more payment Request must not allowed
self.assertRaisesRegex(
frappe.exceptions.ValidationError,
re.compile(r"Payment Request is already created"),
re.compile(r"Payment Entry is already created"),
make_payment_request,
dt="Purchase Invoice",
dn=pi.name,
@@ -609,29 +630,58 @@ class TestPaymentRequest(FrappeTestCase):
pr = make_payment_request(dt="Sales Invoice", dn=si.name, mute_email=1)
self.assertEqual(pr.grand_total, si.outstanding_amount)
def test_partial_paid_invoice_with_submitted_payment_entry(self):
pi = make_purchase_invoice(currency="INR", qty=1, rate=5000)
pi.save()
pi.submit()
def test_partial_paid_invoice_with_submitted_payment_entry(self):
pi = make_purchase_invoice(currency="INR", qty=1, rate=5000)
pi.save()
pi.submit()
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Bank - _TC")
pe.reference_no = "PURINV0001"
pe.reference_date = frappe.utils.nowdate()
pe.paid_amount = 2500
pe.references[0].allocated_amount = 2500
pe.save()
pe.submit()
pe.cancel()
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Bank - _TC")
pe.reference_no = "PURINV0001"
pe.reference_date = frappe.utils.nowdate()
pe.paid_amount = 2500
pe.references[0].allocated_amount = 2500
pe.save()
pe.submit()
pe.cancel()
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Bank - _TC")
pe.reference_no = "PURINV0002"
pe.reference_date = frappe.utils.nowdate()
pe.paid_amount = 2500
pe.references[0].allocated_amount = 2500
pe.save()
pe.submit()
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Bank - _TC")
pe.reference_no = "PURINV0002"
pe.reference_date = frappe.utils.nowdate()
pe.paid_amount = 2500
pe.references[0].allocated_amount = 2500
pe.save()
pe.submit()
pi.load_from_db()
pr = make_payment_request(dt="Purchase Invoice", dn=pi.name, mute_email=1)
self.assertEqual(pr.grand_total, pi.outstanding_amount)
pi.load_from_db()
pr = make_payment_request(dt="Purchase Invoice", dn=pi.name, mute_email=1)
self.assertEqual(pr.grand_total, pi.outstanding_amount)
def test_payment_request_on_unreconcile(self):
pi = make_purchase_invoice(currency="INR", qty=1, rate=500)
pi.submit()
pr = make_payment_request(
dt=pi.doctype,
dn=pi.name,
mute_email=1,
submit_doc=True,
return_doc=True,
)
self.assertEqual(pr.grand_total, pi.outstanding_amount)
pe = pr.create_payment_entry()
unreconcile = frappe.get_doc(
{
"doctype": "Unreconcile Payment",
"company": pe.company,
"voucher_type": pe.doctype,
"voucher_no": pe.name,
}
)
unreconcile.add_references()
unreconcile.submit()
pi.load_from_db()
pr.load_from_db()
self.assertEqual(pr.grand_total, pi.outstanding_amount)

View File

@@ -24,7 +24,9 @@
"paid_amount",
"discounted_amount",
"column_break_3",
"base_payment_amount"
"base_payment_amount",
"base_outstanding",
"base_paid_amount"
],
"fields": [
{
@@ -155,19 +157,35 @@
"fieldtype": "Currency",
"label": "Payment Amount (Company Currency)",
"options": "Company:company:default_currency"
},
{
"fieldname": "base_outstanding",
"fieldtype": "Currency",
"label": "Outstanding (Company Currency)",
"options": "Company:company:default_currency",
"read_only": 1
},
{
"depends_on": "base_paid_amount",
"fieldname": "base_paid_amount",
"fieldtype": "Currency",
"label": "Paid Amount (Company Currency)",
"options": "Company:company:default_currency",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2022-09-16 13:57:06.382859",
"modified": "2025-03-11 11:06:51.792982",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Schedule",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"sort_field": "modified",
"row_format": "Dynamic",
"sort_field": "creation",
"sort_order": "DESC",
"states": [],
"track_changes": 1

View File

@@ -14,6 +14,8 @@ class PaymentSchedule(Document):
if TYPE_CHECKING:
from frappe.types import DF
base_outstanding: DF.Currency
base_paid_amount: DF.Currency
base_payment_amount: DF.Currency
description: DF.SmallText | None
discount: DF.Float

View File

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

View File

@@ -0,0 +1,47 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2025-05-30 11:47:03.670913",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"pegged_currencies_item_section",
"pegged_currency_item"
],
"fields": [
{
"fieldname": "pegged_currencies_item_section",
"fieldtype": "Section Break"
},
{
"fieldname": "pegged_currency_item",
"fieldtype": "Table",
"options": "Pegged Currency Details"
}
],
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2025-06-02 11:46:31.936714",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pegged Currencies",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"print": 1,
"read": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"row_format": "Dynamic",
"sort_field": "creation",
"sort_order": "DESC",
"states": []
}

View File

@@ -0,0 +1,22 @@
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class PeggedCurrencies(Document):
# begin: auto-generated types
# This code is auto-generated. Do not modify anything in this block.
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from frappe.types import DF
from erpnext.accounts.doctype.pegged_currencies.pegged_currencies import PeggedCurrencies
pegged_currency_item: DF.Table[PeggedCurrencies]
# end: auto-generated types
pass

View File

@@ -0,0 +1,9 @@
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe
from frappe.tests.utils import FrappeTestCase
class TestPeggedCurrencies(FrappeTestCase):
pass

View File

@@ -0,0 +1,49 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2025-05-30 11:59:28.219277",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"source_currency",
"pegged_against",
"pegged_exchange_rate"
],
"fields": [
{
"fieldname": "source_currency",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Currency",
"options": "Currency"
},
{
"fieldname": "pegged_exchange_rate",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Exchange Rate"
},
{
"fieldname": "pegged_against",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Pegged Against",
"options": "Currency"
}
],
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2025-06-17 14:11:16.521193",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pegged Currency Details",
"owner": "Administrator",
"permissions": [],
"row_format": "Dynamic",
"sort_field": "creation",
"sort_order": "DESC",
"states": []
}

View File

@@ -0,0 +1,25 @@
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class PeggedCurrencyDetails(Document):
# begin: auto-generated types
# This code is auto-generated. Do not modify anything in this block.
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from frappe.types import DF
parent: DF.Data
parentfield: DF.Data
parenttype: DF.Data
pegged_against: DF.Link | None
pegged_exchange_rate: DF.Data | None
source_currency: DF.Link | None
# end: auto-generated types
pass

View File

@@ -47,7 +47,7 @@ frappe.ui.form.on("Period Closing Voucher", {
from_date: frm.doc.posting_date,
to_date: moment(frm.doc.modified).format("YYYY-MM-DD"),
company: frm.doc.company,
group_by: "",
categorize_by: "",
show_cancelled_entries: frm.doc.docstatus === 2,
};
frappe.set_route("query-report", "General Ledger");

View File

@@ -133,13 +133,18 @@ class PeriodClosingVoucher(AccountsController):
self.make_gl_entries()
def on_cancel(self):
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry", "Payment Ledger Entry")
self.ignore_linked_doctypes = (
"GL Entry",
"Stock Ledger Entry",
"Payment Ledger Entry",
"Account Closing Balance",
)
self.block_if_future_closing_voucher_exists()
self.db_set("gle_processing_status", "In Progress")
self.cancel_gl_entries()
def make_gl_entries(self):
if self.get_gle_count_in_selected_period() > 5000:
if frappe.db.estimate_count("GL Entry") > 100_000:
frappe.enqueue(
process_gl_and_closing_entries,
doc=self,
@@ -154,16 +159,6 @@ class PeriodClosingVoucher(AccountsController):
else:
process_gl_and_closing_entries(self)
def get_gle_count_in_selected_period(self):
return frappe.db.count(
"GL Entry",
{
"posting_date": ["between", [self.period_start_date, self.period_end_date]],
"company": self.company,
"is_cancelled": 0,
},
)
def get_pcv_gl_entries(self):
self.pl_accounts_reverse_gle = []
self.closing_account_gle = []
@@ -215,8 +210,10 @@ class PeriodClosingVoucher(AccountsController):
return gl_entry
def get_gle_for_closing_account(self, dimension_balance, dimensions):
balance_in_account_currency = flt(dimension_balance.balance_in_account_currency)
balance_in_company_currency = flt(dimension_balance.balance_in_company_currency)
debit = balance_in_company_currency if balance_in_company_currency > 0 else 0
credit = abs(balance_in_company_currency) if balance_in_company_currency < 0 else 0
gl_entry = frappe._dict(
{
"company": self.company,
@@ -225,14 +222,10 @@ class PeriodClosingVoucher(AccountsController):
"account_currency": frappe.db.get_value(
"Account", self.closing_account_head, "account_currency"
),
"debit_in_account_currency": balance_in_account_currency
if balance_in_account_currency > 0
else 0,
"debit": balance_in_company_currency if balance_in_company_currency > 0 else 0,
"credit_in_account_currency": abs(balance_in_account_currency)
if balance_in_account_currency < 0
else 0,
"credit": abs(balance_in_company_currency) if balance_in_company_currency < 0 else 0,
"debit_in_account_currency": debit,
"debit": debit,
"credit_in_account_currency": credit,
"credit": credit,
"is_period_closing_voucher_entry": 1,
"voucher_type": "Period Closing Voucher",
"voucher_no": self.name,

View File

@@ -27,6 +27,7 @@ class TestPeriodClosingVoucher(unittest.TestCase):
account1="Cash - TPC",
account2="Sales - TPC",
cost_center=cost_center,
company=company,
save=False,
)
jv1.company = company
@@ -39,6 +40,7 @@ class TestPeriodClosingVoucher(unittest.TestCase):
account1="Cost of Goods Sold - TPC",
account2="Cash - TPC",
cost_center=cost_center,
company=company,
save=False,
)
jv2.company = company
@@ -156,6 +158,7 @@ class TestPeriodClosingVoucher(unittest.TestCase):
amount=400,
cost_center=cost_center,
posting_date="2021-03-15",
company=company,
)
jv.company = company
jv.finance_book = create_finance_book().name
@@ -198,6 +201,7 @@ class TestPeriodClosingVoucher(unittest.TestCase):
account1="Cash - TPC",
account2="Sales - TPC",
cost_center=cost_center,
company=company,
save=False,
)
jv1.company = company
@@ -220,6 +224,7 @@ class TestPeriodClosingVoucher(unittest.TestCase):
account1="Cash - TPC",
account2="Sales - TPC",
cost_center=cost_center1,
company=company,
save=False,
)
jv1.company = company
@@ -232,6 +237,7 @@ class TestPeriodClosingVoucher(unittest.TestCase):
account1="Cash - TPC",
account2="Sales - TPC",
cost_center=cost_center2,
company=company,
save=False,
)
jv2.company = company
@@ -261,6 +267,7 @@ class TestPeriodClosingVoucher(unittest.TestCase):
account1="Cash - TPC",
account2="Sales - TPC",
cost_center=cost_center2,
company=company,
save=False,
)

View File

@@ -124,6 +124,11 @@ class POSClosingEntry(StatusUpdater):
def on_submit(self):
consolidate_pos_invoices(closing_entry=self)
frappe.publish_realtime(
f"poe_{self.pos_opening_entry}_closed",
self,
docname=f"POS Opening Entry/{self.pos_opening_entry}",
)
def on_cancel(self):
unconsolidate_pos_invoices(closing_entry=self)

View File

@@ -323,3 +323,15 @@ frappe.ui.form.on("POS Invoice", {
});
},
});
frappe.ui.form.on("Sales Invoice Payment", {
mode_of_payment: function (frm) {
frappe.call({
doc: frm.doc,
method: "set_account_for_mode_of_payment",
callback: function (r) {
refresh_field("payments");
},
});
},
});

View File

@@ -1443,6 +1443,8 @@
"width": "50%"
},
{
"fetch_from": "sales_partner.commission_rate",
"fetch_if_empty": 1,
"fieldname": "commission_rate",
"fieldtype": "Float",
"label": "Commission Rate (%)",
@@ -1571,7 +1573,7 @@
"icon": "fa fa-file-text",
"is_submittable": 1,
"links": [],
"modified": "2024-11-26 13:10:50.309570",
"modified": "2025-07-17 16:51:40.886083",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice",

View File

@@ -196,6 +196,7 @@ class POSInvoice(SalesInvoice):
# run on validate method of selling controller
super(SalesInvoice, self).validate()
self.validate_pos_opening_entry()
self.validate_auto_set_posting_time()
self.validate_mode_of_payment()
self.validate_uom_is_integer("stock_uom", "stock_qty")
@@ -272,6 +273,8 @@ class POSInvoice(SalesInvoice):
against_psi_doc.delete_loyalty_point_entry()
against_psi_doc.make_loyalty_point_entry()
self.db_set("status", "Cancelled")
if self.coupon_code:
from erpnext.accounts.doctype.pricing_rule.utils import update_coupon_code_count
@@ -320,6 +323,18 @@ class POSInvoice(SalesInvoice):
_("Payment related to {0} is not completed").format(pay.mode_of_payment)
)
def validate_pos_opening_entry(self):
opening_entries = frappe.get_list(
"POS Opening Entry", filters={"pos_profile": self.pos_profile, "status": "Open", "docstatus": 1}
)
if len(opening_entries) == 0:
frappe.throw(
title=_("POS Opening Entry Missing"),
msg=_("No open POS Opening Entry found for POS Profile {0}.").format(
frappe.bold(self.pos_profile)
),
)
def validate_stock_availablility(self):
if self.is_return:
return
@@ -484,8 +499,11 @@ class POSInvoice(SalesInvoice):
def validate_full_payment(self):
invoice_total = flt(self.rounded_total) or flt(self.grand_total)
is_partial_payment_allowed = frappe.db.get_value(
"POS Profile", self.pos_profile, "allow_partial_payment"
)
if self.docstatus == 1:
if self.docstatus == 1 and not is_partial_payment_allowed:
if self.is_return and self.paid_amount != invoice_total:
frappe.throw(
msg=_("Partial Payment in POS Invoice is not allowed."), exc=PartialPaymentValidationError

View File

@@ -7,6 +7,9 @@ import unittest
import frappe
from frappe import _
from erpnext.accounts.doctype.mode_of_payment.test_mode_of_payment import (
set_default_account_for_mode_of_payment,
)
from erpnext.accounts.doctype.pos_invoice.pos_invoice import PartialPaymentValidationError, make_sales_return
from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
@@ -26,6 +29,14 @@ class TestPOSInvoice(unittest.TestCase):
make_stock_entry(target="_Test Warehouse - _TC", item_code="_Test Item", qty=800, basic_rate=100)
frappe.db.sql("delete from `tabTax Rule`")
from erpnext.accounts.doctype.pos_closing_entry.test_pos_closing_entry import init_user_and_profile
from erpnext.accounts.doctype.pos_opening_entry.test_pos_opening_entry import create_opening_entry
cls.test_user, cls.pos_profile = init_user_and_profile()
create_opening_entry(cls.pos_profile, cls.test_user)
mode_of_payment = frappe.get_doc("Mode of Payment", "Bank Draft")
set_default_account_for_mode_of_payment(mode_of_payment, "_Test Company", "_Test Bank - _TC")
def tearDown(self):
if frappe.session.user != "Administrator":
frappe.set_user("Administrator")
@@ -227,12 +238,8 @@ class TestPOSInvoice(unittest.TestCase):
pos = create_pos_invoice(qty=10, do_not_save=True)
pos.set("payments", [])
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, "default": 1}
)
pos.append("payments", {"mode_of_payment": "Bank Draft", "amount": 500})
pos.append("payments", {"mode_of_payment": "Cash", "amount": 500, "default": 1})
pos.insert()
pos.submit()
@@ -270,9 +277,7 @@ class TestPOSInvoice(unittest.TestCase):
do_not_save=1,
)
pos.append(
"payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 1000, "default": 1}
)
pos.append("payments", {"mode_of_payment": "Cash", "amount": 1000, "default": 1})
pos.insert()
pos.submit()
@@ -312,9 +317,7 @@ class TestPOSInvoice(unittest.TestCase):
do_not_save=1,
)
pos.append(
"payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 2000, "default": 1}
)
pos.append("payments", {"mode_of_payment": "Cash", "amount": 2000, "default": 1})
pos.insert()
pos.submit()
@@ -325,9 +328,7 @@ class TestPOSInvoice(unittest.TestCase):
# partial return 1
pos_return1.get("items")[0].qty = -1
pos_return1.set("payments", [])
pos_return1.append(
"payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": -1000, "default": 1}
)
pos_return1.append("payments", {"mode_of_payment": "Cash", "amount": -1000, "default": 1})
pos_return1.paid_amount = -1000
pos_return1.submit()
pos_return1.reload()
@@ -344,9 +345,7 @@ class TestPOSInvoice(unittest.TestCase):
# partial return 2
pos_return2 = make_sales_return(pos.name)
pos_return2.set("payments", [])
pos_return2.append(
"payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": -1000, "default": 1}
)
pos_return2.append("payments", {"mode_of_payment": "Cash", "amount": -1000, "default": 1})
pos_return2.paid_amount = -1000
pos_return2.submit()
@@ -366,10 +365,8 @@ class TestPOSInvoice(unittest.TestCase):
)
pos.set("payments", [])
pos.append("payments", {"mode_of_payment": "Bank Draft", "account": "_Test Bank - _TC", "amount": 50})
pos.append(
"payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 60, "default": 1}
)
pos.append("payments", {"mode_of_payment": "Bank Draft", "amount": 50})
pos.append("payments", {"mode_of_payment": "Cash", "amount": 60, "default": 1})
pos.insert()
pos.submit()
@@ -387,7 +384,7 @@ class TestPOSInvoice(unittest.TestCase):
pos_inv = create_pos_invoice(rate=10000, do_not_save=1)
pos_inv.append(
"payments",
{"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 9000},
{"mode_of_payment": "Cash", "amount": 9000},
)
pos_inv.insert()
self.assertRaises(PartialPaymentValidationError, pos_inv.submit)
@@ -418,9 +415,7 @@ class TestPOSInvoice(unittest.TestCase):
do_not_save=1,
)
pos.append(
"payments", {"mode_of_payment": "Bank Draft", "account": "_Test Bank - _TC", "amount": 1000}
)
pos.append("payments", {"mode_of_payment": "Bank Draft", "amount": 1000})
pos.insert()
pos.submit()
@@ -439,9 +434,7 @@ class TestPOSInvoice(unittest.TestCase):
do_not_save=1,
)
pos2.append(
"payments", {"mode_of_payment": "Bank Draft", "account": "_Test Bank - _TC", "amount": 1000}
)
pos2.append("payments", {"mode_of_payment": "Bank Draft", "amount": 1000})
pos2.insert()
self.assertRaises(frappe.ValidationError, pos2.submit)
@@ -490,9 +483,7 @@ class TestPOSInvoice(unittest.TestCase):
do_not_save=1,
)
pos2.append(
"payments", {"mode_of_payment": "Bank Draft", "account": "_Test Bank - _TC", "amount": 1000}
)
pos2.append("payments", {"mode_of_payment": "Bank Draft", "amount": 1000})
pos2.insert()
self.assertRaises(frappe.ValidationError, pos2.submit)
@@ -555,9 +546,7 @@ class TestPOSInvoice(unittest.TestCase):
)
pos.get("items")[0].has_serial_no = 1
pos.set("payments", [])
pos.append(
"payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 1000, "default": 1}
)
pos.append("payments", {"mode_of_payment": "Cash", "amount": 1000, "default": 1})
pos = pos.save().submit()
# make a return
@@ -603,7 +592,7 @@ class TestPOSInvoice(unittest.TestCase):
inv = create_pos_invoice(customer="Test Loyalty Customer", rate=10000, do_not_save=1)
inv.append(
"payments",
{"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 10000},
{"mode_of_payment": "Cash", "amount": 10000},
)
inv.insert()
inv.submit()
@@ -635,7 +624,7 @@ class TestPOSInvoice(unittest.TestCase):
pos_inv = create_pos_invoice(customer="Test Loyalty Customer", rate=10000, do_not_save=1)
pos_inv.append(
"payments",
{"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 10000},
{"mode_of_payment": "Cash", "amount": 10000},
)
pos_inv.paid_amount = 10000
pos_inv.submit()
@@ -650,7 +639,7 @@ class TestPOSInvoice(unittest.TestCase):
inv.loyalty_amount = inv.loyalty_points * before_lp_details.conversion_factor
inv.append(
"payments",
{"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 10000 - inv.loyalty_amount},
{"mode_of_payment": "Cash", "amount": 10000 - inv.loyalty_amount},
)
inv.paid_amount = 10000
inv.submit()
@@ -671,12 +660,12 @@ class TestPOSInvoice(unittest.TestCase):
frappe.db.sql("delete from `tabPOS Invoice`")
test_user, pos_profile = init_user_and_profile()
pos_inv = create_pos_invoice(rate=300, additional_discount_percentage=10, do_not_submit=1)
pos_inv.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 270})
pos_inv.append("payments", {"mode_of_payment": "Cash", "amount": 270})
pos_inv.save()
pos_inv.submit()
pos_inv2 = create_pos_invoice(rate=3200, do_not_submit=1)
pos_inv2.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 3200})
pos_inv2.append("payments", {"mode_of_payment": "Cash", "amount": 3200})
pos_inv2.save()
pos_inv2.submit()
@@ -697,7 +686,7 @@ class TestPOSInvoice(unittest.TestCase):
frappe.db.sql("delete from `tabPOS Invoice`")
test_user, pos_profile = init_user_and_profile()
pos_inv = create_pos_invoice(rate=300, do_not_submit=1)
pos_inv.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 300})
pos_inv.append("payments", {"mode_of_payment": "Cash", "amount": 300})
pos_inv.append(
"taxes",
{
@@ -714,7 +703,7 @@ class TestPOSInvoice(unittest.TestCase):
pos_inv2 = create_pos_invoice(rate=300, qty=2, do_not_submit=1)
pos_inv2.additional_discount_percentage = 10
pos_inv2.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 540})
pos_inv2.append("payments", {"mode_of_payment": "Cash", "amount": 540})
pos_inv2.append(
"taxes",
{
@@ -752,7 +741,7 @@ class TestPOSInvoice(unittest.TestCase):
frappe.db.sql("delete from `tabPOS Invoice`")
test_user, pos_profile = init_user_and_profile()
pos_inv = create_pos_invoice(item=item, rate=300, do_not_submit=1)
pos_inv.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 300})
pos_inv.append("payments", {"mode_of_payment": "Cash", "amount": 300})
pos_inv.append(
"taxes",
{
@@ -767,7 +756,7 @@ class TestPOSInvoice(unittest.TestCase):
self.assertRaises(frappe.ValidationError, pos_inv.submit)
pos_inv2 = create_pos_invoice(item=item, rate=400, do_not_submit=1)
pos_inv2.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 400})
pos_inv2.append("payments", {"mode_of_payment": "Cash", "amount": 400})
pos_inv2.append(
"taxes",
{
@@ -812,7 +801,7 @@ class TestPOSInvoice(unittest.TestCase):
pos_inv1 = create_pos_invoice(item="_BATCH ITEM Test For Reserve", rate=300, qty=15, do_not_save=1)
pos_inv1.append(
"payments",
{"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 4500},
{"mode_of_payment": "Cash", "amount": 4500},
)
pos_inv1.items[0].batch_no = batch_no
pos_inv1.save()
@@ -833,7 +822,7 @@ class TestPOSInvoice(unittest.TestCase):
)
pos_inv2.append(
"payments",
{"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 3000},
{"mode_of_payment": "Cash", "amount": 3000},
)
pos_inv2.save()
pos_inv2.submit()
@@ -873,7 +862,7 @@ class TestPOSInvoice(unittest.TestCase):
)
pos_inv1.append(
"payments",
{"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 300},
{"mode_of_payment": "Cash", "amount": 300},
)
pos_inv1.save()
pos_inv1.submit()
@@ -1082,10 +1071,3 @@ def create_pos_invoice(**args):
pos_inv.payment_schedule = []
return pos_inv
def make_batch_item(item_name):
from erpnext.stock.doctype.item.test_item import make_item
if not frappe.db.exists(item_name):
return make_item(item_name, dict(has_batch_no=1, create_new_batch=1, is_stock_item=1))

View File

@@ -37,6 +37,7 @@
"column_break_19",
"discount_percentage",
"discount_amount",
"distributed_discount_amount",
"base_rate_with_margin",
"section_break1",
"rate",
@@ -847,11 +848,17 @@
{
"fieldname": "column_break_ciit",
"fieldtype": "Column Break"
},
{
"fieldname": "distributed_discount_amount",
"fieldtype": "Currency",
"label": "Distributed Discount Amount",
"options": "currency"
}
],
"istable": 1,
"links": [],
"modified": "2024-05-07 15:56:53.343317",
"modified": "2024-05-07 15:56:54.343317",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice Item",

View File

@@ -39,6 +39,7 @@ class POSInvoiceItem(Document):
description: DF.TextEditor
discount_amount: DF.Currency
discount_percentage: DF.Percent
distributed_discount_amount: DF.Currency
dn_detail: DF.Data | None
enable_deferred_revenue: DF.Check
expense_account: DF.Link | None

View File

@@ -5,6 +5,7 @@
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"company",
"posting_date",
"posting_time",
"merge_invoices_based_on",
@@ -113,12 +114,22 @@
"label": "Posting Time",
"no_copy": 1,
"reqd": 1
},
{
"fieldname": "company",
"fieldtype": "Link",
"in_standard_filter": 1,
"label": "Company",
"options": "Company",
"print_hide": 1,
"remember_last_selected_value": 1,
"reqd": 1
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2022-08-01 11:36:42.456429",
"modified": "2025-07-02 17:08:04.747202",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice Merge Log",
@@ -179,8 +190,9 @@
"write": 1
}
],
"sort_field": "modified",
"row_format": "Dynamic",
"sort_field": "creation",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
}

View File

@@ -2,12 +2,14 @@
# For license information, please see license.txt
import hashlib
import json
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.model.mapper import map_child_doc, map_doc
from frappe.query_builder import DocType
from frappe.utils import cint, flt, get_time, getdate, nowdate, nowtime
from frappe.utils.background_jobs import enqueue, is_job_enqueued
from frappe.utils.scheduler import is_scheduler_inactive
@@ -26,11 +28,10 @@ class POSInvoiceMergeLog(Document):
if TYPE_CHECKING:
from frappe.types import DF
from erpnext.accounts.doctype.pos_invoice_reference.pos_invoice_reference import (
POSInvoiceReference,
)
from erpnext.accounts.doctype.pos_invoice_reference.pos_invoice_reference import POSInvoiceReference
amended_from: DF.Link | None
company: DF.Link
consolidated_credit_note: DF.Link | None
consolidated_invoice: DF.Link | None
customer: DF.Link
@@ -118,17 +119,18 @@ class POSInvoiceMergeLog(Document):
returns = [d for d in pos_invoice_docs if d.get("is_return") == 1]
sales = [d for d in pos_invoice_docs if d.get("is_return") == 0]
sales_invoice, credit_note = "", ""
sales_invoice, credit_notes = "", {}
sales_invoice_doc = None
if sales:
sales_invoice_doc = self.process_merging_into_sales_invoice(sales)
sales_invoice = sales_invoice_doc.name
if returns:
credit_note = self.process_merging_into_credit_note(returns, sales_invoice_doc)
distinguished_returns = self.distinguish_return_pos_invoices(returns, sales_invoice_doc)
credit_notes = self.process_merging_into_credit_notes(distinguished_returns)
self.save() # save consolidated_sales_invoice & consolidated_credit_note ref in merge log
self.update_pos_invoices(pos_invoice_docs, sales_invoice, credit_note)
self.update_pos_invoices(pos_invoice_docs, sales_invoice, credit_notes)
def on_cancel(self):
pos_invoice_docs = [frappe.get_cached_doc("POS Invoice", d.pos_invoice) for d in self.pos_invoices]
@@ -158,34 +160,50 @@ class POSInvoiceMergeLog(Document):
return sales_invoice
def process_merging_into_credit_note(self, data, sales_invoice_doc=None):
credit_note = self.get_new_sales_invoice()
credit_note.is_return = 1
def process_merging_into_credit_notes(self, data):
credit_notes = {}
for key, value in data.items():
if not value:
continue
credit_note = self.merge_pos_invoice_into(credit_note, data)
referenes = {}
credit_note = self.get_new_sales_invoice()
credit_note.is_return = 1
if sales_invoice_doc:
credit_note.return_against = sales_invoice_doc.name
credit_note = self.merge_pos_invoice_into(credit_note, value)
credit_note.return_against = key
for d in sales_invoice_doc.items:
referenes[d.item_code] = d.name
credit_note.is_consolidated = 1
credit_note.set_posting_time = 1
credit_note.posting_date = getdate(self.posting_date)
credit_note.posting_time = get_time(self.posting_time)
# TODO: return could be against multiple sales invoice which could also have been consolidated?
# credit_note.return_against = self.consolidated_invoice
credit_note.save()
credit_note.submit()
for d in credit_note.items:
d.sales_invoice_item = referenes.get(d.item_code)
self.consolidated_credit_note = credit_note.name
credit_notes[credit_note.name] = [d.name for d in value]
credit_note.is_consolidated = 1
credit_note.set_posting_time = 1
credit_note.posting_date = getdate(self.posting_date)
credit_note.posting_time = get_time(self.posting_time)
# TODO: return could be against multiple sales invoice which could also have been consolidated?
# credit_note.return_against = self.consolidated_invoice
credit_note.save()
credit_note.submit()
return credit_notes
self.consolidated_credit_note = credit_note.name
def distinguish_return_pos_invoices(self, data, sales_invoice_doc=None):
return_invoices = {}
return credit_note.name
return_invoices[sales_invoice_doc.name if sales_invoice_doc else None] = []
for doc in data:
sales_invoices_of_return_against = frappe.db.get_value(
"POS Invoice", doc.return_against, "consolidated_invoice"
)
if sales_invoices_of_return_against:
if sales_invoices_of_return_against in return_invoices:
return_invoices[sales_invoices_of_return_against].append(doc)
else:
return_invoices[sales_invoices_of_return_against] = [doc]
else:
return_invoices[sales_invoice_doc.name if sales_invoice_doc else None].append(doc)
return return_invoices
def merge_pos_invoice_into(self, invoice, data):
items, payments, taxes = [], [], []
@@ -211,33 +229,20 @@ class POSInvoiceMergeLog(Document):
loyalty_amount_sum += doc.loyalty_amount
for item in doc.get("items"):
found = False
for i in items:
if (
i.item_code == item.item_code
and not i.serial_and_batch_bundle
and not i.serial_no
and not i.batch_no
and i.uom == item.uom
and i.net_rate == item.net_rate
and i.warehouse == item.warehouse
):
found = True
i.qty = i.qty + item.qty
i.amount = i.amount + item.net_amount
i.net_amount = i.amount
i.base_amount = i.base_amount + item.base_net_amount
i.base_net_amount = i.base_amount
if not found:
item.rate = item.net_rate
item.amount = item.net_amount
item.base_amount = item.base_net_amount
item.price_list_rate = 0
si_item = map_child_doc(item, invoice, {"doctype": "Sales Invoice Item"})
if item.serial_and_batch_bundle:
si_item.serial_and_batch_bundle = item.serial_and_batch_bundle
items.append(si_item)
item.rate = item.net_rate
item.amount = item.net_amount
item.base_amount = item.base_net_amount
item.price_list_rate = 0
si_item = map_child_doc(item, invoice, {"doctype": "Sales Invoice Item"})
si_item.pos_invoice = doc.name
si_item.pos_invoice_item = item.name
if doc.is_return:
si_item.sales_invoice_item = get_sales_invoice_item(
doc.return_against, item.pos_invoice_item
)
if item.serial_and_batch_bundle:
si_item.serial_and_batch_bundle = item.serial_and_batch_bundle
items.append(si_item)
for tax in doc.get("taxes"):
found = False
@@ -252,6 +257,7 @@ class POSInvoiceMergeLog(Document):
if not found:
tax.charge_type = "Actual"
tax.idx = idx
tax.row_id = None
idx += 1
tax.included_in_print_rate = 0
tax.tax_amount = tax.tax_amount_after_discount_amount
@@ -297,10 +303,17 @@ class POSInvoiceMergeLog(Document):
accounting_dimensions = get_checks_for_pl_and_bs_accounts()
accounting_dimensions_fields = [d.fieldname for d in accounting_dimensions]
dimension_values = frappe.db.get_value(
"POS Profile", {"name": invoice.pos_profile}, accounting_dimensions_fields, as_dict=1
"POS Profile",
{"name": invoice.pos_profile},
[*accounting_dimensions_fields, "cost_center", "project"],
as_dict=1,
)
for dimension in accounting_dimensions:
dimension_value = dimension_values.get(dimension.fieldname)
dimension_value = (
data[0].get(dimension.fieldname)
if data[0].get(dimension.fieldname)
else dimension_values.get(dimension.fieldname)
)
if not dimension_value and (dimension.mandatory_for_pl or dimension.mandatory_for_bs):
frappe.throw(
@@ -312,10 +325,23 @@ class POSInvoiceMergeLog(Document):
invoice.set(dimension.fieldname, dimension_value)
invoice.set(
"cost_center",
data[0].get("cost_center") if data[0].get("cost_center") else dimension_values.get("cost_center"),
)
invoice.set(
"project", data[0].get("project") if data[0].get("project") else dimension_values.get("project")
)
if self.merge_invoices_based_on == "Customer Group":
invoice.flags.ignore_pos_profile = True
invoice.pos_profile = ""
# Unset Commission Section
invoice.set("sales_partner", None)
invoice.set("commission_rate", 0)
invoice.set("total_commission", 0)
return invoice
def get_new_sales_invoice(self):
@@ -327,16 +353,16 @@ class POSInvoiceMergeLog(Document):
return sales_invoice
def update_pos_invoices(self, invoice_docs, sales_invoice="", credit_note=""):
def update_pos_invoices(self, invoice_docs, sales_invoice="", credit_notes=None):
for doc in invoice_docs:
doc.load_from_db()
doc.update(
{
"consolidated_invoice": None
if self.docstatus == 2
else (credit_note if doc.is_return else sales_invoice)
}
)
inv = sales_invoice
if doc.is_return and credit_notes:
for key, value in credit_notes.items():
if doc.name in value:
inv = key
break
doc.update({"consolidated_invoice": None if self.docstatus == 2 else inv})
doc.set_status(update=True)
doc.save()
@@ -441,9 +467,34 @@ def get_invoice_customer_map(pos_invoices):
pos_invoice_customer_map.setdefault(customer, [])
pos_invoice_customer_map[customer].append(invoice)
for customer, invoices in pos_invoice_customer_map.items():
pos_invoice_customer_map[customer] = split_invoices_by_accounting_dimension(invoices)
return pos_invoice_customer_map
def split_invoices_by_accounting_dimension(pos_invoices):
# pos_invoices = {
# {'dim_field1': 'dim_field1_value1', 'dim_field2': 'dim_field2_value1'}: [],
# {'dim_field1': 'dim_field1_value2', 'dim_field2': 'dim_field2_value1'}: []
# }
pos_invoice_accounting_dimensions_map = {}
for invoice in pos_invoices:
dimension_fields = [d.fieldname for d in get_checks_for_pl_and_bs_accounts()]
accounting_dimensions = frappe.db.get_value(
"POS Invoice", invoice.pos_invoice, [*dimension_fields, "cost_center", "project"], as_dict=1
)
accounting_dimensions_dic_hash = hashlib.sha256(
json.dumps(accounting_dimensions).encode()
).hexdigest()
pos_invoice_accounting_dimensions_map.setdefault(accounting_dimensions_dic_hash, [])
pos_invoice_accounting_dimensions_map[accounting_dimensions_dic_hash].append(invoice)
return pos_invoice_accounting_dimensions_map
def consolidate_pos_invoices(pos_invoices=None, closing_entry=None):
invoices = pos_invoices or (closing_entry and closing_entry.get("pos_transactions"))
if frappe.flags.in_test and not invoices:
@@ -527,20 +578,22 @@ def split_invoices(invoices):
def create_merge_logs(invoice_by_customer, closing_entry=None):
try:
for customer, invoices in invoice_by_customer.items():
for _invoices in split_invoices(invoices):
merge_log = frappe.new_doc("POS Invoice Merge Log")
merge_log.posting_date = (
getdate(closing_entry.get("posting_date")) if closing_entry else nowdate()
)
merge_log.posting_time = (
get_time(closing_entry.get("posting_time")) if closing_entry else nowtime()
)
merge_log.customer = customer
merge_log.pos_closing_entry = closing_entry.get("name") if closing_entry else None
merge_log.set("pos_invoices", _invoices)
merge_log.save(ignore_permissions=True)
merge_log.submit()
for customer, invoices_acc_dim in invoice_by_customer.items():
for invoices in invoices_acc_dim.values():
for _invoices in split_invoices(invoices):
merge_log = frappe.new_doc("POS Invoice Merge Log")
merge_log.posting_date = (
getdate(closing_entry.get("posting_date")) if closing_entry else nowdate()
)
merge_log.posting_time = (
get_time(closing_entry.get("posting_time")) if closing_entry else nowtime()
)
merge_log.company = closing_entry.get("company") if closing_entry else None
merge_log.customer = customer
merge_log.pos_closing_entry = closing_entry.get("name") if closing_entry else None
merge_log.set("pos_invoices", _invoices)
merge_log.save(ignore_permissions=True)
merge_log.submit()
if closing_entry:
closing_entry.set_status(update=True, status="Submitted")
closing_entry.db_set("error_message", "")
@@ -628,3 +681,26 @@ def get_error_message(message) -> str:
return message["message"]
except Exception:
return str(message)
def get_sales_invoice_item(return_against_pos_invoice, pos_invoice_item):
try:
SalesInvoice = DocType("Sales Invoice")
SalesInvoiceItem = DocType("Sales Invoice Item")
query = (
frappe.qb.from_(SalesInvoice)
.from_(SalesInvoiceItem)
.select(SalesInvoiceItem.name)
.where(
(SalesInvoice.name == SalesInvoiceItem.parent)
& (SalesInvoice.is_return == 0)
& (SalesInvoiceItem.pos_invoice == return_against_pos_invoice)
& (SalesInvoiceItem.pos_invoice_item == pos_invoice_item)
)
)
result = query.run(as_dict=True)
return result[0].name if result else None
except Exception:
return None

View File

@@ -455,3 +455,58 @@ class TestPOSInvoiceMergeLog(unittest.TestCase):
frappe.set_user("Administrator")
frappe.db.sql("delete from `tabPOS Profile`")
frappe.db.sql("delete from `tabPOS Invoice`")
def test_separate_consolidated_invoice_for_different_accounting_dimensions(self):
"""
Creating 3 POS Invoices where first POS Invoice has different Cost Center than the other two.
Consolidate the Invoices.
Check whether the first POS Invoice is consolidated with a separate Sales Invoice than the other two.
Check whether the second and third POS Invoice are consolidated with the same Sales Invoice.
"""
from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
frappe.db.sql("delete from `tabPOS Invoice`")
create_cost_center(cost_center_name="_Test POS Cost Center 1", is_group=0)
create_cost_center(cost_center_name="_Test POS Cost Center 2", is_group=0)
try:
test_user, pos_profile = init_user_and_profile()
pos_inv = create_pos_invoice(rate=300, do_not_submit=1)
pos_inv.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 300})
pos_inv.cost_center = "_Test POS Cost Center 1 - _TC"
pos_inv.save()
pos_inv.submit()
pos_inv2 = create_pos_invoice(rate=3200, do_not_submit=1)
pos_inv2.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 3200})
pos_inv.cost_center = "_Test POS Cost Center 2 - _TC"
pos_inv2.save()
pos_inv2.submit()
pos_inv3 = create_pos_invoice(rate=2300, do_not_submit=1)
pos_inv3.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 2300})
pos_inv.cost_center = "_Test POS Cost Center 2 - _TC"
pos_inv3.save()
pos_inv3.submit()
consolidate_pos_invoices()
pos_inv.load_from_db()
self.assertTrue(frappe.db.exists("Sales Invoice", pos_inv.consolidated_invoice))
pos_inv2.load_from_db()
self.assertTrue(frappe.db.exists("Sales Invoice", pos_inv2.consolidated_invoice))
self.assertFalse(pos_inv.consolidated_invoice == pos_inv3.consolidated_invoice)
pos_inv3.load_from_db()
self.assertTrue(frappe.db.exists("Sales Invoice", pos_inv3.consolidated_invoice))
self.assertTrue(pos_inv2.consolidated_invoice == pos_inv3.consolidated_invoice)
finally:
frappe.set_user("Administrator")
frappe.db.sql("delete from `tabPOS Profile`")
frappe.db.sql("delete from `tabPOS Invoice`")

View File

@@ -70,3 +70,6 @@ class POSOpeningEntry(StatusUpdater):
def on_submit(self):
self.set_status(update=True)
def on_cancel(self):
self.set_status(update=True)

View File

@@ -30,6 +30,7 @@
"allow_rate_change",
"allow_discount_change",
"disable_grand_total_to_default_mop",
"allow_partial_payment",
"section_break_23",
"item_groups",
"column_break_25",
@@ -56,7 +57,8 @@
"apply_discount_on",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break"
"dimension_col_break",
"project"
],
"fields": [
{
@@ -389,6 +391,20 @@
"fieldname": "disable_grand_total_to_default_mop",
"fieldtype": "Check",
"label": "Disable auto setting Grand Total to default Payment Mode"
},
{
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
"oldfieldname": "cost_center",
"oldfieldtype": "Link",
"options": "Project"
},
{
"default": "0",
"fieldname": "allow_partial_payment",
"fieldtype": "Check",
"label": "Allow Partial Payment"
}
],
"icon": "icon-cog",
@@ -416,7 +432,7 @@
"link_fieldname": "pos_profile"
}
],
"modified": "2025-01-29 13:12:30.796630",
"modified": "2025-04-14 15:58:20.497426",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Profile",
@@ -442,7 +458,8 @@
"role": "Accounts User"
}
],
"sort_field": "modified",
"row_format": "Dynamic",
"sort_field": "creation",
"sort_order": "DESC",
"states": []
}

View File

@@ -29,6 +29,7 @@ class POSProfile(Document):
account_for_change_amount: DF.Link | None
allow_discount_change: DF.Check
allow_partial_payment: DF.Check
allow_rate_change: DF.Check
applicable_for_users: DF.Table[POSProfileUser]
apply_discount_on: DF.Literal["Grand Total", "Net Total"]
@@ -54,6 +55,7 @@ class POSProfile(Document):
payments: DF.Table[POSPaymentMethod]
print_format: DF.Link | None
print_receipt_on_order_complete: DF.Check
project: DF.Link | None
select_print_heading: DF.Link | None
selling_price_list: DF.Link | None
tax_category: DF.Link | None

View File

@@ -169,7 +169,7 @@ class PricingRule(Document):
tocheck = frappe.scrub(self.get("applicable_for", ""))
if tocheck and not self.get(tocheck):
throw(_("{0} is required").format(self.meta.get_label(tocheck)), frappe.MandatoryError)
throw(_("{0} is required").format(_(self.meta.get_label(tocheck))), frappe.MandatoryError)
if self.apply_rule_on_other:
o_field = "other_" + frappe.scrub(self.apply_rule_on_other)
@@ -454,8 +454,7 @@ def get_pricing_rule_for_item(args, doc=None, for_validate=False):
if pricing_rule.coupon_code_based == 1:
if not args.coupon_code:
return item_details
continue
coupon_code = frappe.db.get_value(
doctype="Coupon Code", filters={"pricing_rule": pricing_rule.name}, fieldname="name"
)

View File

@@ -205,6 +205,56 @@ class TestPricingRule(FrappeTestCase):
details = get_item_details(args)
self.assertEqual(details.get("discount_percentage"), 10)
def test_unset_group_condition(self):
"""
If args are not set for group condition, then pricing rule should not be applied.
"""
from erpnext.stock.get_item_details import get_item_details
test_record = {
"doctype": "Pricing Rule",
"title": "_Test Pricing Rule",
"apply_on": "Item Code",
"items": [{"item_code": "_Test Item"}],
"currency": "USD",
"selling": 1,
"rate_or_discount": "Discount Percentage",
"rate": 0,
"discount_percentage": 10,
"applicable_for": "Territory",
"territory": "All Territories",
"company": "_Test Company",
}
frappe.get_doc(test_record.copy()).insert()
args = frappe._dict(
{
"item_code": "_Test Item",
"company": "_Test Company",
"price_list": "_Test Price List",
"currency": "_Test Currency",
"doctype": "Sales Order",
"conversion_rate": 1,
"price_list_currency": "_Test Currency",
"plc_conversion_rate": 1,
"order_type": "Sales",
"customer": "_Test Customer",
"name": None,
}
)
# without territory in customer
customer = frappe.get_doc("Customer", "_Test Customer")
territory = customer.territory
customer.territory = None
customer.save()
details = get_item_details(args)
self.assertEqual(details.get("discount_percentage"), 0)
customer.territory = territory
customer.save()
def test_pricing_rule_for_variants(self):
from erpnext.stock.get_item_details import get_item_details

View File

@@ -223,6 +223,10 @@ def _get_tree_conditions(args, parenttype, table, allow_blank=True):
)
frappe.flags.tree_conditions[key] = condition
elif allow_blank:
condition = f"ifnull({table}.{field}, '') = ''"
return condition

View File

@@ -40,6 +40,13 @@ class TestProcessDeferredAccounting(unittest.TestCase):
si.save()
si.submit()
original_gle = [
["Debtors - _TC", 3000.0, 0, "2023-07-01"],
[deferred_account, 0.0, 3000, "2023-07-01"],
]
check_gl_entries(self, si.name, original_gle, "2023-07-01")
process_deferred_accounting = frappe.get_doc(
dict(
doctype="Process Deferred Accounting",
@@ -63,6 +70,12 @@ class TestProcessDeferredAccounting(unittest.TestCase):
]
check_gl_entries(self, si.name, expected_gle, "2023-07-01")
# cancel the process deferred accounting document
process_deferred_accounting.cancel()
# check if gl entries are cancelled
check_gl_entries(self, si.name, original_gle, "2023-07-01")
change_acc_settings()
def test_pda_submission_and_cancellation(self):

View File

@@ -54,6 +54,29 @@ frappe.ui.form.on("Process Statement Of Accounts", {
};
});
frm.set_query("account", function () {
if (!frm.doc.company) {
frappe.throw(__("Please set Company"));
}
return {
filters: {
company: frm.doc.company,
},
};
});
frm.set_query("cost_center", function () {
if (!frm.doc.company) {
frappe.throw(__("Please set Company"));
}
return {
filters: {
company: frm.doc.company,
},
};
});
frm.set_query("project", function () {
if (!frm.doc.company) {
frappe.throw(__("Please set Company"));
}
return {
filters: {
company: frm.doc.company,
@@ -65,6 +88,11 @@ frappe.ui.form.on("Process Statement Of Accounts", {
frm.set_value("to_date", frappe.datetime.get_today());
}
},
company: function (frm) {
frm.set_value("account", "");
frm.set_value("cost_center", "");
frm.set_value("project", "");
},
report: function (frm) {
let filters = {
company: frm.doc.company,

View File

@@ -12,7 +12,7 @@
"posting_date",
"company",
"account",
"group_by",
"categorize_by",
"cost_center",
"territory",
"ignore_exchange_rate_revaluation_journals",
@@ -174,14 +174,6 @@
"fieldtype": "Date",
"label": "Start Date"
},
{
"default": "Group by Voucher (Consolidated)",
"depends_on": "eval:(doc.report == 'General Ledger');",
"fieldname": "group_by",
"fieldtype": "Select",
"label": "Group By",
"options": "\nGroup by Voucher\nGroup by Voucher (Consolidated)"
},
{
"depends_on": "eval: (doc.report == 'General Ledger');",
"fieldname": "currency",
@@ -384,7 +376,7 @@
"default": "0",
"fieldname": "ignore_exchange_rate_revaluation_journals",
"fieldtype": "Check",
"label": "Ignore Exchange Rate Revaluation Journals"
"label": "Ignore Exchange Rate Revaluation and Gain / Loss Journals"
},
{
"default": "0",
@@ -397,10 +389,18 @@
"fieldname": "show_remarks",
"fieldtype": "Check",
"label": "Show Remarks"
},
{
"default": "Categorize by Voucher (Consolidated)",
"depends_on": "eval:(doc.report == 'General Ledger');",
"fieldname": "categorize_by",
"fieldtype": "Select",
"label": "Categorize By",
"options": "\nCategorize by Voucher\nCategorize by Voucher (Consolidated)"
}
],
"links": [],
"modified": "2024-12-11 12:11:13.543134",
"modified": "2025-07-08 16:52:12.602384",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Statement Of Accounts",
@@ -436,4 +436,4 @@
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
}

View File

@@ -44,6 +44,7 @@ class ProcessStatementOfAccounts(Document):
ageing_based_on: DF.Literal["Due Date", "Posting Date"]
based_on_payment_terms: DF.Check
body: DF.TextEditor | None
categorize_by: DF.Literal["", "Categorize by Voucher", "Categorize by Voucher (Consolidated)"]
cc_to: DF.TableMultiSelect[ProcessStatementOfAccountsCC]
collection_name: DF.DynamicLink | None
company: DF.Link
@@ -56,7 +57,6 @@ class ProcessStatementOfAccounts(Document):
finance_book: DF.Link | None
frequency: DF.Literal["Weekly", "Monthly", "Quarterly"]
from_date: DF.Date | None
group_by: DF.Literal["", "Group by Voucher", "Group by Voucher (Consolidated)"]
ignore_cr_dr_notes: DF.Check
ignore_exchange_rate_revaluation_journals: DF.Check
include_ageing: DF.Check
@@ -82,6 +82,10 @@ class ProcessStatementOfAccounts(Document):
# end: auto-generated types
def validate(self):
self.validate_account()
self.validate_company_for_table("Cost Center")
self.validate_company_for_table("Project")
if not self.subject:
self.subject = "Statement Of Accounts for {{ customer.customer_name }}"
if not self.body:
@@ -104,6 +108,43 @@ class ProcessStatementOfAccounts(Document):
self.to_date = self.start_date
self.from_date = add_months(self.to_date, -1 * self.filter_duration)
def validate_account(self):
if not self.account:
return
if self.company != frappe.get_cached_value("Account", self.account, "company"):
frappe.throw(
_("Account {0} doesn't belong to Company {1}").format(
frappe.bold(self.account),
frappe.bold(self.company),
)
)
def validate_company_for_table(self, doctype):
field = frappe.scrub(doctype)
if not self.get(field):
return
fieldname = field + "_name"
values = set(d.get(fieldname) for d in self.get(field))
invalid_values = frappe.db.get_all(
doctype, filters={"name": ["in", values], "company": ["!=", self.company]}, pluck="name"
)
if invalid_values:
msg = _("<p>Following {0}s doesn't belong to Company {1} :</p>").format(
doctype, frappe.bold(self.company)
)
msg += (
"<ul>"
+ "".join(_("<li>{}</li>").format(frappe.bold(row)) for row in invalid_values)
+ "</ul>"
)
frappe.throw(_(msg))
def get_report_pdf(doc, consolidated=True):
statement_dict = get_statement_dict(doc)
@@ -129,8 +170,8 @@ def get_statement_dict(doc, get_statement_dict=False):
tax_id = frappe.get_doc("Customer", entry.customer).tax_id
presentation_currency = (
get_party_account_currency("Customer", entry.customer, doc.company)
or doc.currency
doc.currency
or get_party_account_currency("Customer", entry.customer, doc.company)
or get_company_currency(doc.company)
)
@@ -204,7 +245,7 @@ def get_gl_filters(doc, entry, tax_id, presentation_currency):
"party": [entry.customer],
"party_name": [entry.customer_name] if entry.customer_name else None,
"presentation_currency": presentation_currency,
"group_by": doc.group_by,
"categorize_by": doc.categorize_by,
"currency": doc.currency,
"project": [p.project_name for p in doc.project],
"show_opening_entries": 0,

View File

@@ -211,7 +211,7 @@
<tr>
{% if(report.report_name == "Accounts Receivable" or report.report_name == "Accounts Payable") %}
{% if(data[i]["party"]) %}
<td>{{ (data[i]["posting_date"]) }}</td>
<td>{{ frappe.format((data[i]["posting_date"]), 'Date') }}</td>
<td style="text-align: right">{{ data[i]["age"] }}</td>
<td>
{% if not(filters.show_future_payments) %}

View File

@@ -97,6 +97,7 @@ def create_process_soa(**args):
company=args.company or "_Test Company",
customers=args.customers or [{"customer": "_Test Customer"}],
enable_auto_email=1 if args.enable_auto_email else 0,
currency=args.currency or "",
frequency=args.frequency or "Weekly",
report=args.report or "General Ledger",
from_date=args.from_date or getdate(today()),

View File

@@ -425,6 +425,8 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
this.frm.set_value("is_paid", 0);
frappe.msgprint(__("Please specify Company to proceed"));
}
} else {
this.frm.set_value("paid_amount", 0);
}
this.calculate_outstanding_amount();
this.frm.refresh_fields();

View File

@@ -143,8 +143,10 @@
"contact_mobile",
"contact_email",
"company_shipping_address_section",
"shipping_address",
"dispatch_address",
"dispatch_address_display",
"column_break_126",
"shipping_address",
"shipping_address_display",
"company_billing_address_section",
"billing_address",
@@ -1546,7 +1548,7 @@
{
"fieldname": "company_shipping_address_section",
"fieldtype": "Section Break",
"label": "Company Shipping Address"
"label": "Shipping Address"
},
{
"fieldname": "column_break_126",
@@ -1627,13 +1629,28 @@
"fieldname": "update_outstanding_for_self",
"fieldtype": "Check",
"label": "Update Outstanding for Self"
},
{
"fieldname": "dispatch_address_display",
"fieldtype": "Text Editor",
"label": "Dispatch Address",
"print_hide": 1,
"read_only": 1
},
{
"fieldname": "dispatch_address",
"fieldtype": "Link",
"label": "Select Dispatch Address ",
"options": "Address",
"print_hide": 1
}
],
"grid_page_length": 50,
"icon": "fa fa-file-text",
"idx": 204,
"is_submittable": 1,
"links": [],
"modified": "2025-01-14 11:39:04.564610",
"modified": "2025-04-09 16:49:22.175081",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",
@@ -1688,6 +1705,7 @@
"write": 1
}
],
"row_format": "Dynamic",
"search_fields": "posting_date, supplier, bill_no, base_grand_total, outstanding_amount",
"show_name_in_global_search": 1,
"sort_field": "modified",

View File

@@ -117,6 +117,8 @@ class PurchaseInvoice(BuyingController):
currency: DF.Link | None
disable_rounded_total: DF.Check
discount_amount: DF.Currency
dispatch_address: DF.Link | None
dispatch_address_display: DF.TextEditor | None
due_date: DF.Date | None
from_date: DF.Date | None
grand_total: DF.Currency
@@ -871,6 +873,7 @@ class PurchaseInvoice(BuyingController):
self.make_payment_gl_entries(gl_entries)
self.make_write_off_gl_entry(gl_entries)
self.make_gle_for_rounding_adjustment(gl_entries)
self.set_transaction_currency_and_rate_in_gl_map(gl_entries)
return gl_entries
def check_asset_cwip_enabled(self):
@@ -916,6 +919,7 @@ class PurchaseInvoice(BuyingController):
"credit_in_account_currency": base_grand_total
if self.party_account_currency == self.company_currency
else grand_total,
"credit_in_transaction_currency": grand_total,
"against_voucher": against_voucher,
"against_voucher_type": self.doctype,
"project": self.project,
@@ -951,7 +955,7 @@ class PurchaseInvoice(BuyingController):
valuation_tax_accounts = [
d.account_head
for d in self.get("taxes")
if d.category in ("Valuation", "Total and Valuation")
if d.category in ("Valuation", "Valuation and Total")
and flt(d.base_tax_amount_after_discount_amount)
]
@@ -967,7 +971,6 @@ class PurchaseInvoice(BuyingController):
for item in self.get("items"):
if flt(item.base_net_amount):
account_currency = get_account_currency(item.expense_account)
if item.item_code:
frappe.get_cached_value("Item", item.item_code, "asset_category")
@@ -976,6 +979,7 @@ class PurchaseInvoice(BuyingController):
and self.auto_accounting_for_stock
and (item.item_code in stock_items or item.is_fixed_asset)
):
account_currency = get_account_currency(item.expense_account)
# warehouse account
warehouse_debit_amount = self.make_stock_adjustment_entry(
gl_entries, item, voucher_wise_stock_value, account_currency
@@ -991,6 +995,7 @@ class PurchaseInvoice(BuyingController):
"project": item.project or self.project,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"debit": warehouse_debit_amount,
"debit_in_transaction_currency": item.net_amount,
},
warehouse_account[item.warehouse]["account_currency"],
item=item,
@@ -1011,6 +1016,7 @@ class PurchaseInvoice(BuyingController):
"project": item.project or self.project,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"debit": -1 * flt(credit_amount, item.precision("base_net_amount")),
"debit_in_transaction_currency": item.net_amount,
},
warehouse_account[item.from_warehouse]["account_currency"],
item=item,
@@ -1025,6 +1031,7 @@ class PurchaseInvoice(BuyingController):
"account": item.expense_account,
"against": self.supplier,
"debit": flt(item.base_net_amount, item.precision("base_net_amount")),
"debit_in_transaction_currency": item.net_amount,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"cost_center": item.cost_center,
"project": item.project,
@@ -1042,6 +1049,10 @@ class PurchaseInvoice(BuyingController):
"account": item.expense_account,
"against": self.supplier,
"debit": warehouse_debit_amount,
"debit_in_transaction_currency": flt(
warehouse_debit_amount / self.conversion_rate,
item.precision("net_amount"),
),
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"cost_center": item.cost_center,
"project": item.project or self.project,
@@ -1054,7 +1065,9 @@ class PurchaseInvoice(BuyingController):
# Amount added through landed-cost-voucher
if landed_cost_entries:
if (item.item_code, item.name) in landed_cost_entries:
for account, amount in landed_cost_entries[(item.item_code, item.name)].items():
for account, base_amount in landed_cost_entries[
(item.item_code, item.name)
].items():
gl_entries.append(
self.get_gl_dict(
{
@@ -1062,8 +1075,9 @@ class PurchaseInvoice(BuyingController):
"against": item.expense_account,
"cost_center": item.cost_center,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"credit": flt(amount["base_amount"]),
"credit_in_account_currency": flt(amount["amount"]),
"credit": flt(base_amount["base_amount"]),
"credit_in_account_currency": flt(base_amount["amount"]),
"credit_in_transaction_currency": item.net_amount,
"project": item.project or self.project,
},
item=item,
@@ -1086,6 +1100,7 @@ class PurchaseInvoice(BuyingController):
"project": item.project or self.project,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"credit": flt(item.rm_supp_cost),
"credit_in_transaction_currency": item.net_amount,
},
warehouse_account[self.supplier_warehouse]["account_currency"],
item=item,
@@ -1099,7 +1114,8 @@ class PurchaseInvoice(BuyingController):
else item.deferred_expense_account
)
dummy, amount = self.get_amount_and_base_amount(item, None)
account_currency = get_account_currency(expense_account)
amount, base_amount = self.get_amount_and_base_amount(item, None)
if provisional_accounting_for_non_stock_items:
self.make_provisional_gl_entry(gl_entries, item)
@@ -1110,7 +1126,8 @@ class PurchaseInvoice(BuyingController):
{
"account": expense_account,
"against": self.supplier,
"debit": amount,
"debit": base_amount,
"debit_in_transaction_currency": amount,
"cost_center": item.cost_center,
"project": item.project or self.project,
},
@@ -1184,6 +1201,10 @@ class PurchaseInvoice(BuyingController):
"account": stock_rbnb,
"against": self.supplier,
"debit": flt(item.item_tax_amount, item.precision("item_tax_amount")),
"debit_in_transaction_currency": flt(
item.item_tax_amount / self.conversion_rate,
item.precision("item_tax_amount"),
),
"remarks": self.remarks or _("Accounting Entry for Stock"),
"cost_center": self.cost_center,
"project": item.project or self.project,
@@ -1202,10 +1223,13 @@ class PurchaseInvoice(BuyingController):
def get_provisional_accounts(self):
self.provisional_accounts = frappe._dict()
linked_purchase_receipts = set([d.purchase_receipt for d in self.items if d.purchase_receipt])
if not linked_purchase_receipts:
return
pr_items = frappe.get_all(
"Purchase Receipt Item",
filters={"parent": ("in", linked_purchase_receipts)},
fields=["name", "provisional_expense_account", "qty", "base_rate"],
fields=["name", "provisional_expense_account", "qty", "base_rate", "rate"],
)
default_provisional_account = self.get_company_default("default_provisional_account")
provisional_accounts = set(
@@ -1233,6 +1257,7 @@ class PurchaseInvoice(BuyingController):
"provisional_account": item.provisional_expense_account or default_provisional_account,
"qty": item.qty,
"base_rate": item.base_rate,
"rate": item.rate,
"has_provisional_entry": item.name in rows_with_provisional_entries,
}
@@ -1249,7 +1274,10 @@ class PurchaseInvoice(BuyingController):
self.posting_date,
pr_item.get("provisional_account"),
reverse=1,
item_amount=(min(item.qty, pr_item.get("qty")) * pr_item.get("base_rate")),
item_amount=(
(min(item.qty, pr_item.get("qty")) * pr_item.get("rate"))
* purchase_receipt_doc.get("conversion_rate")
),
)
def update_gross_purchase_amount_for_linked_assets(self, item):
@@ -1282,8 +1310,37 @@ class PurchaseInvoice(BuyingController):
net_amt_precision,
)
# Stock ledger value is not matching with the warehouse amount
if (
if self.is_return and self.update_stock and (self.is_internal_supplier or not self.return_against):
net_rate = item.base_net_amount
if item.sales_incoming_rate: # for internal transfer
net_rate = item.qty * item.sales_incoming_rate
stock_amount = net_rate + item.item_tax_amount + flt(item.landed_cost_voucher_amount)
warehouse_debit_amount = flt(
voucher_wise_stock_value.get((item.name, item.warehouse)), net_amt_precision
)
if flt(stock_amount, net_amt_precision) != flt(warehouse_debit_amount, net_amt_precision):
cost_of_goods_sold_account = self.get_company_default("default_expense_account")
stock_adjustment_amt = stock_amount - warehouse_debit_amount
gl_entries.append(
self.get_gl_dict(
{
"account": cost_of_goods_sold_account,
"against": item.expense_account,
"debit": stock_adjustment_amt,
"debit_in_transaction_currency": stock_adjustment_amt / self.conversion_rate,
"remarks": self.get("remarks") or _("Stock Adjustment"),
"cost_center": item.cost_center,
"project": item.project or self.project,
},
account_currency,
item=item,
)
)
elif (
self.update_stock
and voucher_wise_stock_value.get((item.name, item.warehouse))
and warehouse_debit_amount
@@ -1299,6 +1356,7 @@ class PurchaseInvoice(BuyingController):
"account": cost_of_goods_sold_account,
"against": item.expense_account,
"debit": stock_adjustment_amt,
"debit_in_transaction_currency": stock_adjustment_amt / self.conversion_rate,
"remarks": self.get("remarks") or _("Stock Adjustment"),
"cost_center": item.cost_center,
"project": item.project or self.project,
@@ -1332,6 +1390,7 @@ class PurchaseInvoice(BuyingController):
dr_or_cr + "_in_account_currency": base_amount
if account_currency == self.company_currency
else amount,
dr_or_cr + "_in_transaction_currency": amount,
"cost_center": tax.cost_center,
},
account_currency,
@@ -1378,6 +1437,10 @@ class PurchaseInvoice(BuyingController):
"cost_center": tax.cost_center,
"against": self.supplier,
"credit": applicable_amount,
"credit_in_transaction_currency": flt(
applicable_amount / self.conversion_rate,
frappe.get_precision("Purchase Invoice Item", "item_tax_amount"),
),
"remarks": self.remarks or _("Accounting Entry for Stock"),
},
item=tax,
@@ -1396,6 +1459,10 @@ class PurchaseInvoice(BuyingController):
"cost_center": tax.cost_center,
"against": self.supplier,
"credit": valuation_tax[tax.name],
"credit_in_transaction_currency": flt(
valuation_tax[tax.name] / self.conversion_rate,
frappe.get_precision("Purchase Invoice Item", "item_tax_amount"),
),
"remarks": self.remarks or _("Accounting Entry for Stock"),
},
item=tax,
@@ -1411,6 +1478,7 @@ class PurchaseInvoice(BuyingController):
"account": self.unrealized_profit_loss_account,
"against": self.supplier,
"credit": flt(self.total_taxes_and_charges),
"credit_in_transaction_currency": flt(self.total_taxes_and_charges),
"credit_in_account_currency": flt(self.base_total_taxes_and_charges),
"cost_center": self.cost_center,
},
@@ -1460,6 +1528,7 @@ class PurchaseInvoice(BuyingController):
"debit_in_account_currency": self.base_paid_amount
if self.party_account_currency == self.company_currency
else self.paid_amount,
"debit_in_transaction_currency": self.paid_amount,
"against_voucher": self.return_against
if cint(self.is_return) and self.return_against
else self.name,
@@ -1481,6 +1550,7 @@ class PurchaseInvoice(BuyingController):
"credit_in_account_currency": self.base_paid_amount
if bank_account_currency == self.company_currency
else self.paid_amount,
"credit_in_transaction_currency": self.paid_amount,
"cost_center": self.cost_center,
},
bank_account_currency,
@@ -1505,6 +1575,7 @@ class PurchaseInvoice(BuyingController):
"debit_in_account_currency": self.base_write_off_amount
if self.party_account_currency == self.company_currency
else self.write_off_amount,
"debit_in_transaction_currency": self.write_off_amount,
"against_voucher": self.return_against
if cint(self.is_return) and self.return_against
else self.name,
@@ -1525,6 +1596,7 @@ class PurchaseInvoice(BuyingController):
"credit_in_account_currency": self.base_write_off_amount
if write_off_account_currency == self.company_currency
else self.write_off_amount,
"credit_in_transaction_currency": self.write_off_amount,
"cost_center": self.cost_center or self.write_off_cost_center,
},
item=self,

View File

@@ -16,7 +16,7 @@ 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.accounts_controller import InvalidQtyError, get_payment_terms
from erpnext.controllers.buying_controller import QtyMismatchError
from erpnext.exceptions import InvalidCurrency
from erpnext.projects.doctype.project.test_project import make_project
@@ -55,6 +55,16 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
def tearDown(self):
frappe.db.rollback()
def test_purchase_invoice_qty(self):
pi = make_purchase_invoice(qty=0, do_not_save=True)
with self.assertRaises(InvalidQtyError):
pi.save()
# No error with qty=1
pi.items[0].qty = 1
pi.save()
self.assertEqual(pi.items[0].qty, 1)
def test_purchase_invoice_received_qty(self):
"""
1. Test if received qty is validated against accepted + rejected
@@ -1653,7 +1663,7 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
pi = create_purchase_invoice_from_receipt(pr.name)
pi.set_posting_time = 1
pi.posting_date = add_days(pr.posting_date, -1)
pi.posting_date = add_days(pr.posting_date, 1)
pi.items[0].expense_account = "Cost of Goods Sold - _TC"
pi.save()
pi.submit()
@@ -1662,30 +1672,38 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
# Check GLE for Purchase Invoice
expected_gle = [
["Cost of Goods Sold - _TC", 250, 0, add_days(pr.posting_date, -1)],
["Creditors - _TC", 0, 250, add_days(pr.posting_date, -1)],
["Cost of Goods Sold - _TC", 250, 0, add_days(pr.posting_date, 1)],
["Creditors - _TC", 0, 250, add_days(pr.posting_date, 1)],
]
check_gl_entries(self, pi.name, expected_gle, pi.posting_date)
expected_gle_for_purchase_receipt = [
["Provision Account - _TC", 250, 0, pr.posting_date],
["_Test Account Cost for Goods Sold - _TC", 0, 250, pr.posting_date],
["Provision Account - _TC", 0, 250, pi.posting_date],
["_Test Account Cost for Goods Sold - _TC", 250, 0, pi.posting_date],
["_Test Account Cost for Goods Sold - _TC", 250, 0, pr.posting_date],
["Provision Account - _TC", 0, 250, pr.posting_date],
["_Test Account Cost for Goods Sold - _TC", 0, 250, pi.posting_date],
["Provision Account - _TC", 250, 0, pi.posting_date],
]
check_gl_entries(self, pr.name, expected_gle_for_purchase_receipt, pr.posting_date)
check_gl_entries(
self, pr.name, expected_gle_for_purchase_receipt, pr.posting_date, voucher_type="Purchase Receipt"
)
# Cancel purchase invoice to check reverse provisional entry cancellation
pi.cancel()
expected_gle_for_purchase_receipt_post_pi_cancel = [
["Provision Account - _TC", 0, 250, pi.posting_date],
["_Test Account Cost for Goods Sold - _TC", 250, 0, pi.posting_date],
["Provision Account - _TC", 0, 250, pi.posting_date],
]
check_gl_entries(self, pr.name, expected_gle_for_purchase_receipt_post_pi_cancel, pr.posting_date)
check_gl_entries(
self,
pr.name,
expected_gle_for_purchase_receipt_post_pi_cancel,
pi.posting_date,
voucher_type="Purchase Receipt",
)
toggle_provisional_accounting_setting()
@@ -1695,6 +1713,9 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
# Configure Buying Settings to allow rate change
frappe.db.set_single_value("Buying Settings", "maintain_same_rate", 0)
# Configure Accounts Settings to allow 300% over billing
frappe.db.set_single_value("Accounts Settings", "over_billing_allowance", 300)
# Create PR: rate = 1000, qty = 5
pr = make_purchase_receipt(
item_code="_Test Non Stock Item", rate=1000, posting_date=add_days(nowdate(), -2)
@@ -1703,7 +1724,7 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
# Overbill PR: rate = 2000, qty = 10
pi = create_purchase_invoice_from_receipt(pr.name)
pi.set_posting_time = 1
pi.posting_date = add_days(pr.posting_date, -1)
pi.posting_date = add_days(pr.posting_date, 1)
pi.items[0].qty = 10
pi.items[0].rate = 2000
pi.items[0].expense_account = "Cost of Goods Sold - _TC"
@@ -1711,30 +1732,38 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
pi.submit()
expected_gle = [
["Cost of Goods Sold - _TC", 20000, 0, add_days(pr.posting_date, -1)],
["Creditors - _TC", 0, 20000, add_days(pr.posting_date, -1)],
["Cost of Goods Sold - _TC", 20000, 0, add_days(pr.posting_date, 1)],
["Creditors - _TC", 0, 20000, add_days(pr.posting_date, 1)],
]
check_gl_entries(self, pi.name, expected_gle, pi.posting_date)
expected_gle_for_purchase_receipt = [
["Provision Account - _TC", 5000, 0, pr.posting_date],
["_Test Account Cost for Goods Sold - _TC", 0, 5000, pr.posting_date],
["Provision Account - _TC", 0, 5000, pi.posting_date],
["_Test Account Cost for Goods Sold - _TC", 5000, 0, pi.posting_date],
["_Test Account Cost for Goods Sold - _TC", 5000, 0, pr.posting_date],
["Provision Account - _TC", 0, 5000, pr.posting_date],
["_Test Account Cost for Goods Sold - _TC", 0, 5000, pi.posting_date],
["Provision Account - _TC", 5000, 0, pi.posting_date],
]
check_gl_entries(self, pr.name, expected_gle_for_purchase_receipt, pr.posting_date)
check_gl_entries(
self, pr.name, expected_gle_for_purchase_receipt, pr.posting_date, voucher_type="Purchase Receipt"
)
# Cancel purchase invoice to check reverse provisional entry cancellation
pi.cancel()
expected_gle_for_purchase_receipt_post_pi_cancel = [
["Provision Account - _TC", 0, 5000, pi.posting_date],
["_Test Account Cost for Goods Sold - _TC", 5000, 0, pi.posting_date],
["Provision Account - _TC", 0, 5000, pi.posting_date],
]
check_gl_entries(self, pr.name, expected_gle_for_purchase_receipt_post_pi_cancel, pr.posting_date)
check_gl_entries(
self,
pr.name,
expected_gle_for_purchase_receipt_post_pi_cancel,
pi.posting_date,
voucher_type="Purchase Receipt",
)
toggle_provisional_accounting_setting()
@@ -1767,13 +1796,76 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
check_gl_entries(self, pi.name, expected_gle, pi.posting_date)
expected_gle_for_purchase_receipt = [
["Provision Account - _TC", 5000, 0, pr.posting_date],
["_Test Account Cost for Goods Sold - _TC", 0, 5000, pr.posting_date],
["Provision Account - _TC", 0, 1000, pi.posting_date],
["_Test Account Cost for Goods Sold - _TC", 1000, 0, pi.posting_date],
["_Test Account Cost for Goods Sold - _TC", 5000, 0, pr.posting_date],
["Provision Account - _TC", 0, 5000, pr.posting_date],
["_Test Account Cost for Goods Sold - _TC", 0, 1000, pi.posting_date],
["Provision Account - _TC", 1000, 0, pi.posting_date],
]
check_gl_entries(self, pr.name, expected_gle_for_purchase_receipt, pr.posting_date)
check_gl_entries(
self, pr.name, expected_gle_for_purchase_receipt, pr.posting_date, voucher_type="Purchase Receipt"
)
toggle_provisional_accounting_setting()
def test_provisional_accounting_entry_multi_currency(self):
setup_provisional_accounting()
pr = make_purchase_receipt(
item_code="_Test Non Stock Item",
posting_date=add_days(nowdate(), -2),
qty=1000,
rate=111.11,
currency="USD",
do_not_save=1,
supplier="_Test Supplier USD",
)
pr.conversion_rate = 0.014783000
pr.save()
pr.submit()
pi = create_purchase_invoice_from_receipt(pr.name)
pi.set_posting_time = 1
pi.posting_date = add_days(pr.posting_date, 1)
pi.items[0].expense_account = "Cost of Goods Sold - _TC"
pi.save()
pi.submit()
self.assertEqual(pr.items[0].provisional_expense_account, "Provision Account - _TC")
# Check GLE for Purchase Invoice
expected_gle = [
["_Test Payable USD - _TC", 0, 1642.54, add_days(pr.posting_date, 1)],
["Cost of Goods Sold - _TC", 1642.54, 0, add_days(pr.posting_date, 1)],
]
check_gl_entries(self, pi.name, expected_gle, pi.posting_date)
expected_gle_for_purchase_receipt = [
["_Test Account Cost for Goods Sold - _TC", 1642.54, 0, pr.posting_date],
["Provision Account - _TC", 0, 1642.54, pr.posting_date],
["_Test Account Cost for Goods Sold - _TC", 0, 1642.54, pi.posting_date],
["Provision Account - _TC", 1642.54, 0, pi.posting_date],
]
check_gl_entries(
self, pr.name, expected_gle_for_purchase_receipt, pr.posting_date, voucher_type="Purchase Receipt"
)
# Cancel purchase invoice to check reverse provisional entry cancellation
pi.cancel()
expected_gle_for_purchase_receipt_post_pi_cancel = [
["_Test Account Cost for Goods Sold - _TC", 1642.54, 0, pi.posting_date],
["Provision Account - _TC", 0, 1642.54, pi.posting_date],
]
check_gl_entries(
self,
pr.name,
expected_gle_for_purchase_receipt_post_pi_cancel,
pi.posting_date,
voucher_type="Purchase Receipt",
)
toggle_provisional_accounting_setting()
@@ -2094,7 +2186,7 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
1,
)
pi = make_pi_from_pr(pr.name)
self.assertEqual(pi.payment_schedule[0].payment_amount, 2500)
self.assertEqual(pi.payment_schedule[0].payment_amount, 1000)
automatically_fetch_payment_terms(enable=0)
frappe.db.set_value(
@@ -2639,6 +2731,171 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
"Buying Settings", "bill_for_rejected_quantity_in_purchase_invoice", original_value
)
def test_trx_currency_debit_credit_for_high_precision(self):
exc_rate = 0.737517516
pi = make_purchase_invoice(
currency="USD", conversion_rate=exc_rate, qty=1, rate=2000, do_not_save=True
)
pi.supplier = "_Test Supplier USD"
pi.save().submit()
expected = (
("_Test Account Cost for Goods Sold - _TC", 1475.04, 0.0, 2000.0, 0.0, "USD", exc_rate),
("_Test Payable USD - _TC", 0.0, 1475.04, 0.0, 2000.0, "USD", exc_rate),
)
actual = frappe.db.get_all(
"GL Entry",
filters={"voucher_no": pi.name},
fields=[
"account",
"debit",
"credit",
"debit_in_transaction_currency",
"credit_in_transaction_currency",
"transaction_currency",
"transaction_exchange_rate",
],
order_by="account",
as_list=1,
)
self.assertEqual(actual, expected)
def test_prevents_fully_returned_invoice_with_zero_quantity(self):
from erpnext.controllers.sales_and_purchase_return import StockOverReturnError, make_return_doc
invoice = make_purchase_invoice(qty=10)
return_doc = make_return_doc(invoice.doctype, invoice.name)
return_doc.items[0].qty = -10
return_doc.save().submit()
return_doc = make_return_doc(invoice.doctype, invoice.name)
return_doc.items[0].qty = 0
self.assertRaises(StockOverReturnError, return_doc.save)
def test_apply_discount_on_grand_total(self):
"""
To test if after applying discount on grand total,
the grand total is calculated correctly without any rounding errors
"""
invoice = make_purchase_invoice(qty=3, rate=100, do_not_save=True, do_not_submit=True)
invoice.append(
"items",
{
"item_code": "_Test Item",
"qty": 3,
"rate": 50.3,
},
)
invoice.append(
"taxes",
{
"charge_type": "On Net Total",
"account_head": "_Test Account VAT - _TC",
"description": "VAT",
"rate": 15,
},
)
# the grand total here will be 518.54
invoice.disable_rounded_total = 1
# apply discount on grand total to adjust the grand total to 518
invoice.discount_amount = 0.54
invoice.save()
# check if grand total is 518 and not something like 517.99 due to rounding errors
self.assertEqual(invoice.grand_total, 518)
def test_apply_discount_on_grand_total_with_previous_row_total_tax(self):
"""
To test if after applying discount on grand total,
where the tax is calculated on previous row total, the grand total is calculated correctly
"""
invoice = make_purchase_invoice(qty=2, rate=100, do_not_save=True, do_not_submit=True)
invoice.extend(
"taxes",
[
{
"charge_type": "Actual",
"account_head": "_Test Account VAT - _TC",
"description": "VAT",
"tax_amount": 100,
},
{
"charge_type": "On Previous Row Amount",
"account_head": "_Test Account VAT - _TC",
"description": "VAT",
"row_id": 1,
"rate": 10,
},
{
"charge_type": "On Previous Row Total",
"account_head": "_Test Account VAT - _TC",
"description": "VAT",
"row_id": 1,
"rate": 10,
},
],
)
# the total here will be 340, so applying 40 discount
invoice.discount_amount = 40
invoice.save()
self.assertEqual(invoice.grand_total, 300)
def test_pr_pi_over_billing(self):
from erpnext.stock.doctype.purchase_receipt.purchase_receipt import (
make_purchase_invoice as make_purchase_invoice_from_pr,
)
# Configure Buying Settings to allow rate change
frappe.db.set_single_value("Buying Settings", "maintain_same_rate", 0)
pr = make_purchase_receipt(qty=10, rate=10)
pi = make_purchase_invoice_from_pr(pr.name)
pi.items[0].rate = 12
# Test 1 - This will fail because over billing is not allowed
self.assertRaises(frappe.ValidationError, pi.submit)
frappe.db.set_single_value("Buying Settings", "set_landed_cost_based_on_purchase_invoice_rate", 1)
# Test 2 - This will now submit because over billing allowance is ignored when set_landed_cost_based_on_purchase_invoice_rate is checked
pi.submit()
frappe.db.set_single_value("Buying Settings", "set_landed_cost_based_on_purchase_invoice_rate", 0)
frappe.db.set_single_value("Accounts Settings", "over_billing_allowance", 20)
pi.cancel()
pi = make_purchase_invoice_from_pr(pr.name)
pi.items[0].rate = 12
# Test 3 - This will now submit because over billing is allowed upto 20%
pi.submit()
pi.reload()
pi.cancel()
pi = make_purchase_invoice_from_pr(pr.name)
pi.items[0].rate = 13
# Test 4 - Since this PI is overbilled by 130% and only 120% is allowed, it will fail
self.assertRaises(frappe.ValidationError, pi.submit)
def test_discount_percentage_not_set_when_amount_is_manually_set(self):
pi = make_purchase_invoice(do_not_save=True)
discount_amount = 7
pi.discount_amount = discount_amount
pi.save()
self.assertEqual(pi.additional_discount_percentage, None)
pi.set_posting_time = 1
pi.posting_date = add_days(today(), -1)
pi.save()
self.assertEqual(pi.discount_amount, discount_amount)
def set_advance_flag(company, flag, default_account):
frappe.db.set_value(
@@ -2748,7 +3005,7 @@ def make_purchase_invoice(**args):
bundle_id = None
if not args.use_serial_batch_fields and (args.get("batch_no") or args.get("serial_no")):
batches = {}
qty = args.qty or 5
qty = args.qty if args.qty is not None else 5
item_code = args.item or args.item_code or "_Test Item"
if args.get("batch_no"):
batches = frappe._dict({args.batch_no: qty})
@@ -2777,7 +3034,7 @@ def make_purchase_invoice(**args):
"item_code": args.item or args.item_code or "_Test Item",
"item_name": args.item_name,
"warehouse": args.warehouse or "_Test Warehouse - _TC",
"qty": args.qty or 5,
"qty": args.qty if args.qty is not None else 5,
"received_qty": args.received_qty or 0,
"rejected_qty": args.rejected_qty or 0,
"rate": args.rate or 50,

View File

@@ -38,6 +38,7 @@
"column_break_30",
"discount_percentage",
"discount_amount",
"distributed_discount_amount",
"base_rate_with_margin",
"sec_break2",
"rate",
@@ -461,7 +462,8 @@
"depends_on": "eval:!doc.is_fixed_asset && doc.use_serial_batch_fields === 1 && parent.update_stock === 1",
"fieldname": "serial_no",
"fieldtype": "Text",
"label": "Serial No"
"label": "Serial No",
"no_copy": 1
},
{
"depends_on": "eval:!doc.is_fixed_asset && doc.use_serial_batch_fields === 1 && parent.update_stock === 1",
@@ -839,7 +841,7 @@
},
{
"collapsible": 1,
"collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount",
"collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount || doc.distributed_discount_amount",
"fieldname": "section_break_26",
"fieldtype": "Section Break",
"label": "Discount and Margin"
@@ -970,12 +972,18 @@
"no_copy": 1,
"options": "Company:company:default_currency",
"print_hide": 1
},
{
"fieldname": "distributed_discount_amount",
"fieldtype": "Currency",
"label": "Distributed Discount Amount",
"options": "currency"
}
],
"idx": 1,
"istable": 1,
"links": [],
"modified": "2024-10-28 15:06:19.246141",
"modified": "2025-03-12 16:33:13.453290",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",
@@ -985,4 +993,4 @@
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
}

View File

@@ -34,6 +34,7 @@ class PurchaseInvoiceItem(Document):
description: DF.TextEditor | None
discount_amount: DF.Currency
discount_percentage: DF.Percent
distributed_discount_amount: DF.Currency
enable_deferred_expense: DF.Check
expense_account: DF.Link | None
from_warehouse: DF.Link | None

View File

@@ -196,7 +196,7 @@
"fieldname": "item_wise_tax_detail",
"fieldtype": "Code",
"hidden": 1,
"label": "Item Wise Tax Detail ",
"label": "Item Wise Tax Detail",
"oldfieldname": "item_wise_tax_detail",
"oldfieldtype": "Small Text",
"print_hide": 1,
@@ -235,10 +235,11 @@
"read_only": 1
}
],
"grid_page_length": 50,
"idx": 1,
"istable": 1,
"links": [],
"modified": "2024-04-08 19:51:36.678551",
"modified": "2025-04-15 13:14:48.936047",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Taxes and Charges",

View File

@@ -8,6 +8,8 @@ from frappe import _, qb
from frappe.model.document import Document
from frappe.utils.data import comma_and
from erpnext.stock import get_warehouse_account_map
class RepostAccountingLedger(Document):
# begin: auto-generated types
@@ -97,6 +99,9 @@ class RepostAccountingLedger(Document):
doc = frappe.get_doc(x.voucher_type, x.voucher_no)
if doc.doctype in ["Payment Entry", "Journal Entry"]:
gle_map = doc.build_gl_map()
elif doc.doctype == "Purchase Receipt":
warehouse_account_map = get_warehouse_account_map(doc.company)
gle_map = doc.get_gl_entries(warehouse_account_map)
else:
gle_map = doc.get_gl_entries()
@@ -177,6 +182,14 @@ def start_repost(account_repost_doc=str) -> None:
doc.force_set_against_expense_account()
doc.make_gl_entries()
elif doc.doctype == "Purchase Receipt":
if not repost_doc.delete_cancelled_entries:
doc.docstatus = 2
doc.make_gl_entries_on_cancel()
doc.docstatus = 1
doc.make_gl_entries(from_repost=True)
elif doc.doctype in ["Payment Entry", "Journal Entry", "Expense Claim"]:
if not repost_doc.delete_cancelled_entries:
doc.make_gl_entries(1)

View File

@@ -12,6 +12,8 @@ from erpnext.accounts.doctype.payment_request.payment_request import make_paymen
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.accounts.utils import get_fiscal_year
from erpnext.stock.doctype.item.test_item import make_item
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import get_gl_entries, make_purchase_receipt
class TestRepostAccountingLedger(AccountsTestMixin, FrappeTestCase):
@@ -204,9 +206,81 @@ class TestRepostAccountingLedger(AccountsTestMixin, FrappeTestCase):
self.assertIsNotNone(frappe.db.exists("GL Entry", {"voucher_no": si.name, "is_cancelled": 1}))
self.assertIsNotNone(frappe.db.exists("GL Entry", {"voucher_no": pe.name, "is_cancelled": 1}))
def test_06_repost_purchase_receipt(self):
from erpnext.accounts.doctype.account.test_account import create_account
provisional_account = create_account(
account_name="Provision Account",
parent_account="Current Liabilities - _TC",
company=self.company,
)
another_provisional_account = create_account(
account_name="Another Provision Account",
parent_account="Current Liabilities - _TC",
company=self.company,
)
company = frappe.get_doc("Company", self.company)
company.enable_provisional_accounting_for_non_stock_items = 1
company.default_provisional_account = provisional_account
company.save()
test_cc = company.cost_center
default_expense_account = company.default_expense_account
item = make_item(properties={"is_stock_item": 0})
pr = make_purchase_receipt(company=self.company, item_code=item.name, rate=1000.0, qty=1.0)
pr_gl_entries = get_gl_entries(pr.doctype, pr.name, skip_cancelled=True)
expected_pr_gles = [
{"account": provisional_account, "debit": 0.0, "credit": 1000.0, "cost_center": test_cc},
{"account": default_expense_account, "debit": 1000.0, "credit": 0.0, "cost_center": test_cc},
]
self.assertEqual(expected_pr_gles, pr_gl_entries)
# change the provisional account
frappe.db.set_value(
"Purchase Receipt Item",
pr.items[0].name,
"provisional_expense_account",
another_provisional_account,
)
repost_doc = frappe.new_doc("Repost Accounting Ledger")
repost_doc.company = self.company
repost_doc.delete_cancelled_entries = True
repost_doc.append("vouchers", {"voucher_type": pr.doctype, "voucher_no": pr.name})
repost_doc.save().submit()
pr_gles_after_repost = get_gl_entries(pr.doctype, pr.name, skip_cancelled=True)
expected_pr_gles_after_repost = [
{"account": default_expense_account, "debit": 1000.0, "credit": 0.0, "cost_center": test_cc},
{"account": another_provisional_account, "debit": 0.0, "credit": 1000.0, "cost_center": test_cc},
]
self.assertEqual(len(pr_gles_after_repost), len(expected_pr_gles_after_repost))
self.assertEqual(expected_pr_gles_after_repost, pr_gles_after_repost)
# teardown
repost_doc.cancel()
repost_doc.delete()
pr.reload()
pr.cancel()
company.enable_provisional_accounting_for_non_stock_items = 0
company.default_provisional_account = None
company.save()
def update_repost_settings():
allowed_types = ["Sales Invoice", "Purchase Invoice", "Payment Entry", "Journal Entry"]
allowed_types = [
"Sales Invoice",
"Purchase Invoice",
"Payment Entry",
"Journal Entry",
"Purchase Receipt",
]
repost_settings = frappe.get_doc("Repost Accounting Ledger Settings")
for x in allowed_types:
repost_settings.append("allowed_types", {"document_type": x, "allowed": True})

View File

@@ -782,24 +782,6 @@ frappe.ui.form.on("Sales Invoice", {
};
};
},
// When multiple companies are set up. in case company name is changed set default company address
company: function (frm) {
if (frm.doc.company) {
frappe.call({
method: "erpnext.setup.doctype.company.company.get_default_company_address",
args: { name: frm.doc.company, existing_address: frm.doc.company_address || "" },
debounce: 2000,
callback: function (r) {
if (r.message) {
frm.set_value("company_address", r.message);
} else {
frm.set_value("company_address", "");
}
},
});
}
},
onload: function (frm) {
frm.redemption_conversion_factor = null;
},
@@ -1102,6 +1084,18 @@ frappe.ui.form.on("Sales Invoice Timesheet", {
},
});
frappe.ui.form.on("Sales Invoice Payment", {
mode_of_payment: function (frm) {
frappe.call({
doc: frm.doc,
method: "set_account_for_mode_of_payment",
callback: function (r) {
refresh_field("payments");
},
});
},
});
var set_timesheet_detail_rate = function (cdt, cdn, currency, timelog) {
frappe.call({
method: "erpnext.projects.doctype.timesheet.timesheet.get_timesheet_detail_rate",

View File

@@ -3,7 +3,6 @@
"allow_import": 1,
"autoname": "naming_series:",
"creation": "2022-01-25 10:29:57.771398",
"default_print_format": "Sales Invoice Print",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
@@ -2025,6 +2024,7 @@
"fieldname": "amount_eligible_for_commission",
"fieldtype": "Currency",
"label": "Amount Eligible for Commission",
"options": "Company:company:default_currency",
"read_only": 1
},
{
@@ -2189,7 +2189,7 @@
"link_fieldname": "consolidated_invoice"
}
],
"modified": "2025-03-05 17:06:59.720616",
"modified": "2025-06-26 14:06:56.773552",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
@@ -2245,4 +2245,4 @@
"title_field": "title",
"track_changes": 1,
"track_seen": 1
}
}

View File

@@ -267,8 +267,8 @@ class SalesInvoice(SellingController):
self.indicator_title = _("Paid")
def validate(self):
super().validate()
self.validate_auto_set_posting_time()
super().validate()
if not (self.is_pos or self.is_debit_note):
self.so_dn_required()
@@ -461,6 +461,7 @@ class SalesInvoice(SellingController):
self.make_bundle_for_sales_purchase_return(table_name)
self.make_bundle_using_old_serial_batch_fields(table_name)
self.validate_standalone_serial_nos_customer()
self.update_stock_reservation_entries()
self.update_stock_ledger()
@@ -678,7 +679,13 @@ class SalesInvoice(SellingController):
"Account", self.debit_to, "account_currency", cache=True
)
if not self.due_date and self.customer:
self.due_date = get_due_date(self.posting_date, "Customer", self.customer, self.company)
self.due_date = get_due_date(
self.posting_date,
"Customer",
self.customer,
self.company,
template_name=self.payment_terms_template,
)
super().set_missing_values(for_validate)
@@ -745,10 +752,10 @@ class SalesInvoice(SellingController):
self.paid_amount = paid_amount
self.base_paid_amount = base_paid_amount
@frappe.whitelist()
def set_account_for_mode_of_payment(self):
for payment in self.payments:
if not payment.account:
payment.account = get_bank_cash_account(payment.mode_of_payment, self.company).get("account")
payment.account = get_bank_cash_account(payment.mode_of_payment, self.company).get("account")
def validate_time_sheets_are_submitted(self):
for data in self.timesheets:
@@ -1241,6 +1248,7 @@ class SalesInvoice(SellingController):
self.make_write_off_gl_entry(gl_entries)
self.make_gle_for_rounding_adjustment(gl_entries)
self.set_transaction_currency_and_rate_in_gl_map(gl_entries)
return gl_entries
def make_customer_gl_entry(self, gl_entries):
@@ -1274,6 +1282,7 @@ class SalesInvoice(SellingController):
"debit_in_account_currency": base_grand_total
if self.party_account_currency == self.company_currency
else grand_total,
"debit_in_transaction_currency": grand_total,
"against_voucher": against_voucher,
"against_voucher_type": self.doctype,
"cost_center": self.cost_center,
@@ -1305,6 +1314,9 @@ class SalesInvoice(SellingController):
if account_currency == self.company_currency
else flt(amount, tax.precision("tax_amount_after_discount_amount"))
),
"credit_in_transaction_currency": flt(
amount, tax.precision("tax_amount_after_discount_amount")
),
"cost_center": tax.cost_center,
},
account_currency,
@@ -1322,6 +1334,7 @@ class SalesInvoice(SellingController):
"against": self.customer,
"debit": flt(self.total_taxes_and_charges),
"debit_in_account_currency": flt(self.base_total_taxes_and_charges),
"debit_in_transaction_currency": flt(self.total_taxes_and_charges),
"cost_center": self.cost_center,
},
account_currency,
@@ -1336,7 +1349,7 @@ class SalesInvoice(SellingController):
)
for item in self.get("items"):
if flt(item.base_net_amount, item.precision("base_net_amount")):
if flt(item.base_net_amount, item.precision("base_net_amount")) or item.is_fixed_asset:
# Do not book income for transfer within same company
if self.is_internal_transfer():
continue
@@ -1344,7 +1357,9 @@ class SalesInvoice(SellingController):
if item.is_fixed_asset:
asset = self.get_asset(item)
if self.is_return:
if (self.docstatus == 2 and not self.is_return) or (
self.docstatus == 1 and self.is_return
):
fixed_asset_gl_entries = get_gl_entries_on_asset_regain(
asset,
item.base_net_amount,
@@ -1357,8 +1372,10 @@ class SalesInvoice(SellingController):
add_asset_activity(asset.name, _("Asset returned"))
if asset.calculate_depreciation:
posting_date = frappe.db.get_value(
"Sales Invoice", self.return_against, "posting_date"
posting_date = (
frappe.db.get_value("Sales Invoice", self.return_against, "posting_date")
if self.is_return
else self.posting_date
)
reverse_depreciation_entry_made_after_disposal(asset, posting_date)
notes = _(
@@ -1420,6 +1437,7 @@ class SalesInvoice(SellingController):
if account_currency == self.company_currency
else flt(amount, item.precision("net_amount"))
),
"credit_in_transaction_currency": flt(amount, item.precision("net_amount")),
"cost_center": item.cost_center,
"project": item.project or self.project,
},
@@ -1454,8 +1472,10 @@ class SalesInvoice(SellingController):
return self._enable_discount_accounting
def set_asset_status(self, asset):
if self.is_return:
if self.is_return and not self.docstatus == 2:
asset.set_status()
elif self.is_return and self.docstatus == 2:
asset.set_status("Sold")
else:
asset.set_status("Sold" if self.docstatus == 1 else None)
@@ -1471,6 +1491,7 @@ class SalesInvoice(SellingController):
+ cstr(self.loyalty_redemption_account)
+ " for the Loyalty Program",
"credit": self.loyalty_amount,
"credit_in_transaction_currency": self.loyalty_amount,
"against_voucher": self.return_against if cint(self.is_return) else self.name,
"against_voucher_type": self.doctype,
"cost_center": self.cost_center,
@@ -1485,6 +1506,7 @@ class SalesInvoice(SellingController):
"cost_center": self.cost_center or self.loyalty_redemption_cost_center,
"against": self.customer,
"debit": self.loyalty_amount,
"debit_in_transaction_currency": self.loyalty_amount,
"remark": "Loyalty Points redeemed by the customer",
},
item=self,
@@ -1518,6 +1540,7 @@ class SalesInvoice(SellingController):
"credit_in_account_currency": payment_mode.base_amount
if self.party_account_currency == self.company_currency
else payment_mode.amount,
"credit_in_transaction_currency": payment_mode.amount,
"against_voucher": against_voucher,
"against_voucher_type": self.doctype,
"cost_center": self.cost_center,
@@ -1537,6 +1560,7 @@ class SalesInvoice(SellingController):
"debit_in_account_currency": payment_mode.base_amount
if payment_mode_account_currency == self.company_currency
else payment_mode.amount,
"debit_in_transaction_currency": payment_mode.amount,
"cost_center": self.cost_center,
},
payment_mode_account_currency,
@@ -1561,6 +1585,7 @@ class SalesInvoice(SellingController):
"debit_in_account_currency": flt(self.base_change_amount)
if self.party_account_currency == self.company_currency
else flt(self.change_amount),
"debit_in_transaction_currency": flt(self.change_amount),
"against_voucher": self.return_against
if cint(self.is_return) and self.return_against
else self.name,
@@ -1579,6 +1604,7 @@ class SalesInvoice(SellingController):
"account": self.account_for_change_amount,
"against": self.customer,
"credit": self.base_change_amount,
"credit_in_transaction_currency": self.change_amount,
"cost_center": self.cost_center,
},
item=self,
@@ -1610,6 +1636,9 @@ class SalesInvoice(SellingController):
if self.party_account_currency == self.company_currency
else flt(self.write_off_amount, self.precision("write_off_amount"))
),
"credit_in_transaction_currency": flt(
self.write_off_amount, self.precision("write_off_amount")
),
"against_voucher": self.return_against if cint(self.is_return) else self.name,
"against_voucher_type": self.doctype,
"cost_center": self.cost_center,
@@ -1630,6 +1659,9 @@ class SalesInvoice(SellingController):
if write_off_account_currency == self.company_currency
else flt(self.write_off_amount, self.precision("write_off_amount"))
),
"debit_in_transaction_currency": flt(
self.write_off_amount, self.precision("write_off_amount")
),
"cost_center": self.cost_center or self.write_off_cost_center or default_cost_center,
},
write_off_account_currency,
@@ -1674,6 +1706,9 @@ class SalesInvoice(SellingController):
"credit_in_account_currency": flt(
self.rounding_adjustment, self.precision("rounding_adjustment")
),
"credit_in_transaction_currency": flt(
self.rounding_adjustment, self.precision("rounding_adjustment")
),
"credit": flt(
self.base_rounding_adjustment, self.precision("base_rounding_adjustment")
),
@@ -2258,6 +2293,18 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
set_purchase_references(target)
def update_details(source_doc, target_doc, source_parent):
def _validate_address_link(address, link_doctype, link_name):
return frappe.db.get_value(
"Dynamic Link",
{
"parent": address,
"parenttype": "Address",
"link_doctype": link_doctype,
"link_name": link_name,
},
"parent",
)
target_doc.inter_company_invoice_reference = source_doc.name
if target_doc.doctype in ["Purchase Invoice", "Purchase Order"]:
currency = frappe.db.get_value("Supplier", details.get("party"), "default_currency")
@@ -2268,13 +2315,34 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
target_doc.buying_price_list = source_doc.selling_price_list
# Invert Addresses
update_address(target_doc, "supplier_address", "address_display", source_doc.company_address)
update_address(
target_doc, "shipping_address", "shipping_address_display", source_doc.customer_address
)
update_address(
target_doc, "billing_address", "billing_address_display", source_doc.customer_address
)
if source_doc.company_address and _validate_address_link(
source_doc.company_address, "Supplier", details.get("party")
):
update_address(target_doc, "supplier_address", "address_display", source_doc.company_address)
if source_doc.dispatch_address_name and _validate_address_link(
source_doc.dispatch_address_name, "Company", details.get("company")
):
update_address(
target_doc,
"dispatch_address",
"dispatch_address_display",
source_doc.dispatch_address_name,
)
if source_doc.shipping_address_name and _validate_address_link(
source_doc.shipping_address_name, "Company", details.get("company")
):
update_address(
target_doc,
"shipping_address",
"shipping_address_display",
source_doc.shipping_address_name,
)
if source_doc.customer_address and _validate_address_link(
source_doc.customer_address, "Company", details.get("company")
):
update_address(
target_doc, "billing_address", "billing_address_display", source_doc.customer_address
)
if currency:
target_doc.currency = currency
@@ -2295,13 +2363,22 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
target_doc.customer = details.get("party")
target_doc.selling_price_list = source_doc.buying_price_list
update_address(
target_doc, "company_address", "company_address_display", source_doc.supplier_address
)
update_address(
target_doc, "shipping_address_name", "shipping_address", source_doc.shipping_address
)
update_address(target_doc, "customer_address", "address_display", source_doc.shipping_address)
if source_doc.supplier_address and _validate_address_link(
source_doc.supplier_address, "Company", details.get("company")
):
update_address(
target_doc, "company_address", "company_address_display", source_doc.supplier_address
)
if source_doc.shipping_address and _validate_address_link(
source_doc.shipping_address, "Customer", details.get("party")
):
update_address(
target_doc, "shipping_address_name", "shipping_address", source_doc.shipping_address
)
if source_doc.shipping_address and _validate_address_link(
source_doc.shipping_address, "Customer", details.get("party")
):
update_address(target_doc, "customer_address", "address_display", source_doc.shipping_address)
if currency:
target_doc.currency = currency
@@ -2692,9 +2769,11 @@ def create_dunning(source_name, target_doc=None, ignore_permissions=False):
target.closing_text = letter_text.get("closing_text")
target.language = letter_text.get("language")
# update outstanding
# update outstanding from doc
if source.payment_schedule and len(source.payment_schedule) == 1:
target.overdue_payments[0].outstanding = source.get("outstanding_amount")
for row in target.overdue_payments:
if row.payment_schedule == source.payment_schedule[0].name:
row.outstanding = source.get("outstanding_amount")
target.validate()

View File

@@ -12,6 +12,9 @@ from frappe.utils import add_days, flt, format_date, getdate, nowdate, today
import erpnext
from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account
from erpnext.accounts.doctype.mode_of_payment.test_mode_of_payment import (
set_default_account_for_mode_of_payment,
)
from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile
from erpnext.accounts.doctype.purchase_invoice.purchase_invoice import WarehouseMissingError
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import (
@@ -24,7 +27,7 @@ from erpnext.assets.doctype.asset.test_asset import create_asset, create_asset_d
from erpnext.assets.doctype.asset_depreciation_schedule.asset_depreciation_schedule import (
get_depr_schedule,
)
from erpnext.controllers.accounts_controller import update_invoice_status
from erpnext.controllers.accounts_controller import InvalidQtyError, update_invoice_status
from erpnext.controllers.taxes_and_totals import get_itemised_tax_breakup_data
from erpnext.exceptions import InvalidAccountCurrency, InvalidCurrency
from erpnext.selling.doctype.customer.test_customer import get_customer_dict
@@ -54,8 +57,33 @@ class TestSalesInvoice(FrappeTestCase):
create_items(["_Test Internal Transfer Item"], uoms=[{"uom": "Box", "conversion_factor": 10}])
create_internal_parties()
setup_accounts()
mode_of_payment = frappe.get_doc("Mode of Payment", "Bank Draft")
set_default_account_for_mode_of_payment(mode_of_payment, "_Test Company", "_Test Bank - _TC")
set_default_account_for_mode_of_payment(
mode_of_payment, "_Test Company with perpetual inventory", "_Test Bank - TCP1"
)
frappe.db.set_single_value("Accounts Settings", "acc_frozen_upto", None)
@change_settings(
"Accounts Settings",
{"maintain_same_internal_transaction_rate": 1, "maintain_same_rate_action": "Stop"},
)
def test_invalid_rate_without_override(self):
from frappe import ValidationError
from erpnext.accounts.doctype.sales_invoice.sales_invoice import make_inter_company_purchase_invoice
si = create_sales_invoice(
customer="_Test Internal Customer 3", company="_Test Company", is_internal_customer=1, rate=100
)
pi = make_inter_company_purchase_invoice(si.name)
pi.items[0].rate = 120
with self.assertRaises(ValidationError) as e:
pi.insert()
pi.submit()
self.assertIn("Rate must be same", str(e.exception))
def tearDown(self):
frappe.db.rollback()
@@ -74,6 +102,16 @@ class TestSalesInvoice(FrappeTestCase):
def tearDownClass(self):
unlink_payment_on_cancel_of_invoice(0)
def test_sales_invoice_qty(self):
si = create_sales_invoice(qty=0, do_not_save=True)
with self.assertRaises(InvalidQtyError):
si.save()
# No error with qty=1
si.items[0].qty = 1
si.save()
self.assertEqual(si.items[0].qty, 1)
def test_timestamp_change(self):
w = frappe.copy_doc(test_records[0])
w.docstatus = 0
@@ -798,6 +836,10 @@ class TestSalesInvoice(FrappeTestCase):
w = self.make()
self.assertEqual(w.outstanding_amount, w.base_rounded_total)
@change_settings(
"Accounts Settings",
{"add_taxes_from_item_tax_template": 0, "add_taxes_from_taxes_and_charges_template": 0},
)
def test_rounded_total_with_cash_discount(self):
si = frappe.copy_doc(test_records[2])
@@ -964,10 +1006,8 @@ class TestSalesInvoice(FrappeTestCase):
pos.is_pos = 1
pos.update_stock = 1
pos.append(
"payments", {"mode_of_payment": "Bank Draft", "account": "_Test Bank - TCP1", "amount": 50}
)
pos.append("payments", {"mode_of_payment": "Cash", "account": "Cash - TCP1", "amount": 50})
pos.append("payments", {"mode_of_payment": "Bank Draft", "amount": 50})
pos.append("payments", {"mode_of_payment": "Cash", "amount": 50})
taxes = get_taxes_and_charges()
pos.taxes = []
@@ -996,10 +1036,8 @@ class TestSalesInvoice(FrappeTestCase):
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.append("payments", {"mode_of_payment": "Bank Draft", "amount": 500})
pos.append("payments", {"mode_of_payment": "Cash", "amount": 500})
pos.insert()
pos.submit()
@@ -1042,10 +1080,8 @@ class TestSalesInvoice(FrappeTestCase):
pos.is_pos = 1
pos.update_stock = 1
pos.append(
"payments", {"mode_of_payment": "Bank Draft", "account": "_Test Bank - TCP1", "amount": 50}
)
pos.append("payments", {"mode_of_payment": "Cash", "account": "Cash - TCP1", "amount": 60})
pos.append("payments", {"mode_of_payment": "Bank Draft", "amount": 50})
pos.append("payments", {"mode_of_payment": "Cash", "amount": 60})
pos.write_off_outstanding_amount_automatically = 1
pos.insert()
@@ -1085,10 +1121,8 @@ class TestSalesInvoice(FrappeTestCase):
pos.is_pos = 1
pos.update_stock = 1
pos.append(
"payments", {"mode_of_payment": "Bank Draft", "account": "_Test Bank - TCP1", "amount": 50}
)
pos.append("payments", {"mode_of_payment": "Cash", "account": "Cash - TCP1", "amount": 40})
pos.append("payments", {"mode_of_payment": "Bank Draft", "amount": 50})
pos.append("payments", {"mode_of_payment": "Cash", "amount": 40})
pos.write_off_outstanding_amount_automatically = 1
pos.insert()
@@ -1102,7 +1136,7 @@ class TestSalesInvoice(FrappeTestCase):
pos = create_sales_invoice(do_not_save=True)
pos.is_pos = 1
pos.append("payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 100})
pos.append("payments", {"mode_of_payment": "Cash", "amount": 100})
pos.save().submit()
self.assertEqual(pos.outstanding_amount, 0.0)
self.assertEqual(pos.status, "Paid")
@@ -1173,10 +1207,8 @@ class TestSalesInvoice(FrappeTestCase):
for tax in taxes:
pos.append("taxes", tax)
pos.append(
"payments", {"mode_of_payment": "Bank Draft", "account": "_Test Bank - TCP1", "amount": 50}
)
pos.append("payments", {"mode_of_payment": "Cash", "account": "Cash - TCP1", "amount": 60})
pos.append("payments", {"mode_of_payment": "Bank Draft", "amount": 50})
pos.append("payments", {"mode_of_payment": "Cash", "amount": 60})
pos.insert()
pos.submit()
@@ -1819,17 +1851,6 @@ class TestSalesInvoice(FrappeTestCase):
for field in expected_gle:
self.assertEqual(expected_gle[field], gle[field])
def test_invoice_exchange_rate(self):
si = create_sales_invoice(
customer="_Test Customer USD",
debit_to="_Test Receivable USD - _TC",
currency="USD",
conversion_rate=1,
do_not_save=1,
)
self.assertRaises(frappe.ValidationError, si.save)
def test_invalid_currency(self):
# Customer currency = USD
@@ -2476,6 +2497,10 @@ class TestSalesInvoice(FrappeTestCase):
for gle in gl_entries:
self.assertEqual(expected_values[gle.account]["cost_center"], gle.cost_center)
@change_settings(
"Accounts Settings",
{"book_deferred_entries_based_on": "Days", "book_deferred_entries_via_journal_entry": 0},
)
def test_deferred_revenue(self):
deferred_account = create_account(
account_name="Deferred Revenue",
@@ -2530,6 +2555,10 @@ class TestSalesInvoice(FrappeTestCase):
self.assertRaises(frappe.ValidationError, si.save)
@change_settings(
"Accounts Settings",
{"book_deferred_entries_based_on": "Months", "book_deferred_entries_via_journal_entry": 0},
)
def test_fixed_deferred_revenue(self):
deferred_account = create_account(
account_name="Deferred Revenue",
@@ -2537,10 +2566,6 @@ class TestSalesInvoice(FrappeTestCase):
company="_Test Company",
)
acc_settings = frappe.get_doc("Accounts Settings", "Accounts Settings")
acc_settings.book_deferred_entries_based_on = "Months"
acc_settings.save()
item = create_item("_Test Item for Deferred Accounting")
item.enable_deferred_revenue = 1
item.deferred_revenue_account = deferred_account
@@ -2580,9 +2605,61 @@ class TestSalesInvoice(FrappeTestCase):
check_gl_entries(self, si.name, expected_gle, "2019-01-30")
acc_settings = frappe.get_doc("Accounts Settings", "Accounts Settings")
acc_settings.book_deferred_entries_based_on = "Days"
acc_settings.save()
def test_validate_inter_company_transaction_address_links(self):
def _validate_address_link(address, link_doctype, link_name):
return frappe.db.get_value(
"Dynamic Link",
{
"parent": address,
"parenttype": "Address",
"link_doctype": link_doctype,
"link_name": link_name,
},
"parent",
)
si = create_sales_invoice(
company="Wind Power LLC",
customer="_Test Internal Customer",
debit_to="Debtors - WP",
warehouse="Stores - WP",
income_account="Sales - WP",
expense_account="Cost of Goods Sold - WP",
cost_center="Main - WP",
currency="USD",
do_not_save=1,
)
si.selling_price_list = "_Test Price List Rest of the World"
si.submit()
target_doc = make_inter_company_transaction("Sales Invoice", si.name)
target_doc.items[0].update(
{
"expense_account": "Cost of Goods Sold - _TC1",
"cost_center": "Main - _TC1",
"warehouse": "Stores - _TC1",
}
)
target_doc.save()
if target_doc.doctype in ["Purchase Invoice", "Purchase Order"]:
for details in [
("supplier_address", "Supplier", target_doc.supplier),
("dispatch_address", "Company", target_doc.company),
("shipping_address", "Company", target_doc.company),
("billing_address", "Company", target_doc.company),
]:
if address := target_doc.get(details[0]):
self.assertEqual(address, _validate_address_link(address, details[1], details[2]))
else:
for details in [
("company_address", "Company", target_doc.company),
("shipping_address_name", "Customer", target_doc.customer),
("customer_address", "Customer", target_doc.customer),
]:
if address := target_doc.get(details[0]):
self.assertEqual(address, _validate_address_link(address, details[1], details[2]))
def test_inter_company_transaction(self):
si = create_sales_invoice(
@@ -2776,7 +2853,9 @@ class TestSalesInvoice(FrappeTestCase):
self.assertEqual(si.items[0].rate, rate)
self.assertEqual(target_doc.items[0].rate, rate)
check_gl_entries(self, target_doc.name, pi_gl_entries, add_days(nowdate(), -1))
check_gl_entries(
self, target_doc.name, pi_gl_entries, add_days(nowdate(), -1), voucher_type="Purchase Invoice"
)
def test_internal_transfer_gl_precision_issues(self):
# Make a stock queue of an item with two valuations
@@ -2976,6 +3055,28 @@ class TestSalesInvoice(FrappeTestCase):
check_gl_entries(self, si.name, expected_gle, add_days(nowdate(), -1))
# cases where distributed discount amount is not set
frappe.db.set_value(
"Sales Invoice Item",
{"name": ["in", [d.name for d in si.items]]},
"distributed_discount_amount",
0,
)
si.load_from_db()
si.additional_discount_account = additional_discount_account
# Ledger reposted implicitly upon 'Update After Submit'
si.save()
expected_gle = [
["Debtors - _TC", 88, 0.0, nowdate()],
["Discount Account - _TC", 22.0, 0.0, nowdate()],
["Service - _TC", 0.0, 100.0, nowdate()],
["TDS Payable - _TC", 0.0, 10.0, nowdate()],
]
check_gl_entries(self, si.name, expected_gle, add_days(nowdate(), -1))
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.
@@ -3062,6 +3163,65 @@ class TestSalesInvoice(FrappeTestCase):
self.assertEqual(expected_values[i][2], schedule.accumulated_depreciation_amount)
self.assertEqual(schedule.journal_entry, schedule.journal_entry)
def test_depreciation_on_cancel_invoice(self):
from erpnext.controllers.sales_and_purchase_return import make_return_doc
create_asset_data()
asset = create_asset(
item_code="Macbook Pro",
purchase_date="2020-01-01",
available_for_use_date="2023-01-01",
depreciation_start_date="2023-04-01",
calculate_depreciation=1,
submit=1,
)
post_depreciation_entries()
si = create_sales_invoice(
item_code="Macbook Pro", asset=asset.name, qty=1, rate=10000, posting_date=getdate("2025-05-01")
)
return_si = make_return_doc("Sales Invoice", si.name)
return_si.posting_date = getdate("2025-05-01")
return_si.submit()
return_si.reload()
return_si.cancel()
asset.load_from_db()
# Check if the asset schedule is updated while cancel the return invoice
expected_values = [
["2023-04-01", 4986.30, 4986.30, True],
["2024-04-01", 20000.0, 24986.30, True],
["2025-04-01", 20000.0, 44986.30, True],
["2025-05-01", 1643.84, 46630.14, True],
]
for i, schedule in enumerate(get_depr_schedule(asset.name, "Active")):
self.assertEqual(getdate(expected_values[i][0]), schedule.schedule_date)
self.assertEqual(expected_values[i][1], schedule.depreciation_amount)
self.assertEqual(expected_values[i][2], schedule.accumulated_depreciation_amount)
self.assertEqual(schedule.journal_entry, schedule.journal_entry)
si.reload()
si.cancel()
asset.load_from_db()
# Check if the asset schedule is updated while cancel the sales invoice
expected_values = [
["2023-04-01", 4986.30, 4986.30, True],
["2024-04-01", 20000.0, 24986.30, True],
["2025-04-01", 20000.0, 44986.30, True],
["2026-04-01", 20000.0, 64986.30, False],
["2027-04-01", 20000.0, 84986.30, False],
["2028-01-01", 15013.70, 100000.0, False],
]
for i, schedule in enumerate(get_depr_schedule(asset.name, "Active")):
self.assertEqual(getdate(expected_values[i][0]), schedule.schedule_date)
self.assertEqual(expected_values[i][1], schedule.depreciation_amount)
self.assertEqual(expected_values[i][2], schedule.accumulated_depreciation_amount)
self.assertEqual(schedule.journal_entry, schedule.journal_entry)
def test_sales_invoice_against_supplier(self):
from erpnext.accounts.doctype.opening_invoice_creation_tool.test_opening_invoice_creation_tool import (
make_customer,
@@ -3356,6 +3516,7 @@ class TestSalesInvoice(FrappeTestCase):
si.posting_date = getdate()
si.submit()
@change_settings("Accounts Settings", {"over_billing_allowance": 0})
def test_over_billing_case_against_delivery_note(self):
"""
Test a case where duplicating the item with qty = 1 in the invoice
@@ -3363,24 +3524,23 @@ class TestSalesInvoice(FrappeTestCase):
"""
from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note
over_billing_allowance = frappe.db.get_single_value("Accounts Settings", "over_billing_allowance")
frappe.db.set_single_value("Accounts Settings", "over_billing_allowance", 0)
dn = create_delivery_note()
dn.submit()
si = make_sales_invoice(dn.name)
# make a copy of first item and add it to invoice
item_copy = frappe.copy_doc(si.items[0])
si.save()
si.items = [] # Clear existing items
si.append("items", item_copy)
si.save()
si.append("items", item_copy)
with self.assertRaises(frappe.ValidationError) as err:
si.submit()
si.save()
self.assertTrue("cannot overbill" in str(err.exception).lower())
frappe.db.set_single_value("Accounts Settings", "over_billing_allowance", over_billing_allowance)
dn.cancel()
@change_settings(
"Accounts Settings",
@@ -3915,10 +4075,8 @@ class TestSalesInvoice(FrappeTestCase):
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.append("payments", {"mode_of_payment": "Bank Draft", "amount": 500})
pos.append("payments", {"mode_of_payment": "Cash", "amount": 500})
pos.save().submit()
pos_return = make_sales_return(pos.name)
@@ -4289,12 +4447,143 @@ class TestSalesInvoice(FrappeTestCase):
pos.is_pos = 1
pos.pos_profile = pos_profile.name
pos.debit_to = "_Test Receivable USD - _TC"
pos.append("payments", {"mode_of_payment": "Cash", "account": "_Test Bank - _TC", "amount": 20.35})
pos.append("payments", {"mode_of_payment": "Cash", "amount": 20.35})
pos.save().submit()
pos_return = make_sales_return(pos.name)
self.assertEqual(abs(pos_return.payments[0].amount), pos.payments[0].amount)
def test_create_return_invoice_for_self_update(self):
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.controllers.sales_and_purchase_return import make_return_doc
invoice = create_sales_invoice()
payment_entry = get_payment_entry(dt=invoice.doctype, dn=invoice.name)
payment_entry.reference_no = "test001"
payment_entry.reference_date = getdate()
payment_entry.save()
payment_entry.submit()
r_invoice = make_return_doc(invoice.doctype, invoice.name)
r_invoice.update_outstanding_for_self = 0
r_invoice.save()
self.assertEqual(r_invoice.update_outstanding_for_self, 1)
r_invoice.submit()
self.assertNotEqual(r_invoice.outstanding_amount, 0)
invoice.reload()
self.assertEqual(invoice.outstanding_amount, 0)
def test_prevents_fully_returned_invoice_with_zero_quantity(self):
from erpnext.controllers.sales_and_purchase_return import StockOverReturnError, make_return_doc
invoice = create_sales_invoice(qty=10)
return_doc = make_return_doc(invoice.doctype, invoice.name)
return_doc.items[0].qty = -10
return_doc.save().submit()
return_doc = make_return_doc(invoice.doctype, invoice.name)
return_doc.items[0].qty = 0
self.assertRaises(StockOverReturnError, return_doc.save)
def test_stand_alone_credit_note_valuation(self):
from erpnext.stock.doctype.item.test_item import make_item
item_code = "_Test Item for Credit Note Valuation"
make_item_for_si(
item_code,
{
"is_stock_item": 1,
"has_batch_no": 1,
"create_new_batch": 1,
"batch_number_series": "BATCH-TCNV.####",
},
)
si = create_sales_invoice(
item=item_code,
qty=-2,
rate=1200,
is_return=1,
update_stock=1,
)
stock_ledger_entry = frappe.db.get_value(
"Stock Ledger Entry",
{
"voucher_type": "Sales Invoice",
"voucher_no": si.name,
"item_code": item_code,
"warehouse": "_Test Warehouse - _TC",
},
["incoming_rate", "valuation_rate", "actual_qty as qty", "stock_value_difference"],
as_dict=True,
)
self.assertEqual(stock_ledger_entry.incoming_rate, 1200.0)
self.assertEqual(stock_ledger_entry.valuation_rate, 1200.0)
self.assertEqual(stock_ledger_entry.qty, 2.0)
self.assertEqual(stock_ledger_entry.stock_value_difference, 2400.0)
def test_stand_alone_credit_note_zero_valuation(self):
from erpnext.stock.doctype.item.test_item import make_item
item_code = "_Test Item for Credit Note Zero Valuation"
make_item_for_si(
item_code,
{
"is_stock_item": 1,
"has_batch_no": 1,
"create_new_batch": 1,
"batch_number_series": "BATCH-TCNZV.####",
},
)
si = create_sales_invoice(
item=item_code,
qty=-2,
rate=1200,
is_return=1,
update_stock=1,
allow_zero_valuation_rate=1,
)
stock_ledger_entry = frappe.db.get_value(
"Stock Ledger Entry",
{
"voucher_type": "Sales Invoice",
"voucher_no": si.name,
"item_code": item_code,
"warehouse": "_Test Warehouse - _TC",
},
["incoming_rate", "valuation_rate", "actual_qty as qty", "stock_value_difference"],
as_dict=True,
)
self.assertEqual(stock_ledger_entry.incoming_rate, 0.0)
self.assertEqual(stock_ledger_entry.valuation_rate, 0.0)
self.assertEqual(stock_ledger_entry.qty, 2.0)
self.assertEqual(stock_ledger_entry.stock_value_difference, 0.0)
def make_item_for_si(item_code, properties=None):
from erpnext.stock.doctype.item.test_item import make_item
item = make_item(item_code, properties=properties)
item.is_stock_item = 1
item.save()
return item
def set_advance_flag(company, flag, default_account):
frappe.db.set_value(
@@ -4322,6 +4611,8 @@ def check_gl_entries(doc, voucher_no, expected_gle, posting_date, voucher_type="
)
gl_entries = q.run(as_dict=True)
doc.assertGreater(len(gl_entries), 0)
for i, gle in enumerate(gl_entries):
doc.assertEqual(expected_gle[i][0], gle.account)
doc.assertEqual(expected_gle[i][1], gle.debit)
@@ -4347,11 +4638,12 @@ def create_sales_invoice(**args):
si.conversion_rate = args.conversion_rate or 1
si.naming_series = args.naming_series or "T-SINV-"
si.cost_center = args.parent_cost_center
si.is_internal_customer = args.is_internal_customer or 0
bundle_id = None
if si.update_stock and (args.get("batch_no") or args.get("serial_no")):
batches = {}
qty = args.qty or 1
qty = args.qty if args.qty is not None else 1
item_code = args.item or args.item_code or "_Test Item"
if args.get("batch_no"):
batches = frappe._dict({args.batch_no: qty})
@@ -4383,7 +4675,7 @@ def create_sales_invoice(**args):
"description": args.description or "_Test Item",
"warehouse": args.warehouse or "_Test Warehouse - _TC",
"target_warehouse": args.target_warehouse,
"qty": args.qty or 1,
"qty": args.qty if args.qty is not None else 1,
"uom": args.uom or "Nos",
"stock_uom": args.uom or "Nos",
"rate": args.rate if args.get("rate") is not None else 100,
@@ -4397,6 +4689,7 @@ def create_sales_invoice(**args):
"conversion_factor": args.get("conversion_factor", 1),
"incoming_rate": args.incoming_rate or 0,
"serial_and_batch_bundle": bundle_id,
"allow_zero_valuation_rate": args.allow_zero_valuation_rate or 0,
},
)
@@ -4549,6 +4842,12 @@ def create_internal_parties():
allowed_to_interact_with="_Test Company with perpetual inventory",
)
create_internal_supplier(
supplier_name="_Test Internal Supplier 3",
represents_company="_Test Company",
allowed_to_interact_with="_Test Company",
)
def create_internal_supplier(supplier_name, represents_company, allowed_to_interact_with):
if not frappe.db.exists("Supplier", supplier_name):

View File

@@ -37,6 +37,7 @@
"column_break_19",
"discount_percentage",
"discount_amount",
"distributed_discount_amount",
"base_rate_with_margin",
"section_break1",
"rate",
@@ -105,6 +106,9 @@
"delivery_note",
"dn_detail",
"delivered_qty",
"column_break_vwhb",
"pos_invoice",
"pos_invoice_item",
"internal_transfer_section",
"purchase_order",
"column_break_92",
@@ -256,7 +260,7 @@
},
{
"collapsible": 1,
"collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount",
"collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount || doc.distributed_discount_amount",
"fieldname": "discount_and_margin",
"fieldtype": "Section Break",
"label": "Discount and Margin"
@@ -630,6 +634,7 @@
"fieldname": "serial_no",
"fieldtype": "Text",
"label": "Serial No",
"no_copy": 1,
"oldfieldname": "serial_no",
"oldfieldtype": "Small Text"
},
@@ -928,6 +933,12 @@
"fieldname": "column_break_ytgd",
"fieldtype": "Column Break"
},
{
"fieldname": "distributed_discount_amount",
"fieldtype": "Currency",
"label": "Distributed Discount Amount",
"options": "currency"
},
{
"fieldname": "available_quantity_section",
"fieldtype": "Section Break",
@@ -945,19 +956,41 @@
"no_copy": 1,
"print_hide": 1,
"read_only": 1
},
{
"fieldname": "pos_invoice_item",
"fieldtype": "Data",
"ignore_user_permissions": 1,
"label": "POS Invoice Item",
"no_copy": 1,
"print_hide": 1,
"read_only": 1
},
{
"fieldname": "column_break_vwhb",
"fieldtype": "Column Break"
},
{
"fieldname": "pos_invoice",
"fieldtype": "Link",
"label": "POS Invoice",
"no_copy": 1,
"options": "POS Invoice",
"print_hide": 1,
"search_index": 1
}
],
"idx": 1,
"istable": 1,
"links": [],
"modified": "2024-11-25 16:27:33.287341",
"modified": "2025-03-12 16:33:55.503777",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",
"naming_rule": "Random",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_field": "creation",
"sort_order": "DESC",
"states": []
}
}

View File

@@ -40,6 +40,7 @@ class SalesInvoiceItem(Document):
discount_account: DF.Link | None
discount_amount: DF.Currency
discount_percentage: DF.Percent
distributed_discount_amount: DF.Currency
dn_detail: DF.Data | None
enable_deferred_revenue: DF.Check
expense_account: DF.Link | None
@@ -64,6 +65,8 @@ class SalesInvoiceItem(Document):
parent: DF.Data
parentfield: DF.Data
parenttype: DF.Data
pos_invoice: DF.Link | None
pos_invoice_item: DF.Data | None
price_list_rate: DF.Currency
pricing_rules: DF.SmallText | None
project: DF.Link | None

View File

@@ -10,6 +10,7 @@ frappe.ui.form.on("Tax Withholding Category", {
filters: {
company: child.company,
root_type: ["in", ["Asset", "Liability"]],
is_group: 0,
},
};
}

View File

@@ -36,27 +36,38 @@ class TaxWithholdingCategory(Document):
def validate(self):
self.validate_dates()
self.validate_accounts()
self.validate_companies_and_accounts()
self.validate_thresholds()
def validate_dates(self):
last_date = None
for d in self.get("rates"):
last_to_date = None
rates = sorted(self.get("rates"), key=lambda d: getdate(d.from_date))
for d in rates:
if getdate(d.from_date) >= getdate(d.to_date):
frappe.throw(_("Row #{0}: From Date cannot be before To Date").format(d.idx))
# validate overlapping of dates
if last_date and getdate(d.to_date) < getdate(last_date):
if last_to_date and getdate(d.from_date) < getdate(last_to_date):
frappe.throw(_("Row #{0}: Dates overlapping with other row").format(d.idx))
def validate_accounts(self):
existing_accounts = []
last_to_date = d.to_date
def validate_companies_and_accounts(self):
existing_accounts = set()
companies = set()
for d in self.get("accounts"):
# validate duplicate company
if d.get("company") in companies:
frappe.throw(_("Company {0} added multiple times").format(frappe.bold(d.get("company"))))
companies.add(d.get("company"))
# validate duplicate account
if d.get("account") in existing_accounts:
frappe.throw(_("Account {0} added multiple times").format(frappe.bold(d.get("account"))))
validate_account_head(d.idx, d.get("account"), d.get("company"))
existing_accounts.append(d.get("account"))
existing_accounts.add(d.get("account"))
def validate_thresholds(self):
for d in self.get("rates"):
@@ -660,6 +671,7 @@ def get_tcs_amount(parties, inv, tax_details, vouchers, adv_vouchers):
conditions.append(ple.party.isin(parties))
conditions.append(ple.voucher_no == ple.against_voucher_no)
conditions.append(ple.company == inv.company)
conditions.append(ple.posting_date[tax_details.from_date : tax_details.to_date])
advance_amt = (
qb.from_(ple).select(Abs(Sum(ple.amount))).where(Criterion.all(conditions)).run()[0][0] or 0.0

View File

@@ -288,17 +288,18 @@ class TestTaxWithholdingCategory(FrappeTestCase):
frappe.db.set_value(
"Customer", "Test TCS Customer", "tax_withholding_category", "Cumulative Threshold TCS"
)
fiscal_year = get_fiscal_year(today(), company="_Test Company")
vouchers = []
# create advance payment
pe = create_payment_entry(
pe1 = create_payment_entry(
payment_type="Receive", party_type="Customer", party="Test TCS Customer", paid_amount=20000
)
pe.paid_from = "Debtors - _TC"
pe.paid_to = "Cash - _TC"
pe.submit()
vouchers.append(pe)
pe1.paid_from = "Debtors - _TC"
pe1.paid_to = "Cash - _TC"
pe1.submit()
vouchers.append(pe1)
# create invoice
si1 = create_sales_invoice(customer="Test TCS Customer", rate=5000)
@@ -320,6 +321,17 @@ class TestTaxWithholdingCategory(FrappeTestCase):
# make another invoice
# sum of unallocated amount from payment entry and this sales invoice will breach cumulative threashold
# TDS should be calculated
# this payment should not be considered for TCS calculation as it is outside of fiscal year
pe2 = create_payment_entry(
payment_type="Receive", party_type="Customer", party="Test TCS Customer", paid_amount=10000
)
pe2.paid_from = "Debtors - _TC"
pe2.paid_to = "Cash - _TC"
pe2.posting_date = add_days(fiscal_year[1], -10)
pe2.submit()
vouchers.append(pe2)
si2 = create_sales_invoice(customer="Test TCS Customer", rate=15000)
si2.submit()
vouchers.append(si2)
@@ -519,7 +531,7 @@ class TestTaxWithholdingCategory(FrappeTestCase):
payment = get_payment_entry(order.doctype, order.name)
payment.apply_tax_withholding_amount = 1
payment.tax_withholding_category = "Cumulative Threshold TDS"
payment.submit()
payment.save().submit()
self.assertEqual(payment.taxes[0].tax_amount, 4000)
def test_multi_category_single_supplier(self):

View File

@@ -12,6 +12,7 @@ from frappe.utils.data import comma_and
from erpnext.accounts.utils import (
cancel_exchange_gain_loss_journal,
get_advance_payment_doctypes,
unlink_ref_doc_from_payment_entries,
update_voucher_outstanding,
)
@@ -84,7 +85,7 @@ class UnreconcilePayment(Document):
update_voucher_outstanding(
alloc.reference_doctype, alloc.reference_name, alloc.account, alloc.party_type, alloc.party
)
if doc.doctype in frappe.get_hooks("advance_payment_doctypes"):
if doc.doctype in get_advance_payment_doctypes():
doc.set_total_advance_paid()
frappe.db.set_value("Unreconcile Payment Entries", alloc.name, "unlinked", True)

View File

@@ -81,6 +81,10 @@ def make_acc_dimensions_offsetting_entry(gl_map):
"credit_in_account_currency": credit,
"remarks": _("Offsetting for Accounting Dimension") + f" - {dimension.name}",
"against_voucher": None,
"account_currency": dimension.account_currency,
# Party Type and Party are restricted to Receivable and Payable accounts
"party_type": None,
"party": None,
}
)
offsetting_entry["against_voucher_type"] = None
@@ -108,6 +112,9 @@ def get_accounting_dimensions_for_offsetting_entry(gl_map, company):
accounting_dimensions_to_offset = []
for acc_dimension in acc_dimensions:
values = set([entry.get(acc_dimension.fieldname) for entry in gl_map])
acc_dimension.account_currency = frappe.get_cached_value(
"Account", acc_dimension.offsetting_account, "account_currency"
)
if len(values) > 1:
accounting_dimensions_to_offset.append(acc_dimension)
@@ -430,7 +437,7 @@ def process_debit_credit_difference(gl_map):
voucher_no = gl_map[0].voucher_no
allowance = get_debit_credit_allowance(voucher_type, precision)
debit_credit_diff = get_debit_credit_difference(gl_map, precision)
debit_credit_diff, trx_cur_debit_credit_diff = get_debit_credit_difference(gl_map, precision)
if abs(debit_credit_diff) > allowance:
if not (
@@ -441,9 +448,9 @@ def process_debit_credit_difference(gl_map):
raise_debit_credit_not_equal_error(debit_credit_diff, voucher_type, voucher_no)
elif abs(debit_credit_diff) >= (1.0 / (10**precision)):
make_round_off_gle(gl_map, debit_credit_diff, precision)
make_round_off_gle(gl_map, debit_credit_diff, trx_cur_debit_credit_diff, precision)
debit_credit_diff = get_debit_credit_difference(gl_map, precision)
debit_credit_diff, trx_cur_debit_credit_diff = get_debit_credit_difference(gl_map, precision)
if abs(debit_credit_diff) > allowance:
if not (
voucher_type == "Journal Entry"
@@ -455,14 +462,23 @@ def process_debit_credit_difference(gl_map):
def get_debit_credit_difference(gl_map, precision):
debit_credit_diff = 0.0
trx_cur_debit_credit_diff = 0
for entry in gl_map:
entry.debit = flt(entry.debit, precision)
entry.credit = flt(entry.credit, precision)
debit_credit_diff += entry.debit - entry.credit
debit_credit_diff = flt(debit_credit_diff, precision)
entry.debit_in_transaction_currency = flt(entry.debit_in_transaction_currency, precision)
entry.credit_in_transaction_currency = flt(entry.credit_in_transaction_currency, precision)
trx_cur_debit_credit_diff += (
entry.debit_in_transaction_currency - entry.credit_in_transaction_currency
)
return debit_credit_diff
debit_credit_diff = flt(debit_credit_diff, precision)
trx_cur_debit_credit_diff = flt(trx_cur_debit_credit_diff, precision)
return debit_credit_diff, trx_cur_debit_credit_diff
def get_debit_credit_allowance(voucher_type, precision):
@@ -489,7 +505,7 @@ def has_opening_entries(gl_map: list) -> bool:
return False
def make_round_off_gle(gl_map, debit_credit_diff, precision):
def make_round_off_gle(gl_map, debit_credit_diff, trx_cur_debit_credit_diff, precision):
round_off_account, round_off_cost_center, round_off_for_opening = get_round_off_account_and_cost_center(
gl_map[0].company, gl_map[0].voucher_type, gl_map[0].voucher_no
)
@@ -534,6 +550,12 @@ def make_round_off_gle(gl_map, debit_credit_diff, precision):
"credit_in_account_currency": debit_credit_diff if debit_credit_diff > 0 else 0,
"debit": abs(debit_credit_diff) if debit_credit_diff < 0 else 0,
"credit": debit_credit_diff if debit_credit_diff > 0 else 0,
"debit_in_transaction_currency": abs(trx_cur_debit_credit_diff)
if trx_cur_debit_credit_diff < 0
else 0,
"credit_in_transaction_currency": trx_cur_debit_credit_diff
if trx_cur_debit_credit_diff > 0
else 0,
"cost_center": round_off_cost_center,
"party_type": None,
"party": None,
@@ -670,7 +692,18 @@ def make_reverse_gl_entries(
query.run()
else:
if not immutable_ledger_enabled:
set_as_cancel(gl_entries[0]["voucher_type"], gl_entries[0]["voucher_no"])
gle_names = [x.get("name") for x in gl_entries]
# if names are available, cancel only that set of entries
if not all(gle_names):
set_as_cancel(gl_entries[0]["voucher_type"], gl_entries[0]["voucher_no"])
else:
frappe.db.sql(
"""UPDATE `tabGL Entry` SET is_cancelled = 1,
modified=%s, modified_by=%s
where name in %s and is_cancelled = 0""",
(now(), frappe.session.user, tuple(gle_names)),
)
for entry in gl_entries:
new_gle = copy.deepcopy(entry)

View File

@@ -71,6 +71,7 @@ def get_party_details(
party_address=None,
company_address=None,
shipping_address=None,
dispatch_address=None,
pos_profile=None,
):
if not party:
@@ -92,6 +93,7 @@ def get_party_details(
party_address,
company_address,
shipping_address,
dispatch_address,
pos_profile,
)
@@ -111,6 +113,7 @@ def _get_party_details(
party_address=None,
company_address=None,
shipping_address=None,
dispatch_address=None,
pos_profile=None,
):
party_details = frappe._dict(
@@ -134,6 +137,7 @@ def _get_party_details(
party_address,
company_address,
shipping_address,
dispatch_address,
ignore_permissions=ignore_permissions,
)
set_contact_details(party_details, party, party_type)
@@ -191,34 +195,51 @@ def set_address_details(
party_address=None,
company_address=None,
shipping_address=None,
dispatch_address=None,
*,
ignore_permissions=False,
):
billing_address_field = (
# party_billing
party_billing_field = (
"customer_address" if party_type in ["Lead", "Prospect"] else party_type.lower() + "_address"
)
party_details[billing_address_field] = party_address or get_default_address(party_type, party.name)
party_details[party_billing_field] = party_address or get_default_address(party_type, party.name)
if doctype:
party_details.update(
get_fetch_values(doctype, billing_address_field, party_details[billing_address_field])
get_fetch_values(doctype, party_billing_field, party_details[party_billing_field])
)
# address display
party_details.address_display = render_address(
party_details[billing_address_field], check_permissions=not ignore_permissions
)
# shipping address
if party_type in ["Customer", "Lead"]:
party_details.shipping_address_name = shipping_address or get_party_shipping_address(
party_type, party.name
)
party_details.shipping_address = render_address(
party_details["shipping_address_name"], check_permissions=not ignore_permissions
)
if doctype:
party_details.update(
get_fetch_values(doctype, "shipping_address_name", party_details.shipping_address_name)
)
party_details.address_display = render_address(
party_details[party_billing_field], check_permissions=not ignore_permissions
)
# party_shipping
if party_type in ["Customer", "Lead"]:
party_shipping_field = "shipping_address_name"
party_shipping_display = "shipping_address"
default_shipping = shipping_address
else:
# Supplier
party_shipping_field = "dispatch_address"
party_shipping_display = "dispatch_address_display"
default_shipping = dispatch_address
party_details[party_shipping_field] = default_shipping or get_party_shipping_address(
party_type, party.name
)
party_details[party_shipping_display] = render_address(
party_details[party_shipping_field], check_permissions=not ignore_permissions
)
if doctype:
party_details.update(
get_fetch_values(doctype, party_shipping_field, party_details[party_shipping_field])
)
# company_address
if company_address:
party_details.company_address = company_address
else:
@@ -256,22 +277,20 @@ def set_address_details(
**get_fetch_values(doctype, "shipping_address", party_details.billing_address),
)
party_address, shipping_address = (
party_details.get(billing_address_field),
party_details.shipping_address_name,
party_billing, party_shipping = (
party_details.get(party_billing_field),
party_details.get(party_shipping_field),
)
party_details["tax_category"] = get_address_tax_category(
party.get("tax_category"),
party_address,
shipping_address if party_type != "Supplier" else party_address,
party.get("tax_category"), party_billing, party_shipping
)
if doctype in TRANSACTION_TYPES:
with temporary_flag("company", company):
get_regional_address_details(party_details, doctype, company)
return party_address, shipping_address
return party_billing, party_shipping
@erpnext.allow_regional
@@ -279,35 +298,56 @@ def get_regional_address_details(party_details, doctype, company):
pass
def set_contact_details(party_details, party, party_type):
party_details.contact_person = get_default_contact(party_type, party.name)
def complete_contact_details(party_details):
contact_details = frappe._dict()
if not party_details.contact_person:
party_details.update(
{
"contact_person": None,
"contact_display": None,
"contact_email": None,
"contact_mobile": None,
"contact_phone": None,
"contact_designation": None,
"contact_department": None,
}
if party_details.party_type == "Employee":
contact_details = frappe.db.get_value(
"Employee",
party_details.party,
[
"employee_name as contact_display",
"prefered_email as contact_email",
"cell_number as contact_mobile",
"designation as contact_designation",
"department as contact_department",
],
as_dict=True,
)
contact_details.update({"contact_person": None, "contact_phone": None})
elif party_details.contact_person:
contact_details = frappe.db.get_value(
"Contact",
party_details.contact_person,
[
"name as contact_person",
"full_name as contact_display",
"email_id as contact_email",
"mobile_no as contact_mobile",
"phone as contact_phone",
"designation as contact_designation",
"department as contact_department",
],
as_dict=True,
)
else:
fields = [
"name as contact_person",
"full_name as contact_display",
"email_id as contact_email",
"mobile_no as contact_mobile",
"phone as contact_phone",
"designation as contact_designation",
"department as contact_department",
]
contact_details = {
"contact_person": None,
"contact_display": None,
"contact_email": None,
"contact_mobile": None,
"contact_phone": None,
"contact_designation": None,
"contact_department": None,
}
contact_details = frappe.db.get_value("Contact", party_details.contact_person, fields, as_dict=True)
party_details.update(contact_details)
party_details.update(contact_details)
def set_contact_details(party_details, party, party_type):
party_details.contact_person = get_default_contact(party_type, party.name)
complete_contact_details(party_details)
def set_other_values(party_details, party, party_type):
@@ -384,6 +424,8 @@ def get_party_account(party_type, party=None, company=None, include_advance=Fals
Will first search in party (Customer / Supplier) record, if not found,
will search in group (Customer Group / Supplier Group),
finally will return default."""
if not party_type:
frappe.throw(_("Party Type is mandatory"))
if not company:
frappe.throw(_("Please select a Company"))
@@ -420,6 +462,12 @@ def get_party_account(party_type, party=None, company=None, include_advance=Fals
if (account and account_currency != existing_gle_currency) or not account:
account = get_party_gle_account(party_type, party, company)
# get default account on the basis of party type
if not account:
account_type = frappe.get_cached_value("Party Type", party_type, "account_type")
default_account_name = "default_" + account_type.lower() + "_account"
account = frappe.get_cached_value("Company", company, default_account_name)
if include_advance and party_type in ["Customer", "Supplier", "Student"]:
advance_account = get_party_advance_account(party_type, party, company)
if advance_account:
@@ -572,12 +620,13 @@ def validate_party_accounts(doc):
@frappe.whitelist()
def get_due_date(posting_date, party_type, party, company=None, bill_date=None):
def get_due_date(posting_date, party_type, party, company=None, bill_date=None, template_name=None):
"""Get due date from `Payment Terms Template`"""
due_date = None
if (bill_date or posting_date) and party:
due_date = bill_date or posting_date
template_name = get_payment_terms_template(party, party_type, company)
if not template_name:
template_name = get_payment_terms_template(party, party_type, company)
if template_name:
due_date = get_due_date_from_template(template_name, posting_date, bill_date).strftime("%Y-%m-%d")
@@ -616,34 +665,34 @@ def get_due_date_from_template(template_name, posting_date, bill_date):
return due_date
def validate_due_date(posting_date, due_date, bill_date=None, template_name=None):
def validate_due_date(posting_date, due_date, bill_date=None, template_name=None, doctype=None):
if getdate(due_date) < getdate(posting_date):
frappe.throw(_("Due Date cannot be before Posting / Supplier Invoice Date"))
else:
if not template_name:
return
validate_due_date_with_template(posting_date, due_date, bill_date, template_name, doctype)
default_due_date = get_due_date_from_template(template_name, posting_date, bill_date).strftime(
"%Y-%m-%d"
)
if not default_due_date:
return
def validate_due_date_with_template(posting_date, due_date, bill_date, template_name, doctype=None):
if not template_name:
return
if default_due_date != posting_date and getdate(due_date) > getdate(default_due_date):
is_credit_controller = (
frappe.db.get_single_value("Accounts Settings", "credit_controller") in frappe.get_roles()
default_due_date = format(get_due_date_from_template(template_name, posting_date, bill_date))
if not default_due_date:
return
if default_due_date != posting_date and getdate(due_date) > getdate(default_due_date):
if frappe.db.get_single_value("Accounts Settings", "credit_controller") in frappe.get_roles():
party_type = "supplier" if doctype == "Purchase Invoice" else "customer"
msgprint(
_("Note: Due Date exceeds allowed {0} credit days by {1} day(s)").format(
party_type, date_diff(due_date, default_due_date)
)
)
if is_credit_controller:
msgprint(
_("Note: Due / Reference Date exceeds allowed customer credit days by {0} day(s)").format(
date_diff(due_date, default_due_date)
)
)
else:
frappe.throw(
_("Due / Reference Date cannot be after {0}").format(formatdate(default_due_date))
)
else:
frappe.throw(_("Due / Reference Date cannot be after {0}").format(formatdate(default_due_date)))
@frappe.whitelist()
@@ -767,9 +816,9 @@ def validate_account_party_type(self):
account_type = frappe.get_cached_value("Account", self.account, "account_type")
if account_type and (account_type not in ["Receivable", "Payable", "Equity"]):
frappe.throw(
_(
"Party Type and Party can only be set for Receivable / Payable account<br><br>" "{0}"
).format(self.account)
_("Party Type and Party can only be set for Receivable / Payable account<br><br>{0}").format(
self.account
)
)
@@ -890,12 +939,16 @@ def get_party_shipping_address(doctype: str, name: str) -> str | None:
["is_shipping_address", "=", 1],
["address_type", "=", "Shipping"],
],
pluck="name",
limit=1,
fields=["name", "is_shipping_address"],
order_by="is_shipping_address DESC",
)
return shipping_addresses[0] if shipping_addresses else None
if shipping_addresses and shipping_addresses[0].is_shipping_address == 1:
return shipping_addresses[0].name
if len(shipping_addresses) == 1:
return shipping_addresses[0].name
else:
return None
def get_partywise_advanced_payment_amount(

View File

@@ -52,7 +52,7 @@
{{ doc.address_display }}
</div>
<div class="col-xs-12">
{{ _("Conatct: ")+doc.contact_display if doc.contact_display else '' }}
{{ _("Contact: ")+doc.contact_display if doc.contact_display else '' }}
</div>
<div class="col-xs-12">
{{ _("Mobile: ")+doc.contact_mobile if doc.contact_mobile else '' }}

View File

@@ -60,6 +60,13 @@ frappe.query_reports["Accounts Payable"] = {
options: "Posting Date\nDue Date\nSupplier Invoice Date",
default: "Due Date",
},
{
fieldname: "calculate_ageing_with",
label: __("Calculate Ageing With"),
fieldtype: "Select",
options: "Report Date\nToday Date",
default: "Report Date",
},
{
fieldname: "range",
label: __("Ageing Range"),
@@ -164,7 +171,7 @@ frappe.query_reports["Accounts Payable"] = {
},
};
erpnext.utils.add_dimensions("Accounts Payable", 9);
erpnext.utils.add_dimensions("Accounts Payable", 10);
function get_party_type_options() {
let options = [];

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