Compare commits

..

720 Commits

Author SHA1 Message Date
Frappe PR Bot
8795ce975f chore(release): Bumped to Version 15.72.3
## [15.72.3](https://github.com/frappe/erpnext/compare/v15.72.2...v15.72.3) (2025-08-03)

### Performance Improvements

* process_gl_map causing performance issues in the reposting ([58f6534](58f6534d8b))
2025-08-03 10:42:14 +00:00
rohitwaghchaure
629cdd62f2 Merge pull request #48932 from frappe/mergify/bp/version-15/pr-48914
perf: process_gl_map causing performance issues in the reposting (backport #48914)
2025-08-03 16:08:38 +05:30
Rohit Waghchaure
58f6534d8b perf: process_gl_map causing performance issues in the reposting
(cherry picked from commit a96fa55704)
2025-08-03 09:46:12 +00:00
Frappe PR Bot
31343b6287 chore(release): Bumped to Version 15.72.2
## [15.72.2](https://github.com/frappe/erpnext/compare/v15.72.1...v15.72.2) (2025-08-01)

### Bug Fixes

* multiple fixes for advance payment accounting (backport [#48341](https://github.com/frappe/erpnext/issues/48341)) ([#48896](https://github.com/frappe/erpnext/issues/48896)) ([52b9f92](52b9f92553))
2025-08-01 10:25:24 +00:00
ruthra kumar
e0850ed209 Merge pull request #48906 from frappe/mergify/bp/version-15/pr-48896
fix: multiple fixes for advance payment accounting (backport #48341) (backport #48896)
2025-08-01 15:53:57 +05:30
mergify[bot]
52b9f92553 fix: multiple fixes for advance payment accounting (backport #48341) (#48896)
* fix: multiple fixes for advance payment accounting

(cherry picked from commit e70caedddc)

# Conflicts:
#	erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
#	erpnext/accounts/doctype/payment_entry/payment_entry.py
#	erpnext/accounts/doctype/payment_entry_reference/payment_entry_reference.json
#	erpnext/accounts/utils.py
#	erpnext/controllers/accounts_controller.py
#	erpnext/patches/v15_0/create_advance_payment_ledger_records.py

* chore: resolve conflicts

* fix: do not execute patch if no advance doctypes

---------

Co-authored-by: Lakshit Jain <108322669+ljain112@users.noreply.github.com>
Co-authored-by: ljain112 <ljain112@gmail.com>
(cherry picked from commit cb0addc122)
2025-08-01 10:01:31 +00:00
Frappe PR Bot
396886c6e8 chore(release): Bumped to Version 15.72.1
## [15.72.1](https://github.com/frappe/erpnext/compare/v15.72.0...v15.72.1) (2025-07-31)

### Bug Fixes

* failing subcontracting patch ([14d5c7f](14d5c7f3cd))
2025-07-31 11:05:20 +00:00
Mihir Kandoi
3a0db8d550 Merge pull request #48892 from frappe/mergify/bp/version-15/pr-48888
fix: failing subcontracting patch (backport #48887) (backport #48888)
2025-07-31 16:34:07 +05:30
Mihir Kandoi
9e661b206c chore: add date so patch can rerun
(cherry picked from commit ed927a2147)
2025-07-31 10:46:45 +00:00
Mihir Kandoi
14d5c7f3cd fix: failing subcontracting patch
(cherry picked from commit bb43419944)
(cherry picked from commit 2f4a9f283d)
2025-07-31 10:46:45 +00:00
Frappe PR Bot
b4a6d09d5d chore(release): Bumped to Version 15.72.0
# [15.72.0](https://github.com/frappe/erpnext/compare/v15.71.1...v15.72.0) (2025-07-29)

### Bug Fixes

* append finance book row only when calculate depreciation is checked ([36f22f9](36f22f929d))
* attribute error in payment entry ([3739e2c](3739e2ca5a))
* avoid auto_repeat on duplicate ([65a2706](65a27066cc))
* correct query filter assignment in stock ledger and balance reports ([fa01bdc](fa01bdc490))
* create job card for selected operations only ([23180da](23180dad42))
* do not set value after depreciation as zero ([20bbfc5](20bbfc504f))
* enhance warehouse filter to support list and tuple values ([#48755](https://github.com/frappe/erpnext/issues/48755)) ([0cb2c41](0cb2c41cba))
* error when trying to edit quantity of top most FG in bom creator ([bd7de51](bd7de515b1))
* fetch item valuation rate for internal transactions ([b23f7a9](b23f7a9d91))
* fetch payment term template from order ([ee8eb36](ee8eb368e7))
* get default company currency ([622052b](622052b950))
* handle empty warehouse condition in get_warehouse_condition function; typo; ([1d52a8f](1d52a8fb69))
* ignore is overridden by transaction.js upon clicking cancel ([424baed](424baed077))
* include empty values in user permission ([cfcd21d](cfcd21d5c6))
* incorrect GL entries ([207d2ac](207d2ac63c))
* Misclassification of Journal Voucher Entries in Customer Ledger Summary ([#48041](https://github.com/frappe/erpnext/issues/48041)) ([01fcd98](01fcd98c84))
* over billed purchase receipt status ([1efdff0](1efdff0ad1))
* patch to enable fetch_valuation_rate_for_internal_transaction ([bf5b6a5](bf5b6a540f))
* patch to set default buying price list in material request ([#48680](https://github.com/frappe/erpnext/issues/48680)) ([fd1c213](fd1c213a8d))
* **pick list:** make warehouse editable ([6a50410](6a5041042e))
* post gl entry on completion date of asset repair ([5a82b72](5a82b723c2))
* prevent concurrency issues ([ad75754](ad75754ca6))
* prevent negative scrap quantity in Job Card ([#48545](https://github.com/frappe/erpnext/issues/48545)) ([ae945b2](ae945b2e6f))
* remove alias for order by field ([193fbcb](193fbcba11))
* **sales-order:** disallow address edits after sales order is submitted ([2073e98](2073e98613))
* serial no warehouse for backdated stock reco ([b82aea4](b82aea4a87))
* set company as mandatory ([49befc1](49befc1dfd))
* set letter head from company if exists ([d4fae00](d4fae00b80))
* sql error in quality inspection ([3e92ae8](3e92ae8bd0))
* status in MR (material transfer) when using transit stock entries ([584b442](584b442824))
* test case ([9fe1e6d](9fe1e6d0bd))
* test case ([c7dcbed](c7dcbed16f))
* **test:** update tests ([62033b5](62033b5c7a))
* update advance paid amount on unreconcile ([074a706](074a7065be))
* update asset value after revaluation cancellation ([d9b24a3](d9b24a30eb))
* update get_data function to use item_query ([9bf0d85](9bf0d852ee))
* update subscription details patch ([ebda396](ebda396518))
* use db_set in email_campaign (backport [#45679](https://github.com/frappe/erpnext/issues/45679)) ([#48806](https://github.com/frappe/erpnext/issues/48806)) ([9b59fb6](9b59fb659b))
* use the item_query for get_data ([a7e8f40](a7e8f404f7))
* valuation for rejected materials ([d378e51](d378e51492))
* warehouse filter query by chaining conditions ([b57163b](b57163b7be))

### Features

* add fetch_valuation_rate_for_internal_transaction in accounts settings ([f8d1e5a](f8d1e5a0d3))
* Add non-negative constraint to workstation cost fields (backport [#48557](https://github.com/frappe/erpnext/issues/48557)) ([#48826](https://github.com/frappe/erpnext/issues/48826)) ([e1d7ec9](e1d7ec906f))
* enhance apply_warehouse_filter to support multiple warehouses in filters ([801cda3](801cda3813))
* option to recalculate costing and billing fields in project ([6adc8a0](6adc8a09c0))
* show opening/closing balance in cash flow report ([#47877](https://github.com/frappe/erpnext/issues/47877)) ([7fd5b2b](7fd5b2b26a))
* update stock balance report to support multi-select for items and warehouses ([2b08c5b](2b08c5b769))
* update stock ledger report to support multi-select for warehouses and items ([ecf9e6e](ecf9e6e748))
2025-07-29 15:39:56 +00:00
ruthra kumar
943aca9739 Merge pull request #48832 from frappe/version-15-hotfix
chore: release v15
2025-07-29 21:08:37 +05:30
ruthra kumar
9732973b73 Merge pull request #48849 from frappe/mergify/bp/version-15-hotfix/pr-48534
fix: update advance paid amount on unreconcile (backport #48534)
2025-07-29 20:52:07 +05:30
Ravibharathi
074a7065be fix: update advance paid amount on unreconcile
(cherry picked from commit 99f7eb38d3)
2025-07-29 15:06:20 +00:00
ruthra kumar
9f36531f2a Merge pull request #48847 from frappe/mergify/bp/version-15-hotfix/pr-48835
fix: include empty values in user permission (backport #48835)
2025-07-29 20:17:23 +05:30
l0gesh29
cfcd21d5c6 fix: include empty values in user permission
(cherry picked from commit f13d98fc7c)
2025-07-29 14:26:35 +00:00
rohitwaghchaure
5c34299b1e Merge pull request #48843 from frappe/mergify/bp/version-15-hotfix/pr-48743
fix(pick list): make warehouse editable (backport #48743)
2025-07-29 18:42:43 +05:30
rohitwaghchaure
4fda27fdba Merge pull request #48842 from frappe/mergify/bp/version-15-hotfix/pr-48841
fix: serial no warehouse for backdated stock reco (backport #48841)
2025-07-29 18:32:45 +05:30
ravibharathi656
6a5041042e fix(pick list): make warehouse editable
(cherry picked from commit f5beda48dc)
2025-07-29 12:55:17 +00:00
Rohit Waghchaure
b82aea4a87 fix: serial no warehouse for backdated stock reco
(cherry picked from commit 1deedc766c)
2025-07-29 12:46:52 +00:00
Khushi Rawat
21bdf6ef14 Merge pull request #48840 from khushi8112/finance-books-issue-when-asset-splitting
fix: finance books issue when asset splitting
2025-07-29 18:01:37 +05:30
khushi8112
bc1d3ea017 chore: remove print statement 2025-07-29 17:43:21 +05:30
khushi8112
1be071683a test: test assets after split 2025-07-29 17:39:48 +05:30
khushi8112
36f22f929d fix: append finance book row only when calculate depreciation is checked 2025-07-29 17:39:04 +05:30
ruthra kumar
1d85da43a6 Merge pull request #48838 from frappe/mergify/bp/version-15-hotfix/pr-48837
fix: unable to cancel PO if unreconciliation is done (backport #48837)
2025-07-29 17:17:35 +05:30
ruthra kumar
424baed077 fix: ignore is overridden by transaction.js upon clicking cancel
which overrides with 'Serial and Batch Bundle'

(cherry picked from commit cf70147c0d)
2025-07-29 11:34:31 +00:00
ruthra kumar
9508ae5044 Merge pull request #48836 from frappe/mergify/bp/version-15-hotfix/pr-48782
fix: attribute error in payment entry (backport #48782)
2025-07-29 17:03:55 +05:30
ljain112
1697ac0b57 chore: added test case for reconciliation_effect_date
(cherry picked from commit f7ee9ee967)
2025-07-29 11:13:12 +00:00
ljain112
3739e2ca5a fix: attribute error in payment entry
(cherry picked from commit dc841fe661)
2025-07-29 11:13:12 +00:00
Khushi Rawat
ec9747cc99 Merge pull request #48833 from khushi8112/bp-v15-pr-48649
fix: post gl entry on completion date of asset repair
2025-07-29 15:36:43 +05:30
Khushi Rawat
21f5541158 Merge pull request #48629 from khushi8112/update-value-after-depreciation-after-revaluation
fix: update asset value after revaluation cancellation
2025-07-29 15:33:33 +05:30
khushi8112
5a82b723c2 fix: post gl entry on completion date of asset repair 2025-07-29 15:17:30 +05:30
Mihir Kandoi
d7a9c7b161 Merge pull request #48828 from frappe/mergify/bp/version-15-hotfix/pr-48700
fix: prevent negative scrap quantity in Job Card (#48545) (backport #48700)
2025-07-29 14:26:05 +05:30
mergify[bot]
e1d7ec906f feat: Add non-negative constraint to workstation cost fields (backport #48557) (#48826)
* feat: Add non-negative constraint to workstation cost fields

(cherry picked from commit a2bb557570)

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

* fix: Add non-negative constraint to job capacity field in workstation

(cherry picked from commit 92a12d7fea)

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

* chore: resolve conflicts

---------

Co-authored-by: KerollesFathy <kerolles.f@outlook.com>
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-07-29 08:53:25 +00:00
ruthra kumar
fe1292e3fa Merge pull request #48829 from frappe/mergify/bp/version-15-hotfix/pr-48593
fix(sales-order): disallow address edits after sales order is submitted (backport #48593)
2025-07-29 14:19:38 +05:30
Diptanil Saha
61e5c52419 Merge pull request #48830 from frappe/mergify/bp/version-15-hotfix/pr-48769
fix: set letter head from company if exists (backport #48769)
2025-07-29 13:56:33 +05:30
ravibharathi656
d4fae00b80 fix: set letter head from company if exists
(cherry picked from commit d163da171f)
2025-07-29 08:23:11 +00:00
Bhavan23
2073e98613 fix(sales-order): disallow address edits after sales order is submitted
(cherry picked from commit daac7c589b)
2025-07-29 08:10:07 +00:00
Vishist Singh Solanki
ae945b2e6f fix: prevent negative scrap quantity in Job Card (#48545)
(cherry picked from commit 94ec76545c)
2025-07-29 07:57:54 +00:00
ruthra kumar
84c0321785 Merge pull request #48827 from frappe/mergify/bp/version-15-hotfix/pr-47877
feat(cashflow): show opening/closing balance (backport #47877)
2025-07-29 13:25:18 +05:30
Mihir Kandoi
f0f8666baa Merge pull request #48682 from frappe/mergify/bp/version-15-hotfix/pr-48680
fix: patch to set default buying price list in material request (backport #48680)
2025-07-29 13:23:16 +05:30
Mihir Kandoi
5d7b8200fa Merge pull request #48681 from frappe/mergify/bp/version-15-hotfix/pr-48653
feat: button to recalculate costing and billing fields in project (backport #48653)
2025-07-29 13:22:59 +05:30
Logesh Periyasamy
7fd5b2b26a feat: show opening/closing balance in cash flow report (#47877)
* feat: add checkbox to carryforward opening balance

* fix: ignore period closing voucher

* chore: rename filter check box

* feat: add total for opening and closing balance

* fix: update section name

* fix: remove section rename

---------

Co-authored-by: venkat102 <venkatesharunachalam659@gmail.com>
(cherry picked from commit 88b9f8d68c)
2025-07-29 07:35:55 +00:00
Mihir Kandoi
85f1efe67e Merge pull request #48777 from frappe/mergify/bp/version-15-hotfix/pr-48773
fix: create job card for selected operations only (backport #48773)
2025-07-29 13:00:28 +05:30
ruthra kumar
d543a0c959 Merge pull request #48823 from frappe/mergify/bp/version-15-hotfix/pr-48757
fix: add patch for update subscription details (backport #48757)
2025-07-29 12:29:51 +05:30
l0gesh29
ebda396518 fix: update subscription details patch
(cherry picked from commit c7b1379a7f)
2025-07-29 06:38:09 +00:00
Mihir Kandoi
c086f43964 Merge pull request #48821 from frappe/mergify/bp/version-15-hotfix/pr-48820
fix: over billed purchase receipt status (backport #48820)
2025-07-29 12:03:28 +05:30
Mihir Kandoi
3336b5d55d Merge branch 'version-15-hotfix' into mergify/bp/version-15-hotfix/pr-48820 2025-07-29 11:48:27 +05:30
mergify[bot]
18b007dbf2 Merge pull request #48805 from frappe/mergify/bp/version-15-hotfix/pr-48676
fix: missing account in GL entries (subcontracting) (backport #48676)
2025-07-29 11:48:12 +05:30
Mihir Kandoi
1efdff0ad1 fix: over billed purchase receipt status
(cherry picked from commit 15e354f76e)
2025-07-29 06:02:50 +00:00
Mihir Kandoi
92e315c4e1 Merge pull request #48811 from frappe/mergify/bp/version-15-hotfix/pr-48804
fix: sql error in quality inspection (backport #48804)
2025-07-29 11:18:46 +05:30
Mihir Kandoi
22e6ea41f7 Merge pull request #48819 from frappe/mergify/bp/version-15-hotfix/pr-39555
ci: Add fake passing tests when CI is skipped (backport #39555)
2025-07-29 11:18:02 +05:30
ruthra kumar
1c81b2c684 Merge pull request #48815 from frappe/mergify/bp/version-15-hotfix/pr-48797
fix: avoid auto_repeat on duplicate (backport #48797)
2025-07-29 09:18:28 +05:30
ruthra kumar
907358a356 Merge pull request #48814 from frappe/mergify/bp/version-15-hotfix/pr-48796
fix: remove alias for order by field (backport #48796)
2025-07-29 09:17:55 +05:30
Mihir Kandoi
9c3011cb9f Potential fix for code scanning alert no. 9: Workflow does not contain permissions
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-07-28 22:23:42 +05:30
Mihir Kandoi
5840a242a6 Potential fix for code scanning alert no. 13: Workflow does not contain permissions
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-07-28 22:23:34 +05:30
Ankush Menat
4fd32fc3bd ci: Add fake passing tests when CI is skipped (#39555)
(cherry picked from commit dfda5ad673)
2025-07-28 16:50:44 +00:00
Diptanil Saha
2d4419c9d5 Merge pull request #48818 from frappe/mergify/bp/version-15-hotfix/pr-48778
fix: fetch payment term template from order (backport #48778)
2025-07-28 20:41:42 +05:30
ravibharathi656
ee8eb368e7 fix: fetch payment term template from order
(cherry picked from commit 5ed34d6ff9)
2025-07-28 14:55:42 +00:00
Diptanil Saha
95470b4262 Merge pull request #48816 from diptanilsaha/backport_48675
feat(internal-transaction): fetch valuation rate for internal transaction (backport #48675, #48794)
2025-07-28 18:45:30 +05:30
diptanilsaha
bf5b6a540f fix: patch to enable fetch_valuation_rate_for_internal_transaction 2025-07-28 18:25:16 +05:30
mithili
65a27066cc fix: avoid auto_repeat on duplicate
(cherry picked from commit 2c54f49cbc)
2025-07-28 12:29:13 +00:00
rohitwaghchaure
f772976676 Merge pull request #48809 from frappe/mergify/bp/version-15-hotfix/pr-48787
fix: concurrency issues (backport #48787)
2025-07-28 17:55:49 +05:30
rohitwaghchaure
5e6f957e97 Merge pull request #48808 from frappe/mergify/bp/version-15-hotfix/pr-48801
fix: incorrect GL entries (backport #48801)
2025-07-28 17:55:09 +05:30
diptanilsaha
b23f7a9d91 fix: fetch item valuation rate for internal transactions 2025-07-28 17:54:56 +05:30
l0gesh29
f8d1e5a0d3 feat: add fetch_valuation_rate_for_internal_transaction in accounts settings 2025-07-28 17:54:32 +05:30
l0gesh29
1ca81887ca chore: rename variable
(cherry picked from commit 8fdda31e45)
2025-07-28 12:10:10 +00:00
l0gesh29
193fbcba11 fix: remove alias for order by field
(cherry picked from commit 048b87328b)
2025-07-28 12:10:10 +00:00
ruthra kumar
794fac12a4 Merge pull request #48812 from frappe/mergify/bp/version-15-hotfix/pr-48480
Currency sales partner commision report (backport #48480)
2025-07-28 17:29:32 +05:30
mergify[bot]
9b59fb659b fix: use db_set in email_campaign (backport #45679) (#48806)
Bug fix in email_campaign's update_status function. (#45679)

During the scheduler event of set_email_campaign_status, the function calling update_status isn't saving the modified status field.

(cherry picked from commit 88e68bb803)

Co-authored-by: harshpwctech <84438948+harshpwctech@users.noreply.github.com>
2025-07-28 17:26:17 +05:30
mithili
8d25269de6 refactor: remove join in sql
(cherry picked from commit 9638151f9d)
2025-07-28 11:42:54 +00:00
mithili
8314059bf7 chore: update query to fetch company currency
(cherry picked from commit 998617879c)
2025-07-28 11:42:53 +00:00
mithili
622052b950 fix: get default company currency
(cherry picked from commit 984947f333)
2025-07-28 11:42:53 +00:00
mithili
49befc1dfd fix: set company as mandatory
(cherry picked from commit 2de2ea9f58)
2025-07-28 11:42:53 +00:00
Mihir Kandoi
3e92ae8bd0 fix: sql error in quality inspection
(cherry picked from commit 062b245e3f)
2025-07-28 11:24:29 +00:00
Rohit Waghchaure
ad75754ca6 fix: prevent concurrency issues
(cherry picked from commit a186b1266d)
2025-07-28 10:59:17 +00:00
Rohit Waghchaure
207d2ac63c fix: incorrect GL entries
(cherry picked from commit 4c273fcc99)
2025-07-28 10:59:06 +00:00
Mihir Kandoi
442fede0fe Merge pull request #48803 from frappe/mergify/bp/version-15-hotfix/pr-48793
fix: status in MR (material transfer) when using transit stock entries (backport #48793)
2025-07-28 16:04:11 +05:30
Mihir Kandoi
584b442824 fix: status in MR (material transfer) when using transit stock entries
(cherry picked from commit baa612bc72)
2025-07-28 10:03:28 +00:00
Mihir Kandoi
faa9006072 Merge pull request #48789 from mihir-kandoi/st44460
fix: error when trying to edit quantity of top most FG in bom creator
2025-07-28 14:53:19 +05:30
Assem Bahnasy
01fcd98c84 fix: Misclassification of Journal Voucher Entries in Customer Ledger Summary (#48041)
* fix: miscalculation of Invoiced Amount, Paid Amount, and Credit Amount in Customer Ledger Summary

* style: Apply ruff-format to customer_ledger_summary.py and ignore .venv/

* fix: Ensure .venv/ is ignored in .gitignore

* chore: removing backportrc line

* test: adding test_journal_voucher_against_return_invoice()

* fix: fixed test_journal_voucher_against_return_invoice function

* Revert .gitignore changes

---------

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2025-07-28 14:35:59 +05:30
Mihir Kandoi
bd7de515b1 fix: error when trying to edit quantity of top most FG in bom creator 2025-07-28 11:42:13 +05:30
Smit Vora
8d8d47b0d6 Merge pull request #48729 from frappe/mergify/bp/version-15-hotfix/pr-48382 2025-07-26 12:13:27 +05:30
Soni Karm
0cb2c41cba fix: enhance warehouse filter to support list and tuple values (#48755) 2025-07-26 11:32:23 +05:30
Shreyas Sojitra
23180dad42 fix: create job card for selected operations only
(cherry picked from commit 27e5344188)
2025-07-25 04:36:33 +00:00
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
mergify[bot]
fd441e1eff refactor: call hooks after gle & sle rename (backport #48706) (#48754)
refactor: call hooks after gle & sle rename (#48706)

(cherry picked from commit ed79adebc4)

Co-authored-by: Kitti U. @ Ecosoft <kittiu@gmail.com>
2025-07-23 18:37:14 +05:30
rohitwaghchaure
0588b68cec Merge pull request #48734 from frappe/mergify/bp/version-15-hotfix/pr-48720
fix: valuation for rejected materials (backport #48720)
2025-07-23 08:45:35 +05:30
rohitwaghchaure
c2140625f5 chore: fixed test case 2025-07-23 08:27:33 +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
Smit Vora
176a124f1a chore: restore removed import as it's used in v15 2025-07-22 15:50:18 +05:30
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
4453e447dc chore: fix conflicts 2025-07-22 09:57:07 +05:30
Rohit Waghchaure
d378e51492 fix: valuation for rejected materials
(cherry picked from commit b7039cc506)

# Conflicts:
#	erpnext/controllers/buying_controller.py
2025-07-22 04:18:22 +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
Karm Soni
9bf0d852ee fix: update get_data function to use item_query
(cherry picked from commit 8a97b39028)
2025-07-21 14:33:53 +00:00
Karm Soni
fb81202830 refactor: revert indentation
(cherry picked from commit 063c4e9720)
2025-07-21 14:33:52 +00:00
Karm Soni
a1aee44014 refactor: remove unused imports in stock_balance.py
(cherry picked from commit bc46045cc7)
2025-07-21 14:33:52 +00:00
Karm Soni
b57163b7be fix: warehouse filter query by chaining conditions
(cherry picked from commit 7a266113ed)
2025-07-21 14:33:52 +00:00
Karm Soni
1d52a8fb69 fix: handle empty warehouse condition in get_warehouse_condition function; typo;
(cherry picked from commit fca9843fc2)
2025-07-21 14:33:52 +00:00
Karm Soni
a7e8f404f7 fix: use the item_query for get_data
(cherry picked from commit 169caaf66f)
2025-07-21 14:33:51 +00:00
Karm Soni
fa01bdc490 fix: correct query filter assignment in stock ledger and balance reports
(cherry picked from commit e60c711fdc)
2025-07-21 14:33:51 +00:00
Karm Soni
62033b5c7a fix(test): update tests
(cherry picked from commit 0a71ca6739)
2025-07-21 14:33:51 +00:00
Karm Soni
ecf9e6e748 feat: update stock ledger report to support multi-select for warehouses and items
(cherry picked from commit f2afd98725)
2025-07-21 14:33:50 +00:00
Karm Soni
72e8ce0449 refactor: use existing functionality
(cherry picked from commit 2882576479)
2025-07-21 14:33:50 +00:00
Karm Soni
801cda3813 feat: enhance apply_warehouse_filter to support multiple warehouses in filters
(cherry picked from commit 2ff1dcc391)
2025-07-21 14:33:50 +00:00
Karm Soni
2b08c5b769 feat: update stock balance report to support multi-select for items and warehouses
(cherry picked from commit 0d2a88bafc)
2025-07-21 14:33:49 +00:00
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
fd1c213a8d fix: patch to set default buying price list in material request (#48680)
* fix: patch to set default buying price list in material request

(cherry picked from commit 446264e496)
2025-07-18 11:14:15 +00:00
Mihir Kandoi
36a9f3b3e9 chore: rename recalculating to updating
(cherry picked from commit f6e16c1180)
2025-07-18 10:56:08 +00:00
Mihir Kandoi
6adc8a09c0 feat: option to recalculate costing and billing fields in project
(cherry picked from commit dd23d4c81b)
2025-07-18 10:56:07 +00:00
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
khushi8112
9fe1e6d0bd fix: test case 2025-07-16 16:03:07 +05:30
khushi8112
c7dcbed16f fix: test case 2025-07-16 15:41:42 +05:30
khushi8112
20bbfc504f fix: do not set value after depreciation as zero 2025-07-16 14:33:35 +05:30
khushi8112
3ab6a256e0 test: updated test case 2025-07-16 13:33:31 +05:30
khushi8112
d9b24a30eb fix: update asset value after revaluation cancellation 2025-07-16 13:12:51 +05:30
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
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
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
marination
3deb11e5b2 fix: Merge conflicts 2025-05-13 13:35:19 +02: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
396 changed files with 10741 additions and 5069 deletions

23
.github/workflows/patch_faux.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
# Tests are skipped for these files but github doesn't allow "passing" hence this is required.
name: Skipped Patch Test
permissions: none
on:
pull_request:
paths:
- "**.js"
- "**.css"
- "**.md"
- "**.html"
- "**.csv"
jobs:
test:
runs-on: ubuntu-latest
name: Patch Test
steps:
- name: Pass skipped tests unconditionally
run: "echo Skipped"

View File

@@ -0,0 +1,25 @@
# Tests are skipped for these files but github doesn't allow "passing" hence this is required.
name: Skipped Tests
permissions: {}
on:
pull_request:
paths:
- "**.js"
- "**.css"
- "**.md"
- "**.html"
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
container: [1, 2, 3, 4]
name: Python Unit Tests
steps:
- name: Pass skipped tests unconditionally
run: "echo Skipped"

View File

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

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

@@ -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,15 @@
"show_taxes_as_table_in_print",
"column_break_12",
"show_payment_schedule_in_print",
"item_price_settings_section",
"maintain_same_internal_transaction_rate",
"fetch_valuation_rate_for_internal_transaction",
"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",
@@ -81,6 +89,8 @@
"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",
@@ -540,19 +550,12 @@
"fieldname": "column_break_xrnd",
"fieldtype": "Column Break"
},
{
"default": "0",
"description": "If enabled, Sales Invoice will be generated instead of POS Invoice in POS Transactions for real-time update of G/L and Stock Ledger.",
"fieldname": "use_sales_invoice_in_pos",
"fieldtype": "Check",
"label": "Use Sales Invoice"
},
{
"default": "Buffered Cursor",
"fieldname": "receivable_payable_fetch_method",
"fieldtype": "Select",
"label": "Data Fetch Method",
"options": "Buffered Cursor\nUnBuffered Cursor"
"options": "Buffered Cursor\nUnBuffered Cursor\nRaw SQL"
},
{
"fieldname": "accounts_receivable_payable_tuning_section",
@@ -563,6 +566,69 @@
"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"
},
{
"default": "0",
"fieldname": "fetch_valuation_rate_for_internal_transaction",
"fieldtype": "Check",
"label": "Fetch Valuation Rate for Internal Transaction"
}
],
"icon": "icon-cog",
@@ -570,7 +636,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2025-05-05 12:29:38.302027",
"modified": "2025-07-18 13:56:47.192437",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",
@@ -599,4 +665,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
@@ -46,18 +48,22 @@ class AccountsSettings(Document):
enable_immutable_ledger: DF.Check
enable_party_matching: DF.Check
exchange_gain_loss_posting_date: DF.Literal["Invoice", "Payment", "Reconciliation Date"]
fetch_valuation_rate_for_internal_transaction: DF.Check
frozen_accounts_modifier: DF.Link | None
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"]
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
@@ -70,6 +76,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
@@ -136,3 +143,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

@@ -12,7 +12,8 @@
"against_voucher_no",
"amount",
"currency",
"event"
"event",
"delinked"
],
"fields": [
{
@@ -68,12 +69,20 @@
"label": "Company",
"options": "Company",
"read_only": 1
},
{
"default": "0",
"fieldname": "delinked",
"fieldtype": "Check",
"label": "DeLinked",
"read_only": 1
}
],
"grid_page_length": 50,
"in_create": 1,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-11-05 10:31:28.736671",
"modified": "2025-07-29 11:37:42.678556",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Advance Payment Ledger Entry",
@@ -107,7 +116,8 @@
"share": 1
}
],
"row_format": "Dynamic",
"sort_field": "creation",
"sort_order": "DESC",
"states": []
}
}

View File

@@ -1,9 +1,11 @@
# Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
import frappe
from frappe.model.document import Document
from erpnext.accounts.utils import update_voucher_outstanding
class AdvancePaymentLedgerEntry(Document):
# begin: auto-generated types
@@ -19,9 +21,16 @@ class AdvancePaymentLedgerEntry(Document):
amount: DF.Currency
company: DF.Link | None
currency: DF.Link | None
delinked: DF.Check
event: DF.Data | None
voucher_no: DF.DynamicLink | None
voucher_type: DF.Link | None
# end: auto-generated types
pass
def on_update(self):
if (
self.against_voucher_type in ["Purchase Order", "Sales Order"]
and self.flags.update_outstanding == "Yes"
and not frappe.flags.is_reverse_depr_entry
):
update_voucher_outstanding(self.against_voucher_type, self.against_voucher_no, None, None, None)

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

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

@@ -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

@@ -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

@@ -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, now
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, modified = %s where name = %s",
(newname, now(), 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

@@ -163,6 +163,7 @@ frappe.ui.form.on("Journal Entry", {
});
erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
erpnext.utils.set_letter_head(frm);
},
voucher_type: function (frm) {

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,
@@ -146,8 +147,7 @@ class JournalEntry(AccountsController):
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):
@@ -191,8 +191,6 @@ class JournalEntry(AccountsController):
self.validate_cheque_info()
self.check_credit_limit()
self.make_gl_entries()
self.make_advance_payment_ledger_entries()
self.update_advance_paid()
self.update_asset_value()
self.update_inter_company_jv()
self.update_invoice_discounting()
@@ -225,8 +223,6 @@ class JournalEntry(AccountsController):
"Advance Payment Ledger Entry",
)
self.make_gl_entries(1)
self.make_advance_payment_ledger_entries()
self.update_advance_paid()
self.unlink_advance_entry_reference()
self.unlink_asset_reference()
self.unlink_inter_company_jv()
@@ -237,17 +233,6 @@ class JournalEntry(AccountsController):
def get_title(self):
return self.pay_to_recd_from or self.accounts[0].account
def update_advance_paid(self):
advance_paid = frappe._dict()
for d in self.get("accounts"):
if d.is_advance:
if d.reference_type in frappe.get_hooks("advance_payment_doctypes"):
advance_paid.setdefault(d.reference_type, []).append(d.reference_name)
for voucher_type, order_list in advance_paid.items():
for voucher_no in list(set(order_list)):
frappe.get_doc(voucher_type, voucher_no).set_total_advance_paid()
def validate_inter_company_accounts(self):
if self.voucher_type == "Inter Company Journal Entry" and self.inter_company_journal_entry_reference:
doc = frappe.db.get_value(
@@ -1093,49 +1078,65 @@ class JournalEntry(AccountsController):
self.transaction_exchange_rate = row.exchange_rate
break
advance_doctypes = get_advance_payment_doctypes()
for d in self.get("accounts"):
if d.debit or d.credit or (self.voucher_type == "Exchange Gain Or Loss"):
r = [d.user_remark, self.remark]
r = [x for x in r if x]
remarks = "\n".join(r)
row = {
"account": d.account,
"party_type": d.party_type,
"due_date": self.due_date,
"party": d.party,
"against": d.against_account,
"debit": flt(d.debit, d.precision("debit")),
"credit": flt(d.credit, d.precision("credit")),
"account_currency": d.account_currency,
"debit_in_account_currency": flt(
d.debit_in_account_currency, d.precision("debit_in_account_currency")
),
"credit_in_account_currency": flt(
d.credit_in_account_currency, d.precision("credit_in_account_currency")
),
"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,
"voucher_detail_no": d.reference_detail_no,
"cost_center": d.cost_center,
"project": d.project,
"finance_book": self.finance_book,
"advance_voucher_type": d.advance_voucher_type,
"advance_voucher_no": d.advance_voucher_no,
}
if d.reference_type in advance_doctypes:
row.update(
{
"against_voucher_type": self.doctype,
"against_voucher": self.name,
"advance_voucher_type": d.reference_type,
"advance_voucher_no": d.reference_name,
}
)
gl_map.append(
self.get_gl_dict(
{
"account": d.account,
"party_type": d.party_type,
"due_date": self.due_date,
"party": d.party,
"against": d.against_account,
"debit": flt(d.debit, d.precision("debit")),
"credit": flt(d.credit, d.precision("credit")),
"account_currency": d.account_currency,
"debit_in_account_currency": flt(
d.debit_in_account_currency, d.precision("debit_in_account_currency")
),
"credit_in_account_currency": flt(
d.credit_in_account_currency, d.precision("credit_in_account_currency")
),
"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,
"voucher_detail_no": d.reference_detail_no,
"cost_center": d.cost_center,
"project": d.project,
"finance_book": self.finance_book,
},
row,
item=d,
)
)

View File

@@ -580,6 +580,18 @@ class TestJournalEntry(unittest.TestCase):
]
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,

View File

@@ -32,6 +32,8 @@
"reference_name",
"reference_due_date",
"reference_detail_no",
"advance_voucher_type",
"advance_voucher_no",
"col_break3",
"is_advance",
"user_remark",
@@ -263,12 +265,28 @@
"label": "Reference Detail No",
"no_copy": 1,
"search_index": 1
},
{
"fieldname": "advance_voucher_type",
"fieldtype": "Link",
"label": "Advance Voucher Type",
"no_copy": 1,
"options": "DocType",
"read_only": 1
},
{
"fieldname": "advance_voucher_no",
"fieldtype": "Dynamic Link",
"label": "Advance Voucher No",
"no_copy": 1,
"options": "advance_voucher_type",
"read_only": 1
}
],
"idx": 1,
"istable": 1,
"links": [],
"modified": "2024-02-05 01:10:50.224840",
"modified": "2025-07-25 04:45:28.117715",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry Account",
@@ -279,4 +297,4 @@
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
}

View File

@@ -17,8 +17,9 @@ class JournalEntryAccount(Document):
account: DF.Link
account_currency: DF.Link | None
account_type: DF.Data | None
advance_voucher_no: DF.DynamicLink | None
advance_voucher_type: DF.Link | None
against_account: DF.Text | None
balance: DF.Currency
bank_account: DF.Link | None
cost_center: DF.Link | None
credit: DF.Currency
@@ -31,7 +32,6 @@ class JournalEntryAccount(Document):
parentfield: DF.Data
parenttype: DF.Data
party: DF.DynamicLink | None
party_balance: DF.Currency
party_type: DF.Link | None
project: DF.Link | None
reference_detail_no: DF.Data | None

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

@@ -273,6 +273,7 @@ frappe.ui.form.on("Payment Entry", {
frm.events.hide_unhide_fields(frm);
frm.events.set_dynamic_labels(frm);
erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
erpnext.utils.set_letter_head(frm);
},
contact_person: function (frm) {

View File

@@ -228,6 +228,7 @@
"fieldname": "party_balance",
"fieldtype": "Currency",
"label": "Party Balance",
"no_copy": 1,
"print_hide": 1,
"read_only": 1
},
@@ -799,7 +800,7 @@
"table_fieldname": "payment_entries"
}
],
"modified": "2025-05-08 11:18:10.238085",
"modified": "2025-05-15 18:01:04.013025",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry",

View File

@@ -46,8 +46,10 @@ from erpnext.accounts.party import (
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,
@@ -115,12 +117,10 @@ class PaymentEntry(AccountsController):
def on_submit(self):
if self.difference_amount:
frappe.throw(_("Difference Amount must be zero"))
self.update_payment_requests()
self.make_gl_entries()
self.update_outstanding_amounts()
self.update_payment_schedule()
self.update_payment_requests()
self.make_advance_payment_ledger_entries()
self.update_advance_paid() # advance_paid_status depends on the payment request amount
self.set_status()
def validate_for_repost(self):
@@ -220,13 +220,11 @@ class PaymentEntry(AccountsController):
"Advance Payment Ledger Entry",
)
super().on_cancel()
self.update_payment_requests(cancel=True)
self.make_gl_entries(cancel=1)
self.update_outstanding_amounts()
self.delink_advance_entry_references()
self.update_payment_schedule(cancel=1)
self.update_payment_requests(cancel=True)
self.make_advance_payment_ledger_entries()
self.update_advance_paid() # advance_paid_status depends on the payment request amount
self.set_status()
def update_payment_requests(self, cancel=False):
@@ -568,7 +566,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()
@@ -1028,7 +1026,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
@@ -1308,8 +1306,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:
@@ -1365,23 +1362,27 @@ class PaymentEntry(AccountsController):
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,
"advance_voucher_type": d.advance_voucher_type,
"advance_voucher_no": d.advance_voucher_no,
},
item=self,
)
)
if self.book_advance_payments_in_separate_party_account:
if d.reference_doctype in advance_payment_doctypes:
# Upon reconciliation, whole ledger will be reposted. So, reference to SO/PO is fine
gle.update(
{
"against_voucher_type": d.reference_doctype,
"against_voucher": d.reference_name,
}
)
else:
# Do not reference Invoices while Advance is in separate party account
gle.update({"against_voucher_type": self.doctype, "against_voucher": self.name})
if d.reference_doctype in advance_payment_doctypes:
# advance reference
gle.update(
{
"against_voucher_type": self.doctype,
"against_voucher": self.name,
"advance_voucher_type": d.reference_doctype,
"advance_voucher_no": d.reference_name,
}
)
elif self.book_advance_payments_in_separate_party_account:
# Do not reference Invoices while Advance is in separate party account
gle.update({"against_voucher_type": self.doctype, "against_voucher": self.name})
else:
gle.update(
{
@@ -1486,29 +1487,14 @@ class PaymentEntry(AccountsController):
"voucher_no": self.name,
"voucher_detail_no": invoice.name,
}
if invoice.reconcile_effect_on:
posting_date = invoice.reconcile_effect_on
else:
# For backwards compatibility
# Supporting reposting on payment entries reconciled before select field introduction
reconciliation_takes_effect_on = frappe.get_cached_value(
"Company", self.company, "reconciliation_takes_effect_on"
posting_date = get_reconciliation_effect_date(
invoice.reference_doctype, invoice.reference_name, self.company, self.posting_date
)
if reconciliation_takes_effect_on == "Advance Payment Date":
posting_date = self.posting_date
elif 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 reconciliation_takes_effect_on == "Reconciliation Date":
posting_date = nowdate()
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)
@@ -1526,6 +1512,8 @@ class PaymentEntry(AccountsController):
{
"against_voucher_type": invoice.reference_doctype,
"against_voucher": invoice.reference_name,
"advance_voucher_type": invoice.advance_voucher_type,
"advance_voucher_no": invoice.advance_voucher_no,
"posting_date": posting_date,
}
)
@@ -1550,6 +1538,8 @@ class PaymentEntry(AccountsController):
{
"against_voucher_type": "Payment Entry",
"against_voucher": self.name,
"advance_voucher_type": invoice.advance_voucher_type,
"advance_voucher_no": invoice.advance_voucher_no,
}
)
gle = self.get_gl_dict(
@@ -1698,14 +1688,6 @@ 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()
def on_recurring(self, reference_doc, auto_repeat_doc):
self.reference_no = reference_doc.name
self.reference_date = nowdate()

View File

@@ -52,7 +52,7 @@ class TestPaymentEntry(FrappeTestCase):
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]]
(d[0], d) for d in [["Debtors - _TC", 0, 1000, pe.name], ["_Test Cash - _TC", 1000.0, 0, None]]
)
self.validate_gl_entries(pe.name, expected_gle)
@@ -84,7 +84,7 @@ class TestPaymentEntry(FrappeTestCase):
expected_gle = dict(
(d[0], d)
for d in [["_Test Receivable USD - _TC", 0, 5500, so.name], [pe.paid_to, 5500.0, 0, None]]
for d in [["_Test Receivable USD - _TC", 0, 5500, pe.name], [pe.paid_to, 5500.0, 0, None]]
)
self.validate_gl_entries(pe.name, expected_gle)

View File

@@ -22,7 +22,9 @@
"exchange_gain_loss",
"account",
"payment_request",
"payment_request_outstanding"
"payment_request_outstanding",
"advance_voucher_type",
"advance_voucher_no"
],
"fields": [
{
@@ -151,12 +153,28 @@
"fieldtype": "Date",
"label": "Reconcile Effect On",
"read_only": 1
},
{
"columns": 2,
"fieldname": "advance_voucher_type",
"fieldtype": "Link",
"label": "Advance Voucher Type",
"options": "DocType",
"read_only": 1
},
{
"columns": 2,
"fieldname": "advance_voucher_no",
"fieldtype": "Dynamic Link",
"label": "Advance Voucher No",
"options": "advance_voucher_type",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2025-01-13 15:56:18.895082",
"modified": "2025-07-25 04:32:11.040025",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry Reference",
@@ -167,4 +185,4 @@
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
}

View File

@@ -16,6 +16,8 @@ class PaymentEntryReference(Document):
account: DF.Link | None
account_type: DF.Data | None
advance_voucher_no: DF.DynamicLink | None
advance_voucher_type: DF.Link | None
allocated_amount: DF.Float
bill_no: DF.Data | None
due_date: DF.Date | None
@@ -26,7 +28,6 @@ class PaymentEntryReference(Document):
parentfield: DF.Data
parenttype: DF.Data
payment_request: DF.Link | None
payment_request_outstanding: DF.Float
payment_term: DF.Link | None
payment_term_outstanding: DF.Float
payment_type: DF.Data | None

View File

@@ -197,4 +197,4 @@
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
}

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

@@ -1714,6 +1714,67 @@ class TestPaymentReconciliation(FrappeTestCase):
)
self.assertEqual(len(pl_entries), 3)
def test_advance_payment_reconciliation_date_for_older_date(self):
old_settings = frappe.db.get_value(
"Company",
self.company,
[
"reconciliation_takes_effect_on",
"default_advance_paid_account",
"book_advance_payments_in_separate_party_account",
],
as_dict=True,
)
frappe.db.set_value(
"Company",
self.company,
{
"book_advance_payments_in_separate_party_account": 1,
"default_advance_paid_account": self.advance_payable_account,
"reconciliation_takes_effect_on": "Oldest Of Invoice Or Advance",
},
)
self.supplier = "_Test Supplier"
pi1 = self.create_purchase_invoice(qty=10, rate=100)
po = self.create_purchase_order(qty=10, rate=100)
pay = get_payment_entry(po.doctype, po.name)
pay.paid_amount = 1000
pay.save().submit()
pr = frappe.new_doc("Payment Reconciliation")
pr.company = self.company
pr.party_type = "Supplier"
pr.party = self.supplier
pr.receivable_payable_account = get_party_account(pr.party_type, pr.party, pr.company)
pr.default_advance_account = self.advance_payable_account
pr.get_unreconciled_entries()
invoices = [x.as_dict() for x in pr.invoices]
payments = [x.as_dict() for x in pr.payments]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
pr.allocation[0].allocated_amount = 100
pr.reconcile()
pay.reload()
self.assertEqual(getdate(pay.references[0].reconcile_effect_on), getdate(pi1.posting_date))
# test setting of date if not available
frappe.db.set_value("Payment Entry Reference", pay.references[1].name, "reconcile_effect_on", None)
pay.reload()
pay.cancel()
pay.reload()
pi1.reload()
po.reload()
self.assertEqual(getdate(pay.references[0].reconcile_effect_on), getdate(pi1.posting_date))
pi1.cancel()
po.cancel()
frappe.db.set_value("Company", self.company, old_settings)
def test_advance_payment_reconciliation_against_journal_for_customer(self):
frappe.db.set_value(
"Company",
@@ -2145,6 +2206,136 @@ class TestPaymentReconciliation(FrappeTestCase):
self.assertEqual(len(pr.get("payments")), 0)
self.assertEqual(pr.get("invoices")[0].get("outstanding_amount"), 200)
def test_partial_advance_payment_with_closed_fiscal_year(self):
"""
Test Advance Payment partial reconciliation before period closing and partial after period closing
"""
default_settings = frappe.db.get_value(
"Company",
self.company,
[
"book_advance_payments_in_separate_party_account",
"default_advance_paid_account",
"reconciliation_takes_effect_on",
],
as_dict=True,
)
first_fy_start_date = frappe.db.get_value("Fiscal Year", {"disabled": 0}, "min(year_start_date)")
prev_fy_start_date = add_years(first_fy_start_date, -1)
prev_fy_end_date = add_days(first_fy_start_date, -1)
create_fiscal_year(
company=self.company, year_start_date=prev_fy_start_date, year_end_date=prev_fy_end_date
)
frappe.db.set_value(
"Company",
self.company,
{
"book_advance_payments_in_separate_party_account": 1,
"default_advance_paid_account": self.advance_payable_account,
"reconciliation_takes_effect_on": "Oldest Of Invoice Or Advance",
},
)
self.supplier = "_Test Supplier"
# Create advance payment of 1000 (previous FY)
pe = self.create_payment_entry(amount=1000, posting_date=prev_fy_start_date)
pe.party_type = "Supplier"
pe.party = self.supplier
pe.payment_type = "Pay"
pe.paid_from = self.cash
pe.paid_to = self.advance_payable_account
pe.save().submit()
# Create purchase invoice of 600 (previous FY)
pi1 = self.create_purchase_invoice(qty=1, rate=600, do_not_submit=True)
pi1.posting_date = prev_fy_start_date
pi1.set_posting_time = 1
pi1.supplier = self.supplier
pi1.credit_to = self.creditors
pi1.save().submit()
# Reconcile advance payment
pr = self.create_payment_reconciliation(party_is_customer=False)
pr.party = self.supplier
pr.receivable_payable_account = self.creditors
pr.default_advance_account = self.advance_payable_account
pr.from_invoice_date = pr.to_invoice_date = pi1.posting_date
pr.from_payment_date = pr.to_payment_date = pe.posting_date
pr.get_unreconciled_entries()
invoices = [x.as_dict() for x in pr.invoices if x.invoice_number == pi1.name]
payments = [x.as_dict() for x in pr.payments if x.reference_name == pe.name]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
pr.reconcile()
# Verify partial reconciliation
pe.reload()
pi1.reload()
self.assertEqual(len(pe.references), 1)
self.assertEqual(pe.references[0].allocated_amount, 600)
self.assertEqual(flt(pe.unallocated_amount), 400)
self.assertEqual(pi1.outstanding_amount, 0)
self.assertEqual(pi1.status, "Paid")
# Close accounting period for March (previous FY)
pcv = make_period_closing_voucher(
company=self.company, cost_center=self.cost_center, posting_date=prev_fy_end_date
)
pcv.reload()
self.assertEqual(pcv.gle_processing_status, "Completed")
# Change reconciliation setting to "Reconciliation Date"
frappe.db.set_value(
"Company",
self.company,
"reconciliation_takes_effect_on",
"Reconciliation Date",
)
# Create new purchase invoice for 400 in new fiscal year
pi2 = self.create_purchase_invoice(qty=1, rate=400, do_not_submit=True)
pi2.posting_date = today()
pi2.set_posting_time = 1
pi2.supplier = self.supplier
pi2.currency = "INR"
pi2.credit_to = self.creditors
pi2.save()
pi2.submit()
# Allocate 600 from advance payment to purchase invoice
pr = self.create_payment_reconciliation(party_is_customer=False)
pr.party = self.supplier
pr.receivable_payable_account = self.creditors
pr.default_advance_account = self.advance_payable_account
pr.from_invoice_date = pr.to_invoice_date = pi2.posting_date
pr.from_payment_date = pr.to_payment_date = pe.posting_date
pr.get_unreconciled_entries()
invoices = [x.as_dict() for x in pr.invoices if x.invoice_number == pi2.name]
payments = [x.as_dict() for x in pr.payments if x.reference_name == pe.name]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
pr.reconcile()
pe.reload()
pi2.reload()
# Assert advance payment is fully allocated
self.assertEqual(len(pe.references), 2)
self.assertEqual(flt(pe.unallocated_amount), 0)
# Assert new invoice is fully paid
self.assertEqual(pi2.outstanding_amount, 0)
self.assertEqual(pi2.status, "Paid")
# Verify reconciliation dates are correct based on company setting
self.assertEqual(getdate(pe.references[0].reconcile_effect_on), getdate(pi1.posting_date))
self.assertEqual(getdate(pe.references[1].reconcile_effect_on), getdate(pi2.posting_date))
frappe.db.set_value("Company", self.company, default_settings)
def make_customer(customer_name, currency=None):
if not frappe.db.exists("Customer", customer_name):

View File

@@ -829,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

@@ -328,7 +328,7 @@ class TestPaymentRequest(FrappeTestCase):
self.assertEqual(pe.paid_amount, 800) # paid amount set from pr's outstanding amount
self.assertEqual(pe.references[0].allocated_amount, 800)
self.assertEqual(pe.references[0].outstanding_amount, 800) # for Orders it is not zero
self.assertEqual(pe.references[0].outstanding_amount, 0) # Also for orders it will zero
self.assertEqual(pe.references[0].payment_request, pr.name)
so.load_from_db()
@@ -630,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

@@ -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

@@ -210,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,
@@ -220,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

@@ -14,6 +14,7 @@ erpnext.selling.POSInvoiceController = class POSInvoiceController extends erpnex
}
company() {
erpnext.utils.set_letter_head(this.frm);
erpnext.accounts.dimensions.update_dimension(this.frm, this.frm.doctype);
this.frm.set_value("set_warehouse", "");
this.frm.set_value("taxes_and_charges", "");

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

@@ -273,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

View File

@@ -1071,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

@@ -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

@@ -28,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
@@ -258,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
@@ -337,6 +337,11 @@ class POSInvoiceMergeLog(Document):
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):
@@ -583,6 +588,7 @@ def create_merge_logs(invoice_by_customer, closing_entry=None):
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)

View File

@@ -135,6 +135,7 @@ frappe.ui.form.on("POS Profile", {
company: function (frm) {
frm.trigger("toggle_display_account_head");
erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
erpnext.utils.set_letter_head(frm);
},
toggle_display_account_head: function (frm) {

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)

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,12 @@ 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", "");
erpnext.utils.set_letter_head(frm);
},
report: function (frm) {
let filters = {
company: frm.doc.company,

View File

@@ -376,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",
@@ -400,7 +400,7 @@
}
],
"links": [],
"modified": "2025-04-30 14:43:23.643006",
"modified": "2025-07-08 16:52:12.602384",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Statement Of Accounts",

View File

@@ -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)
)

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

@@ -970,7 +970,7 @@ class PurchaseInvoice(BuyingController):
self.get_provisional_accounts()
for item in self.get("items"):
if flt(item.base_net_amount):
if flt(item.base_net_amount) or (self.get("update_stock") and item.valuation_rate):
if item.item_code:
frappe.get_cached_value("Item", item.item_code, "asset_category")
@@ -1223,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(
@@ -1254,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,
}
@@ -1270,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):
@@ -1303,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
@@ -1332,38 +1368,6 @@ class PurchaseInvoice(BuyingController):
warehouse_debit_amount = stock_amount
elif self.is_return and self.update_stock and self.is_internal_supplier and warehouse_debit_amount:
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)
+ flt(item.get("amount_difference_with_purchase_invoice"))
)
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,
)
)
return warehouse_debit_amount
def make_tax_gl_entries(self, gl_entries):

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()
@@ -1706,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"
@@ -1714,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()
@@ -1770,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()
@@ -2796,6 +2885,17 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
# 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(
@@ -2905,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})
@@ -2934,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

@@ -169,6 +169,10 @@ def start_repost(account_repost_doc=str) -> None:
frappe.db.delete(
"Payment Ledger Entry", filters={"voucher_type": doc.doctype, "voucher_no": doc.name}
)
frappe.db.delete(
"Advance Payment Ledger Entry",
filters={"voucher_type": doc.doctype, "voucher_no": doc.name},
)
if doc.doctype in ["Sales Invoice", "Purchase Invoice"]:
if not repost_doc.delete_cancelled_entries:

View File

@@ -8,7 +8,7 @@ from frappe import _, qb
from frappe.model.document import Document
from frappe.query_builder.custom import ConstantColumn
from erpnext.accounts.utils import _delete_pl_entries, create_payment_ledger_entry
from erpnext.accounts.utils import _delete_adv_pl_entries, _delete_pl_entries, create_payment_ledger_entry
VOUCHER_TYPES = ["Sales Invoice", "Purchase Invoice", "Payment Entry", "Journal Entry"]
@@ -16,6 +16,7 @@ VOUCHER_TYPES = ["Sales Invoice", "Purchase Invoice", "Payment Entry", "Journal
def repost_ple_for_voucher(voucher_type, voucher_no, gle_map=None):
if voucher_type and voucher_no and gle_map:
_delete_pl_entries(voucher_type, voucher_no)
_delete_adv_pl_entries(voucher_type, voucher_no)
create_payment_ledger_entry(gle_map, cancel=0)

View File

@@ -2024,6 +2024,7 @@
"fieldname": "amount_eligible_for_commission",
"fieldtype": "Currency",
"label": "Amount Eligible for Commission",
"options": "Company:company:default_currency",
"read_only": 1
},
{
@@ -2188,7 +2189,7 @@
"link_fieldname": "consolidated_invoice"
}
],
"modified": "2025-03-17 19:32:31.809658",
"modified": "2025-06-26 14:06:56.773552",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",

View File

@@ -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()
@@ -1356,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,
@@ -1369,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 = _(
@@ -1467,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)
@@ -2286,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")
@@ -2296,16 +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, "dispatch_address", "dispatch_address_display", source_doc.dispatch_address_name
)
update_address(
target_doc, "shipping_address", "shipping_address_display", source_doc.shipping_address_name
)
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
@@ -2326,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

View File

@@ -27,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
@@ -64,6 +64,26 @@ class TestSalesInvoice(FrappeTestCase):
)
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()
@@ -82,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
@@ -806,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])
@@ -2463,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",
@@ -2517,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",
@@ -2524,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
@@ -2567,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(
@@ -2763,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
@@ -2963,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.
@@ -3049,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,
@@ -3343,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
@@ -3350,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",
@@ -4323,6 +4496,94 @@ class TestSalesInvoice(FrappeTestCase):
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(
@@ -4350,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)
@@ -4375,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})
@@ -4411,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,
@@ -4425,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,
},
)
@@ -4577,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

@@ -671,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)

View File

@@ -9,6 +9,7 @@ from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_pay
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.party import get_party_account
from erpnext.accounts.test.accounts_mixin import AccountsTestMixin
from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order
from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
@@ -17,6 +18,7 @@ class TestUnreconcilePayment(AccountsTestMixin, FrappeTestCase):
def setUp(self):
self.create_company()
self.create_customer()
self.create_supplier()
self.create_usd_receivable_account()
self.create_item()
self.clear_old_entries()
@@ -364,13 +366,13 @@ class TestUnreconcilePayment(AccountsTestMixin, FrappeTestCase):
# Assert 'Advance Paid'
so.reload()
pe.reload()
self.assertEqual(so.advance_paid, 100)
self.assertEqual(so.advance_paid, 0)
self.assertEqual(len(pe.references), 0)
self.assertEqual(pe.unallocated_amount, 100)
pe.cancel()
so.reload()
self.assertEqual(so.advance_paid, 100)
self.assertEqual(so.advance_paid, 0)
def test_06_unreconcile_advance_from_payment_entry(self):
self.enable_advance_as_liability()
@@ -417,7 +419,7 @@ class TestUnreconcilePayment(AccountsTestMixin, FrappeTestCase):
so2.reload()
pe.reload()
self.assertEqual(so1.advance_paid, 150)
self.assertEqual(so2.advance_paid, 110)
self.assertEqual(so2.advance_paid, 0)
self.assertEqual(len(pe.references), 1)
self.assertEqual(pe.unallocated_amount, 110)
@@ -463,8 +465,77 @@ class TestUnreconcilePayment(AccountsTestMixin, FrappeTestCase):
self.assertEqual(len(pr.get("invoices")), 0)
self.assertEqual(len(pr.get("payments")), 0)
# Assert 'Advance Paid'
so.reload()
self.assertEqual(so.advance_paid, 1000)
unreconcile = frappe.get_doc(
{
"doctype": "Unreconcile Payment",
"company": self.company,
"voucher_type": pe.doctype,
"voucher_no": pe.name,
}
)
unreconcile.add_references()
unreconcile.allocations = [x for x in unreconcile.allocations if x.reference_name == si.name]
unreconcile.save().submit()
# after unreconcilaition advance paid will be reduced
# Assert 'Advance Paid'
so.reload()
self.assertEqual(so.advance_paid, 0)
self.disable_advance_as_liability()
def test_unreconcile_advance_from_journal_entry(self):
po = create_purchase_order(
company=self.company,
supplier=self.supplier,
item=self.item,
qty=1,
rate=100,
transaction_date=today(),
do_not_submit=False,
)
je = frappe.get_doc(
{
"doctype": "Journal Entry",
"company": self.company,
"voucher_type": "Journal Entry",
"posting_date": po.transaction_date,
"multi_currency": True,
"accounts": [
{
"account": "Creditors - _TC",
"party_type": "Supplier",
"party": po.supplier,
"debit_in_account_currency": 100,
"is_advance": "Yes",
"reference_type": po.doctype,
"reference_name": po.name,
},
{"account": "Cash - _TC", "credit_in_account_currency": 100},
],
}
)
je.save().submit()
po.reload()
self.assertEqual(po.advance_paid, 100)
unreconcile = frappe.get_doc(
{
"doctype": "Unreconcile Payment",
"company": self.company,
"voucher_type": je.doctype,
"voucher_no": je.name,
}
)
unreconcile.add_references()
self.assertEqual(len(unreconcile.allocations), 1)
allocations = [x.reference_name for x in unreconcile.allocations]
self.assertEqual([po.name], allocations)
unreconcile.save().submit()
po.reload()
self.assertEqual(po.advance_paid, 0)

View File

@@ -44,31 +44,12 @@ class UnreconcilePayment(Document):
@frappe.whitelist()
def get_allocations_from_payment(self):
allocated_references = []
ple = qb.DocType("Payment Ledger Entry")
allocated_references = (
qb.from_(ple)
.select(
ple.account,
ple.party_type,
ple.party,
ple.against_voucher_type.as_("reference_doctype"),
ple.against_voucher_no.as_("reference_name"),
Abs(Sum(ple.amount_in_account_currency)).as_("allocated_amount"),
ple.account_currency,
)
.where(
(ple.docstatus == 1)
& (ple.voucher_type == self.voucher_type)
& (ple.voucher_no == self.voucher_no)
& (ple.voucher_no != ple.against_voucher_no)
)
.groupby(ple.against_voucher_type, ple.against_voucher_no)
.run(as_dict=True)
return get_linked_payments_for_doc(
company=self.company,
doctype=self.voucher_type,
docname=self.voucher_no,
)
return allocated_references
def add_references(self):
allocations = self.get_allocations_from_payment()
@@ -81,27 +62,43 @@ class UnreconcilePayment(Document):
doc = frappe.get_doc(alloc.reference_doctype, alloc.reference_name)
unlink_ref_doc_from_payment_entries(doc, self.voucher_no)
cancel_exchange_gain_loss_journal(doc, self.voucher_type, self.voucher_no)
# update outstanding amounts
update_voucher_outstanding(
alloc.reference_doctype, alloc.reference_name, alloc.account, alloc.party_type, alloc.party
alloc.reference_doctype,
alloc.reference_name,
alloc.account,
alloc.party_type,
alloc.party,
)
if doc.doctype in frappe.get_hooks("advance_payment_doctypes"):
doc.set_total_advance_paid()
frappe.db.set_value("Unreconcile Payment Entries", alloc.name, "unlinked", True)
@frappe.whitelist()
def doc_has_references(doctype: str | None = None, docname: str | None = None):
count = 0
if doctype in ["Sales Invoice", "Purchase Invoice"]:
return frappe.db.count(
count = frappe.db.count(
"Payment Ledger Entry",
filters={"delinked": 0, "against_voucher_no": docname, "amount": ["<", 0]},
)
else:
return frappe.db.count(
count = frappe.db.count(
"Payment Ledger Entry",
filters={"delinked": 0, "voucher_no": docname, "against_voucher_no": ["!=", docname]},
)
count += frappe.db.count(
"Advance Payment Ledger Entry",
filters={
"delinked": 0,
"voucher_no": docname,
"voucher_type": doctype,
"event": ["=", "Submit"],
},
)
return count
@frappe.whitelist()
@@ -123,9 +120,12 @@ def get_linked_payments_for_doc(
res = (
qb.from_(ple)
.select(
ple.account,
ple.party_type,
ple.party,
ple.company,
ple.voucher_type,
ple.voucher_no,
ple.voucher_type.as_("reference_doctype"),
ple.voucher_no.as_("reference_name"),
Abs(Sum(ple.amount_in_account_currency)).as_("allocated_amount"),
ple.account_currency,
)
@@ -147,19 +147,52 @@ def get_linked_payments_for_doc(
qb.from_(ple)
.select(
ple.company,
ple.against_voucher_type.as_("voucher_type"),
ple.against_voucher_no.as_("voucher_no"),
ple.account,
ple.party_type,
ple.party,
ple.against_voucher_type.as_("reference_doctype"),
ple.against_voucher_no.as_("reference_name"),
Abs(Sum(ple.amount_in_account_currency)).as_("allocated_amount"),
ple.account_currency,
)
.where(Criterion.all(criteria))
.groupby(ple.against_voucher_no)
)
res = query.run(as_dict=True)
res += get_linked_advances(company, _dn)
return res
return []
def get_linked_advances(company, docname):
adv = qb.DocType("Advance Payment Ledger Entry")
criteria = [
(adv.company == company),
(adv.delinked == 0),
(adv.voucher_no == docname),
(adv.event == "Submit"),
]
return (
qb.from_(adv)
.select(
adv.company,
adv.against_voucher_type.as_("reference_doctype"),
adv.against_voucher_no.as_("reference_name"),
Abs(Sum(adv.amount)).as_("allocated_amount"),
adv.currency,
)
.where(Criterion.all(criteria))
.having(qb.Field("allocated_amount") > 0)
.groupby(adv.against_voucher_no)
.run(as_dict=True)
)
@frappe.whitelist()
def create_unreconcile_doc_for_selection(selections=None):
if selections:

View File

@@ -305,6 +305,8 @@ def get_merge_properties(dimensions=None):
"project",
"finance_book",
"voucher_no",
"advance_voucher_type",
"advance_voucher_no",
]
if dimensions:
merge_properties.extend(dimensions)
@@ -692,7 +694,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

@@ -424,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"))
@@ -460,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:

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"),

View File

@@ -23,6 +23,13 @@ frappe.query_reports["Accounts Payable Summary"] = {
options: "Posting Date\nDue 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"),

View File

@@ -185,7 +185,7 @@
{% if(!filters.show_future_payments) { %}
<td>
{% if(!(filters.party)) { %}
{% if(!filters.party?.length) { %}
{%= data[i]["party"] %}
{% if(data[i]["customer_name"] && data[i]["customer_name"] != data[i]["party"]) { %}
<br> {%= data[i]["customer_name"] %}
@@ -258,7 +258,7 @@
{% if(data[i]["party"]|| "&nbsp;") { %}
{% if(!data[i]["is_total_row"]) { %}
<td>
{% if(!(filters.party)) { %}
{% if(!filters.party?.length) { %}
{%= data[i]["party"] %}
{% if(data[i]["customer_name"] && data[i]["customer_name"] != data[i]["party"]) { %}
<br> {%= data[i]["customer_name"] %}

View File

@@ -89,6 +89,13 @@ frappe.query_reports["Accounts Receivable"] = {
options: "Posting Date\nDue 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"),

View File

@@ -6,6 +6,7 @@ from collections import OrderedDict
import frappe
from frappe import _, qb, query_builder, scrub
from frappe.database.schema import get_definition
from frappe.query_builder import Criterion
from frappe.query_builder.functions import Date, Substring, Sum
from frappe.utils import cint, cstr, flt, getdate, nowdate
@@ -14,7 +15,12 @@ from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
get_accounting_dimensions,
get_dimension_with_children,
)
from erpnext.accounts.utils import get_currency_precision, get_party_types_from_account_type
from erpnext.accounts.utils import (
build_qb_match_conditions,
get_advance_payment_doctypes,
get_currency_precision,
get_party_types_from_account_type,
)
# This report gives a summary of all Outstanding Invoices considering the following
@@ -47,7 +53,10 @@ class ReceivablePayableReport:
self.ple = qb.DocType("Payment Ledger Entry")
self.filters.report_date = getdate(self.filters.report_date or nowdate())
self.age_as_on = (
getdate(nowdate()) if self.filters.report_date > getdate(nowdate()) else self.filters.report_date
getdate(nowdate())
if "calculate_ageing_with" not in self.filters
or self.filters.calculate_ageing_with == "Today Date"
else self.filters.report_date
)
if not self.filters.range:
@@ -58,6 +67,7 @@ class ReceivablePayableReport:
frappe.db.get_single_value("Accounts Settings", "receivable_payable_fetch_method")
or "Buffered Cursor"
) # Fail Safe
self.advance_payment_doctypes = get_advance_payment_doctypes()
def run(self, args):
self.filters.update(args)
@@ -81,6 +91,7 @@ class ReceivablePayableReport:
self.party_details = {}
self.invoices = set()
self.skip_total_row = 0
self.advance_payment_doctypes = get_advance_payment_doctypes()
if self.filters.get("group_by_party"):
self.previous_party = ""
@@ -96,9 +107,6 @@ class ReceivablePayableReport:
def get_data(self):
self.get_sales_invoices_or_customers_based_on_sales_person()
# Build delivery note map against all sales invoices
self.build_delivery_note_map()
# Get invoice details like bill_no, due_date etc for all invoices
self.get_invoice_details()
@@ -106,7 +114,8 @@ class ReceivablePayableReport:
self.get_future_payments()
# Get return entries
self.get_return_entries()
if not self.filters.party_type or self.filters.party_type in ["Customer", "Supplier"]:
self.get_return_entries()
# Get Exchange Rate Revaluations
self.get_exchange_rate_revaluations()
@@ -119,11 +128,16 @@ class ReceivablePayableReport:
self.fetch_ple_in_buffered_cursor()
elif self.ple_fetch_method == "UnBuffered Cursor":
self.fetch_ple_in_unbuffered_cursor()
elif self.ple_fetch_method == "Raw SQL":
self.fetch_ple_in_sql_procedures()
# Build delivery note map against all sales invoices
self.build_delivery_note_map()
self.build_data()
def fetch_ple_in_buffered_cursor(self):
self.ple_entries = frappe.db.sql(self.ple_query.get_sql(), as_dict=True)
self.ple_entries = self.ple_query.run(as_dict=True)
for ple in self.ple_entries:
self.init_voucher_balance(ple) # invoiced, paid, credit_note, outstanding
@@ -137,7 +151,7 @@ class ReceivablePayableReport:
def fetch_ple_in_unbuffered_cursor(self):
self.ple_entries = []
with frappe.db.unbuffered_cursor():
for ple in frappe.db.sql(self.ple_query.get_sql(), as_dict=True, as_iterator=True):
for ple in self.ple_query.run(as_dict=True, as_iterator=True):
self.init_voucher_balance(ple) # invoiced, paid, credit_note, outstanding
self.ple_entries.append(ple)
@@ -174,7 +188,10 @@ class ReceivablePayableReport:
if key not in self.voucher_balance:
self.voucher_balance[key] = self.build_voucher_dict(ple)
if ple.voucher_type == ple.against_voucher_type and ple.voucher_no == ple.against_voucher_no:
if (ple.voucher_type == ple.against_voucher_type and ple.voucher_no == ple.against_voucher_no) or (
ple.voucher_type in ("Payment Entry", "Journal Entry")
and ple.against_voucher_type in self.advance_payment_doctypes
):
self.voucher_balance[key].cost_center = ple.cost_center
self.get_invoices(ple)
@@ -302,6 +319,79 @@ class ReceivablePayableReport:
row.paid -= amount
row.paid_in_account_currency -= amount_in_account_currency
def fetch_ple_in_sql_procedures(self):
self.proc = InitSQLProceduresForAR()
build_balance = f"""
begin not atomic
declare done boolean default false;
declare rec1 row type of `{self.proc._row_def_table_name}`;
declare ple cursor for {self.ple_query.get_sql()};
declare continue handler for not found set done = true;
open ple;
fetch ple into rec1;
while not done do
call {self.proc.init_procedure_name}(rec1);
fetch ple into rec1;
end while;
close ple;
set done = false;
open ple;
fetch ple into rec1;
while not done do
call {self.proc.allocate_procedure_name}(rec1);
fetch ple into rec1;
end while;
close ple;
end;
"""
frappe.db.sql(build_balance)
balances = frappe.db.sql(
f"""select
name,
voucher_type,
voucher_no,
party,
party_account `account`,
posting_date,
account_currency,
cost_center,
sum(invoiced) `invoiced`,
sum(paid) `paid`,
sum(credit_note) `credit_note`,
sum(invoiced) - sum(paid) - sum(credit_note) `outstanding`,
sum(invoiced_in_account_currency) `invoiced_in_account_currency`,
sum(paid_in_account_currency) `paid_in_account_currency`,
sum(credit_note_in_account_currency) `credit_note_in_account_currency`,
sum(invoiced_in_account_currency) - sum(paid_in_account_currency) - sum(credit_note_in_account_currency) `outstanding_in_account_currency`
from `{self.proc._voucher_balance_name}` group by name order by posting_date;""",
as_dict=True,
)
for x in balances:
if self.filters.get("ignore_accounts"):
key = (x.voucher_type, x.voucher_no, x.party)
else:
key = (x.account, x.voucher_type, x.voucher_no, x.party)
_d = self.build_voucher_dict(x)
for field in [
"invoiced",
"paid",
"credit_note",
"outstanding",
"invoiced_in_account_currency",
"paid_in_account_currency",
"credit_note_in_account_currency",
"outstanding_in_account_currency",
"cost_center",
]:
_d[field] = x.get(field)
self.voucher_balance[key] = _d
def update_sub_total_row(self, row, party):
total_row = self.total_row_map.get(party)
@@ -444,16 +534,14 @@ class ReceivablePayableReport:
self.invoice_details = frappe._dict()
if self.account_type == "Receivable":
# nosemgrep
si_list = frappe.db.sql(
"""
select name, due_date, po_no
from `tabSales Invoice`
where posting_date <= %s
and company = %s
and docstatus = 1
""",
(self.filters.report_date, self.filters.company),
as_dict=1,
si_list = frappe.get_list(
"Sales Invoice",
filters={
"posting_date": ("<=", self.filters.report_date),
"company": self.filters.company,
"docstatus": 1,
},
fields=["name", "due_date", "po_no"],
)
for d in si_list:
self.invoice_details.setdefault(d.name, d)
@@ -476,33 +564,29 @@ class ReceivablePayableReport:
if self.account_type == "Payable":
# nosemgrep
for pi in frappe.db.sql(
"""
select name, due_date, bill_no, bill_date
from `tabPurchase Invoice`
where
posting_date <= %s
and company = %s
and docstatus = 1
""",
(self.filters.report_date, self.filters.company),
as_dict=1,
):
invoices = frappe.get_list(
"Purchase Invoice",
filters={
"posting_date": ("<=", self.filters.report_date),
"company": self.filters.company,
"docstatus": 1,
},
fields=["name", "due_date", "bill_no", "bill_date"],
)
for pi in invoices:
self.invoice_details.setdefault(pi.name, pi)
# Invoices booked via Journal Entries
# nosemgrep
journal_entries = frappe.db.sql(
"""
select name, due_date, bill_no, bill_date
from `tabJournal Entry`
where
posting_date <= %s
and company = %s
and docstatus = 1
""",
(self.filters.report_date, self.filters.company),
as_dict=1,
journal_entries = frappe.get_list(
"Journal Entry",
filters={
"posting_date": ("<=", self.filters.report_date),
"company": self.filters.company,
"docstatus": 1,
},
fields=["name", "due_date", "bill_no", "bill_date"],
)
for je in journal_entries:
@@ -784,7 +868,7 @@ class ReceivablePayableReport:
self.get_ageing_data(entry_date, row)
# ageing buckets should not have amounts if due date is not reached
if getdate(entry_date) > getdate(self.filters.report_date):
if getdate(entry_date) > getdate(self.age_as_on):
[setattr(row, f"range{i}", 0.0) for i in self.range_numbers]
row.total_due = sum(row[f"range{i}"] for i in self.range_numbers)
@@ -851,6 +935,9 @@ class ReceivablePayableReport:
else:
query = query.select(ple.remarks)
if match_conditions := build_qb_match_conditions("Payment Ledger Entry"):
query = query.where(Criterion.all(match_conditions))
if self.filters.get("group_by_party"):
query = query.orderby(self.ple.party, self.ple.posting_date)
else:
@@ -1237,3 +1324,134 @@ def get_customer_group_with_children(customer_groups):
frappe.throw(_("Customer Group: {0} does not exist").format(d))
return list(set(all_customer_groups))
class InitSQLProceduresForAR:
"""
Initialize SQL Procedures, Functions and Temporary tables to build Receivable / Payable report
"""
_varchar_type = get_definition("Data")
_currency_type = get_definition("Currency")
# Temporary Tables
_voucher_balance_name = "_ar_voucher_balance"
_voucher_balance_definition = f"""
create temporary table `{_voucher_balance_name}`(
name {_varchar_type},
voucher_type {_varchar_type},
voucher_no {_varchar_type},
party {_varchar_type},
party_account {_varchar_type},
posting_date date,
account_currency {_varchar_type},
cost_center {_varchar_type},
invoiced {_currency_type},
paid {_currency_type},
credit_note {_currency_type},
invoiced_in_account_currency {_currency_type},
paid_in_account_currency {_currency_type},
credit_note_in_account_currency {_currency_type}) engine=memory;
"""
_row_def_table_name = "_ar_ple_row"
_row_def_table_definition = f"""
create temporary table `{_row_def_table_name}`(
name {_varchar_type},
account {_varchar_type},
voucher_type {_varchar_type},
voucher_no {_varchar_type},
against_voucher_type {_varchar_type},
against_voucher_no {_varchar_type},
party_type {_varchar_type},
cost_center {_varchar_type},
party {_varchar_type},
posting_date date,
due_date date,
account_currency {_varchar_type},
amount {_currency_type},
amount_in_account_currency {_currency_type}) engine=memory;
"""
# Function
genkey_function_name = "ar_genkey"
genkey_function_sql = f"""
create function `{genkey_function_name}`(rec row type of `{_row_def_table_name}`, allocate bool) returns char(40)
begin
if allocate then
return sha1(concat_ws(',', rec.account, rec.against_voucher_type, rec.against_voucher_no, rec.party));
else
return sha1(concat_ws(',', rec.account, rec.voucher_type, rec.voucher_no, rec.party));
end if;
end
"""
# Procedures
init_procedure_name = "ar_init_tmp_table"
init_procedure_sql = f"""
create procedure ar_init_tmp_table(in ple row type of `{_row_def_table_name}`)
begin
if not exists (select name from `{_voucher_balance_name}` where name = `{genkey_function_name}`(ple, false))
then
insert into `{_voucher_balance_name}` values (`{genkey_function_name}`(ple, false), ple.voucher_type, ple.voucher_no, ple.party, ple.account, ple.posting_date, ple.account_currency, ple.cost_center, 0, 0, 0, 0, 0, 0);
end if;
end;
"""
allocate_procedure_name = "ar_allocate_to_tmp_table"
allocate_procedure_sql = f"""
create procedure ar_allocate_to_tmp_table(in ple row type of `{_row_def_table_name}`)
begin
declare invoiced {_currency_type} default 0;
declare invoiced_in_account_currency {_currency_type} default 0;
declare paid {_currency_type} default 0;
declare paid_in_account_currency {_currency_type} default 0;
declare credit_note {_currency_type} default 0;
declare credit_note_in_account_currency {_currency_type} default 0;
if ple.amount > 0 then
if (ple.voucher_type in ("Journal Entry", "Payment Entry") and (ple.voucher_no != ple.against_voucher_no)) then
set paid = -1 * ple.amount;
set paid_in_account_currency = -1 * ple.amount_in_account_currency;
else
set invoiced = ple.amount;
set invoiced_in_account_currency = ple.amount_in_account_currency;
end if;
else
if ple.voucher_type in ("Sales Invoice", "Purchase Invoice") then
if (ple.voucher_no = ple.against_voucher_no) then
set paid = -1 * ple.amount;
set paid_in_account_currency = -1 * ple.amount_in_account_currency;
else
set credit_note = -1 * ple.amount;
set credit_note_in_account_currency = -1 * ple.amount_in_account_currency;
end if;
else
set paid = -1 * ple.amount;
set paid_in_account_currency = -1 * ple.amount_in_account_currency;
end if;
end if;
insert into `{_voucher_balance_name}` values (`{genkey_function_name}`(ple, true), ple.against_voucher_type, ple.against_voucher_no, ple.party, ple.account, ple.posting_date, ple.account_currency,'', invoiced, paid, 0, invoiced_in_account_currency, paid_in_account_currency, 0);
end;
"""
def __init__(self):
existing_procedures = frappe.db.get_routines()
if self.genkey_function_name not in existing_procedures:
frappe.db.sql(self.genkey_function_sql)
if self.init_procedure_name not in existing_procedures:
frappe.db.sql(self.init_procedure_sql)
if self.allocate_procedure_name not in existing_procedures:
frappe.db.sql(self.allocate_procedure_sql)
frappe.db.sql(f"drop table if exists `{self._voucher_balance_name}`")
frappe.db.sql(self._voucher_balance_definition)
frappe.db.sql(f"drop table if exists `{self._row_def_table_name}`")
frappe.db.sql(self._row_def_table_definition)

View File

@@ -23,6 +23,13 @@ frappe.query_reports["Accounts Receivable Summary"] = {
options: "Posting Date\nDue 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"),

View File

@@ -0,0 +1,13 @@
// Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
// frappe.query_reports["Calculated Discount Mismatch"] = {
// filters: [
// {
// "fieldname": "my_filter",
// "label": __("My Filter"),
// "fieldtype": "Data",
// "reqd": 1,
// },
// ],
// };

View File

@@ -0,0 +1,38 @@
{
"add_total_row": 0,
"add_translate_data": 0,
"columns": [],
"creation": "2025-06-06 17:09:50.681090",
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 0,
"is_standard": "Yes",
"letter_head": "",
"letterhead": null,
"modified": "2025-06-06 18:09:18.221911",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Calculated Discount Mismatch",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "Version",
"report_name": "Calculated Discount Mismatch",
"report_type": "Script Report",
"roles": [
{
"role": "System Manager"
},
{
"role": "Administrator"
},
{
"role": "Accounts Manager"
},
{
"role": "Accounts User"
}
],
"timeout": 0
}

View File

@@ -0,0 +1,173 @@
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import json
import frappe
from frappe import _
from frappe.query_builder import Order, Tuple
from frappe.utils.formatters import format_value
AFFECTED_DOCTYPES = frozenset(
(
"POS Invoice",
"Purchase Invoice",
"Sales Invoice",
"Purchase Order",
"Supplier Quotation",
"Quotation",
"Sales Order",
"Delivery Note",
"Purchase Receipt",
)
)
LAST_MODIFIED_DATE_THRESHOLD = "2025-05-30"
def execute(filters=None):
columns = get_columns()
data = get_data()
return columns, data
def get_columns():
return [
{
"fieldname": "doctype",
"label": _("Transaction Type"),
"fieldtype": "Link",
"options": "DocType",
"width": 120,
},
{
"fieldname": "docname",
"label": _("Transaction Name"),
"fieldtype": "Dynamic Link",
"options": "doctype",
"width": 150,
},
{
"fieldname": "actual_discount_percentage",
"label": _("Discount Percentage in Transaction"),
"fieldtype": "Percent",
"width": 180,
},
{
"fieldname": "actual_discount_amount",
"label": _("Discount Amount in Transaction"),
"fieldtype": "Currency",
"width": 180,
},
{
"fieldname": "suspected_discount_amount",
"label": _("Suspected Discount Amount"),
"fieldtype": "Currency",
"width": 180,
},
]
def get_data():
transactions_with_discount_percentage = {}
for doctype in AFFECTED_DOCTYPES:
transactions = get_transactions_with_discount_percentage(doctype)
for transaction in transactions:
transactions_with_discount_percentage[(doctype, transaction.name)] = transaction
if not transactions_with_discount_percentage:
return []
VERSION = frappe.qb.DocType("Version")
versions = (
frappe.qb.from_(VERSION)
.select(VERSION.ref_doctype, VERSION.docname, VERSION.data)
.where(VERSION.creation > LAST_MODIFIED_DATE_THRESHOLD)
.where(Tuple(VERSION.ref_doctype, VERSION.docname).isin(list(transactions_with_discount_percentage)))
.where(
VERSION.data.like('%"discount\\_amount"%')
| VERSION.data.like('%"additional\\_discount\\_percentage"%')
)
.orderby(VERSION.creation, order=Order.desc)
.run(as_dict=True)
)
if not versions:
return []
version_map = {}
for version in versions:
key = (version.ref_doctype, version.docname)
if key not in version_map:
version_map[key] = []
version_map[key].append(version.data)
data = []
discount_amount_field_map = {
doctype: frappe.get_meta(doctype).get_field("discount_amount") for doctype in AFFECTED_DOCTYPES
}
for doc, versions in version_map.items():
for version_data in versions:
if '"additional_discount_percentage"' in version_data:
# don't consider doc if additional_discount_percentage is changed in newest version
break
version_data = json.loads(version_data)
changed_values = version_data.get("changed")
if not changed_values:
continue
discount_values = next((row for row in changed_values if row[0] == "discount_amount"), None)
if not discount_values:
continue
old = discount_values[1]
new = discount_values[2]
doctype = doc[0]
doc_values = transactions_with_discount_percentage.get(doc)
formatted_discount_amount = format_value(
doc_values.discount_amount,
df=discount_amount_field_map[doctype],
currency=doc_values.currency,
)
if new != formatted_discount_amount:
# if the discount amount in the version is not equal to the current value, skip
break
data.append(
{
"doctype": doctype,
"docname": doc_values.name,
"actual_discount_percentage": doc_values.additional_discount_percentage,
"actual_discount_amount": new,
"suspected_discount_amount": old,
}
)
break
return data
def get_transactions_with_discount_percentage(doctype):
transactions = frappe.get_all(
doctype,
fields=[
"name",
"currency",
"additional_discount_percentage",
"discount_amount",
],
filters={
"docstatus": ["<", 2],
"additional_discount_percentage": [">", 0],
"discount_amount": ["!=", 0],
"modified": [">", LAST_MODIFIED_DATE_THRESHOLD],
},
)
return transactions

View File

@@ -14,9 +14,16 @@ erpnext.utils.add_dimensions("Cash Flow", 10);
frappe.query_reports["Cash Flow"]["filters"].splice(8, 1);
frappe.query_reports["Cash Flow"]["filters"].push({
fieldname: "include_default_book_entries",
label: __("Include Default FB Entries"),
fieldtype: "Check",
default: 1,
});
frappe.query_reports["Cash Flow"]["filters"].push(
{
fieldname: "include_default_book_entries",
label: __("Include Default FB Entries"),
fieldtype: "Check",
default: 1,
},
{
fieldname: "show_opening_and_closing_balance",
label: __("Show Opening and Closing Balance"),
fieldtype: "Check",
}
);

View File

@@ -2,9 +2,13 @@
# For license information, please see license.txt
from datetime import timedelta
import frappe
from frappe import _
from frappe.utils import cstr
from frappe.query_builder import DocType
from frappe.utils import cstr, flt
from pypika import Order
from erpnext.accounts.report.financial_statements import (
get_columns,
@@ -12,6 +16,7 @@ from erpnext.accounts.report.financial_statements import (
get_data,
get_filtered_list_for_consolidated_report,
get_period_list,
set_gl_entries_by_account,
)
from erpnext.accounts.report.profit_and_loss_statement.profit_and_loss_statement import (
get_net_profit_loss,
@@ -75,7 +80,11 @@ def execute(filters=None):
# add first net income in operations section
if net_profit_loss:
net_profit_loss.update(
{"indent": 1, "parent_section": cash_flow_sections[0]["section_header"]}
{
"indent": 1,
"parent_section": cash_flow_sections[0]["section_header"],
"section": net_profit_loss["account"],
}
)
data.append(net_profit_loss)
section_data.append(net_profit_loss)
@@ -115,10 +124,20 @@ def execute(filters=None):
filters,
)
add_total_row_account(
net_change_in_cash = add_total_row_account(
data, data, _("Net Change in Cash"), period_list, company_currency, summary_data, filters
)
columns = get_columns(filters.periodicity, period_list, filters.accumulated_values, filters.company, True)
if filters.show_opening_and_closing_balance:
show_opening_and_closing_balance(data, period_list, company_currency, net_change_in_cash, filters)
columns = get_columns(
filters.periodicity,
period_list,
filters.accumulated_values,
filters.company,
True,
)
chart = get_chart_data(columns, data, company_currency)
@@ -251,6 +270,137 @@ def add_total_row_account(out, data, label, period_list, currency, summary_data,
out.append(total_row)
out.append({})
return total_row
def show_opening_and_closing_balance(out, period_list, currency, net_change_in_cash, filters):
opening_balance = {
"section_name": "Opening",
"section": "Opening",
"currency": currency,
}
closing_balance = {
"section_name": "Closing (Opening + Total)",
"section": "Closing (Opening + Total)",
"currency": currency,
}
opening_amount = get_opening_balance(filters.company, period_list, filters) or 0.0
running_total = opening_amount
for i, period in enumerate(period_list):
key = period["key"]
change = net_change_in_cash.get(key, 0.0)
opening_balance[key] = opening_amount if i == 0 else running_total
running_total += change
closing_balance[key] = running_total
opening_balance["total"] = opening_balance[period_list[0]["key"]]
closing_balance["total"] = closing_balance[period_list[-1]["key"]]
out.extend([opening_balance, net_change_in_cash, closing_balance, {}])
def get_opening_balance(company, period_list, filters):
from copy import deepcopy
cash_value = {}
account_types = get_cash_flow_accounts()
net_profit_loss = 0.0
local_filters = deepcopy(filters)
local_filters.start_date, local_filters.end_date = get_opening_range_using_fiscal_year(
company, period_list
)
for section in account_types:
section_name = section.get("section_name")
cash_value.setdefault(section_name, 0.0)
if section_name == "Operations":
net_profit_loss += get_net_income(company, period_list, local_filters)
for account in section.get("account_types", []):
account_type = account.get("account_type")
local_filters.account_type = account_type
amount = get_account_type_based_gl_data(company, local_filters) or 0.0
if account_type == "Depreciation":
cash_value[section_name] += amount * -1
else:
cash_value[section_name] += amount
return sum(cash_value.values()) + net_profit_loss
def get_net_income(company, period_list, filters):
gl_entries_by_account_for_income, gl_entries_by_account_for_expense = {}, {}
income, expense = 0.0, 0.0
from_date, to_date = get_opening_range_using_fiscal_year(company, period_list)
for root_type in ["Income", "Expense"]:
for root in frappe.db.sql(
"""select lft, rgt from tabAccount
where root_type=%s and ifnull(parent_account, '') = ''""",
root_type,
as_dict=1,
):
set_gl_entries_by_account(
company,
from_date,
to_date,
filters,
gl_entries_by_account_for_income
if root_type == "Income"
else gl_entries_by_account_for_expense,
root.lft,
root.rgt,
root_type=root_type,
ignore_closing_entries=True,
)
for entries in gl_entries_by_account_for_income.values():
for entry in entries:
if entry.posting_date <= to_date:
amount = (entry.debit - entry.credit) * -1
income = flt((income + amount), 2)
for entries in gl_entries_by_account_for_expense.values():
for entry in entries:
if entry.posting_date <= to_date:
amount = entry.debit - entry.credit
expense = flt((expense + amount), 2)
return income - expense
def get_opening_range_using_fiscal_year(company, period_list):
first_from_date = period_list[0]["from_date"]
previous_day = first_from_date - timedelta(days=1)
# Get the earliest fiscal year for the company
FiscalYear = DocType("Fiscal Year")
FiscalYearCompany = DocType("Fiscal Year Company")
earliest_fy = (
frappe.qb.from_(FiscalYear)
.join(FiscalYearCompany)
.on(FiscalYearCompany.parent == FiscalYear.name)
.select(FiscalYear.year_start_date)
.where(FiscalYearCompany.company == company)
.orderby(FiscalYear.year_start_date, order=Order.asc)
.limit(1)
).run(as_dict=True)
if not earliest_fy:
frappe.throw(_("Not able to find the earliest Fiscal Year for the given company."))
company_start_date = earliest_fy[0]["year_start_date"]
return company_start_date, previous_day
def get_report_summary(summary_data, currency):
report_summary = []
@@ -272,7 +422,7 @@ def get_chart_data(columns, data, currency):
for section in data
if section.get("parent_section") is None and section.get("currency")
]
datasets = datasets[:-1]
datasets = datasets[:-2]
chart = {"data": {"labels": labels, "datasets": datasets}, "type": "bar"}

View File

@@ -8,6 +8,7 @@ from frappe.query_builder import Criterion, Tuple
from frappe.query_builder.functions import IfNull
from frappe.utils import getdate, nowdate
from frappe.utils.nestedset import get_descendants_of
from pypika.terms import LiteralValue
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
get_accounting_dimensions,
@@ -15,7 +16,7 @@ from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
)
TREE_DOCTYPES = frozenset(
["Customer Group", "Terrirtory", "Supplier Group", "Sales Partner", "Sales Person", "Cost Center"]
["Customer Group", "Territory", "Supplier Group", "Sales Partner", "Sales Person", "Cost Center"]
)
@@ -77,13 +78,12 @@ class PartyLedgerSummaryReport:
from frappe.desk.reportview import build_match_conditions
query, params = query.walk()
match_conditions = build_match_conditions(party_type)
if match_conditions:
query += "and" + match_conditions
query = query.where(LiteralValue(match_conditions))
party_details = frappe.db.sql(query, params, as_dict=True)
party_details = query.run(as_dict=True)
for row in party_details:
self.parties.append(row.party)
@@ -275,12 +275,25 @@ class PartyLedgerSummaryReport:
if gle.posting_date < self.filters.from_date or gle.is_opening == "Yes":
self.party_data[gle.party].opening_balance += amount
else:
if amount > 0:
self.party_data[gle.party].invoiced_amount += amount
elif gle.voucher_no in self.return_invoices:
self.party_data[gle.party].return_amount -= amount
# Cache the party data reference to avoid repeated dictionary lookups
party_data = self.party_data[gle.party]
# Check if this is a direct return invoice (most specific condition first)
if gle.voucher_no in self.return_invoices:
party_data.return_amount -= amount
# Check if this entry is against a return invoice
elif gle.against_voucher in self.return_invoices:
# For entries against return invoices, positive amounts are payments
if amount > 0:
party_data.paid_amount -= amount
else:
party_data.invoiced_amount += amount
# Normal transaction logic
else:
self.party_data[gle.party].paid_amount -= amount
if amount > 0:
party_data.invoiced_amount += amount
else:
party_data.paid_amount -= amount
out = []
for party, row in self.party_data.items():
@@ -289,7 +302,7 @@ class PartyLedgerSummaryReport:
or row.invoiced_amount
or row.paid_amount
or row.return_amount
or row.closing_amount
or row.closing_balance # Fixed typo from closing_amount to closing_balance
):
total_party_adjustment = sum(
amount for amount in self.party_adjustment_details.get(party, {}).values()
@@ -313,6 +326,7 @@ class PartyLedgerSummaryReport:
gle.party,
gle.voucher_type,
gle.voucher_no,
gle.against_voucher, # For handling returned invoices (Credit/Debit Notes)
gle.debit,
gle.credit,
gle.is_opening,
@@ -458,9 +472,16 @@ class PartyLedgerSummaryReport:
def get_children(doctype, value):
children = get_descendants_of(doctype, value)
if not isinstance(value, list):
value = [d.strip() for d in value.strip().split(",") if d]
return [value, *children]
all_children = []
for d in value:
all_children += get_descendants_of(doctype, value)
all_children.append(d)
return list(set(all_children))
def execute(filters=None):

View File

@@ -150,3 +150,157 @@ class TestCustomerLedgerSummary(FrappeTestCase, AccountsTestMixin):
for field in expected_after_cr_and_payment:
with self.subTest(field=field):
self.assertEqual(report[0].get(field), expected_after_cr_and_payment.get(field))
def test_journal_voucher_against_return_invoice(self):
filters = {"company": self.company, "from_date": today(), "to_date": today()}
# Create Sales Invoice of 10 qty at rate 100 (Amount: 1000.0)
si1 = self.create_sales_invoice(do_not_submit=True)
si1.save().submit()
expected = {
"party": "_Test Customer",
"party_name": "_Test Customer",
"opening_balance": 0,
"invoiced_amount": 1000.0,
"paid_amount": 0,
"return_amount": 0,
"closing_balance": 1000.0,
"currency": "INR",
"customer_name": "_Test Customer",
}
report = execute(filters)[1]
self.assertEqual(len(report), 1)
for field in expected:
with self.subTest(field=field):
actual_value = report[0].get(field)
expected_value = expected.get(field)
self.assertEqual(
actual_value,
expected_value,
f"Field {field} does not match expected value. "
f"Expected: {expected_value}, Got: {actual_value}",
)
# Create Payment Entry (Receive) for the first invoice
pe1 = self.create_payment_entry(si1.name, True)
pe1.paid_amount = 1000 # Full payment 1000.0
pe1.save().submit()
expected_after_payment = {
"party": "_Test Customer",
"party_name": "_Test Customer",
"opening_balance": 0,
"invoiced_amount": 1000.0,
"paid_amount": 1000.0,
"return_amount": 0,
"closing_balance": 0.0,
"currency": "INR",
"customer_name": "_Test Customer",
}
report = execute(filters)[1]
self.assertEqual(len(report), 1)
for field in expected_after_payment:
with self.subTest(field=field):
actual_value = report[0].get(field)
expected_value = expected_after_payment.get(field)
self.assertEqual(
actual_value,
expected_value,
f"Field {field} does not match expected value. "
f"Expected: {expected_value}, Got: {actual_value}",
)
# Create Credit Note (return invoice) for first invoice (1000.0)
cr_note = self.create_credit_note(si1.name, do_not_submit=True)
cr_note.items[0].qty = -10 # 1 item of qty 10 at rate 100 (Amount: 1000.0)
cr_note.save().submit()
expected_after_cr_note = {
"party": "_Test Customer",
"party_name": "_Test Customer",
"opening_balance": 0,
"invoiced_amount": 1000.0,
"paid_amount": 1000.0,
"return_amount": 1000.0,
"closing_balance": -1000.0,
"currency": "INR",
"customer_name": "_Test Customer",
}
report = execute(filters)[1]
self.assertEqual(len(report), 1)
for field in expected_after_cr_note:
with self.subTest(field=field):
actual_value = report[0].get(field)
expected_value = expected_after_cr_note.get(field)
self.assertEqual(
actual_value,
expected_value,
f"Field {field} does not match expected value. "
f"Expected: {expected_value}, Got: {actual_value}",
)
# Create Payment Entry for the returned amount (1000.0) - Pay the customer back
pe2 = get_payment_entry("Sales Invoice", cr_note.name, bank_account=self.cash)
pe2.insert().submit()
expected_after_cr_and_return_payment = {
"party": "_Test Customer",
"party_name": "_Test Customer",
"opening_balance": 0,
"invoiced_amount": 1000.0,
"paid_amount": 0,
"return_amount": 1000.0,
"closing_balance": 0,
"currency": "INR",
}
report = execute(filters)[1]
self.assertEqual(len(report), 1)
for field in expected_after_cr_and_return_payment:
with self.subTest(field=field):
actual_value = report[0].get(field)
expected_value = expected_after_cr_and_return_payment.get(field)
self.assertEqual(
actual_value,
expected_value,
f"Field {field} does not match expected value. "
f"Expected: {expected_value}, Got: {actual_value}",
)
# Create second Sales Invoice of 10 qty at rate 100 (Amount: 1000.0)
si2 = self.create_sales_invoice(do_not_submit=True)
si2.save().submit()
# Create Payment Entry (Receive) for the second invoice - payment (500.0)
pe3 = self.create_payment_entry(si2.name, True)
pe3.paid_amount = 500 # Partial payment 500.0
pe3.save().submit()
expected_after_cr_and_payment = {
"party": "_Test Customer",
"party_name": "_Test Customer",
"opening_balance": 0.0,
"invoiced_amount": 2000.0,
"paid_amount": 500.0,
"return_amount": 1000.0,
"closing_balance": 500.0,
"currency": "INR",
"customer_name": "_Test Customer",
}
report = execute(filters)[1]
self.assertEqual(len(report), 1)
for field in expected_after_cr_and_payment:
with self.subTest(field=field):
actual_value = report[0].get(field)
expected_value = expected_after_cr_and_payment.get(field)
self.assertEqual(
actual_value,
expected_value,
f"Field {field} does not match expected value. "
f"Expected: {expected_value}, Got: {actual_value}",
)

View File

@@ -79,6 +79,14 @@ class Deferred_Item:
return - estimated amount to post for given period
Calculated based on already booked amount and item service period
"""
if self.filters.book_deferred_entries_based_on == "Months":
# if the deferred entries are based on service period, use service start and end date
return self.calculate_monthly_amount(start_date, end_date)
else:
return self.calculate_days_amount(start_date, end_date)
def calculate_monthly_amount(self, start_date, end_date):
total_months = (
(self.service_end_date.year - self.service_start_date.year) * 12
+ (self.service_end_date.month - self.service_start_date.month)
@@ -105,6 +113,19 @@ class Deferred_Item:
return base_amount
def calculate_days_amount(self, start_date, end_date):
base_amount = 0
total_days = date_diff(self.service_end_date, self.service_start_date) + 1
total_booking_days = date_diff(end_date, start_date) + 1
already_booked_amount = self.get_item_total()
base_amount = flt(self.base_net_amount * total_booking_days / flt(total_days))
if base_amount + already_booked_amount > self.base_net_amount:
base_amount = self.base_net_amount - already_booked_amount
return base_amount
def make_dummy_gle(self, name, date, amount):
"""
return - frappe._dict() of a dummy gle entry
@@ -245,6 +266,10 @@ class Deferred_Revenue_and_Expense_Report:
else:
self.filters = frappe._dict(filters)
self.filters.book_deferred_entries_based_on = frappe.db.get_singles_value(
"Accounts Settings", "book_deferred_entries_based_on"
)
self.period_list = None
self.deferred_invoices = []
# holds period wise total for report
@@ -289,7 +314,11 @@ class Deferred_Revenue_and_Expense_Report:
.join(inv)
.on(inv.name == inv_item.parent)
.left_join(gle)
.on((inv_item.name == gle.voucher_detail_no) & (deferred_account_field == gle.account))
.on(
(inv_item.name == gle.voucher_detail_no)
& (deferred_account_field == gle.account)
& (gle.is_cancelled == 0)
)
.select(
inv.name.as_("doc"),
inv.posting_date,

View File

@@ -86,7 +86,7 @@ def set_gl_entries_by_account(dimension_list, filters, account, gl_entries_by_ac
"finance_book": cstr(filters.get("finance_book")),
}
gl_filters["dimensions"] = set(dimension_list)
gl_filters["dimensions"] = tuple(set(dimension_list))
if filters.get("include_default_book_entries"):
gl_filters["company_fb"] = frappe.get_cached_value("Company", filters.company, "default_finance_book")

View File

@@ -47,12 +47,12 @@
{% for(let j=0, k=data.length; j<k; j++) { %}
{%
var row = data[j];
var row_class = data[j].parent_account ? "" : "financial-statements-important";
row_class += data[j].account_name ? "" : " financial-statements-blank-row";
var row_class = data[j].parent_account || data[j].parent_section ? "" : "financial-statements-important";
row_class += data[j].account_name || data[j].section ? "" : " financial-statements-blank-row";
%}
<tr class="{%= row_class %}">
<td>
<span style="padding-left: {%= cint(data[j].indent) * 2 %}em">{%= row.account_name %}</span>
<span style="padding-left: {%= cint(data[j].indent) * 2 %}em">{%= row.account_name || row.section %}</span>
</td>
{% for(let i=1, l=report_columns.length; i<l; i++) { %}
<td class="text-right">

View File

@@ -9,7 +9,7 @@ import re
import frappe
from frappe import _
from frappe.query_builder.functions import Sum
from frappe.query_builder.functions import Max, Min, Sum
from frappe.utils import add_days, add_months, cint, cstr, flt, formatdate, get_first_day, getdate
from pypika.terms import ExistsCriterion
@@ -109,14 +109,19 @@ def get_period_list(
def get_fiscal_year_data(from_fiscal_year, to_fiscal_year):
fiscal_year = frappe.db.sql(
"""select min(year_start_date) as year_start_date,
max(year_end_date) as year_end_date from `tabFiscal Year` where
name between %(from_fiscal_year)s and %(to_fiscal_year)s""",
{"from_fiscal_year": from_fiscal_year, "to_fiscal_year": to_fiscal_year},
as_dict=1,
from_year_start_date = frappe.get_cached_value("Fiscal Year", from_fiscal_year, "year_start_date")
to_year_end_date = frappe.get_cached_value("Fiscal Year", to_fiscal_year, "year_end_date")
fy = frappe.qb.DocType("Fiscal Year")
query = (
frappe.qb.from_(fy)
.select(Min(fy.year_start_date).as_("year_start_date"), Max(fy.year_end_date).as_("year_end_date"))
.where(fy.year_start_date >= from_year_start_date)
.where(fy.year_end_date <= to_year_end_date)
)
fiscal_year = query.run(as_dict=True)
return fiscal_year[0] if fiscal_year else {}

View File

@@ -209,7 +209,7 @@ frappe.query_reports["General Ledger"] = {
},
{
fieldname: "ignore_err",
label: __("Ignore Exchange Rate Revaluation Journals"),
label: __("Ignore Exchange Rate Revaluation and Gain / Loss Journals"),
fieldtype: "Check",
},
{

View File

@@ -204,7 +204,7 @@ def get_gl_entries(filters, accounting_dimensions):
)
if filters.get("presentation_currency"):
return convert_to_presentation_currency(gl_entries, currency_map)
return convert_to_presentation_currency(gl_entries, currency_map, filters)
else:
return gl_entries

View File

@@ -3,7 +3,7 @@
import frappe
from frappe import qb
from frappe.tests.utils import FrappeTestCase
from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import flt, today
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice

View File

@@ -178,7 +178,7 @@ def get_columns(additional_table_columns, filters):
"fieldname": "invoice",
"fieldtype": "Link",
"options": "Purchase Invoice",
"width": 120,
"width": 150,
},
{"label": _("Posting Date"), "fieldname": "posting_date", "fieldtype": "Date", "width": 120},
]
@@ -310,8 +310,8 @@ def apply_conditions(query, pi, pii, filters):
def get_items(filters, additional_table_columns):
doctype = "Purchase Invoice"
pi = frappe.qb.DocType(doctype)
pii = frappe.qb.DocType(f"{doctype} Item")
pi = frappe.qb.DocType("Purchase Invoice")
pii = frappe.qb.DocType("Purchase Invoice Item")
Item = frappe.qb.DocType("Item")
query = (
frappe.qb.from_(pi)
@@ -331,6 +331,7 @@ def get_items(filters, additional_table_columns):
pi.unrealized_profit_loss_account,
pii.item_code,
pii.description,
pii.item_name,
pii.item_group,
pii.item_name.as_("pi_item_name"),
pii.item_group.as_("pi_item_group"),
@@ -374,7 +375,7 @@ def get_items(filters, additional_table_columns):
if match_conditions:
query += " and " + match_conditions
query = apply_order_by_conditions(query, pi, pii, filters)
query = apply_order_by_conditions(doctype, query, filters)
return frappe.db.sql(query, params, as_dict=True)

View File

@@ -5,12 +5,14 @@
import frappe
from frappe import _
from frappe.model.meta import get_field_precision
from frappe.query_builder import functions as fn
from frappe.utils import cstr, flt
from frappe.utils.nestedset import get_descendants_of
from frappe.utils.xlsxutils import handle_html
from pypika import Order
from erpnext.accounts.report.sales_register.sales_register import get_mode_of_payments
from erpnext.accounts.report.utils import get_query_columns, get_values_for_columns
from erpnext.accounts.report.utils import get_values_for_columns
from erpnext.selling.report.item_wise_sales_history.item_wise_sales_history import (
get_customer_details,
)
@@ -196,7 +198,7 @@ def get_columns(additional_table_columns, filters):
"fieldname": "invoice",
"fieldtype": "Link",
"options": "Sales Invoice",
"width": 120,
"width": 150,
},
{"label": _("Posting Date"), "fieldname": "posting_date", "fieldtype": "Date", "width": 120},
]
@@ -341,7 +343,7 @@ def get_columns(additional_table_columns, filters):
return columns
def apply_conditions(query, si, sii, filters, additional_conditions=None):
def apply_conditions(query, si, sii, sip, filters, additional_conditions=None):
for opts in ("company", "customer"):
if filters.get(opts):
query = query.where(si[opts] == filters[opts])
@@ -353,10 +355,7 @@ def apply_conditions(query, si, sii, filters, additional_conditions=None):
query = query.where(si.posting_date <= filters.get("to_date"))
if filters.get("mode_of_payment"):
sales_invoice = frappe.db.get_all(
"Sales Invoice Payment", {"mode_of_payment": filters.get("mode_of_payment")}, pluck="parent"
)
query = query.where(si.name.isin(sales_invoice))
query = query.where(sip.mode_of_payment == filters.get("mode_of_payment"))
if filters.get("warehouse"):
if frappe.db.get_value("Warehouse", filters.get("warehouse"), "is_group"):
@@ -375,7 +374,12 @@ def apply_conditions(query, si, sii, filters, additional_conditions=None):
query = query.where(sii.item_code == filters.get("item_code"))
if filters.get("item_group"):
query = query.where(sii.item_group == filters.get("item_group"))
if frappe.db.get_value("Item Group", filters.get("item_group"), "is_group"):
item_groups = get_descendants_of("Item Group", filters.get("item_group"))
item_groups.append(filters.get("item_group"))
query = query.where(sii.item_group.isin(item_groups))
else:
query = query.where(sii.item_group == filters.get("item_group"))
if filters.get("income_account"):
query = query.where(
@@ -390,15 +394,18 @@ def apply_conditions(query, si, sii, filters, additional_conditions=None):
return query
def apply_order_by_conditions(query, si, ii, filters):
def apply_order_by_conditions(doctype, query, filters):
invoice = f"`tab{doctype}`"
invoice_item = f"`tab{doctype} Item`"
if not filters.get("group_by"):
query += f" order by {si.posting_date} desc, {ii.item_group} desc"
query += f" order by {invoice}.posting_date desc, {invoice_item}.item_group desc"
elif filters.get("group_by") == "Invoice":
query += f" order by {ii.parent} desc"
query += f" order by {invoice_item}.parent desc"
elif filters.get("group_by") == "Item":
query += f" order by {ii.item_code}"
query += f" order by {invoice_item}.item_code"
elif filters.get("group_by") == "Item Group":
query += f" order by {ii.item_group}"
query += f" order by {invoice_item}.item_group"
elif filters.get("group_by") in ("Customer", "Customer Group", "Territory", "Supplier"):
filter_field = frappe.scrub(filters.get("group_by"))
query += f" order by {filter_field} desc"
@@ -408,14 +415,17 @@ def apply_order_by_conditions(query, si, ii, filters):
def get_items(filters, additional_query_columns, additional_conditions=None):
doctype = "Sales Invoice"
si = frappe.qb.DocType(doctype)
sii = frappe.qb.DocType(f"{doctype} Item")
si = frappe.qb.DocType("Sales Invoice")
sii = frappe.qb.DocType("Sales Invoice Item")
sip = frappe.qb.DocType("Sales Invoice Payment")
item = frappe.qb.DocType("Item")
query = (
frappe.qb.from_(si)
.join(sii)
.on(si.name == sii.parent)
.left_join(sip)
.on(sip.parent == si.name)
.left_join(item)
.on(sii.item_code == item.name)
.select(
@@ -427,7 +437,7 @@ def get_items(filters, additional_query_columns, additional_conditions=None):
si.is_internal_customer,
si.customer,
si.remarks,
si.territory,
fn.IfNull(si.territory, "Not Specified").as_("territory"),
si.company,
si.base_net_total,
sii.project,
@@ -450,11 +460,12 @@ def get_items(filters, additional_query_columns, additional_conditions=None):
sii.base_net_rate,
sii.base_net_amount,
si.customer_name,
si.customer_group,
fn.IfNull(si.customer_group, "Not Specified").as_("customer_group"),
sii.so_detail,
si.update_stock,
sii.uom,
sii.qty,
sip.mode_of_payment,
)
.where(si.docstatus == 1)
.where(sii.parenttype == doctype)
@@ -474,17 +485,17 @@ def get_items(filters, additional_query_columns, additional_conditions=None):
if filters.get("customer_group"):
query = query.where(si.customer_group == filters["customer_group"])
query = apply_conditions(query, si, sii, filters, additional_conditions)
query = apply_conditions(query, si, sii, sip, filters, additional_conditions)
from frappe.desk.reportview import build_match_conditions
query, params = query.walk()
match_conditions = build_match_conditions("Sales Invoice")
match_conditions = build_match_conditions(doctype)
if match_conditions:
query += " and " + match_conditions
query = apply_order_by_conditions(query, si, sii, filters)
query = apply_order_by_conditions(doctype, query, filters)
return frappe.db.sql(query, params, as_dict=True)
@@ -756,25 +767,13 @@ def add_total_row(
def get_display_value(filters, group_by_field, item):
if filters.get("group_by") == "Item":
if item.get("item_code") != item.get("item_name"):
value = (
cstr(item.get("item_code"))
+ "<br><br>"
+ "<span style='font-weight: normal'>"
+ cstr(item.get("item_name"))
+ "</span>"
)
value = f"{item.get('item_code')}: {item.get('item_name')}"
else:
value = item.get("item_code", "")
elif filters.get("group_by") in ("Customer", "Supplier"):
party = frappe.scrub(filters.get("group_by"))
if item.get(party) != item.get(party + "_name"):
value = (
item.get(party)
+ "<br><br>"
+ "<span style='font-weight: normal'>"
+ item.get(party + "_name")
+ "</span>"
)
value = f"{item.get(party)}: {item.get(party + '_name')}"
else:
value = item.get(party)
else:

View File

@@ -1,21 +1,22 @@
{
"add_total_row": 0,
"add_translate_data": 0,
"columns": [],
"creation": "2013-05-06 12:28:23",
"disable_prepared_report": 0,
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 3,
"idx": 6,
"is_standard": "Yes",
"modified": "2021-10-06 06:26:07.881340",
"letterhead": null,
"modified": "2025-07-17 23:16:19.892044",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Partners Commission",
"owner": "Administrator",
"prepared_report": 0,
"query": "SELECT\n sales_partner as \"Sales Partner:Link/Sales Partner:220\",\n\tsum(base_net_total) as \"Invoiced Amount (Excl. Tax):Currency:220\",\n\tsum(amount_eligible_for_commission) as \"Amount Eligible for Commission:Currency:220\",\n\tsum(total_commission) as \"Total Commission:Currency:170\",\n\tsum(total_commission)*100/sum(amount_eligible_for_commission) as \"Average Commission Rate:Percent:220\"\nFROM\n\t`tabSales Invoice`\nWHERE\n\tdocstatus = 1 and ifnull(base_net_total, 0) > 0 and ifnull(total_commission, 0) > 0\nGROUP BY\n\tsales_partner\nORDER BY\n\t\"Total Commission:Currency:120\"",
"query": "SELECT\n sales_partner as \"Sales Partner:Link / Sales Partner:220\",\n sum(base_net_total) as \"Invoiced Amount (Excl. Tax):Currency:220\",\n sum(amount_eligible_for_commission) as \"Amount Eligible for Commission:Currency:220\",\n sum(total_commission) as \"Total Commission:Currency:170\",\n sum(total_commission)*100 / sum(amount_eligible_for_commission) as \"Average Commission Rate:Percent:220\"\nFROM\n (\n SELECT\n sales_partner,\n base_net_total,\n total_commission,\n amount_eligible_for_commission\n FROM\n `tabSales Invoice` \n WHERE\n docstatus = 1\n AND IFNULL(base_net_total, 0) > 0\n AND IFNULL(total_commission, 0) > 0\n\n UNION ALL\n\n SELECT\n sales_partner,\n base_net_total,\n total_commission,\n amount_eligible_for_commission\n FROM\n `tabPOS Invoice`\n WHERE\n docstatus = 1\n AND IFNULL(base_net_total, 0) > 0\n AND IFNULL(total_commission, 0) > 0\n ) AS sub\nGROUP BY\n sales_partner\nORDER BY\n \"Total Commission:Currency:120\"",
"ref_doctype": "Sales Invoice",
"report_name": "Sales Partners Commission",
"report_type": "Query Report",
@@ -26,5 +27,6 @@
{
"role": "Accounts User"
}
]
}
],
"timeout": 0
}

View File

@@ -121,7 +121,7 @@ def get_result(filters, tds_docs, tds_accounts, tax_category_map, journal_entry_
)
out.append(row)
out.sort(key=lambda x: x["section_code"])
out.sort(key=lambda x: (x["section_code"], x["transaction_date"]))
return out

View File

@@ -67,11 +67,12 @@ class TestTaxWithholdingDetails(AccountsTestMixin, FrappeTestCase):
mid_year = add_to_date(fiscal_year[1], months=6)
tds_doc = frappe.get_doc("Tax Withholding Category", "TDS - 3")
tds_doc.rates[0].to_date = mid_year
from_date = add_to_date(mid_year, days=1)
tds_doc.append(
"rates",
{
"tax_withholding_rate": 20,
"from_date": add_to_date(mid_year, days=1),
"from_date": from_date,
"to_date": fiscal_year[2],
"single_threshold": 1,
"cumulative_threshold": 1,
@@ -80,18 +81,19 @@ class TestTaxWithholdingDetails(AccountsTestMixin, FrappeTestCase):
tds_doc.save()
inv_1 = make_purchase_invoice(rate=1000, do_not_submit=True)
inv_1 = make_purchase_invoice(
rate=1000, posting_date=add_to_date(fiscal_year[1], days=1), do_not_save=True, do_not_submit=True
)
inv_1.set_posting_time = 1
inv_1.apply_tds = 1
inv_1.tax_withholding_category = "TDS - 3"
inv_1.tax_withholding_category = tds_doc.name
inv_1.save()
inv_1.submit()
inv_2 = make_purchase_invoice(
rate=1000, do_not_submit=True, posting_date=add_to_date(mid_year, days=1), do_not_save=True
)
inv_2 = make_purchase_invoice(rate=1000, posting_date=from_date, do_not_save=True, do_not_submit=True)
inv_2.set_posting_time = 1
inv_1.apply_tds = 1
inv_2.tax_withholding_category = "TDS - 3"
inv_2.apply_tds = 1
inv_2.tax_withholding_category = tds_doc.name
inv_2.save()
inv_2.submit()

View File

@@ -86,7 +86,7 @@ def get_rate_as_at(date, from_currency, to_currency):
return rate
def convert_to_presentation_currency(gl_entries, currency_info):
def convert_to_presentation_currency(gl_entries, currency_info, filters=None):
"""
Take a list of GL Entries and change the 'debit' and 'credit' values to currencies
in `currency_info`.
@@ -99,6 +99,13 @@ def convert_to_presentation_currency(gl_entries, currency_info):
company_currency = currency_info["company_currency"]
account_currencies = list(set(entry["account_currency"] for entry in gl_entries))
exchange_gain_or_loss = False
if filters and isinstance(filters.get("account"), list):
account_filter = filters.get("account")
gain_loss_account = frappe.db.get_value("Company", filters.company, "exchange_gain_loss_account")
exchange_gain_or_loss = len(account_filter) == 1 and account_filter[0] == gain_loss_account
for entry in gl_entries:
debit = flt(entry["debit"])
@@ -107,7 +114,11 @@ def convert_to_presentation_currency(gl_entries, currency_info):
credit_in_account_currency = flt(entry["credit_in_account_currency"])
account_currency = entry["account_currency"]
if len(account_currencies) == 1 and account_currency == presentation_currency:
if (
len(account_currencies) == 1
and account_currency == presentation_currency
and not exchange_gain_or_loss
):
entry["debit"] = debit_in_account_currency
entry["credit"] = credit_in_account_currency
else:

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