Compare commits

..

496 Commits

Author SHA1 Message Date
Frappe PR Bot
ad4fe2db9e chore(release): Bumped to Version 15.87.0
# [15.87.0](https://github.com/frappe/erpnext/compare/v15.86.0...v15.87.0) (2025-11-05)

### Features

* process period closing voucher ([8cdbaac](8cdbaacfff))
2025-11-05 12:37:51 +00:00
ruthra kumar
13de175b0f Merge pull request #50370 from frappe/mergify/bp/version-15/pr-50144
refactor: period closing voucher to handle large data volumes (backport #50144)
2025-11-05 18:06:29 +05:30
ruthra kumar
a333ec28e9 chore: resolve conflicts 2025-11-05 17:46:59 +05:30
ruthra kumar
e6d38d009f refactor: add paused to select option
(cherry picked from commit fca7abf4d6)
2025-11-05 12:15:04 +00:00
ruthra kumar
178eded259 refactor: minor changes on status
1. set to 'In Progress' on start of both legacy and new controller
2. force delete to avoid permission issues
3. default to 1hr timeout

(cherry picked from commit 9c13edc0b9)
2025-11-05 12:15:04 +00:00
ruthra kumar
5db7888a8d refactor: enable legacy controller by default for pcv
(cherry picked from commit fe39ce03bb)

# Conflicts:
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.json
#	erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py
2025-11-05 12:15:04 +00:00
ruthra kumar
83e0ce4020 chore: progress bar
(cherry picked from commit 0b88f98a86)
2025-11-05 12:15:03 +00:00
ruthra kumar
6f58614ef2 chore: remove scaffolding
(cherry picked from commit 191c0e65a1)
2025-11-05 12:15:03 +00:00
ruthra kumar
a3068c8bf6 refactor: abort processing of all tasks upon cancellation
(cherry picked from commit 090e155fd0)
2025-11-05 12:15:03 +00:00
ruthra kumar
bdeee94c18 refactor: more changes
1. 'Accounts Manager' has access to submit, cancel and delete
2. cancel and delete operation of PCV is linked with Proces PCV

(cherry picked from commit cae1237859)
2025-11-05 12:15:02 +00:00
ruthra kumar
db5013fca1 refactor: smaller methods
(cherry picked from commit fa3bd6f5a7)
2025-11-05 12:15:02 +00:00
ruthra kumar
2712310c0a refactor: utility to consolidate results from all dates
(cherry picked from commit 7406d83260)
2025-11-05 12:15:02 +00:00
ruthra kumar
a624ae07f0 refactor: utility to convert tuple key to str
(cherry picked from commit 5b464ae4c1)
2025-11-05 12:15:02 +00:00
ruthra kumar
347a7e3b1f refactor: cleanup and for better readability
(cherry picked from commit 653ae84b3e)
2025-11-05 12:15:01 +00:00
ruthra kumar
df4347a6cb refactor: make Accounts Closing Balance as well
(cherry picked from commit 6e32769e37)
2025-11-05 12:15:01 +00:00
ruthra kumar
7edbf25e60 refactor: store closing balance for Balnace sheet accounts
(cherry picked from commit 09e37bc98c)
2025-11-05 12:15:01 +00:00
ruthra kumar
7c85d7f163 refactor: calculate both balances from single queue
(cherry picked from commit 643e1fdce8)
2025-11-05 12:15:01 +00:00
ruthra kumar
6216547027 refactor: populate opening balances calculation table
(cherry picked from commit 86edacb781)
2025-11-05 12:15:00 +00:00
ruthra kumar
ac0a837bf3 chore: rename closing balance field
(cherry picked from commit cef879bb3b)
2025-11-05 12:15:00 +00:00
ruthra kumar
8be8a73a36 refactor: balances for both P&L and Balance sheet accounts
(cherry picked from commit 324bebfd44)
2025-11-05 12:15:00 +00:00
ruthra kumar
f49f60b5f4 refactor: maintain report type on each date
(cherry picked from commit 186d540502)
2025-11-05 12:15:00 +00:00
ruthra kumar
3a13c04a71 refactor: more stable pause and resume
(cherry picked from commit 9e93298f12)
2025-11-05 12:14:59 +00:00
ruthra kumar
62e8d4753e refactor: process on submit
(cherry picked from commit c738b6d356)
2025-11-05 12:14:59 +00:00
ruthra kumar
18c7121230 refactor: for better readability
(cherry picked from commit 8ba199016a)
2025-11-05 12:14:59 +00:00
ruthra kumar
37c1d665e3 refactor: store results as is and convert at the end
(cherry picked from commit f25ee3c53f)
2025-11-05 12:14:59 +00:00
ruthra kumar
0d9c711b6d refactor: build and post gl entries
(cherry picked from commit e88074ddec)
2025-11-05 12:14:58 +00:00
ruthra kumar
3b0a1bce3d refactor: store daily balances based on dimensions key
dimensions key is manually converted to string

(cherry picked from commit 1846de0d49)
2025-11-05 12:14:58 +00:00
ruthra kumar
efd90f554f refactor: store closing balance as JSON
(cherry picked from commit 1a31825409)
2025-11-05 12:14:58 +00:00
ruthra kumar
5992ce533e refactor: stable start, pause, resume and completion stages
(cherry picked from commit c839ebf593)
2025-11-05 12:14:58 +00:00
ruthra kumar
1c044759ac refactor: barebones functions
(cherry picked from commit 1c92b01542)
2025-11-05 12:14:57 +00:00
ruthra kumar
86a36b3ef4 refactor: temporarily save balances in JSON
(cherry picked from commit f44c908a8d)
2025-11-05 12:14:57 +00:00
ruthra kumar
cd830a6b6c refactor: child table in process pcv
(cherry picked from commit 0d09d21d2e)
2025-11-05 12:14:57 +00:00
ruthra kumar
dc1147d504 refactor: more data structure changes
(cherry picked from commit a15578f8f4)
2025-11-05 12:14:56 +00:00
ruthra kumar
797b418af4 refactor: checkbox for pcv controller
(cherry picked from commit 4888461be2)

# Conflicts:
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.json
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.py
2025-11-05 12:14:56 +00:00
ruthra kumar
8cdbaacfff feat: process period closing voucher
(cherry picked from commit 7a93630629)
2025-11-05 12:14:56 +00:00
Frappe PR Bot
09d12f2f9f chore(release): Bumped to Version 15.86.0
# [15.86.0](https://github.com/frappe/erpnext/compare/v15.85.1...v15.86.0) (2025-11-04)

### Bug Fixes

* **accounts-receivable:** ensure report data with party account currency ([164333a](164333a730))
* **accounts-receivable:** ensure report data with party account currency (backport [#50035](https://github.com/frappe/erpnext/issues/50035)) ([#50311](https://github.com/frappe/erpnext/issues/50311)) ([ae23cdd](ae23cdd8e9))
* **accounts:** populate correct fields on GL Entry during discount accounting ([4076798](4076798707))
* added validation for default accounts on company ([d9d9230](d9d9230d4a))
* allow bulk edit for bill of material items ([afe42ee](afe42ee3e9))
* create GL entries via hooks only for submitted assets ([3d78277](3d7827731b))
* disallow material transfer if source and target warehouse are same ([#50331](https://github.com/frappe/erpnext/issues/50331)) ([d920520](d920520843)), closes [#48697](https://github.com/frappe/erpnext/issues/48697)
* handle None in last_valuation_rate check ([e3110b3](e3110b3993))
* job card timer ([053765a](053765a466))
* **pos:** order pos invoices by timestamp ([12903b1](12903b11ed))
* Respect allowed zero qty in SO and PO based on Buying/Selling settings when update items ([#49673](https://github.com/frappe/erpnext/issues/49673)) ([5d4da9c](5d4da9c68f))
* set valuation rate for rejected serial/batch item ([f72d14b](f72d14b1ca))

### Features

* option to exclude stand-alone returned sales invoices from the Gross Profit report ([017dc79](017dc792e6))

### Reverts

* Revert "refactor: add supplier filter in buying (backport [#50013](https://github.com/frappe/erpnext/issues/50013)) ([#50107](https://github.com/frappe/erpnext/issues/50107))" ([288570a](288570acde))
2025-11-04 12:32:53 +00:00
Diptanil Saha
19f66c6018 Merge pull request #50333 from frappe/version-15-hotfix
chore: release v15
2025-11-04 18:01:18 +05:30
rohitwaghchaure
de80215df5 Merge pull request #50338 from frappe/mergify/bp/version-15-hotfix/pr-50332
feat: option to exclude stand-alone returned sales invoices from the Gross Profit report (backport #50332)
2025-11-04 17:38:04 +05:30
Rohit Waghchaure
017dc792e6 feat: option to exclude stand-alone returned sales invoices from the Gross Profit report
(cherry picked from commit 52cf9d4950)
2025-11-04 11:30:46 +00:00
Mihir Kandoi
d920520843 fix: disallow material transfer if source and target warehouse are same (#50331)
* fix: disallow material transfer if source and target warehouse are same (#48697)

* fix: disallow material transfer if source and target warehouse are same

* fix: check on child row level instead of parent level

* chore: add docstring to function
2025-11-04 09:44:18 +00:00
mergify[bot]
ac901dee3c Add support for subcontract return from rejected warehouse (backport #50299) (#50330)
* Merge pull request #50299 from saadchaudharry/feature-subcontract-return-rejected

Add support for subcontract return from rejected warehouse

(cherry picked from commit 8854db51dd)

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

* chore: resolve conflicts

---------

Co-authored-by: Saad Chaudhary <47004596+saadchaudharry@users.noreply.github.com>
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-11-04 09:09:41 +00:00
ruthra kumar
eed1abd272 Merge pull request #50313 from frappe/mergify/bp/version-15-hotfix/pr-49673
fix: Respect allowed zero qty in SO and PO based on Buying/Selling settings when update items (backport #49673)
2025-11-03 15:39:39 +05:30
ruthra kumar
ae23cdd8e9 fix(accounts-receivable): ensure report data with party account currency (backport #50035) (#50311)
* fix(accounts-receivable): ensure report data with party account currency

(cherry picked from commit 752ea7ee7d)

* test(accounts-receivable): add test case to validate report data with party account currency

(cherry picked from commit 3e4846ea3d)

---------

Co-authored-by: Bhavan23 <bhavan@aerele.in>
2025-11-03 15:30:24 +05:30
Kerolles Fathy
5d4da9c68f fix: Respect allowed zero qty in SO and PO based on Buying/Selling settings when update items (#49673)
* fix: respect allowed zero qty in SO and PO based on buying/selling settings

* refactor: remove parent_doctype param due to it's already avaliable

* refactor: rename is_allowed_zero_qty_for to is_allowed_zero_qty

* fix: prevent rate change for unit price items

* fix: unboundlocal variable rate_unchanged

* refactor: only throw on 'zero' qty items

---------

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
(cherry picked from commit 44363c069e)
2025-11-03 09:47:30 +00:00
Khushi Rawat
990ada1656 Merge pull request #50312 from frappe/mergify/bp/version-15-hotfix/pr-50260
fix: create GL entries via hooks only for submitted assets (backport #50260)
2025-11-03 15:13:42 +05:30
Bhavan23
1e40fb00f5 test(accounts-receivable): add test case to validate report data with party account currency
(cherry picked from commit 3e4846ea3d)
2025-11-03 15:13:29 +05:30
khushi8112
3d7827731b fix: create GL entries via hooks only for submitted assets
(cherry picked from commit 33690975f6)
2025-11-03 09:21:58 +00:00
Bhavan23
164333a730 fix(accounts-receivable): ensure report data with party account currency
(cherry picked from commit 752ea7ee7d)
2025-11-03 09:12:44 +00:00
ruthra kumar
e1afcb39db Merge pull request #50309 from frappe/mergify/bp/version-15-hotfix/pr-50297
chore:there is no company field in bank (backport #50297)
2025-11-03 14:04:42 +05:30
Nihal Roshan
65e37756f6 refactor: remove company filter
'Bank' doctype has no 'company' field.

(cherry picked from commit f1682ea90e)
2025-11-03 08:31:56 +00:00
Diptanil Saha
c897220535 Merge pull request #50307 from frappe/mergify/bp/version-15-hotfix/pr-50305
fix(accounts): populate correct fields on GL Entry during discount accounting (backport #50305)
2025-11-03 13:58:28 +05:30
Diptanil Saha
b04c06e034 chore: resolve conflict 2025-11-03 13:22:33 +05:30
diptanilsaha
4076798707 fix(accounts): populate correct fields on GL Entry during discount accounting
(cherry picked from commit e41a7b8cd7)

# Conflicts:
#	erpnext/controllers/accounts_controller.py
2025-11-03 07:49:36 +00:00
rohitwaghchaure
8b8427cbf5 Merge pull request #50303 from frappe/mergify/bp/version-15-hotfix/pr-50300
fix: handle None in last_valuation_rate check (backport #50300)
2025-11-03 10:13:57 +05:30
Kavin
e3110b3993 fix: handle None in last_valuation_rate check
(cherry picked from commit a3058bf8cc)
2025-11-02 07:25:34 +00:00
Diptanil Saha
b5f8f2b6fa Merge pull request #50292 from frappe/mergify/bp/version-15-hotfix/pr-50291
fix: added validation for default accounts on company (backport #50291)
2025-11-01 10:04:59 +05:30
Diptanil Saha
1a3652bee1 chore: resolve conflict 2025-10-31 17:34:15 +05:30
Mihir Kandoi
253b945816 Merge pull request #50287 from frappe/revert-50107-mergify/bp/version-15-hotfix/pr-50013
Revert "refactor: add supplier filter in buying (backport #50013)"
2025-10-31 15:46:29 +05:30
diptanilsaha
d9d9230d4a fix: added validation for default accounts on company
(cherry picked from commit 4af1ae1470)

# Conflicts:
#	erpnext/setup/doctype/company/company.py
2025-10-31 10:07:42 +00:00
rohitwaghchaure
668ec641c1 Merge pull request #50290 from rohitwaghchaure/fixed-github-50262
fix: job card timer
2025-10-31 14:33:23 +05:30
Rohit Waghchaure
053765a466 fix: job card timer 2025-10-31 14:06:22 +05:30
Mihir Kandoi
288570acde Revert "refactor: add supplier filter in buying (backport #50013) (#50107)"
This reverts commit abb210bd18.
2025-10-31 13:59:58 +05:30
Frappe PR Bot
4ef07f97c9 chore(release): Bumped to Version 15.85.1
## [15.85.1](https://github.com/frappe/erpnext/compare/v15.85.0...v15.85.1) (2025-10-30)

### Bug Fixes

* **pos:** order pos invoices by timestamp ([8bd1e8f](8bd1e8ff74))
2025-10-30 15:42:14 +00:00
rohitwaghchaure
670579bde3 Merge pull request #50278 from frappe/mergify/bp/version-15/pr-50277
fix(pos): order pos invoices by timestamp (backport #50277)
2025-10-30 21:10:53 +05:30
Kavin
8bd1e8ff74 fix(pos): order pos invoices by timestamp
(cherry picked from commit 12903b11ed)
2025-10-30 13:20:53 +00:00
rohitwaghchaure
83f4970255 Merge pull request #50277 from aerele/support-51587
fix(pos): order pos invoices by timestamp
2025-10-30 18:49:44 +05:30
Kavin
12903b11ed fix(pos): order pos invoices by timestamp 2025-10-30 18:16:11 +05:30
rohitwaghchaure
7658076070 Merge pull request #50271 from frappe/mergify/bp/version-15-hotfix/pr-50270
fix: set valuation rate for rejected serial/batch item (backport #50270)
2025-10-30 09:27:57 +05:30
rohitwaghchaure
b019d2f45e chore: fix linters issue 2025-10-30 09:06:37 +05:30
venkat102
397bc96b40 test: add unit test for valuation rate on rejected serial/batch item
(cherry picked from commit d002959d35)
2025-10-30 03:32:00 +00:00
venkat102
f72d14b1ca fix: set valuation rate for rejected serial/batch item
(cherry picked from commit 614402cf6c)
2025-10-30 03:31:59 +00:00
rohitwaghchaure
0405d82b75 Merge pull request #50266 from frappe/mergify/bp/version-15-hotfix/pr-50264
fix: allow bulk edit for bill of material items (backport #50264)
2025-10-30 08:58:13 +05:30
Rohit Waghchaure
afe42ee3e9 fix: allow bulk edit for bill of material items
(cherry picked from commit 1f74e06791)
2025-10-29 12:51:38 +00:00
Frappe PR Bot
49f66a8a51 chore(release): Bumped to Version 15.85.0
# [15.85.0](https://github.com/frappe/erpnext/compare/v15.84.0...v15.85.0) (2025-10-28)

### Bug Fixes

* **accounts:** update payment mode account retrieval to use namespaced function ([2300660](23006601b2))
* add message for missing purchase orders in production plan ([5798409](5798409f69))
* **asset depreciations and balances:** showing opening entries ([81f19b9](81f19b950d))
* avoid group columns mutation ([158e1b2](158e1b28a9))
* **Bank Transaction:** make transaction ID non-unique ([b52b04a](b52b04a10c))
* fiscal year overlap validation for company-specific years ([482a796](482a796212))
* get valuation rate based of previous SLEs for material receipt ([e9f4a34](e9f4a34d8d))
* **gross profit:** remove customer name from columns ([a767253](a7672530f4))
* **journal-entry:** allow copy account currency when duplicating JV ([1b227b8](1b227b8b4f))
* optimized the slow query to get the batchwise available qty ([85bf936](85bf9366b0))
* Pass uom field name to update existing item qty ([93b2786](93b2786865))
* provision to find and fix incorrect serial and batch bundles ([2276741](22767410d5))
* recalculate amount based on allocated amount ([2a90bff](2a90bffb5f))
* resolve conflicts ([97147a4](97147a484d))
* sabb missed in the incorrect serial no valuation report ([8a995f2](8a995f28c9))
* set default value for as zero for additional asset cost ([ee5e4ec](ee5e4eccec))
* set status to Draft for auto-created assets from Purchase Receipt ([d8eddbf](d8eddbfd03))
* stock difference value for adjustment entry ([6c0694f](6c0694ff17))
* **Task:** make Timesheet-dependent fields no_copy (backport [#50130](https://github.com/frappe/erpnext/issues/50130)) ([#50196](https://github.com/frappe/erpnext/issues/50196)) ([4988ff8](4988ff84df))
* use correct field name ([a82fa8c](a82fa8c26b))

### Features

* Add posting date param for reverse GL entries ([1a7092d](1a7092d7b6))
* add project filter to Delayed Tasks Summary report ([82ca729](82ca729e2b))
2025-10-28 13:48:43 +00:00
Diptanil Saha
0a09bb8d17 Merge pull request #50249 from frappe/version-15-hotfix
chore: release v15
2025-10-28 19:17:10 +05:30
rohitwaghchaure
ba700bce90 Merge pull request #50252 from frappe/mergify/bp/version-15-hotfix/pr-50247
fix: provision to find and fix incorrect serial and batch bundles (backport #50247)
2025-10-28 18:21:46 +05:30
Rohit Waghchaure
22767410d5 fix: provision to find and fix incorrect serial and batch bundles
(cherry picked from commit 10ad56060c)
2025-10-28 12:15:11 +00:00
Diptanil Saha
89e7a260fd Merge pull request #50251 from frappe/mergify/bp/version-15-hotfix/pr-50137
fix(payment-reco): recalculate amount based on allocated amount (backport #50137)
2025-10-28 17:34:10 +05:30
l0gesh29
2a90bffb5f fix: recalculate amount based on allocated amount
(cherry picked from commit 5a7a6a9bd5)
2025-10-28 11:58:10 +00:00
Diptanil Saha
7434522ea1 Merge pull request #50250 from frappe/mergify/bp/version-15-hotfix/pr-50220
fix(gross profit): remove customer name from columns (backport #50220)
2025-10-28 15:37:53 +05:30
ravibharathi656
158e1b28a9 fix: avoid group columns mutation
(cherry picked from commit 7ce81127d2)
2025-10-28 09:51:23 +00:00
ravibharathi656
a7672530f4 fix(gross profit): remove customer name from columns
(cherry picked from commit 0009925af0)
2025-10-28 09:51:23 +00:00
Diptanil Saha
ad33735541 Merge pull request #50245 from frappe/mergify/bp/version-15-hotfix/pr-50213
fix(Bank Transaction)!: make transaction ID non-unique (backport #50213)
2025-10-28 10:20:49 +05:30
Diptanil Saha
977f385006 chore: resolve conflict 2025-10-28 09:07:14 +05:30
barredterra
b52b04a10c fix(Bank Transaction): make transaction ID non-unique
(cherry picked from commit a2a41a0eaa)

# Conflicts:
#	erpnext/accounts/doctype/bank_transaction/bank_transaction.json
2025-10-28 02:45:52 +00:00
Diptanil Saha
05b89b4121 Merge pull request #50243 from frappe/mergify/bp/version-15-hotfix/pr-49599
fix(accounts): reference get_payment_mode_account correctly in Sales Invoice (backport #49599)
2025-10-28 08:08:36 +05:30
Diptanil Saha
36983c97cb chore: resolve conflict 2025-10-28 08:06:10 +05:30
KerollesFathy
23006601b2 fix(accounts): update payment mode account retrieval to use namespaced function
(cherry picked from commit 0af74aef00)

# Conflicts:
#	erpnext/public/js/controllers/accounts.js
2025-10-27 16:50:10 +00:00
rohitwaghchaure
37e9461ece Merge pull request #50239 from frappe/mergify/bp/version-15-hotfix/pr-50233
fix: optimized the slow query to get the batch-wise available qty (backport #50233)
2025-10-27 17:31:15 +05:30
Mihir Kandoi
126d79dcd2 Merge pull request #50241 from frappe/mergify/bp/version-15-hotfix/pr-50221
fix: Pass uom field name to update existing item qty (backport #50221)
2025-10-27 17:29:29 +05:30
Kavin
93b2786865 fix: Pass uom field name to update existing item qty
(cherry picked from commit 23d69389ec)
2025-10-27 11:48:44 +00:00
rohitwaghchaure
2680f85430 chore: fix linters issue 2025-10-27 17:06:45 +05:30
rohitwaghchaure
2d7fde024d chore: fix conflicts 2025-10-27 16:57:00 +05:30
Rohit Waghchaure
85bf9366b0 fix: optimized the slow query to get the batchwise available qty
(cherry picked from commit 9c21567309)

# Conflicts:
#	erpnext/stock/serial_batch_bundle.py
2025-10-27 11:19:24 +00:00
Khushi Rawat
86f507bb6e Merge pull request #50238 from frappe/mergify/bp/version-15-hotfix/pr-50222
fix(asset depreciations and balances): showing opening entries (backport #50222)
2025-10-27 16:35:46 +05:30
ravibharathi656
81f19b950d fix(asset depreciations and balances): showing opening entries
(cherry picked from commit d3afa67be3)
2025-10-27 10:48:36 +00:00
Mihir Kandoi
7b4eac2294 Merge pull request #50236 from Abdeali099/fix-msg
fix: add message for missing purchase orders in production plan
2025-10-27 15:54:09 +05:30
Diptanil Saha
aff4b62258 Merge pull request #50234 from frappe/mergify/bp/version-15-hotfix/pr-50039
fix(journal-entry): allow copy account currency when duplicating JV (backport #50039)
2025-10-27 15:36:40 +05:30
Abdeali Chharchhoda
5798409f69 fix: add message for missing purchase orders in production plan 2025-10-27 15:09:22 +05:30
Bhavan23
1b227b8b4f fix(journal-entry): allow copy account currency when duplicating JV
(cherry picked from commit 76748e4573)
2025-10-27 08:45:01 +00:00
Diptanil Saha
4eca7f0524 Merge pull request #50230 from frappe/mergify/bp/version-15-hotfix/pr-50103
fix: fiscal year overlap validation for company-specific years (backport #50103)
2025-10-27 11:01:57 +05:30
rehansari26
4bb66179ab test: replace get_doc with new_doc in fiscal year tests
(cherry picked from commit d59e55fb08)
2025-10-27 05:08:36 +00:00
Rehan Ansari
d84a29e1a1 test: fiscal year overlap validation for company-specific years
(cherry picked from commit 94ae098854)
2025-10-27 05:08:36 +00:00
Rehan Ansari
482a796212 fix: fiscal year overlap validation for company-specific years
(cherry picked from commit 57aaf34d3e)
2025-10-27 05:08:36 +00:00
Diptanil Saha
41694d3751 Merge pull request #50223 from frappe/mergify/bp/version-15-hotfix/pr-49889
feat: add project filter to Delayed Tasks Summary report (backport #49889)
2025-10-24 22:27:54 +05:30
Rehan Ansari
82ca729e2b feat: add project filter to Delayed Tasks Summary report
(cherry picked from commit 88097e78d2)
2025-10-24 16:42:15 +00:00
rohitwaghchaure
e67361257e Merge pull request #50216 from frappe/mergify/bp/version-15-hotfix/pr-50215
fix: get valuation rate based of previous SLEs for material receipt (backport #50215)
2025-10-24 00:05:12 +05:30
Rohit Waghchaure
e9f4a34d8d fix: get valuation rate based of previous SLEs for material receipt
(cherry picked from commit fa9ef6708f)
2025-10-23 18:30:20 +00:00
Khushi Rawat
c6c4e31b32 Merge pull request #50211 from frappe/mergify/bp/version-15-hotfix/pr-50209
fix: set status to Draft for auto-created assets from Purchase Receipt (backport #50209)
2025-10-23 23:33:42 +05:30
khushi8112
ee5e4eccec fix: set default value for as zero for additional asset cost 2025-10-23 22:51:30 +05:30
khushi8112
a82fa8c26b fix: use correct field name 2025-10-23 20:45:08 +05:30
khushi8112
97147a484d fix: resolve conflicts 2025-10-23 19:09:30 +05:30
khushi8112
d8eddbfd03 fix: set status to Draft for auto-created assets from Purchase Receipt
(cherry picked from commit 20c2cb40d1)

# Conflicts:
#	erpnext/assets/doctype/asset/asset.py
#	erpnext/patches.txt
2025-10-23 13:03:17 +00:00
Deepesh Garg
977464e6a7 Merge pull request #50206 from frappe/mergify/bp/version-15-hotfix/pr-50204
feat: Add posting date param for reverse GL entries (#50204)
2025-10-23 16:02:07 +05:30
Deepesh Garg
db84df0cbd chore: Linting issues
(cherry picked from commit 05e1a737f1)
2025-10-23 08:12:31 +00:00
Deepesh Garg
1a7092d7b6 feat: Add posting date param for reverse GL entries
(cherry picked from commit 38988bf797)
2025-10-23 08:12:30 +00:00
rohitwaghchaure
fcd05bb7e4 Merge pull request #50202 from frappe/mergify/bp/version-15-hotfix/pr-50200
fix: stock difference value for adjustment entry (backport #50200)
2025-10-23 10:31:00 +05:30
Rohit Waghchaure
6c0694ff17 fix: stock difference value for adjustment entry
(cherry picked from commit fb4c7de86c)
2025-10-22 17:03:12 +00:00
mergify[bot]
4988ff84df fix(Task): make Timesheet-dependent fields no_copy (backport #50130) (#50196)
* fix(Task): make Timesheet-dependent fields no_copy

(cherry picked from commit 2a2e4b5423)

# Conflicts:
#	erpnext/projects/doctype/task/task.json

* chore: resolve conflicts

---------

Co-authored-by: Patrick Eissler <77415730+PatrickDEissler@users.noreply.github.com>
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-10-22 08:34:11 +00:00
Mihir Kandoi
e5d0116924 Merge pull request #50194 from frappe/mergify/bp/version-15-hotfix/pr-50151
chore: remove print statement (backport #50151)
2025-10-22 14:01:04 +05:30
Mihir Kandoi
38d3b17dfe Merge pull request #50195 from frappe/mergify/bp/version-15-hotfix/pr-50153
fix: Address title error when create new transporter on driver  (backport #50153)
2025-10-22 13:48:31 +05:30
Kerolles Fathy
89d305ac9f Merge pull request #50153 from KerollesFathy/fix-address-error-when-create-transporter
fix: Address title error when create new transporter on driver
(cherry picked from commit 8efcf6cb38)
2025-10-22 08:14:25 +00:00
Abdeali Chharchhoda
8b2be43897 chore: remove print statement
(cherry picked from commit 1ad4dc9066)
2025-10-22 08:14:24 +00:00
rohitwaghchaure
0bd3b5aac2 Merge pull request #50192 from frappe/mergify/bp/version-15-hotfix/pr-50191
fix: sabb missed in the incorrect serial no valuation report (backport #50191)
2025-10-22 12:17:53 +05:30
Rohit Waghchaure
8a995f28c9 fix: sabb missed in the incorrect serial no valuation report
(cherry picked from commit b50bac6788)
2025-10-22 06:26:01 +00:00
Frappe PR Bot
e714b82802 chore(release): Bumped to Version 15.84.0
# [15.84.0](https://github.com/frappe/erpnext/compare/v15.83.2...v15.84.0) (2025-10-21)

### Bug Fixes

* added exception handling on service level agreement apply hook ([#50096](https://github.com/frappe/erpnext/issues/50096)) ([a3a6d39](a3a6d39436))
* adjustment entry ([76cfa28](76cfa28a42))
* correct monthly sales history (backport [#50056](https://github.com/frappe/erpnext/issues/50056)) ([#50179](https://github.com/frappe/erpnext/issues/50179)) ([afc2d95](afc2d95736))
* handle flt conversion for prev_ordered_qty ([3d3e116](3d3e116797))
* internal transfer entry with serial/batch ([d67a439](d67a439051))
* **point-of-sale:** render payment methods only payment component is visible ([2b0281c](2b0281c510))
* preview stock ledger for manual serial and batch values ([c64dcf3](c64dcf3423))
* **stock:** remove duplicate fields ([58a1383](58a1383380))
* validation for negative batch ([b9dd05f](b9dd05f292))

### Features

* set options for IBAN fields (backport [#49377](https://github.com/frappe/erpnext/issues/49377)) ([#49413](https://github.com/frappe/erpnext/issues/49413)) ([bd3a132](bd3a132868))

### Performance Improvements

* Add index for faster queries ([#50175](https://github.com/frappe/erpnext/issues/50175)) ([0571ed0](0571ed0735))
2025-10-21 12:44:58 +00:00
Diptanil Saha
7ec6ef3139 Merge pull request #50182 from frappe/version-15-hotfix
chore: release v15
2025-10-21 18:13:27 +05:30
mergify[bot]
afc2d95736 fix: correct monthly sales history (backport #50056) (#50179)
fix: correct monthly sales history (#50056)

* fix: correct monthly sales history

* fix: correct monthly sales history calculation

* chore: remove unrelated file accidentally committed

---------


(cherry picked from commit f51ed30c23)

Co-authored-by: Ahmed AbuKhatwa <82771130+AhmedAbokhatwa@users.noreply.github.com>
Co-authored-by: AhmedAbukhatwa <Ahmedabukhatwa1@gmail.com>
2025-10-21 11:06:02 +05:30
Deepesh Garg
1e9ffe351b Merge pull request #50178 from frappe/mergify/bp/version-15-hotfix/pr-50175
perf: Add index for faster queries
2025-10-21 09:56:35 +05:30
Deepesh Garg
0571ed0735 perf: Add index for faster queries (#50175)
(cherry picked from commit 7a91ec3e33)
2025-10-20 18:43:48 +00:00
mergify[bot]
43941ecd5e refactor: simplify expression (backport #50168) (#50170)
Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
2025-10-19 23:59:27 +02:00
Frappe PR Bot
8b9788ca74 chore(release): Bumped to Version 15.83.2
## [15.83.2](https://github.com/frappe/erpnext/compare/v15.83.1...v15.83.2) (2025-10-18)

### Bug Fixes

* internal transfer entry with serial/batch ([97cdac1](97cdac10d7))
* **stock:** remove duplicate fields ([5e8e6ef](5e8e6ef2f3))
2025-10-18 04:42:12 +00:00
rohitwaghchaure
eb38bcdab7 Merge pull request #50164 from frappe/mergify/bp/version-15/pr-50158
fix: internal transfer entry with serial/batch (backport #50156) (backport #50158)
2025-10-18 10:10:35 +05:30
rohitwaghchaure
9876d1c7e6 Merge pull request #50165 from frappe/mergify/bp/version-15/pr-50157
fix(stock-settings): remove duplicate fields (backport #50157)
2025-10-18 10:10:20 +05:30
Kavin
5e8e6ef2f3 fix(stock): remove duplicate fields
(cherry picked from commit 58a1383380)
2025-10-18 03:49:50 +00:00
rohitwaghchaure
2055c4e8d3 Merge pull request #50157 from aerele/support-51015
fix(stock-settings): remove duplicate fields
2025-10-18 09:19:21 +05:30
Rohit Waghchaure
97cdac10d7 fix: internal transfer entry with serial/batch
(cherry picked from commit 9b4e62a758)
(cherry picked from commit d67a439051)
2025-10-18 03:47:47 +00:00
rohitwaghchaure
df22902035 Merge pull request #50158 from frappe/mergify/bp/version-15-hotfix/pr-50156
fix: internal transfer entry with serial/batch (backport #50156)
2025-10-17 21:32:16 +05:30
Rohit Waghchaure
d67a439051 fix: internal transfer entry with serial/batch
(cherry picked from commit 9b4e62a758)
2025-10-17 15:34:30 +00:00
Kavin
58a1383380 fix(stock): remove duplicate fields 2025-10-17 18:35:53 +05:30
Frappe PR Bot
5e21c9c5c9 chore(release): Bumped to Version 15.83.1
## [15.83.1](https://github.com/frappe/erpnext/compare/v15.83.0...v15.83.1) (2025-10-17)

### Bug Fixes

* validation for negative batch ([555d5da](555d5da611))
2025-10-17 09:19:51 +00:00
rohitwaghchaure
6262566c53 Merge pull request #50150 from frappe/mergify/bp/version-15/pr-50145
fix: validation for negative batch (backport #50123) (backport #50145)
2025-10-17 14:48:04 +05:30
Rohit Waghchaure
555d5da611 fix: validation for negative batch
(cherry picked from commit f9c8f27586)
(cherry picked from commit b9dd05f292)
2025-10-17 08:06:54 +00:00
rohitwaghchaure
f5af5dd8c0 Merge pull request #50145 from frappe/mergify/bp/version-15-hotfix/pr-50123
fix: validation for negative batch (backport #50123)
2025-10-17 12:34:15 +05:30
Rohit Waghchaure
b9dd05f292 fix: validation for negative batch
(cherry picked from commit f9c8f27586)
2025-10-17 06:07:37 +00:00
Diptanil Saha
44f39e0b43 Merge pull request #50142 from frappe/mergify/bp/version-15-hotfix/pr-50141
fix(point-of-sale): render payment methods only when payment component is visible (backport #50141)
2025-10-17 01:46:05 +05:30
diptanilsaha
2b0281c510 fix(point-of-sale): render payment methods only payment component is visible
(cherry picked from commit 7dc4306640)
2025-10-16 20:13:33 +00:00
rohitwaghchaure
03766e8980 Merge pull request #50117 from frappe/mergify/bp/version-15-hotfix/pr-50113
fix: adjustment entry (backport #50113)
2025-10-15 21:31:32 +05:30
Diptanil Saha
e7b7377b7e Merge pull request #50120 from frappe/mergify/bp/version-15-hotfix/pr-50096
fix: added exception handling on service level agreement apply hook (backport #50096)
2025-10-15 19:51:23 +05:30
Diptanil Saha
a3a6d39436 fix: added exception handling on service level agreement apply hook (#50096)
* fix: added exception handling on service level agreement apply hook

* Revert "fix: added exception handling on service level agreement apply hook"

This reverts commit dae93aa96f.

* fix: Ignore missing SLA table during install/uninstall

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit 182c9fd966)
2025-10-15 14:04:17 +00:00
Rohit Waghchaure
76cfa28a42 fix: adjustment entry
(cherry picked from commit c0851abaee)
2025-10-15 10:30:33 +00:00
Diptanil Saha
afa7d2b595 Merge pull request #50109 from frappe/mergify/bp/version-15-hotfix/pr-50095
fix: preview stock ledger for manual serial and batch values (backport #50095)
2025-10-15 13:14:13 +05:30
Kavin
c64dcf3423 fix: preview stock ledger for manual serial and batch values
(cherry picked from commit c5f68d0b27)
2025-10-15 05:47:41 +00:00
Mihir Kandoi
3fa38d0b4e Merge pull request #50106 from frappe/mergify/bp/version-15-hotfix/pr-50078
fix: handle flt conversion for prev_ordered_qty (backport #50078)
2025-10-15 00:02:09 +05:30
mergify[bot]
abb210bd18 refactor: add supplier filter in buying (backport #50013) (#50107)
* refactor: add supplier filter in buying

(cherry picked from commit 108b108d64)

# Conflicts:
#	erpnext/public/js/controllers/buying.js

* chore: resolve conflicts

---------

Co-authored-by: manikandan-s-18 <manikandansundar18@gmail.com>
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-10-14 18:22:20 +00:00
Kavin
3d3e116797 fix: handle flt conversion for prev_ordered_qty
(cherry picked from commit 77c35ef47f)
2025-10-14 18:10:30 +00:00
mergify[bot]
bd3a132868 feat: set options for IBAN fields (backport #49377) (#49413)
Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
2025-10-14 14:42:08 +00:00
Frappe PR Bot
779074e6a6 chore(release): Bumped to Version 15.83.0
# [15.83.0](https://github.com/frappe/erpnext/compare/v15.82.2...v15.83.0) (2025-10-14)

### Bug Fixes

* add GROUP BY for dn_detail and convert SQL query to QB ([9aa9b18](9aa9b181e5))
* **asset movement:** clear custodian if not present ([4ec5b28](4ec5b28fd2))
* Batch ordering based on the method mentioned in settings ([50266d3](50266d3b6b))
* batch qty for expired batches ([f4816e4](f4816e4960))
* consider negative qty in batch qty calculation ([4370a59](4370a59183))
* **deferred revenue:** validate service stop date ([557d53a](557d53a953))
* do reposting of first transfer entry based on item-wh combination ([e9d71e0](e9d71e013a))
* duplicate serial nos ([9854ded](9854dedc06))
* enhance sub-assembly item handling in raw material request calculations ([467fcea](467fcea728))
* filter sales team to show only active individual salespersons ([38efd5c](38efd5cb0b))
* fixed asset register showing opening entries ([1ea6e1d](1ea6e1db12))
* hide sales invoice creation for fully returned delivery notes ([b426b8c](b426b8c07f))
* incorrect field valuation_rate ([93df11a](93df11a0cf))
* negative error not throw for backdated entry ([1fc21d6](1fc21d60c6))
* performance issue by adding index ([e4fd49e](e4fd49e991))
* preserve address if present ([aaf470c](aaf470cf5c))
* prevent empty Create dropdown when In Process (backport [#49891](https://github.com/frappe/erpnext/issues/49891)) ([#50063](https://github.com/frappe/erpnext/issues/50063)) ([b67b292](b67b29200c))
* **production plan:** filter sales orders by item ([20c2809](20c2809437))
* reset raw materials considering not available batches ([2184a28](2184a28e91))
* Reset Raw Materials Table button not working ([81ed32f](81ed32ff51))
* resolve conflict ([dccc561](dccc561eec))
* resolve conflict ([38e1ca1](38e1ca1362))
* revert unrelated manual modified timestamp change ([c4cba78](c4cba78124))
* sales return for product bundle items ([ac46b3d](ac46b3d1ca))
* sanitize projects field in tasks webform ([#50089](https://github.com/frappe/erpnext/issues/50089)) ([432201f](432201f634))
* set default roles on role_profile during reinstallation ([c93fbf3](c93fbf3982))
* skip auto-cancel of depreciation for components during asset capitalization ([6d5f2b5](6d5f2b5024))
* skip party validation for payroll & it's journal & GL entry submission (backport [#49638](https://github.com/frappe/erpnext/issues/49638)) ([#49826](https://github.com/frappe/erpnext/issues/49826)) ([957b47f](957b47f351))
* stock ledger adjustment entry ([8020159](8020159c14))
* **stock-entry:** fetch empty batch for finished item ([af3d7ef](af3d7ef300))
* **stock-reconciliation:** include inventory dimensions in duplicate validation ([21a972a](21a972ad95))
* **Supplier Quotation Comparison:** add a missing translate function (backport [#49497](https://github.com/frappe/erpnext/issues/49497)) ([#50055](https://github.com/frappe/erpnext/issues/50055)) ([b7c2405](b7c2405113))
* swap warehouse labels for return entry ([c5dc810](c5dc810642))
* warehouse source reference in production report ([db93e50](db93e50f16))

### Features

* add asset name to Asset Depreciations and Balances report ([0776b30](0776b300e8))

### Performance Improvements

* add composite indexes to Advance Payment Ledger Entry table ([5652e92](5652e926d7))
* optimize sql query ([79a8e26](79a8e2656b))
2025-10-14 14:03:31 +00:00
Diptanil Saha
c521a6495d Merge pull request #50087 from frappe/version-15-hotfix
chore: release v15
2025-10-14 19:27:40 +05:30
rohitwaghchaure
6f02362765 Merge pull request #50098 from frappe/mergify/bp/version-15-hotfix/pr-50089
fix: sanitize projects field in tasks webform (backport #50089)
2025-10-14 19:07:50 +05:30
Akhil Narang
432201f634 fix: sanitize projects field in tasks webform (#50089)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit f8b50d3ffa)
2025-10-14 13:08:51 +00:00
rohitwaghchaure
f9dc00f8ad Merge pull request #50094 from frappe/mergify/bp/version-15-hotfix/pr-50080
perf: optimize sql query (backport #50080)
2025-10-14 18:17:00 +05:30
rohitwaghchaure
0dd79e8c2b Merge pull request #50092 from frappe/mergify/bp/version-15-hotfix/pr-50091
fix: negative error not throw for backdated entry (backport #50091)
2025-10-14 18:16:42 +05:30
Khushi Rawat
f70e61ab31 Merge pull request #50093 from frappe/mergify/bp/version-15-hotfix/pr-50033
fix: filter sales team to show only active individual salespersons (backport #50033)
2025-10-14 17:51:15 +05:30
mergify[bot]
b67b29200c fix: prevent empty Create dropdown when In Process (backport #49891) (#50063) 2025-10-14 17:49:27 +05:30
mergify[bot]
fd72b55852 Merge pull request #50081 from frappe/mergify/bp/version-15-hotfix/pr-49960
Fix/Support 50220 (backport #49960)
2025-10-14 12:12:14 +00:00
Khushi Rawat
dccc561eec fix: resolve conflict 2025-10-14 17:25:48 +05:30
rohitwaghchaure
8bf553bbce chore: fix conflicts 2025-10-14 17:17:12 +05:30
Rohit Waghchaure
79a8e2656b perf: optimize sql query
(cherry picked from commit e7b64175fd)

# Conflicts:
#	erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json
2025-10-14 11:44:04 +00:00
Rehan Ansari
38efd5cb0b fix: filter sales team to show only active individual salespersons
(cherry picked from commit 2fcd406b18)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.js
2025-10-14 11:40:00 +00:00
Rohit Waghchaure
1fc21d60c6 fix: negative error not throw for backdated entry
(cherry picked from commit 88a947ff4e)
2025-10-14 11:39:06 +00:00
Khushi Rawat
a777a11919 Merge pull request #50088 from khushi8112/composite-component-depr-jv-cancellation-issue
fix: skip auto-cancel of depreciation for components during asset capitalization
2025-10-14 16:57:50 +05:30
Diptanil Saha
6cc046362f Merge branch 'version-15' into version-15-hotfix 2025-10-14 16:56:32 +05:30
khushi8112
02ebde43bf refactor: Ensure flag cleanup with try-finally to prevent state corruption 2025-10-14 16:32:32 +05:30
khushi8112
6d5f2b5024 fix: skip auto-cancel of depreciation for components during asset capitalization 2025-10-14 15:19:07 +05:30
Mihir Kandoi
a50313f990 Merge pull request #50084 from frappe/mergify/bp/version-15-hotfix/pr-50004
fix: add GROUP BY for dn_detail and convert SQL query to QB (backport #50004)
2025-10-14 15:13:59 +05:30
Mihir Kandoi
7d533b7086 chore: resolve conflicts 2025-10-14 14:57:28 +05:30
l0gesh29
9aa9b181e5 fix: add GROUP BY for dn_detail and convert SQL query to QB
(cherry picked from commit fd9167f2af)

# Conflicts:
#	erpnext/stock/doctype/delivery_note/delivery_note.py
2025-10-14 09:20:17 +00:00
l0gesh29
b426b8c07f fix: hide sales invoice creation for fully returned delivery notes
(cherry picked from commit 1f831d8783)
2025-10-14 09:20:16 +00:00
Mihir Kandoi
6682a25532 Merge pull request #50082 from frappe/mergify/bp/version-15-hotfix/pr-50079
chore: replace broken links with correct ones (backport #50079)
2025-10-14 14:43:05 +05:30
Mihir Kandoi
01fe1c658e chore: replace broken links with correct ones
(cherry picked from commit 11be07086f)
2025-10-14 08:58:06 +00:00
rohitwaghchaure
82e392bc0c Merge pull request #50074 from frappe/mergify/bp/version-15-hotfix/pr-50070
fix: performance issue by adding index (backport #50070)
2025-10-14 13:57:10 +05:30
rohitwaghchaure
b6f99a127b Merge pull request #50075 from frappe/mergify/bp/version-15-hotfix/pr-50065
fix(stock-reconciliation): include inventory dimensions in duplicate validation (backport #50065)
2025-10-14 13:56:55 +05:30
rohitwaghchaure
7d34a39137 Merge pull request #50076 from frappe/mergify/bp/version-15-hotfix/pr-50073
fix(stock-entry): fetch empty batch for finished item (backport #50073)
2025-10-14 13:56:41 +05:30
rohitwaghchaure
76fe4e26ea Merge pull request #50077 from frappe/mergify/bp/version-15-hotfix/pr-50072
fix: swap warehouse labels for return entry (backport #50072)
2025-10-14 13:56:17 +05:30
Kavin
c5dc810642 fix: swap warehouse labels for return entry
(cherry picked from commit f0c3f0d0be)
2025-10-14 08:07:00 +00:00
venkat102
af3d7ef300 fix(stock-entry): fetch empty batch for finished item
(cherry picked from commit 74a7ddf66d)
2025-10-14 08:05:57 +00:00
rohitwaghchaure
61f7309695 chore: fix conflicts 2025-10-14 13:33:56 +05:30
Rohit Waghchaure
9854dedc06 fix: duplicate serial nos
(cherry picked from commit c95465cba1)
2025-10-14 08:03:44 +00:00
venkat102
21a972ad95 fix(stock-reconciliation): include inventory dimensions in duplicate validation
(cherry picked from commit 4b21c2cc46)
2025-10-14 08:03:43 +00:00
rohitwaghchaure
967ee78415 chore: fix conflicts 2025-10-14 13:33:24 +05:30
Rohit Waghchaure
e4fd49e991 fix: performance issue by adding index
(cherry picked from commit 1afc75b15a)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
#	erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
2025-10-14 08:02:28 +00:00
rohitwaghchaure
b82f8648f1 Merge pull request #50068 from frappe/mergify/bp/version-15-hotfix/pr-50061
fix: do reposting of first transfer entry based on item-wh combination (backport #50061)
2025-10-14 13:21:13 +05:30
rohitwaghchaure
141b70ce8b Merge pull request #50069 from frappe/mergify/bp/version-15-hotfix/pr-50027
fix: reset raw materials considering not available batches (backport #50027)
2025-10-14 13:21:03 +05:30
Rohit Waghchaure
2184a28e91 fix: reset raw materials considering not available batches
(cherry picked from commit ec1636db12)
2025-10-14 07:19:43 +00:00
Rohit Waghchaure
e9d71e013a fix: do reposting of first transfer entry based on item-wh combination
(cherry picked from commit 2f25b445ab)
2025-10-14 07:19:08 +00:00
Mihir Kandoi
5909b0e1a2 Merge pull request #50064 from frappe/mergify/bp/version-15-hotfix/pr-49445
fix(production plan): filter sales orders by item (backport #49445)
2025-10-14 12:20:56 +05:30
Mihir Kandoi
525dd42e86 Merge pull request #50062 from frappe/mergify/bp/version-15-hotfix/pr-50058
fix: warehouse source reference in production report (backport #50058)
2025-10-14 12:10:53 +05:30
ravibharathi656
20c2809437 fix(production plan): filter sales orders by item
(cherry picked from commit bfff945fb1)
2025-10-14 06:32:58 +00:00
matteo.arosti
db93e50f16 fix: warehouse source reference in production report
(cherry picked from commit 451651e350)
2025-10-14 06:22:44 +00:00
mergify[bot]
957b47f351 fix: skip party validation for payroll & it's journal & GL entry submission (backport #49638) (#49826)
* fix: skip party validation for payroll & it's journal & GL entry submission (#49638)

* fix: skip validation for manual je & gl submission linked with payroll entry

* refactor: change condition

* fix: add checkbox in jouranl entry account and passed it true from payroll to skip party validation

* refactor: add checkbox to skip party validation in journal entry

(cherry picked from commit 35474d997d)

# Conflicts:
#	erpnext/accounts/doctype/journal_entry/journal_entry.json
#	erpnext/accounts/doctype/journal_entry/journal_entry.py

* fix: conflicts raised because of cherry pick while backporting

* fix: conflicts

---------

Co-authored-by: Raheel Khan <raheel@frappe.io>
2025-10-14 11:36:15 +05:30
mergify[bot]
b7c2405113 fix(Supplier Quotation Comparison): add a missing translate function (backport #49497) (#50055)
fix(Supplier Quotation Comparison): add a missing translate function (#49497)

* Update supplier_quotation_comparison.py

* refactor: text cleaning

(cherry picked from commit 6cacead726)

Co-authored-by: El-Shafei H. <el.shafei.developer@gmail.com>
2025-10-14 00:36:15 +05:30
rohitwaghchaure
f8a1ef055d Merge pull request #50051 from frappe/mergify/bp/version-15-hotfix/pr-50047
fix: enhance sub-assembly item handling in raw material request calculations (backport #50047)
2025-10-14 00:00:29 +05:30
Mihir Kandoi
664ac3d422 Merge pull request #50052 from frappe/mergify/bp/version-15-hotfix/pr-50025 2025-10-13 20:04:14 +05:30
Mihir Kandoi
5603467cee refactor: move value inline
(cherry picked from commit 1717a7c983)
2025-10-13 14:16:47 +00:00
thomasantony12
e23616f9ea chore: use get_single_value instead of get_cached_doc
(cherry picked from commit fab7f9ee53)
2025-10-13 14:16:47 +00:00
thomasantony12
50266d3b6b fix: Batch ordering based on the method mentioned in settings
(cherry picked from commit 7fa800b874)
2025-10-13 14:16:47 +00:00
Smit Vora
75d14985e0 chore: resolve conflicts 2025-10-13 19:45:04 +05:30
Smit Vora
467fcea728 fix: enhance sub-assembly item handling in raw material request calculations
(cherry picked from commit f912c8419a)

# Conflicts:
#	erpnext/manufacturing/doctype/production_plan/production_plan.py
2025-10-13 14:06:34 +00:00
Diptanil Saha
6a7004e4f7 Merge pull request #50046 from frappe/mergify/bp/version-15-hotfix/pr-49939
fix: preserve address if present (backport #49939)
2025-10-13 16:41:48 +05:30
diptanilsaha
5d1aa4050d chore: resolve conflicts 2025-10-13 16:36:36 +05:30
Khushi Rawat
ce6336d5d6 Merge pull request #50045 from frappe/mergify/bp/version-15-hotfix/pr-50040
perf: add composite indexes to Advance Payment Ledger Entry (backport #50040)
2025-10-13 16:25:52 +05:30
ravibharathi656
aaf470cf5c fix: preserve address if present
(cherry picked from commit 0678638106)

# Conflicts:
#	erpnext/public/js/controllers/transaction.js
2025-10-13 10:46:23 +00:00
khushi8112
c4cba78124 fix: revert unrelated manual modified timestamp change
(cherry picked from commit 59bd35c64d)
2025-10-13 10:38:12 +00:00
khushi8112
5652e926d7 perf: add composite indexes to Advance Payment Ledger Entry table
(cherry picked from commit 7fcf277055)
2025-10-13 10:38:12 +00:00
ruthra kumar
f68f7aba0b Merge pull request #50038 from frappe/mergify/bp/version-15-hotfix/pr-50017
fix(deferred revenue): validate service stop date (backport #50017)
2025-10-13 12:54:39 +05:30
ruthra kumar
f36da0543b Merge pull request #50037 from frappe/mergify/bp/version-15-hotfix/pr-50034
fix: set default roles on Role Profiles during reinstallation (backport #50034)
2025-10-13 12:38:01 +05:30
ravibharathi656
557d53a953 fix(deferred revenue): validate service stop date
(cherry picked from commit 58203a89f1)
2025-10-13 07:07:54 +00:00
diptanilsaha
c93fbf3982 fix: set default roles on role_profile during reinstallation
(cherry picked from commit 12c1b8a910)
2025-10-13 06:38:40 +00:00
rohitwaghchaure
d7bf7d0f4d Merge pull request #50026 from frappe/mergify/bp/version-15-hotfix/pr-50024
fix: stock ledger adjustment entry (backport #50024)
2025-10-12 12:12:59 +05:30
Rohit Waghchaure
8020159c14 fix: stock ledger adjustment entry
(cherry picked from commit 8b6e58d02a)
2025-10-12 06:11:44 +00:00
mergify[bot]
1e91c0f5aa Merge pull request #50006 from frappe/mergify/bp/version-15-hotfix/pr-49993
fix: incorrect PR status when using set landed cost based on PI rate (backport #49993)
2025-10-10 11:18:30 +00:00
Diptanil Saha
47af5747bd Merge pull request #50001 from diptanilsaha/backport_49764
feat: Cache employee name in session data on boot (backport #49764)
2025-10-10 12:33:39 +05:30
Khushi Rawat
3e8bf03e80 Merge pull request #50000 from frappe/mergify/bp/version-15-hotfix/pr-49980
fix: fixed asset register showing opening entries (backport #49980)
2025-10-10 12:01:10 +05:30
Khushi Rawat
fe32257450 Merge pull request #49999 from frappe/mergify/bp/version-15-hotfix/pr-49995
feat: add asset name to Asset Depreciations and Balances report (backport #49995)
2025-10-10 12:00:54 +05:30
Diptanil Saha
97b89da7c7 Merge pull request #49764 from elshafei-developer/add-employee-name-to-session-user
feat: Cache employee name in session data on boot
2025-10-10 11:45:38 +05:30
ravibharathi656
1ea6e1db12 fix: fixed asset register showing opening entries
(cherry picked from commit c9d98eb4f0)
2025-10-10 05:44:27 +00:00
Rehan Ansari
0776b300e8 feat: add asset name to Asset Depreciations and Balances report
(cherry picked from commit b4cf6a1fb9)
2025-10-10 05:35:25 +00:00
rohitwaghchaure
c350e9dabd Merge pull request #49994 from frappe/mergify/bp/version-15-hotfix/pr-49991
fix: consider negative qty in batch qty calculation (backport #49991)
2025-10-09 22:45:02 +05:30
Rohit Waghchaure
4370a59183 fix: consider negative qty in batch qty calculation
(cherry picked from commit 912ffc2d64)
2025-10-09 15:23:47 +00:00
Frappe PR Bot
cc0a895760 chore(release): Bumped to Version 15.82.2
## [15.82.2](https://github.com/frappe/erpnext/compare/v15.82.1...v15.82.2) (2025-10-09)

### Bug Fixes

* Reset Raw Materials Table button not working ([00db37e](00db37e306))
* sales return for product bundle items ([2ea583e](2ea583ee16))
2025-10-09 12:31:16 +00:00
rohitwaghchaure
6ec370ad86 Merge pull request #49989 from frappe/mergify/bp/version-15/pr-49974
fix: Reset Raw Materials Table button not working (backport #49973) (backport #49974)
2025-10-09 17:59:42 +05:30
rohitwaghchaure
994f992fcf Merge pull request #49990 from frappe/mergify/bp/version-15/pr-49984
fix: sales return for product bundle items (backport #49975) (backport #49984)
2025-10-09 17:59:28 +05:30
rohitwaghchaure
3e816f6ea1 chore: fix conflicts
(cherry picked from commit 1fbc03c104)
2025-10-09 12:09:21 +00:00
Rohit Waghchaure
789cea9a85 test: test case for sales return for product bundle
(cherry picked from commit 1d57bbca11)

# Conflicts:
#	erpnext/stock/doctype/delivery_note/test_delivery_note.py
(cherry picked from commit 6ba55bbee0)
2025-10-09 12:09:21 +00:00
Rohit Waghchaure
2ea583ee16 fix: sales return for product bundle items
(cherry picked from commit 13ce7279a8)
(cherry picked from commit ac46b3d1ca)
2025-10-09 12:09:20 +00:00
rohitwaghchaure
1ab45386a8 Merge pull request #49984 from frappe/mergify/bp/version-15-hotfix/pr-49975
fix: sales return for product bundle items (backport #49975)
2025-10-09 17:38:55 +05:30
Rohit Waghchaure
00db37e306 fix: Reset Raw Materials Table button not working
(cherry picked from commit 128e243945)
(cherry picked from commit 81ed32ff51)
2025-10-09 12:06:21 +00:00
rohitwaghchaure
1fbc03c104 chore: fix conflicts 2025-10-09 17:21:03 +05:30
Rohit Waghchaure
6ba55bbee0 test: test case for sales return for product bundle
(cherry picked from commit 1d57bbca11)

# Conflicts:
#	erpnext/stock/doctype/delivery_note/test_delivery_note.py
2025-10-09 09:40:27 +00:00
Rohit Waghchaure
ac46b3d1ca fix: sales return for product bundle items
(cherry picked from commit 13ce7279a8)
2025-10-09 09:40:26 +00:00
rohitwaghchaure
6e55f53cf6 Merge pull request #49974 from frappe/mergify/bp/version-15-hotfix/pr-49973
fix: Reset Raw Materials Table button not working (backport #49973)
2025-10-08 23:45:42 +05:30
Rohit Waghchaure
81ed32ff51 fix: Reset Raw Materials Table button not working
(cherry picked from commit 128e243945)
2025-10-08 17:05:21 +00:00
Khushi Rawat
5d9c245ddd Merge pull request #49956 from frappe/mergify/bp/version-15-hotfix/pr-49954
fix(asset movement): clear custodian if not present (backport #49954)
2025-10-08 21:33:20 +05:30
Frappe PR Bot
c84952169f chore(release): Bumped to Version 15.82.1
## [15.82.1](https://github.com/frappe/erpnext/compare/v15.82.0...v15.82.1) (2025-10-08)

### Bug Fixes

* batch qty for expired batches ([4e2a42d](4e2a42d092))
* incorrect field valuation_rate ([9c3f4b6](9c3f4b69af))
2025-10-08 14:32:21 +00:00
rohitwaghchaure
d103409077 Merge pull request #49972 from frappe/mergify/bp/version-15/pr-49971
fix: batch qty for expired batches (backport #49967) (backport #49971)
2025-10-08 20:00:34 +05:30
rohitwaghchaure
d1dd3ca097 Merge pull request #49970 from frappe/mergify/bp/version-15/pr-49968
fix: incorrect field valuation_rate (backport #49966) (backport #49968)
2025-10-08 20:00:19 +05:30
Rohit Waghchaure
4e2a42d092 fix: batch qty for expired batches
(cherry picked from commit ff2faf36a7)
(cherry picked from commit f4816e4960)
2025-10-08 14:12:42 +00:00
rohitwaghchaure
fda021430d Merge pull request #49971 from frappe/mergify/bp/version-15-hotfix/pr-49967
fix: batch qty for expired batches (backport #49967)
2025-10-08 19:41:42 +05:30
Rohit Waghchaure
f4816e4960 fix: batch qty for expired batches
(cherry picked from commit ff2faf36a7)
2025-10-08 13:49:28 +00:00
Rohit Waghchaure
9c3f4b69af fix: incorrect field valuation_rate
(cherry picked from commit 630d873214)
(cherry picked from commit 93df11a0cf)
2025-10-08 13:38:13 +00:00
rohitwaghchaure
33f67012b4 Merge pull request #49968 from frappe/mergify/bp/version-15-hotfix/pr-49966
fix: incorrect field valuation_rate (backport #49966)
2025-10-08 19:07:29 +05:30
Rohit Waghchaure
93df11a0cf fix: incorrect field valuation_rate
(cherry picked from commit 630d873214)
2025-10-08 13:15:53 +00:00
Khushi Rawat
38e1ca1362 fix: resolve conflict 2025-10-08 12:53:25 +05:30
ravibharathi656
4ec5b28fd2 fix(asset movement): clear custodian if not present
(cherry picked from commit 323d8eaccd)

# Conflicts:
#	erpnext/assets/doctype/asset_movement/asset_movement.py
2025-10-08 07:05:10 +00:00
Frappe PR Bot
e2e1ac0dba chore(release): Bumped to Version 15.82.0
# [15.82.0](https://github.com/frappe/erpnext/compare/v15.81.3...v15.82.0) (2025-10-07)

### Bug Fixes

* **accounting:** ensure proper removal of advance references during unreconcillation ([825ccd3](825ccd3422))
* add default scrap warehouse in wo ([a5ed9fd](a5ed9fdc67))
* Add try-finally for setting buying price list ([e21baec](e21baec246))
* check is_rejected attribute ([bdf150b](bdf150bdf8))
* clear asset custodian  when asset take back from employee without assign to another employee ([f4cdb49](f4cdb49126))
* **Common Code:** fetch canonical URI from Code List (backport [#49882](https://github.com/frappe/erpnext/issues/49882)) ([#49884](https://github.com/frappe/erpnext/issues/49884)) ([2c0501b](2c0501b05f))
* delete column dynamically based on the naming by ([040873a](040873a442))
* do not consider draft bundles ([75323fd](75323fda01))
* do not fetch disabled item tax template ([c42dcbe](c42dcbe739))
* exclude opening entries ([ed1c270](ed1c270398))
* failing patch ([0dad195](0dad1957c8))
* get unconsumed qty as per BOM qty ([82386b1](82386b18aa))
* linter; dont change doc after DB update ([#49907](https://github.com/frappe/erpnext/issues/49907)) ([6c47353](6c47353205))
* **manufacturing:** prevent KeyError in BOM Creator when sub-assembly reused ([07c3755](07c3755f31))
* optimize SQL query by adding index on batch ([a83331b](a83331bd2f))
* **profit and loss statement:** incorrect total calculation ([e132c45](e132c457f2))
* remove allow_on_submit for pick list items ([4ccdede](4ccdedeb12))
* resolved conflict ([a39bc62](a39bc626c7))
* retain shipping address in doc ([20c21a4](20c21a4dc0))
* set fg_completed_qty based upon fg item qty ([b6d57ff](b6d57ff8a5))
* Set paid amount automatically only if return entry validated and has negative grand total ([#49829](https://github.com/frappe/erpnext/issues/49829)) ([bd3503a](bd3503a3d8))
* SQL operator precedence in Project query customer filter ([d950de2](d950de2d09))
* **subscription:** include days before ([f27b754](f27b754570))
* too many writes on patch run ([a2bf53f](a2bf53ff0a))
* use item valuation rate if no bin ([a4b5a74](a4b5a74644))
* validate transfer_qty based on overproduction wo percentage ([7ce97ce](7ce97ce0c2))
* warning message if the batch has incorrect qty ([3f3fd20](3f3fd20b31))

### Features

* allow fallback to default selling price list (backport [#49634](https://github.com/frappe/erpnext/issues/49634)) ([#49704](https://github.com/frappe/erpnext/issues/49704)) ([95387b4](95387b4bf0))
* dynamic due date in payment terms when fetched from order (backport [#48864](https://github.com/frappe/erpnext/issues/48864)) ([#49938](https://github.com/frappe/erpnext/issues/49938)) ([baa6d2b](baa6d2bcdc))
* recalculate batch qty ([d49b64d](d49b64dc7c))
* validating asset scrap date ([#43093](https://github.com/frappe/erpnext/issues/43093)) ([0eb76f4](0eb76f4d2c))

### Performance Improvements

* serial nos / batches reposting ([8a310ef](8a310efc97))
2025-10-07 13:23:00 +00:00
ruthra kumar
b557a03ba7 Merge pull request #49942 from frappe/version-15-hotfix
chore: release v15
2025-10-07 18:51:39 +05:30
mergify[bot]
11eab0c852 Merge pull request #49946 from frappe/mergify/bp/version-15-hotfix/pr-49721
feat: add company links to Email Account and Communication (backport #49721)
2025-10-07 17:01:37 +05:30
rohitwaghchaure
8683f49e8b Merge pull request #49945 from frappe/mergify/bp/version-15-hotfix/pr-49935
refactor: old serial nos filter (backport #49935)
2025-10-07 16:29:16 +05:30
rohitwaghchaure
6ea07ba56d chore: fix conflicts 2025-10-07 16:02:30 +05:30
Rohit Waghchaure
e02a55b188 refactor: old serial nos filter
(cherry picked from commit 6a8bd0ae9e)

# Conflicts:
#	erpnext/stock/deprecated_serial_batch.py
2025-10-07 09:52:27 +00:00
mergify[bot]
baa6d2bcdc feat: dynamic due date in payment terms when fetched from order (backport #48864) (#49938)
* feat: dynamic due date in payment terms when fetched from order (#48864)

* fix: dynamic due date when payment terms are fetched from order

* fix(test): use change_settings decorator for settings enable and disable

* fix(test): compare schedule for due_date dynamically

* fix: save conditions for due date at invoice level

* fix: make fields read only and on change of date unset the date condition fields

* fix: remove fetch_form

* fix: correct field assingment

* fix: revert unwanted changes

* refactor: streamline payment term field assignments and enhance discount date handling

* refactor: remove payment_term from fields_to_copy and optimize currency handling in transaction callback

* refactor: ensure default values for payment schedule and discount validity fields

(cherry picked from commit 3c70cbbaf8)

# Conflicts:
#	erpnext/public/js/controllers/transaction.js
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py

* chore: resolve conflicts

---------

Co-authored-by: Lakshit Jain <ljain112@gmail.com>
2025-10-07 14:10:15 +05:30
rohitwaghchaure
631ffd55ef Merge pull request #49934 from frappe/mergify/bp/version-15-hotfix/pr-49846
chore(Stock Qty vs Serial No Count): add show_disabled_items filter (backport #49846)
2025-10-07 11:49:20 +05:30
rethik
7a457dafe0 chore: add show_disabled_items filter to show both enabled and disabled items
(cherry picked from commit bf5f24c0e0)
2025-10-07 05:59:36 +00:00
rohitwaghchaure
94a5867303 Merge pull request #49933 from frappe/mergify/bp/version-15-hotfix/pr-49762
fix(manufacturing): prevent KeyError in BOM Creator when sub-assembly reused (backport #49762)
2025-10-07 11:23:12 +05:30
rohitwaghchaure
1663b875c0 Merge pull request #49932 from frappe/mergify/bp/version-15-hotfix/pr-49702
fix: do not fetch disabled item tax template (backport #49702)
2025-10-07 11:22:57 +05:30
ljain112
d47f3cc101 chore: resolve conflicts 2025-10-07 11:01:47 +05:30
KerollesFathy
07c3755f31 fix(manufacturing): prevent KeyError in BOM Creator when sub-assembly reused
Ensure missing (fg_item, fg_reference_id) keys are initialized in
production_item_wise_rm before appending items. This avoids crashes
when the same sub-assembly is referenced under multiple parents.

(cherry picked from commit 4f8b2e520a)
2025-10-07 05:27:18 +00:00
ljain112
c42dcbe739 fix: do not fetch disabled item tax template
(cherry picked from commit b10cf4a928)

# Conflicts:
#	erpnext/public/js/controllers/transaction.js
#	erpnext/stock/get_item_details.py
2025-10-07 05:26:09 +00:00
rohitwaghchaure
233fe9b7e6 Merge pull request #49929 from frappe/mergify/bp/version-15-hotfix/pr-49928
fix: warning message if the batch has incorrect qty (backport #49928)
2025-10-07 10:42:23 +05:30
Rohit Waghchaure
3f3fd20b31 fix: warning message if the batch has incorrect qty
(cherry picked from commit 870181de87)
2025-10-07 04:50:35 +00:00
ruthra kumar
f84a6c0d3a Merge pull request #49927 from frappe/mergify/bp/version-15-hotfix/pr-49743
fix: use valuation_rate from item master if no bin is present (backport #49743)
2025-10-07 10:03:27 +05:30
ruthra kumar
5c9c17c649 Merge pull request #49925 from frappe/mergify/bp/version-15-hotfix/pr-49870
fix: show asset value as revaluation amount or gross purchase amount (backport #49870)
2025-10-07 10:02:28 +05:30
ravibharathi656
a4b5a74644 fix: use item valuation rate if no bin
(cherry picked from commit 23b1b7ee04)
2025-10-07 04:13:26 +00:00
l0gesh29
ed1c270398 fix: exclude opening entries
(cherry picked from commit 3773f56b0b)
2025-10-06 21:40:58 +00:00
rohitwaghchaure
56d04761f8 Merge pull request #49924 from frappe/mergify/bp/version-15-hotfix/pr-49923
feat: recalculate batch qty (backport #49923)
2025-10-06 22:33:22 +05:30
Rohit Waghchaure
d49b64dc7c feat: recalculate batch qty
(cherry picked from commit 70117d3b06)
2025-10-06 16:30:14 +00:00
Frappe PR Bot
42b43b372a chore(release): Bumped to Version 15.81.3
## [15.81.3](https://github.com/frappe/erpnext/compare/v15.81.2...v15.81.3) (2025-10-06)

### Bug Fixes

* check is_rejected attribute ([b017f07](b017f07343))
* do not consider draft bundles ([92afae7](92afae7185))
2025-10-06 14:45:22 +00:00
rohitwaghchaure
4dae4b987e Merge pull request #49922 from frappe/mergify/bp/version-15/pr-49918
fix: check is_rejected attribute (backport #49913) (backport #49918)
2025-10-06 20:13:46 +05:30
rohitwaghchaure
54e672e078 Merge pull request #49921 from frappe/mergify/bp/version-15/pr-49919
fix: do not consider draft bundles (backport #49917) (backport #49919)
2025-10-06 20:13:38 +05:30
rohitwaghchaure
62a09a3cb0 Merge pull request #49920 from frappe/mergify/bp/version-15-hotfix/pr-49890
perf: serial nos / batches reposting (backport #49890)
2025-10-06 19:58:25 +05:30
Kavin
b017f07343 fix: check is_rejected attribute
(cherry picked from commit 2ac2e02b2f)
(cherry picked from commit bdf150bdf8)
2025-10-06 14:25:55 +00:00
Rohit Waghchaure
92afae7185 fix: do not consider draft bundles
(cherry picked from commit a60f7eaf3a)
(cherry picked from commit 75323fda01)
2025-10-06 14:25:46 +00:00
rohitwaghchaure
eb9d656b8f Merge pull request #49918 from frappe/mergify/bp/version-15-hotfix/pr-49913
fix: check is_rejected attribute (backport #49913)
2025-10-06 19:54:59 +05:30
rohitwaghchaure
7ddf63faa8 Merge pull request #49919 from frappe/mergify/bp/version-15-hotfix/pr-49917
fix: do not consider draft bundles (backport #49917)
2025-10-06 19:54:51 +05:30
Rohit Waghchaure
8a310efc97 perf: serial nos / batches reposting
(cherry picked from commit acb3ef78a7)
2025-10-06 14:11:43 +00:00
Kavin
bdf150bdf8 fix: check is_rejected attribute
(cherry picked from commit 2ac2e02b2f)
2025-10-06 14:08:30 +00:00
Rohit Waghchaure
75323fda01 fix: do not consider draft bundles
(cherry picked from commit a60f7eaf3a)
2025-10-06 14:08:30 +00:00
ruthra kumar
f94f628884 Merge pull request #49912 from frappe/mergify/bp/version-15-hotfix/pr-49600
fix(profit and loss statement): incorrect total calculation (backport #49600)
2025-10-06 17:27:55 +05:30
ravibharathi656
e132c457f2 fix(profit and loss statement): incorrect total calculation
(cherry picked from commit b7c6d8e2a6)
2025-10-06 11:40:38 +00:00
ruthra kumar
048d6f6942 Merge pull request #49908 from frappe/mergify/bp/version-15-hotfix/pr-49635
fix(subscription): include days before (backport #49635)
2025-10-06 15:39:59 +05:30
Raffael Meyer
6c47353205 fix: linter; dont change doc after DB update (#49907)
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2025-10-06 10:02:05 +00:00
ravibharathi656
4f067085e7 test: add invoice generation before period with prorate
(cherry picked from commit b452e06b82)
2025-10-06 09:52:07 +00:00
ravibharathi656
3fcbb10155 refactor(subscription): default prorate 0
(cherry picked from commit eda1dae882)
2025-10-06 09:52:07 +00:00
ravibharathi656
f27b754570 fix(subscription): include days before
(cherry picked from commit 9164162a9e)
2025-10-06 09:52:06 +00:00
mergify[bot]
95387b4bf0 feat: allow fallback to default selling price list (backport #49634) (#49704)
Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Henning Wendtland <156231187+HenningWendtland@users.noreply.github.com>
2025-10-06 11:49:40 +02:00
ruthra kumar
7f2d26ec20 Merge pull request #49900 from frappe/mergify/bp/version-15-hotfix/pr-49852
fix: SQL operator precedence in Project query customer filter (backport #49852)
2025-10-06 13:21:58 +05:30
Fawaz Alhafiz
d950de2d09 fix: SQL operator precedence in Project query customer filter
Added explicit parentheses around customer OR conditions in get_project_name()
to ensure proper grouping with AND filters. Without these parentheses, SQL
operator precedence caused the status filter to be bypassed when a customer
filter was applied, resulting in completed and cancelled projects appearing
in link field dropdowns.

Before:
WHERE customer='X' OR customer IS NULL OR customer='' AND status NOT IN (...)
was interpreted as:
WHERE customer='X' OR customer IS NULL OR (customer='' AND status NOT IN (...))

After:
WHERE (customer='X' OR customer IS NULL OR customer='') AND status NOT IN (...)

Fixes: Completed/cancelled projects showing in Project link fields
Affected: Any doctype using Project link fields with customer filters
(cherry picked from commit 0ec30a1cea)
2025-10-06 07:34:55 +00:00
ruthra kumar
5d8a368ad2 Merge pull request #49893 from frappe/mergify/bp/version-15-hotfix/pr-49829
fix: Set paid amount automatically only if return entry validated and has negative grand total (backport #49829)
2025-10-06 12:58:33 +05:30
ruthra kumar
615a5fa5ba Merge pull request #49898 from frappe/mergify/bp/version-15-hotfix/pr-49865
fix: delete column dynamically based on the naming by (backport #49865)
2025-10-06 12:51:23 +05:30
ruthra kumar
823cdf211d Merge pull request #49894 from frappe/mergify/bp/version-15-hotfix/pr-49871
fix: retain shipping address in doc (backport #49871)
2025-10-06 12:37:21 +05:30
ravibharathi656
20c21a4dc0 fix: retain shipping address in doc
(cherry picked from commit 039f5e6143)

# Conflicts:
#	erpnext/public/js/controllers/buying.js
2025-10-06 12:35:21 +05:30
l0gesh29
040873a442 fix: delete column dynamically based on the naming by
(cherry picked from commit 4f503ac7f6)
2025-10-06 07:05:04 +00:00
Nabin Hait
a39bc626c7 fix: resolved conflict 2025-10-06 12:17:57 +05:30
Nabin Hait
bd3503a3d8 fix: Set paid amount automatically only if return entry validated and has negative grand total (#49829)
(cherry picked from commit dcbcc596f2)

# Conflicts:
#	erpnext/public/js/controllers/taxes_and_totals.js
2025-10-06 05:58:29 +00:00
Frappe PR Bot
161c1fb7a4 chore(release): Bumped to Version 15.81.2
## [15.81.2](https://github.com/frappe/erpnext/compare/v15.81.1...v15.81.2) (2025-10-06)

### Bug Fixes

* failing patch ([65061cc](65061cc459))
2025-10-06 03:54:42 +00:00
ruthra kumar
4d506d2d9c Merge pull request #49873 from frappe/mergify/bp/version-15/pr-49868
fix: failing patch (backport #49867) (backport #49868)
2025-10-06 09:23:17 +05:30
ruthra kumar
04abc6b5e5 Merge pull request #49877 from frappe/mergify/bp/version-15-hotfix/pr-49872
fix: remove allow_on_submit for pick list items (backport #49872)
2025-10-06 09:21:33 +05:30
mergify[bot]
2c0501b05f fix(Common Code): fetch canonical URI from Code List (backport #49882) (#49884)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
fix(Common Code): fetch canonical URI from Code List (#49882)
2025-10-04 19:22:28 +02:00
rohitwaghchaure
7b484de0a9 Merge pull request #49878 from frappe/mergify/bp/version-15-hotfix/pr-49876
fix: optimize SQL query by adding index on batch (backport #49876)
2025-10-04 13:18:07 +05:30
Rohit Waghchaure
a83331bd2f fix: optimize SQL query by adding index on batch
(cherry picked from commit 8756f91857)
2025-10-04 05:30:10 +00:00
Kavin
4ccdedeb12 fix: remove allow_on_submit for pick list items
(cherry picked from commit da716b824f)
2025-10-04 04:36:08 +00:00
Mihir Kandoi
65061cc459 fix: failing patch
(cherry picked from commit 41d1703e7c)
(cherry picked from commit 0dad1957c8)
2025-10-03 19:04:15 +00:00
Mihir Kandoi
fe0739aadf Merge pull request #49868 from frappe/mergify/bp/version-15-hotfix/pr-49867
fix: failing patch (backport #49867)
2025-10-04 00:33:18 +05:30
Mihir Kandoi
0dad1957c8 fix: failing patch
(cherry picked from commit 41d1703e7c)
2025-10-03 10:02:09 +00:00
rohitwaghchaure
bf39ae6db0 Merge pull request #49856 from frappe/mergify/bp/version-15-hotfix/pr-49806
fix: validate transfer_qty based on overproduction wo percentage (backport #49806)
2025-10-02 22:43:52 +05:30
Khushi Rawat
09bcff13ad Merge pull request #49522 from KerollesFathy/clear-custodian-when-asset-take-backed
fix: clear asset custodian when asset take back from employee without assign to another employee
2025-10-02 22:16:35 +05:30
rohitwaghchaure
b91fb6b280 Merge pull request #49855 from frappe/mergify/bp/version-15-hotfix/pr-49850
fix: add default scrap warehouse in wo (backport #49850)
2025-10-02 20:22:20 +05:30
Kavin
0fec34e886 test: test overproduction allowed qty in wo
(cherry picked from commit b527d38bfa)
2025-10-02 14:36:24 +00:00
Kavin
b6d57ff8a5 fix: set fg_completed_qty based upon fg item qty
(cherry picked from commit 526b850e61)
2025-10-02 14:36:24 +00:00
Kavin
7ce97ce0c2 fix: validate transfer_qty based on overproduction wo percentage
(cherry picked from commit 4024d8846b)
2025-10-02 14:36:23 +00:00
Kavin
a5ed9fdc67 fix: add default scrap warehouse in wo
(cherry picked from commit 7e51346946)
2025-10-02 14:35:22 +00:00
mergify[bot]
5e5850d89a refactor(Supplier): custom buttons call make methods (backport #49840) (#49842)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-10-02 00:16:34 +02:00
Diptanil Saha
56aa86f77e Merge pull request #49839 from diptanilsaha/backport_49496
fix(Accounts Payable Summary): add a missing translate function (backport #49496)
2025-10-02 00:24:42 +05:30
Diptanil Saha
f321725b49 Merge pull request #49496 from elshafei-developer/Add-a-missing-translate-function
fix(Accounts Payable Summary): add a missing translate function
2025-10-02 00:07:06 +05:30
Diptanil Saha
4e3697284e Merge pull request #49838 from diptanilsaha/backport_49820
fix: financial ratios translation and pdf export error (backport #49820)
2025-10-01 23:57:09 +05:30
Frappe PR Bot
4c1cada222 chore(release): Bumped to Version 15.81.1
## [15.81.1](https://github.com/frappe/erpnext/compare/v15.81.0...v15.81.1) (2025-10-01)

### Bug Fixes

* Add try-finally for setting buying price list ([e10ed89](e10ed89be5))
* too many writes on patch run ([c455e73](c455e7390e))
2025-10-01 14:55:26 +00:00
Mihir Kandoi
8bb19eece4 Merge pull request #49835 from frappe/mergify/bp/version-15/pr-49833
fix: too many writes on patch run (backport #49832) (backport #49833)
2025-10-01 20:23:45 +05:30
Mihir Kandoi
e10ed89be5 fix: Add try-finally for setting buying price list
(cherry picked from commit 35a8d02866)
(cherry picked from commit e21baec246)
2025-10-01 13:44:41 +00:00
Mihir Kandoi
c455e7390e fix: too many writes on patch run
(cherry picked from commit 44ff6ed6a1)
(cherry picked from commit a2bf53ff0a)
2025-10-01 13:44:41 +00:00
Mihir Kandoi
3f9fbb7b75 Merge pull request #49833 from frappe/mergify/bp/version-15-hotfix/pr-49832 2025-10-01 19:13:21 +05:30
Mihir Kandoi
e21baec246 fix: Add try-finally for setting buying price list
(cherry picked from commit 35a8d02866)
2025-10-01 13:27:40 +00:00
Mihir Kandoi
a2bf53ff0a fix: too many writes on patch run
(cherry picked from commit 44ff6ed6a1)
2025-10-01 13:27:40 +00:00
ruthra kumar
06cd48feaa Merge pull request #49823 from frappe/mergify/bp/version-15-hotfix/pr-49689
fix(accounting): ensure proper removal of advance references during u… (backport #49689)
2025-10-01 12:56:19 +05:30
Pandiyan P
825ccd3422 fix(accounting): ensure proper removal of advance references during unreconcillation
(cherry picked from commit a7ec01bf21)
2025-10-01 06:40:55 +00:00
rohitwaghchaure
c56da286f7 Merge pull request #49811 from frappe/mergify/bp/version-15-hotfix/pr-49750
fix: get unconsumed qty as per BOM required qty (backport #49750)
2025-09-30 22:19:55 +05:30
Khushi Rawat
a7577d428f Merge pull request #49817 from khushi8112/backport-v15-pr-43093
feat: validating asset scrap date (backport #43093)
2025-09-30 21:23:26 +05:30
Khushi Rawat
e81b85b241 chore: resolve conflict 2025-09-30 21:02:39 +05:30
rahulgupta8848
0eb76f4d2c feat: validating asset scrap date (#43093)
* feat: validating asset scrap date

* refactor: refactorization of scrap asset function

---------

Co-authored-by: “rahulgupta8848” <“rahul.gupta@8848digital.com”>
(cherry picked from commit e07bc5af41)

# Conflicts:
#	erpnext/assets/doctype/asset/asset.js
2025-09-30 21:02:15 +05:30
Frappe PR Bot
24013ddf27 chore(release): Bumped to Version 15.81.0
# [15.81.0](https://github.com/frappe/erpnext/compare/v15.80.1...v15.81.0) (2025-09-30)

### Bug Fixes

* add date filter for getting return invoice items ([bc77704](bc77704462))
* auto batch not set for raw materials in subcontracting receipt ([6c8e838](6c8e8384d5))
* **bank transaction:** change reference number to small text ([5a0bf7a](5a0bf7a5e1))
* convert with flt ([3975627](3975627b33))
* do not validate cost center in cancelled gl entry ([366bb82](366bb8269c))
* don't recalculate stock_qty with conversion_factor ([c88a277](c88a277ad9))
* include precision in validation ([abffbca](abffbcad99))
* **payment entry:** trigger currency on account set ([84a2596](84a2596ce5))
* remove item name to avoid overriding item row name ([d0e511f](d0e511fd2f))
* set cost center in taxes if not set ([4dcd502](4dcd502b76))
* **stock entry:** set expense account from company for manufacture ([50f9521](50f9521feb))
* update item details only in draft state ([30f6b53](30f6b53240))
* update subcontracted_quantity with set_value ([17e415d](17e415d03a))
* use get_value instead of get_doc ([f706811](f706811757))
* use sales_order from data instead of doc ([7ee8281](7ee82813fd))
* use stock adjustment account  if no expense account ([9c81f44](9c81f448c8))
* valuation rate for old batch ([37a03f1](37a03f10ab))

### Features

* add show zero value filter in profit and loss and balance sheet ([c32ad97](c32ad9711f))
* service expense account in the subcontracting receipt ([ba9b63a](ba9b63af49))

### Performance Improvements

* reposting for backdated transactions ([cd5a836](cd5a836685))
2025-09-30 13:28:59 +00:00
ruthra kumar
e8ee5f8c9b Merge pull request #49801 from frappe/version-15-hotfix
chore: release v15
2025-09-30 18:56:45 +05:30
rohitwaghchaure
0fb5f75e93 chore: fix conflicts
Removed the test for additional material transfer in work orders.
2025-09-30 18:43:38 +05:30
rohitwaghchaure
4847e24553 Merge branch 'version-15' into version-15-hotfix 2025-09-30 18:38:20 +05:30
Kavin
f548f0b231 test: required_qty clamping in manufacture entry
(cherry picked from commit 34d2c8d9c2)

# Conflicts:
#	erpnext/manufacturing/doctype/work_order/test_work_order.py
2025-09-30 12:28:34 +00:00
Kavin
82386b18aa fix: get unconsumed qty as per BOM qty
(cherry picked from commit cf4b395ee3)
2025-09-30 12:28:33 +00:00
rohitwaghchaure
bbbcb456ce Merge pull request #49810 from frappe/mergify/bp/version-15-hotfix/pr-49803
fix: valuation rate for old batch (backport #49803)
2025-09-30 17:50:13 +05:30
rohitwaghchaure
4c78f9b9cb Merge pull request #49807 from frappe/mergify/bp/version-15-hotfix/pr-49794
fix: don't recalculate stock_qty with conversion_factor (backport #49794)
2025-09-30 17:12:18 +05:30
Rohit Waghchaure
37a03f10ab fix: valuation rate for old batch
(cherry picked from commit d864d166f9)
2025-09-30 11:42:15 +00:00
rohitwaghchaure
c2dd37a89e Merge pull request #49808 from frappe/mergify/bp/version-15-hotfix/pr-49766
fix: use sales_order from data instead of doc (backport #49766)
2025-09-30 17:12:07 +05:30
rohitwaghchaure
f458faa819 Merge pull request #49809 from frappe/mergify/bp/version-15-hotfix/pr-49748
fix: update item details only in draft state (backport #49748)
2025-09-30 17:11:56 +05:30
Kavin
30f6b53240 fix: update item details only in draft state
(cherry picked from commit 689172ff22)
2025-09-30 11:08:59 +00:00
Kavin
7ee82813fd fix: use sales_order from data instead of doc
(cherry picked from commit 9f9120451b)
2025-09-30 11:06:48 +00:00
Kavin
c88a277ad9 fix: don't recalculate stock_qty with conversion_factor
(cherry picked from commit fed8236919)
2025-09-30 11:03:47 +00:00
rohitwaghchaure
9e73d083b5 Merge pull request #49793 from frappe/mergify/bp/version-15-hotfix/pr-49790
fix: update subcontracted_quantity with set_value (backport #49790)
2025-09-30 16:32:13 +05:30
rohitwaghchaure
03c8d92796 Merge pull request #49792 from frappe/mergify/bp/version-15-hotfix/pr-49791
refactor: convert item warehouse based reposting (backport #49791)
2025-09-30 16:31:57 +05:30
ruthra kumar
31ad9a6346 Merge pull request #49805 from frappe/mergify/bp/version-15-hotfix/pr-49639
fix(Credit-limit): consider current voucher for credit limit validation (backport #49639)
2025-09-30 16:30:17 +05:30
PRASATHRAJA
fc40a3c376 Merge pull request #49639 from aerele/credit-limit-jv
fix(Credit-limit): consider current voucher for credit limit validation

(cherry picked from commit 4a01c53cca)
2025-09-30 10:39:35 +00:00
ruthra kumar
b8e3db0179 Merge pull request #49800 from frappe/mergify/bp/version-15-hotfix/pr-49799
fix: do not validate cost center in cancelled gl entry (backport #49799)
2025-09-30 15:14:11 +05:30
ljain112
366bb8269c fix: do not validate cost center in cancelled gl entry
(cherry picked from commit 29cbddbc77)
2025-09-30 09:04:24 +00:00
venkat102
3975627b33 fix: convert with flt
(cherry picked from commit 81614939ab)
2025-09-29 16:20:27 +00:00
venkat102
f706811757 fix: use get_value instead of get_doc
(cherry picked from commit 89a603f20c)
2025-09-29 16:20:26 +00:00
venkat102
17e415d03a fix: update subcontracted_quantity with set_value
(cherry picked from commit ea63bfc9af)
2025-09-29 16:20:26 +00:00
Rohit Waghchaure
8911bad792 refactor: convert item-wh based reposting
(cherry picked from commit 8411e4c5b2)
2025-09-29 16:20:25 +00:00
ruthra kumar
a30c481ca1 Merge pull request #49787 from frappe/mergify/bp/version-15-hotfix/pr-49773
fix(bank transaction): change reference number to small text (backport #49773)
2025-09-29 17:15:06 +05:30
ravibharathi656
5a0bf7a5e1 fix(bank transaction): change reference number to small text
(cherry picked from commit 90f399d0fc)

# Conflicts:
#	erpnext/accounts/doctype/bank_transaction/bank_transaction.json
2025-09-29 16:59:31 +05:30
ruthra kumar
f135954944 Merge pull request #49784 from frappe/mergify/bp/version-15-hotfix/pr-49708
feat: add show zero value filter in profit and loss and balance sheet (backport #49708)
2025-09-29 16:47:54 +05:30
ravibharathi656
c32ad9711f feat: add show zero value filter in profit and loss and balance sheet
(cherry picked from commit 33ab24943c)

# Conflicts:
#	erpnext/accounts/report/balance_sheet/balance_sheet.js
#	erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.js
2025-09-29 16:32:21 +05:30
ruthra kumar
f6842041c9 Merge pull request #49782 from frappe/mergify/bp/version-15-hotfix/pr-49718
fix: set cost center in taxes if not set (backport #49718)
2025-09-29 16:26:35 +05:30
ravibharathi656
4dcd502b76 fix: set cost center in taxes if not set
(cherry picked from commit b75940bf0e)

# Conflicts:
#	erpnext/public/js/controllers/transaction.js
2025-09-29 15:53:19 +05:30
ruthra kumar
19f81c9204 Merge pull request #49777 from frappe/mergify/bp/version-15-hotfix/pr-49735
fix(payment entry): trigger currency on account set (backport #49735)
2025-09-29 14:56:14 +05:30
ruthra kumar
67b6b3779d Merge pull request #49775 from frappe/mergify/bp/version-15-hotfix/pr-49618
fix: add date filter for getting return invoice items (backport #49618)
2025-09-29 14:31:45 +05:30
ruthra kumar
c836016358 Merge pull request #49774 from frappe/mergify/bp/version-15-hotfix/pr-49640
fix: include precision in validation (backport #49640)
2025-09-29 14:29:45 +05:30
ravibharathi656
84a2596ce5 fix(payment entry): trigger currency on account set
(cherry picked from commit 096e74b1ee)
2025-09-29 08:58:03 +00:00
Navin-S-R
98bc7b41fc test: validate profit values for later period returns
(cherry picked from commit d5c457b8c5)

# Conflicts:
#	erpnext/accounts/report/gross_profit/test_gross_profit.py
2025-09-29 14:16:52 +05:30
l0gesh29
abffbcad99 fix: include precision in validation
(cherry picked from commit 1de0c46c51)
2025-09-29 08:44:29 +00:00
Navin-S-R
bc77704462 fix: add date filter for getting return invoice items
(cherry picked from commit 2abb011816)
2025-09-29 08:44:28 +00:00
rohitwaghchaure
5abb2d510d Merge pull request #49772 from frappe/mergify/bp/version-15-hotfix/pr-49770
chore: removed print statement (backport #49770)
2025-09-29 13:06:44 +05:30
Rohit Waghchaure
ae040024af chore: removed print statement
(cherry picked from commit 324bdcb177)
2025-09-29 06:32:32 +00:00
rohitwaghchaure
fe1247dd4b Merge pull request #49758 from frappe/mergify/bp/version-15-hotfix/pr-49757
feat: service expense account in the subcontracting receipt (backport #49757)
2025-09-27 10:20:23 +05:30
rohitwaghchaure
84789daf59 Merge pull request #49756 from frappe/mergify/bp/version-15-hotfix/pr-49741
fix(stock entry): set expense account from company for manufacture (backport #49741)
2025-09-27 10:04:06 +05:30
rohitwaghchaure
cecd177286 chore: fix conflicts
Removed fields related to job card and landed cost voucher amount from subcontracting receipt item.
2025-09-27 10:03:27 +05:30
rohitwaghchaure
c26ed80d67 chore: fix conflicts 2025-09-27 10:02:40 +05:30
rohitwaghchaure
15f0c28cda chore: fix conflicts 2025-09-27 10:01:53 +05:30
Rohit Waghchaure
ba9b63af49 feat: service expense account in the subcontracting receipt
(cherry picked from commit 6e597b9c42)

# Conflicts:
#	erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.py
#	erpnext/subcontracting/doctype/subcontracting_receipt/test_subcontracting_receipt.py
#	erpnext/subcontracting/doctype/subcontracting_receipt_item/subcontracting_receipt_item.json
2025-09-26 15:44:26 +00:00
ravibharathi656
9c81f448c8 fix: use stock adjustment account if no expense account
(cherry picked from commit b2e109318f)
2025-09-26 13:28:43 +00:00
ravibharathi656
50f9521feb fix(stock entry): set expense account from company for manufacture
(cherry picked from commit 06177ffaff)
2025-09-26 13:28:43 +00:00
ruthra kumar
0ff32ac554 Merge pull request #49738 from frappe/mergify/bp/version-15-hotfix/pr-49717
refactor: improve trial balance performance (backport #49717)
2025-09-26 11:58:26 +05:30
rohitwaghchaure
fe72ea6d6b Merge pull request #49739 from frappe/mergify/bp/version-15-hotfix/pr-49734
fix: auto batch not set for raw materials in subcontracting receipt (backport #49734)
2025-09-26 11:43:04 +05:30
rohitwaghchaure
62959e5a70 chore: fix conflicts 2025-09-26 11:21:16 +05:30
Rohit Waghchaure
6c8e8384d5 fix: auto batch not set for raw materials in subcontracting receipt
(cherry picked from commit 23f9d4c600)

# Conflicts:
#	erpnext/controllers/subcontracting_controller.py
2025-09-26 05:07:12 +00:00
ruthra kumar
0c8004530a refactor: improve trial balance performance
(cherry picked from commit cee3813ced)
2025-09-26 04:46:00 +00:00
Raffael Meyer
b18afa8bdd chore(Bank Guarante): move to leaner doctype definition (#49737) 2025-09-25 22:05:59 +00:00
Frappe PR Bot
f54933e657 chore(release): Bumped to Version 15.80.1
## [15.80.1](https://github.com/frappe/erpnext/compare/v15.80.0...v15.80.1) (2025-09-25)

### Bug Fixes

* remove item name to avoid overriding item row name ([a80e0d9](a80e0d9d39))

### Performance Improvements

* reposting for backdated transactions ([f43fac5](f43fac50ed))
2025-09-25 15:14:17 +00:00
rohitwaghchaure
a1862020e8 Merge pull request #49732 from frappe/mergify/bp/version-15/pr-49728
fix: remove item name in get_item_details (backport #49725) (backport #49728)
2025-09-25 20:42:44 +05:30
rohitwaghchaure
249d6b3619 Merge pull request #49729 from frappe/mergify/bp/version-15/pr-49724
perf: reposting for backdated transactions (backport #49720) (backport #49724)
2025-09-25 20:42:35 +05:30
Kavin
a80e0d9d39 fix: remove item name to avoid overriding item row name
(cherry picked from commit 47055901c0)
(cherry picked from commit d0e511fd2f)
2025-09-25 14:23:33 +00:00
rohitwaghchaure
6b3bb45900 Merge pull request #49728 from frappe/mergify/bp/version-15-hotfix/pr-49725
fix: remove item name in get_item_details (backport #49725)
2025-09-25 19:52:28 +05:30
Rohit Waghchaure
f43fac50ed perf: reposting for backdated transactions
(cherry picked from commit 1b0fc0541b)
(cherry picked from commit cd5a836685)
2025-09-25 13:23:30 +00:00
Kavin
d0e511fd2f fix: remove item name to avoid overriding item row name
(cherry picked from commit 47055901c0)
2025-09-25 13:23:29 +00:00
rohitwaghchaure
d50538dbf7 Merge pull request #49724 from frappe/mergify/bp/version-15-hotfix/pr-49720
perf: reposting for backdated transactions (backport #49720)
2025-09-25 18:52:32 +05:30
Rohit Waghchaure
cd5a836685 perf: reposting for backdated transactions
(cherry picked from commit 1b0fc0541b)
2025-09-25 12:16:41 +00:00
Frappe PR Bot
05d5dc5321 chore(release): Bumped to Version 15.80.0
# [15.80.0](https://github.com/frappe/erpnext/compare/v15.79.2...v15.80.0) (2025-09-23)

### Bug Fixes

* **accounts receivable:** exclude employee transactions ([c071107](c071107b27))
* **accounts:** dynamic zero cutoff (backport [#48899](https://github.com/frappe/erpnext/issues/48899)) ([#49552](https://github.com/frappe/erpnext/issues/49552)) ([5ef7a78](5ef7a7857c))
* add condition for name ([65ce737](65ce737c2d))
* add option for currency field (backport [#49572](https://github.com/frappe/erpnext/issues/49572)) ([#49594](https://github.com/frappe/erpnext/issues/49594)) ([1a4ea07](1a4ea07b78))
* auto commit if too many writes reached ([0310172](0310172338))
* Consider non SABB batch qty in reserved batch validation ([7ed97e4](7ed97e47cc))
* incorrect current qty calculation for the batch ([bf48cf0](bf48cf02e5))
* **item:** avoid inheriting item defaults from identically named items ([#49571](https://github.com/frappe/erpnext/issues/49571)) ([9e58a56](9e58a56b5c))
* only show filters in print view if 'Include filters' is enabled ([79d4731](79d4731fe7))
* **payment-reconciliation:** apply field precision for allocated and difference amounts (backport [#49448](https://github.com/frappe/erpnext/issues/49448)) ([#49595](https://github.com/frappe/erpnext/issues/49595)) ([fbd62e7](fbd62e72f9))
* project accounting dimension and gl posting date column width (backport [#49563](https://github.com/frappe/erpnext/issues/49563)) ([#49591](https://github.com/frappe/erpnext/issues/49591)) ([bce22cb](bce22cb27b))
* **purchase order:** get party type based on supplier field ([3aebbf6](3aebbf6e92))
* restore auto_commit_on_many_writes flag ([5320782](53207821aa))
* set first_response_time on status change of issue ([0d5613c](0d5613ca4c))
* skip receivable/payable account validation in payroll entry if party is not available (backport [#49585](https://github.com/frappe/erpnext/issues/49585)) ([#49598](https://github.com/frappe/erpnext/issues/49598)) ([697f6ef](697f6ef086))
* **stock:** NoneType object error on stock entry ([de8c4ee](de8c4eec1b))
* warehouse for batch validation ([cb94c4b](cb94c4b5f1))

### Features

* add filters option in print view (backport [#49631](https://github.com/frappe/erpnext/issues/49631)) ([#49700](https://github.com/frappe/erpnext/issues/49700)) ([e9b29ed](e9b29ed544))
* populate available qty in pick list locations ([bc7f884](bc7f884ae1))
2025-09-23 14:00:33 +00:00
ruthra kumar
74b19f2743 Merge pull request #49697 from frappe/version-15-hotfix
chore: release v15
2025-09-23 19:29:11 +05:30
ruthra kumar
e9b29ed544 feat: add filters option in print view (backport #49631) (#49700)
fix: only show filters in print view if 'Include filters' is enabled

(cherry picked from commit 1979879b07)

# Conflicts:
#	erpnext/accounts/report/general_ledger/general_ledger.html

Co-authored-by: Nareshkanna S <nareshkannashanmugam@gmail.com>
2025-09-23 16:40:11 +05:30
Nareshkanna S
79d4731fe7 fix: only show filters in print view if 'Include filters' is enabled
(cherry picked from commit 1979879b07)

# Conflicts:
#	erpnext/accounts/report/general_ledger/general_ledger.html
2025-09-23 16:29:18 +05:30
ruthra kumar
e4997af1c0 Merge pull request #49695 from frappe/mergify/bp/version-15-hotfix/pr-49694
chore: update sales_data from site_info (backport #49694)
2025-09-23 15:11:22 +05:30
Jannat Patel
ff08ee6ada test: activation with site_info
(cherry picked from commit 5a26d593e4)
2025-09-23 09:22:03 +00:00
Jannat Patel
ac55028f6b chore: update sales_data from site_info
(cherry picked from commit 866b252309)
2025-09-23 09:22:03 +00:00
Frappe PR Bot
98457a8530 chore(release): Bumped to Version 15.79.2
## [15.79.2](https://github.com/frappe/erpnext/compare/v15.79.1...v15.79.2) (2025-09-23)

### Bug Fixes

* Consider non SABB batch qty in reserved batch validation ([9158751](91587517d9))
* warehouse for batch validation ([59a7104](59a710433a))
2025-09-23 07:16:11 +00:00
rohitwaghchaure
236d8c7af1 Merge pull request #49693 from frappe/mergify/bp/version-15/pr-49691
fix: Consider non SABB batch qty in reserved batch validation (backport #49648) (backport #49691)
2025-09-23 12:44:43 +05:30
rohitwaghchaure
63c1fd52b1 Merge pull request #49692 from frappe/mergify/bp/version-15/pr-49688
fix: warehouse for batch validation (backport #49687) (backport #49688)
2025-09-23 12:44:21 +05:30
Kavin
91587517d9 fix: Consider non SABB batch qty in reserved batch validation
(cherry picked from commit ae8b34e03c)
(cherry picked from commit 7ed97e47cc)
2025-09-23 06:39:33 +00:00
rohitwaghchaure
7402549b4b Merge pull request #49691 from frappe/mergify/bp/version-15-hotfix/pr-49648
fix: Consider non SABB batch qty in reserved batch validation (backport #49648)
2025-09-23 12:09:11 +05:30
Rohit Waghchaure
59a710433a fix: warehouse for batch validation
(cherry picked from commit 381072170a)
(cherry picked from commit cb94c4b5f1)
2025-09-23 06:37:26 +00:00
rohitwaghchaure
f4cef8a417 Merge pull request #49690 from frappe/mergify/bp/version-15-hotfix/pr-49684
feat: populate available qty in pick list locations (backport #49684)
2025-09-23 12:07:00 +05:30
rohitwaghchaure
dc6d4f2620 Merge pull request #49688 from frappe/mergify/bp/version-15-hotfix/pr-49687
fix: warehouse for batch validation (backport #49687)
2025-09-23 12:06:31 +05:30
Kavin
7ed97e47cc fix: Consider non SABB batch qty in reserved batch validation
(cherry picked from commit ae8b34e03c)
2025-09-23 06:21:00 +00:00
Kavin
a463f4a419 refactor: fetching qty on warehouse trigger
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
(cherry picked from commit e3ab0e7c67)
2025-09-23 06:20:23 +00:00
Kavin
bc7f884ae1 feat: populate available qty in pick list locations
(cherry picked from commit d8756fc7de)
2025-09-23 06:20:23 +00:00
Kavin
056d51937b chore: rename stock qty label
(cherry picked from commit fc967fceb2)
2025-09-23 06:20:22 +00:00
Rohit Waghchaure
cb94c4b5f1 fix: warehouse for batch validation
(cherry picked from commit 381072170a)
2025-09-23 06:12:44 +00:00
Diptanil Saha
868987e46e Merge pull request #49686 from frappe/mergify/bp/version-15-hotfix/pr-49676
fix: auto commit if too many writes reached (backport #49676)
2025-09-23 11:20:36 +05:30
Kavin
53207821aa fix: restore auto_commit_on_many_writes flag
(cherry picked from commit 66712fa8b5)
2025-09-23 05:31:28 +00:00
Kavin
0310172338 fix: auto commit if too many writes reached
(cherry picked from commit 99a0ba0b45)
2025-09-23 05:31:27 +00:00
ruthra kumar
5bfb4d2390 Merge pull request #49667 from frappe/mergify/bp/version-15-hotfix/pr-49644
fix(purchase order): get party type based on supplier field (backport #49644)
2025-09-22 15:05:53 +05:30
venkat102
3aebbf6e92 fix(purchase order): get party type based on supplier field
(cherry picked from commit 11b9b1adc5)

# Conflicts:
#	erpnext/public/js/controllers/transaction.js
2025-09-22 15:01:57 +05:30
ruthra kumar
925afe1b59 Merge pull request #49665 from frappe/mergify/bp/version-15-hotfix/pr-49653
fix(accounts receivable): exclude employee transactions (backport #49653)
2025-09-22 14:58:17 +05:30
venkat102
c071107b27 fix(accounts receivable): exclude employee transactions
(cherry picked from commit 736a776d3d)
2025-09-22 08:05:36 +00:00
ruthra kumar
8c7e20f9a2 Merge pull request #49664 from frappe/mergify/bp/version-15-hotfix/pr-49470
fix(bank clearance): use base total taxes and charges if exists (backport #49470)
2025-09-22 12:44:55 +05:30
Ravibharathi
81824320db Merge pull request #49470 from aerele/bank-clearance-tax-calculation
fix(bank clearance): use base total taxes and charges if exists

(cherry picked from commit 302ff49b7f)
2025-09-22 05:58:20 +00:00
Diptanil Saha
9914d20127 Merge pull request #49659 from frappe/mergify/bp/version-15-hotfix/pr-49649
fix: set first_response_time on set_first_response (backport #49649)
2025-09-22 00:38:16 +05:30
diptanilsaha
0d5613ca4c fix: set first_response_time on status change of issue
(cherry picked from commit ba459204b0)
2025-09-21 18:36:29 +00:00
Frappe PR Bot
20d14881fe chore(release): Bumped to Version 15.79.1
## [15.79.1](https://github.com/frappe/erpnext/compare/v15.79.0...v15.79.1) (2025-09-21)

### Bug Fixes

* **stock:** NoneType object error on stock entry ([48bd005](48bd005a09))
2025-09-21 18:34:45 +00:00
rohitwaghchaure
73e76f533e Merge pull request #49658 from frappe/mergify/bp/version-15/pr-49619
fix(stock): NoneType object error on stock entry (backport #49615) (backport #49619)
2025-09-22 00:03:18 +05:30
Kavin
48bd005a09 fix(stock): NoneType object error on stock entry
(cherry picked from commit aee03417de)
(cherry picked from commit de8c4eec1b)
2025-09-21 17:12:19 +00:00
Mihir Kandoi
04c2bb4f50 Merge pull request #49619 from frappe/mergify/bp/version-15-hotfix/pr-49615
fix(stock): NoneType object error on stock entry (backport #49615)
2025-09-18 21:18:09 +05:30
Kavin
de8c4eec1b fix(stock): NoneType object error on stock entry
(cherry picked from commit aee03417de)
2025-09-18 14:47:04 +00:00
mergify[bot]
697f6ef086 fix: skip receivable/payable account validation in payroll entry if party is not available (backport #49585) (#49598)
fix: skip receivable/payable account validation in payroll entry if party is not available (#49585)

* fix: skip receivable/payable account validation if party is not available in creation of payroll entry

* refactor: rename flag

(cherry picked from commit 8b543e5503)

Co-authored-by: Raheel Khan <raheel@frappe.io>
2025-09-18 17:04:28 +05:30
ruthra kumar
d66aed52f7 Merge pull request #49617 from frappe/mergify/bp/version-15-hotfix/pr-49467
fix: add condition for name (backport #49467)
2025-09-18 17:03:32 +05:30
venkat102
089c068ee8 test: add test to validate user permission in qb
(cherry picked from commit a5b881ea74)

# Conflicts:
#	erpnext/setup/doctype/employee/test_employee.py
2025-09-18 16:46:39 +05:30
venkat102
65ce737c2d fix: add condition for name
(cherry picked from commit cf5a2d6351)
2025-09-18 11:12:13 +00:00
mergify[bot]
5ef7a7857c fix(accounts): dynamic zero cutoff (backport #48899) (#49552)
fix(accounts): dynamic zero cutoff (#48899)

* fix(accounts): dynamic zero cutoff

The cutoff for displaying zero values in accounting reports has so far been hardcoded to 0.005, giving wrong results for currencies that require a higher precision. This PR changes this to a dynamic value calculated from the Currency's _Fraction Units_.

* style: fix typo

(cherry picked from commit 6972f161b8)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-09-17 18:03:48 +05:30
mergify[bot]
fbd62e72f9 fix(payment-reconciliation): apply field precision for allocated and difference amounts (backport #49448) (#49595)
fix(payment-reconciliation): apply field precision for allocated and difference amounts (#49448)

fix(payment-reconciliation): handle allocated and difference amount with field precision for accurate exchange rate calculations

(cherry picked from commit 194ab87fef)

Co-authored-by: Bhavansathru <122002510+Bhavan23@users.noreply.github.com>
2025-09-17 17:33:33 +05:30
mergify[bot]
1a4ea07b78 fix: add option for currency field (backport #49572) (#49594)
fix: add option for currency field (#49572)

(cherry picked from commit e0299e1cbd)

Co-authored-by: Logesh Periyasamy <logeshperiyasamy24@gmail.com>
2025-09-17 17:33:15 +05:30
mergify[bot]
bce22cb27b fix: project accounting dimension and gl posting date column width (backport #49563) (#49591)
fix: project accounting dimension and gl posting date column width (#49563)

* fix: add width for posting_date

* fix: add project field for missing doctype

* fix: remove allow_on_submit to align with cost center

(cherry picked from commit 9fc17e0e3a)

Co-authored-by: Logesh Periyasamy <logeshperiyasamy24@gmail.com>
2025-09-17 17:33:02 +05:30
Imesha Sudasingha
9e58a56b5c fix(item): avoid inheriting item defaults from identically named items (#49571) 2025-09-17 17:32:13 +05:30
rohitwaghchaure
87a2774511 Merge pull request #49592 from frappe/mergify/bp/version-15-hotfix/pr-49587
fix: incorrect current qty calculation for the batch (backport #49587)
2025-09-17 17:21:26 +05:30
Rohit Waghchaure
bf48cf02e5 fix: incorrect current qty calculation for the batch
(cherry picked from commit 535f8657ed)
2025-09-17 11:32:11 +00:00
Frappe PR Bot
6ae8e32efa chore(release): Bumped to Version 15.79.0
# [15.79.0](https://github.com/frappe/erpnext/compare/v15.78.1...v15.79.0) (2025-09-16)

### Bug Fixes

* add Address and Contact in Add Column ([28b3856](28b3856bc9))
* batch qty calculation performance issue ([921f317](921f317423))
* correct grammatical errors in asset movement validation messages ([97765ce](97765ce8bd))
* correct typo in asset movement purpose validation ([edd3f5d](edd3f5da1c))
* depreciate asset with remaining amount when depreciation amount exceeds current asset value ([845d346](845d3464b4))
* do not allow backdated entries if stock reco exists in future for serial or batch ([44869f0](44869f02b4))
* incorrect batch qty ([ae3dd5b](ae3dd5b831))
* incorrect stock value in the report ([d302ca7](d302ca7ea0))
* non batch-wise valuation for batch item ([affe09e](affe09ee0b))
* precision issue for valuation rate calculation ([7a8cd47](7a8cd47259))
* remove ignore_permissions ([7280034](7280034abd))
* renamed temporary bank account to 'Demo Bank Account' ([6ab287f](6ab287f19c))
* SABB document status validation ([7bb9225](7bb92255c5))
* **sales invoice:** fetch tax id from customer ([ee7da99](ee7da999a3))
* set basic rate on selection of the batch ([39eeafd](39eeafd0d0))
* skip 'Bank Account' creation on setup ([07241aa](07241aa54a))
* validation for document status ([0b2f53f](0b2f53fefe))

### Features

* add permission check for custom button ([9db9dd6](9db9dd6f35))
2025-09-16 14:43:36 +00:00
ruthra kumar
89204046de Merge pull request #49566 from frappe/version-15-hotfix
chore: release v15
2025-09-16 20:12:09 +05:30
rohitwaghchaure
fea0ca8e8e Merge pull request #49562 from frappe/mergify/bp/version-15-hotfix/pr-49558
fix: set basic rate on selection of the batch (backport #49558)
2025-09-16 13:08:42 +05:30
Rohit Waghchaure
39eeafd0d0 fix: set basic rate on selection of the batch
(cherry picked from commit bebb8ae1ea)
2025-09-16 07:26:10 +00:00
ruthra kumar
add236c907 Merge pull request #49559 from frappe/mergify/bp/version-15-hotfix/pr-49511
fix(sales invoice): fetch tax id from customer (backport #49511)
2025-09-16 12:48:01 +05:30
ravibharathi656
ee7da999a3 fix(sales invoice): fetch tax id from customer
(cherry picked from commit df329964dd)
2025-09-16 06:32:20 +00:00
rohitwaghchaure
0a7247f94c Merge pull request #49554 from frappe/mergify/bp/version-15-hotfix/pr-49549
fix: do not allow backdated entries if stock reco exists in future for serial or batch (backport #49549)
2025-09-15 16:22:33 +05:30
rohitwaghchaure
572af6e08a chore: fix conflicts 2025-09-15 15:43:38 +05:30
Rohit Waghchaure
44869f02b4 fix: do not allow backdated entries if stock reco exists in future for serial or batch
(cherry picked from commit 335dcc976c)

# Conflicts:
#	erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.json
2025-09-15 10:12:08 +00:00
Khushi Rawat
e92ec66890 Merge pull request #49551 from frappe/mergify/bp/version-15-hotfix/pr-49524
fix: Assets Movement Typos (backport #49524)
2025-09-15 13:00:46 +05:30
KerollesFathy
97765ce8bd fix: correct grammatical errors in asset movement validation messages
(cherry picked from commit 5f083d55b5)
2025-09-15 06:26:45 +00:00
KerollesFathy
edd3f5da1c fix: correct typo in asset movement purpose validation
(cherry picked from commit 56da3bd2e4)
2025-09-15 06:26:45 +00:00
rohitwaghchaure
1addaae669 Merge pull request #49543 from frappe/mergify/bp/version-15-hotfix/pr-49542
fix: validation for document status (backport #49542)
2025-09-14 17:06:53 +05:30
Rohit Waghchaure
0b2f53fefe fix: validation for document status
(cherry picked from commit 96e2e356b6)
2025-09-14 06:57:36 +00:00
rohitwaghchaure
b5417af6f5 Merge pull request #49541 from frappe/mergify/bp/version-15-hotfix/pr-49539
fix: precision issue for valuation rate calculation (backport #49539)
2025-09-14 12:27:02 +05:30
Rohit Waghchaure
7a8cd47259 fix: precision issue for valuation rate calculation
(cherry picked from commit c92a06d77d)
2025-09-14 06:22:22 +00:00
rohitwaghchaure
f523413bce Merge pull request #49540 from frappe/mergify/bp/version-15-hotfix/pr-49538
fix: SABB document status validation (backport #49538)
2025-09-14 11:51:18 +05:30
Rohit Waghchaure
7bb92255c5 fix: SABB document status validation
(cherry picked from commit c0236191aa)
2025-09-14 05:56:11 +00:00
KerollesFathy
4bc76be130 refactor: optimize asset location and custodian update logic to avoid multiple updates 2025-09-10 19:01:14 +03:00
KerollesFathy
f4cdb49126 fix: clear asset custodian when asset take back from employee without assign to another employee 2025-09-10 18:27:39 +03:00
rohitwaghchaure
6245bf9b87 Merge pull request #49495 from frappe/mergify/bp/version-15-hotfix/pr-49477
fix: batch qty calculation performance issue (backport #49477)
2025-09-08 10:06:21 +05:30
Rohit Waghchaure
921f317423 fix: batch qty calculation performance issue
(cherry picked from commit 1a262483a4)
2025-09-07 11:20:42 +00:00
Diptanil Saha
08cfd00373 Merge pull request #49492 from frappe/mergify/bp/version-15-hotfix/pr-49485
fix: skip 'Bank Account' creation on setup (backport #49485)
2025-09-06 13:32:07 +05:30
diptanilsaha
6ab287f19c fix: renamed temporary bank account to 'Demo Bank Account'
(cherry picked from commit efeda90cad)
2025-09-06 07:44:55 +00:00
diptanilsaha
07241aa54a fix: skip 'Bank Account' creation on setup
(cherry picked from commit 47d4319f83)
2025-09-06 07:44:54 +00:00
ruthra kumar
f27c67a19d Merge pull request #49482 from frappe/mergify/bp/version-15-hotfix/pr-46996
fix: Allow adding Address/Contact fields to `Address And Contacts` report (backport #46996)
2025-09-05 20:17:26 +05:30
ruthra kumar
4f1f46a4d4 chore: translatable labels
(cherry picked from commit 39174f9dc0)
2025-09-05 14:05:20 +00:00
Sanket322
28b3856bc9 fix: add Address and Contact in Add Column
(cherry picked from commit d9ca7e755f)
2025-09-05 14:05:20 +00:00
Khushi Rawat
ee9369cd44 Merge pull request #49468 from khushi8112/asset-scrapping-issue
fix: asset scrapping issue
2025-09-05 02:22:41 +05:30
khushi8112
da039e5bf0 chore: remove print statement 2025-09-05 01:58:20 +05:30
khushi8112
845d3464b4 fix: depreciate asset with remaining amount when depreciation amount exceeds current asset value 2025-09-05 01:54:56 +05:30
Frappe PR Bot
ceb17b6b61 chore(release): Bumped to Version 15.78.1
## [15.78.1](https://github.com/frappe/erpnext/compare/v15.78.0...v15.78.1) (2025-09-04)

### Bug Fixes

* non batch-wise valuation for batch item ([9c14aa2](9c14aa2d01))
2025-09-04 14:39:10 +00:00
rohitwaghchaure
745070dc97 Merge pull request #49464 from frappe/mergify/bp/version-15/pr-49457
fix: non batch-wise valuation for batch item (backport #49453) (backport #49457)
2025-09-04 20:07:51 +05:30
Mihir Kandoi
b1c1452b90 Merge pull request #49440 from frappe/mergify/bp/version-15-hotfix/pr-49437
refactor: PR 49320 (backport #49437)
2025-09-04 20:00:32 +05:30
rohitwaghchaure
4dbcef3d67 chore: fix test case
(cherry picked from commit ac8637d5a0)
(cherry picked from commit 6bdf11f5c9)
2025-09-04 12:52:18 +00:00
Rohit Waghchaure
9c14aa2d01 fix: non batch-wise valuation for batch item
(cherry picked from commit 11b82ba008)
(cherry picked from commit affe09ee0b)
2025-09-04 12:52:18 +00:00
rohitwaghchaure
e0f4c17462 Merge pull request #49457 from frappe/mergify/bp/version-15-hotfix/pr-49453
fix: non batch-wise valuation for batch item (backport #49453)
2025-09-04 18:20:11 +05:30
rohitwaghchaure
6bdf11f5c9 chore: fix test case
(cherry picked from commit ac8637d5a0)
2025-09-04 09:01:08 +00:00
Rohit Waghchaure
affe09ee0b fix: non batch-wise valuation for batch item
(cherry picked from commit 11b82ba008)
2025-09-04 09:01:07 +00:00
rohitwaghchaure
eb631d6e75 Merge pull request #49452 from frappe/mergify/bp/version-15-hotfix/pr-49449
fix: incorrect stock value in the report (backport #49449)
2025-09-04 07:10:40 +05:30
Rohit Waghchaure
d302ca7ea0 fix: incorrect stock value in the report
(cherry picked from commit 5824b5effd)
2025-09-03 19:18:03 +00:00
Raffael Meyer
af0399c2d2 Merge pull request #49435 from frappe/mergify/bp/version-15-hotfix/pr-49374
fix: improve permission handling for party link creation (backport #49374)
2025-09-03 17:13:08 +02:00
rohitwaghchaure
ce820e4150 Merge pull request #49443 from frappe/mergify/bp/version-15-hotfix/pr-49442
fix: incorrect batch qty (backport #49442)
2025-09-03 19:20:10 +05:30
Rohit Waghchaure
ae3dd5b831 fix: incorrect batch qty
(cherry picked from commit 000135a3d4)
2025-09-03 11:13:52 +00:00
Mihir Kandoi
43e9ab9cd1 refactor: PR 49320
(cherry picked from commit 991413608b)
2025-09-03 08:50:57 +00:00
mergify[bot]
b8a07a437b test: use valid IBANs in party matching test case (backport #49432) (#49433)
Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
2025-09-02 17:35:03 +00:00
Marc-Constantin Enke
9db9dd6f35 feat: add permission check for custom button
(cherry picked from commit 00fd1d2f26)
2025-09-02 17:20:37 +00:00
Marc-Constantin Enke
7280034abd fix: remove ignore_permissions
(cherry picked from commit 7f55f421ab)
2025-09-02 17:20:37 +00:00
209 changed files with 4714 additions and 1987 deletions

View File

@@ -6,7 +6,7 @@ Feature requests are also a great way to take the product forward. New ideas can
When you are raising an Issue, you should keep a few things in mind. Remember that the developer does not have access to your machine so you must give all the information you can while raising an Issue. If you are suggesting a feature, you should be very clear about what you want.
The Issue list is not the right place to ask a question or start a general discussion. If you want to do that , then the right place is the forum [https://discuss.erpnext.com](https://discuss.erpnext.com).
The Issue list is not the right place to ask a question or start a general discussion. If you want to do that , then the right place is the forum [https://discuss.frappe.io](https://discuss.frappe.io/c/erpnext/6).
### Reply and Closing Policy

View File

@@ -9,7 +9,7 @@ body:
Welcome to ERPNext issue tracker! Before creating an issue, please heed the following:
1. This tracker should only be used to report bugs and request features / enhancements to ERPNext
- For questions and general support, checkout the [user manual](https://docs.erpnext.com/) or use [forum](https://discuss.erpnext.com)
- For questions and general support, checkout the [user manual](https://docs.erpnext.com/) or use [forum](https://discuss.frappe.io/c/erpnext/6)
- For documentation issues, propose edit on [documentation site](https://docs.erpnext.com/) directly.
2. When making a bug report, make sure you provide all required information. The easier it is for
maintainers to reproduce, the faster it'll be fixed.

View File

@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Community Forum
url: https://discuss.erpnext.com/
url: https://discuss.frappe.io/c/erpnext/6
about: For general QnA, discussions and community help.

View File

@@ -11,7 +11,7 @@ assignees: ''
Welcome to ERPNext issue tracker! Before creating an issue, please heed the following:
1. This tracker should only be used to report bugs and request features / enhancements to ERPNext
- For questions and general support, checkout the manual https://erpnext.com/docs/user/manual/en or use https://discuss.erpnext.com
- For questions and general support, checkout the manual https://docs.erpnext.com or use https://discuss.frappe.io/c/erpnext/6
2. Use the search function before creating a new issue. Duplicates will be closed and directed to
the original discussion.
3. When making a feature request, make sure to be as verbose as possible. The better you convey your message, the greater the drive to make it happen.
@@ -21,7 +21,7 @@ Please keep in mind that we get many many requests and we can't possibly work on
If you're in urgent need to a feature, please try the following channels to get paid developments done quickly:
1. Certified ERPNext partners: https://erpnext.com/partners
2. Developer community on ERPNext forums: https://discuss.erpnext.com/c/developers/5
2. Developer community on ERPNext forums: https://discuss.frappe.io/c/framework/5
3. Telegram group for ERPNext/Frappe development work: https://t.me/erpnext_opps
-->

View File

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

View File

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

View File

@@ -46,7 +46,8 @@ def validate_service_stop_date(doc):
if (
old_stop_dates
and old_stop_dates.get(item.name)
and item.service_stop_date != old_stop_dates.get(item.name)
and item.service_stop_date
and getdate(item.service_stop_date) != getdate(old_stop_dates.get(item.name))
):
frappe.throw(_("Cannot change Service Stop Date for item in row {0}").format(item.idx))

View File

@@ -110,6 +110,7 @@ class Account(NestedSet):
self.validate_parent_child_account_type()
self.validate_root_details()
self.validate_account_number()
self.validate_disabled()
self.validate_group_or_ledger()
self.set_root_and_report_type()
self.validate_mandatory()
@@ -254,6 +255,14 @@ class Account(NestedSet):
self.create_account_for_child_company(parent_acc_name_map, descendants, parent_acc_name)
def validate_disabled(self):
doc_before_save = self.get_doc_before_save()
if not doc_before_save or cint(doc_before_save.disabled) == cint(self.disabled):
return
if cint(self.disabled):
self.validate_default_accounts_in_company()
def validate_group_or_ledger(self):
doc_before_save = self.get_doc_before_save()
if not doc_before_save or cint(doc_before_save.is_group) == cint(self.is_group):
@@ -264,9 +273,32 @@ class Account(NestedSet):
elif cint(self.is_group):
if self.account_type and not self.flags.exclude_account_type_check:
throw(_("Cannot covert to Group because Account Type is selected."))
self.validate_default_accounts_in_company()
elif self.check_if_child_exists():
throw(_("Account with child nodes cannot be set as ledger"))
def validate_default_accounts_in_company(self):
default_account_fields = get_company_default_account_fields()
company_default_accounts = frappe.db.get_value(
"Company", self.company, list(default_account_fields.keys()), as_dict=1
)
msg = _("Account {0} cannot be disabled as it is already set as {1} for {2}.")
if not self.disabled:
msg = _("Account {0} cannot be converted to Group as it is already set as {1} for {2}.")
for d in default_account_fields:
if company_default_accounts.get(d) == self.name:
throw(
msg.format(
frappe.bold(self.name),
frappe.bold(default_account_fields.get(d)),
frappe.bold(self.company),
)
)
def validate_frozen_accounts_modifier(self):
doc_before_save = self.get_doc_before_save()
if not doc_before_save or doc_before_save.freeze_account == self.freeze_account:
@@ -627,3 +659,27 @@ def _ensure_idle_system():
).format(pretty_date(last_gl_update)),
title=_("System In Use"),
)
def get_company_default_account_fields():
return {
"default_bank_account": "Default Bank Account",
"default_cash_account": "Default Cash Account",
"default_receivable_account": "Default Receivable Account",
"default_payable_account": "Default Payable Account",
"default_expense_account": "Default Expense Account",
"default_income_account": "Default Income Account",
"stock_received_but_not_billed": "Stock Received But Not Billed Account",
"stock_adjustment_account": "Stock Adjustment Account",
"write_off_account": "Write Off Account",
"default_discount_account": "Default Payment Discount Account",
"unrealized_profit_loss_account": "Unrealized Profit / Loss Account",
"exchange_gain_loss_account": "Exchange Gain / Loss Account",
"unrealized_exchange_gain_loss_account": "Unrealized Exchange Gain / Loss Account",
"round_off_account": "Round Off Account",
"default_deferred_revenue_account": "Default Deferred Revenue Account",
"default_deferred_expense_account": "Default Deferred Expense Account",
"accumulated_depreciation_account": "Accumulated Depreciation Account",
"depreciation_expense_account": "Depreciation Expense Account",
"disposal_account": "Gain/Loss Account on Asset Disposal",
}

View File

@@ -75,6 +75,7 @@
"period_closing_settings_section",
"acc_frozen_upto",
"ignore_account_closing_balance",
"use_legacy_controller_for_pcv",
"column_break_25",
"frozen_accounts_modifier",
"tab_break_dpet",
@@ -629,6 +630,12 @@
"fieldname": "fetch_valuation_rate_for_internal_transaction",
"fieldtype": "Check",
"label": "Fetch Valuation Rate for Internal Transaction"
},
{
"default": "1",
"fieldname": "use_legacy_controller_for_pcv",
"fieldtype": "Check",
"label": "Use Legacy Controller For Period Closing Voucher"
}
],
"icon": "icon-cog",
@@ -636,7 +643,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2025-07-18 13:56:47.192437",
"modified": "2025-10-20 14:06:08.870427",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",

View File

@@ -73,6 +73,7 @@ class AccountsSettings(Document):
submit_journal_entries: DF.Check
unlink_advance_payment_on_cancelation_of_order: DF.Check
unlink_payment_on_cancellation_of_invoice: DF.Check
use_legacy_controller_for_pcv: DF.Check
# end: auto-generated types
def validate(self):

View File

@@ -82,7 +82,7 @@
"in_create": 1,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2025-07-29 11:37:42.678556",
"modified": "2025-10-13 15:11:58.300836",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Advance Payment Ledger Entry",

View File

@@ -34,3 +34,15 @@ class AdvancePaymentLedgerEntry(Document):
and not frappe.flags.is_reverse_depr_entry
):
update_voucher_outstanding(self.against_voucher_type, self.against_voucher_no, None, None, None)
def on_doctype_update():
frappe.db.add_index(
"Advance Payment Ledger Entry",
["against_voucher_type", "against_voucher_no"],
)
frappe.db.add_index(
"Advance Payment Ledger Entry",
["voucher_type", "voucher_no"],
)

View File

@@ -16,6 +16,7 @@
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"project",
"section_break_8",
"rate",
"section_break_9",
@@ -92,6 +93,13 @@
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
},
{
"allow_on_submit": 1,
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
"options": "Project"
},
{
"fieldname": "section_break_8",
"fieldtype": "Section Break"

View File

@@ -132,7 +132,8 @@
"fieldtype": "Data",
"in_list_view": 1,
"label": "IBAN",
"length": 30
"length": 34,
"options": "IBAN"
},
{
"fieldname": "column_break_12",
@@ -208,6 +209,7 @@
"label": "Disabled"
}
],
"grid_page_length": 50,
"links": [
{
"group": "Transactions",
@@ -250,7 +252,7 @@
"link_fieldname": "default_bank_account"
}
],
"modified": "2024-10-30 09:41:14.113414",
"modified": "2025-08-29 12:32:01.081687",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Account",
@@ -282,6 +284,7 @@
"write": 1
}
],
"row_format": "Dynamic",
"search_fields": "bank,account",
"sort_field": "modified",
"sort_order": "DESC",

View File

@@ -9,7 +9,8 @@ from frappe.contacts.address_and_contact import (
load_address_and_contact,
)
from frappe.model.document import Document
from frappe.utils import comma_and, get_link_to_form
from frappe.utils import comma_and, get_link_to_form, validate_iban
from frappe.utils.deprecations import deprecated
class BankAccount(Document):
@@ -52,7 +53,6 @@ class BankAccount(Document):
def validate(self):
self.validate_company()
self.validate_iban()
self.validate_account()
self.update_default_bank_account()
@@ -72,34 +72,10 @@ class BankAccount(Document):
if self.is_company_account and not self.company:
frappe.throw(_("Company is manadatory for company account"))
@deprecated
def validate_iban(self):
"""
Algorithm: https://en.wikipedia.org/wiki/International_Bank_Account_Number#Validating_the_IBAN
"""
# IBAN field is optional
if not self.iban:
return
def encode_char(c):
# Position in the alphabet (A=1, B=2, ...) plus nine
return str(9 + ord(c) - 64)
# remove whitespaces, upper case to get the right number from ord()
iban = "".join(self.iban.split(" ")).upper()
# Move country code and checksum from the start to the end
flipped = iban[4:] + iban[:4]
# Encode characters as numbers
encoded = [encode_char(c) if ord(c) >= 65 and ord(c) <= 90 else c for c in flipped]
try:
to_check = int("".join(encoded))
except ValueError:
frappe.throw(_("IBAN is not valid"))
if to_check % 97 != 1:
frappe.throw(_("IBAN is not valid"))
"""Kept for backward compatibility, will be removed in v16."""
validate_iban(self.iban, throw=True)
def update_default_bank_account(self):
if self.is_default and not self.disabled:

View File

@@ -3,45 +3,8 @@
import unittest
import frappe
from frappe import ValidationError
# test_records = frappe.get_test_records('Bank Account')
class TestBankAccount(unittest.TestCase):
def test_validate_iban(self):
valid_ibans = [
"GB82 WEST 1234 5698 7654 32",
"DE91 1000 0000 0123 4567 89",
"FR76 3000 6000 0112 3456 7890 189",
]
invalid_ibans = [
# wrong checksum (3rd place)
"GB72 WEST 1234 5698 7654 32",
"DE81 1000 0000 0123 4567 89",
"FR66 3000 6000 0112 3456 7890 189",
]
bank_account = frappe.get_doc({"doctype": "Bank Account"})
try:
bank_account.validate_iban()
except AttributeError:
msg = "BankAccount.validate_iban() failed for empty IBAN"
self.fail(msg=msg)
for iban in valid_ibans:
bank_account.iban = iban
try:
bank_account.validate_iban()
except ValidationError:
msg = f"BankAccount.validate_iban() failed for valid IBAN {iban}"
self.fail(msg=msg)
for not_iban in invalid_ibans:
bank_account.iban = not_iban
msg = f"BankAccount.validate_iban() accepted invalid IBAN {not_iban}"
with self.assertRaises(ValidationError, msg=msg):
bank_account.validate_iban()
pass

View File

@@ -137,8 +137,10 @@ def get_payment_entries_for_bank_clearance(
entries = []
condition = ""
pe_condition = ""
if not include_reconciled_entries:
condition = "and (clearance_date IS NULL or clearance_date='0000-00-00')"
pe_condition = "and (pe.clearance_date IS NULL or pe.clearance_date='0000-00-00')"
journal_entries = frappe.db.sql(
f"""
@@ -163,19 +165,20 @@ def get_payment_entries_for_bank_clearance(
payment_entries = frappe.db.sql(
f"""
select
"Payment Entry" as payment_document, name as payment_entry,
reference_no as cheque_number, reference_date as cheque_date,
if(paid_from=%(account)s, paid_amount + total_taxes_and_charges, 0) as credit,
if(paid_from=%(account)s, 0, received_amount + total_taxes_and_charges) as debit,
posting_date, ifnull(party,if(paid_from=%(account)s,paid_to,paid_from)) as against_account, clearance_date,
if(paid_to=%(account)s, paid_to_account_currency, paid_from_account_currency) as account_currency
from `tabPayment Entry`
"Payment Entry" as payment_document, pe.name as payment_entry,
pe.reference_no as cheque_number, pe.reference_date as cheque_date,
if(pe.paid_from=%(account)s, pe.paid_amount + if(pe.payment_type = 'Pay' and c.default_currency = pe.paid_from_account_currency, pe.base_total_taxes_and_charges, pe.total_taxes_and_charges) , 0) as credit,
if(pe.paid_from=%(account)s, 0, pe.received_amount + pe.total_taxes_and_charges) as debit,
pe.posting_date, ifnull(pe.party,if(pe.paid_from=%(account)s,pe.paid_to,pe.paid_from)) as against_account, pe.clearance_date,
if(pe.paid_to=%(account)s, pe.paid_to_account_currency, pe.paid_from_account_currency) as account_currency
from `tabPayment Entry` as pe
join `tabCompany` c on c.name = pe.company
where
(paid_from=%(account)s or paid_to=%(account)s) and docstatus=1
and posting_date >= %(from)s and posting_date <= %(to)s
{condition}
(pe.paid_from=%(account)s or pe.paid_to=%(account)s) and pe.docstatus=1
and pe.posting_date >= %(from)s and pe.posting_date <= %(to)s
{pe_condition}
order by
posting_date ASC, name DESC
pe.posting_date ASC, pe.name DESC
""",
{
"account": account,

View File

@@ -9,13 +9,6 @@ cur_frm.add_fetch("bank", "swift_number", "swift_number");
frappe.ui.form.on("Bank Guarantee", {
setup: function (frm) {
frm.set_query("bank", function () {
return {
filters: {
company: frm.doc.company,
},
};
});
frm.set_query("bank_account", function () {
return {
filters: {

File diff suppressed because it is too large Load Diff

View File

@@ -116,15 +116,14 @@
{
"allow_on_submit": 1,
"fieldname": "reference_number",
"fieldtype": "Data",
"fieldtype": "Small Text",
"label": "Reference Number"
},
{
"fieldname": "transaction_id",
"fieldtype": "Data",
"label": "Transaction ID",
"read_only": 1,
"unique": 1
"read_only": 1
},
{
"allow_on_submit": 1,
@@ -223,7 +222,8 @@
{
"fieldname": "bank_party_iban",
"fieldtype": "Data",
"label": "Party IBAN (Bank Statement)"
"label": "Party IBAN (Bank Statement)",
"options": "IBAN"
},
{
"fieldname": "bank_party_account_number",
@@ -238,7 +238,7 @@
"grid_page_length": 50,
"is_submittable": 1,
"links": [],
"modified": "2025-06-18 17:24:57.044666",
"modified": "2025-10-23 17:32:58.514807",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Transaction",

View File

@@ -36,7 +36,7 @@ class BankTransaction(Document):
party: DF.DynamicLink | None
party_type: DF.Link | None
payment_entries: DF.Table[BankTransactionPayments]
reference_number: DF.Data | None
reference_number: DF.SmallText | None
status: DF.Literal["", "Pending", "Settled", "Unreconciled", "Reconciled", "Cancelled"]
transaction_id: DF.Data | None
transaction_type: DF.Data | None

View File

@@ -7,6 +7,9 @@ from frappe.utils import nowdate
from erpnext.accounts.doctype.bank_transaction.test_bank_transaction import create_bank_account
IBAN_1 = "DE02000000003716541159"
IBAN_2 = "DE02500105170137075030"
class TestAutoMatchParty(FrappeTestCase):
@classmethod
@@ -22,24 +25,24 @@ class TestAutoMatchParty(FrappeTestCase):
frappe.db.set_single_value("Accounts Settings", "enable_fuzzy_matching", 0)
def test_match_by_account_number(self):
create_supplier_for_match(account_no="000000003716541159")
create_supplier_for_match(account_no=IBAN_1[11:])
doc = create_bank_transaction(
withdrawal=1200,
transaction_id="562213b0ca1bf838dab8f2c6a39bbc3b",
account_no="000000003716541159",
iban="DE02000000003716541159",
account_no=IBAN_1[11:],
iban=IBAN_1,
)
self.assertEqual(doc.party_type, "Supplier")
self.assertEqual(doc.party, "John Doe & Co.")
def test_match_by_iban(self):
create_supplier_for_match(iban="DE02000000003716541159")
create_supplier_for_match(iban=IBAN_1)
doc = create_bank_transaction(
withdrawal=1200,
transaction_id="c5455a224602afaa51592a9d9250600d",
account_no="000000003716541159",
iban="DE02000000003716541159",
account_no=IBAN_1[11:],
iban=IBAN_1,
)
self.assertEqual(doc.party_type, "Supplier")
@@ -51,7 +54,7 @@ class TestAutoMatchParty(FrappeTestCase):
withdrawal=1200,
transaction_id="1f6f661f347ff7b1ea588665f473adb1",
party_name="Ella Jackson",
iban="DE04000000003716545346",
iban=IBAN_2,
)
self.assertEqual(doc.party_type, "Supplier")
self.assertEqual(doc.party, "Jackson Ella W.")

View File

@@ -99,7 +99,7 @@ class FiscalYear(Document):
)
overlap = False
if not self.get("companies") or not company_for_existing:
if not self.get("companies") and not company_for_existing:
overlap = True
for d in self.get("companies"):

View File

@@ -26,6 +26,27 @@ class TestFiscalYear(unittest.TestCase):
self.assertRaises(frappe.exceptions.InvalidDates, fy.insert)
def test_company_fiscal_year_overlap(self):
for name in ["_Test Global FY 2001", "_Test Company FY 2001"]:
if frappe.db.exists("Fiscal Year", name):
frappe.delete_doc("Fiscal Year", name)
global_fy = frappe.new_doc("Fiscal Year")
global_fy.year = "_Test Global FY 2001"
global_fy.year_start_date = "2001-04-01"
global_fy.year_end_date = "2002-03-31"
global_fy.insert()
company_fy = frappe.new_doc("Fiscal Year")
company_fy.year = "_Test Company FY 2001"
company_fy.year_start_date = "2001-01-01"
company_fy.year_end_date = "2001-12-31"
company_fy.append("companies", {"company": "_Test Company"})
company_fy.insert()
self.assertTrue(frappe.db.exists("Fiscal Year", global_fy.name))
self.assertTrue(frappe.db.exists("Fiscal Year", company_fy.name))
def test_record_generator():
test_records = [

View File

@@ -131,18 +131,20 @@ class GLEntry(Document):
if not self.is_cancelled and not (self.party_type and self.party):
account_type = frappe.get_cached_value("Account", self.account, "account_type")
if account_type == "Receivable":
frappe.throw(
_("{0} {1}: Customer is required against Receivable account {2}").format(
self.voucher_type, self.voucher_no, self.account
if not frappe.flags.party_not_required: # skipping validation if party is not required
if account_type == "Receivable":
frappe.throw(
_("{0} {1}: Customer is required against Receivable account {2}").format(
self.voucher_type, self.voucher_no, self.account
)
)
)
elif account_type == "Payable":
frappe.throw(
_("{0} {1}: Supplier is required against Payable account {2}").format(
self.voucher_type, self.voucher_no, self.account
elif account_type == "Payable":
frappe.throw(
_("{0} {1}: Supplier is required against Payable account {2}").format(
self.voucher_type, self.voucher_no, self.account
)
)
)
# Zero value transaction is not allowed
if not (
@@ -251,7 +253,7 @@ class GLEntry(Document):
)
def validate_cost_center(self):
if not self.cost_center:
if not self.cost_center or self.is_cancelled:
return
is_group, company = frappe.get_cached_value("Cost Center", self.cost_center, ["is_group", "company"])

View File

@@ -59,6 +59,7 @@
"addtional_info",
"mode_of_payment",
"payment_order",
"party_not_required",
"column_break3",
"is_opening",
"stock_entry",
@@ -543,6 +544,14 @@
"label": "Is System Generated",
"no_copy": 1,
"read_only": 1
},
{
"default": "0",
"fieldname": "party_not_required",
"fieldtype": "Check",
"hidden": 1,
"label": "Party Not Required",
"no_copy": 1
}
],
"icon": "fa fa-file-text",
@@ -557,7 +566,7 @@
"table_fieldname": "payment_entries"
}
],
"modified": "2024-07-18 15:32:29.413598",
"modified": "2025-09-29 13:05:46.982277",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry",

View File

@@ -72,6 +72,7 @@ class JournalEntry(AccountsController):
multi_currency: DF.Check
naming_series: DF.Literal["ACC-JV-.YYYY.-"]
paid_loan: DF.Data | None
party_not_required: DF.Check
pay_to_recd_from: DF.Data | None
payment_order: DF.Link | None
posting_date: DF.Date
@@ -189,8 +190,8 @@ class JournalEntry(AccountsController):
def on_submit(self):
self.validate_cheque_info()
self.check_credit_limit()
self.make_gl_entries()
self.check_credit_limit()
self.update_asset_value()
self.update_inter_company_jv()
self.update_invoice_discounting()
@@ -542,8 +543,11 @@ class JournalEntry(AccountsController):
def validate_party(self):
for d in self.get("accounts"):
account_type = frappe.get_cached_value("Account", d.account, "account_type")
if account_type in ["Receivable", "Payable"]:
if not (d.party_type and d.party):
if (
not (d.party_type and d.party) and not self.party_not_required
): # skipping validation if party_not_required is passed via payroll entry
frappe.throw(
_(
"Row {0}: Party Type and Party is required for Receivable / Payable account {1}"
@@ -1136,6 +1140,11 @@ class JournalEntry(AccountsController):
}
)
# set flag to skip party validation
account_type = frappe.get_cached_value("Account", d.account, "account_type")
if account_type in ["Receivable", "Payable"] and self.party_not_required:
frappe.flags.party_not_required = True
gl_map.append(
self.get_gl_dict(
row,
@@ -1163,6 +1172,7 @@ class JournalEntry(AccountsController):
merge_entries=merge_entries,
update_outstanding=update_outstanding,
)
frappe.flags.party_not_required = False
if cancel:
cancel_exchange_gain_loss_journal(frappe._dict(doctype=self.doctype, name=self.name))

View File

@@ -11,6 +11,7 @@ from frappe.utils import flt, nowdate
from erpnext.accounts.doctype.account.test_account import get_inventory_account
from erpnext.accounts.doctype.journal_entry.journal_entry import StockAccountInvalidTransaction
from erpnext.exceptions import InvalidAccountCurrency
from erpnext.selling.doctype.customer.test_customer import make_customer, set_credit_limit
class TestJournalEntry(unittest.TestCase):
@@ -592,6 +593,15 @@ class TestJournalEntry(unittest.TestCase):
self.assertEqual(jv.pay_to_recd_from, "_Test Receiver 2")
def test_credit_limit_for_customer(self):
customer = make_customer("_Test New Customer")
set_credit_limit("_Test New Customer", "_Test Company", 50)
jv = make_journal_entry(account1="Debtors - _TC", account2="_Test Cash - _TC", amount=100, save=False)
jv.accounts[0].party_type = "Customer"
jv.accounts[0].party = customer
jv.save()
self.assertRaises(frappe.ValidationError, jv.submit)
def make_journal_entry(
account1,

View File

@@ -106,7 +106,6 @@
"fieldname": "account_currency",
"fieldtype": "Link",
"label": "Account Currency",
"no_copy": 1,
"options": "Currency",
"print_hide": 1,
"read_only": 1
@@ -272,7 +271,8 @@
"label": "Advance Voucher Type",
"no_copy": 1,
"options": "DocType",
"read_only": 1
"read_only": 1,
"search_index": 1
},
{
"fieldname": "advance_voucher_no",
@@ -280,13 +280,14 @@
"label": "Advance Voucher No",
"no_copy": 1,
"options": "advance_voucher_type",
"read_only": 1
"read_only": 1,
"search_index": 1
}
],
"idx": 1,
"istable": 1,
"links": [],
"modified": "2025-07-25 04:45:28.117715",
"modified": "2025-10-27 13:48:32.805100",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry Account",

View File

@@ -24,6 +24,7 @@
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"project",
"help_section",
"loyalty_program_help"
],
@@ -143,6 +144,12 @@
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
},
{
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
"options": "Project"
}
],
"modified": "2019-05-26 09:11:46.120251",

View File

@@ -13,6 +13,7 @@
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"project",
"section_break_4",
"invoices"
],
@@ -62,6 +63,12 @@
"label": "Cost Center",
"options": "Cost Center"
},
{
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
"options": "Project"
},
{
"collapsible": 1,
"fieldname": "accounting_dimensions_section",

View File

@@ -74,6 +74,6 @@ def create_party_link(primary_role, primary_party, secondary_party):
party_link.secondary_role = "Customer" if primary_role == "Supplier" else "Supplier"
party_link.secondary_party = secondary_party
party_link.save(ignore_permissions=True)
party_link.save()
return party_link

View File

@@ -601,6 +601,7 @@ frappe.ui.form.on("Payment Entry", {
if (frm.doc.payment_type == "Pay") {
frm.events.paid_amount(frm);
}
frm.events.paid_from_account_currency(frm);
}
);
},
@@ -624,6 +625,7 @@ frappe.ui.form.on("Payment Entry", {
frm.events.received_amount(frm);
}
}
frm.events.paid_to_account_currency(frm);
}
);
},

View File

@@ -385,6 +385,16 @@ frappe.ui.form.on("Payment Reconciliation Allocation", {
// filter payment
let payment = frm.doc.payments.filter((x) => x.reference_name == row.reference_name);
let amount = payment[0].amount;
for (const d of frm.doc.allocation) {
if (row.reference_name == d.reference_name && amount) {
if (d.allocated_amount <= amount) {
d.amount = amount;
amount -= d.allocated_amount;
}
}
}
frm.call({
doc: frm.doc,
method: "calculate_difference_on_allocation_change",

View File

@@ -28,6 +28,7 @@
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"project",
"sec_break1",
"invoice_name",
"invoices",
@@ -193,6 +194,12 @@
"label": "Cost Center",
"options": "Cost Center"
},
{
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
"options": "Project"
},
{
"depends_on": "eval:doc.party",
"description": "Only 'Payment Entries' made against this advance account are supported.",

View File

@@ -5,6 +5,7 @@
import frappe
from frappe import _, msgprint, qb
from frappe.model.document import Document
from frappe.model.meta import get_field_precision
from frappe.query_builder import Criterion
from frappe.query_builder.custom import ConstantColumn
from frappe.utils import flt, fmt_money, get_link_to_form, getdate, nowdate, today
@@ -392,6 +393,12 @@ class PaymentReconciliation(Document):
inv.outstanding_amount = flt(entry.get("outstanding_amount"))
def get_difference_amount(self, payment_entry, invoice, allocated_amount):
allocated_amount_precision = get_field_precision(
frappe.get_meta("Payment Reconciliation Allocation").get_field("allocated_amount")
)
difference_amount_precision = get_field_precision(
frappe.get_meta("Payment Reconciliation Allocation").get_field("difference_amount")
)
difference_amount = 0
if frappe.get_cached_value(
"Account", self.receivable_payable_account, "account_currency"
@@ -399,8 +406,14 @@ class PaymentReconciliation(Document):
if invoice.get("exchange_rate") and payment_entry.get("exchange_rate", 1) != invoice.get(
"exchange_rate", 1
):
allocated_amount_in_ref_rate = payment_entry.get("exchange_rate", 1) * allocated_amount
allocated_amount_in_inv_rate = invoice.get("exchange_rate", 1) * allocated_amount
allocated_amount_in_ref_rate = flt(
payment_entry.get("exchange_rate", 1) * flt(allocated_amount, allocated_amount_precision),
difference_amount_precision,
)
allocated_amount_in_inv_rate = flt(
invoice.get("exchange_rate", 1) * flt(allocated_amount, allocated_amount_precision),
difference_amount_precision,
)
difference_amount = allocated_amount_in_ref_rate - allocated_amount_in_inv_rate
return difference_amount

View File

@@ -226,7 +226,8 @@
"fetch_from": "bank_account.iban",
"fieldname": "iban",
"fieldtype": "Read Only",
"label": "IBAN"
"label": "IBAN",
"options": "IBAN"
},
{
"fetch_from": "bank_account.branch_code",
@@ -443,11 +444,12 @@
"label": "Phone Number"
}
],
"grid_page_length": 50,
"in_create": 1,
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2024-12-27 21:29:10.361894",
"modified": "2025-08-29 11:52:48.555415",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Request",
@@ -482,8 +484,9 @@
"write": 1
}
],
"row_format": "Dynamic",
"show_preview_popup": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
}

View File

@@ -127,7 +127,13 @@ class PaymentRequest(Document):
existing_payment_request_amount = flt(get_existing_payment_request_amount(ref_doc))
if existing_payment_request_amount + flt(self.grand_total) > ref_amount:
if (
flt(
existing_payment_request_amount + flt(self.grand_total, self.precision("grand_total")),
get_currency_precision(),
)
> ref_amount
):
frappe.throw(
_("Total Payment Request amount cannot be greater than {0} amount").format(
self.reference_doctype

View File

@@ -10,14 +10,19 @@
"description",
"section_break_4",
"due_date",
"invoice_portion",
"mode_of_payment",
"column_break_5",
"invoice_portion",
"due_date_based_on",
"credit_days",
"credit_months",
"section_break_6",
"discount_type",
"discount_date",
"column_break_9",
"discount",
"discount_type",
"column_break_9",
"discount_validity_based_on",
"discount_validity",
"section_break_9",
"payment_amount",
"outstanding",
@@ -172,12 +177,50 @@
"label": "Paid Amount (Company Currency)",
"options": "Company:company:default_currency",
"read_only": 1
},
{
"fieldname": "due_date_based_on",
"fieldtype": "Select",
"label": "Due Date Based On",
"options": "\nDay(s) after invoice date\nDay(s) after the end of the invoice month\nMonth(s) after the end of the invoice month",
"read_only": 1
},
{
"depends_on": "eval:in_list(['Day(s) after invoice date', 'Day(s) after the end of the invoice month'], doc.due_date_based_on)",
"fieldname": "credit_days",
"fieldtype": "Int",
"label": "Credit Days",
"non_negative": 1,
"read_only": 1
},
{
"depends_on": "eval:doc.due_date_based_on=='Month(s) after the end of the invoice month'",
"fieldname": "credit_months",
"fieldtype": "Int",
"label": "Credit Months",
"non_negative": 1,
"read_only": 1
},
{
"depends_on": "discount",
"fieldname": "discount_validity_based_on",
"fieldtype": "Select",
"label": "Discount Validity Based On",
"options": "\nDay(s) after invoice date\nDay(s) after the end of the invoice month\nMonth(s) after the end of the invoice month",
"read_only": 1
},
{
"depends_on": "discount_validity_based_on",
"fieldname": "discount_validity",
"fieldtype": "Int",
"label": "Discount Validity",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2025-03-11 11:06:51.792982",
"modified": "2025-07-31 08:38:25.820701",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Schedule",
@@ -189,4 +232,4 @@
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
}

View File

@@ -17,12 +17,27 @@ class PaymentSchedule(Document):
base_outstanding: DF.Currency
base_paid_amount: DF.Currency
base_payment_amount: DF.Currency
credit_days: DF.Int
credit_months: DF.Int
description: DF.SmallText | None
discount: DF.Float
discount_date: DF.Date | None
discount_type: DF.Literal["Percentage", "Amount"]
discount_validity: DF.Int
discount_validity_based_on: DF.Literal[
"",
"Day(s) after invoice date",
"Day(s) after the end of the invoice month",
"Month(s) after the end of the invoice month",
]
discounted_amount: DF.Currency
due_date: DF.Date
due_date_based_on: DF.Literal[
"",
"Day(s) after invoice date",
"Day(s) after the end of the invoice month",
"Month(s) after the end of the invoice month",
]
invoice_portion: DF.Percent
mode_of_payment: DF.Link | None
outstanding: DF.Currency

View File

@@ -161,4 +161,4 @@
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1
}
}

View File

@@ -4,6 +4,8 @@
frappe.ui.form.on("Period Closing Voucher", {
onload: function (frm) {
if (!frm.doc.transaction_date) frm.doc.transaction_date = frappe.datetime.obj_to_str(new Date());
frm.ignore_doctypes_on_cancel_all = ["Process Period Closing Voucher"];
},
setup: function (frm) {

View File

@@ -132,7 +132,11 @@ class PeriodClosingVoucher(AccountsController):
def on_submit(self):
self.db_set("gle_processing_status", "In Progress")
self.make_gl_entries()
if frappe.get_single_value("Accounts Settings", "use_legacy_controller_for_pcv"):
self.make_gl_entries()
else:
ppcv = frappe.get_doc({"doctype": "Process Period Closing Voucher", "parent_pcv": self.name})
ppcv.save().submit()
def on_cancel(self):
self.ignore_linked_doctypes = (
@@ -140,11 +144,29 @@ class PeriodClosingVoucher(AccountsController):
"Stock Ledger Entry",
"Payment Ledger Entry",
"Account Closing Balance",
"Process Period Closing Voucher",
)
self.block_if_future_closing_voucher_exists()
if not frappe.get_single_value("Accounts Settings", "use_legacy_controller_for_pcv"):
self.cancel_process_pcv_docs()
self.db_set("gle_processing_status", "In Progress")
self.cancel_gl_entries()
def cancel_process_pcv_docs(self):
ppcvs = frappe.db.get_all("Process Period Closing Voucher", {"parent_pcv": self.name, "docstatus": 1})
for x in ppcvs:
frappe.get_doc("Process Period Closing Voucher", x.name).cancel()
def on_trash(self):
super().on_trash()
ppcvs = frappe.db.get_all(
"Process Period Closing Voucher", {"parent_pcv": self.name, "docstatus": ["in", [1, 2]]}
)
for x in ppcvs:
frappe.delete_doc("Process Period Closing Voucher", x.name, force=True, ignore_permissions=True)
def make_gl_entries(self):
if frappe.db.estimate_count("GL Entry") > 100_000:
frappe.enqueue(

View File

@@ -14,6 +14,10 @@ from erpnext.accounts.utils import get_fiscal_year
class TestPeriodClosingVoucher(unittest.TestCase):
def setUp(self):
super().setUp()
frappe.db.set_single_value("Accounts Settings", "use_legacy_controller_for_pcv", 1)
def test_closing_entry(self):
frappe.db.sql("delete from `tabGL Entry` where company='Test PCV Company'")
frappe.db.sql("delete from `tabPeriod Closing Voucher` where company='Test PCV Company'")

View File

@@ -161,6 +161,8 @@ def get_pos_invoices(start, end, pos_profile, user):
`tabPOS Invoice`
where
owner = %s and docstatus = 1 and pos_profile = %s and ifnull(consolidated_invoice,'') = ''
order by
timestamp
""",
(user, pos_profile),
as_dict=1,

View File

@@ -0,0 +1,71 @@
// Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on("Process Period Closing Voucher", {
refresh(frm) {
if (frm.doc.docstatus == 1 && ["Queued"].find((x) => x == frm.doc.status)) {
let execute_btn = __("Start");
frm.add_custom_button(execute_btn, () => {
frm.call({
method: "erpnext.accounts.doctype.process_period_closing_voucher.process_period_closing_voucher.start_pcv_processing",
args: {
docname: frm.doc.name,
},
}).then((r) => {
if (!r.exc) {
frappe.show_alert(__("Job Started"));
frm.reload_doc();
}
});
});
}
if (frm.doc.docstatus == 1 && ["Running"].find((x) => x == frm.doc.status)) {
let execute_btn = __("Pause");
frm.add_custom_button(execute_btn, () => {
frm.call({
method: "erpnext.accounts.doctype.process_period_closing_voucher.process_period_closing_voucher.pause_pcv_processing",
args: {
docname: frm.doc.name,
},
}).then((r) => {
if (!r.exc) {
frappe.show_alert(__("PCV Paused"));
frm.reload_doc();
}
});
});
}
if (frm.doc.docstatus == 1 && ["Paused"].find((x) => x == frm.doc.status)) {
let execute_btn = __("Resume");
frm.add_custom_button(execute_btn, () => {
frm.call({
method: "erpnext.accounts.doctype.process_period_closing_voucher.process_period_closing_voucher.resume_pcv_processing",
args: {
docname: frm.doc.name,
},
}).then((r) => {
if (!r.exc) {
frappe.show_alert(__("PCV Resumed"));
frm.reload_doc();
}
});
});
}
// progress bar
let progress = 0;
let normal_finished = frm.doc.normal_balances.filter((x) => x.status == "Completed").length;
let opening_finished = frm.doc.z_opening_balances.filter((x) => x.status == "Completed").length;
progress =
((normal_finished + opening_finished) /
(frm.doc.normal_balances.length + frm.doc.z_opening_balances.length)) *
100;
frm.dashboard.add_progress("Books closure progress", progress, "");
},
});

View File

@@ -0,0 +1,113 @@
{
"actions": [],
"autoname": "format:Process-PCV-{###}",
"creation": "2025-09-25 15:44:03.534699",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"parent_pcv",
"status",
"p_l_closing_balance",
"normal_balances",
"bs_closing_balance",
"z_opening_balances",
"amended_from"
],
"fields": [
{
"fieldname": "parent_pcv",
"fieldtype": "Link",
"in_list_view": 1,
"label": "PCV",
"options": "Period Closing Voucher",
"reqd": 1
},
{
"default": "Queued",
"fieldname": "status",
"fieldtype": "Select",
"label": "Status",
"no_copy": 1,
"options": "Queued\nRunning\nPaused\nCompleted\nCancelled"
},
{
"fieldname": "amended_from",
"fieldtype": "Link",
"label": "Amended From",
"no_copy": 1,
"options": "Process Period Closing Voucher",
"print_hide": 1,
"read_only": 1,
"search_index": 1
},
{
"fieldname": "p_l_closing_balance",
"fieldtype": "JSON",
"label": "P&L Closing Balance",
"no_copy": 1
},
{
"fieldname": "normal_balances",
"fieldtype": "Table",
"label": "Dates to Process",
"no_copy": 1,
"options": "Process Period Closing Voucher Detail"
},
{
"fieldname": "z_opening_balances",
"fieldtype": "Table",
"label": "Opening Balances",
"no_copy": 1,
"options": "Process Period Closing Voucher Detail"
},
{
"fieldname": "bs_closing_balance",
"fieldtype": "JSON",
"label": "Balance Sheet Closing Balance"
}
],
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2025-11-05 11:40:24.996403",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Period Closing Voucher",
"naming_rule": "Expression",
"owner": "Administrator",
"permissions": [
{
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"submit": 1,
"write": 1
},
{
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"share": 1,
"submit": 1,
"write": 1
}
],
"row_format": "Dynamic",
"sort_field": "creation",
"sort_order": "DESC",
"states": []
}

View File

@@ -0,0 +1,559 @@
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import copy
from datetime import timedelta
import frappe
from frappe import qb
from frappe.model.document import Document
from frappe.query_builder.functions import Count, Max, Min, Sum
from frappe.utils import add_days, flt, get_datetime
from frappe.utils.scheduler import is_scheduler_inactive
from erpnext.accounts.doctype.account_closing_balance.account_closing_balance import (
make_closing_entries,
)
class ProcessPeriodClosingVoucher(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.process_period_closing_voucher_detail.process_period_closing_voucher_detail import (
ProcessPeriodClosingVoucherDetail,
)
amended_from: DF.Link | None
bs_closing_balance: DF.JSON | None
normal_balances: DF.Table[ProcessPeriodClosingVoucherDetail]
p_l_closing_balance: DF.JSON | None
parent_pcv: DF.Link
status: DF.Literal["Queued", "Running", "Paused", "Completed", "Cancelled"]
z_opening_balances: DF.Table[ProcessPeriodClosingVoucherDetail]
# end: auto-generated types
def validate(self):
self.status = "Queued"
self.populate_processing_tables()
def populate_processing_tables(self):
self.generate_pcv_dates()
self.generate_opening_balances_dates()
def get_dates(self, start, end):
return [start + timedelta(days=x) for x in range((end - start).days + 1)]
def generate_pcv_dates(self):
self.normal_balances = []
pcv = frappe.get_doc("Period Closing Voucher", self.parent_pcv)
dates = self.get_dates(get_datetime(pcv.period_start_date), get_datetime(pcv.period_end_date))
for x in dates:
self.append(
"normal_balances",
{"processing_date": x, "status": "Queued", "report_type": "Profit and Loss"},
)
self.append(
"normal_balances", {"processing_date": x, "status": "Queued", "report_type": "Balance Sheet"}
)
def generate_opening_balances_dates(self):
self.z_opening_balances = []
pcv = frappe.get_doc("Period Closing Voucher", self.parent_pcv)
if pcv.is_first_period_closing_voucher():
gl = qb.DocType("GL Entry")
min = qb.from_(gl).select(Min(gl.posting_date)).where(gl.company.eq(pcv.company)).run()[0][0]
max = qb.from_(gl).select(Max(gl.posting_date)).where(gl.company.eq(pcv.company)).run()[0][0]
dates = self.get_dates(get_datetime(min), get_datetime(max))
for x in dates:
self.append(
"z_opening_balances",
{"processing_date": x, "status": "Queued", "report_type": "Balance Sheet"},
)
def on_submit(self):
start_pcv_processing(self.name)
def on_cancel(self):
cancel_pcv_processing(self.name)
@frappe.whitelist()
def start_pcv_processing(docname: str):
if frappe.db.get_value("Process Period Closing Voucher", docname, "status") in ["Queued", "Running"]:
frappe.db.set_value("Process Period Closing Voucher", docname, "status", "Running")
if normal_balances := frappe.db.get_all(
"Process Period Closing Voucher Detail",
filters={"parent": docname, "status": "Queued"},
fields=["processing_date", "report_type", "parentfield"],
order_by="parentfield, idx, processing_date",
limit=4,
):
if not is_scheduler_inactive():
for x in normal_balances:
frappe.db.set_value(
"Process Period Closing Voucher Detail",
{
"processing_date": x.processing_date,
"parent": docname,
"report_type": x.report_type,
"parentfield": x.parentfield,
},
"status",
"Running",
)
frappe.enqueue(
method="erpnext.accounts.doctype.process_period_closing_voucher.process_period_closing_voucher.process_individual_date",
queue="long",
timeout="3600",
is_async=True,
enqueue_after_commit=True,
docname=docname,
date=x.processing_date,
report_type=x.report_type,
parentfield=x.parentfield,
)
else:
frappe.db.set_value("Process Period Closing Voucher", docname, "status", "Completed")
@frappe.whitelist()
def pause_pcv_processing(docname: str):
ppcv = qb.DocType("Process Period Closing Voucher")
qb.update(ppcv).set(ppcv.status, "Paused").where(ppcv.name.eq(docname)).run()
if queued_dates := frappe.db.get_all(
"Process Period Closing Voucher Detail",
filters={"parent": docname, "status": "Queued"},
pluck="name",
):
ppcvd = qb.DocType("Process Period Closing Voucher Detail")
qb.update(ppcvd).set(ppcvd.status, "Paused").where(ppcvd.name.isin(queued_dates)).run()
@frappe.whitelist()
def cancel_pcv_processing(docname: str):
ppcv = qb.DocType("Process Period Closing Voucher")
qb.update(ppcv).set(ppcv.status, "Cancelled").where(ppcv.name.eq(docname)).run()
if queued_dates := frappe.db.get_all(
"Process Period Closing Voucher Detail",
filters={"parent": docname, "status": "Queued"},
pluck="name",
):
ppcvd = qb.DocType("Process Period Closing Voucher Detail")
qb.update(ppcvd).set(ppcvd.status, "Cancelled").where(ppcvd.name.isin(queued_dates)).run()
@frappe.whitelist()
def resume_pcv_processing(docname: str):
ppcv = qb.DocType("Process Period Closing Voucher")
qb.update(ppcv).set(ppcv.status, "Running").where(ppcv.name.eq(docname)).run()
if paused_dates := frappe.db.get_all(
"Process Period Closing Voucher Detail",
filters={"parent": docname, "status": "Paused"},
pluck="name",
):
ppcvd = qb.DocType("Process Period Closing Voucher Detail")
qb.update(ppcvd).set(ppcvd.status, "Queued").where(ppcvd.name.isin(paused_dates)).run()
start_pcv_processing(docname)
def update_default_dimensions(dimension_fields, gl_entry, dimension_values):
for i, dimension in enumerate(dimension_fields):
gl_entry[dimension] = dimension_values[i]
def get_gle_for_pl_account(pcv, acc, balances, dimensions):
balance_in_account_currency = flt(balances.debit_in_account_currency) - flt(
balances.credit_in_account_currency
)
balance_in_company_currency = flt(balances.debit) - flt(balances.credit)
gl_entry = frappe._dict(
{
"company": pcv.company,
"posting_date": pcv.period_end_date,
"account": acc,
"account_currency": balances.account_currency,
"debit_in_account_currency": abs(balance_in_account_currency)
if balance_in_account_currency < 0
else 0,
"debit": abs(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,
"is_period_closing_voucher_entry": 1,
"voucher_type": "Period Closing Voucher",
"voucher_no": pcv.name,
"fiscal_year": pcv.fiscal_year,
"remarks": pcv.remarks,
"is_opening": "No",
}
)
# update dimensions
update_default_dimensions(get_dimensions(), gl_entry, dimensions)
return gl_entry
def get_gle_for_closing_account(pcv, dimension_balance, dimensions):
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": pcv.company,
"posting_date": pcv.period_end_date,
"account": pcv.closing_account_head,
"account_currency": frappe.db.get_value("Account", pcv.closing_account_head, "account_currency"),
"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": pcv.name,
"fiscal_year": pcv.fiscal_year,
"remarks": pcv.remarks,
"is_opening": "No",
}
)
# update dimensions
update_default_dimensions(get_dimensions(), gl_entry, dimensions)
return gl_entry
@frappe.whitelist()
def schedule_next_date(docname: str):
if to_process := frappe.db.get_all(
"Process Period Closing Voucher Detail",
filters={"parent": docname, "status": "Queued"},
fields=["processing_date", "report_type", "parentfield"],
order_by="parentfield, idx, processing_date",
limit=1,
):
if not is_scheduler_inactive():
frappe.db.set_value(
"Process Period Closing Voucher Detail",
{
"processing_date": to_process[0].processing_date,
"parent": docname,
"report_type": to_process[0].report_type,
"parentfield": to_process[0].parentfield,
},
"status",
"Running",
)
frappe.enqueue(
method="erpnext.accounts.doctype.process_period_closing_voucher.process_period_closing_voucher.process_individual_date",
queue="long",
timeout="3600",
is_async=True,
enqueue_after_commit=True,
docname=docname,
date=to_process[0].processing_date,
report_type=to_process[0].report_type,
parentfield=to_process[0].parentfield,
)
else:
ppcvd = qb.DocType("Process Period Closing Voucher Detail")
total_no_of_dates = (
qb.from_(ppcvd).select(Count(ppcvd.star)).where(ppcvd.parent.eq(docname)).run()[0][0]
)
completed = (
qb.from_(ppcvd)
.select(Count(ppcvd.star))
.where(ppcvd.parent.eq(docname) & ppcvd.status.eq("Completed"))
.run()[0][0]
)
# Ensure both normal and opening balances are processed for all dates
if total_no_of_dates == completed:
summarize_and_post_ledger_entries(docname)
def make_dict_json_compliant(dimension_wise_balance) -> dict:
"""
convert tuple -> str
JSON doesn't support dictionary with tuple keys
"""
converted_dict = {}
for k, v in dimension_wise_balance.items():
str_key = [str(x) for x in k]
str_key = ",".join(str_key)
converted_dict[str_key] = v
return converted_dict
def get_consolidated_gles(balances, report_type) -> list:
gl_entries = []
for x in balances:
if x.report_type == report_type:
closing_balances = [frappe._dict(gle) for gle in frappe.json.loads(x.closing_balance)]
gl_entries.extend(closing_balances)
return gl_entries
def get_gl_entries(docname):
"""
Calculate total closing balance of all P&L accounts across PCV start and end date
"""
ppcv = frappe.get_doc("Process Period Closing Voucher", docname)
# calculate balance
gl_entries = get_consolidated_gles(ppcv.normal_balances, "Profit and Loss")
pl_dimension_wise_acc_balance = build_dimension_wise_balance_dict(gl_entries)
# save
json_dict = make_dict_json_compliant(pl_dimension_wise_acc_balance)
frappe.db.set_value(
"Process Period Closing Voucher", docname, "p_l_closing_balance", frappe.json.dumps(json_dict)
)
# build gl map
pcv = frappe.get_doc("Period Closing Voucher", ppcv.parent_pcv)
pl_accounts_reverse_gle = []
closing_account_gle = []
for dimensions, account_balances in pl_dimension_wise_acc_balance.items():
for acc, balances in account_balances.items():
balance_in_company_currency = flt(balances.debit) - flt(balances.credit)
if balance_in_company_currency:
pl_accounts_reverse_gle.append(get_gle_for_pl_account(pcv, acc, balances, dimensions))
closing_account_gle.append(get_gle_for_closing_account(pcv, account_balances["balances"], dimensions))
return pl_accounts_reverse_gle, closing_account_gle
def calculate_balance_sheet_balance(docname):
"""
Calculate total closing balance of all P&L accounts across PCV start and end date.
If it is first PCV, opening entries are also considered
"""
ppcv = frappe.get_doc("Process Period Closing Voucher", docname)
gl_entries = get_consolidated_gles(ppcv.normal_balances + ppcv.z_opening_balances, "Balance Sheet")
# build dimension wise dictionary from all GLE's
bs_dimension_wise_acc_balance = build_dimension_wise_balance_dict(gl_entries)
# save
json_dict = make_dict_json_compliant(bs_dimension_wise_acc_balance)
frappe.db.set_value(
"Process Period Closing Voucher", docname, "bs_closing_balance", frappe.json.dumps(json_dict)
)
return bs_dimension_wise_acc_balance
def get_p_l_closing_entries(pl_gles, pcv):
pl_closing_entries = copy.deepcopy(pl_gles)
for d in pl_gles:
# reverse debit and credit
gle_copy = copy.deepcopy(d)
gle_copy.debit = d.credit
gle_copy.credit = d.debit
gle_copy.debit_in_account_currency = d.credit_in_account_currency
gle_copy.credit_in_account_currency = d.debit_in_account_currency
gle_copy.is_period_closing_voucher_entry = 0
gle_copy.period_closing_voucher = pcv.name
pl_closing_entries.append(gle_copy)
return pl_closing_entries
def get_bs_closing_entries(dimension_wise_balance, pcv):
closing_entries = []
for dimensions, account_balances in dimension_wise_balance.items():
for acc, balances in account_balances.items():
balance_in_company_currency = flt(balances.debit) - flt(balances.credit)
if acc != "balances" and balance_in_company_currency:
closing_entries.append(get_closing_entry(pcv, acc, balances, dimensions))
return closing_entries
def get_closing_account_closing_entry(closing_account_gle, pcv):
closing_entries_for_closing_account = copy.deepcopy(closing_account_gle)
for d in closing_entries_for_closing_account:
d.period_closing_voucher = pcv.name
return closing_entries_for_closing_account
def summarize_and_post_ledger_entries(docname):
# P&L accounts
pl_accounts_reverse_gle, closing_account_gle = get_gl_entries(docname)
gl_entries = pl_accounts_reverse_gle + closing_account_gle
from erpnext.accounts.general_ledger import make_gl_entries
if gl_entries:
make_gl_entries(gl_entries, merge_entries=False)
pcv_name = frappe.db.get_value("Process Period Closing Voucher", docname, "parent_pcv")
pcv = frappe.get_doc("Period Closing Voucher", pcv_name)
# Balance sheet accounts
bs_dimension_wise_acc_balance = calculate_balance_sheet_balance(docname)
pl_closing_entries = get_p_l_closing_entries(pl_accounts_reverse_gle, pcv)
bs_closing_entries = get_bs_closing_entries(bs_dimension_wise_acc_balance, pcv)
closing_entries_for_closing_account = get_closing_account_closing_entry(closing_account_gle, pcv)
closing_entries = pl_closing_entries + bs_closing_entries + closing_entries_for_closing_account
make_closing_entries(closing_entries, pcv.name, pcv.company, pcv.period_end_date)
frappe.db.set_value("Period Closing Voucher", pcv.name, "gle_processing_status", "Completed")
frappe.db.set_value("Process Period Closing Voucher", docname, "status", "Completed")
def get_closing_entry(pcv, account, balances, dimensions):
closing_entry = frappe._dict(
{
"company": pcv.company,
"closing_date": pcv.period_end_date,
"period_closing_voucher": pcv.name,
"account": account,
"account_currency": balances.account_currency,
"debit_in_account_currency": flt(balances.debit_in_account_currency),
"debit": flt(balances.debit),
"credit_in_account_currency": flt(balances.credit_in_account_currency),
"credit": flt(balances.credit),
"is_period_closing_voucher_entry": 0,
}
)
# update dimensions
update_default_dimensions(get_dimensions(), closing_entry, dimensions)
return closing_entry
def get_dimensions():
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
get_accounting_dimensions,
)
default_dimensions = ["cost_center", "finance_book", "project"]
dimensions = default_dimensions + get_accounting_dimensions()
return dimensions
def get_dimension_key(res):
return tuple([res.get(dimension) for dimension in get_dimensions()])
def build_dimension_wise_balance_dict(gl_entries):
dimension_balances = frappe._dict()
for x in gl_entries:
dimension_key = get_dimension_key(x)
dimension_balances.setdefault(dimension_key, frappe._dict()).setdefault(
x.account,
frappe._dict(
{
"debit_in_account_currency": 0,
"credit_in_account_currency": 0,
"debit": 0,
"credit": 0,
"account_currency": x.account_currency,
}
),
)
dimension_balances[dimension_key][x.account].debit_in_account_currency += flt(
x.debit_in_account_currency
)
dimension_balances[dimension_key][x.account].credit_in_account_currency += flt(
x.credit_in_account_currency
)
dimension_balances[dimension_key][x.account].debit += flt(x.debit)
dimension_balances[dimension_key][x.account].credit += flt(x.credit)
# dimension-wise total balances
dimension_balances[dimension_key].setdefault(
"balances",
frappe._dict(
{
"balance_in_account_currency": 0,
"balance_in_company_currency": 0,
}
),
)
balance_in_account_currency = flt(x.debit_in_account_currency) - flt(x.credit_in_account_currency)
balance_in_company_currency = flt(x.debit) - flt(x.credit)
dimension_balances[dimension_key][
"balances"
].balance_in_account_currency += balance_in_account_currency
dimension_balances[dimension_key][
"balances"
].balance_in_company_currency += balance_in_company_currency
return dimension_balances
def process_individual_date(docname: str, date, report_type, parentfield):
current_date_status = frappe.db.get_value(
"Process Period Closing Voucher Detail",
{"processing_date": date, "report_type": report_type, "parentfield": parentfield},
"status",
)
if current_date_status != "Running":
return
pcv_name = frappe.db.get_value("Process Period Closing Voucher", docname, "parent_pcv")
company = frappe.db.get_value("Period Closing Voucher", pcv_name, "company")
dimensions = get_dimensions()
accounts = frappe.db.get_all(
"Account", filters={"company": company, "report_type": report_type}, pluck="name"
)
# summarize
gle = qb.DocType("GL Entry")
query = qb.from_(gle).select(gle.account)
for dim in dimensions:
query = query.select(gle[dim])
query = query.select(
Sum(gle.debit).as_("debit"),
Sum(gle.credit).as_("credit"),
Sum(gle.debit_in_account_currency).as_("debit_in_account_currency"),
Sum(gle.credit_in_account_currency).as_("credit_in_account_currency"),
gle.account_currency,
).where(
(gle.company.eq(company))
& (gle.is_cancelled.eq(0))
& (gle.posting_date.eq(date))
& (gle.account.isin(accounts))
)
if parentfield == "z_opening_balances":
query = query.where(gle.is_opening.eq("Yes"))
query = query.groupby(gle.account)
for dim in dimensions:
query = query.groupby(gle[dim])
res = query.run(as_dict=True)
# save results
frappe.db.set_value(
"Process Period Closing Voucher Detail",
{"processing_date": date, "parent": docname, "report_type": report_type, "parentfield": parentfield},
"closing_balance",
frappe.json.dumps(res),
)
frappe.db.set_value(
"Process Period Closing Voucher Detail",
{"processing_date": date, "parent": docname, "report_type": report_type, "parentfield": parentfield},
"status",
"Completed",
)
# chain call
schedule_next_date(docname)

View File

@@ -0,0 +1,4 @@
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe

View File

@@ -0,0 +1,58 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2025-10-01 15:58:17.544153",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"processing_date",
"report_type",
"status",
"closing_balance"
],
"fields": [
{
"fieldname": "processing_date",
"fieldtype": "Date",
"in_list_view": 1,
"label": "Processing Date"
},
{
"default": "Queued",
"fieldname": "status",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Status",
"options": "Queued\nRunning\nPaused\nCompleted\nCancelled"
},
{
"fieldname": "closing_balance",
"fieldtype": "JSON",
"in_list_view": 1,
"label": "Closing Balance"
},
{
"default": "Profit and Loss",
"fieldname": "report_type",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Report Type",
"options": "Profit and Loss\nBalance Sheet"
}
],
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2025-10-20 12:03:59.106931",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Period Closing Voucher Detail",
"owner": "Administrator",
"permissions": [],
"row_format": "Dynamic",
"rows_threshold_for_grid_search": 20,
"sort_field": "creation",
"sort_order": "DESC",
"states": []
}

View File

@@ -0,0 +1,26 @@
# 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 ProcessPeriodClosingVoucherDetail(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
closing_balance: DF.JSON | None
parent: DF.Data
parentfield: DF.Data
parenttype: DF.Data
processing_date: DF.Date | None
report_type: DF.Literal["Profit and Loss", "Balance Sheet"]
status: DF.Literal["Queued", "Running", "Paused", "Completed", "Cancelled"]
# end: auto-generated types
pass

View File

@@ -2150,19 +2150,16 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
rate = flt(sle.stock_value_difference) / flt(sle.actual_qty)
self.assertAlmostEqual(rate, 500)
@change_settings("Accounts Settings", {"automatically_fetch_payment_terms": 1})
def test_payment_allocation_for_payment_terms(self):
from erpnext.buying.doctype.purchase_order.test_purchase_order import (
create_pr_against_po,
create_purchase_order,
)
from erpnext.selling.doctype.sales_order.test_sales_order import (
automatically_fetch_payment_terms,
)
from erpnext.stock.doctype.purchase_receipt.purchase_receipt import (
make_purchase_invoice as make_pi_from_pr,
)
automatically_fetch_payment_terms()
frappe.db.set_value(
"Payment Terms Template",
"_Test Payment Term Template",
@@ -2188,7 +2185,6 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
pi = make_pi_from_pr(pr.name)
self.assertEqual(pi.payment_schedule[0].payment_amount, 1000)
automatically_fetch_payment_terms(enable=0)
frappe.db.set_value(
"Payment Terms Template",
"_Test Payment Term Template",
@@ -2644,6 +2640,38 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
frappe.db.set_single_value("Buying Settings", "maintain_same_rate", 1)
@change_settings(
"Buying Settings", {"maintain_same_rate": 0, "set_landed_cost_based_on_purchase_invoice_rate": 1}
)
def test_pr_status_rate_adjusted_from_pi(self):
pr = make_purchase_receipt(qty=5, rate=100)
pi = create_purchase_invoice_from_receipt(pr.name)
pi.submit()
pr.reload()
# Inital check
self.assertEqual(pr.status, "Completed")
pi.reload()
pi.cancel()
pi = create_purchase_invoice_from_receipt(pr.name)
pi.items[0].rate = 80
pi.submit()
pr.reload()
# Test 1 : Adjustment amount is negative
self.assertEqual(pr.status, "Completed")
pi.reload()
pi.cancel()
pi = create_purchase_invoice_from_receipt(pr.name)
pi.items[0].rate = 120
pi.submit()
pr.reload()
# Test 2 : Adjustment amount is positive
self.assertEqual(pr.status, "Completed")
def test_opening_invoice_rounding_adjustment_validation(self):
pi = make_purchase_invoice(do_not_save=1)
pi.items[0].rate = 99.98

View File

@@ -912,7 +912,8 @@
"label": "Rejected Serial and Batch Bundle",
"no_copy": 1,
"options": "Serial and Batch Bundle",
"print_hide": 1
"print_hide": 1,
"search_index": 1
},
{
"fieldname": "wip_composite_asset",
@@ -983,7 +984,7 @@
"idx": 1,
"istable": 1,
"links": [],
"modified": "2025-03-12 16:33:13.453290",
"modified": "2025-10-14 13:01:54.441511",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",
@@ -993,4 +994,4 @@
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
}

View File

@@ -22,6 +22,7 @@
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"project",
"section_break_9",
"account_currency",
"tax_amount",
@@ -211,6 +212,13 @@
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
},
{
"allow_on_submit": 1,
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
"options": "Project"
},
{
"default": "0",
"depends_on": "eval:['Purchase Taxes and Charges Template', 'Payment Entry'].includes(parent.doctype)",

View File

@@ -798,6 +798,15 @@ frappe.ui.form.on("Sales Invoice", {
},
};
};
frm.set_query("sales_person", "sales_team", function () {
return {
filters: {
is_group: 0,
enabled: 1,
},
};
});
},
onload: function (frm) {
frm.redemption_conversion_factor = null;

View File

@@ -281,6 +281,7 @@
"read_only": 1
},
{
"fetch_from": "customer.tax_id",
"fieldname": "tax_id",
"fieldtype": "Data",
"hide_days": 1,
@@ -2198,7 +2199,7 @@
"link_fieldname": "consolidated_invoice"
}
],
"modified": "2025-08-04 19:20:28.732039",
"modified": "2025-09-09 14:48:59.472826",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",

View File

@@ -2411,6 +2411,9 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
target.purchase_order = source.purchase_order
target.po_detail = source.purchase_order_item
if (source.get("serial_no") or source.get("batch_no")) and not source.get("serial_and_batch_bundle"):
target.use_serial_batch_fields = 1
item_field_map = {
"doctype": target_doctype + " Item",
"field_no_map": ["income_account", "expense_account", "cost_center", "warehouse"],

View File

@@ -16,6 +16,7 @@
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"project",
"section_break_8",
"rate",
"section_break_9",
@@ -188,6 +189,13 @@
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
},
{
"allow_on_submit": 1,
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
"options": "Project"
},
{
"default": "0",
"depends_on": "eval:['Sales Taxes and Charges Template', 'Payment Entry'].includes(parent.doctype)",

View File

@@ -16,6 +16,7 @@
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"project",
"shipping_amount_section",
"calculate_based_on",
"column_break_8",
@@ -136,6 +137,12 @@
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
},
{
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
"options": "Project"
}
],
"icon": "fa fa-truck",

View File

@@ -483,18 +483,23 @@ class Subscription(Document):
return invoice
def get_items_from_plans(self, plans: list[dict[str, str]], prorate: bool | None = None) -> list[dict]:
def get_items_from_plans(self, plans: list[dict[str, str]], prorate: int = 0) -> list[dict]:
"""
Returns the `Item`s linked to `Subscription Plan`
"""
if prorate is None:
prorate = False
prorate_factor = 1
if prorate:
prorate_factor = get_prorata_factor(
self.current_invoice_end,
self.current_invoice_start,
cint(self.generate_invoice_at == "Beginning of the current subscription period"),
cint(
self.generate_invoice_at
in [
"Beginning of the current subscription period",
"Days before the current subscription period",
]
),
)
items = []
@@ -511,33 +516,19 @@ class Subscription(Document):
deferred = frappe.db.get_value("Item", item_code, deferred_field)
if not prorate:
item = {
"item_code": item_code,
"qty": plan.qty,
"rate": get_plan_rate(
plan.plan,
plan.qty,
party,
self.current_invoice_start,
self.current_invoice_end,
),
"cost_center": plan_doc.cost_center,
}
else:
item = {
"item_code": item_code,
"qty": plan.qty,
"rate": get_plan_rate(
plan.plan,
plan.qty,
party,
self.current_invoice_start,
self.current_invoice_end,
prorate_factor,
),
"cost_center": plan_doc.cost_center,
}
item = {
"item_code": item_code,
"qty": plan.qty,
"rate": get_plan_rate(
plan.plan,
plan.qty,
party,
self.current_invoice_start,
self.current_invoice_end,
prorate_factor,
),
"cost_center": plan_doc.cost_center,
}
if deferred:
item.update(

View File

@@ -8,6 +8,7 @@ from frappe.utils.data import (
add_days,
add_months,
add_to_date,
add_years,
cint,
date_diff,
flt,
@@ -555,6 +556,33 @@ class TestSubscription(FrappeTestCase):
subscription.reload()
self.assertEqual(len(subscription.invoices), 0)
def test_invoice_generation_days_before_subscription_period_with_prorate(self):
settings = frappe.get_single("Subscription Settings")
settings.prorate = 1
settings.save()
create_plan(
plan_name="_Test Plan Name 5",
cost=1000,
billing_interval="Year",
billing_interval_count=1,
currency="INR",
)
start_date = add_days(nowdate(), 2)
subscription = create_subscription(
start_date=start_date,
party_type="Supplier",
party="_Test Supplier",
generate_invoice_at="Days before the current subscription period",
generate_new_invoices_past_due_date=1,
number_of_days=2,
plans=[{"plan": "_Test Plan Name 5", "qty": 1}],
)
subscription.process(nowdate())
self.assertEqual(len(subscription.invoices), 1)
def make_plans():
create_plan(plan_name="_Test Plan Name", cost=900, currency="INR")

View File

@@ -648,6 +648,7 @@ def make_reverse_gl_entries(
adv_adj=False,
update_outstanding="Yes",
partial_cancel=False,
posting_date=None,
):
"""
Get original gl entries of the voucher
@@ -745,6 +746,8 @@ def make_reverse_gl_entries(
if immutable_ledger_enabled:
new_gle["is_cancelled"] = 0
new_gle["posting_date"] = frappe.form_dict.get("posting_date") or getdate()
elif posting_date:
new_gle["posting_date"] = posting_date
if new_gle["debit"] or new_gle["credit"]:
make_entry(new_gle, adv_adj, "Yes")

View File

@@ -164,6 +164,12 @@
{% } %}
</tr>
</thead>
<div class="show-filters">
{% if subtitle %}
{{ subtitle }}
<hr>
{% endif %}
</div>
<tbody>
{% for(var i=0, l=data.length; i<l; i++) { %}
<tr>

View File

@@ -664,7 +664,16 @@ class ReceivablePayableReport:
invoiced = d.base_payment_amount
paid_amount = d.base_paid_amount
if company_currency == d.party_account_currency or self.filters.get("in_party_currency"):
in_party_currency = self.filters.get("in_party_currency")
# company, billing, and party account currencies are the same
if company_currency == d.currency and company_currency == d.party_account_currency:
in_party_currency = False
# When filtered by party currency and the billing currency not matches the party account currency
if in_party_currency and d.currency != d.party_account_currency:
in_party_currency = False
if in_party_currency:
invoiced = d.payment_amount
paid_amount = d.paid_amount
@@ -974,6 +983,7 @@ class ReceivablePayableReport:
if self.account_type == "Receivable":
self.add_customer_filters()
self.exclude_employee_transaction()
elif self.account_type == "Payable":
self.add_supplier_filters()
@@ -1053,6 +1063,9 @@ class ReceivablePayableReport:
)
)
def exclude_employee_transaction(self):
self.qb_selection_filter.append(self.ple.party_type != "Employee")
def add_supplier_filters(self):
supplier = qb.DocType("Supplier")
if self.filters.get("supplier_group"):
@@ -1266,7 +1279,7 @@ class ReceivablePayableReport:
def setup_ageing_columns(self):
# for charts
self.ageing_column_labels = []
ranges = [*self.ranges, "Above"]
ranges = [*self.ranges, _("Above")]
prev_range_value = 0
for idx, curr_range_value in enumerate(ranges):

View File

@@ -199,6 +199,81 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase):
row = report[1]
self.assertTrue(len(row) == 0)
@change_settings(
"Accounts Settings",
{"allow_multi_currency_invoices_against_single_party_account": 1},
)
def test_allow_multi_currency_invoices_against_single_party_account(self):
filters = {
"company": self.company,
"based_on_payment_terms": 1,
"report_date": today(),
"range": "30, 60, 90, 120",
"show_remarks": True,
"in_party_currency": 1,
}
# CASE 1: Company currency and party account currency are the same
si = self.create_sales_invoice(qty=1, no_payment_schedule=True, do_not_submit=True)
si.currency = "USD"
si.conversion_rate = 80
si.save().submit()
filters.update(
{
"party_type": "Customer",
"party": [self.customer],
}
)
report = execute(filters)
row = report[1][0]
expected_data = [8000, 8000, "No Remarks"] # Data in company currency
self.assertEqual(expected_data, [row.invoice_grand_total, row.invoiced, row.remarks])
# CASE 2: Transaction currency and party account currency are the same
self.create_customer(
"USD Customer", currency="USD", default_account=self.debtors_usd, company=self.company
)
si = create_sales_invoice(
item=self.item,
company=self.company,
customer=self.customer,
debit_to=self.debtors_usd,
posting_date=today(),
parent_cost_center=self.cost_center,
cost_center=self.cost_center,
rate=100,
currency="USD",
conversion_rate=80,
price_list_rate=100,
do_not_save=1,
)
si.save().submit()
filters.update(
{
"party_type": "Customer",
"party": [self.customer],
}
)
report = execute(filters)
row = report[1][0]
expected_data = [100, 100, "No Remarks"] # Data in Part Account Currency
self.assertEqual(expected_data, [row.invoice_grand_total, row.invoiced, row.remarks])
# View in Company currency
filters.pop("in_party_currency")
report = execute(filters)
row = report[1][0]
expected_data = [8000, 8000, "No Remarks"] # Data in Company Currency
self.assertEqual(expected_data, [row.invoice_grand_total, row.invoiced, row.remarks])
def test_accounts_receivable_with_partial_payment(self):
filters = {
"company": self.company,

View File

@@ -171,7 +171,7 @@ class AccountsReceivableSummary(ReceivablePayableReport):
self.add_column(_("Difference"), fieldname="diff")
self.setup_ageing_columns()
self.add_column(label="Total Amount Due", fieldname="total_due")
self.add_column(label=_("Total Amount Due"), fieldname="total_due")
if self.filters.show_future_payments:
self.add_column(label=_("Future Payment Amount"), fieldname="future_amount")

View File

@@ -273,6 +273,7 @@ def get_asset_value_adjustment_map_by_category(filters):
AND a.company = %(company)s
AND a.purchase_date <= %(to_date)s
AND gle.account = aca.fixed_asset_account
AND gle.is_opening = 'No'
GROUP BY a.asset_category
""",
{"from_date": filters.from_date, "to_date": filters.to_date, "company": filters.company},
@@ -354,7 +355,7 @@ def get_asset_details_for_grouped_by_category(filters):
# nosemgrep
return frappe.db.sql(
f"""
SELECT a.name,
SELECT a.name, a.asset_name,
ifnull(sum(case when a.purchase_date < %(from_date)s then
case when ifnull(a.disposal_date, 0) = 0 or a.disposal_date >= %(from_date)s then
a.gross_purchase_amount
@@ -543,6 +544,7 @@ def get_asset_value_adjustment_map(filters):
AND a.company = %(company)s
AND a.purchase_date <= %(to_date)s
AND gle.account = aca.fixed_asset_account
AND gle.is_opening = 'No'
GROUP BY a.name
""",
{"from_date": filters.from_date, "to_date": filters.to_date, "company": filters.company},
@@ -583,6 +585,14 @@ def get_columns(filters):
"width": 120,
}
)
columns.append(
{
"label": _("Asset Name"),
"fieldname": "asset_name",
"fieldtype": "Data",
"width": 140,
}
)
columns += [
{

View File

@@ -5,28 +5,33 @@ frappe.query_reports["Balance Sheet"] = $.extend({}, erpnext.financial_statement
erpnext.utils.add_dimensions("Balance Sheet", 10);
frappe.query_reports["Balance Sheet"]["filters"].push({
fieldname: "selected_view",
label: __("Select View"),
fieldtype: "Select",
options: [
{ value: "Report", label: __("Report View") },
{ value: "Growth", label: __("Growth View") },
],
default: "Report",
reqd: 1,
});
frappe.query_reports["Balance Sheet"]["filters"].push({
fieldname: "accumulated_values",
label: __("Accumulated Values"),
fieldtype: "Check",
default: 1,
});
frappe.query_reports["Balance Sheet"]["filters"].push({
fieldname: "include_default_book_entries",
label: __("Include Default FB Entries"),
fieldtype: "Check",
default: 1,
});
frappe.query_reports["Balance Sheet"]["filters"].push(
{
fieldname: "selected_view",
label: __("Select View"),
fieldtype: "Select",
options: [
{ value: "Report", label: __("Report View") },
{ value: "Growth", label: __("Growth View") },
],
default: "Report",
reqd: 1,
},
{
fieldname: "accumulated_values",
label: __("Accumulated Values"),
fieldtype: "Check",
default: 1,
},
{
fieldname: "include_default_book_entries",
label: __("Include Default FB Entries"),
fieldtype: "Check",
default: 1,
},
{
fieldname: "show_zero_values",
label: __("Show zero values"),
fieldtype: "Check",
}
);

View File

@@ -38,6 +38,7 @@ from erpnext.accounts.report.profit_and_loss_statement.profit_and_loss_statement
get_report_summary as get_pl_summary,
)
from erpnext.accounts.report.utils import convert, convert_to_presentation_currency
from erpnext.accounts.utils import get_zero_cutoff
def execute(filters=None):
@@ -563,7 +564,7 @@ def prepare_data(accounts, start_date, end_date, balance_must_be, companies, com
row[company] = flt(d.get(company, 0.0), 3)
if abs(row[company]) >= 0.005:
if abs(row[company]) >= get_zero_cutoff(filters.presentation_currency):
# ignore zero values
has_value = True
total += flt(row[company])

View File

@@ -12,6 +12,7 @@ from erpnext.accounts.report.financial_statements import (
filter_out_zero_value_rows,
)
from erpnext.accounts.report.trial_balance.trial_balance import validate_filters
from erpnext.accounts.utils import get_zero_cutoff
def execute(filters=None):
@@ -154,7 +155,7 @@ def prepare_data(accounts, filters, company_currency, dimension_list):
for dimension in dimension_list:
row[frappe.scrub(dimension)] = flt(d.get(frappe.scrub(dimension), 0.0), 3)
if abs(row[frappe.scrub(dimension)]) >= 0.005:
if abs(row[frappe.scrub(dimension)]) >= get_zero_cutoff(company_currency):
# ignore zero values
has_value = True
total += flt(d.get(frappe.scrub(dimension), 0.0), 3)

View File

@@ -52,7 +52,7 @@ frappe.query_reports["Financial Ratios"] = {
},
],
formatter: function (value, row, column, data, default_formatter) {
let heading_ratios = ["Liquidity Ratios", "Solvency Ratios", "Turnover Ratios"];
let heading_ratios = [__("Liquidity Ratios"), __("Solvency Ratios"), __("Turnover Ratios")];
if (heading_ratios.includes(value)) {
value = $(`<span>${value}</span>`);
@@ -60,7 +60,7 @@ frappe.query_reports["Financial Ratios"] = {
value = $value.wrap("<p></p>").parent().html();
}
if (heading_ratios.includes(row[1].content) && column.fieldtype == "Float") {
if (heading_ratios.includes(row[1]?.content) && column.fieldtype == "Float") {
column.fieldtype = "Data";
}

View File

@@ -147,9 +147,9 @@ def get_gl_data(filters, period_list, years):
def add_liquidity_ratios(data, years, current_asset, current_liability, quick_asset):
precision = frappe.db.get_single_value("System Settings", "float_precision")
data.append({"ratio": "Liquidity Ratios"})
data.append({"ratio": _("Liquidity Ratios")})
ratio_data = [["Current Ratio", current_asset], ["Quick Ratio", quick_asset]]
ratio_data = [[_("Current Ratio"), current_asset], [_("Quick Ratio"), quick_asset]]
for d in ratio_data:
row = {
@@ -165,13 +165,13 @@ def add_solvency_ratios(
data, years, total_asset, total_liability, net_sales, cogs, total_income, total_expense
):
precision = frappe.db.get_single_value("System Settings", "float_precision")
data.append({"ratio": "Solvency Ratios"})
data.append({"ratio": _("Solvency Ratios")})
debt_equity_ratio = {"ratio": "Debt Equity Ratio"}
gross_profit_ratio = {"ratio": "Gross Profit Ratio"}
net_profit_ratio = {"ratio": "Net Profit Ratio"}
return_on_asset_ratio = {"ratio": "Return on Asset Ratio"}
return_on_equity_ratio = {"ratio": "Return on Equity Ratio"}
debt_equity_ratio = {"ratio": _("Debt Equity Ratio")}
gross_profit_ratio = {"ratio": _("Gross Profit Ratio")}
net_profit_ratio = {"ratio": _("Net Profit Ratio")}
return_on_asset_ratio = {"ratio": _("Return on Asset Ratio")}
return_on_equity_ratio = {"ratio": _("Return on Equity Ratio")}
for year in years:
profit_after_tax = flt(total_income.get(year)) + flt(total_expense.get(year))
@@ -195,7 +195,7 @@ def add_solvency_ratios(
def add_turnover_ratios(data, years, period_list, filters, total_asset, net_sales, cogs, direct_expense):
precision = frappe.db.get_single_value("System Settings", "float_precision")
data.append({"ratio": "Turnover Ratios"})
data.append({"ratio": _("Turnover Ratios")})
avg_data = {}
for d in ["Receivable", "Payable", "Stock"]:
@@ -208,10 +208,10 @@ def add_turnover_ratios(data, years, period_list, filters, total_asset, net_sale
)
ratio_data = [
["Fixed Asset Turnover Ratio", net_sales, total_asset],
["Debtor Turnover Ratio", net_sales, avg_debtors],
["Creditor Turnover Ratio", direct_expense, avg_creditors],
["Inventory Turnover Ratio", cogs, avg_stock],
[_("Fixed Asset Turnover Ratio"), net_sales, total_asset],
[_("Debtor Turnover Ratio"), net_sales, avg_debtors],
[_("Creditor Turnover Ratio"), direct_expense, avg_creditors],
[_("Inventory Turnover Ratio"), cogs, avg_stock],
]
for ratio in ratio_data:
row = {

View File

@@ -34,6 +34,12 @@
</h5>
{% } %}
<hr>
<div class="show-filters">
{% if subtitle %}
{{ subtitle }}
<hr>
{% endif %}
</div>
<table class="table table-bordered">
<thead>
<tr>

View File

@@ -18,7 +18,7 @@ from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
get_dimension_with_children,
)
from erpnext.accounts.report.utils import convert_to_presentation_currency, get_currency
from erpnext.accounts.utils import get_fiscal_year
from erpnext.accounts.utils import get_fiscal_year, get_zero_cutoff
def get_period_list(
@@ -212,7 +212,7 @@ def get_data(
company_currency,
accumulated_values=filters.accumulated_values,
)
out = filter_out_zero_value_rows(out, parent_children_map)
out = filter_out_zero_value_rows(out, parent_children_map, filters.show_zero_values)
if out and total:
add_total_row(out, root_type, balance_must_be, period_list, company_currency)
@@ -304,7 +304,7 @@ def prepare_data(accounts, balance_must_be, period_list, company_currency, accum
row[period.key] = flt(d.get(period.key, 0.0), 3)
if abs(row[period.key]) >= 0.005:
if abs(row[period.key]) >= get_zero_cutoff(company_currency):
# ignore zero values
has_value = True
total += flt(row[period.key])
@@ -323,18 +323,24 @@ def prepare_data(accounts, balance_must_be, period_list, company_currency, accum
def filter_out_zero_value_rows(data, parent_children_map, show_zero_values=False):
def get_all_parents(account, parent_children_map):
for parent, children in parent_children_map.items():
for child in children:
if child["name"] == account and parent:
accounts_to_show.add(parent)
get_all_parents(parent, parent_children_map)
data_with_value = []
accounts_to_show = set()
for d in data:
if show_zero_values or d.get("has_value"):
accounts_to_show.add(d.get("account"))
get_all_parents(d.get("account"), parent_children_map)
for d in data:
if d.get("account") in accounts_to_show:
data_with_value.append(d)
else:
# show group with zero balance, if there are balances against child
children = [child.name for child in parent_children_map.get(d.get("account")) or []]
if children:
for row in data:
if row.get("account") in children and row.get("has_value"):
data_with_value.append(d)
break
return data_with_value

View File

@@ -21,6 +21,12 @@
{%= frappe.datetime.str_to_user(filters.to_date) %}
</h5>
<hr>
<div class="show-filters">
{% if subtitle %}
{{ subtitle }}
<hr>
{% endif %}
</div>
<table class="table table-bordered">
<thead>
<tr>

View File

@@ -645,7 +645,7 @@ def get_columns(filters):
"options": "GL Entry",
"hidden": 1,
},
{"label": _("Posting Date"), "fieldname": "posting_date", "fieldtype": "Date", "width": 100},
{"label": _("Posting Date"), "fieldname": "posting_date", "fieldtype": "Date", "width": 120},
{
"label": _("Account"),
"fieldname": "account",

View File

@@ -85,6 +85,12 @@ frappe.query_reports["Gross Profit"] = {
});
},
},
{
fieldname: "include_returned_invoices",
label: __("Include Returned Invoices (Stand-alone)"),
fieldtype: "Check",
default: 1,
},
],
tree: true,
name_field: "parent",

View File

@@ -178,7 +178,12 @@ def get_data_when_grouped_by_invoice(columns, gross_profit_data, filters, group_
# to display item as Item Code: Item Name
columns[0] = "Sales Invoice:Link/Item:300"
# removing Item Code and Item Name columns
del columns[4:6]
supplier_master_name = frappe.db.get_single_value("Buying Settings", "supp_master_name")
customer_master_name = frappe.db.get_single_value("Selling Settings", "cust_master_name")
if supplier_master_name == "Supplier Name" and customer_master_name == "Customer Name":
del columns[4:6]
else:
del columns[5:7]
total_base_amount = 0
total_buying_amount = 0
@@ -226,6 +231,15 @@ def get_data_when_not_grouped_by_invoice(gross_profit_data, filters, group_wise_
group_columns = group_wise_columns.get(scrub(filters.group_by))
# removing customer_name from group columns
customer_master_name = frappe.db.get_single_value("Selling Settings", "cust_master_name")
supplier_master_name = frappe.db.get_single_value("Buying Settings", "supp_master_name")
if "customer_name" in group_columns and (
supplier_master_name == "Supplier Name" and customer_master_name == "Customer Name"
):
group_columns = [col for col in group_columns if col != "customer_name"]
for src in gross_profit_data.grouped_data:
total_base_amount += src.base_amount or 0.00
total_buying_amount += src.buying_amount or 0.00
@@ -275,7 +289,7 @@ def get_columns(group_wise_columns, filters):
"label": _("Posting Date"),
"fieldname": "posting_date",
"fieldtype": "Date",
"width": 100,
"width": 120,
},
"posting_time": {
"label": _("Posting Time"),
@@ -677,7 +691,9 @@ class GrossProfitGenerator:
si.name = si_item.parent
and si.docstatus = 1
and si.is_return = 1
and si.posting_date between %(from_date)s and %(to_date)s
""",
{"from_date": self.filters.from_date, "to_date": self.filters.to_date},
as_dict=1,
)
@@ -843,7 +859,10 @@ class GrossProfitGenerator:
if self.filters.to_date:
conditions += " and posting_date <= %(to_date)s"
conditions += " and (is_return = 0 or (is_return=1 and return_against is null))"
if self.filters.include_returned_invoices:
conditions += " and (is_return = 0 or (is_return=1 and return_against is null))"
else:
conditions += " and is_return = 0"
if self.filters.item_group:
conditions += f" and {get_item_group_condition(self.filters.item_group)}"

View File

@@ -1,9 +1,9 @@
import frappe
from frappe import qb
from frappe.tests.utils import FrappeTestCase
from frappe.utils import flt, nowdate
from frappe.utils import add_days, flt, get_first_day, get_last_day, nowdate
from erpnext.accounts.doctype.sales_invoice.sales_invoice import make_delivery_note
from erpnext.accounts.doctype.sales_invoice.sales_invoice import make_delivery_note, make_sales_return
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.report.gross_profit.gross_profit import execute
from erpnext.stock.doctype.delivery_note.delivery_note import make_sales_invoice
@@ -392,7 +392,6 @@ class TestGrossProfit(FrappeTestCase):
"""
Item Qty for Sales Invoices with multiple instances of same item go in the -ve. Ideally, the credit noteshould cancel out the invoice items.
"""
from erpnext.accounts.doctype.sales_invoice.sales_invoice import make_sales_return
# Invoice with an item added twice
sinv = self.create_sales_invoice(qty=1, rate=100, posting_date=nowdate(), do_not_submit=True)
@@ -443,7 +442,11 @@ class TestGrossProfit(FrappeTestCase):
sinv = sinv.save().submit()
filters = frappe._dict(
company=self.company, from_date=nowdate(), to_date=nowdate(), group_by="Invoice"
company=self.company,
from_date=nowdate(),
to_date=nowdate(),
group_by="Invoice",
include_returned_invoices=1,
)
columns, data = execute(filters=filters)
@@ -635,3 +638,42 @@ class TestGrossProfit(FrappeTestCase):
self.assertEqual(total.buying_amount, 0.0)
self.assertEqual(total.gross_profit, 100.0)
self.assertEqual(total.get("gross_profit_%"), 100.0)
def test_profit_for_later_period_return(self):
month_start_date, month_end_date = get_first_day(nowdate()), get_last_day(nowdate())
# create sales invoice on month start date
sinv = self.create_sales_invoice(qty=1, rate=100, do_not_save=True, do_not_submit=True)
sinv.set_posting_time = 1
sinv.posting_date = month_start_date
sinv.save().submit()
# create credit note on next month start date
cr_note = make_sales_return(sinv.name)
cr_note.set_posting_time = 1
cr_note.posting_date = add_days(month_end_date, 1)
cr_note.save().submit()
# apply filters for invoiced period
filters = frappe._dict(
company=self.company, from_date=month_start_date, to_date=month_end_date, group_by="Invoice"
)
_, data = execute(filters=filters)
total = data[-1]
self.assertEqual(total.selling_amount, 100.0)
self.assertEqual(total.buying_amount, 0.0)
self.assertEqual(total.gross_profit, 100.0)
self.assertEqual(total.get("gross_profit_%"), 100.0)
# extend filters upto returned period
filters.update(to_date=add_days(month_end_date, 1))
_, data = execute(filters=filters)
total = data[-1]
self.assertEqual(total.selling_amount, 0.0)
self.assertEqual(total.buying_amount, 0.0)
self.assertEqual(total.gross_profit, 0.0)
self.assertEqual(total.get("gross_profit_%"), 0.0)

View File

@@ -5,29 +5,34 @@ frappe.query_reports["Profit and Loss Statement"] = $.extend({}, erpnext.financi
erpnext.utils.add_dimensions("Profit and Loss Statement", 10);
frappe.query_reports["Profit and Loss Statement"]["filters"].push({
fieldname: "selected_view",
label: __("Select View"),
fieldtype: "Select",
options: [
{ value: "Report", label: __("Report View") },
{ value: "Growth", label: __("Growth View") },
{ value: "Margin", label: __("Margin View") },
],
default: "Report",
reqd: 1,
});
frappe.query_reports["Profit and Loss Statement"]["filters"].push({
fieldname: "accumulated_values",
label: __("Accumulated Values"),
fieldtype: "Check",
default: 1,
});
frappe.query_reports["Profit and Loss Statement"]["filters"].push({
fieldname: "include_default_book_entries",
label: __("Include Default FB Entries"),
fieldtype: "Check",
default: 1,
});
frappe.query_reports["Profit and Loss Statement"]["filters"].push(
{
fieldname: "selected_view",
label: __("Select View"),
fieldtype: "Select",
options: [
{ value: "Report", label: __("Report View") },
{ value: "Growth", label: __("Growth View") },
{ value: "Margin", label: __("Margin View") },
],
default: "Report",
reqd: 1,
},
{
fieldname: "accumulated_values",
label: __("Accumulated Values"),
fieldtype: "Check",
default: 1,
},
{
fieldname: "include_default_book_entries",
label: __("Include Default FB Entries"),
fieldtype: "Check",
default: 1,
},
{
fieldname: "show_zero_values",
label: __("Show zero values"),
fieldtype: "Check",
}
);

View File

@@ -12,6 +12,7 @@ from erpnext.accounts.report.financial_statements import (
filter_out_zero_value_rows,
)
from erpnext.accounts.report.trial_balance.trial_balance import validate_filters
from erpnext.accounts.utils import get_zero_cutoff
value_fields = ("income", "expense", "gross_profit_loss")
@@ -149,7 +150,7 @@ def prepare_data(accounts, filters, total_row, parent_children_map, based_on):
for key in value_fields:
row[key] = flt(d.get(key, 0.0), 3)
if abs(row[key]) >= 0.005:
if abs(row[key]) >= get_zero_cutoff(company_currency):
# ignore zero values
has_value = True

View File

@@ -18,6 +18,7 @@ from erpnext.accounts.report.financial_statements import (
set_gl_entries_by_account,
)
from erpnext.accounts.report.utils import convert_to_presentation_currency, get_currency
from erpnext.accounts.utils import get_zero_cutoff
value_fields = (
"opening_debit",
@@ -215,7 +216,7 @@ def get_opening_balance(
ignore_is_opening=0,
):
closing_balance = frappe.qb.DocType(doctype)
account = frappe.qb.DocType("Account")
accounts = frappe.db.get_all("Account", filters={"report_type": report_type}, pluck="name")
opening_balance = (
frappe.qb.from_(closing_balance)
@@ -227,14 +228,7 @@ def get_opening_balance(
Sum(closing_balance.debit_in_account_currency).as_("debit_in_account_currency"),
Sum(closing_balance.credit_in_account_currency).as_("credit_in_account_currency"),
)
.where(
(closing_balance.company == filters.company)
& (
closing_balance.account.isin(
frappe.qb.from_(account).select("name").where(account.report_type == report_type)
)
)
)
.where((closing_balance.company == filters.company) & (closing_balance.account.isin(accounts)))
.groupby(closing_balance.account)
)
@@ -289,21 +283,24 @@ def get_opening_balance(
if filters.project:
opening_balance = opening_balance.where(closing_balance.project == filters.project)
if filters.get("include_default_book_entries"):
company_fb = frappe.get_cached_value("Company", filters.company, "default_finance_book")
if frappe.db.count("Finance Book"):
if filters.get("include_default_book_entries"):
company_fb = frappe.get_cached_value("Company", filters.company, "default_finance_book")
if filters.finance_book and company_fb and cstr(filters.finance_book) != cstr(company_fb):
frappe.throw(_("To use a different finance book, please uncheck 'Include Default FB Entries'"))
if filters.finance_book and company_fb and cstr(filters.finance_book) != cstr(company_fb):
frappe.throw(
_("To use a different finance book, please uncheck 'Include Default FB Entries'")
)
opening_balance = opening_balance.where(
(closing_balance.finance_book.isin([cstr(filters.finance_book), cstr(company_fb), ""]))
| (closing_balance.finance_book.isnull())
)
else:
opening_balance = opening_balance.where(
(closing_balance.finance_book.isin([cstr(filters.finance_book), ""]))
| (closing_balance.finance_book.isnull())
)
opening_balance = opening_balance.where(
(closing_balance.finance_book.isin([cstr(filters.finance_book), cstr(company_fb), ""]))
| (closing_balance.finance_book.isnull())
)
else:
opening_balance = opening_balance.where(
(closing_balance.finance_book.isin([cstr(filters.finance_book), ""]))
| (closing_balance.finance_book.isnull())
)
if accounting_dimensions:
for dimension in accounting_dimensions:
@@ -413,7 +410,7 @@ def prepare_data(accounts, filters, parent_children_map, company_currency):
for key in value_fields:
row[key] = flt(d.get(key, 0.0), 3)
if abs(row[key]) >= 0.005:
if abs(row[key]) >= get_zero_cutoff(company_currency):
# ignore zero values
has_value = True

View File

@@ -5,7 +5,9 @@ from erpnext.stock.doctype.item.test_item import create_item
class AccountsTestMixin:
def create_customer(self, customer_name="_Test Customer", currency=None):
def create_customer(
self, customer_name="_Test Customer", currency=None, default_account=None, company=None
):
if not frappe.db.exists("Customer", customer_name):
customer = frappe.new_doc("Customer")
customer.customer_name = customer_name
@@ -13,9 +15,28 @@ class AccountsTestMixin:
if currency:
customer.default_currency = currency
if company and default_account:
customer.append(
"accounts",
{
"company": company,
"account": default_account,
},
)
customer.save()
self.customer = customer.name
else:
if company and default_account:
customer = frappe.get_doc("Customer", customer_name)
customer.accounts = []
customer.append(
"accounts",
{
"company": company,
"account": default_account,
},
)
customer.save()
self.customer = customer_name
def create_supplier(self, supplier_name="_Test Supplier", currency=None):

View File

@@ -9,6 +9,7 @@ from erpnext.accounts.party import get_party_shipping_address
from erpnext.accounts.utils import (
get_future_stock_vouchers,
get_voucherwise_gl_entries,
get_zero_cutoff,
sort_stock_vouchers_by_posting_date,
)
from erpnext.stock.doctype.item.test_item import make_item
@@ -156,6 +157,11 @@ class TestUtils(unittest.TestCase):
self.assertSequenceEqual(doc_name[0:2], ("SUP", fiscal_year))
frappe.db.set_default("supp_master_name", "Supplier Name")
def test_get_zero_cutoff(self):
self.assertEqual(get_zero_cutoff(None), 0.005)
self.assertEqual(get_zero_cutoff("EUR"), 0.005)
self.assertEqual(get_zero_cutoff("BHD"), 0.0005)
ADDRESS_RECORDS = [
{

View File

@@ -27,6 +27,7 @@ from frappe.utils import (
now,
nowdate,
)
from frappe.utils.caching import site_cache
from pypika import Order
from pypika.functions import Coalesce
from pypika.terms import ExistsCriterion
@@ -946,19 +947,28 @@ def update_accounting_ledgers_after_reference_removal(
adv_ple.run()
def remove_ref_from_advance_section(ref_doc: object = None):
def remove_ref_from_advance_section(ref_doc: object = None, payment_name: str | None = None):
# TODO: this might need some testing
if ref_doc.doctype in ("Sales Invoice", "Purchase Invoice"):
ref_doc.set("advances", [])
adv_type = qb.DocType(f"{ref_doc.doctype} Advance")
qb.from_(adv_type).delete().where(adv_type.parent == ref_doc.name).run()
row_names = []
for adv in ref_doc.get("advances") or []:
if adv.get("reference_name", None) == payment_name:
row_names.append(adv.name)
if not row_names:
return
child_table = (
"Sales Invoice Advance" if ref_doc.doctype == "Sales Invoice" else "Purchase Invoice Advance"
)
frappe.db.delete(child_table, {"name": ("in", row_names)})
def unlink_ref_doc_from_payment_entries(ref_doc: object = None, payment_name: str | None = None):
remove_ref_doc_link_from_jv(ref_doc.doctype, ref_doc.name, payment_name)
remove_ref_doc_link_from_pe(ref_doc.doctype, ref_doc.name, payment_name)
update_accounting_ledgers_after_reference_removal(ref_doc.doctype, ref_doc.name, payment_name)
remove_ref_from_advance_section(ref_doc)
remove_ref_from_advance_section(ref_doc, payment_name)
def remove_ref_doc_link_from_jv(
@@ -1025,7 +1035,6 @@ def remove_ref_doc_link_from_pe(
query = query.where(per.parent == payment_name)
reference_rows = query.run(as_dict=True)
if not reference_rows:
return
@@ -1130,6 +1139,29 @@ def get_currency_precision():
return precision
def get_fraction_units(currency: str) -> int:
"""Returns the number of fraction units for a currency."""
fraction_units = frappe.db.get_value("Currency", currency, "fraction_units")
if fraction_units is None:
fraction_units = 100
return fraction_units
@site_cache()
def get_zero_cutoff(currency: str) -> float:
"""Returns the zero cutoff for a currency.
For example, if the Fraction Units for a currency are set to 100, then the zero cutoff is 0.005.
We don't want to display values less than the zero cutoff.
This value was chosen for compatibility with the previous hard-coded value of 0.005.
"""
fraction_units = get_fraction_units(currency)
return 0.5 / (fraction_units or 1)
def get_held_invoices(party_type, party):
"""
Returns a list of names Purchase Invoices for the given party that are on hold
@@ -2451,6 +2483,10 @@ def build_qb_match_conditions(doctype, user=None) -> list:
for filter in match_filters:
for link_option, allowed_values in filter.items():
fieldnames = link_fields_map.get(link_option, [])
cond = None
if link_option == doctype:
cond = _dt["name"].isin(allowed_values)
for fieldname in fieldnames:
field = _dt[fieldname]
@@ -2459,6 +2495,7 @@ def build_qb_match_conditions(doctype, user=None) -> list:
if not apply_strict_user_permissions:
cond = (Coalesce(field, "") == "") | cond
if cond:
criterion.append(cond)
return criterion

View File

@@ -790,17 +790,33 @@ frappe.ui.form.on("Asset Finance Book", {
});
erpnext.asset.scrap_asset = function (frm) {
frappe.confirm(__("Do you really want to scrap this asset?"), function () {
frappe.call({
args: {
asset_name: frm.doc.name,
var scrap_dialog = new frappe.ui.Dialog({
title: __("Enter date to scrap asset"),
fields: [
{
label: __("Select the date"),
fieldname: "scrap_date",
fieldtype: "Date",
reqd: 1,
},
method: "erpnext.assets.doctype.asset.depreciation.scrap_asset",
callback: function (r) {
cur_frm.reload_doc();
},
});
],
size: "medium",
primary_action_label: "Submit",
primary_action(values) {
frappe.call({
args: {
asset_name: frm.doc.name,
scrap_date: values.scrap_date,
},
method: "erpnext.assets.doctype.asset.depreciation.scrap_asset",
callback: function (r) {
frm.reload_doc();
scrap_dialog.hide();
},
});
},
});
scrap_dialog.show();
};
erpnext.asset.restore_asset = function (frm) {

View File

@@ -518,6 +518,7 @@
"read_only": 1
},
{
"default": "0",
"depends_on": "eval:doc.docstatus > 0",
"fieldname": "additional_asset_cost",
"fieldtype": "Currency",
@@ -596,7 +597,7 @@
"link_fieldname": "target_asset"
}
],
"modified": "2025-05-20 00:44:06.229177",
"modified": "2025-10-23 22:43:33.634452",
"modified_by": "Administrator",
"module": "Assets",
"name": "Asset",
@@ -641,4 +642,4 @@
"states": [],
"title_field": "asset_name",
"track_changes": 1
}
}

View File

@@ -69,6 +69,7 @@ class Asset(AccountsController):
default_finance_book: DF.Link | None
department: DF.Link | None
depr_entry_posting_status: DF.Literal["", "Successful", "Failed"]
depreciation_completed: DF.Check
depreciation_method: DF.Literal["", "Straight Line", "Double Declining Balance", "Manual"]
disposal_date: DF.Date | None
finance_books: DF.Table[AssetFinanceBook]
@@ -152,7 +153,9 @@ class Asset(AccountsController):
)
self.validate_expected_value_after_useful_life()
self.set_total_booked_depreciations()
self.total_asset_cost = self.gross_purchase_amount
def before_save(self):
self.total_asset_cost = self.gross_purchase_amount + self.additional_asset_cost
self.status = self.get_status()
def on_submit(self):
@@ -936,7 +939,7 @@ def make_post_gl_entry():
assets = frappe.db.sql_list(
""" select name from `tabAsset`
where asset_category = %s and ifnull(booked_fixed_asset, 0) = 0
and available_for_use_date = %s""",
and available_for_use_date = %s and docstatus = 1""",
(asset_category.name, nowdate()),
)

View File

@@ -394,7 +394,7 @@ def get_comma_separated_links(names, doctype):
@frappe.whitelist()
def scrap_asset(asset_name):
def scrap_asset(asset_name, scrap_date=None):
asset = frappe.get_doc("Asset", asset_name)
if asset.docstatus != 1:
@@ -402,7 +402,11 @@ def scrap_asset(asset_name):
elif asset.status in ("Cancelled", "Sold", "Scrapped", "Capitalized"):
frappe.throw(_("Asset {0} cannot be scrapped, as it is already {1}").format(asset.name, asset.status))
date = today()
today_date = getdate(today())
date = getdate(scrap_date) or today_date
purchase_date = getdate(asset.purchase_date)
validate_scrap_date(date, today_date, purchase_date, asset.calculate_depreciation, asset_name)
notes = _("This schedule was created when Asset {0} was scrapped.").format(
get_link_to_form(asset.doctype, asset.name)
@@ -436,6 +440,36 @@ def scrap_asset(asset_name):
frappe.msgprint(_("Asset scrapped via Journal Entry {0}").format(je.name))
def validate_scrap_date(scrap_date, today_date, purchase_date, calculate_depreciation, asset_name):
if scrap_date > today_date:
frappe.throw(_("Future date is not allowed"))
elif scrap_date < purchase_date:
frappe.throw(_("Scrap date cannot be before purchase date"))
if calculate_depreciation:
asset_depreciation_schedules = frappe.db.get_all(
"Asset Depreciation Schedule", filters={"asset": asset_name, "docstatus": 1}, fields=["name"]
)
for depreciation_schedule in asset_depreciation_schedules:
last_booked_depreciation_date = frappe.db.get_value(
"Depreciation Schedule",
{
"parent": depreciation_schedule["name"],
"docstatus": 1,
"journal_entry": ["!=", ""],
},
"schedule_date",
order_by="schedule_date desc",
)
if (
last_booked_depreciation_date
and scrap_date < last_booked_depreciation_date
and scrap_date > purchase_date
):
frappe.throw(_("Asset cannot be scrapped before the last depreciation entry."))
@frappe.whitelist()
def restore_asset(asset_name):
asset = frappe.get_doc("Asset", asset_name)
@@ -473,7 +507,8 @@ def depreciate_asset(asset_doc, date, notes):
make_depreciation_entry_for_all_asset_depr_schedules(asset_doc, date)
asset_doc.reload()
cancel_depreciation_entries(asset_doc, date)
if not frappe.flags.is_composite_component:
cancel_depreciation_entries(asset_doc, date)
@erpnext.allow_regional

View File

@@ -15,6 +15,7 @@ from frappe.utils import (
is_last_day_of_the_month,
nowdate,
)
from frappe.utils.data import add_to_date
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice
@@ -219,6 +220,31 @@ class TestAsset(AssetSetup):
)
self.assertEqual(accumulated_depr_amount, 18000.0)
asset_depreciation = frappe.db.get_value(
"Asset Depreciation Schedule", {"asset": asset.name, "docstatus": 1}, "name"
)
last_booked_depreciation_date = frappe.db.get_value(
"Depreciation Schedule",
{
"parent": asset_depreciation,
"docstatus": 1,
"journal_entry": ["!=", ""],
},
"schedule_date",
order_by="schedule_date desc",
)
before_purchase_date = add_to_date(asset.purchase_date, days=-1)
future_date = add_to_date(nowdate(), days=1)
if last_booked_depreciation_date:
before_last_booked_depreciation_date = add_to_date(last_booked_depreciation_date, days=-1)
self.assertRaises(frappe.ValidationError, scrap_asset, asset.name, scrap_date=before_purchase_date)
self.assertRaises(frappe.ValidationError, scrap_asset, asset.name, scrap_date=future_date)
self.assertRaises(
frappe.ValidationError, scrap_asset, asset.name, scrap_date=before_last_booked_depreciation_date
)
scrap_asset(asset.name)
asset.load_from_db()
first_asset_depr_schedule.load_from_db()

View File

@@ -44,6 +44,7 @@
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"project",
"target_fixed_asset_account"
],
"fields": [
@@ -288,6 +289,12 @@
"label": "Cost Center",
"options": "Cost Center"
},
{
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
"options": "Project"
},
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"

View File

@@ -492,14 +492,18 @@ class AssetCapitalization(StockController):
asset = frappe.get_doc("Asset", item.asset)
if asset.calculate_depreciation:
notes = _(
"This schedule was created when Asset {0} was consumed through Asset Capitalization {1}."
).format(
get_link_to_form(asset.doctype, asset.name),
get_link_to_form(self.doctype, self.get("name")),
)
depreciate_asset(asset, self.posting_date, notes)
asset.reload()
frappe.flags.is_composite_component = True
try:
notes = _(
"This schedule was created when Asset {0} was consumed through Asset Capitalization {1}."
).format(
get_link_to_form(asset.doctype, asset.name),
get_link_to_form(self.doctype, self.get("name")),
)
depreciate_asset(asset, self.posting_date, notes)
asset.reload()
finally:
frappe.flags.is_composite_component = False
fixed_asset_gl_entries = get_gl_entries_on_asset_disposal(
asset,

View File

@@ -18,6 +18,7 @@
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"project",
"fixed_asset_account"
],
"fields": [
@@ -98,6 +99,13 @@
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
},
{
"allow_on_submit": 1,
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
"options": "Project"
},
{
"fieldname": "finance_book",
"fieldtype": "Link",

View File

@@ -369,6 +369,10 @@ class AssetDepreciationSchedule(Document):
original_schedule_date=schedule_date,
)
depreciation_amount = flt(depreciation_amount, asset_doc.precision("gross_purchase_amount"))
if depreciation_amount > row.value_after_depreciation - row.expected_value_after_useful_life:
depreciation_amount = row.value_after_depreciation - row.expected_value_after_useful_life
if depreciation_amount > 0:
self.add_depr_schedule_row(date_of_disposal, depreciation_amount, n)
@@ -654,6 +658,7 @@ def _get_pro_rata_amt(
total_days = get_total_days(original_schedule_date or to_date, 12)
else:
total_days = get_total_days(original_schedule_date or to_date, row.frequency_of_depreciation)
return (depreciation_amount * flt(days)) / flt(total_days), days, months

View File

@@ -5,7 +5,7 @@
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import get_link_to_form
from frappe.utils import cstr, get_link_to_form
from erpnext.assets.doctype.asset_activity.asset_activity import add_asset_activity
@@ -61,7 +61,7 @@ class AssetMovement(Document):
if d.source_location:
if current_location != d.source_location:
frappe.throw(
_("Asset {0} does not belongs to the location {1}").format(d.asset, d.source_location)
_("Asset {0} does not belong to the location {1}").format(d.asset, d.source_location)
)
else:
d.source_location = current_location
@@ -75,11 +75,11 @@ class AssetMovement(Document):
frappe.throw(_("Target Location is required while receiving Asset {0}").format(d.asset))
if d.to_employee and frappe.db.get_value("Employee", d.to_employee, "company") != self.company:
frappe.throw(
_("Employee {0} does not belongs to the company {1}").format(d.to_employee, self.company)
_("Employee {0} does not belong to the company {1}").format(d.to_employee, self.company)
)
def validate_employee(self, d):
if self.purpose == "Tranfer and Issue":
if self.purpose == "Transfer and Issue":
if not d.from_employee:
frappe.throw(_("From Employee is required while issuing Asset {0}").format(d.asset))
@@ -88,7 +88,7 @@ class AssetMovement(Document):
if current_custodian != d.from_employee:
frappe.throw(
_("Asset {0} does not belongs to the custodian {1}").format(d.asset, d.from_employee)
_("Asset {0} does not belong to the custodian {1}").format(d.asset, d.from_employee)
)
if not d.to_employee:
@@ -96,7 +96,7 @@ class AssetMovement(Document):
if d.to_employee and frappe.db.get_value("Employee", d.to_employee, "company") != self.company:
frappe.throw(
_("Employee {0} does not belongs to the company {1}").format(d.to_employee, self.company)
_("Employee {0} does not belong to the company {1}").format(d.to_employee, self.company)
)
def on_submit(self):
@@ -142,8 +142,8 @@ class AssetMovement(Document):
def update_asset_location_and_custodian(self, asset_id, location, employee):
asset = frappe.get_doc("Asset", asset_id)
if employee and employee != asset.custodian:
frappe.db.set_value("Asset", asset_id, "custodian", employee)
if cstr(employee) != asset.custodian:
frappe.db.set_value("Asset", asset_id, "custodian", cstr(employee))
if location and location != asset.location:
frappe.db.set_value("Asset", asset_id, "location", location)

View File

@@ -268,6 +268,7 @@ def get_asset_depreciation_amount_map(filters, finance_book):
.where(gle.account == IfNull(aca.depreciation_expense_account, company.depreciation_expense_account))
.where(gle.debit != 0)
.where(gle.is_cancelled == 0)
.where(gle.is_opening == "No")
.where(company.name == filters.company)
.where(asset.docstatus == 1)
)
@@ -318,6 +319,7 @@ def get_asset_value_adjustment_map(filters, finance_book):
.select(asset.name.as_("asset"), Sum(gle.debit - gle.credit).as_("adjustment_amount"))
.where(gle.account == aca.fixed_asset_account)
.where(gle.is_cancelled == 0)
.where(gle.is_opening == "No")
.where(company.name == filters.company)
.where(asset.docstatus == 1)
)

View File

@@ -644,9 +644,8 @@ class PurchaseOrder(BuyingController):
if not self.is_against_so():
return
for item in removed_items:
prev_ordered_qty = (
prev_ordered_qty = flt(
frappe.get_cached_value("Sales Order Item", item.get("sales_order_item"), "ordered_qty")
or 0.0
)
frappe.db.set_value(

View File

@@ -541,12 +541,8 @@ class TestPurchaseOrder(FrappeTestCase):
self.assertRaises(frappe.ValidationError, pr.submit)
self.assertRaises(frappe.ValidationError, pi.submit)
@change_settings("Accounts Settings", {"automatically_fetch_payment_terms": 1})
def test_make_purchase_invoice_with_terms(self):
from erpnext.selling.doctype.sales_order.test_sales_order import (
automatically_fetch_payment_terms,
)
automatically_fetch_payment_terms()
po = create_purchase_order(do_not_save=True)
self.assertRaises(frappe.ValidationError, make_pi_from_po, po.name)
@@ -570,7 +566,6 @@ class TestPurchaseOrder(FrappeTestCase):
self.assertEqual(getdate(pi.payment_schedule[0].due_date), getdate(po.transaction_date))
self.assertEqual(pi.payment_schedule[1].payment_amount, 2500.0)
self.assertEqual(getdate(pi.payment_schedule[1].due_date), add_days(getdate(po.transaction_date), 30))
automatically_fetch_payment_terms(enable=0)
def test_warehouse_company_validation(self):
from erpnext.stock.utils import InvalidWarehouseCompany
@@ -718,6 +713,7 @@ class TestPurchaseOrder(FrappeTestCase):
)
self.assertEqual(due_date, "2023-03-31")
@change_settings("Accounts Settings", {"automatically_fetch_payment_terms": 0})
def test_terms_are_not_copied_if_automatically_fetch_payment_terms_is_unchecked(self):
po = create_purchase_order(do_not_save=1)
po.payment_terms_template = "_Test Payment Term Template"
@@ -905,18 +901,16 @@ class TestPurchaseOrder(FrappeTestCase):
bo.load_from_db()
self.assertEqual(bo.items[0].ordered_qty, 5)
@change_settings("Accounts Settings", {"automatically_fetch_payment_terms": 1})
def test_payment_terms_are_fetched_when_creating_purchase_invoice(self):
from erpnext.accounts.doctype.payment_entry.test_payment_entry import (
create_payment_terms_template,
)
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice
from erpnext.selling.doctype.sales_order.test_sales_order import (
automatically_fetch_payment_terms,
compare_payment_schedules,
)
automatically_fetch_payment_terms()
po = create_purchase_order(qty=10, rate=100, do_not_save=1)
create_payment_terms_template()
po.payment_terms_template = "Test Receivable Template"
@@ -930,8 +924,6 @@ class TestPurchaseOrder(FrappeTestCase):
# self.assertEqual(po.payment_terms_template, pi.payment_terms_template)
compare_payment_schedules(self, po, pi)
automatically_fetch_payment_terms(enable=0)
def test_internal_transfer_flow(self):
from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
from erpnext.accounts.doctype.sales_invoice.sales_invoice import (

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