Compare commits

...

864 Commits

Author SHA1 Message Date
mergify[bot]
bd7e5b3e05 refactor: use consistent report column names (backport #54451) (backport #54478) (#54506)
* refactor: use consistent report column names

(cherry picked from commit 7630c01e40)

# Conflicts:
#	erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py
(cherry picked from commit ab188c4404)

* refactor: better label for entity type

(cherry picked from commit 8e12bda108)
(cherry picked from commit e1ff203f95)

* fix: add party_type for dynamic link and add it to grouping key

(cherry picked from commit a3ad1fb163)
(cherry picked from commit 6eb2868a15)

* fix: use key consistently

(cherry picked from commit 8f9a5e6c0c)
(cherry picked from commit 32d46b3e88)

* chore: resolve conflicts

(cherry picked from commit 34e94d6e7a)

* chore: translate values correctly

(cherry picked from commit 83fd655042)

---------

Co-authored-by: Smit Vora <smitvora203@gmail.com>
2026-04-24 20:01:36 +05:30
Frappe PR Bot
adf92a8292 chore(release): Bumped to Version 14.92.14
## [14.92.14](https://github.com/frappe/erpnext/compare/v14.92.13...v14.92.14) (2026-04-10)

### Bug Fixes

* added exception handling on service level agreement apply hook ([#50096](https://github.com/frappe/erpnext/issues/50096)) ([#54192](https://github.com/frappe/erpnext/issues/54192)) ([12b2788](12b27883f6))
2026-04-10 11:53:37 +00:00
diptanilsaha
df6dc540f8 Merge pull request #54202 from frappe/mergify/bp/version-14/pr-54192
fix: added exception handling on service level agreement apply hook (#50096) (backport #54192)
2026-04-10 17:22:07 +05:30
diptanilsaha
12b27883f6 fix: added exception handling on service level agreement apply hook (#50096) (#54192)
Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit 21311dab86)
2026-04-10 11:33:06 +00:00
Frappe PR Bot
5bbfb79cdc chore(release): Bumped to Version 14.92.13
## [14.92.13](https://github.com/frappe/erpnext/compare/v14.92.12...v14.92.13) (2026-03-21)

### Bug Fixes

* allow zero valuation rate ([7a98e13](7a98e13d7d))
2026-03-21 08:34:35 +00:00
rohitwaghchaure
266ac2d5be Merge pull request #53637 from frappe/mergify/bp/version-14/pr-53635
fix: allow zero valuation rate (backport #53635)
2026-03-21 14:03:04 +05:30
Rohit Waghchaure
7a98e13d7d fix: allow zero valuation rate
(cherry picked from commit a6eadb18c9)
2026-03-19 08:32:50 +00:00
rohitwaghchaure
aeee42e857 Merge pull request #52349 from frappe/version-14-hotfix
chore: release v14
2026-02-03 22:48:16 +05:30
Mihir Kandoi
e1674d2017 Merge pull request #51658 from mihir-kandoi/eol-msg 2026-01-30 17:09:28 +05:30
Mihir Kandoi
65d7c6b882 chore: rename filename 2026-01-30 17:08:48 +05:30
Frappe PR Bot
966f262e38 chore(release): Bumped to Version 14.92.12
## [14.92.12](https://github.com/frappe/erpnext/compare/v14.92.11...v14.92.12) (2026-01-27)

### Bug Fixes

* **stock:** remove limit filter while fetching batch and bin ([07ac93d](07ac93d06a))
2026-01-27 14:42:02 +00:00
ruthra kumar
44f81092b6 Merge pull request #52105 from frappe/version-14-hotfix
chore: release v14
2026-01-27 20:09:29 +05:30
rohitwaghchaure
6f1616bc95 Merge pull request #51939 from aerele/fix/pick-list-qty-validation
fix(stock): remove limit filter while fetching batch and bin
2026-01-23 19:36:54 +05:30
Sudharsanan11
07ac93d06a fix(stock): remove limit filter while fetching batch and bin 2026-01-20 23:12:13 +05:30
Frappe PR Bot
34499d7f77 chore(release): Bumped to Version 14.92.11
## [14.92.11](https://github.com/frappe/erpnext/compare/v14.92.10...v14.92.11) (2026-01-20)

### Bug Fixes

* Show non-SLE vouchers with GL entries in Stock vs Account Value Comparison report ([6e03d45](6e03d45034))
* **transaction.js:** use flt instead of cint for plc_conversion_rate ([d09de53](d09de53d1d))
2026-01-20 16:37:18 +00:00
ruthra kumar
2967de1999 Merge pull request #51910 from frappe/version-14-hotfix
chore: release v14
2026-01-20 22:05:36 +05:30
ruthra kumar
824beaa893 Merge pull request #51837 from frappe/mergify/bp/version-14-hotfix/pr-51787
fix: recalculate taxes when item tax template changes after discount (backport #51787)
2026-01-19 14:37:18 +05:30
ljain112
b4dc1be5ed chore: resolve conflicts 2026-01-19 13:45:11 +05:30
Lakshit Jain
cf49c32b94 Merge pull request #51787 from ljain112/fix-taxes-disc
fix: recalculate taxes when item tax template changes after discount
(cherry picked from commit f00aeec9b4)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
#	erpnext/controllers/taxes_and_totals.py
2026-01-19 07:01:36 +00:00
rohitwaghchaure
d54f45469a Merge pull request #51770 from frappe/mergify/bp/version-14-hotfix/pr-51768
fix: Show non-SLE vouchers with GL entries in Stock vs Account Value … (backport #51768)
2026-01-15 20:59:58 +05:30
rohitwaghchaure
ad5181c52f chore: fix conflicts 2026-01-15 19:28:44 +05:30
Rohit Waghchaure
6e03d45034 fix: Show non-SLE vouchers with GL entries in Stock vs Account Value Comparison report
(cherry picked from commit 1db9ce205f)

# Conflicts:
#	erpnext/stock/report/stock_and_account_value_comparison/stock_and_account_value_comparison.py
2026-01-15 12:20:32 +00:00
Diptanil Saha
7a18f86dd5 Merge pull request #51746 from frappe/mergify/bp/version-14-hotfix/pr-51730
fix(transaction.js): use flt instead of cint for plc_conversion_rate (backport #51730)
2026-01-14 15:56:06 +05:30
Diptanil Saha
39e1bddce6 chore: resolve conflict 2026-01-14 15:53:18 +05:30
diptanilsaha
d09de53d1d fix(transaction.js): use flt instead of cint for plc_conversion_rate
(cherry picked from commit 8b445e04e5)

# Conflicts:
#	erpnext/public/js/controllers/transaction.js
2026-01-14 10:22:04 +00:00
Frappe PR Bot
8035940263 chore(release): Bumped to Version 14.92.10
## [14.92.10](https://github.com/frappe/erpnext/compare/v14.92.9...v14.92.10) (2026-01-13)

### Bug Fixes

* don't duplicate default income account to Item ([#50413](https://github.com/frappe/erpnext/issues/50413)) ([55d2a54](55d2a54785)), closes [#48231](https://github.com/frappe/erpnext/issues/48231)
* negative stock issue for higher precision ([21d1385](21d13859a0))
2026-01-13 14:44:57 +00:00
ruthra kumar
c69f3d330a Merge pull request #51712 from frappe/version-14-hotfix
chore: release v14
2026-01-13 20:13:30 +05:30
Mihir Kandoi
90d88b1c26 chore: fix grammar 2026-01-13 11:00:42 +05:30
Mihir Kandoi
22eec09175 chore: update links 2026-01-13 10:52:51 +05:30
ruthra kumar
dbfd4ea4d3 Merge pull request #51331 from frappe/mergify/bp/version-14-hotfix/pr-50413
fix: don't duplicate default income account to Item (backport #50413)
2026-01-12 20:34:03 +05:30
barredterra
8d28dcb18b chore: resolve conflicts 2026-01-11 17:59:27 +01:00
Mihir Kandoi
3f186b24f3 chore: EOL announcement for v14 2026-01-10 22:44:44 +05:30
rohitwaghchaure
4b0ddbf73a Merge pull request #51591 from frappe/mergify/bp/version-14-hotfix/pr-51588
fix: negative stock issue for higher precision (backport #51586) (backport #51588)
2026-01-08 16:11:20 +05:30
rohitwaghchaure
cddf1e1ee5 chore: fix conflicts
Refactor delivery note tests to improve clarity and organization. Remove redundant test cases and ensure proper valuation checks for batch and serial items.
2026-01-08 15:18:53 +05:30
rohitwaghchaure
22e5aba02b chore: fix conflicts
Refactor test cases for delivery notes to handle negative stock and higher precision.

(cherry picked from commit 5193dbba9b)
2026-01-08 09:35:44 +00:00
Rohit Waghchaure
21d13859a0 fix: negative stock issue for higher precision
(cherry picked from commit 87be020c78)

# Conflicts:
#	erpnext/stock/doctype/delivery_note/test_delivery_note.py
(cherry picked from commit 1bbeecff12)

# Conflicts:
#	erpnext/stock/doctype/delivery_note/test_delivery_note.py
2026-01-08 09:35:44 +00:00
Frappe PR Bot
18fbe69892 chore(release): Bumped to Version 14.92.9
## [14.92.9](https://github.com/frappe/erpnext/compare/v14.92.8...v14.92.9) (2026-01-07)

### Bug Fixes

* update filters on period closing voucher ([6499a1d](6499a1dae0))
2026-01-07 04:58:04 +00:00
ruthra kumar
f2043baf36 Merge pull request #51539 from frappe/version-14-hotfix
chore: release v14
2026-01-07 10:26:40 +05:30
ruthra kumar
6267b9aea5 Merge pull request #51486 from frappe/mergify/bp/version-14-hotfix/pr-51467
fix: update filters on period closing voucher (backport #51467)
2026-01-05 10:53:20 +05:30
SowmyaArunachalam
6499a1dae0 fix: update filters on period closing voucher
(cherry picked from commit 7ab1e1f677)
2026-01-05 05:20:31 +00:00
Sagar Vora
478992812f Merge pull request #51410 from frappe/revert-51302-pin-urllib3 2025-12-31 13:22:41 +05:30
Sagar Vora
634dd11d72 Revert "fix(deps): pin urllib3" 2025-12-31 13:18:09 +05:30
Frappe PR Bot
29134db5b4 chore(release): Bumped to Version 14.92.8
## [14.92.8](https://github.com/frappe/erpnext/compare/v14.92.7...v14.92.8) (2025-12-30)

### Bug Fixes

* **stock:** update last incoming rate in serial no doctype ([5e12937](5e129374b9))
2025-12-30 13:33:09 +00:00
ruthra kumar
a2597c9608 Merge pull request #51390 from frappe/version-14-hotfix
chore: release v14
2025-12-30 19:01:44 +05:30
rohitwaghchaure
0e6586734a Merge pull request #51365 from aerele/fix/serial-item-incoming-rate
fix(stock): update last incoming rate in serial no doctype
2025-12-29 23:31:07 +05:30
Sudharsanan11
5e129374b9 fix(stock): update last incoming rate in serial no doctype 2025-12-29 16:54:09 +05:30
Raffael Meyer
55d2a54785 fix: don't duplicate default income account to Item (#50413)
* fix: don't duplicate default income account to Item

Only store _Default Income Account_ in **Item** if it's different from the **Company**'s  _Default Income Account_.

Resolves #48231

* refactor: move db call out of loop

* docs: add docstring

(cherry picked from commit b6cb9d4799)

# Conflicts:
#	erpnext/controllers/selling_controller.py
2025-12-25 09:23:09 +00:00
Frappe PR Bot
b3bf456ea2 chore(release): Bumped to Version 14.92.7
## [14.92.7](https://github.com/frappe/erpnext/compare/v14.92.6...v14.92.7) (2025-12-24)

### Bug Fixes

* available qty not fetched on selection of batch ([9841438](98414385e5))
* **deps:** pin urllib3<2 ([1dee100](1dee10077c))
* disable uv ([d713f39](d713f39fce))
* **patch:** fallback for frankfurter settings v14 patch ([5c9e0bb](5c9e0bba2f))

### Performance Improvements

* optimize company monthly sales query using date range ([#48942](https://github.com/frappe/erpnext/issues/48942)) ([e9c1d0a](e9c1d0ad52))
2025-12-24 08:23:59 +00:00
rohitwaghchaure
932dc66871 Merge pull request #51279 from frappe/version-14-hotfix
chore: release v14
2025-12-24 13:52:30 +05:30
Akhil Narang
3a6d056fd3 Merge pull request #51302 from akhilnarang/pin-urllib3
fix(deps): pin urllib3
2025-12-24 12:52:26 +05:30
Akhil Narang
d713f39fce fix: disable uv
Seems to cause an issue with dependency resolution when installation dev dependencies

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-24 12:29:21 +05:30
Akhil Narang
1dee10077c fix(deps): pin urllib3<2
v2 has breaking changes, and some other ERPNext dependencies pull in newer requests, which has urllib3<3 mentioned.

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-24 11:26:39 +05:30
ruthra kumar
c86cf5b9c6 Merge pull request #51291 from frappe/mergify/bp/version-14-hotfix/pr-51285
fix(patch): handle currency exchange settings frankfurter api update for older versions (backport #51285)
2025-12-23 20:46:16 +05:30
diptanilsaha
5c9e0bba2f fix(patch): fallback for frankfurter settings v14 patch
(cherry picked from commit 50bb1ce31d)
2025-12-23 12:11:25 +00:00
rohitwaghchaure
793688710a Merge pull request #51261 from rohitwaghchaure/fixed-support-53592
fix: available qty not fetched on selection of batch
2025-12-22 16:52:30 +05:30
Rohit Waghchaure
98414385e5 fix: available qty not fetched on selection of batch 2025-12-22 16:47:38 +05:30
Diptanil Saha
33f7b742ec Merge pull request #51147 from frappe/mergify/bp/version-14-hotfix/pr-48942 2025-12-17 11:57:24 +05:30
Yash Chaubey
e9c1d0ad52 perf: optimize company monthly sales query using date range (#48942)
* perf: optimize company monthly sales query using date range instead of DATE_FORMAT

* perf: optimize company monthly sales query using date range

(cherry picked from commit 4ede97ae2b)
2025-12-17 06:07:27 +00:00
Frappe PR Bot
e733b41ab3 chore(release): Bumped to Version 14.92.6
## [14.92.6](https://github.com/frappe/erpnext/compare/v14.92.5...v14.92.6) (2025-12-16)

### Bug Fixes

* **asset:** calculate depreciation amount for non prorata based schedules ([8de0d60](8de0d60581))
* **asset:** prorata daily depr amount calculation ([bc58fd1](bc58fd1fa4))
* **currency exchange settings:** added backward compatibility for frankfurter api ([a15b010](a15b010868))
* **share balance:** use currency field instead of int for rate and amount ([a299392](a299392128))
* Short circuit guest perm checks ([6f6cbb7](6f6cbb717e))
* **transaction-deletion:** Add virtual doctypes to the list of ignored doctypes (backport [#51063](https://github.com/frappe/erpnext/issues/51063)) ([#51086](https://github.com/frappe/erpnext/issues/51086)) ([67c0d08](67c0d08569))
* update expected schedules on test case test_schedule_for_straight_line_method_for_existing_asset ([6ea7393](6ea7393f7d))
2025-12-16 15:12:25 +00:00
ruthra kumar
39fd4a827c Merge pull request #51125 from frappe/version-14-hotfix
chore: release v14
2025-12-16 20:40:57 +05:30
mergify[bot]
67c0d08569 fix(transaction-deletion): Add virtual doctypes to the list of ignored doctypes (backport #51063) (#51086)
* fix: Add virtual doctypes to the list of ignored doctypes in transaction deletion

(cherry picked from commit c7a7cb2b90)

* refactor: switch to `or_filters` so the query hits the DB only once

(cherry picked from commit 45a7195abe)

* refactor: remove redundant assignment of doctypes_to_be_ignored_list

(cherry picked from commit 0f7d89f4d1)

---------

Co-authored-by: KerollesFathy <kerollesfhabib@gmail.com>
2025-12-14 14:31:02 +05:30
Ankush Menat
6f6cbb717e fix: Short circuit guest perm checks 2025-12-14 12:12:35 +05:30
Diptanil Saha
387657fa92 Merge pull request #51044 from frappe/mergify/bp/version-14-hotfix/pr-51037
fix(currency exchange settings): added backward compatibility for frankfurter api (backport #51037)
2025-12-11 16:27:54 +05:30
Diptanil Saha
ef03d90a08 chore: resolve conflict 2025-12-11 15:58:30 +05:30
diptanilsaha
a15b010868 fix(currency exchange settings): added backward compatibility for frankfurter api
(cherry picked from commit 5c2bb66028)

# Conflicts:
#	erpnext/patches.txt
2025-12-11 10:26:17 +00:00
Khushi Rawat
9d00afe1b1 Merge pull request #50964 from aerele/daily-prorata-depr-amount-calculation
fix(asset): prorata daily depr amount calculation
2025-12-10 14:22:17 +05:30
Navin-S-R
6ea7393f7d fix: update expected schedules on test case test_schedule_for_straight_line_method_for_existing_asset 2025-12-10 13:35:57 +05:30
Navin-S-R
8de0d60581 fix(asset): calculate depreciation amount for non prorata based schedules 2025-12-10 12:38:27 +05:30
Diptanil Saha
a67092894f Merge pull request #51002 from frappe/mergify/bp/version-14-hotfix/pr-51001
fix(share balance): use currency field instead of int for rate and amount (backport #51001)
2025-12-10 10:38:26 +05:30
Diptanil Saha
77b9044d8d chore: resolve conflict 2025-12-10 09:56:15 +05:30
Diptanil Saha
ba9f571886 chore: resolve conflict 2025-12-10 09:52:37 +05:30
diptanilsaha
a299392128 fix(share balance): use currency field instead of int for rate and amount
(cherry picked from commit 2fe5fad884)

# Conflicts:
#	erpnext/accounts/doctype/share_balance/share_balance.json
#	erpnext/accounts/doctype/share_balance/share_balance.py
2025-12-10 04:21:05 +00:00
Navin-S-R
bc58fd1fa4 fix(asset): prorata daily depr amount calculation 2025-12-08 15:38:48 +05:30
Frappe PR Bot
1920259180 chore(release): Bumped to Version 14.92.5
## [14.92.5](https://github.com/frappe/erpnext/compare/v14.92.4...v14.92.5) (2025-12-03)

### Bug Fixes

* **Job Card:** avoid Type Error when completed_qty is None (backport [#50447](https://github.com/frappe/erpnext/issues/50447)) ([#50760](https://github.com/frappe/erpnext/issues/50760)) ([5e05873](5e05873226))
* update uom when item changes ([a3b120b](a3b120b3b2))
2025-12-03 05:43:40 +00:00
Diptanil Saha
ea1ca7111d Merge pull request #50867 from frappe/version-14-hotfix 2025-12-03 11:12:16 +05:30
rohitwaghchaure
10f1c9c3ac Merge pull request #50763 from aerele/support-52987
fix: update uom when item changes
2025-11-26 23:42:32 +05:30
Pugazhendhi Velu
a3b120b3b2 fix: update uom when item changes 2025-11-26 16:07:27 +00:00
mergify[bot]
5e05873226 fix(Job Card): avoid Type Error when completed_qty is None (backport #50447) (#50760)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
fix(Job Card): avoid Type Error when completed_qty is None (#50447)
2025-11-26 14:55:53 +01:00
ruthra kumar
14a7ab71b4 Merge pull request #50747 from frappe/version-14-hotfix
chore: release v14
2025-11-26 10:17:16 +05:30
mergify[bot]
db828c08b6 chore: switched frankfurter domain from frankfurter.app to frankfurter.dev (backport #50734) (#50739)
Co-authored-by: diptanilsaha <diptanil@frappe.io>
2025-11-25 15:49:37 +05:30
Frappe PR Bot
993890116b chore(release): Bumped to Version 14.92.4
## [14.92.4](https://github.com/frappe/erpnext/compare/v14.92.3...v14.92.4) (2025-11-18)

### Bug Fixes

* current qty in stock reco ([5979683](5979683e8e))
* **process statement of accounts:** use date instead of formatted date ([1ef9471](1ef9471c79))
2025-11-18 13:09:28 +00:00
Diptanil Saha
cd437b5a26 Merge pull request #50594 from frappe/version-14-hotfix 2025-11-18 18:37:55 +05:30
Diptanil Saha
e6f505ef81 Merge pull request #50523 from frappe/mergify/bp/version-14-hotfix/pr-49086
fix(process statement of accounts): use date instead of formatted date (backport #49086)
2025-11-13 22:16:06 +05:30
ravibharathi656
1ef9471c79 fix(process statement of accounts): use date instead of formatted date
(cherry picked from commit aa3f50ab77)
2025-11-13 16:24:05 +00:00
rohitwaghchaure
304aad6745 Merge pull request #50490 from frappe/mergify/bp/version-14-hotfix/pr-50487
fix: current qty in stock reconciliation  (backport #50487)
2025-11-12 22:49:37 +05:30
rohitwaghchaure
c80fed8b2f chore: fix conflicts 2025-11-12 13:57:00 +05:30
Rohit Waghchaure
5979683e8e fix: current qty in stock reco
(cherry picked from commit 58315bc963)

# Conflicts:
#	erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
2025-11-12 08:25:59 +00:00
Frappe PR Bot
457a81123b chore(release): Bumped to Version 14.92.3
## [14.92.3](https://github.com/frappe/erpnext/compare/v14.92.2...v14.92.3) (2025-11-11)

### Bug Fixes

* set company before creating asset movement to avoid permission error ([8dc80c9](8dc80c948e))
2025-11-11 14:42:37 +00:00
Diptanil Saha
d7966183be Merge pull request #50474 from frappe/version-14-hotfix 2025-11-11 20:11:02 +05:30
Khushi Rawat
367bd58e76 Merge pull request #50378 from frappe/mergify/bp/version-14-hotfix/pr-50367
fix: set company before creating asset movement to avoid permission error (backport #50367)
2025-11-06 10:03:10 +05:30
rehansari26
8dc80c948e fix: set company before creating asset movement to avoid permission error
(cherry picked from commit 8c49c9e500)
2025-11-05 21:50:18 +00:00
Diptanil Saha
0e3cc120dc Merge pull request #50334 from frappe/version-14-hotfix
chore: release v14
2025-11-04 18:00:16 +05:30
ruthra kumar
b54c5f61d6 Merge pull request #50308 from frappe/mergify/bp/version-14-hotfix/pr-50297
chore:there is no company field in bank (backport #50297)
2025-11-03 14:04:23 +05:30
Nihal Roshan
c51a9025b3 refactor: remove company filter
'Bank' doctype has no 'company' field.

(cherry picked from commit f1682ea90e)
2025-11-03 08:31:53 +00:00
Frappe PR Bot
616448f9c9 chore(release): Bumped to Version 14.92.2
## [14.92.2](https://github.com/frappe/erpnext/compare/v14.92.1...v14.92.2) (2025-10-21)

### Bug Fixes

* do reposting of first transfer entry based on item-wh combination ([85c509e](85c509ea69))
* handle flt conversion for prev_ordered_qty ([9460568](94605687c7))
2025-10-21 12:45:22 +00:00
Diptanil Saha
70a8c64ea4 Merge pull request #50181 from frappe/version-14-hotfix
chore: release v14
2025-10-21 18:13:40 +05:30
mergify[bot]
00a75d4984 refactor: simplify expression (backport #50168) (#50169)
Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
2025-10-19 23:59:31 +02:00
rohitwaghchaure
8b826c2369 Merge pull request #50121 from frappe/mergify/bp/version-14-hotfix/pr-50061
fix: do reposting of first transfer entry based on item-wh combination (backport #50061)
2025-10-16 15:02:52 +05:30
rohitwaghchaure
210786119d chore: fix conflicts 2025-10-16 00:17:50 +05:30
Rohit Waghchaure
85c509ea69 fix: do reposting of first transfer entry based on item-wh combination
(cherry picked from commit 2f25b445ab)

# Conflicts:
#	erpnext/stock/stock_ledger.py
2025-10-15 18:44:46 +00:00
Mihir Kandoi
6e35b6b6b3 Merge pull request #50105 from frappe/mergify/bp/version-14-hotfix/pr-50078
fix: handle flt conversion for prev_ordered_qty (backport #50078)
2025-10-15 00:15:14 +05:30
Kavin
94605687c7 fix: handle flt conversion for prev_ordered_qty
(cherry picked from commit 77c35ef47f)
2025-10-14 18:10:27 +00:00
Frappe PR Bot
e27518b2d4 chore(release): Bumped to Version 14.92.1
## [14.92.1](https://github.com/frappe/erpnext/compare/v14.92.0...v14.92.1) (2025-10-14)

### Bug Fixes

* sanitize projects field in tasks webform ([#50089](https://github.com/frappe/erpnext/issues/50089)) ([aadc83d](aadc83d0d9))
2025-10-14 14:18:29 +00:00
Diptanil Saha
cf71178af6 Merge pull request #50099 from frappe/version-14-hotfix
chore: release v14
2025-10-14 19:46:52 +05:30
ruthra kumar
002575244f Merge pull request #50097 from frappe/mergify/bp/version-14-hotfix/pr-50089
fix: sanitize projects field in tasks webform (backport #50089)
2025-10-14 19:22:52 +05:30
Akhil Narang
aadc83d0d9 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:25 +00:00
Frappe PR Bot
66f1e2a076 chore(release): Bumped to Version 14.92.0
# [14.92.0](https://github.com/frappe/erpnext/compare/v14.91.3...v14.92.0) (2025-10-07)

### Bug Fixes

* **Common Code:** fetch canonical URI from Code List (backport [#49882](https://github.com/frappe/erpnext/issues/49882)) ([#49883](https://github.com/frappe/erpnext/issues/49883)) ([9b5183e](9b5183e0e5))
* do not fetch disabled item tax template ([dcae024](dcae024fd2))
* linter; dont change doc after DB update (backport [#49907](https://github.com/frappe/erpnext/issues/49907)) ([#49909](https://github.com/frappe/erpnext/issues/49909)) ([30a6fe5](30a6fe55ca))
* resolved conflict ([2c383a6](2c383a69f9))
* Set paid amount automatically only if return entry validated and has negative grand total ([#49829](https://github.com/frappe/erpnext/issues/49829)) ([b7d76d8](b7d76d8fad))

### Features

* dynamic due date in payment terms when fetched from order (backport [#48864](https://github.com/frappe/erpnext/issues/48864)) ([#49937](https://github.com/frappe/erpnext/issues/49937)) ([d82106c](d82106cb76))
2025-10-07 13:18:52 +00:00
ruthra kumar
1d5935a10f chore: release v14 (#49943)
* refactor(Supplier): custom buttons call make methods (backport #49840) (#49841)

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

* fix(Common Code): fetch canonical URI from Code List (backport #49882) (#49883)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
fix(Common Code): fetch canonical URI from Code List (#49882)

* 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

* fix: resolved conflict

* fix: linter; dont change doc after DB update (backport #49907) (#49909)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
fix: linter; dont change doc after DB update (#49907)

* 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

* chore: fix conflicts

* chore: fix conflicts

* chore: fix linters issue

* feat: dynamic due date in payment terms when fetched from order (backport #48864) (#49937)

* 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/accounts/doctype/payment_schedule/payment_schedule.json
#	erpnext/accounts/doctype/payment_schedule/payment_schedule.py
#	erpnext/public/js/controllers/transaction.js
#	erpnext/selling/doctype/sales_order/test_sales_order.py
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py

* chore: resolve conflicts

---------

Co-authored-by: Lakshit Jain <ljain112@gmail.com>

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
Co-authored-by: ljain112 <ljain112@gmail.com>
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-10-07 18:47:23 +05:30
mergify[bot]
d82106cb76 feat: dynamic due date in payment terms when fetched from order (backport #48864) (#49937)
* 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/accounts/doctype/payment_schedule/payment_schedule.json
#	erpnext/accounts/doctype/payment_schedule/payment_schedule.py
#	erpnext/public/js/controllers/transaction.js
#	erpnext/selling/doctype/sales_order/test_sales_order.py
#	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:46 +05:30
rohitwaghchaure
03aeac6c9b Merge pull request #49931 from frappe/mergify/bp/version-14-hotfix/pr-49702
fix: do not fetch disabled item tax template (backport #49702)
2025-10-07 11:54:19 +05:30
rohitwaghchaure
014f5bff5c chore: fix linters issue 2025-10-07 11:24:49 +05:30
rohitwaghchaure
819667ab24 chore: fix conflicts 2025-10-07 11:00:45 +05:30
rohitwaghchaure
aa20e224fb chore: fix conflicts 2025-10-07 11:00:02 +05:30
ljain112
dcae024fd2 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
mergify[bot]
30a6fe55ca fix: linter; dont change doc after DB update (backport #49907) (#49909)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
fix: linter; dont change doc after DB update (#49907)
2025-10-06 13:34:24 +02:00
ruthra kumar
57f9894f41 Merge pull request #49892 from frappe/mergify/bp/version-14-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:55 +05:30
Nabin Hait
2c383a69f9 fix: resolved conflict 2025-10-06 12:19:22 +05:30
Nabin Hait
b7d76d8fad 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:16 +00:00
mergify[bot]
9b5183e0e5 fix(Common Code): fetch canonical URI from Code List (backport #49882) (#49883)
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:04 +02:00
mergify[bot]
0b43d518af refactor(Supplier): custom buttons call make methods (backport #49840) (#49841)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-10-02 00:16:20 +02:00
Frappe PR Bot
a6b490e4b3 chore(release): Bumped to Version 14.91.3
## [14.91.3](https://github.com/frappe/erpnext/compare/v14.91.2...v14.91.3) (2025-09-30)

### Performance Improvements

* reposting for backdated transactions ([3d51c1b](3d51c1b363))
2025-09-30 13:07:25 +00:00
ruthra kumar
a5d33d5665 Merge pull request #49802 from frappe/version-14-hotfix
chore: release v14
2025-09-30 18:36:03 +05:30
Frappe PR Bot
48c3c80383 chore(release): Bumped to Version 14.91.2
## [14.91.2](https://github.com/frappe/erpnext/compare/v14.91.1...v14.91.2) (2025-09-25)

### Performance Improvements

* reposting for backdated transactions ([f3da431](f3da431f1f))
2025-09-25 14:45:52 +00:00
rohitwaghchaure
a9a68f2523 Merge pull request #49726 from frappe/mergify/bp/version-14/pr-49723
perf: reposting for backdated transactions (backport #49720) (backport #49723)
2025-09-25 20:14:23 +05:30
Rohit Waghchaure
f3da431f1f perf: reposting for backdated transactions
(cherry picked from commit 1b0fc0541b)
(cherry picked from commit 3d51c1b363)
2025-09-25 13:22:15 +00:00
rohitwaghchaure
14e92d589f Merge pull request #49723 from frappe/mergify/bp/version-14-hotfix/pr-49720
perf: reposting for backdated transactions (backport #49720)
2025-09-25 18:50:18 +05:30
Rohit Waghchaure
3d51c1b363 perf: reposting for backdated transactions
(cherry picked from commit 1b0fc0541b)
2025-09-25 12:16:23 +00:00
Frappe PR Bot
825ef415ef chore(release): Bumped to Version 14.91.1
## [14.91.1](https://github.com/frappe/erpnext/compare/v14.91.0...v14.91.1) (2025-09-23)

### Bug Fixes

* add condition for name ([0c7911d](0c7911d0fe))
2025-09-23 13:35:10 +00:00
ruthra kumar
f6148c4352 chore: release v14 (#49696)
* fix: add condition for name

(cherry picked from commit cf5a2d6351)

* test: add test to validate user permission in qb

(cherry picked from commit a5b881ea74)

# Conflicts:
#	erpnext/setup/doctype/employee/test_employee.py

---------

Co-authored-by: venkat102 <venkatesharunachalam659@gmail.com>
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2025-09-23 19:03:40 +05:30
ruthra kumar
3c408ff66b Merge pull request #49616 from frappe/mergify/bp/version-14-hotfix/pr-49467
fix: add condition for name (backport #49467)
2025-09-22 10:49:01 +05:30
venkat102
f6bc9fc505 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:47:10 +05:30
venkat102
0c7911d0fe fix: add condition for name
(cherry picked from commit cf5a2d6351)
2025-09-18 11:12:13 +00:00
Frappe PR Bot
b8ecc4274f chore(release): Bumped to Version 14.91.0
# [14.91.0](https://github.com/frappe/erpnext/compare/v14.90.1...v14.91.0) (2025-09-16)

### Bug Fixes

* duplicate items being created when fetching items from warehouse in stock reco ([646de0b](646de0bec1))
* remove ignore_permissions ([180f406](180f406917))

### Features

* add permission check for custom button ([42b38b7](42b38b7998))
2025-09-16 14:41:37 +00:00
ruthra kumar
a9b7bc1385 Merge pull request #49565 from frappe/version-14-hotfix
chore: release v14
2025-09-16 20:08:58 +05:30
Mihir Kandoi
d062e50f35 Merge pull request #49515 from frappe/mergify/bp/version-14-hotfix/pr-48456 2025-09-10 10:06:48 +05:30
Mihir Kandoi
646de0bec1 fix: duplicate items being created when fetching items from warehouse in stock reco
(cherry picked from commit 73f6c29559)
2025-09-10 03:01:06 +00:00
Raffael Meyer
02de47c673 Merge pull request #49434 from frappe/mergify/bp/version-14-hotfix/pr-49374
fix: improve permission handling for party link creation (backport #49374)
2025-09-03 17:12:27 +02:00
Marc-Constantin Enke
42b38b7998 feat: add permission check for custom button
(cherry picked from commit 00fd1d2f26)
2025-09-02 17:20:31 +00:00
Marc-Constantin Enke
180f406917 fix: remove ignore_permissions
(cherry picked from commit 7f55f421ab)
2025-09-02 17:20:31 +00:00
Frappe PR Bot
90803b852e chore(release): Bumped to Version 14.90.1
## [14.90.1](https://github.com/frappe/erpnext/compare/v14.90.0...v14.90.1) (2025-09-02)

### Bug Fixes

* add is_cancelled in condition ([b9f9be3](b9f9be3d88))
* ignore cancelled gl and add company filter ([6b29c06](6b29c06511))
* set missing due date in Purchase Invoice and POS Invoice ([#49232](https://github.com/frappe/erpnext/issues/49232)) ([2b6b0b3](2b6b0b32a7))
2025-09-02 13:48:57 +00:00
ruthra kumar
4cbde47ac4 Merge pull request #49424 from frappe/version-14-hotfix
chore: release v14
2025-09-02 19:17:38 +05:30
ruthra kumar
0b3215cd42 Merge pull request #49416 from frappe/mergify/bp/version-14-hotfix/pr-49379
fix: add is_cancelled in condition (backport #49379)
2025-09-02 11:16:44 +05:30
l0gesh29
b9f9be3d88 fix: add is_cancelled in condition
(cherry picked from commit 77a9cf6398)
2025-09-02 05:27:23 +00:00
ruthra kumar
faeedb01a8 Merge pull request #49411 from frappe/mergify/bp/version-14-hotfix/pr-49366
fix(trial-balance-simple): ignore cancelled gl and add company filter (backport #49366)
2025-09-02 10:42:36 +05:30
Raffael Meyer
a2402ddf52 Merge pull request #49233 from frappe/mergify/bp/version-14-hotfix/pr-49232
fix: set missing due date in Purchase Invoice and POS Invoice (backport #49232)
2025-09-02 00:49:37 +02:00
l0gesh29
6b29c06511 fix: ignore cancelled gl and add company filter
(cherry picked from commit afb067ce50)
2025-09-01 11:16:22 +00:00
Frappe PR Bot
2cedd455d9 chore(release): Bumped to Version 14.90.0
# [14.90.0](https://github.com/frappe/erpnext/compare/v14.89.2...v14.90.0) (2025-08-26)

### Bug Fixes

* **dunning:** include accounting dimension upon gl creation ([4fccef0](4fccef0636))
* **payment_entry:** clear party_type when switching to Internal Transfer to avoid 'Supplier None not found' ([e27dd64](e27dd64044))
* **Supplier:** add make_method for Pricing Rule (backport [#49282](https://github.com/frappe/erpnext/issues/49282)) ([#49283](https://github.com/frappe/erpnext/issues/49283)) ([7986e69](7986e69839))

### Features

* add make methods for Bank Account (backport [#49000](https://github.com/frappe/erpnext/issues/49000)) ([#49274](https://github.com/frappe/erpnext/issues/49274)) ([836545b](836545bdb4))
2025-08-26 11:35:26 +00:00
ruthra kumar
ba31f685f8 Merge pull request #49327 from frappe/version-14-hotfix
chore: release v14
2025-08-26 17:01:27 +05:30
ruthra kumar
507d27d509 Merge pull request #49309 from niyati34/fix/payment-entry-clear-party-type-v14hotfix
Fix/payment entry clear party type v14hotfix
2025-08-26 13:27:38 +05:30
niyati34
e27dd64044 fix(payment_entry): clear party_type when switching to Internal Transfer to avoid 'Supplier None not found' 2025-08-25 19:49:05 +05:30
ruthra kumar
7f617a54d1 Merge pull request #49278 from aerele/dunning-accouting-dimension
fix(dunning): include accounting dimension upon gl creation
2025-08-25 16:56:35 +05:30
mergify[bot]
7986e69839 fix(Supplier): add make_method for Pricing Rule (backport #49282) (#49283)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
fix(Supplier): add make_method for Pricing Rule (#49282)
2025-08-22 19:26:10 +02:00
mergify[bot]
836545bdb4 feat: add make methods for Bank Account (backport #49000) (#49274)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-08-22 19:17:44 +02:00
ravibharathi656
4fccef0636 fix(dunning): include accounting dimension upon gl creation 2025-08-22 12:34:39 +05:30
Raffael Meyer
2b6b0b32a7 fix: set missing due date in Purchase Invoice and POS Invoice (#49232)
(cherry picked from commit 77478303fe)
2025-08-19 12:30:46 +00:00
Frappe PR Bot
dac192a210 chore(release): Bumped to Version 14.89.2
## [14.89.2](https://github.com/frappe/erpnext/compare/v14.89.1...v14.89.2) (2025-08-19)

### Bug Fixes

* formatted string for disabled filter in get_income_account ([1c24bed](1c24bedaf6))
* handle empty loyalty point details ([0d6be69](0d6be69ce5))
* include missing cint import ([ea454ef](ea454ef770))
* sanitize column name for inventory_dimensions in get_stock_balance ([c3ebc39](c3ebc39f3b))
* use query builder instead of raw SQL in get_blanket_orders ([9d06e09](9d06e093a6))
* use query builder instead of raw SQL in get_loyalty_details ([64e6d65](64e6d65c00))
* use query builder instead of raw SQL in get_material_requests_based_on_supplier ([5a0e690](5a0e690307))
* use query builder instead of raw SQL in get_rfq_containing_supplier ([4b643fe](4b643feb92))
* use query builder instead of raw SQL in get_timesheet_detail_rate ([22d7bbb](22d7bbb081))
* use query builder instead of raw SQL in unset_existing_data ([06f04ca](06f04cad3e))
2025-08-19 11:53:42 +00:00
ruthra kumar
8421e09a95 Merge pull request #49226 from frappe/version-14-hotfix
chore: release v14
2025-08-19 17:22:16 +05:30
Diptanil Saha
43a723546d Merge pull request #49220 from frappe/mergify/bp/version-14-hotfix/pr-49192
fix: improve queries with query builder and input sanitization (backport #49192)
2025-08-19 11:51:32 +05:30
diptanilsaha
ea454ef770 fix: include missing cint import 2025-08-19 11:27:55 +05:30
diptanilsaha
0d6be69ce5 fix: handle empty loyalty point details
(cherry picked from commit 1231ca17c9)
2025-08-19 05:25:23 +00:00
diptanilsaha
22d7bbb081 fix: use query builder instead of raw SQL in get_timesheet_detail_rate
(cherry picked from commit e563ed0c75)
2025-08-19 05:25:23 +00:00
diptanilsaha
4b643feb92 fix: use query builder instead of raw SQL in get_rfq_containing_supplier
(cherry picked from commit 7f2a52ff71)
2025-08-19 05:25:22 +00:00
diptanilsaha
06f04cad3e fix: use query builder instead of raw SQL in unset_existing_data
(cherry picked from commit 7fa4ed6139)
2025-08-19 05:25:22 +00:00
diptanilsaha
c3ebc39f3b fix: sanitize column name for inventory_dimensions in get_stock_balance
(cherry picked from commit eb22794f14)
2025-08-19 05:25:22 +00:00
diptanilsaha
9d06e093a6 fix: use query builder instead of raw SQL in get_blanket_orders
(cherry picked from commit 1db135262d)
2025-08-19 05:25:22 +00:00
diptanilsaha
1c24bedaf6 fix: formatted string for disabled filter in get_income_account
(cherry picked from commit 6320f7290f)
2025-08-19 05:25:21 +00:00
diptanilsaha
5a0e690307 fix: use query builder instead of raw SQL in get_material_requests_based_on_supplier
(cherry picked from commit de919568b4)
2025-08-19 05:25:21 +00:00
diptanilsaha
64e6d65c00 fix: use query builder instead of raw SQL in get_loyalty_details
(cherry picked from commit 8696ba2f5d)
2025-08-19 05:25:21 +00:00
Frappe PR Bot
e7915b31ce chore(release): Bumped to Version 14.89.1
## [14.89.1](https://github.com/frappe/erpnext/compare/v14.89.0...v14.89.1) (2025-08-12)

### Bug Fixes

* add condition to fetch active accounts ([8fc8aa2](8fc8aa2dfd))
* nonetype error on applying presentation_currency filter on financial statements and trial balance report ([89d00ee](89d00ee4a2))
* **purchase invoice:** filter only enabled account ([e0d9a47](e0d9a47ff7))
* **tax withholding details:** avoid voucher duplication ([92ee871](92ee871b79))
* timeout while submitting purchase receipt ([06c3839](06c3839abc))
2025-08-12 12:02:50 +00:00
ruthra kumar
b4200c5453 Merge pull request #49117 from frappe/version-14-hotfix
chore: release v14
2025-08-12 17:31:29 +05:30
ruthra kumar
2f4bfa77b2 Merge pull request #48998 from frappe/mergify/bp/version-14-hotfix/pr-48761
fix: prevent gain or loss entry cancellation upon reposting (backport #48761)
2025-08-12 16:44:09 +05:30
Vignesh S
5eeaaf4757 chore: fix text case failure casued by mergify 2025-08-12 16:25:59 +05:30
ruthra kumar
8faabb8110 Merge pull request #49115 from frappe/mergify/bp/version-14-hotfix/pr-48909
fix(tax withholding details): avoid voucher duplication (backport #48909)
2025-08-12 16:07:00 +05:30
ravibharathi656
92ee871b79 fix(tax withholding details): avoid voucher duplication
(cherry picked from commit 8837016243)
2025-08-12 09:31:36 +00:00
MochaMind
67dad765dc chore: release v14 (#49057)
* fix: timeout while submitting purchase receipt

(cherry picked from commit c433943c46)

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

* chore: fix conflicts

* fix: nonetype error on applying presentation_currency filter on financial statements and trial balance report

(cherry picked from commit d7e22de44c)

* fix(purchase invoice): filter only enabled account

(cherry picked from commit c3111db6e2)

* fix: add condition to fetch active accounts

(cherry picked from commit 7c8dd86a35)

* chore: add back filter

(cherry picked from commit 23308f6d10)

---------

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
Co-authored-by: diptanilsaha <diptanil@frappe.io>
Co-authored-by: mithili <mithili15602@gamil.com>
Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-08-11 11:50:29 +05:30
Mihir Kandoi
25ff9e0a4d Merge pull request #49048 from frappe/mergify/bp/version-14-hotfix/pr-48813
fix(purchase invoice): filter only enabled account (backport #48813)
2025-08-08 12:00:55 +05:30
mithili
a230a0d94c chore: add back filter
(cherry picked from commit 23308f6d10)
2025-08-08 05:25:01 +00:00
mithili
8fc8aa2dfd fix: add condition to fetch active accounts
(cherry picked from commit 7c8dd86a35)
2025-08-08 05:25:01 +00:00
mithili
e0d9a47ff7 fix(purchase invoice): filter only enabled account
(cherry picked from commit c3111db6e2)
2025-08-08 05:25:01 +00:00
rohitwaghchaure
9d0034f0a4 Merge pull request #49018 from frappe/mergify/bp/version-14-hotfix/pr-49010
fix: timeout while submitting purchase receipt (backport #49010)
2025-08-07 12:28:30 +05:30
Diptanil Saha
f3d780c5bc Merge pull request #49024 from frappe/mergify/bp/version-14-hotfix/pr-49023
fix: NoneType error on applying presentation_currency filter on financial statements and trial balance report (backport #49023)
2025-08-07 02:31:03 +05:30
diptanilsaha
89d00ee4a2 fix: nonetype error on applying presentation_currency filter on financial statements and trial balance report
(cherry picked from commit d7e22de44c)
2025-08-06 20:41:33 +00:00
rohitwaghchaure
22e63099ee chore: fix conflicts 2025-08-06 22:24:45 +05:30
Rohit Waghchaure
06c3839abc fix: timeout while submitting purchase receipt
(cherry picked from commit c433943c46)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
2025-08-06 14:35:43 +00:00
Frappe PR Bot
a7d13d580c chore(release): Bumped to Version 14.89.0
# [14.89.0](https://github.com/frappe/erpnext/compare/v14.88.4...v14.89.0) (2025-08-06)

### Bug Fixes

* add doctype fieldname in condition ([c263e6d](c263e6d67e))
* add flt to prevent NoneType errors ([2c98081](2c98081be6))
* closing balance being added twice to fifo queue ([7abc4c4](7abc4c4022))
* do not split round off when there is a cost center allocation ([388b5fb](388b5fb8f6))
* payment ledger voucher seperator row currencies ([0de4477](0de4477ddf))
* provide company for outstanding record. ([235f271](235f271729))
* provide missing `company` in report records that require reference to `Company:company:default_currency` ([d38fd07](d38fd0779c))
* Use correct Attachments folder in code list import ([f415bc3](f415bc3d14))

### Features

* add show_amount_in_company_currency in gl report ([eb69122](eb691226d5))
2025-08-06 02:35:47 +00:00
ruthra kumar
dd9dc29fe5 Merge pull request #48980 from frappe/version-14-hotfix
chore: release v14
2025-08-06 08:04:22 +05:30
Logesh Periyasamy
b3035ec7d4 Merge pull request #48761 from aerele/exchange-gain-or-loss-on-repost
fix: prevent gain or loss entry cancellation upon reposting
(cherry picked from commit a8d17b7590)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
2025-08-06 07:44:42 +05:30
ruthra kumar
0ecc056a3f Merge pull request #48996 from frappe/mergify/bp/version-14-hotfix/pr-48901
fix: do not split round off when there is a cost center allocation (backport #48901)
2025-08-05 20:55:34 +05:30
ravibharathi656
7a9150aac0 test: add test for cost center allocation commercial rounding
(cherry picked from commit dd24cce509)

# Conflicts:
#	erpnext/accounts/doctype/cost_center_allocation/test_cost_center_allocation.py
2025-08-05 20:35:21 +05:30
venkat102
388b5fb8f6 fix: do not split round off when there is a cost center allocation
(cherry picked from commit f0df41d521)
2025-08-05 20:35:18 +05:30
ruthra kumar
96a1a4a8b8 Merge pull request #48984 from frappe/mergify/bp/version-14-hotfix/pr-48798
feat: add show_amount_in_company_currency in gl report (backport #48798)
2025-08-05 17:44:27 +05:30
l0gesh29
eb691226d5 feat: add show_amount_in_company_currency in gl report
(cherry picked from commit 468e5e9b2e)

# Conflicts:
#	erpnext/accounts/report/general_ledger/general_ledger.js
2025-08-05 17:11:33 +05:30
Mihir Kandoi
00e61a531a Merge pull request #48986 from mihir-kandoi/st45290
fix: closing balance being added twice to fifo queue in stock ageing report
2025-08-05 15:48:38 +05:30
Mihir Kandoi
7abc4c4022 fix: closing balance being added twice to fifo queue 2025-08-05 15:25:25 +05:30
Mihir Kandoi
1ae3fd3e27 Merge pull request #48966 from frappe/mergify/bp/version-14-hotfix/pr-48693
fix: Use correct Attachments folder in code list import (backport #48693)
2025-08-05 14:29:16 +05:30
ruthra kumar
ade44fbdb4 Merge pull request #48970 from frappe/mergify/bp/version-14-hotfix/pr-48861
chore: correct description for `consider_party_ledger_amount` in Tax Withholding Category (backport #48861)
2025-08-05 14:26:25 +05:30
ljain112
82e8fb8a5e chore: correct description for consider_party_ledger_amount in Tax Withholding Category
(cherry picked from commit f619bca2d6)

# Conflicts:
#	erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.json
2025-08-05 14:24:38 +05:30
Corentin Forler
f415bc3d14 fix: Use correct Attachments folder in code list import
(cherry picked from commit bc2cb1737a)
2025-08-05 08:34:37 +00:00
ruthra kumar
5bc3273460 Merge pull request #48963 from frappe/mergify/bp/version-14-hotfix/pr-48860
fix: add doctype fieldname in condition (backport #48860)
2025-08-05 13:09:37 +05:30
l0gesh29
c263e6d67e fix: add doctype fieldname in condition
(cherry picked from commit e2d63e4c32)

# Conflicts:
#	erpnext/accounts/utils.py
2025-08-05 12:16:33 +05:30
ruthra kumar
11b5a81170 Merge pull request #48927 from pps190/backport/version-14-hotfix/48926
fix: provide missing company in report records that require reference to Company:company:default_currency (Backport #48926)
2025-08-04 10:29:49 +05:30
Mihir Kandoi
27485b9472 Merge pull request #48329 from pps190/backport/version-14-hotfix/34909
Get incoming rate v14 fix (Backport #34909)
2025-08-02 22:09:30 +05:30
Devin Slauenwhite
0de4477ddf fix: payment ledger voucher seperator row currencies 2025-08-02 12:29:52 -04:00
Devin Slauenwhite
235f271729 fix: provide company for outstanding record. 2025-08-02 12:23:32 -04:00
Devin Slauenwhite
d38fd0779c fix: provide missing company in report records that require reference to Company:company:default_currency 2025-08-02 12:03:40 -04:00
Mihir Kandoi
093c6bb17e Merge pull request #48907 from frappe/st45332
fix: add flt to prevent NoneType errors
2025-08-01 17:07:50 +05:30
Mihir Kandoi
2c98081be6 fix: add flt to prevent NoneType errors 2025-08-01 16:39:56 +05:30
Frappe PR Bot
e5c821a822 chore(release): Bumped to Version 14.88.4
## [14.88.4](https://github.com/frappe/erpnext/compare/v14.88.3...v14.88.4) (2025-07-29)

### Bug Fixes

* import get_link_to_form from utils ([b43fbf2](b43fbf2a7d))
* include empty values in user permission ([4d12ae0](4d12ae069e))
* incorrect GL entries ([493c8ce](493c8ce04e))
* post gl entry on completion date of asset repair ([80ae982](80ae9820f0))
* resolved conflicts ([6cdc781](6cdc7811b8))
* resolved conflicts ([4524c74](4524c74968))
2025-07-29 15:11:30 +00:00
ruthra kumar
500ffbab09 Merge pull request #48831 from frappe/version-14-hotfix
chore: release v14
2025-07-29 20:40:08 +05:30
ruthra kumar
451326fdeb Merge pull request #48846 from frappe/mergify/bp/version-14-hotfix/pr-48835
fix: include empty values in user permission (backport #48835)
2025-07-29 20:17:18 +05:30
l0gesh29
4d12ae069e fix: include empty values in user permission
(cherry picked from commit f13d98fc7c)
2025-07-29 14:26:33 +00:00
Khushi Rawat
4297c58e5e Merge pull request #48834 from frappe/mergify/bp/version-14-hotfix/pr-48833
fix: post gl entry on completion date of asset repair (backport #48833)
2025-07-29 16:57:02 +05:30
Khushi Rawat
b43fbf2a7d fix: import get_link_to_form from utils 2025-07-29 15:48:41 +05:30
Khushi Rawat
6cdc7811b8 fix: resolved conflicts 2025-07-29 15:42:00 +05:30
Khushi Rawat
59ac7aeb23 chore: resolved conflicts 2025-07-29 15:41:20 +05:30
Khushi Rawat
4524c74968 fix: resolved conflicts 2025-07-29 15:39:10 +05:30
khushi8112
80ae9820f0 fix: post gl entry on completion date of asset repair
(cherry picked from commit 5a82b723c2)

# Conflicts:
#	erpnext/assets/doctype/asset_repair/asset_repair.json
#	erpnext/assets/doctype/asset_repair/asset_repair.py
#	erpnext/assets/doctype/asset_repair/test_asset_repair.py
2025-07-29 10:07:22 +00:00
rohitwaghchaure
5d92f38bbe Merge pull request #48807 from frappe/mergify/bp/version-14-hotfix/pr-48801
fix: incorrect GL entries (backport #48801)
2025-07-28 17:54:00 +05:30
rohitwaghchaure
a944eaf054 chore: fix conflicts 2025-07-28 16:35:39 +05:30
Rohit Waghchaure
493c8ce04e fix: incorrect GL entries
(cherry picked from commit 4c273fcc99)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
2025-07-28 10:58:37 +00:00
Frappe PR Bot
a711cd7a18 chore(release): Bumped to Version 14.88.3
## [14.88.3](https://github.com/frappe/erpnext/compare/v14.88.2...v14.88.3) (2025-07-23)

### Bug Fixes

* add validation for account key ([360f3b7](360f3b7c25))
* calculate due date based on payment term ([#46416](https://github.com/frappe/erpnext/issues/46416)) ([9e7a5bb](9e7a5bb1bb))
* performance issue while submitting the purchase invoice ([4fe09fd](4fe09fd7e8))
* **period closing voucher:** closing account head debit and debit in account currency should be equal ([76a233e](76a233e1b7))
* **production plan:** add company filter to sub assembly warehouse ([8934adf](8934adfef4))
* show amount for exchange gain or loss account ([581221f](581221f1ec))
2025-07-23 02:50:52 +00:00
ruthra kumar
942aca31f2 Merge pull request #48746 from frappe/version-14-hotfix
chore: release v14
2025-07-23 08:19:35 +05:30
ruthra kumar
77ea06dc7d Merge pull request #48740 from frappe/mergify/bp/version-14-hotfix/pr-48665
fix: show amount for exchange gain or loss account (backport #48665)
2025-07-22 12:56:31 +05:30
l0gesh29
360f3b7c25 fix: add validation for account key
(cherry picked from commit b6da350c20)
2025-07-22 06:44:03 +00:00
l0gesh29
581221f1ec fix: show amount for exchange gain or loss account
(cherry picked from commit 4f90f50eb2)
2025-07-22 06:44:03 +00:00
rohitwaghchaure
e0be83caa5 Merge pull request #48728 from frappe/mergify/bp/version-14-hotfix/pr-48704
fix(production plan): add company filter to sub assembly warehouse (backport #48704)
2025-07-21 20:04:07 +05:30
ravibharathi656
8934adfef4 fix(production plan): add company filter to sub assembly warehouse
(cherry picked from commit 1728a95111)
2025-07-21 14:27:40 +00:00
Frappe PR Bot
259251dfab chore(release): Bumped to Version 14.88.2
## [14.88.2](https://github.com/frappe/erpnext/compare/v14.88.1...v14.88.2) (2025-07-17)

### Bug Fixes

* calculate due date based on payment term ([#46416](https://github.com/frappe/erpnext/issues/46416)) ([9ce357f](9ce357f3bf))
2025-07-17 11:18:43 +00:00
rohitwaghchaure
f8c54f0a9b Merge pull request #48660 from frappe/mergify/bp/version-14/pr-48638
fix: calculate due date based on payment term (backport #46416) (backport #48638)
2025-07-17 16:47:21 +05:30
Sudharsanan Ashok
9ce357f3bf fix: calculate due date based on payment term (#46416)
(cherry picked from commit 9e808c832f)
(cherry picked from commit 9e7a5bb1bb)
2025-07-17 10:45:07 +00:00
Marica
2d6f4740be Merge pull request #48638 from frappe/mergify/bp/version-14-hotfix/pr-46416
fix: calculate due date based on payment term (backport #46416)
2025-07-16 17:18:04 +02:00
Frappe PR Bot
a3b38d9a91 chore(release): Bumped to Version 14.88.1
## [14.88.1](https://github.com/frappe/erpnext/compare/v14.88.0...v14.88.1) (2025-07-16)

### Bug Fixes

* **period closing voucher:** closing account head debit and debit in account currency should be equal ([18eea34](18eea3425c))
2025-07-16 15:09:51 +00:00
ruthra kumar
ed2e8c2cc6 Merge pull request #48640 from frappe/mergify/bp/version-14/pr-48615
fix(period closing voucher): closing account head debit and debit in account currency should be equal (backport #48615)
2025-07-16 20:38:16 +05:30
venkat102
18eea3425c fix(period closing voucher): closing account head debit and debit in account currency should be equal
(cherry picked from commit 76a233e1b7)
2025-07-16 14:46:15 +00:00
ruthra kumar
7aaea9f5b6 Merge pull request #48615 from aerele/backport-48612
fix(period closing voucher): closing account head debit and debit in account currency should be equal
2025-07-16 20:13:11 +05:30
Sudharsanan Ashok
9e7a5bb1bb fix: calculate due date based on payment term (#46416)
(cherry picked from commit 9e808c832f)
2025-07-16 14:40:15 +00:00
rohitwaghchaure
27105501fb Merge pull request #48636 from frappe/mergify/bp/version-14-hotfix/pr-48633
fix: performance issue while submitting the purchase invoice (backport #48633)
2025-07-16 17:10:28 +05:30
Rohit Waghchaure
4fe09fd7e8 fix: performance issue while submitting the purchase invoice
(cherry picked from commit 47979871de)
2025-07-16 11:16:37 +00:00
venkat102
76a233e1b7 fix(period closing voucher): closing account head debit and debit in account currency should be equal 2025-07-15 18:24:54 +05:30
Frappe PR Bot
bda447f20a chore(release): Bumped to Version 14.88.0
# [14.88.0](https://github.com/frappe/erpnext/compare/v14.87.0...v14.88.0) (2025-07-15)

### Bug Fixes

* **Employee:** add context to status in List View (backport [#48576](https://github.com/frappe/erpnext/issues/48576)) ([#48578](https://github.com/frappe/erpnext/issues/48578)) ([9dad082](9dad08274a))

### Features

* parent item group support in Stock Projected Qty report ([3b36be2](3b36be214f))
* update the modified date of the SLE after reposting ([8966c95](8966c956d5))
2025-07-15 12:50:14 +00:00
ruthra kumar
7db420cf9f Merge pull request #48601 from frappe/version-14-hotfix
chore: release v14
2025-07-15 18:18:44 +05:30
ruthra kumar
5ddfe3ce1d Merge pull request #48585 from frappe/mergify/bp/version-14-hotfix/pr-47892
refactor: use sql for building voucher balance in Receivable report (backport #47892)
2025-07-15 08:23:20 +05:30
ruthra kumar
ff998572e7 chore: resolve conflicts 2025-07-15 08:03:48 +05:30
ruthra kumar
f364a41490 chore: rename method
(cherry picked from commit fc8ca7d82c)

# Conflicts:
#	erpnext/accounts/report/accounts_receivable/accounts_receivable.py
2025-07-15 01:52:45 +00:00
ruthra kumar
804edad233 refactor: build and pass match conditions as qb criterion
(cherry picked from commit 7efeed54de)

# Conflicts:
#	erpnext/accounts/report/accounts_receivable/accounts_receivable.py
#	erpnext/accounts/utils.py
2025-07-15 01:52:45 +00:00
ruthra kumar
e533158a1c chore: drop unused utility method
(cherry picked from commit 52c0df24e3)
2025-07-15 01:52:45 +00:00
ruthra kumar
5bcf642dff refactor: dynamic DB field types
(cherry picked from commit 9d0ebe3427)

# Conflicts:
#	erpnext/accounts/report/accounts_receivable/accounts_receivable.py
2025-07-15 01:52:44 +00:00
ruthra kumar
d7822f493b refactor: better variable name
(cherry picked from commit 1a90c0d031)
2025-07-15 01:52:44 +00:00
ruthra kumar
5188745c53 refactor: prefix-ed names for easy distinction
(cherry picked from commit c5e35cc330)
2025-07-15 01:52:44 +00:00
ruthra kumar
006a8c71fd refactor: utility to drop existing procedures and include cost center
(cherry picked from commit da32bb5f51)

# Conflicts:
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.js
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.json
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.py
2025-07-15 01:52:44 +00:00
ruthra kumar
ba25d334b1 refactor: order by posting date
(cherry picked from commit 7b7440d44a)
2025-07-15 01:52:43 +00:00
ruthra kumar
dd1020ccfb refactor: call procedures based on config
(cherry picked from commit e90c6a33bd)

# Conflicts:
#	erpnext/accounts/report/accounts_receivable/accounts_receivable.py
2025-07-15 01:52:43 +00:00
ruthra kumar
de2f80811f refactor: introduce sql option for data fetch
(cherry picked from commit 8cf8f6abad)

# Conflicts:
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.py
2025-07-15 01:52:43 +00:00
ruthra kumar
12eaa64572 refactor: better readability
(cherry picked from commit 097e74979f)
2025-07-15 01:52:42 +00:00
ruthra kumar
da1dcb8b21 refactor: using sql procedures for AR report
- dynamic filters are passed

(cherry picked from commit e5920c57aa)

# Conflicts:
#	erpnext/accounts/report/accounts_receivable/accounts_receivable.py
2025-07-15 01:52:42 +00:00
mergify[bot]
9dad08274a fix(Employee): add context to status in List View (backport #48576) (#48578)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
fix(Employee): add context to status in List View (#48576)
2025-07-14 15:53:42 +02:00
rohitwaghchaure
d8d53bc43e Merge pull request #48496 from frappe/mergify/bp/version-14-hotfix/pr-48490
feat: update the modified date of the SLE after reposting (backport #48490)
2025-07-09 19:45:26 +05:30
Rohit Waghchaure
8966c956d5 feat: update the modified date of the SLE after reposting
(cherry picked from commit c2cd4934e7)
2025-07-09 13:52:11 +00:00
rohitwaghchaure
a518fc080a Merge pull request #48491 from frappe/mergify/bp/version-14-hotfix/pr-48488
feat: parent item group support in Stock Projected Qty report (backport #48488)
2025-07-09 18:59:55 +05:30
Rohit Waghchaure
3b36be214f feat: parent item group support in Stock Projected Qty report
(cherry picked from commit 6e80d89d13)
2025-07-09 11:19:41 +00:00
Frappe PR Bot
20af226947 chore(release): Bumped to Version 14.87.0
# [14.87.0](https://github.com/frappe/erpnext/compare/v14.86.5...v14.87.0) (2025-07-08)

### Bug Fixes

* fetch from parent optional in inventory dimension ([bb901ca](bb901cab88))
* incorrect backport ([94a17b6](94a17b6ec2))

### Features

* Period-wise closing entries for TB (backport [#39712](https://github.com/frappe/erpnext/issues/39712)) ([#48386](https://github.com/frappe/erpnext/issues/48386)) ([711e06b](711e06b537))

### Reverts

* do not convert exchange gain/loss amount to foreign currency ([083402e](083402e9a8))
* Revert "fix: stock reco qty with inventory dimension ([#47918](https://github.com/frappe/erpnext/issues/47918))" ([9207d79](9207d79ce6))
2025-07-08 12:54:12 +00:00
ruthra kumar
7f26b1d5a2 Merge pull request #48461 from frappe/version-14-hotfix
chore: release v14
2025-07-08 18:22:45 +05:30
ruthra kumar
c332fcdeff Merge pull request #48458 from frappe/mergify/bp/version-14-hotfix/pr-48361
revert: do not convert exchange gain/loss amount to foreign currency (backport #48361)
2025-07-08 15:45:19 +05:30
mergify[bot]
51adea3b89 refactor: remove do_reposting_for_each_stock_transaction feature (backport #48444) (#48451)
* refactor: remove do_reposting_for_each_stock_transaction feature

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
2025-07-08 15:06:00 +05:30
venkat102
083402e9a8 revert: do not convert exchange gain/loss amount to foreign currency
(cherry picked from commit c17ae703c7)

# Conflicts:
#	erpnext/accounts/report/general_ledger/test_general_ledger.py
2025-07-08 14:26:24 +05:30
rohitwaghchaure
1116a0fc8e Merge pull request #48442 from frappe/mergify/bp/version-14-hotfix/pr-48441
Revert "fix: stock reco qty with inventory dimension" (backport #48441)
2025-07-08 12:30:58 +05:30
rohitwaghchaure
b15d7e573e chore: fix conflicts 2025-07-08 10:45:49 +05:30
rohitwaghchaure
9207d79ce6 Revert "fix: stock reco qty with inventory dimension (#47918)"
This reverts commit 342cebc778.

(cherry picked from commit 8ba66c9833)

# Conflicts:
#	erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
2025-07-08 05:07:53 +00:00
rohitwaghchaure
33eb72035b Merge pull request #48433 from frappe/mergify/bp/version-14-hotfix/pr-48432
fix: fetch from parent optional in inventory dimension (backport #48432)
2025-07-08 10:13:56 +05:30
rohitwaghchaure
2c6099e051 Merge pull request #48438 from rohitwaghchaure/fixed-sales-incoming-rate-issue
fix: incorrect backport
2025-07-08 09:55:06 +05:30
rohitwaghchaure
5f4aaed5a0 chore: fix conflicts 2025-07-08 08:34:16 +05:30
Rohit Waghchaure
94a17b6ec2 fix: incorrect backport 2025-07-08 08:32:12 +05:30
Rohit Waghchaure
bb901cab88 fix: fetch from parent optional in inventory dimension
(cherry picked from commit 8aac6a6b18)

# Conflicts:
#	erpnext/stock/doctype/inventory_dimension/inventory_dimension.json
2025-07-07 11:52:53 +00:00
Diptanil Saha
711e06b537 feat: Period-wise closing entries for TB (backport #39712) (#48386)
feat: Period-wise closing entries for TB

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2025-07-03 22:47:28 +05:30
Diptanil Saha
c54b65acc2 chore: fix flaky test in Tax Withholding Details (backport #48375) (#48387)
* fix(test): flaky budget test case

* chore(test): import get_accumulated_monthly_budget

* fix(test): tds_payable_monthly tests

---------

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2025-07-03 22:09:19 +05:30
Frappe PR Bot
179b8c7c61 chore(release): Bumped to Version 14.86.5
## [14.86.5](https://github.com/frappe/erpnext/compare/v14.86.4...v14.86.5) (2025-07-01)

### Bug Fixes

* accounting entries for standalone credit notes ([15ae019](15ae0196c6))
* add validation for exchange gain/loss entries ([b98cce8](b98cce8b9a))
* do not allow backdated transactions against serial numbers. ([#48281](https://github.com/frappe/erpnext/issues/48281)) ([945bdab](945bdabebb))
2025-07-01 11:59:12 +00:00
ruthra kumar
b107387dda Merge pull request #48337 from frappe/version-14-hotfix
chore: release v14
2025-07-01 17:27:40 +05:30
ruthra kumar
9fcca18bf3 Merge pull request #48334 from frappe/mergify/bp/version-14-hotfix/pr-48162
fix: add validation for exchange gain/loss entries (backport #48162)
2025-07-01 16:20:45 +05:30
i-am-vimal
b98cce8b9a fix: add validation for exchange gain/loss entries
(cherry picked from commit 5c9eddd31e)

# Conflicts:
#	erpnext/accounts/report/utils.py
2025-07-01 15:36:51 +05:30
Hossein Yousefian
bd9655a781 get_incoming_rate_voucher_no_fix 2025-06-30 17:11:04 -04:00
Hossein Yousefian
1df3b608ec get_incoming_rate_zero_in_rate_fix 2025-06-30 17:11:04 -04:00
rohitwaghchaure
62b7a8d21a Merge pull request #48313 from frappe/mergify/bp/version-14-hotfix/pr-48310
fix: accounting entries for standalone credit notes (backport #48310)
2025-06-30 10:09:23 +05:30
rohitwaghchaure
6b31e54891 chore: fix conflicts 2025-06-30 09:42:13 +05:30
Rohit Waghchaure
15ae0196c6 fix: accounting entries for standalone credit notes
(cherry picked from commit 52177cffcd)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
2025-06-30 04:09:39 +00:00
Frappe PR Bot
a06d705d75 chore(release): Bumped to Version 14.86.4
## [14.86.4](https://github.com/frappe/erpnext/compare/v14.86.3...v14.86.4) (2025-06-27)

### Bug Fixes

* do not allow backdated transactions against serial numbers. ([#48281](https://github.com/frappe/erpnext/issues/48281)) ([1393100](1393100a62))
2025-06-27 06:27:09 +00:00
rohitwaghchaure
9e3e3182f2 Merge pull request #48290 from frappe/mergify/bp/version-14/pr-48281
fix: do not allow backdated transactions against serial numbers. (backport #48281)
2025-06-27 11:55:38 +05:30
rohitwaghchaure
1393100a62 fix: do not allow backdated transactions against serial numbers. (#48281)
(cherry picked from commit 945bdabebb)
2025-06-27 06:03:52 +00:00
rohitwaghchaure
945bdabebb fix: do not allow backdated transactions against serial numbers. (#48281) 2025-06-27 11:33:03 +05:30
Frappe PR Bot
f07594b863 chore(release): Bumped to Version 14.86.3
## [14.86.3](https://github.com/frappe/erpnext/compare/v14.86.2...v14.86.3) (2025-06-24)

### Bug Fixes

* get already billed amount from current doc instead of database ([#48079](https://github.com/frappe/erpnext/issues/48079)) ([0790db7](0790db79fd))
2025-06-24 14:08:14 +00:00
ruthra kumar
25a382ec24 Merge pull request #48241 from frappe/version-14-hotfix
chore: release v14
2025-06-24 19:36:37 +05:30
ruthra kumar
d7c47e8ea5 Merge pull request #48234 from frappe/mergify/bp/version-14-hotfix/pr-48079
fix: get already billed amount from current doc instead of database (backport #48079)
2025-06-24 17:36:05 +05:30
ljain112
2627fb10ce chore: resolve conflicts 2025-06-24 16:14:24 +05:30
Lakshit Jain
0790db79fd fix: get already billed amount from current doc instead of database (#48079)
* fix: get already billed amount from current doc instead of database

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

* refactor: minor fixes

---------

Co-authored-by: Sagar Vora <16315650+sagarvora@users.noreply.github.com>
(cherry picked from commit 47c3c4808e)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
2025-06-24 10:11:43 +00:00
Frappe PR Bot
0dad2acfc8 chore(release): Bumped to Version 14.86.2
## [14.86.2](https://github.com/frappe/erpnext/compare/v14.86.1...v14.86.2) (2025-06-17)

### Bug Fixes

* incorrect warehouse set from SO to MR ([fbfc6a6](fbfc6a6f62))
2025-06-17 14:36:59 +00:00
ruthra kumar
193042ef07 Merge pull request #48099 from frappe/version-14-hotfix
chore: release v14
2025-06-17 20:05:31 +05:30
rohitwaghchaure
8208a9ec27 Merge pull request #48064 from frappe/mergify/bp/version-14-hotfix/pr-48061
fix: incorrect warehouse set from SO to MR (backport #48061)
2025-06-16 14:52:54 +05:30
Rohit Waghchaure
fbfc6a6f62 fix: incorrect warehouse set from SO to MR
(cherry picked from commit 0da8d9c869)
2025-06-16 04:42:26 +00:00
Frappe PR Bot
e9f9eaa2d0 chore(release): Bumped to Version 14.86.1
## [14.86.1](https://github.com/frappe/erpnext/compare/v14.86.0...v14.86.1) (2025-06-10)

### Bug Fixes

* available qty in BOM Stock Report ([186173a](186173a21e))
* incorrect warehouse in MR ([2cac05e](2cac05e56c))
* key-error for COGS By Item Group report (backport [#47914](https://github.com/frappe/erpnext/issues/47914)) ([#47916](https://github.com/frappe/erpnext/issues/47916)) ([f5ef376](f5ef376486))
* stock adjustment entry during reposting (backport [#47878](https://github.com/frappe/erpnext/issues/47878)) ([#47882](https://github.com/frappe/erpnext/issues/47882)) ([c9eeca2](c9eeca22f5))
* stock reco qty with inventory dimension (backport [#47918](https://github.com/frappe/erpnext/issues/47918)) ([#47921](https://github.com/frappe/erpnext/issues/47921)) ([6397c36](6397c366fd))
* throw permission error ([#47976](https://github.com/frappe/erpnext/issues/47976)) ([96c937b](96c937bf6a))
2025-06-10 14:31:53 +00:00
ruthra kumar
08d40ddb9b Merge pull request #47997 from frappe/version-14-hotfix
chore: release v14
2025-06-10 20:00:21 +05:30
rohitwaghchaure
d60ab92082 Merge pull request #48003 from frappe/mergify/bp/version-14-hotfix/pr-47998
fix: incorrect warehouse in MR (backport #47998)
2025-06-10 18:54:18 +05:30
rohitwaghchaure
85a0581145 chore: fix conflicts 2025-06-10 18:20:28 +05:30
Rohit Waghchaure
2cac05e56c fix: incorrect warehouse in MR
(cherry picked from commit 2b9ca79291)

# Conflicts:
#	erpnext/manufacturing/doctype/production_plan/production_plan.py
2025-06-10 12:41:16 +00:00
ruthra kumar
10e4e610db Merge pull request #47993 from frappe/mergify/bp/version-14-hotfix/pr-47981
refactor(Work Order): query_sales_order (backport #47981)
2025-06-10 15:01:22 +05:30
barredterra
9ab80cfd6c refactor(Work Order): query_sales_order
- Use `get_list` instead of `db.sql_list`

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

- Added type hints to enable argument validation

(cherry picked from commit 2dbdacf905)
2025-06-10 09:03:13 +00:00
rohitwaghchaure
8f2b83d434 Merge pull request #47986 from frappe/mergify/bp/version-14-hotfix/pr-47942
fix: available qty in BOM Stock Report (backport #47942)
2025-06-10 14:03:06 +05:30
Sagar Vora
7f0ebb37da Merge pull request #47977 from frappe/mergify/bp/version-14-hotfix/pr-47976
fix: throw permission error (backport #47976)
2025-06-10 07:39:53 +00:00
Sagar Vora
1d42c4a305 chore: fix conflicts 2025-06-10 13:08:39 +05:30
Rohit Waghchaure
186173a21e fix: available qty in BOM Stock Report
(cherry picked from commit ea689bbe3f)
2025-06-10 06:50:51 +00:00
Aayush Dalal
96c937bf6a fix: throw permission error (#47976)
Co-authored-by: Sagar Vora <16315650+sagarvora@users.noreply.github.com>
(cherry picked from commit 8b6a8d0c4f)

# Conflicts:
#	erpnext/accounts/doctype/bank_statement_import/bank_statement_import.py
#	erpnext/stock/utils.py
2025-06-09 17:29:42 +00:00
rohitwaghchaure
52aafc9410 Merge pull request #47932 from rohitwaghchaure/fixed-sabb-cond
chore: incorrect condition
2025-06-06 13:13:54 +05:30
Rohit Waghchaure
3232310c0f chore: incorrect condition 2025-06-06 12:30:03 +05:30
mergify[bot]
6397c366fd fix: stock reco qty with inventory dimension (backport #47918) (#47921)
fix: stock reco qty with inventory dimension (#47918)

(cherry picked from commit 342cebc778)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-06-06 09:50:20 +05:30
mergify[bot]
f5ef376486 fix: key-error for COGS By Item Group report (backport #47914) (#47916)
fix: key-error for COGS By Item Group report (#47914)

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

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-06-05 17:18:22 +05:30
mergify[bot]
c9eeca22f5 fix: stock adjustment entry during reposting (backport #47878) (#47882)
fix: stock adjustment entry during reposting (#47878)

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

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-06-04 12:51:22 +05:30
Frappe PR Bot
b145638eca chore(release): Bumped to Version 14.86.0
# [14.86.0](https://github.com/frappe/erpnext/compare/v14.85.10...v14.86.0) (2025-06-03)

### Bug Fixes

* filter of item for manufacture type material request (backport [#47712](https://github.com/frappe/erpnext/issues/47712)) ([#47716](https://github.com/frappe/erpnext/issues/47716)) ([69463b4](69463b4798))
* incorrect actual qty in product bundle balance report (backport [#47791](https://github.com/frappe/erpnext/issues/47791)) ([#47813](https://github.com/frappe/erpnext/issues/47813)) ([df779bb](df779bb7dd))
* use `query.walk() `for escaping special chars in receiable/payable report ([ca48583](ca4858318e))

### Features

* add column "Item Name" to "BOM Stock Report" (backport [#47116](https://github.com/frappe/erpnext/issues/47116)) ([#47484](https://github.com/frappe/erpnext/issues/47484)) ([b664781](b664781fae))
2025-06-03 11:52:06 +00:00
ruthra kumar
b46fdc2645 Merge pull request #47867 from frappe/version-14-hotfix
chore: release v14
2025-06-03 17:20:36 +05:30
mergify[bot]
df779bb7dd fix: incorrect actual qty in product bundle balance report (backport #47791) (#47813)
fix: incorrect actual qty in product bundle balance report (#47791)

(cherry picked from commit c544c3e018)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-05-30 14:01:49 +05:30
ruthra kumar
20f701ff0b Merge pull request #47807 from frappe/mergify/bp/version-14-hotfix/pr-47794
fix: use `query.walk() `for escaping special chars in receiable/payable report (backport #47794)
2025-05-29 14:58:45 +05:30
ljain112
ca4858318e fix: use query.walk() for escaping special chars in receiable/payable report
(cherry picked from commit a0a51b5074)
2025-05-29 08:21:15 +00:00
mergify[bot]
b664781fae feat: add column "Item Name" to "BOM Stock Report" (backport #47116) (#47484)
Co-authored-by: Patrick Eißler <77415730+PatrickDEissler@users.noreply.github.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-05-27 19:21:20 +02:00
mergify[bot]
69463b4798 fix: filter of item for manufacture type material request (backport #47712) (#47716)
* fix: filter of item for manufacture type material request (#47712)

(cherry picked from commit 874750f9ce)

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

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-05-27 21:56:36 +05:30
Frappe PR Bot
caf0f2cd19 chore(release): Bumped to Version 14.85.10
## [14.85.10](https://github.com/frappe/erpnext/compare/v14.85.9...v14.85.10) (2025-05-27)

### Bug Fixes

* incorrect status in the serial no ([#47740](https://github.com/frappe/erpnext/issues/47740)) ([d37b12f](d37b12f385))
* incorrect valuation rate due to positive qty (backport [#47686](https://github.com/frappe/erpnext/issues/47686)) ([#47687](https://github.com/frappe/erpnext/issues/47687)) ([d5d4b3a](d5d4b3a7f3))
* only include advances within the tcs period ([43aeff3](43aeff38aa))
* patch to rename group_by filter in custom reports (backport [#47709](https://github.com/frappe/erpnext/issues/47709)) ([#47729](https://github.com/frappe/erpnext/issues/47729)) ([70bcfb4](70bcfb4748))
* rate changing while making PR (negative discount) (backport [#40539](https://github.com/frappe/erpnext/issues/40539)) ([#47735](https://github.com/frappe/erpnext/issues/47735)) ([70e6ea6](70e6ea6b3f))
* remove public access to list items (backport [#45838](https://github.com/frappe/erpnext/issues/45838)) ([5d9be73](5d9be7366b))
* skip last purchase rate for free item (backport [#47693](https://github.com/frappe/erpnext/issues/47693)) ([#47695](https://github.com/frappe/erpnext/issues/47695)) ([1f1cb33](1f1cb338fe))
* validation message format (backport [#47542](https://github.com/frappe/erpnext/issues/47542)) ([#47549](https://github.com/frappe/erpnext/issues/47549)) ([792f3af](792f3afa1b))
2025-05-27 11:46:57 +00:00
ruthra kumar
1cfb002de8 Merge pull request #47757 from frappe/version-14-hotfix
chore: release v14
2025-05-27 17:15:22 +05:30
ruthra kumar
3b686827e9 Merge pull request #47752 from frappe/mergify/bp/version-14-hotfix/pr-47736
fix: only include advances within the tcs period (backport #47736)
2025-05-27 14:10:45 +05:30
rohitwaghchaure
d37b12f385 fix: incorrect status in the serial no (#47740) 2025-05-27 13:23:40 +05:30
ljain112
43aeff38aa fix: only include advances within the tcs period
(cherry picked from commit 477ec9fdcc)
2025-05-27 07:49:16 +00:00
ruthra kumar
ad13dcd695 Merge pull request #47745 from frappe/mergify/bp/version-14-hotfix/pr-47549
fix: validation message format (backport #47542) (backport #47549)
2025-05-27 12:03:44 +05:30
mergify[bot]
792f3afa1b fix: validation message format (backport #47542) (#47549)
fix: validation message format (#47542)

(cherry picked from commit a18e1cffa7)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
(cherry picked from commit f225e1986e)
2025-05-27 06:04:55 +00:00
ruthra kumar
43dda4a5d2 Merge pull request #47741 from frappe/mergify/bp/version-14-hotfix/pr-47697
refactor: Fetch party name for contract (backport #47697)
2025-05-26 19:56:16 +05:30
ruthra kumar
274ce10329 chore: resolve conflicts 2025-05-26 17:46:42 +05:30
ruthra kumar
caf145e3ca refactor: patch old contract with full party name
(cherry picked from commit 8e2221178b)

# Conflicts:
#	erpnext/patches.txt
2025-05-26 12:11:25 +00:00
ruthra kumar
05911ad563 refactor: fetch party name on selection
(cherry picked from commit 752024e222)
2025-05-26 12:11:24 +00:00
ruthra kumar
de937a6bad refactor: full name field in contract
(cherry picked from commit 016924361a)

# Conflicts:
#	erpnext/crm/doctype/contract/contract.json
#	erpnext/crm/doctype/contract/contract.py
2025-05-26 12:11:24 +00:00
mergify[bot]
70e6ea6b3f fix: rate changing while making PR (negative discount) (backport #40539) (#47735)
fix: rate changing while making PR (negative discount) (#40539)

(cherry picked from commit 8136954484)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-05-26 16:02:06 +05:30
mergify[bot]
70bcfb4748 fix: patch to rename group_by filter in custom reports (backport #47709) (#47729)
* fix: patch to rename group_by filter in custom reports

(cherry picked from commit 0d19c18c06)

# Conflicts:
#	erpnext/patches.txt
#	erpnext/patches/v14_0/rename_group_by_to_categorize_by_in_custom_reports.py

* fix: using python instead of sql query

(cherry picked from commit 48eccb1f73)

* chore: resolve conflict

---------

Co-authored-by: diptanilsaha <diptanil@frappe.io>
2025-05-26 13:29:28 +05:30
mergify[bot]
1f1cb338fe fix: skip last purchase rate for free item (backport #47693) (#47695)
fix: skip last purchase rate for free item (#47693)

(cherry picked from commit c3b17024bd)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-05-24 17:17:09 +05:30
mergify[bot]
d5d4b3a7f3 fix: incorrect valuation rate due to positive qty (backport #47686) (#47687)
fix: incorrect valuation rate due to positive qty (#47686)

(cherry picked from commit 6ed97b5fda)

Co-authored-by: Khushi Rawat <142375893+khushi8112@users.noreply.github.com>
2025-05-22 16:17:42 +05:30
mergify[bot]
5d9be7366b fix: remove public access to list items (backport #45838)
* fix: remove public access to list items

(cherry picked from commit 2bd596ee3d)

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

* fix: resolve conflict

---------

Co-authored-by: CaseSolved <richard@casesolved.co.uk>
Co-authored-by: Sagar Vora <16315650+sagarvora@users.noreply.github.com>
2025-05-21 23:12:40 +05:30
Frappe PR Bot
79a4b597d4 chore(release): Bumped to Version 14.85.9
## [14.85.9](https://github.com/frappe/erpnext/compare/v14.85.8...v14.85.9) (2025-05-20)

### Bug Fixes

* asset image field updation issue (backport [#47615](https://github.com/frappe/erpnext/issues/47615)) ([d88feec](d88feecf46))
* better validation message with solution for BOM recursion (backport [#47472](https://github.com/frappe/erpnext/issues/47472)) ([#47476](https://github.com/frappe/erpnext/issues/47476)) ([537c917](537c917bfc))
* include only invoices with update_stock = 0  for billed amt in delivery note. ([54197ff](54197ff760))
* remove hardcoded doctype in `make_return_doc` ([9ce86b1](9ce86b135b))
2025-05-20 13:53:32 +00:00
ruthra kumar
0b0944cc06 Merge pull request #47635 from frappe/version-14-hotfix
chore: release v14
2025-05-20 19:22:04 +05:30
mergify[bot]
537c917bfc fix: better validation message with solution for BOM recursion (backport #47472) (#47476)
fix: better validation message with solution for BOM recursion

(cherry picked from commit 7103cdd84a)

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
2025-05-20 16:15:40 +05:30
ruthra kumar
13f393c59a Merge pull request #47624 from frappe/mergify/bp/version-14-hotfix/pr-47559
fix: include only invoices with update_stock = 0  for billed amt in delivery note. (backport #47559)
2025-05-20 11:24:52 +05:30
ljain112
54197ff760 fix: include only invoices with update_stock = 0 for billed amt in delivery note.
(cherry picked from commit 6dc459db58)
2025-05-20 05:31:56 +00:00
ruthra kumar
6f1109226d Merge pull request #47621 from frappe/mergify/bp/version-14-hotfix/pr-47614
fix: remove hardcoded doctype in `make_return_doc` (backport #47614)
2025-05-20 10:37:00 +05:30
barredterra
9ce86b135b fix: remove hardcoded doctype in make_return_doc
(cherry picked from commit 45a5c19dd4)

# Conflicts:
#	erpnext/controllers/sales_and_purchase_return.py
2025-05-20 10:11:21 +05:30
mergify[bot]
d88feecf46 fix: asset image field updation issue (backport #47615) 2025-05-20 10:08:26 +05:30
Frappe PR Bot
271d0a301f chore(release): Bumped to Version 14.85.8
## [14.85.8](https://github.com/frappe/erpnext/compare/v14.85.7...v14.85.8) (2025-05-13)

### Bug Fixes

* broken test suite due to incorrect OR filter ([949ed59](949ed59f84))
* ignore "Account Closing Balance" doctype on Period Closing Voucher cancellation ([a04feff](a04feff264))
* typo in event.js ([2389fd5](2389fd5145))
* warning message for COGS account in the stock entry ([1bbbd26](1bbbd261cb))
2025-05-13 14:02:11 +00:00
ruthra kumar
9d36166616 Merge pull request #47529 from frappe/version-14-hotfix
chore: release v14
2025-05-13 19:30:41 +05:30
ruthra kumar
00407cd0ee Merge pull request #47526 from frappe/mergify/bp/version-14-hotfix/pr-47520
fix: ignore "Account Closing Balance" doctype on Period Closing Voucher cancellation (backport #47520)
2025-05-13 15:22:32 +05:30
ljain112
a04feff264 fix: ignore "Account Closing Balance" doctype on Period Closing Voucher cancellation
(cherry picked from commit d6602d63fc)

# Conflicts:
#	erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py
2025-05-13 15:00:36 +05:30
ruthra kumar
d6f5ac90b1 Merge pull request #47516 from frappe/mergify/bp/version-14-hotfix/pr-47367
fix: Use `Currency` instead of `Float` in GL report to show details (backport #47367)
2025-05-13 13:08:20 +05:30
Abdeali Chharchhodawala
c6c1b00559 Merge pull request #47367 from Abdeali099/gl-report-field-float-to-currency
fix: Use `Currency` instead of `Float` in GL report to show details
(cherry picked from commit e4e0bb68ec)
2025-05-13 12:49:52 +05:30
ruthra kumar
b86dc294f1 Merge pull request #47518 from frappe/mergify/bp/version-14-hotfix/pr-47380
fix: broken CI - uae vat 201 tests failing (backport #47380)
2025-05-13 12:45:41 +05:30
ruthra kumar
949ed59f84 fix: broken test suite due to incorrect OR filter
(cherry picked from commit 37d74e387d)
2025-05-13 06:39:22 +00:00
ruthra kumar
558225b027 Merge pull request #47466 from frappe/mergify/bp/version-14-hotfix/pr-47462
Update event.js (backport #47462)
2025-05-08 14:12:55 +05:30
Yaiphalemba Mangshatabam
2389fd5145 fix: typo in event.js
"Sales Partners" -> "Sales Partner"

(cherry picked from commit edee75c757)
2025-05-08 08:40:37 +00:00
rohitwaghchaure
d66a34411c Merge pull request #47453 from frappe/mergify/bp/version-14-hotfix/pr-47452
fix: warning message for COGS account in the stock entry (backport #47452)
2025-05-08 13:58:23 +05:30
Rohit Waghchaure
1bbbd261cb fix: warning message for COGS account in the stock entry
(cherry picked from commit bba6b0ff45)
2025-05-07 10:50:18 +00:00
Frappe PR Bot
182b9892fc chore(release): Bumped to Version 14.85.7
## [14.85.7](https://github.com/frappe/erpnext/compare/v14.85.6...v14.85.7) (2025-05-06)

### Bug Fixes

* backward compatibility for renamed group_by filter on reports (backport [#47362](https://github.com/frappe/erpnext/issues/47362)) ([#47402](https://github.com/frappe/erpnext/issues/47402)) ([378821d](378821d9e6))
* change shipping address fetching condition ([8e0bd97](8e0bd976c3))
* completed transactions showing in the list (backport [#47374](https://github.com/frappe/erpnext/issues/47374)) ([#47378](https://github.com/frappe/erpnext/issues/47378)) ([b507e63](b507e63375))
* do not allocate amount when ref's doctype or name are not set ([f278120](f278120aa0))
* rename unchanged group_by filter related to general ledger report (backport [#47366](https://github.com/frappe/erpnext/issues/47366)) ([#47404](https://github.com/frappe/erpnext/issues/47404)) ([d41fec7](d41fec7d2b))
* renaming group by fieldname and value in reports (backport [#47352](https://github.com/frappe/erpnext/issues/47352)) ([#47359](https://github.com/frappe/erpnext/issues/47359)) ([27a8856](27a8856dca))
* show party type in due date exceeding message ([4376fbc](4376fbc3ed))
* validation for difference account ([150cc5a](150cc5a664))
* warning message before changing the valuation method (backport [#47340](https://github.com/frappe/erpnext/issues/47340)) ([#47341](https://github.com/frappe/erpnext/issues/47341)) ([b13e0a6](b13e0a6b9f))
2025-05-06 14:13:22 +00:00
ruthra kumar
015525599f Merge pull request #47430 from frappe/version-14-hotfix
chore: release v14
2025-05-06 19:41:49 +05:30
mergify[bot]
3993525bf6 feat!: configure which rate is used to auto-update price list (backport #47417) (#47433)
* feat!: configure which rate is used to auto-update price list

(cherry picked from commit 3ebde4526a)

# Conflicts:
#	erpnext/selling/doctype/sales_order/test_sales_order.py
#	erpnext/setup/setup_wizard/operations/defaults_setup.py
#	erpnext/setup/setup_wizard/operations/install_fixtures.py
#	erpnext/stock/doctype/stock_settings/stock_settings.json
#	erpnext/stock/doctype/stock_settings/stock_settings.py
#	erpnext/stock/get_item_details.py

* fix: merge conflicts

---------

Co-authored-by: Sagar Vora <16315650+sagarvora@users.noreply.github.com>
2025-05-06 18:43:27 +05:30
ruthra kumar
8343c92ac5 Merge pull request #47425 from frappe/mergify/bp/version-14-hotfix/pr-47337
fix: do not allocate amount when ref's doctype or name are not set (backport #47337)
2025-05-06 15:01:05 +05:30
Abdeali Chharchhoda
f278120aa0 fix: do not allocate amount when ref's doctype or name are not set
(cherry picked from commit b9a02b466b)
2025-05-06 09:04:52 +00:00
ruthra kumar
862e6330ac Merge pull request #47415 from frappe/mergify/bp/version-14-hotfix/pr-47408
fix: show party type in due date exceeding message (backport #47408)
2025-05-06 14:32:58 +05:30
ruthra kumar
bd395e2406 chore: resolve conflicts and pass all parameters 2025-05-06 14:12:44 +05:30
Abdeali Chharchhoda
4376fbc3ed fix: show party type in due date exceeding message
(cherry picked from commit b6d9134014)

# Conflicts:
#	erpnext/accounts/party.py
2025-05-06 06:28:47 +00:00
ruthra kumar
c49ee563fd Merge pull request #47413 from frappe/mergify/bp/version-14-hotfix/pr-47358
fix: change shipping address fetching condition (backport #47358)
2025-05-06 11:29:16 +05:30
Vimal
8e0bd976c3 fix: change shipping address fetching condition
(cherry picked from commit 0b4add2f2b)
2025-05-06 05:28:40 +00:00
rohitwaghchaure
d66e8e8597 Merge pull request #47389 from frappe/mergify/bp/version-14-hotfix/pr-47376
fix: validation for difference account (backport #47376)
2025-05-05 18:39:04 +05:30
mergify[bot]
d41fec7d2b fix: rename unchanged group_by filter related to general ledger report (backport #47366) (#47404)
* fix: rename unchanged group_by filter related to general ledger report (#47366)

(cherry picked from commit 3de249dcba)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.js
#	erpnext/accounts/test/test_reports.py
#	erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt.js

* chore: resolve conflict

* chore: resolve conflict

* chore: resolve conflict

---------

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

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

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

(cherry picked from commit d4ffa54136)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-05-05 18:01:06 +05:30
ruthra kumar
698e260526 Merge pull request #47146 from frappe/mergify/copy/version-14-hotfix/pr-47145
refactor: make AR / AP report more memory efficient (copy #47145)
2025-05-05 15:43:33 +05:30
ruthra kumar
fc793f0f25 refactor: set default for fetch methods 2025-05-05 15:04:48 +05:30
ruthra kumar
204d1d6a53 refactor: use fetch method based on configuration 2025-05-05 15:04:48 +05:30
ruthra kumar
aee917b790 refactor: configurable fetch method for AR / AP report 2025-05-05 15:04:45 +05:30
ruthra kumar
892d3980d3 refactor: use unbuffered cursor for fetching 2025-05-05 14:59:24 +05:30
rohitwaghchaure
e743d5f66b chore: fix linters issue 2025-05-05 14:19:20 +05:30
rohitwaghchaure
9adb863787 chore: fix linters issue 2025-05-05 14:12:07 +05:30
Rohit Waghchaure
150cc5a664 fix: validation for difference account
(cherry picked from commit fb819c558e)
2025-05-03 07:52:53 +00:00
mergify[bot]
b507e63375 fix: completed transactions showing in the list (backport #47374) (#47378)
* fix: completed transactions showing in the list (#47374)

(cherry picked from commit 97db9da10e)

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

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-05-02 15:29:10 +05:30
mergify[bot]
27a8856dca fix: renaming group by fieldname and value in reports (backport #47352) (#47359)
* fix: renaming group by fieldname and value in reports (#47352)

* fix: renaming in general ledger report

* fix: renaming in supplier quotation comparison report

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

* fix: added patch

* fix: patch update to all documents

* chore: added patches to patch.txt

* chore: removing patch from v14

(cherry picked from commit 13a84e7f82)

# Conflicts:
#	erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.json
#	erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.py
#	erpnext/accounts/report/general_ledger/general_ledger.py
#	erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.py
#	erpnext/patches.txt
#	erpnext/patches/v14_0/rename_group_by_to_categorize_by.py

* chore: resolve conflict

* chore: resolve conflict

* chore: resolve conflict

* chore: resolve conflict

* chore: resolve conflict

* chore: resolve conflict

* chore: fixed path for patch file

---------

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-04-30 18:22:59 +05:30
mergify[bot]
b13e0a6b9f fix: warning message before changing the valuation method (backport #47340) (#47341)
fix: warning message before changing the valuation method (#47340)

(cherry picked from commit ffdc4347e8)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-04-30 12:54:15 +05:30
Frappe PR Bot
04bb4f8415 chore(release): Bumped to Version 14.85.6
## [14.85.6](https://github.com/frappe/erpnext/compare/v14.85.5...v14.85.6) (2025-04-29)

### Bug Fixes

* allow to change valuation method from FIFO to Moving Average ([7130e5c](7130e5ccfb))
* calculate useful days of asset's life correctly for existing asset ([#47066](https://github.com/frappe/erpnext/issues/47066)) ([0bc3bc4](0bc3bc4851))
* item code not showing in the error message ([48748e7](48748e7142))
* remove invalid email account creation (backport [#47318](https://github.com/frappe/erpnext/issues/47318)) ([#47322](https://github.com/frappe/erpnext/issues/47322)) ([0c5c344](0c5c34409e))
2025-04-29 13:08:31 +00:00
ruthra kumar
6735ba0ab6 Merge pull request #47327 from frappe/version-14-hotfix
chore: release v14
2025-04-29 18:36:51 +05:30
mergify[bot]
0c5c34409e fix: remove invalid email account creation (backport #47318) (#47322)
fix: remove invalid email account creation (#47318)

(cherry picked from commit 7423e4187f)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-04-29 12:40:25 +05:30
rohitwaghchaure
9dbc1cc5fb Merge pull request #47287 from frappe/mergify/bp/version-14-hotfix/pr-47268
fix: allow to change valuation method from FIFO to Moving Average (backport #47268)
2025-04-28 15:28:53 +05:30
Rohit Waghchaure
7130e5ccfb fix: allow to change valuation method from FIFO to Moving Average
(cherry picked from commit b454ed4b8f)
2025-04-28 09:06:30 +00:00
rohitwaghchaure
0e42516977 Merge pull request #47258 from rohitwaghchaure/fixed-support-46933
fix: item code not showing in the error message
2025-04-25 14:38:38 +05:30
Rohit Waghchaure
48748e7142 fix: item code not showing in the error message 2025-04-25 14:08:38 +05:30
Khushi Rawat
0bc3bc4851 fix: calculate useful days of asset's life correctly for existing asset (#47066)
* fix: calculate useful days of asset's life correctly for existing asset

* fix: test

* fix: test case correction
2025-04-23 12:30:59 +05:30
Frappe PR Bot
d791108649 chore(release): Bumped to Version 14.85.5
## [14.85.5](https://github.com/frappe/erpnext/compare/v14.85.4...v14.85.5) (2025-04-22)

### Bug Fixes

* create default warehouse ([#47125](https://github.com/frappe/erpnext/issues/47125)) ([a766aa0](a766aa0837))
* rate based on posting date in Tax Withholding Report ([17dc87a](17dc87a2df))
* respect mapped accounting dimensions ([e4c2442](e4c2442ba2))
2025-04-22 13:45:53 +00:00
ruthra kumar
0d84059fde Merge pull request #47205 from frappe/version-14-hotfix
chore: release v14
2025-04-22 19:14:23 +05:30
ruthra kumar
6868da5f6a Merge pull request #47198 from frappe/mergify/bp/version-14-hotfix/pr-47138
fix: rate based on posting date in Tax Withholding Report (backport #47138)
2025-04-22 14:07:19 +05:30
ljain112
f906568fea chore: added test case for date period in multiple tax withholding rules
(cherry picked from commit 515fe340a8)

# Conflicts:
#	erpnext/accounts/report/tds_payable_monthly/test_tds_payable_monthly.py
2025-04-22 13:33:16 +05:30
ljain112
17dc87a2df fix: rate based on posting date in Tax Withholding Report
(cherry picked from commit a32a79e90a)
2025-04-22 07:59:50 +00:00
Sagar Vora
522597d22b Merge pull request #47156 from frappe/mergify/bp/version-14-hotfix/pr-47154
fix: respect mapped accounting dimensions (backport #47154)
2025-04-19 13:03:56 +05:30
Sagar Vora
e4c2442ba2 fix: respect mapped accounting dimensions
(cherry picked from commit 7dbe27da19)
2025-04-19 07:22:23 +00:00
mergify[bot]
0d9bc4424c chore: migrate pre-commit config (backport #47132) (#47133)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-04-17 14:22:23 +02:00
Raffael Meyer
35c9375f0d Merge pull request #47130 from frappe/mergify/bp/version-14-hotfix/pr-47125
fix: create default warehouse (backport #47125)
2025-04-17 13:56:56 +02:00
barredterra
f04c73b9c2 ci: update linters
copy config from version-15
2025-04-17 13:38:19 +02:00
Raffael Meyer
a766aa0837 fix: create default warehouse (#47125) 2025-04-17 13:38:10 +02:00
Frappe PR Bot
3248415667 chore(release): Bumped to Version 14.85.4
## [14.85.4](https://github.com/frappe/erpnext/compare/v14.85.3...v14.85.4) (2025-04-16)

### Bug Fixes

* correct doctype in item_wise_purchase register ([6ec33c0](6ec33c0098))
* go for lower case "on" because we already have translations for that ([056cc35](056cc35379))
* make report's "printed on" translatable ([f1a8643](f1a864349e))
* **Payment Entry:** set account type if missing (backport [#47069](https://github.com/frappe/erpnext/issues/47069)) (backport [#47070](https://github.com/frappe/erpnext/issues/47070)) ([#47072](https://github.com/frappe/erpnext/issues/47072)) ([b88f6c1](b88f6c1252))
* remove redundant letter head ([033fa09](033fa09eb4))
* revert [#46900](https://github.com/frappe/erpnext/issues/46900) - against_voucher filter in general ledger ([5844aaf](5844aafd12))
* serial no validation for stock reconciliation ([a3d4d34](a3d4d34454))
* stock entry repack amount calculation ([253a067](253a067592))
* update the modified date in for SLEs and GLs after rename ([8801584](8801584c8d))

### Performance Improvements

* stock ageing report generation ([7a74dac](7a74dac2c2))
2025-04-16 04:02:43 +00:00
ruthra kumar
4fb12754ce Merge pull request #47090 from frappe/version-14-hotfix
chore: release v14
2025-04-16 09:31:20 +05:30
ruthra kumar
503b89a764 Merge pull request #46952 from frappe/mergify/bp/version-14-hotfix/pr-46949
fix: improve translatability of query report print formats (backport #46913) (backport #46949)
2025-04-15 15:59:10 +05:30
mergify[bot]
b88f6c1252 fix(Payment Entry): set account type if missing (backport #47069) (backport #47070) (#47072)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
fix(Payment Entry): set account type if missing (backport #47069) (#47070)
fix(Payment Entry): set account type if missing (#47069)
2025-04-14 19:19:50 +02:00
rohitwaghchaure
e5156e6666 Merge pull request #47068 from frappe/mergify/bp/version-14-hotfix/pr-46997
fix: update the modified date in for SLEs and GLs after rename (backport #46997)
2025-04-14 21:06:08 +05:30
Rohit Waghchaure
8801584c8d fix: update the modified date in for SLEs and GLs after rename
(cherry picked from commit dc5a5ef258)
2025-04-14 15:02:22 +00:00
rohitwaghchaure
55ac96ff09 Merge pull request #47062 from frappe/mergify/bp/version-14-hotfix/pr-46853
fix: stock entry repack amount calculation (backport #46853)
2025-04-14 20:30:38 +05:30
rohitwaghchaure
3f3fb323cf chore: fix conflicts 2025-04-14 18:02:24 +05:30
Rohit Waghchaure
253a067592 fix: stock entry repack amount calculation
(cherry picked from commit 544ceb93cd)

# Conflicts:
#	erpnext/stock/stock_ledger.py
2025-04-14 12:30:21 +00:00
Frappe PR Bot
d8f301f1db chore(release): Bumped to Version 14.85.3
## [14.85.3](https://github.com/frappe/erpnext/compare/v14.85.2...v14.85.3) (2025-04-14)

### Bug Fixes

* revert [#46900](https://github.com/frappe/erpnext/issues/46900) - against_voucher filter in general ledger ([27ecd3a](27ecd3a21b))
2025-04-14 08:24:00 +00:00
ruthra kumar
6d65c967da Merge pull request #47056 from frappe/mergify/bp/version-14/pr-47049
Revert "fix: remove against_voucher and against_voucher_type column from General Ledger Report" (backport #47049)
2025-04-14 13:52:35 +05:30
ruthra kumar
4ac5c7e5e7 Merge pull request #47054 from frappe/mergify/bp/version-14-hotfix/pr-47049
Revert "fix: remove against_voucher and against_voucher_type column from General Ledger Report" (backport #47049)
2025-04-14 13:51:45 +05:30
ruthra kumar
911014a54e chore: resolve conflict 2025-04-14 13:27:13 +05:30
ruthra kumar
694f158fc8 chore: resolve conflict 2025-04-14 13:25:36 +05:30
ruthra kumar
27ecd3a21b fix: revert #46900 - against_voucher filter in general ledger
(cherry picked from commit adb331ef71)

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

# Conflicts:
#	erpnext/accounts/report/general_ledger/general_ledger.py
2025-04-14 07:49:35 +00:00
Frappe PR Bot
e684807bc7 chore(release): Bumped to Version 14.85.2
## [14.85.2](https://github.com/frappe/erpnext/compare/v14.85.1...v14.85.2) (2025-04-12)

### Bug Fixes

* correct doctype in item_wise_purchase register ([0e1045e](0e1045e855))
2025-04-12 02:03:19 +00:00
ruthra kumar
3af506e0a9 Merge pull request #47030 from frappe/mergify/bp/version-14/pr-47012
fix: correct doctype in item_wise_purchase register (backport #47012)
2025-04-12 07:31:49 +05:30
ruthra kumar
98ffbfb432 Merge pull request #47032 from frappe/mergify/bp/version-14-hotfix/pr-47012
fix: correct doctype in item_wise_purchase register (backport #47012)
2025-04-12 07:29:28 +05:30
ljain112
6ec33c0098 fix: correct doctype in item_wise_purchase register
(cherry picked from commit b8b8dce733)
2025-04-12 01:41:16 +00:00
ljain112
0e1045e855 fix: correct doctype in item_wise_purchase register
(cherry picked from commit b8b8dce733)
2025-04-12 01:41:12 +00:00
Frappe PR Bot
34d3f58149 chore(release): Bumped to Version 14.85.1
## [14.85.1](https://github.com/frappe/erpnext/compare/v14.85.0...v14.85.1) (2025-04-10)

### Bug Fixes

* serial no validation for stock reconciliation ([c388b75](c388b7579c))

### Performance Improvements

* stock ageing report generation ([eaa2974](eaa297475f))
2025-04-10 06:02:52 +00:00
rohitwaghchaure
efd34817be Merge pull request #46986 from frappe/mergify/bp/version-14/pr-46971
fix: serial no validation for stock reconciliation (backport #46971)
2025-04-10 11:31:22 +05:30
rohitwaghchaure
124ad729ab Merge pull request #46984 from frappe/mergify/bp/version-14/pr-46983
perf: stock ageing report generation (backport #46983)
2025-04-10 11:31:13 +05:30
Rohit Waghchaure
c388b7579c fix: serial no validation for stock reconciliation
(cherry picked from commit a3d4d34454)
2025-04-10 05:36:45 +00:00
rohitwaghchaure
a2595350f6 Merge pull request #46971 from rohitwaghchaure/fixed-support-35746
fix: serial no validation for stock reconciliation
2025-04-10 11:05:45 +05:30
Rohit Waghchaure
eaa297475f perf: stock ageing report generation
(cherry picked from commit 7a74dac2c2)
2025-04-10 05:34:42 +00:00
rohitwaghchaure
ac7700dff0 Merge pull request #46983 from rohitwaghchaure/fixed-stock-ageing-report
perf: stock ageing report generation
2025-04-10 11:03:40 +05:30
Rohit Waghchaure
7a74dac2c2 perf: stock ageing report generation 2025-04-10 10:10:09 +05:30
Rohit Waghchaure
a3d4d34454 fix: serial no validation for stock reconciliation 2025-04-09 17:14:40 +05:30
barredterra
443ed5b2ce chore: add missing german translation
(cherry picked from commit d94ebd0c78)
2025-04-08 14:12:41 +00:00
barredterra
033fa09eb4 fix: remove redundant letter head
(cherry picked from commit 7896f8a855)
2025-04-08 14:12:41 +00:00
barredterra
056cc35379 fix: go for lower case "on" because we already have translations for that
(cherry picked from commit 7cf83ffce7)
2025-04-08 14:12:40 +00:00
barredterra
f1a864349e fix: make report's "printed on" translatable
(cherry picked from commit 18e9a9881c)
2025-04-08 14:12:40 +00:00
Frappe PR Bot
24681bd64f chore(release): Bumped to Version 14.85.0
# [14.85.0](https://github.com/frappe/erpnext/compare/v14.84.0...v14.85.0) (2025-04-08)

### Bug Fixes

* **accounting:** update outstanding amount based on update_outstanding_for_self ([8e2bfc6](8e2bfc6bcb))
* don't filter payment entries on Bank Account in Payment Clearance ([576ce7e](576ce7e882))
* empty party filter on change of party type in General Ledger Report. ([14b4d14](14b4d147a8))
* improved rounding adjustment when applying discount (backport [#46720](https://github.com/frappe/erpnext/issues/46720)) ([06c3299](06c32993ea))
* incorrect condition ([d1f9444](d1f9444be7))
* make message translatable (backport [#46863](https://github.com/frappe/erpnext/issues/46863)) ([#46865](https://github.com/frappe/erpnext/issues/46865)) ([70d117e](70d117e858))
* **payment term:** allocate payment amount when payment term is fetched from order ([36b951d](36b951d018))
* remove against_voucher from General Ledger Report ([9e3a041](9e3a04136c))
* removed customer_group query in customer.js ([3be0f00](3be0f00b3b))
* Translate UnReconcile dialog title (backport [#46818](https://github.com/frappe/erpnext/issues/46818)) ([#46862](https://github.com/frappe/erpnext/issues/46862)) ([5f467be](5f467be0c8))
* update outstanding with precision ([698d5be](698d5be840))
* update payment amount if automatically_fetch_payment_terms is enabled ([dda35b8](dda35b8e51))
* update posting date before running validations ([430d1e8](430d1e8b2e))
* use `grand_total_diff` instead of `rounding_adjustment` in `taxes_and_totals` (backport [#46829](https://github.com/frappe/erpnext/issues/46829)) ([233e0d8](233e0d8049))
* user permissions in sales and purchase report ([f26b22e](f26b22ee7f))

### Features

* asset filter in asset depreciation and balances report ([#46848](https://github.com/frappe/erpnext/issues/46848)) ([2fe9fa7](2fe9fa7ef7))
2025-04-08 13:05:14 +00:00
ruthra kumar
b0c742b64e Merge pull request #46941 from frappe/version-14-hotfix
chore: release v14
2025-04-08 18:33:42 +05:30
mergify[bot]
18282b2632 chore: fix german translations (backport #46912) (#46914)
* chore: fix german translations (#46912)

(cherry picked from commit 8276e8e8b3)

# Conflicts:
#	erpnext/translations/de.csv

* chore: resolve conflicts

* chore: delete duplicate translations

---------

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-04-08 13:16:35 +02:00
ruthra kumar
46115d6f71 Merge pull request #46937 from frappe/mergify/bp/version-14-hotfix/pr-46631
fix: update outstanding for self (backport #46631)
2025-04-08 16:21:45 +05:30
ruthra kumar
f62905f7a7 chore: pass individual range 2025-04-08 15:53:30 +05:30
ruthra kumar
88facb7523 refactor: pass both doctype and name 2025-04-08 15:13:59 +05:30
ruthra kumar
512877ab46 chore: resolve conflicts 2025-04-08 14:34:59 +05:30
Bhavan23
c7e6b2356f test: add unit test to validate outstanding amount for update_outstanding_for_self checkbox enabled
(cherry picked from commit 7b0882600a)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
2025-04-08 08:59:05 +00:00
Bhavan23
8e2bfc6bcb fix(accounting): update outstanding amount based on update_outstanding_for_self
fix(accounting): against voucher has been already paid show proper message and update update_outstanding_for_self as 1

(cherry picked from commit 222f1834f1)

# Conflicts:
#	erpnext/controllers/accounts_controller.py
2025-04-08 08:59:04 +00:00
ruthra kumar
98260b990c Merge pull request #46931 from frappe/mergify/bp/version-14-hotfix/pr-46821
fix: removed customer_group query in customer.js (backport #46821)
2025-04-08 13:10:04 +05:30
ljain112
3be0f00b3b fix: removed customer_group query in customer.js
(cherry picked from commit f49adfdd98)
2025-04-08 07:28:33 +00:00
ruthra kumar
f44478db78 Merge pull request #46924 from frappe/mergify/bp/version-14-hotfix/pr-46709
fix: user permissions in sales and purchase report (backport #46709)
2025-04-08 11:53:08 +05:30
ruthra kumar
db8cb70bd8 chore: resolve conflict 2025-04-08 11:13:44 +05:30
ljain112
f26b22ee7f fix: user permissions in sales and purchase report
(cherry picked from commit f4bc1dfd00)

# Conflicts:
#	erpnext/accounts/report/purchase_register/purchase_register.py
2025-04-08 05:40:47 +00:00
ruthra kumar
1e4807f16d Merge pull request #46920 from frappe/mergify/bp/version-14-hotfix/pr-46804
fix: update outstanding with precision (backport #46804)
2025-04-08 11:07:45 +05:30
ljain112
698d5be840 fix: update outstanding with precision
(cherry picked from commit aadda9f606)
2025-04-08 04:29:31 +00:00
ruthra kumar
59e46e22d3 Merge pull request #46904 from frappe/mergify/bp/version-14-hotfix/pr-46895
fix: empty party filter on change of party type in General Ledger Report (backport #46895)
2025-04-07 17:55:56 +05:30
ljain112
14b4d147a8 fix: empty party filter on change of party type in General Ledger Report.
(cherry picked from commit 9c68bc22fa)
2025-04-07 12:12:55 +00:00
ruthra kumar
2bed1c8336 Merge pull request #46901 from frappe/mergify/bp/version-14-hotfix/pr-46900
fix: remove against_voucher and against_voucher_type column from General Ledger Report (backport #46900)
2025-04-07 17:38:42 +05:30
ljain112
9e3a04136c fix: remove against_voucher from General Ledger Report
(cherry picked from commit 6d1f119a0f)
2025-04-07 17:14:49 +05:30
ruthra kumar
dcc53cea55 Merge pull request #46896 from frappe/mergify/bp/version-14-hotfix/pr-46728
fix: update posting date before running validations (backport #46728)
2025-04-07 14:54:37 +05:30
Dany Robert
430d1e8b2e fix: update posting date before running validations
(cherry picked from commit d04dbd8ed9)
2025-04-07 09:01:56 +00:00
ruthra kumar
36a366d962 Merge pull request #46890 from frappe/mergify/bp/version-14-hotfix/pr-46637
fix(payment term): allocate payment amount when payment term is fetched from order (backport #46637)
2025-04-07 11:25:58 +05:30
venkat102
dda35b8e51 fix: update payment amount if automatically_fetch_payment_terms is enabled
(cherry picked from commit 7bf1a39861)
2025-04-07 05:34:19 +00:00
venkat102
4e0d7d88ec test: validate payment schedule based on invoice amount
(cherry picked from commit 7785296573)
2025-04-07 05:34:19 +00:00
venkat102
36b951d018 fix(payment term): allocate payment amount when payment term is fetched from order
(cherry picked from commit 5618859bd8)
2025-04-07 05:34:18 +00:00
mergify[bot]
233e0d8049 fix: use grand_total_diff instead of rounding_adjustment in taxes_and_totals (backport #46829)
* fix: use `grand_total_diff` instead of `rounding_adjustment` in `taxes_and_totals`

(cherry picked from commit fd252da6b1)

* test: ensure correct grand total

---------

Co-authored-by: vishakhdesai <vishakhdesai@gmail.com>
Co-authored-by: Sagar Vora <sagar@resilient.tech>
2025-04-06 09:11:06 +05:30
mergify[bot]
5f467be0c8 fix: Translate UnReconcile dialog title (backport #46818) (#46862)
fix: Translate UnReconcile dialog title

(cherry picked from commit f2cfb03c2c)

Co-authored-by: Corentin Forler <corentin@dokos.io>
2025-04-05 17:37:16 +02:00
mergify[bot]
70d117e858 fix: make message translatable (backport #46863) (#46865)
fix: make message translatable (#46863)

(cherry picked from commit 7d12e9afd4)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-04-05 17:36:16 +02:00
Khushi Rawat
2fe9fa7ef7 feat: asset filter in asset depreciation and balances report (#46848) 2025-04-04 10:39:16 +05:30
Sagar Vora
b4ca51ad4c Merge pull request #46813 from frappe/mergify/bp/version-14-hotfix/pr-46812
fix: revert resetting `rounding_adjustment` (backport #46812)
2025-03-31 15:56:27 +05:30
Vishakh Desai
fb5777cf10 Merge pull request #46812 from vishakhdesai/fix-taxes-and-totals
fix: revert resetting `rounding_adjustment`
(cherry picked from commit 3a9dca0563)
2025-03-31 10:25:00 +00:00
mergify[bot]
06c32993ea fix: improved rounding adjustment when applying discount (backport #46720)
* fix: improved rounding adjustment when applying discount (#46720)

* fix: rounding adjustment in apply_discount_amount taxes_and_totals

* refactor: minor changes

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

* fix: failing test case

* fix: made changes in get_total_for_discount_amount in taxes_and_totals

* fix: failing test cases

* fix: changes as per review

* refactor: remove unnecessary use of flt

* refactor: improve logic

* refactor: minor change

* refactor: minor changes

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

* fix: failing test case

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

---------

Co-authored-by: Vishakh Desai <78500008+vishakhdesai@users.noreply.github.com>
Co-authored-by: Sagar Vora <sagar@resilient.tech>
2025-03-31 15:54:09 +05:30
rohitwaghchaure
466c6ee3d4 Merge pull request #46780 from frappe/mergify/bp/version-14-hotfix/pr-46777
fix: incorrect condition (backport #46777)
2025-03-29 12:17:59 +05:30
rohitwaghchaure
a8831351e3 chore: fix conflicts 2025-03-29 12:16:17 +05:30
Rohit Waghchaure
d1f9444be7 fix: incorrect condition
(cherry picked from commit 0c1a8e9c58)

# Conflicts:
#	erpnext/public/js/controllers/transaction.js
2025-03-28 18:19:41 +00:00
rohitwaghchaure
ceaea16d84 Merge pull request #46751 from frappe/mergify/bp/version-14/pr-46748
Revert "perf: timeout while renaming cost center (backport #46641)" (backport #46748)
2025-03-27 13:13:59 +05:30
rohitwaghchaure
119f2e7074 Revert "perf: timeout while renaming cost center (backport #46641)"
(cherry picked from commit da6affbba7)
2025-03-27 06:53:19 +00:00
rohitwaghchaure
9cadb89678 Merge pull request #46748 from frappe/revert-46646-mergify/bp/version-14-hotfix/pr-46641
Revert "perf: timeout while renaming cost center (backport #46641)"
2025-03-27 12:16:56 +05:30
rohitwaghchaure
da6affbba7 Revert "perf: timeout while renaming cost center (backport #46641)" 2025-03-27 11:57:24 +05:30
Sagar Vora
6293b08540 Merge pull request #46729 from vishakhdesai/bank-clearance-fix-v14-backport
fix: don't filter payment entries on Bank Account in Payment Clearance (backport #46669)
2025-03-26 13:00:57 +05:30
vishakhdesai
576ce7e882 fix: don't filter payment entries on Bank Account in Payment Clearance 2025-03-26 11:41:35 +05:30
Frappe PR Bot
67d7ffa430 chore(release): Bumped to Version 14.84.0
# [14.84.0](https://github.com/frappe/erpnext/compare/v14.83.4...v14.84.0) (2025-03-25)

### Bug Fixes

* assign dialog instance to a variable in update_child_items function ([690a939](690a939572))
* customer credit limit check based on `bypass_credit_limit_check` in Journal Entry ([331ecc1](331ecc1964))
* do not validate if conversion rate is 1 for different currency ([c3447c0](c3447c030a))
* fix lint issues with trailing whitespaces ([df64d2e](df64d2ef4e))
* removed test case ([509c5c4](509c5c4d17))

### Features

* repost accounting ledger for purchase receipt ([88e664b](88e664b79f))

### Performance Improvements

* timeout while renaming cost center ([b9b08c3](b9b08c35ef))
2025-03-25 12:25:57 +00:00
ruthra kumar
d90c8a9150 Merge pull request #46714 from frappe/version-14-hotfix
chore: release v14
2025-03-25 17:54:27 +05:30
ruthra kumar
15bb1fdb24 Merge pull request #46712 from frappe/mergify/bp/version-14-hotfix/pr-46616
fix: do not validate if conversion rate is 1 for different currency (backport #46616)
2025-03-25 16:06:08 +05:30
ljain112
509c5c4d17 fix: removed test case 2025-03-25 15:22:19 +05:30
ruthra kumar
cb028b8740 chore: resolve conflict 2025-03-25 14:26:14 +05:30
ljain112
c3447c030a fix: do not validate if conversion rate is 1 for different currency
(cherry picked from commit e8a66d03bc)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
2025-03-25 08:42:17 +00:00
ruthra kumar
1d65f995e7 Merge pull request #46646 from frappe/mergify/bp/version-14-hotfix/pr-46641
perf: timeout while renaming cost center (backport #46641)
2025-03-25 13:27:09 +05:30
ruthra kumar
3a6d8cd9a1 Merge pull request #46704 from frappe/mergify/bp/version-14-hotfix/pr-46622
feat: repost accounting ledger for purchase receipt (backport #46622)
2025-03-25 12:13:50 +05:30
ljain112
88e664b79f feat: repost accounting ledger for purchase receipt
(cherry picked from commit b36e356469)
2025-03-25 06:19:33 +00:00
ruthra kumar
090ee7f042 Merge pull request #46690 from IMS94/fix-46686-so-update-items
fix: assign dialog instance to a variable in update_child_items function
2025-03-25 11:18:45 +05:30
mergify[bot]
b311b6eb7f ci: apply label "skip-release-notes" based on PR title (backport #46694) (#46696)
ci: apply label "skip-release-notes" based on PR title (#46694)

Workflow copied from frappe/frappe

(cherry picked from commit eb350012b0)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-03-24 16:55:07 +01:00
Imesha Sudasingha
df64d2ef4e fix: fix lint issues with trailing whitespaces 2025-03-24 12:50:48 +00:00
Imesha Sudasingha
690a939572 fix: assign dialog instance to a variable in update_child_items function
`dialog` is being referred in `onchange` handlers of the fields. Without this fix, they are failing because `dialog` is not defined.
2025-03-24 12:42:42 +00:00
ruthra kumar
a3639b055c Merge pull request #46676 from frappe/mergify/bp/version-14-hotfix/pr-46577
fix: customer credit limit check based on `bypass_credit_limit_check` in Journal Entry (backport #46577)
2025-03-24 13:58:00 +05:30
ljain112
331ecc1964 fix: customer credit limit check based on bypass_credit_limit_check in Journal Entry
(cherry picked from commit 8a84faebed)
2025-03-24 08:01:38 +00:00
rohitwaghchaure
736b125e14 chore: fix conflicts 2025-03-22 20:49:56 +05:30
Rohit Waghchaure
b9b08c35ef perf: timeout while renaming cost center
(cherry picked from commit 92be7cbbbf)

# Conflicts:
#	erpnext/accounts/doctype/gl_entry/gl_entry.json
2025-03-21 12:38:52 +00:00
Frappe PR Bot
7e8d2dc0fc chore(release): Bumped to Version 14.83.4
## [14.83.4](https://github.com/frappe/erpnext/compare/v14.83.3...v14.83.4) (2025-03-19)

### Bug Fixes

* fetch quality inspection parameter group ([6e497f7](6e497f73f1))
* not able to make PR against stand alone Debit Note ([16fe53b](16fe53b8c7))
* order by condition ([af3089b](af3089b96e))
* repost future sle and gle after capitalization ([#46576](https://github.com/frappe/erpnext/issues/46576)) ([805549f](805549f793))
* set stock adjustment account in difference account ([6f0c67a](6f0c67a242))
* **Transaction Deletion Record:** sql syntax error while fetching lead address ([20b43b4](20b43b4d93))
2025-03-19 11:04:55 +00:00
ruthra kumar
39af6bd143 Merge pull request #46581 from frappe/version-14-hotfix
chore: release v14
2025-03-19 16:33:27 +05:30
rohitwaghchaure
300f1a860b Merge pull request #46609 from rohitwaghchaure/fixed-support-33137
fix: order by condition
2025-03-19 15:36:43 +05:30
rohitwaghchaure
1441ef2532 Merge pull request #46610 from frappe/mergify/bp/version-14-hotfix/pr-46595
fix: not able to make PR against stand alone Debit Note (backport #46595)
2025-03-19 15:36:15 +05:30
rohitwaghchaure
64fd5c0ba9 chore: fix conflicts 2025-03-19 15:31:05 +05:30
Rohit Waghchaure
16fe53b8c7 fix: not able to make PR against stand alone Debit Note
(cherry picked from commit 6a52c30591)

# Conflicts:
#	erpnext/public/js/controllers/buying.js
2025-03-19 08:05:24 +00:00
Rohit Waghchaure
af3089b96e fix: order by condition 2025-03-19 13:20:56 +05:30
rohitwaghchaure
3cb29fc035 Merge pull request #46583 from frappe/mergify/bp/version-14-hotfix/pr-46575
fix: fetch quality inspection parameter group (backport #46575)
2025-03-18 17:28:54 +05:30
rohitwaghchaure
8a93057844 Merge pull request #46586 from frappe/mergify/bp/version-14-hotfix/pr-46576
fix: repost future sle and gle after capitalization (backport #46576)
2025-03-18 17:28:15 +05:30
Khushi Rawat
805549f793 fix: repost future sle and gle after capitalization (#46576)
(cherry picked from commit 29d77aa19f)
2025-03-18 10:31:48 +00:00
Mihir Kandoi
6e497f73f1 fix: fetch quality inspection parameter group
(cherry picked from commit 0a482c7ea8)
2025-03-18 10:27:29 +00:00
ruthra kumar
33f090a8c8 Merge pull request #46561 from frappe/mergify/bp/version-14-hotfix/pr-46557
fix(Transaction Deletion Record): sql syntax error while deleting lead address (backport #46557)
2025-03-17 17:00:49 +05:30
venkat102
20b43b4d93 fix(Transaction Deletion Record): sql syntax error while fetching lead address
(cherry picked from commit af0d6eeae8)
2025-03-17 11:08:38 +00:00
ruthra kumar
5c1f6f0107 Merge pull request #46511 from aerele/fix-v14/item-stock-difference-account
fix: set stock adjustment account in difference account (backport #45606)
2025-03-14 09:23:52 +05:30
Bhavan23
6f0c67a242 fix: set stock adjustment account in difference account 2025-03-13 17:01:55 +05:30
Frappe PR Bot
609bfaefba chore(release): Bumped to Version 14.83.3
## [14.83.3](https://github.com/frappe/erpnext/compare/v14.83.2...v14.83.3) (2025-03-12)

### Bug Fixes

* **account:** update account number from parent company ([1f54c27](1f54c272ac))
* not able to save work order with alternative item ([6ca1f9b](6ca1f9bc73))
2025-03-12 14:13:24 +00:00
ruthra kumar
2546589b4c Merge pull request #46445 from frappe/version-14-hotfix
chore: release v14
2025-03-12 19:41:47 +05:30
Shanuka Hewage
f311a0fc1c Fix: add parenttype condition to payment schedule query in accounts receivable report (#46370)
fix: add parenttype condition to payment schedule query in accounts receivable report
2025-03-12 16:07:07 +05:30
mergify[bot]
a1585b3c53 ci: ignore PRs labeled with "skip-release-notes" when generating release notes (backport #46453) (#46456)
ci: ignore PRs labeled with "skip-release-notes" when generating release notes

(cherry picked from commit 57007bf937)

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
2025-03-12 10:33:07 +05:30
ruthra kumar
05c0bf5d99 Merge pull request #46449 from frappe/mergify/bp/version-14-hotfix/pr-46398
chore: rename print and stationery account (backport #46398)
2025-03-11 18:12:08 +05:30
chethank1407
247a006b5a chore: rename print and stationery account
(cherry picked from commit 615997b774)
2025-03-11 12:03:21 +00:00
ruthra kumar
e0cf6393ee Merge pull request #46438 from frappe/mergify/bp/version-14-hotfix/pr-46372
fix(account): update account number from parent company (backport #46372)
2025-03-11 11:24:35 +05:30
venkat102
1f54c272ac fix(account): update account number from parent company
(cherry picked from commit 4a4894bc01)
2025-03-11 05:32:05 +00:00
rohitwaghchaure
9a1321ab02 Merge pull request #46414 from rohitwaghchaure/fixed-support-32397
fix: not able to save work order with alternative item
2025-03-10 17:38:37 +05:30
Rohit Waghchaure
6ca1f9bc73 fix: not able to save work order with alternative item 2025-03-10 12:46:45 +05:30
Frappe PR Bot
b404f00ece chore(release): Bumped to Version 14.83.2
## [14.83.2](https://github.com/frappe/erpnext/compare/v14.83.1...v14.83.2) (2025-03-05)

### Bug Fixes

* Add permission check in POS's `Toggle Recent Orders` (backport [#46010](https://github.com/frappe/erpnext/issues/46010)) ([#46273](https://github.com/frappe/erpnext/issues/46273)) ([557a05b](557a05b0ad))
* auto allocation for negative amount outstanding for Customers in Payment Entry ([8e02dcf](8e02dcfcaa))
* change voucher_type and voucher_no field type to data ([df4f4d9](df4f4d9a31))
* consolidate gl entries by project in General Ledger Report (backport [#46314](https://github.com/frappe/erpnext/issues/46314)) ([#46320](https://github.com/frappe/erpnext/issues/46320)) ([b3b7e62](b3b7e62a90))
* do not include opening invoices in billed items to be received report ([cedf577](cedf577b4c))
* don't allow renaming account while system is actively in use (backport [#46176](https://github.com/frappe/erpnext/issues/46176)) ([#46209](https://github.com/frappe/erpnext/issues/46209)) ([167069b](167069b823))
* exclude cancelled gl entries ([369a692](369a692af9))
* incorrect batch picked in the pick list ([ac25d3e](ac25d3e1c4))
* incorrectly billed amount in the purchase receipt ([ca94ad3](ca94ad3a24))
* inventory dimension for maintence visit ([69a8e0d](69a8e0dfac))
* only include submitted docs for internal received quantity validation (backport [#46262](https://github.com/frappe/erpnext/issues/46262)) ([#46303](https://github.com/frappe/erpnext/issues/46303)) ([90b5f0b](90b5f0b7bf))
* **patch:** Ensure SLE indexes (backport [#46131](https://github.com/frappe/erpnext/issues/46131)) ([#46134](https://github.com/frappe/erpnext/issues/46134)) ([f8bbcab](f8bbcab3a5))

### Performance Improvements

* don't track seen for POS Invoice (backport [#46187](https://github.com/frappe/erpnext/issues/46187)) ([#46188](https://github.com/frappe/erpnext/issues/46188)) ([b41ee66](b41ee667b9))
2025-03-05 13:28:51 +00:00
ruthra kumar
0f56fbcf6d Merge pull request #46264 from frappe/version-14-hotfix
chore: release v14
2025-03-05 18:57:30 +05:30
mergify[bot]
b3b7e62a90 fix: consolidate gl entries by project in General Ledger Report (backport #46314) (#46320)
fix: consolidate gl entries by project in General Ledger Report (#46314)

(cherry picked from commit 1f685efcaf)

Co-authored-by: Lakshit Jain <108322669+ljain112@users.noreply.github.com>
2025-03-05 16:18:34 +05:30
rohitwaghchaure
35a728d22b Merge pull request #46316 from rohitwaghchaure/fixed-support-31024-v14
fix: incorrect batch picked in the pick list
2025-03-05 15:43:04 +05:30
Rohit Waghchaure
ac25d3e1c4 fix: incorrect batch picked in the pick list 2025-03-05 14:29:22 +05:30
mergify[bot]
90b5f0b7bf fix: only include submitted docs for internal received quantity validation (backport #46262) (#46303)
fix: only include submitted docs for internal received quantity validation (#46262)

(cherry picked from commit 88fcdbb81e)

Co-authored-by: Lakshit Jain <108322669+ljain112@users.noreply.github.com>
2025-03-05 13:17:17 +05:30
mergify[bot]
557a05b0ad fix: Add permission check in POS's Toggle Recent Orders (backport #46010) (#46273)
* fix: use get_list to check permissions

(cherry picked from commit a08bc6b913)

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

* fix: resolve conflicts

---------

Co-authored-by: Sanket322 <shahsanket322003.com>
Co-authored-by: ljain112 <ljain112@gmail.com>
2025-03-05 12:04:39 +05:30
mergify[bot]
b41ee667b9 perf: don't track seen for POS Invoice (backport #46187) (#46188)
* perf: don't track seen for POS Invoice (#46187)

This is a moving doctype. Do people even browse the list view?

It doesn't make much sense, either. POS INvoices are rarely "reviewed" by multiple users.

(cherry picked from commit ded0aab680)

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

* chore: conflicts

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2025-03-05 12:03:27 +05:30
mergify[bot]
fbf6d8c9e2 chore: erpnext.com -> frappe.io/erpnext (backport #46288) (#46289)
* chore: erpnext.com -> frappe.io/erpnext (#46288)

(cherry picked from commit 41fe30ea6e)

# Conflicts:
#	README.md
#	pyproject.toml

* Update README.md

* Update pyproject.toml

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2025-03-05 11:37:49 +05:30
mergify[bot]
167069b823 fix: don't allow renaming account while system is actively in use (backport #46176) (#46209)
* fix: don't allow renaming account while system is actively in use (#46176)

(cherry picked from commit 999f1cf96d)

# Conflicts:
#	erpnext/accounts/doctype/account/account.py

* chore: conflicts

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2025-03-05 10:37:56 +05:30
Lakshit Jain
2d72a37d0c Merge pull request #46275 from frappe/mergify/bp/version-14-hotfix/pr-46039
fix: Ensure new line is added regardless of postal code presence (backport #46039)
2025-03-04 19:14:28 +05:30
Lakshit Jain
77ad224cf6 Merge pull request #46267 from frappe/mergify/bp/version-14-hotfix/pr-45896
fix: auto allocation for negative amount outstanding for Customers in Payment Entry (backport #45896)
2025-03-04 18:17:28 +05:30
Lakshit Jain
b5b55fad6c Merge pull request #46269 from frappe/mergify/bp/version-14-hotfix/pr-46260
fix: do not include opening invoices in billed items to be received report (backport #46260)
2025-03-04 18:16:57 +05:30
Sanket322
7cde990d69 refactor: add new line ragardless of postal code
(cherry picked from commit 746adfd057)
2025-03-04 12:36:40 +00:00
ljain112
cedf577b4c fix: do not include opening invoices in billed items to be received report
(cherry picked from commit c1ddf444c6)
2025-03-04 11:24:08 +00:00
ljain112
8e02dcfcaa fix: auto allocation for negative amount outstanding for Customers in Payment Entry
(cherry picked from commit 6275b44a0b)
2025-03-04 11:20:12 +00:00
Smit Vora
399ed331e3 Merge pull request #46247 from frappe/mergify/bp/version-14-hotfix/pr-46192
fix: Exclude Cancelled GL Entries (backport #46192)
2025-03-04 16:39:47 +05:30
ruthra kumar
59236bc5bf Merge pull request #46265 from frappe/mergify/bp/version-14-hotfix/pr-45751
fix: change voucher_type and voucher_name field type to data (backport #45751)
2025-03-04 16:12:16 +05:30
ruthra kumar
1089cdf213 chore: resolve conflicts 2025-03-04 15:46:05 +05:30
Sugesh393
df4f4d9a31 fix: change voucher_type and voucher_no field type to data
(cherry picked from commit f8ab021920)

# Conflicts:
#	erpnext/accounts/doctype/tax_withheld_vouchers/tax_withheld_vouchers.json
#	erpnext/accounts/doctype/tax_withheld_vouchers/tax_withheld_vouchers.py
2025-03-04 10:10:04 +00:00
mergify[bot]
f8bbcab3a5 fix(patch): Ensure SLE indexes (backport #46131) (#46134)
* fix(patch): Ensure SLE indexes (#46131)

Because of the way this change was pushed in parts, some sites don't see
this as "update" and don't have the new indexes.

(cherry picked from commit f62aa8fc57)

# Conflicts:
#	erpnext/patches.txt

* fix: resolved conflict

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2025-03-03 21:36:57 +05:30
Ninad1306
369a692af9 fix: exclude cancelled gl entries
(cherry picked from commit 3251a331dd)
2025-03-03 11:31:08 +00:00
rohitwaghchaure
8cc92e9ca0 Merge pull request #46241 from frappe/mergify/bp/version-14-hotfix/pr-46239
fix: incorrectly billed amount in the purchase receipt (backport #46239)
2025-03-03 16:16:38 +05:30
rohitwaghchaure
eebf6cf877 chore: fix conflicts 2025-03-03 14:48:07 +05:30
Rohit Waghchaure
ca94ad3a24 fix: incorrectly billed amount in the purchase receipt
(cherry picked from commit a5271fdb2e)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
2025-03-03 09:15:48 +00:00
rohitwaghchaure
1a8bf0cf3d Merge pull request #46040 from frappe/mergify/bp/version-14-hotfix/pr-46037
fix: inventory dimension for maintenance visit (backport #46037)
2025-02-28 14:53:56 +05:30
Frappe PR Bot
19604e91c6 chore(release): Bumped to Version 14.83.1
## [14.83.1](https://github.com/frappe/erpnext/compare/v14.83.0...v14.83.1) (2025-02-26)

### Bug Fixes

* incorrect stock value difference for adjustment entry ([c734373](c734373c9f))
2025-02-26 12:43:06 +00:00
ruthra kumar
4f40939c15 Merge pull request #46133 from frappe/version-14-hotfix
chore: release v14
2025-02-26 18:11:42 +05:30
rohitwaghchaure
811953b9b0 chore: fix conflicts 2025-02-23 19:47:06 +05:30
rohitwaghchaure
6748780591 Merge pull request #46027 from frappe/mergify/bp/version-14-hotfix/pr-46021
fix: incorrect stock value difference for adjustment entry (backport #46021)
2025-02-20 13:06:07 +05:30
Rohit Waghchaure
69a8e0dfac fix: inventory dimension for maintence visit
(cherry picked from commit cd4ba69262)

# Conflicts:
#	erpnext/stock/doctype/inventory_dimension/inventory_dimension.py
2025-02-20 06:13:14 +00:00
Frappe PR Bot
11da4372e2 chore(release): Bumped to Version 14.83.0
# [14.83.0](https://github.com/frappe/erpnext/compare/v14.82.2...v14.83.0) (2025-02-19)

### Bug Fixes

* '0' rate LDC's Invoice net totals should be ignored (backport [#45639](https://github.com/frappe/erpnext/issues/45639)) ([#45783](https://github.com/frappe/erpnext/issues/45783)) ([534b25c](534b25c448))
* add is_new in if condition ([ef37388](ef37388993))
* fetch child account data for selected parent ([#45904](https://github.com/frappe/erpnext/issues/45904)) ([e7d9786](e7d97865e5))
* include missing payment_gateway parameter in Payment Request URL ([a344b8b](a344b8b9ae))
* millisecond issue for posting datetime ([fc6f568](fc6f568a6c))
* on selection of batch qty is not fetching ([44a16bb](44a16bb544))
* pos return validation on v14 ([#45859](https://github.com/frappe/erpnext/issues/45859)) ([84432fc](84432fc035))
* **report:** add options to multiselectlist fields ([aa0ada9](aa0ada9670))
* **send_message:** escape HTML in the text ([703fd81](703fd816d1))
* serial no is mandatory for zero qty validation ([6f6133f](6f6133f2e2))
* set default value to 0 as per new logic ([4b16272](4b16272a01))
* tests ([e515b91](e515b91988))

### Features

* added ability to use custom html format for process statement of accounts ([#45746](https://github.com/frappe/erpnext/issues/45746)) ([a0cd08e](a0cd08e9ea))
* added option to enforce free item qty in pricing rule ([2edf083](2edf083c35))
2025-02-19 11:48:59 +00:00
ruthra kumar
4c74ac8738 Merge pull request #45982 from frappe/version-14-hotfix
chore: release v14
2025-02-19 17:17:34 +05:30
Akhil Narang
3e21e343d3 Merge pull request #46024 from frappe/mergify/bp/version-14-hotfix/pr-46003
fix(send_message): escape HTML in the text (backport #46003)
2025-02-19 16:43:09 +05:30
Rohit Waghchaure
c734373c9f fix: incorrect stock value difference for adjustment entry
(cherry picked from commit df83e427a3)
2025-02-19 11:11:09 +00:00
Akhil Narang
703fd816d1 fix(send_message): escape HTML in the text
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
(cherry picked from commit 448a5db20f)
2025-02-19 10:45:28 +00:00
rohitwaghchaure
101c71c508 Merge pull request #46004 from frappe/mergify/bp/version-14-hotfix/pr-45750
feat: added option to enforce free item qty in pricing rule (backport #45750)
2025-02-19 15:45:14 +05:30
Steve Wilson
a0cd08e9ea feat: added ability to use custom html format for process statement of accounts (#45746)
* feat: added ability to use custom print format for process statement of accounts documents.

* fix: handles missing hook issues

* chore: linter changes

---------

Co-authored-by: Boy4099 <mashtawayne4099@gmail.com>
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2025-02-19 15:19:36 +05:30
rohitwaghchaure
57a0717778 chore: fix conflicts 2025-02-19 15:12:08 +05:30
rohitwaghchaure
0cf9c94a37 chore: fix conflicts 2025-02-19 15:10:34 +05:30
ruthra kumar
e48a03f130 Merge pull request #46009 from frappe/mergify/bp/version-14-hotfix/pr-45904
fix: fetch child account data for selected parent (backport #45904)
2025-02-19 14:21:34 +05:30
Bhavansathru
e7d97865e5 fix: fetch child account data for selected parent (#45904)
* fix: fetch child account data for selected parent

* fix: change reference name

---------

Co-authored-by: venkat102 <venkatesharunachalam659@gmail.com>
(cherry picked from commit 73e82b7afa)
2025-02-19 08:29:00 +00:00
Mihir Kandoi
4b16272a01 fix: set default value to 0 as per new logic
(cherry picked from commit 844f1636c0)
2025-02-19 07:21:39 +00:00
Mihir Kandoi
1ff0edd492 refactor: rename field
(cherry picked from commit f3d598881c)
2025-02-19 07:21:39 +00:00
Mihir Kandoi
ef37388993 fix: add is_new in if condition
(cherry picked from commit 4dcac56486)
2025-02-19 07:21:39 +00:00
Mihir Kandoi
116798df96 test: added test
(cherry picked from commit ac3259b8f1)
2025-02-19 07:21:38 +00:00
Mihir Kandoi
e515b91988 fix: tests
(cherry picked from commit 366ae85d85)

# Conflicts:
#	erpnext/stock/doctype/pick_list/test_pick_list.py
2025-02-19 07:21:38 +00:00
Mihir Kandoi
2edf083c35 feat: added option to enforce free item qty in pricing rule
(cherry picked from commit 19c01b1457)

# Conflicts:
#	erpnext/accounts/doctype/pricing_rule/pricing_rule.py
2025-02-19 07:21:38 +00:00
rohitwaghchaure
86ddabeae6 Merge pull request #45985 from rohitwaghchaure/fixed-support-31935-1
fix: millisecond issue for posting datetime
2025-02-18 20:11:28 +05:30
Rohit Waghchaure
fc6f568a6c fix: millisecond issue for posting datetime 2025-02-18 18:54:17 +05:30
rohitwaghchaure
cd3a411401 Merge pull request #45931 from rohitwaghchaure/fixed-support-31345-1
fix: serial no is mandatory for zero qty validation
2025-02-15 22:01:40 +05:30
Rohit Waghchaure
6f6133f2e2 fix: serial no is mandatory for zero qty validation 2025-02-15 15:34:37 +05:30
rohitwaghchaure
5a8b81409e Merge pull request #45920 from rohitwaghchaure/fixed-support-31326
fix: on selection of batch qty is not fetching
2025-02-14 17:34:21 +05:30
Rohit Waghchaure
44a16bb544 fix: on selection of batch qty is not fetching 2025-02-14 17:26:50 +05:30
ruthra kumar
206d0f1856 Merge pull request #45918 from frappe/mergify/bp/version-14-hotfix/pr-45912
fix: include missing payment_gateway parameter in Payment Request URL (backport #45912)
2025-02-14 17:13:20 +05:30
Diptanil Saha
84432fc035 fix: pos return validation on v14 (#45859)
fix: pos return validation v-14
2025-02-14 17:11:03 +05:30
Navin-S-R
a344b8b9ae fix: include missing payment_gateway parameter in Payment Request URL
(cherry picked from commit dbac8cfc94)
2025-02-14 11:20:17 +00:00
ruthra kumar
c65f421da9 Merge pull request #45893 from frappe/mergify/bp/version-14-hotfix/pr-45804
fix(report): add options to multiselectlist fields (backport #45804)
2025-02-13 14:27:22 +05:30
ruthra kumar
5c6028340f chore: resolve conflicts 2025-02-13 14:25:41 +05:30
venkat102
aa0ada9670 fix(report): add options to multiselectlist fields
(cherry picked from commit 8785342fce)

# Conflicts:
#	erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.js
#	erpnext/accounts/report/gross_profit/gross_profit.js
#	erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js
#	erpnext/stock/report/serial_and_batch_summary/serial_and_batch_summary.js
2025-02-13 08:46:55 +00:00
mergify[bot]
534b25c448 fix: '0' rate LDC's Invoice net totals should be ignored (backport #45639) (#45783)
* fix: '0' rate LDC's Invoice net totals should be ignored

(cherry picked from commit 325c4e3536)

# Conflicts:
#	erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py

* test: ldc @ 0 rate

(cherry picked from commit 0cdd346f8f)

# Conflicts:
#	erpnext/accounts/doctype/tax_withholding_category/test_tax_withholding_category.py

* chore: resolve conflicts

* fix: incorrect parameters

* fix: ignore 0 rate ldc invoices

---------

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2025-02-13 13:19:34 +05:30
Frappe PR Bot
f109303f85 chore(release): Bumped to Version 14.82.2
## [14.82.2](https://github.com/frappe/erpnext/compare/v14.82.1...v14.82.2) (2025-02-12)

### Bug Fixes

* add total row in non_grouped_invoices ([49074aa](49074aa2fa))
* correct amt in account currency for lcv with manually distributed charges. (backport [#45532](https://github.com/frappe/erpnext/issues/45532)) ([#45863](https://github.com/frappe/erpnext/issues/45863)) ([c61e4e2](c61e4e2ddf))
* do not allow "Finance Book" in Accounting Dimensions (backport [#45696](https://github.com/frappe/erpnext/issues/45696)) ([#45855](https://github.com/frappe/erpnext/issues/45855)) ([08ba775](08ba77538b))
* do not validate party against  Receivable and Payable account for cancelled gl entries ([9f79da0](9f79da0015))
* map project from rfq to supplier quotation (backport [#45745](https://github.com/frappe/erpnext/issues/45745)) ([#45827](https://github.com/frappe/erpnext/issues/45827)) ([c4358c0](c4358c049a))
* Party name in Supplier Portal for Purchase Order (backport [#45772](https://github.com/frappe/erpnext/issues/45772)) ([#45857](https://github.com/frappe/erpnext/issues/45857)) ([46eba50](46eba50c8c))
* pos numpad editable action buttons (backport [#45823](https://github.com/frappe/erpnext/issues/45823)) ([#45825](https://github.com/frappe/erpnext/issues/45825)) ([6b9dad7](6b9dad7768))
* **regional:** removed payment schedule validation in sales invoice for italy (backport [#45852](https://github.com/frappe/erpnext/issues/45852)) ([#45853](https://github.com/frappe/erpnext/issues/45853)) ([de14bf1](de14bf1010))
* skip warning for free items ([2ed3bdc](2ed3bdcc2e))
* unable to remove image from employee ([91caca0](91caca05bb))
* update ctx to args ([573ce64](573ce645b2))

### Performance Improvements

* Ignore is_opening column in GL Queries ([#45327](https://github.com/frappe/erpnext/issues/45327)) ([9985a03](9985a03f39))
2025-02-12 12:08:02 +00:00
ruthra kumar
ab8fceb68d Merge pull request #45861 from frappe/version-14-hotfix
chore: release v14
2025-02-12 17:36:33 +05:30
rohitwaghchaure
e53a78c2bd Merge pull request #45883 from frappe/mergify/bp/version-14-hotfix/pr-45786
fix: skip warning for free items (backport #45786)
2025-02-12 15:16:15 +05:30
barredterra
2ed3bdcc2e fix: skip warning for free items
(cherry picked from commit 772776ad8a)
2025-02-12 09:20:04 +00:00
mergify[bot]
c61e4e2ddf fix: correct amt in account currency for lcv with manually distributed charges. (backport #45532) (#45863)
fix: correct amt in account currency for lcv with manually distributed charges.

(cherry picked from commit db38e7bf5a)

Co-authored-by: ljain112 <ljain112@gmail.com>
2025-02-11 16:05:35 +05:30
mergify[bot]
08ba77538b fix: do not allow "Finance Book" in Accounting Dimensions (backport #45696) (#45855)
fix: do not allow "Finance Book" in Accounting Dimensions

(cherry picked from commit a44be73a98)

Co-authored-by: ljain112 <ljain112@gmail.com>
2025-02-11 15:42:27 +05:30
mergify[bot]
de14bf1010 fix(regional): removed payment schedule validation in sales invoice for italy (backport #45852) (#45853)
fix(regional): removed payment schedule validation in sales invoice for italy (#45852)

(cherry picked from commit 494310293c)

Co-authored-by: Lakshit Jain <108322669+ljain112@users.noreply.github.com>
2025-02-11 15:41:39 +05:30
mergify[bot]
46eba50c8c fix: Party name in Supplier Portal for Purchase Order (backport #45772) (#45857)
fix: Party name in Supplier Portal for Purchase Order

(cherry picked from commit fc8663421b)

Co-authored-by: ljain112 <ljain112@gmail.com>
2025-02-11 15:41:04 +05:30
mergify[bot]
c4358c049a fix: map project from rfq to supplier quotation (backport #45745) (#45827)
* fix: map project from rfq to supplier quotation

(cherry picked from commit d0479036bb)

* fix: add project field map from mr to rfq

(cherry picked from commit 8fa39bec61)

---------

Co-authored-by: HenningWendtland <156231187+HenningWendtland@users.noreply.github.com>
2025-02-11 14:52:21 +05:30
ruthra kumar
a43f1badd5 Merge pull request #45846 from frappe/mergify/bp/version-14-hotfix/pr-45792
fix: do not validate party against Receivable and Payable account for cancelled gl entries (backport #45792)
2025-02-11 12:53:20 +05:30
ljain112
9f79da0015 fix: do not validate party against Receivable and Payable account for cancelled gl entries
(cherry picked from commit 0809e00455)
2025-02-11 06:44:37 +00:00
ruthra kumar
ca9df9db07 Merge pull request #45843 from frappe/mergify/bp/version-14-hotfix/pr-45781
fix: Added Total Row for `Gross Profit` Report in Non-Grouped Invoices (backport #45781)
2025-02-11 10:55:37 +05:30
Sanket322
49074aa2fa fix: add total row in non_grouped_invoices
(cherry picked from commit 2d32ddacc3)
2025-02-11 04:51:32 +00:00
mergify[bot]
6b9dad7768 fix: pos numpad editable action buttons (backport #45823) (#45825)
fix: pos numpad editable action buttons (#45823)

(cherry picked from commit 0b9c28620f)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-02-10 16:33:21 +05:30
ruthra kumar
9e36cac0d1 Merge pull request #45812 from frappe/mergify/bp/version-14-hotfix/pr-45793
fix: unable to remove image from employee (backport #45793)
2025-02-10 11:01:25 +05:30
ruthra kumar
256318bb1c chore: resolve conflict 2025-02-10 10:37:50 +05:30
Asmita Hase
91caca05bb fix: unable to remove image from employee
fix: employee image disappears when newly created user_id is linked to employee

(cherry picked from commit 0207d2d7b6)

# Conflicts:
#	erpnext/setup/doctype/employee/employee.json
2025-02-10 05:02:53 +00:00
Frappe PR Bot
f5a1041de2 chore(release): Bumped to Version 14.82.1
## [14.82.1](https://github.com/frappe/erpnext/compare/v14.82.0...v14.82.1) (2025-02-07)

### Bug Fixes

* update ctx to args ([1e13806](1e138064a8))
2025-02-07 14:27:35 +00:00
ruthra kumar
4880a83538 Merge pull request #45797 from frappe/mergify/bp/version-14/pr-45796
Fix: Update `ctx` to `args` for compatibility. (copy #45770) (backport #45796)
2025-02-07 19:56:10 +05:30
Sanket322
1e138064a8 fix: update ctx to args
(cherry picked from commit d4bc3d182f)
(cherry picked from commit 573ce645b2)
2025-02-07 14:21:46 +00:00
ruthra kumar
ceb5997256 Merge pull request #45796 from frappe/mergify/copy/version-14-hotfix/pr-45770
Fix: Update `ctx` to `args` for compatibility. (copy #45770)
2025-02-07 19:50:15 +05:30
Sanket322
573ce645b2 fix: update ctx to args
(cherry picked from commit d4bc3d182f)
2025-02-07 14:15:35 +00:00
ruthra kumar
09cefd9d63 Merge pull request #45785 from frappe/mergify/bp/version-14-hotfix/pr-45327
perf: Ignore is_opening column in GL Queries (backport #45327)
2025-02-07 17:15:58 +05:30
ruthra kumar
222bd9351d chore: resolve conflicts 2025-02-07 15:39:21 +05:30
Deepesh Garg
9985a03f39 perf: Ignore is_opening column in GL Queries (#45327)
* perf: Ignore is_opening column in GL Queries

* chore: Remove unwanted changes

* chore: Remove unwanted changes

* chore: Remove unwanted changes

* chore: Remove unwanted changes

* chore: Remove unwanted changes

* chore: Remove unwanted changes

(cherry picked from commit 993f40fa43)

# Conflicts:
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.json
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.py
2025-02-07 10:06:07 +00:00
Frappe PR Bot
35fab8c23f chore(release): Bumped to Version 14.82.0
# [14.82.0](https://github.com/frappe/erpnext/compare/v14.81.0...v14.82.0) (2025-02-05)

### Bug Fixes

* allow multiple email ids ([9510758](9510758ce4))
* bind this to function ([83bce78](83bce785ff))
* check billing address ([2f33f6b](2f33f6bdf5))
* closing stock balance report not generating ([3f6beeb](3f6beebeec))
* correct error message in payment entry ([9f5d7e4](9f5d7e41ec))
* default payment terms template selected while duplicating ([82cfafb](82cfafb610))
* Gross Profit Report with Correct Totals and Gross Margin (backport [#45548](https://github.com/frappe/erpnext/issues/45548)) ([#45597](https://github.com/frappe/erpnext/issues/45597)) ([0086656](0086656748))
* handling company in bank reconciliation tool ([#45582](https://github.com/frappe/erpnext/issues/45582)) ([7823f1b](7823f1b06f))
* payment schedule table is empty while duplicating record ([d0ff91b](d0ff91b0e0))
* **pos:** add item in the existing item row when discount is applied ([3c6ed0a](3c6ed0a565))
* posting_date to posting_datetime in stock related queries ([bf3d68e](bf3d68e76d))
* renamed Commments Tab to Notes tab in Lead doctype ([0eddd1e](0eddd1e2d7))
* track employee changes ([#45674](https://github.com/frappe/erpnext/issues/45674)) ([43a5c33](43a5c33dbf))

### Features

* set bank account of company to default company bank account from masters ([dac5307](dac53074f2))
2025-02-05 11:45:31 +00:00
ruthra kumar
21b7833d57 Merge pull request #45704 from frappe/version-14-hotfix
chore: release v14
2025-02-05 17:14:10 +05:30
ruthra kumar
b217a7ee3e Merge pull request #45736 from frappe/mergify/bp/version-14-hotfix/pr-45717
fix(Purchase Invoice): default payment terms template selected while duplicating (backport #45717)
2025-02-05 15:30:42 +05:30
ruthra kumar
49787b6d84 chore: resolve conflicts 2025-02-05 15:22:13 +05:30
Ejaaz Khan
95903c9f96 refactor: remove log
(cherry picked from commit bfc01441a0)
2025-02-05 09:47:58 +00:00
Ejaaz Khan
d0ff91b0e0 fix: payment schedule table is empty while duplicating record
(cherry picked from commit fb3f08a441)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
2025-02-05 09:47:58 +00:00
Ejaaz Khan
82cfafb610 fix: default payment terms template selected while duplicating
(cherry picked from commit 18127603fe)
2025-02-05 09:47:57 +00:00
ruthra kumar
d14acb4f58 Merge pull request #45729 from frappe/mergify/bp/version-14-hotfix/pr-45686
fix: allow multiple email ids (backport #45686)
2025-02-05 14:27:57 +05:30
ruthra kumar
202693d4c3 Merge pull request #45730 from frappe/mergify/bp/version-14-hotfix/pr-45447
fix(pos): add item in the existing item row when discount is applied (backport #45447)
2025-02-05 14:10:21 +05:30
venkat102
3c6ed0a565 fix(pos): add item in the existing item row when discount is applied
(cherry picked from commit bee2c04d0b)
2025-02-05 14:03:54 +05:30
Sudharsanan11
2f33f6bdf5 fix: check billing address
(cherry picked from commit 9950e4aa0c)
2025-02-05 08:19:59 +00:00
Sudharsanan11
9510758ce4 fix: allow multiple email ids
(cherry picked from commit 423decb93c)
2025-02-05 08:19:58 +00:00
ruthra kumar
f01765db6f Merge pull request #45722 from frappe/mergify/bp/version-14-hotfix/pr-45721
fix: closing stock balance report not generating (backport #45721)
2025-02-05 10:38:34 +05:30
Rohit Waghchaure
3f6beebeec fix: closing stock balance report not generating
(cherry picked from commit 47d1c3b5a3)
2025-02-05 03:16:09 +00:00
ruthra kumar
8a9d554c32 Merge pull request #45712 from frappe/mergify/bp/version-14-hotfix/pr-45582
fix: handling company in bank reconciliation tool (backport #45582)
2025-02-04 17:32:26 +05:30
Aayush Dalal
7823f1b06f fix: handling company in bank reconciliation tool (#45582)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
(cherry picked from commit d1c927530e)
2025-02-04 11:45:02 +00:00
ruthra kumar
4d5becbd7c Merge pull request #45676 from frappe/mergify/bp/version-14-hotfix/pr-45674
fix: track employee changes (backport #45674)
2025-02-03 15:27:16 +05:30
Ankush Menat
43a5c33dbf fix: track employee changes (#45674)
closes https://github.com/frappe/erpnext/issues/45571

(cherry picked from commit 827afbfa2e)
2025-02-03 08:52:37 +00:00
ruthra kumar
50c26ba017 Merge pull request #45668 from frappe/mergify/bp/version-14-hotfix/pr-45619
feat: set bank account of company to default company bank account fro… (backport #45619)
2025-02-03 14:05:38 +05:30
ruthra kumar
7bfe0526a1 Merge pull request #45670 from frappe/mergify/bp/version-14-hotfix/pr-44790
refactor: configurable posting date for Exc Gain / Loss journal (backport #44790)
2025-02-03 14:04:56 +05:30
Shariq Ansari
235b38a3af Merge pull request #45672 from frappe/mergify/bp/version-14-hotfix/pr-45637
fix: renamed Comments Tab to Notes tab in Lead doctype (backport #45637)
2025-02-03 13:27:22 +05:30
Shariq Ansari
c6ed82a304 chore: resolved conflict 2025-02-03 13:25:10 +05:30
ruthra kumar
e9d934d378 chore: resolve conflicts 2025-02-03 13:24:27 +05:30
Shariq Ansari
0eddd1e2d7 fix: renamed Commments Tab to Notes tab in Lead doctype
(cherry picked from commit 018df3135a)

# Conflicts:
#	erpnext/crm/doctype/lead/lead.json
2025-02-03 07:53:25 +00:00
ruthra kumar
cc275318e3 refactor: support JE posting date in semi-auto reconciilation tool
(cherry picked from commit a71718883e)

# Conflicts:
#	erpnext/accounts/doctype/process_payment_reconciliation_log_allocations/process_payment_reconciliation_log_allocations.json
#	erpnext/accounts/doctype/process_payment_reconciliation_log_allocations/process_payment_reconciliation_log_allocations.py
2025-02-03 07:29:24 +00:00
ruthra kumar
620cdc2489 test: exc gain/loss posting date based on configuration
(cherry picked from commit 2f3281579a)

# Conflicts:
#	erpnext/controllers/tests/test_accounts_controller.py
2025-02-03 07:29:24 +00:00
ruthra kumar
ef6e264887 refactor: only apply configuration on normal payments
patch to update default value

(cherry picked from commit b2c3da135e)

# Conflicts:
#	erpnext/controllers/accounts_controller.py
#	erpnext/patches.txt
2025-02-03 07:29:24 +00:00
ruthra kumar
5a62bd6e85 refactor: allow reconciliation date for exchange gain / loss
(cherry picked from commit 95af63e305)

# Conflicts:
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.json
2025-02-03 07:29:23 +00:00
ruthra kumar
035139d4c7 refactor: configurable posting date for Exc Gain / Loss journal
(cherry picked from commit 5257413a93)
2025-02-03 07:29:23 +00:00
ruthra kumar
b5637c43fa refactor: configurable posting date for Exc Gain / Loss journal
(cherry picked from commit 3fbd2ca0d9)

# Conflicts:
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.json
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.py
2025-02-03 07:29:23 +00:00
Mihir Kandoi
dac53074f2 feat: set bank account of company to default company bank account from masters
(cherry picked from commit ce7702cc19)
2025-02-03 06:31:55 +00:00
rohitwaghchaure
b6a6bced61 Merge pull request #45666 from frappe/mergify/bp/version-14-hotfix/pr-45621
fix: delivered button of purchase order (backport #45621)
2025-02-03 12:01:11 +05:30
rohitwaghchaure
7b3c35c167 chore: fix conflicts 2025-02-03 11:58:10 +05:30
Mihir Kandoi
83bce785ff fix: bind this to function
(cherry picked from commit 41649cf52d)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.js
2025-02-03 06:22:42 +00:00
mergify[bot]
0086656748 fix: Gross Profit Report with Correct Totals and Gross Margin (backport #45548) (#45597)
* fix: Gross Profit Report with Correct Totals and Gross Margin (#45548)

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

# Conflicts:
#	erpnext/accounts/report/gross_profit/test_gross_profit.py
#	erpnext/patches.txt

* fix: conflicts

---------

Co-authored-by: Sanket Shah <113279972+Sanket322@users.noreply.github.com>
Co-authored-by: ljain112 <ljain112@gmail.com>
2025-01-31 16:10:25 +05:30
rohitwaghchaure
36b1c436ea Merge pull request #45618 from frappe/mergify/bp/version-14-hotfix/pr-45612
fix: posting_date to posting_datetime in stock related queries (backport #45612)
2025-01-31 14:43:40 +05:30
ruthra kumar
9f4b3e86b3 Merge pull request #45635 from frappe/mergify/bp/version-14-hotfix/pr-45615
fix: correct error message in payment entry (backport #45615)
2025-01-31 14:18:49 +05:30
ljain112
9f5d7e41ec fix: correct error message in payment entry
(cherry picked from commit 592704cfd0)
2025-01-31 07:27:37 +00:00
rohitwaghchaure
50aa4ed55a chore: fix conflicts 2025-01-31 12:01:45 +05:30
rohitwaghchaure
dee6e2b697 chore: fix conflicts 2025-01-31 10:38:08 +05:30
rohitwaghchaure
9217e919c3 chore: fix conflicts 2025-01-31 10:36:25 +05:30
Rohit Waghchaure
bf3d68e76d fix: posting_date to posting_datetime in stock related queries
(cherry picked from commit e61ab48145)

# Conflicts:
#	erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py
#	erpnext/stock/report/stock_ledger/stock_ledger.py
2025-01-30 15:50:38 +00:00
Frappe PR Bot
4eaaffe550 chore(release): Bumped to Version 14.81.0
# [14.81.0](https://github.com/frappe/erpnext/compare/v14.80.0...v14.81.0) (2025-01-29)

### Bug Fixes

* add condition to check if item is delivered by supplier in make_purchase_order_for_default_supplier() ([#45370](https://github.com/frappe/erpnext/issues/45370)) ([69464ab](69464ab7ff))
* add multiple item issue in stock entry (backport [#45544](https://github.com/frappe/erpnext/issues/45544)) ([#45579](https://github.com/frappe/erpnext/issues/45579)) ([1160df9](1160df9350))
* currency decimal on POS Past Order List (backport [#45524](https://github.com/frappe/erpnext/issues/45524)) ([#45526](https://github.com/frappe/erpnext/issues/45526)) ([4d2352a](4d2352af00))
* fix creating documents from sales invoice (backport [#45346](https://github.com/frappe/erpnext/issues/45346)) ([#45407](https://github.com/frappe/erpnext/issues/45407)) ([452b205](452b205021))
* get stock balance filtered by company for validating stock value in jv (backport [#45549](https://github.com/frappe/erpnext/issues/45549)) ([#45577](https://github.com/frappe/erpnext/issues/45577)) ([e682d2c](e682d2c9ae))
* heatmap for Customer and Supplier not rendering ([#44717](https://github.com/frappe/erpnext/issues/44717)) ([ecdff8f](ecdff8f320))
* Merge Conflicts ([35f801f](35f801feda))
* remove applied pricing rule ([c484563](c484563bea))
* resolved pos return setting to default mode of payment instead of user selection ([#45377](https://github.com/frappe/erpnext/issues/45377)) ([#45436](https://github.com/frappe/erpnext/issues/45436)) ([24dc1bf](24dc1bf1a3))
* secure bulk transaction (backport [#45386](https://github.com/frappe/erpnext/issues/45386)) ([#45425](https://github.com/frappe/erpnext/issues/45425)) ([c6bc928](c6bc928f50))
* set company related values ([03068ab](03068ab96c))
* set preferred email in Employee via backend controller (backport [#45320](https://github.com/frappe/erpnext/issues/45320)) ([#45378](https://github.com/frappe/erpnext/issues/45378)) ([1622fc8](1622fc8728))
* update fields on change of item code In `Update Items` of `Sales Order` ([#45125](https://github.com/frappe/erpnext/issues/45125)) ([8befe7f](8befe7f244))
* update voucher outstanding from payment ledger ([a015527](a0155279e0))
* use user defined discount amount or default ([914f4bf](914f4bffea))
* Wrong `bank_ac_no` filter + simplify convoluted logic ([b6b453c](b6b453ca5d))

### Features

* add company level validation for accounting dimension ([cca5fbd](cca5fbd81a))
2025-01-29 11:30:28 +00:00
ruthra kumar
2c693c638d Merge pull request #45567 from frappe/version-14-hotfix
chore: release v14
2025-01-29 16:58:57 +05:30
ruthra kumar
39e82dfbc1 Merge pull request #45593 from frappe/mergify/bp/version-14-hotfix/pr-45569
fix: update voucher outstanding from payment ledger (backport #45569)
2025-01-29 16:33:00 +05:30
ljain112
a0155279e0 fix: update voucher outstanding from payment ledger
(cherry picked from commit dd77070351)
2025-01-29 10:42:17 +00:00
mergify[bot]
e682d2c9ae fix: get stock balance filtered by company for validating stock value in jv (backport #45549) (#45577)
* fix: get stock balance filtered by company for validating stock value in jv (#45549)

* fix: get stock balance filtered by company for validating stock value in jv

* test: error is raised  on validate

(cherry picked from commit 9f20854bd9)

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

* fix: conflict

---------

Co-authored-by: Lakshit Jain <108322669+ljain112@users.noreply.github.com>
Co-authored-by: ljain112 <ljain112@gmail.com>
2025-01-29 12:46:13 +05:30
mergify[bot]
1160df9350 fix: add multiple item issue in stock entry (backport #45544) (#45579)
fix: add multiple item issue in stock entry (#45544)

(cherry picked from commit 5a023dc8d4)

Co-authored-by: Ejaaz Khan <67804911+iamejaaz@users.noreply.github.com>
2025-01-29 12:45:48 +05:30
ruthra kumar
80ed2fb1fb Merge pull request #45538 from frappe/mergify/bp/version-14-hotfix/pr-45345
fix:  maintain existing discounts in get_pricing_rule_for_item (backport #45345)
2025-01-29 12:26:52 +05:30
ruthra kumar
9eda931b97 chore: resolve conflicts 2025-01-29 11:58:21 +05:30
ruthra kumar
30f001edea Merge pull request #45556 from frappe/mergify/bp/version-14-hotfix/pr-45125
fix: update fields on change of item code In `Update Items` of `Sales Order` (backport #45125)
2025-01-28 11:32:08 +05:30
Sanket Shah
8befe7f244 fix: update fields on change of item code In Update Items of Sales Order (#45125)
* fix: update fields on change of item code

* fix: minor update

* fix: set the new values always

* Revert "fix: set the new values always"

This reverts commit 44daa0a641.

---------

Co-authored-by: Sanket322 <shahsanket322003.com>
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
(cherry picked from commit 9933d3c8ff)
2025-01-28 05:58:26 +00:00
mergify[bot]
de531a81b6 chore: bump actions/cache to v4 (backport #45541) (#45545)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-01-27 15:57:05 +01:00
ruthra kumar
ecbeaaf533 Merge pull request #45533 from frappe/mergify/bp/version-14-hotfix/pr-45302
feat: add company level validation for accounting dimension (backport #45302)
2025-01-27 17:30:52 +05:30
ruthra kumar
befc16cc97 refactor(test): update test data 2025-01-27 16:12:18 +05:30
ruthra kumar
b8e4d80b4e chore: resolve conflicts 2025-01-27 16:12:18 +05:30
Sugesh393
9767dc61a6 chore: update variable names for improved readability
(cherry picked from commit 36bae55299)
2025-01-27 16:12:18 +05:30
Sugesh393
03068ab96c fix: set company related values
(cherry picked from commit 454067198e)
2025-01-27 16:12:12 +05:30
Sanket322
c484563bea fix: remove applied pricing rule
(cherry picked from commit 50223c6bec)

# Conflicts:
#	erpnext/public/js/controllers/transaction.js
2025-01-27 10:32:53 +00:00
Sanket322
914f4bffea fix: use user defined discount amount or default
(cherry picked from commit e2a32b7257)
2025-01-27 10:32:52 +00:00
Sugesh393
2fb1aaa5c3 test: add new unit test for company validation in accounting dimension
(cherry picked from commit c94091d68f)

# Conflicts:
#	erpnext/controllers/tests/test_accounts_controller.py
2025-01-27 09:24:59 +00:00
Sugesh393
cca5fbd81a feat: add company level validation for accounting dimension
(cherry picked from commit 60efd3e219)

# Conflicts:
#	erpnext/controllers/accounts_controller.py
2025-01-27 09:24:59 +00:00
mergify[bot]
4d2352af00 fix: currency decimal on POS Past Order List (backport #45524) (#45526)
fix: currency decimal on POS Past Order List (#45524)

* fix: currency decimal on POS

* fix: removed precision

(cherry picked from commit 2ac8c92e7f)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-01-27 13:21:34 +05:30
Diptanil Saha
24dc1bf1a3 fix: resolved pos return setting to default mode of payment instead of user selection (#45377) (#45436)
* fix: resolved pos return setting to default mode of payment instead of user selection

* refactor: removed console log statement

* refactor: moved get_payment_data to sales_and_purchase_return.py
2025-01-24 22:51:22 +05:30
mergify[bot]
c6bc928f50 fix: secure bulk transaction (backport #45386) (#45425)
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
fix: secure bulk transaction (#45386)
2025-01-24 17:19:17 +01:00
ruthra kumar
9518063a81 Merge pull request #45401 from frappe/mergify/bp/version-14-hotfix/pr-45129
fix: Wrong `bank_ac_no` filter + simplify logic in automatch (backport #45129)
2025-01-24 10:43:32 +05:30
mergify[bot]
452b205021 fix: fix creating documents from sales invoice (backport #45346) (#45407)
* fix: fix creating documents from sales invoice (#45346)

Co-authored-by: Meike Nedwidek <nedwidek@kk-software.de>
(cherry picked from commit 1758e125e0)

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

* fix: resolved conflict

---------

Co-authored-by: meike289 <63092915+meike289@users.noreply.github.com>
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2025-01-23 18:19:32 +05:30
marination
35f801feda fix: Merge Conflicts 2025-01-23 13:28:21 +01:00
Shanuka Hewage
69464ab7ff fix: add condition to check if item is delivered by supplier in make_purchase_order_for_default_supplier() (#45370) 2025-01-23 17:57:04 +05:30
marination
b6b453ca5d fix: Wrong bank_ac_no filter + simplify convoluted logic
(cherry picked from commit 8521796811)

# Conflicts:
#	erpnext/accounts/doctype/bank_transaction/auto_match_party.py
2025-01-23 11:13:05 +00:00
mergify[bot]
1622fc8728 fix: set preferred email in Employee via backend controller (backport #45320) (#45378)
fix: set preferred email in Employee via backend controller (#45320)

fix: set preferred email in Employee (backend)

Set "Preferred Email" for Employee via validate. Unset value when
prefered_contact_email is also unset.

(cherry picked from commit 4481ca83ff)

Co-authored-by: gavin <gavin18d@gmail.com>
2025-01-23 11:15:13 +05:30
HENRY Florian
ecdff8f320 fix: heatmap for Customer and Supplier not rendering (#44717) 2025-01-22 12:11:16 +05:30
Frappe PR Bot
a22d3b9895 chore(release): Bumped to Version 14.80.0
# [14.80.0](https://github.com/frappe/erpnext/compare/v14.79.0...v14.80.0) (2025-01-22)

### Bug Fixes

* do not reset picked items ([fe5de30](fe5de30256))
* include pos invoice in modifing key for returned item validation ([431fa22](431fa225e3))
* pos search by term items price (backport [#45006](https://github.com/frappe/erpnext/issues/45006)) ([#45102](https://github.com/frappe/erpnext/issues/45102)) ([524a8d7](524a8d77f7))
* **Project:** re-phrase welcome email ([#45175](https://github.com/frappe/erpnext/issues/45175)) ([77e92b3](77e92b38eb))
* round off tax withholding amount ([#45271](https://github.com/frappe/erpnext/issues/45271)) ([667e659](667e659e3f))
* update query ([49e3865](49e3865265))
* validate linked sales person ([f9420db](f9420db3ca))

### Features

* add difference_posting_date field ([1753509](17535095e2))
* use difference_posting_date for journal entry posting_date ([0fdd681](0fdd6817a6))

### Reverts

* avoid change to translatable string ([20bb151](20bb15167d))
2025-01-22 03:34:40 +00:00
ruthra kumar
ad960c1470 Merge pull request #45358 from frappe/version-14-hotfix
chore: release v14
2025-01-22 09:03:17 +05:30
ruthra kumar
0c7219159a Merge pull request #45359 from frappe/mergify/bp/version-14-hotfix/pr-45242
fix: include pos invoice in modifing key for returned item validation (backport #45242)
2025-01-21 16:58:13 +05:30
venkat102
431fa225e3 fix: include pos invoice in modifing key for returned item validation
(cherry picked from commit 2936139c79)
2025-01-21 11:06:02 +00:00
ruthra kumar
f27e35c8f4 Merge pull request #45351 from frappe/mergify/bp/version-14-hotfix/pr-44808
feat: Added difference_posting_date field in Sales Invoice Advance and Purchase Invoice Advance (backport #44808)
2025-01-21 14:48:27 +05:30
ruthra kumar
5fbffcbd7b Merge pull request #45311 from frappe/mergify/bp/version-14-hotfix/pr-45175
fix(Project): re-phrase welcome email (backport #45175)
2025-01-21 13:56:30 +05:30
ruthra kumar
bb949da334 Merge pull request #45313 from frappe/mergify/bp/version-14-hotfix/pr-45271
fix: round off tax withholding amount (backport #45271)
2025-01-21 13:55:19 +05:30
ruthra kumar
8764a321c7 chore: resolve conflicts 2025-01-21 12:57:10 +05:30
rs-rethik
49e3865265 fix: update query
(cherry picked from commit 854e37c05c)
2025-01-21 06:54:23 +00:00
rs-rethik
33a1da8194 refactor: convert sql query to query builder
(cherry picked from commit 2d58e845e6)
2025-01-21 06:54:23 +00:00
rs-rethik
52309fe0b6 test: add unit test to validate journal entry posting date
(cherry picked from commit c14a2d73bf)

# Conflicts:
#	erpnext/controllers/tests/test_accounts_controller.py
2025-01-21 06:54:23 +00:00
rs-rethik
0fdd6817a6 feat: use difference_posting_date for journal entry posting_date
(cherry picked from commit ff1d040a6e)
2025-01-21 06:54:22 +00:00
rs-rethik
17535095e2 feat: add difference_posting_date field
(cherry picked from commit 225e56cbca)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.json
#	erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py
#	erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.json
#	erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py
2025-01-21 06:54:22 +00:00
ruthra kumar
4d74597f94 Merge pull request #45336 from frappe/mergify/bp/version-14-hotfix/pr-45167
fix: validate linked sales person (backport #45167)
2025-01-20 12:10:39 +05:30
Sudharsanan11
f9420db3ca fix: validate linked sales person
(cherry picked from commit e614f07795)
2025-01-20 06:20:20 +00:00
rohitwaghchaure
8996685f44 Merge pull request #45326 from frappe/mergify/bp/version-14-hotfix/pr-44783
fix: do not reset picked items (backport #44783)
2025-01-19 15:07:00 +05:30
rohitwaghchaure
7046a01921 chore: fix test case 2025-01-19 14:22:52 +05:30
rohitwaghchaure
0b8cf3a369 chore: fix conflicts 2025-01-19 13:52:49 +05:30
Rohit Waghchaure
fe5de30256 fix: do not reset picked items
(cherry picked from commit 34a80bfcd3)

# Conflicts:
#	erpnext/stock/doctype/pick_list/test_pick_list.py
2025-01-18 10:15:22 +00:00
barredterra
20bb15167d revert: avoid change to translatable string 2025-01-17 14:38:27 +01:00
barredterra
1ccf30d97b chore: resolve confilcts 2025-01-17 14:38:03 +01:00
mergify[bot]
524a8d77f7 fix: pos search by term items price (backport #45006) (#45102)
* fix: load price list rate for pos search term

(cherry picked from commit 4b6cae156e)

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

* fix: load search term price with customer default price list

(cherry picked from commit 2beb485d77)

* chore: resolve conflict

---------

Co-authored-by: diptanilsaha <diptanil.dev@gmail.com>
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2025-01-17 17:02:34 +05:30
Lakshit Jain
667e659e3f fix: round off tax withholding amount (#45271)
(cherry picked from commit ada272a29b)
2025-01-17 11:21:09 +00:00
Patrick Eißler
77e92b38eb fix(Project): re-phrase welcome email (#45175)
(cherry picked from commit 8d66142865)

# Conflicts:
#	erpnext/projects/doctype/project/project.py
2025-01-17 11:19:03 +00:00
Frappe PR Bot
ff3425ead1 chore(release): Bumped to Version 14.79.0
# [14.79.0](https://github.com/frappe/erpnext/compare/v14.78.9...v14.79.0) (2025-01-15)

### Bug Fixes

* deduct tds on excess amount if checked ([6a52f79](6a52f79cce))
* do not add ordered items from Quotation to new Sales Order ([d42173b](d42173beb5))
* **Timesheet:** ignore permissions when updating Task and Project (backport [#45168](https://github.com/frappe/erpnext/issues/45168)) ([#45171](https://github.com/frappe/erpnext/issues/45171)) ([49ffecc](49ffeccafa))
* typo ([#45233](https://github.com/frappe/erpnext/issues/45233)) ([6bc210d](6bc210d9f4))

### Features

* validate discount date in payment schedule (backport [#44646](https://github.com/frappe/erpnext/issues/44646)) ([#44726](https://github.com/frappe/erpnext/issues/44726)) ([f4b7fa8](f4b7fa8980))
2025-01-15 12:09:13 +00:00
rohitwaghchaure
d098fd3fc3 Merge pull request #45264 from frappe/version-14-hotfix
chore: release v14
2025-01-15 17:37:57 +05:30
ruthra kumar
a66d475b56 Merge pull request #45253 from frappe/mergify/bp/version-14-hotfix/pr-45001
fix: deduct tds on excess amount if checked (backport #45001)
2025-01-14 10:28:19 +05:30
ljain112
6a52f79cce fix: deduct tds on excess amount if checked
(cherry picked from commit a203e3ffaf)
2025-01-14 04:33:09 +00:00
mergify[bot]
49ffeccafa fix(Timesheet): ignore permissions when updating Task and Project (backport #45168) (#45171)
* fix(Timesheet): ignore permissions when updating Task and Project (#45168)

(cherry picked from commit 9e760e54a5)

# Conflicts:
#	erpnext/projects/doctype/timesheet/timesheet.py

* chore: resolve conflicts

---------

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2025-01-13 12:08:26 +05:30
Nabin Hait
6bc210d9f4 fix: typo (#45233) 2025-01-13 12:04:40 +05:30
mergify[bot]
f4b7fa8980 feat: validate discount date in payment schedule (backport #44646) (#44726)
Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
2025-01-09 18:51:27 +01:00
rohitwaghchaure
c331a4fa84 Merge pull request #45185 from frappe/mergify/bp/version-14-hotfix/pr-45180
fix: do not add ordered items from Quotation to new Sales Order (backport #45180)
2025-01-09 16:27:15 +05:30
Rohit Waghchaure
d42173beb5 fix: do not add ordered items from Quotation to new Sales Order
(cherry picked from commit 2e930eb97b)
2025-01-09 09:09:56 +00:00
Frappe PR Bot
611c1f1ec2 chore(release): Bumped to Version 14.78.9
## [14.78.9](https://github.com/frappe/erpnext/compare/v14.78.8...v14.78.9) (2025-01-08)

### Bug Fixes

* add monthly distributation and write query in qb ([7d1d0c8](7d1d0c8e0c))
* discount resetting on date change ([01d2794](01d2794968)), closes [#44989](https://github.com/frappe/erpnext/issues/44989)
* header_img field schema ([eb55051](eb5505187e))
* Missing company filter breaks `get_account_balance` in Bank Reco ([821cfe2](821cfe2c39))
* Override pre-commit behaviour due to conflicts with CI ([46894a5](46894a5b86))
* **Project:** make status in confirmation dialog translatable ([#45118](https://github.com/frappe/erpnext/issues/45118)) ([07653c5](07653c54f3))
* Returned Qty in Work Order Consumed Materials report ([affa67e](affa67e74d))
* update customer contact details on pos (backport [#45071](https://github.com/frappe/erpnext/issues/45071)) ([#45105](https://github.com/frappe/erpnext/issues/45105)) ([2d63fc9](2d63fc98d0))
2025-01-08 10:27:38 +00:00
ruthra kumar
a05fb916ff Merge pull request #45132 from frappe/version-14-hotfix
chore: release v14
2025-01-08 15:56:16 +05:30
ruthra kumar
b2d35fae10 Merge pull request #45156 from frappe/revert-45152-mergify/bp/version-14-hotfix/pr-45112
Revert "fix: Missing company filter breaks `get_account_balance` in Bank Reco (backport #45112)"
2025-01-08 09:01:37 +05:30
ruthra kumar
8d13ef050e Revert "fix: Missing company filter breaks get_account_balance in Bank Reco (backport #45112)" 2025-01-08 09:00:21 +05:30
ruthra kumar
8ac40f07e3 Merge pull request #45152 from frappe/mergify/bp/version-14-hotfix/pr-45112
fix: Missing company filter breaks `get_account_balance` in Bank Reco (backport #45112)
2025-01-08 08:59:22 +05:30
marination
46894a5b86 fix: Override pre-commit behaviour due to conflicts with CI
(cherry picked from commit d7bf73cffa)
2025-01-08 02:46:51 +00:00
marination
821cfe2c39 fix: Missing company filter breaks get_account_balance in Bank Reco
(cherry picked from commit 8de0fe78ea)
2025-01-08 02:46:51 +00:00
ruthra kumar
b8b76a5b58 Merge pull request #45122 from frappe/mergify/bp/version-14-hotfix/pr-45121
fix: discount resetting on date change (backport #45121)
2025-01-07 11:26:24 +05:30
ruthra kumar
01d2794968 fix: discount resetting on date change
revert #44989

(cherry picked from commit 886281f81a)
2025-01-07 05:51:46 +00:00
ruthra kumar
02cfb589a2 Merge pull request #45108 from frappe/mergify/bp/version-14-hotfix/pr-45107
fix: Returned Qty in Work Order Consumed Materials report (backport #45107)
2025-01-07 10:12:56 +05:30
ruthra kumar
caf5faceda Merge pull request #45119 from frappe/mergify/bp/version-14-hotfix/pr-45118
fix(Project): make status in confirmation dialog translatable (backport #45118)
2025-01-07 10:12:04 +05:30
Raffael Meyer
07653c54f3 fix(Project): make status in confirmation dialog translatable (#45118)
(cherry picked from commit 9eede907f8)
2025-01-06 22:13:47 +00:00
Rohit Waghchaure
affa67e74d fix: Returned Qty in Work Order Consumed Materials report
(cherry picked from commit 30d68a31e0)
2025-01-06 10:37:28 +00:00
mergify[bot]
2d63fc98d0 fix: update customer contact details on pos (backport #45071) (#45105)
fix: update customer contact details on pos (#45071)

* fix: update customer contact details on pos

* refactor: removed console log statement

(cherry picked from commit d79e561248)

Co-authored-by: Diptanil Saha <diptanil@frappe.io>
2025-01-06 14:58:36 +05:30
ruthra kumar
8bb4415f65 Merge pull request #45079 from frappe/mergify/bp/version-14-hotfix/pr-44983
fix: add monthly distributation and write query in qb (backport #44983)
2025-01-06 10:28:45 +05:30
ruthra kumar
90b2ec9aba Merge pull request #42438 from trustedcomputer/version-14-hotfix
fix: header_img field schema (backport payments #83)
2025-01-04 05:20:58 +05:30
ruthra kumar
24ae74ebb3 refactor: store result in variable before enumeration
helps to inspect result while debugging

(cherry picked from commit b60bd17d1d)
2025-01-03 23:48:31 +00:00
Sanket322
7d1d0c8e0c fix: add monthly distributation and write query in qb
(cherry picked from commit 27195c7c96)
2025-01-03 23:48:30 +00:00
Frappe PR Bot
1f39bb9c7a chore(release): Bumped to Version 14.78.8
## [14.78.8](https://github.com/frappe/erpnext/compare/v14.78.7...v14.78.8) (2025-01-03)

### Bug Fixes

* BOM cost update issue ([4977843](49778432ea))
* removed unused code ([9efc1de](9efc1de40e))
* slow stock transactions (backport [#45025](https://github.com/frappe/erpnext/issues/45025)) ([#45026](https://github.com/frappe/erpnext/issues/45026)) ([b7509e3](b7509e326e))
2025-01-03 01:21:42 +00:00
ruthra kumar
9e60f67d25 Merge pull request #45064 from frappe/version-14-hotfix
chore: release v14
2025-01-03 06:50:19 +05:30
ruthra kumar
6a91f9155f Merge pull request #45059 from frappe/mergify/bp/version-14/pr-45056
chore: partial revert #44989 (backport #45056)
2025-01-02 21:04:58 +05:30
ruthra kumar
b3d545f91a Merge pull request #45057 from frappe/mergify/bp/version-14-hotfix/pr-45056
chore: partial revert #44989 (backport #45056)
2025-01-02 21:04:16 +05:30
ruthra kumar
77f612354f chore: partial revert #44989
(cherry picked from commit 63d547fb4a)
2025-01-02 15:29:53 +00:00
ruthra kumar
7b0e19499b chore: partial revert #44989
(cherry picked from commit 63d547fb4a)
2025-01-02 15:27:38 +00:00
rohitwaghchaure
34504a23ec Merge pull request #45041 from frappe/mergify/bp/version-14-hotfix/pr-45039
fix: removed unused code (backport #45039)
2025-01-02 13:32:23 +05:30
rohitwaghchaure
b603adce5e chore: fix conflicts 2025-01-02 12:21:03 +05:30
Rohit Waghchaure
9efc1de40e fix: removed unused code
(cherry picked from commit dc5f2d35ac)

# Conflicts:
#	erpnext/stock/doctype/stock_entry/stock_entry.py
2025-01-02 06:47:37 +00:00
rohitwaghchaure
ff622ef552 Merge pull request #45037 from frappe/mergify/bp/version-14-hotfix/pr-45036
fix: Auto BOM cost update issue (backport #45036)
2025-01-02 12:15:37 +05:30
Rohit Waghchaure
49778432ea fix: BOM cost update issue
(cherry picked from commit 28ea3ddd51)
2025-01-02 04:55:15 +00:00
Frappe PR Bot
0e8a04f2cc chore(release): Bumped to Version 14.78.7
## [14.78.7](https://github.com/frappe/erpnext/compare/v14.78.6...v14.78.7) (2025-01-01)

### Bug Fixes

* slow stock transactions (backport [#45025](https://github.com/frappe/erpnext/issues/45025)) ([#45026](https://github.com/frappe/erpnext/issues/45026)) ([a85a103](a85a103bad))
2025-01-01 10:48:12 +00:00
rohitwaghchaure
2a40845f65 Merge pull request #45029 from frappe/mergify/bp/version-14/pr-45026
fix: slow stock transactions (backport #45025) (backport #45026)
2025-01-01 16:16:46 +05:30
mergify[bot]
a85a103bad fix: slow stock transactions (backport #45025) (#45026)
* fix: slow stock transactions (#45025)

(cherry picked from commit e92af10f14)

# Conflicts:
#	erpnext/stock/stock_ledger.py

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
(cherry picked from commit b7509e326e)
2025-01-01 10:00:11 +00:00
mergify[bot]
b7509e326e fix: slow stock transactions (backport #45025) (#45026)
* fix: slow stock transactions (#45025)

(cherry picked from commit e92af10f14)

# Conflicts:
#	erpnext/stock/stock_ledger.py

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-01-01 15:29:06 +05:30
Frappe PR Bot
76ea858e72 chore(release): Bumped to Version 14.78.6
## [14.78.6](https://github.com/frappe/erpnext/compare/v14.78.5...v14.78.6) (2025-01-01)

### Bug Fixes

* apply apply_pricing_rule date change ([cca507f](cca507f0bd))
* clear payment schedule in purchase invoice for is_paid ([cdd3763](cdd3763a8b))
* duplicate validate for closing stock balance (backport [#45015](https://github.com/frappe/erpnext/issues/45015)) ([#45021](https://github.com/frappe/erpnext/issues/45021)) ([e2b6615](e2b6615e72))
* failing tests fixed ([498abf7](498abf7c83))
* get item tax template based on posting date ([56d0686](56d06861d0))
* load customer default price list in pos during item selection (backport [#44991](https://github.com/frappe/erpnext/issues/44991)) ([#44992](https://github.com/frappe/erpnext/issues/44992)) ([0f687f1](0f687f1db7))
* pos payment using non-default mode of payment (backport [#44920](https://github.com/frappe/erpnext/issues/44920)) ([#44970](https://github.com/frappe/erpnext/issues/44970)) ([a0063b3](a0063b31c2)), closes [#41108](https://github.com/frappe/erpnext/issues/41108)
* refactor query in get_total_allocated_amount in bank_transaction ([cc0a478](cc0a478559))
* resolve conflicts ([443a0b8](443a0b81f9))
* set paid amount in party currency in bank reco payment entry ([43a40b1](43a40b1e66))
* Show order tax amount in customer currency on the portal (backport [#44915](https://github.com/frappe/erpnext/issues/44915)) ([#44922](https://github.com/frappe/erpnext/issues/44922)) ([78e0799](78e0799a06))
* update item_tax_rate in backend ([cf980a1](cf980a1304))
* update payment amount for partial pos return (backport [#44065](https://github.com/frappe/erpnext/issues/44065)) ([#44961](https://github.com/frappe/erpnext/issues/44961)) ([1da4712](1da4712919))
2025-01-01 08:56:51 +00:00
ruthra kumar
97487eb6e1 Merge pull request #45004 from frappe/version-14-hotfix
chore: release v14
2025-01-01 14:25:31 +05:30
ruthra kumar
97612ebbf7 Merge pull request #45007 from frappe/mergify/bp/version-14-hotfix/pr-44884
fix: update item_tax_rate in backend (backport #44884)
2025-01-01 13:48:40 +05:30
ruthra kumar
02a0bf35ea chore: remove tests for 'Tax Detail' report 2025-01-01 13:08:08 +05:30
ruthra kumar
0d17cf115a Merge pull request #45022 from frappe/mergify/bp/version-14-hotfix/pr-44989
fix: apply apply_pricing_rule on date change (backport #44989)
2025-01-01 10:18:10 +05:30
DHINESH00
cca507f0bd fix: apply apply_pricing_rule date change
(cherry picked from commit 2cbab9b875)
2025-01-01 04:42:47 +00:00
mergify[bot]
e2b6615e72 fix: duplicate validate for closing stock balance (backport #45015) (#45021)
fix: duplicate validate for closing stock balance (#45015)

(cherry picked from commit 8d650e56ba)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2025-01-01 09:32:51 +05:30
ruthra kumar
fd2a1a0ba0 refactor: use correct method parameters 2024-12-31 17:10:30 +05:30
ruthra kumar
514835b5dd Merge pull request #45009 from frappe/mergify/bp/version-14-hotfix/pr-44903
fix: set paid amount in party currency in bank reco payment entry (backport #44903)
2024-12-31 16:16:06 +05:30
ruthra kumar
bcd3b36821 chore: resolve conflict 2024-12-31 15:55:03 +05:30
ljain112
43a40b1e66 fix: set paid amount in party currency in bank reco payment entry
(cherry picked from commit 70b1077286)
2024-12-31 10:23:34 +00:00
ljain112
cf980a1304 fix: update item_tax_rate in backend
(cherry picked from commit de54c0b41f)

# Conflicts:
#	erpnext/controllers/taxes_and_totals.py
2024-12-31 10:21:30 +00:00
mergify[bot]
0f687f1db7 fix: load customer default price list in pos during item selection (backport #44991) (#44992)
fix: load customer default price list in pos during item selection (#44991)

fix: load customer default price list in pos
(cherry picked from commit d1ae0d784e)

Co-authored-by: Diptanil Saha <diptanil.dev@gmail.com>
2024-12-31 12:52:36 +05:30
mergify[bot]
a0063b31c2 fix: pos payment using non-default mode of payment (backport #44920) (#44970)
fix: pos payment using non-default mode of payment (#44920)

* fix: pos payment using non-default mode of payment (#41108)

* fix: included css syntax

* refactor: created a function to sanitize the class name

* refactor: reusing method to sanitize class name

* refactor: function rename

(cherry picked from commit 98cbb7e900)

Co-authored-by: Diptanil Saha <diptanil.dev@gmail.com>
2024-12-30 13:57:08 +05:30
ruthra kumar
47e2699315 Merge pull request #44965 from frappe/mergify/bp/version-14-hotfix/pr-44921
fix: get item tax template based on posting date (backport #44921)
2024-12-30 13:09:06 +05:30
ruthra kumar
899acc3601 Merge pull request #44962 from vishakhdesai/backport-v14-#44787
fix: refactor query in get_total_allocated_amount in bank_transaction (backport #44787)
2024-12-30 13:08:38 +05:30
ljain112
56d06861d0 fix: get item tax template based on posting date
(cherry picked from commit 976e35d547)
2024-12-30 12:33:40 +05:30
ruthra kumar
45bf65f37c Merge pull request #44959 from frappe/mergify/bp/version-14-hotfix/pr-44958
refactor(test): make manufacturing test idempotent (backport #44958)
2024-12-30 12:28:08 +05:30
vishakhdesai
443a0b81f9 fix: resolve conflicts 2024-12-30 12:27:14 +05:30
ruthra kumar
d348d587e2 refactor(test): make manufacturing test idempotent
(cherry picked from commit f3be246df3)
2024-12-30 12:04:36 +05:30
mergify[bot]
1da4712919 fix: update payment amount for partial pos return (backport #44065) (#44961)
fix: update payment amount for partial pos return

(cherry picked from commit 53ef6336b6)

Co-authored-by: Kavin <78342682+kavin0411@users.noreply.github.com>
2024-12-30 11:54:14 +05:30
ruthra kumar
3dcb7c1380 Merge pull request #44934 from frappe/mergify/bp/version-14-hotfix/pr-44892
fix: clear payment schedule in purchase invoice for is_paid (backport #44892)
2024-12-27 14:44:51 +05:30
ruthra kumar
ce7dc5ecb3 chore: resolve conflicts 2024-12-27 13:51:11 +05:30
ruthra kumar
d5f30202b4 refactor: early return is always better
validate_advance_entries() has a heavy IO bound operation. Early
return on unwanted cases is always better.

(cherry picked from commit 0589fa7f3e)

# Conflicts:
#	erpnext/controllers/accounts_controller.py
2024-12-27 07:54:39 +00:00
Sanket322
cdd3763a8b fix: clear payment schedule in purchase invoice for is_paid
(cherry picked from commit e1fc239f3d)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
#	erpnext/controllers/accounts_controller.py
2024-12-27 07:54:38 +00:00
mergify[bot]
78e0799a06 fix: Show order tax amount in customer currency on the portal (backport #44915) (#44922)
* fix: Show order tax amount in customer currency on the portal (#44915)

(cherry picked from commit b998933ef0)

# Conflicts:
#	erpnext/templates/includes/order/order_taxes.html

* fix: resolved conflict

---------

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2024-12-27 11:25:59 +05:30
Frappe PR Bot
27b7de4854 chore(release): Bumped to Version 14.78.5
## [14.78.5](https://github.com/frappe/erpnext/compare/v14.78.4...v14.78.5) (2024-12-25)

### Bug Fixes

* 'str' object has no attribute 'get_sql' ([510e3ce](510e3cebc9))
* added docs.frappe.io in documentation_url ([#44776](https://github.com/frappe/erpnext/issues/44776)) ([82a3fd1](82a3fd13f2))
* buying rate for service item in gross profit report ([7fa3a78](7fa3a789b1))
* closing stock balance permissions (backport [#44791](https://github.com/frappe/erpnext/issues/44791)) ([#44792](https://github.com/frappe/erpnext/issues/44792)) ([4cb27b9](4cb27b97b4))
* correct tds rate with lower deduction certificate ([d55fe7d](d55fe7d33f))
* do not set cost_center update_voucher_balance as it is set in init_voucher_balance ([97d5d18](97d5d18041))
* fetch tax withholding category from the voucher ([1093c22](1093c227f1))
* permissions for marking Quotation as lost ([0179358](0179358f07))
* Remove typo ([422ada2](422ada2726))
* show profit and loss after period closing ([1a089da](1a089da51a))
* slow posting datetime update (backport [#44799](https://github.com/frappe/erpnext/issues/44799)) ([#44804](https://github.com/frappe/erpnext/issues/44804)) ([d2ede71](d2ede713e4))
* update correct cost center in Accounts Receivable Report ([197b13e](197b13eb87))
* use utility method to generate url ([d042330](d042330c30))
* **ux:** purchase invoice link in error message ([#44797](https://github.com/frappe/erpnext/issues/44797)) ([c9d43f4](c9d43f4c88))
* Warehouse wise Stock Value chart roles (backport [#44865](https://github.com/frappe/erpnext/issues/44865)) ([#44866](https://github.com/frappe/erpnext/issues/44866)) ([177ca6f](177ca6f431))
2024-12-25 03:34:28 +00:00
ruthra kumar
1b5384f8d4 Merge pull request #44886 from frappe/version-14-hotfix
chore: release v14
2024-12-25 09:03:10 +05:30
vishakhdesai
498abf7c83 fix: failing tests fixed
(cherry picked from commit 2ce07865d3)

# Conflicts:
#	erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py
2024-12-24 12:23:59 +00:00
vishakhdesai
cc0a478559 fix: refactor query in get_total_allocated_amount in bank_transaction
(cherry picked from commit 6b847cdb62)

# Conflicts:
#	erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py
#	erpnext/accounts/doctype/bank_transaction/bank_transaction.py
2024-12-24 12:23:59 +00:00
ruthra kumar
07947eb3f4 Merge pull request #44893 from frappe/mergify/bp/version-14-hotfix/pr-44878
fix: show profit and loss after period closing (backport #44878)
2024-12-24 17:52:45 +05:30
venkat102
1a089da51a fix: show profit and loss after period closing
(cherry picked from commit dc5cd93bf0)
2024-12-24 11:33:39 +00:00
ruthra kumar
67c9872146 Merge pull request #44881 from frappe/mergify/bp/version-14-hotfix/pr-44794
fix: correct tds rate with lower deduction certificate (backport #44794)
2024-12-24 14:37:27 +05:30
ljain112
d55fe7d33f fix: correct tds rate with lower deduction certificate
(cherry picked from commit cb9c12d495)
2024-12-24 08:15:49 +00:00
mergify[bot]
177ca6f431 fix: Warehouse wise Stock Value chart roles (backport #44865) (#44866)
fix: Warehouse wise Stock Value chart roles (#44865)

(cherry picked from commit 7d41805d0e)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-12-23 22:30:45 +05:30
ruthra kumar
8915c804c1 Merge pull request #44848 from frappe/mergify/bp/version-14-hotfix/pr-44797
fix(ux): purchase invoice link in error message (backport #44797)
2024-12-23 15:17:58 +05:30
ruthra kumar
d506589d10 Merge pull request #44846 from frappe/mergify/bp/version-14-hotfix/pr-44738
fix: fetch tax withholding category from the voucher (backport #44738)
2024-12-23 15:03:12 +05:30
ruthra kumar
7ef15ec082 Merge pull request #44842 from frappe/mergify/bp/version-14-hotfix/pr-44813
fix: update correct cost center in Accounts Receivable Report (backport #44813)
2024-12-23 14:55:56 +05:30
Nijith anil
c9d43f4c88 fix(ux): purchase invoice link in error message (#44797)
* fix(ux): purchase invoice link in error message

* chore: fix linter

---------

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
(cherry picked from commit 6f00a87a9c)
2024-12-23 09:19:26 +00:00
venkat102
1093c227f1 fix: fetch tax withholding category from the voucher
(cherry picked from commit 09e64594db)
2024-12-23 09:06:02 +00:00
venkat102
d0c60343cd chore: use get function
(cherry picked from commit 1663c7983e)
2024-12-23 09:06:01 +00:00
vishakhdesai
97d5d18041 fix: do not set cost_center update_voucher_balance as it is set in init_voucher_balance
(cherry picked from commit 3b36ce560c)
2024-12-23 08:51:37 +00:00
vishakhdesai
197b13eb87 fix: update correct cost center in Accounts Receivable Report
(cherry picked from commit 09776e9a5a)
2024-12-23 08:51:37 +00:00
ruthra kumar
0986434871 Merge pull request #44837 from frappe/mergify/bp/version-14-hotfix/pr-44751
fix: buying rate for service item in gross profit report (backport #44751)
2024-12-23 12:08:12 +05:30
ljain112
7fa3a789b1 fix: buying rate for service item in gross profit report
(cherry picked from commit 8d6e79a16f)
2024-12-23 06:16:21 +00:00
ruthra kumar
647f039598 Merge pull request #44833 from frappe/mergify/bp/version-14-hotfix/pr-44644
fix: permissions for marking Quotation as lost (backport #44644)
2024-12-23 11:41:55 +05:30
ruthra kumar
00baa6a07f Merge pull request #44829 from frappe/mergify/bp/version-14-hotfix/pr-44826
fix: Remove typo from `Bank Account` on trash (backport #44826)
2024-12-23 11:26:29 +05:30
ruthra kumar
67ba639ae1 chore: resolve conflicts 2024-12-23 11:16:04 +05:30
barredterra
0179358f07 fix: permissions for marking Quotation as lost
(cherry picked from commit 4d5241486f)

# Conflicts:
#	erpnext/crm/doctype/competitor/competitor.json
#	erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.json
2024-12-23 05:41:57 +00:00
mergify[bot]
4cb27b97b4 fix: closing stock balance permissions (backport #44791) (#44792)
* fix: closing stock balance permissions (#44791)

(cherry picked from commit 3662a6a41d)

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

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-12-23 10:54:34 +05:30
Abdeali Chharchhoda
422ada2726 fix: Remove typo
(cherry picked from commit ba28f6bf73)
2024-12-23 04:52:05 +00:00
mergify[bot]
d2ede713e4 fix: slow posting datetime update (backport #44799) (#44804)
fix: slow posting datetime update

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
2024-12-20 13:37:00 +05:30
ruthra kumar
e48022f2fe Merge pull request #44777 from frappe/mergify/bp/version-14-hotfix/pr-44776
fix: added docs.frappe.io in documentation_url (backport #44776)
2024-12-18 17:53:22 +05:30
Nabin Hait
82a3fd13f2 fix: added docs.frappe.io in documentation_url (#44776)
(cherry picked from commit febdf4c61e)
2024-12-18 11:59:32 +00:00
Frappe PR Bot
561fe5a171 chore(release): Bumped to Version 14.78.4
## [14.78.4](https://github.com/frappe/erpnext/compare/v14.78.3...v14.78.4) (2024-12-18)

### Bug Fixes

* 'str' object has no attribute 'get_sql' ([bd20ff5](bd20ff581b))
2024-12-18 09:07:38 +00:00
ruthra kumar
f8f2c39ed5 Merge pull request #44768 from frappe/mergify/bp/version-14/pr-44765
fix: 'str' object has no attribute 'get_sql' (backport #44765)
2024-12-18 14:36:18 +05:30
ruthra kumar
becd64fccb Merge pull request #44769 from frappe/mergify/bp/version-14-hotfix/pr-44765
fix: 'str' object has no attribute 'get_sql' (backport #44765)
2024-12-18 14:34:21 +05:30
ljain112
510e3cebc9 fix: 'str' object has no attribute 'get_sql'
(cherry picked from commit 9a43acb65c)
2024-12-18 08:43:18 +00:00
ljain112
bd20ff581b fix: 'str' object has no attribute 'get_sql'
(cherry picked from commit 9a43acb65c)
2024-12-18 08:43:15 +00:00
ruthra kumar
b4faee24da Merge pull request #44759 from frappe/mergify/bp/version-14-hotfix/pr-44758
fix: use utility method to generate url (backport #44758)
2024-12-18 11:17:18 +05:30
ruthra kumar
d042330c30 fix: use utility method to generate url
(cherry picked from commit b970eb8b15)
2024-12-18 05:33:03 +00:00
Frappe PR Bot
d241862f14 chore(release): Bumped to Version 14.78.3
## [14.78.3](https://github.com/frappe/erpnext/compare/v14.78.2...v14.78.3) (2024-12-18)

### Bug Fixes

* allow all dispatch address for drop ship invoice ([0688c0a](0688c0ab6b))
* better indicator base amount for Tax Witholding in Journal Entry ([4a261b5](4a261b5cef))
* broken CI ([c86174d](c86174d0f2))
* incorrect status of the purchase receipt ([#44689](https://github.com/frappe/erpnext/issues/44689)) ([4b4d5df](4b4d5dfa63))
* purchase return entry issue (backport [#44721](https://github.com/frappe/erpnext/issues/44721)) ([#44736](https://github.com/frappe/erpnext/issues/44736)) ([744f345](744f3457de))
* remove invalid filter in Account Receivable report ([b571c7a](b571c7af87))
* set company bank account if default account not set in mode of payment ([2d12f2c](2d12f2cebd))
* Stock Entry uses incorrect company when generated from Pick List ([#44679](https://github.com/frappe/erpnext/issues/44679)) ([00898be](00898be8e4))
* update discount when pricing rule is changed ([0a7832d](0a7832d8d3))
* User permissions in financial statements ([8a9c457](8a9c457d37))
* using query.walk() for escaping ([3a7e335](3a7e335d4b))
* Wrong allocated_amount for sales_team in gross_profit report ([#42989](https://github.com/frappe/erpnext/issues/42989)) ([d83cc57](d83cc57e58))
2024-12-18 05:01:40 +00:00
ruthra kumar
8e34e20b27 Merge pull request #44740 from frappe/version-14-hotfix
chore: release v14
2024-12-18 10:30:20 +05:30
ruthra kumar
caea52c280 Merge pull request #44752 from frappe/mergify/bp/version-14-hotfix/pr-44695
fix: User permissions in financial statements (backport #44695)
2024-12-17 21:18:53 +05:30
ruthra kumar
4473b74e1b Merge pull request #44754 from frappe/mergify/bp/version-14-hotfix/pr-44708
fix: update discount when pricing rule is changed (backport #44708)
2024-12-17 21:10:41 +05:30
venkat102
0a7832d8d3 fix: update discount when pricing rule is changed
(cherry picked from commit 8338d1d5b4)
2024-12-17 15:13:03 +00:00
ljain112
3a7e335d4b fix: using query.walk() for escaping
(cherry picked from commit 5ea131c763)
2024-12-17 15:09:08 +00:00
ljain112
8a9c457d37 fix: User permissions in financial statements
(cherry picked from commit a626372d66)
2024-12-17 15:09:08 +00:00
ruthra kumar
13be763105 Merge pull request #44749 from ruthra-kumar/backport_v14_pr_44581
fix: allow all dispatch address for drop ship invoice (backport #44581)
2024-12-17 20:39:05 +05:30
ruthra kumar
0688c0ab6b fix: allow all dispatch address for drop ship invoice 2024-12-17 20:34:10 +05:30
ruthra kumar
7e00e55d18 Merge pull request #44734 from frappe/mergify/bp/version-14-hotfix/pr-44660
fix: better indicator base amount for Tax Witholding in Journal Entry (backport #44660)
2024-12-17 17:45:43 +05:30
ruthra kumar
ecca59c8a8 Merge pull request #44747 from frappe/mergify/bp/version-14-hotfix/pr-44685
fix: set company bank account if default account not set in mode of p… (backport #44685)
2024-12-17 17:29:15 +05:30
venkat102
2d12f2cebd fix: set company bank account if default account not set in mode of payment
(cherry picked from commit 91c7e3d5f3)
2024-12-17 11:50:04 +00:00
ruthra kumar
c86174d0f2 fix: broken CI
- pin ubuntu-22.04
2024-12-17 16:28:15 +05:30
mergify[bot]
744f3457de fix: purchase return entry issue (backport #44721) (#44736)
fix: purchase return entry issue (#44721)

(cherry picked from commit 1f5d7072e7)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-12-17 14:48:59 +05:30
Smit Vora
4a261b5cef fix: better indicator base amount for Tax Witholding in Journal Entry
(cherry picked from commit 56a0a0db18)
2024-12-17 06:20:32 +00:00
ruthra kumar
bad744194f Merge pull request #44699 from ruthra-kumar/backport_v14_pr_44676
fix: remove invalid filter in Account Receivable report (backport #44676)
2024-12-13 17:53:28 +05:30
ljain112
b571c7af87 fix: remove invalid filter in Account Receivable report 2024-12-13 17:29:17 +05:30
rohitwaghchaure
4b4d5dfa63 fix: incorrect status of the purchase receipt (#44689) 2024-12-13 12:44:03 +05:30
ruthra kumar
4c8b4419b6 Merge pull request #44687 from ruthra-kumar/backport_v14_pr_42989
fix: Wrong allocated_amount for sales_team in gross_profit report (backport #43989)
2024-12-13 12:39:28 +05:30
Diógenes Souza
d83cc57e58 fix: Wrong allocated_amount for sales_team in gross_profit report (#42989)
* fix: Wrong allocated_amount for sales_team in gross_profit report

* style: Removes whitespaces

---------

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2024-12-13 12:01:04 +05:30
Nicolas Pereira
00898be8e4 fix: Stock Entry uses incorrect company when generated from Pick List (#44679) 2024-12-13 10:21:30 +05:30
Frappe PR Bot
225d4ccb63 chore(release): Bumped to Version 14.78.2
## [14.78.2](https://github.com/frappe/erpnext/compare/v14.78.1...v14.78.2) (2024-12-12)

### Bug Fixes

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

(cherry picked from commit 9ad79625e0)

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

* chore: fix conflicts

---------

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

(cherry picked from commit 72256565bb)

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

(cherry picked from commit 1571dff3ef)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-12-05 16:01:49 +05:30
Khushi Rawat
68fe3b4165 Merge pull request #44543 from frappe/mergify/bp/version-14-hotfix/pr-44537
fix: add title for translation in  asset.js (backport #44537)
2024-12-05 15:42:11 +05:30
mahsem
aed90f73d7 fix: add title for translation in asset.js
(cherry picked from commit 61439132a4)
2024-12-05 09:47:58 +00:00
mergify[bot]
ecc756bd52 fix: incorrect stock UOM for BOM raw materials (backport #44528) (#44530)
fix: incorrect stock UOM for BOM raw materials (#44528)

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

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

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

* change_amount_pos_payment.js

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

(cherry picked from commit 353610ce61)

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

(cherry picked from commit 4001166ecc)

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

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-12-04 19:03:09 +05:30
trustedcomputer
eb5505187e fix: header_img field schema 2024-07-22 12:35:46 -07:00
304 changed files with 7980 additions and 5094 deletions

View File

@@ -10,6 +10,7 @@ WEBSITE_REPOS = [
DOCUMENTATION_DOMAINS = [
"docs.erpnext.com",
"docs.frappe.io",
"frappeframework.com",
]

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

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

View File

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

View File

@@ -9,15 +9,16 @@ jobs:
name: linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: pip
- name: Install and Run Pre-commit
uses: pre-commit/action@v2.0.3
uses: pre-commit/action@v3.0.0
- name: Download Semgrep rules
run: git clone --depth 1 https://github.com/frappe/semgrep-rules.git frappe-semgrep-rules

View File

@@ -16,7 +16,7 @@ concurrency:
jobs:
test:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 60
name: Patch Test
@@ -59,7 +59,7 @@ jobs:
run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml') }}
@@ -68,7 +68,7 @@ jobs:
${{ runner.os }}-
- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
@@ -83,7 +83,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}

View File

@@ -79,7 +79,7 @@ jobs:
run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml') }}
@@ -88,7 +88,7 @@ jobs:
${{ runner.os }}-
- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
@@ -103,7 +103,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}

View File

@@ -66,7 +66,7 @@ jobs:
run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml') }}
@@ -75,7 +75,7 @@ jobs:
${{ runner.os }}-
- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
@@ -90,7 +90,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}

View File

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

View File

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

View File

@@ -4,7 +4,7 @@
import frappe
from frappe import _, throw
from frappe.utils import cint, cstr
from frappe.utils import add_to_date, cint, cstr, pretty_date
from frappe.utils.nestedset import NestedSet, get_ancestors_of, get_descendants_of
import erpnext
@@ -400,6 +400,7 @@ def validate_account_number(name, account_number, company):
@frappe.whitelist()
def update_account_number(name, account_name, account_number=None, from_descendant=False):
_ensure_idle_system()
account = frappe.db.get_value("Account", name, "company", as_dict=True)
if not account:
return
@@ -420,7 +421,7 @@ def update_account_number(name, account_name, account_number=None, from_descenda
"name",
)
if old_name:
if old_name and not from_descendant:
# same account in parent company exists
allow_child_account_creation = _("Allow Account Creation Against Child Company")
@@ -461,6 +462,7 @@ def update_account_number(name, account_name, account_number=None, from_descenda
@frappe.whitelist()
def merge_account(old, new):
_ensure_idle_system()
# Validate properties before merging
new_account = frappe.get_cached_doc("Account", new)
old_account = frappe.get_cached_doc("Account", old)
@@ -514,3 +516,27 @@ def sync_update_account_number_in_child(
for d in frappe.db.get_values("Account", filters=filters, fieldname=["company", "name"], as_dict=True):
update_account_number(d["name"], account_name, account_number, from_descendant=True)
def _ensure_idle_system():
# Don't allow renaming if accounting entries are actively being updated, there are two main reasons:
# 1. Correctness: It's next to impossible to ensure that renamed account is not being used *right now*.
# 2. Performance: Renaming requires locking out many tables entirely and severely degrades performance.
if frappe.flags.in_test:
return
try:
# We also lock inserts to GL entry table with for_update here.
last_gl_update = frappe.db.get_value("GL Entry", {}, "modified", for_update=True, wait=False)
except frappe.QueryTimeoutError:
# wait=False fails immediately if there's an active transaction.
last_gl_update = add_to_date(None, seconds=-1)
if last_gl_update > add_to_date(None, minutes=-5):
frappe.throw(
_(
"Last GL Entry update was done {}. This operation is not allowed while system is actively being used. Please wait for 5 minutes before retrying."
).format(pretty_date(last_gl_update)),
title=_("System In Use"),
)

View File

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

View File

@@ -31,7 +31,8 @@
"label": "Reference Document Type",
"options": "DocType",
"read_only_depends_on": "eval:!doc.__islocal",
"reqd": 1
"reqd": 1,
"search_index": 1
},
{
"default": "0",

View File

@@ -25,6 +25,7 @@ class AccountingDimension(Document):
"Accounting Dimension Detail",
"Company",
"Account",
"Finance Book",
):
msg = _("Not allowed to create accounting dimension for {0}").format(self.document_type)
frappe.throw(msg)

View File

@@ -3,4 +3,14 @@
frappe.ui.form.on("Accounts Settings", {
refresh: function (frm) {},
drop_ar_procedures: function (frm) {
frm.call({
doc: frm.doc,
method: "drop_ar_sql_procedures",
callback: function (r) {
frappe.show_alert(__("Procedures dropped"), 5);
},
});
},
});

View File

@@ -44,6 +44,7 @@
"section_break_jpd0",
"auto_reconcile_payments",
"stale_days",
"exchange_gain_loss_posting_date",
"invoicing_settings_tab",
"accounts_transactions_settings_section",
"over_billing_allowance",
@@ -73,7 +74,13 @@
"remarks_section",
"general_ledger_remarks_length",
"column_break_lvjk",
"receivable_payable_remarks_length"
"receivable_payable_remarks_length",
"accounts_receivable_payable_tuning_section",
"receivable_payable_fetch_method",
"column_break_ntmi",
"drop_ar_procedures",
"legacy_section",
"ignore_is_opening_check_for_reporting"
],
"fields": [
{
@@ -383,7 +390,7 @@
{
"fieldname": "section_break_jpd0",
"fieldtype": "Section Break",
"label": "Payment Reconciliations"
"label": "Payment Reconciliation Settings"
},
{
"default": "0",
@@ -462,6 +469,49 @@
"fieldname": "remarks_section",
"fieldtype": "Section Break",
"label": "Remarks Column Length"
},
{
"default": "Payment",
"description": "Only applies for Normal Payments",
"fieldname": "exchange_gain_loss_posting_date",
"fieldtype": "Select",
"label": "Posting Date Inheritance for Exchange Gain / Loss",
"options": "Invoice\nPayment\nReconciliation Date"
},
{
"default": "0",
"description": "Ignores legacy Is Opening field in GL Entry that allows adding opening balance post the system is in use while generating reports",
"fieldname": "ignore_is_opening_check_for_reporting",
"fieldtype": "Check",
"label": "Ignore Is Opening check for reporting"
},
{
"default": "Buffered Cursor",
"fieldname": "receivable_payable_fetch_method",
"fieldtype": "Select",
"label": "Data Fetch Method",
"options": "Buffered Cursor\nUnBuffered Cursor\nRaw SQL"
},
{
"fieldname": "accounts_receivable_payable_tuning_section",
"fieldtype": "Section Break",
"label": "Accounts Receivable / Payable Tuning"
},
{
"fieldname": "legacy_section",
"fieldtype": "Section Break",
"label": "Legacy Fields"
},
{
"fieldname": "column_break_ntmi",
"fieldtype": "Column Break"
},
{
"depends_on": "eval:doc.receivable_payable_fetch_method == \"Raw SQL\"",
"description": "Drops existing SQL Procedures and Function setup by Accounts Receivable report",
"fieldname": "drop_ar_procedures",
"fieldtype": "Button",
"label": "Drop Procedures"
}
],
"icon": "icon-cog",
@@ -469,7 +519,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2024-01-22 12:10:10.151819",
"modified": "2025-05-05 12:29:38.302027",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",

View File

@@ -65,3 +65,11 @@ class AccountsSettings(Document):
def validate_pending_reposts(self):
if self.acc_frozen_upto:
check_pending_reposting(self.acc_frozen_upto)
@frappe.whitelist()
def drop_ar_sql_procedures(self):
from erpnext.accounts.report.accounts_receivable.accounts_receivable import InitSQLProceduresForAR
frappe.db.sql(f"drop function if exists {InitSQLProceduresForAR.genkey_function_name}")
frappe.db.sql(f"drop procedure if exists {InitSQLProceduresForAR.init_procedure_name}")
frappe.db.sql(f"drop procedure if exists {InitSQLProceduresForAR.allocate_procedure_name}")

View File

@@ -21,7 +21,7 @@ class BankAccount(Document):
self.name = self.account_name + " - " + self.bank
def on_trash(self):
delete_contact_and_address("BankAccount", self.name)
delete_contact_and_address("Bank Account", self.name)
def validate(self):
self.validate_company()

View File

@@ -46,9 +46,6 @@ class BankClearance(Document):
as_dict=1,
)
if self.bank_account:
condition += "and bank_account = %(bank_account)s"
payment_entries = frappe.db.sql(
f"""
select
@@ -70,7 +67,6 @@ class BankClearance(Document):
"account": self.account,
"from": self.from_date,
"to": self.to_date,
"bank_account": self.bank_account,
},
as_dict=1,
)
@@ -93,7 +89,7 @@ class BankClearance(Document):
.where(loan_disbursement.docstatus == 1)
.where(loan_disbursement.disbursement_date >= self.from_date)
.where(loan_disbursement.disbursement_date <= self.to_date)
.where(loan_disbursement.disbursement_account.isin([self.bank_account, self.account]))
.where(loan_disbursement.disbursement_account == self.account)
.orderby(loan_disbursement.disbursement_date)
.orderby(loan_disbursement.name, order=frappe.qb.desc)
)
@@ -121,7 +117,7 @@ class BankClearance(Document):
.where(loan_repayment.docstatus == 1)
.where(loan_repayment.posting_date >= self.from_date)
.where(loan_repayment.posting_date <= self.to_date)
.where(loan_repayment.payment_account.isin([self.bank_account, self.account]))
.where(loan_repayment.payment_account == self.account)
)
if not self.include_reconciled_entries:

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: {

View File

@@ -19,10 +19,15 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
},
onload: function (frm) {
if (!frm.doc.company) {
frm.set_value("company", frappe.defaults.get_default("company"));
}
// Set default filter dates
let today = frappe.datetime.get_today();
frm.doc.bank_statement_from_date = frappe.datetime.add_months(today, -1);
frm.doc.bank_statement_to_date = today;
frm.trigger("bank_account");
},
@@ -94,7 +99,7 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
make_reconciliation_tool(frm) {
frm.get_field("reconciliation_tool_cards").$wrapper.empty();
if (frm.doc.bank_account && frm.doc.bank_statement_to_date) {
if (frm.doc.company && frm.doc.bank_account && frm.doc.bank_statement_to_date) {
frm.trigger("get_cleared_balance").then(() => {
if (
frm.doc.bank_account &&
@@ -110,7 +115,7 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
},
get_account_opening_balance(frm) {
if (frm.doc.bank_account && frm.doc.bank_statement_from_date) {
if (frm.doc.company && frm.doc.bank_account && frm.doc.bank_statement_from_date) {
frappe.call({
method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_account_balance",
args: {
@@ -125,7 +130,7 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
},
get_cleared_balance(frm) {
if (frm.doc.bank_account && frm.doc.bank_statement_to_date) {
if (frm.doc.company && frm.doc.bank_account && frm.doc.bank_statement_to_date) {
return frappe.call({
method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_account_balance",
args: {

View File

@@ -12,6 +12,7 @@ from frappe.utils import cint, flt
from erpnext import get_default_cost_center
from erpnext.accounts.doctype.bank_transaction.bank_transaction import get_total_allocated_amount
from erpnext.accounts.party import get_party_account
from erpnext.accounts.report.bank_reconciliation_statement.bank_reconciliation_statement import (
get_amounts_not_reflected_in_system,
get_entries,
@@ -284,54 +285,56 @@ def create_payment_entry_bts(
bank_transaction = frappe.db.get_values(
"Bank Transaction",
bank_transaction_name,
fieldname=["name", "unallocated_amount", "deposit", "bank_account"],
fieldname=["name", "unallocated_amount", "deposit", "bank_account", "currency"],
as_dict=True,
)[0]
paid_amount = bank_transaction.unallocated_amount
payment_type = "Receive" if bank_transaction.deposit > 0.0 else "Pay"
company_account = frappe.get_value("Bank Account", bank_transaction.bank_account, "account")
company = frappe.get_value("Account", company_account, "company")
payment_entry_dict = {
"company": company,
"payment_type": payment_type,
"reference_no": reference_number,
"reference_date": reference_date,
"party_type": party_type,
"party": party,
"posting_date": posting_date,
"paid_amount": paid_amount,
"received_amount": paid_amount,
}
payment_entry = frappe.new_doc("Payment Entry")
bank_account = frappe.get_cached_value("Bank Account", bank_transaction.bank_account, "account")
company = frappe.get_cached_value("Account", bank_account, "company")
party_account = get_party_account(party_type, party, company)
payment_entry.update(payment_entry_dict)
bank_currency = bank_transaction.currency
party_currency = frappe.get_cached_value("Account", party_account, "account_currency")
if mode_of_payment:
payment_entry.mode_of_payment = mode_of_payment
if project:
payment_entry.project = project
if cost_center:
payment_entry.cost_center = cost_center
if payment_type == "Receive":
payment_entry.paid_to = company_account
else:
payment_entry.paid_from = company_account
exc_rate = get_exchange_rate(bank_currency, party_currency, posting_date)
payment_entry.validate()
amt_in_bank_acc_currency = bank_transaction.unallocated_amount
amount_in_party_currency = bank_transaction.unallocated_amount * exc_rate
pe = frappe.new_doc("Payment Entry")
pe.payment_type = payment_type
pe.company = company
pe.reference_no = reference_number
pe.reference_date = reference_date
pe.party_type = party_type
pe.party = party
pe.posting_date = posting_date
pe.paid_from = party_account if payment_type == "Receive" else bank_account
pe.paid_to = party_account if payment_type == "Pay" else bank_account
pe.paid_from_account_currency = party_currency if payment_type == "Receive" else bank_currency
pe.paid_to_account_currency = party_currency if payment_type == "Pay" else bank_currency
pe.paid_amount = amount_in_party_currency if payment_type == "Receive" else amt_in_bank_acc_currency
pe.received_amount = amount_in_party_currency if payment_type == "Pay" else amt_in_bank_acc_currency
pe.mode_of_payment = mode_of_payment
pe.project = project
pe.cost_center = cost_center
pe.validate()
if allow_edit:
return payment_entry
return pe
payment_entry.insert()
pe.insert()
pe.submit()
payment_entry.submit()
vouchers = json.dumps(
[
{
"payment_doctype": "Payment Entry",
"payment_name": payment_entry.name,
"amount": paid_amount,
"payment_name": pe.name,
"amount": amt_in_bank_acc_currency,
}
]
)
@@ -455,8 +458,12 @@ def get_linked_payments(
def subtract_allocations(gl_account, vouchers):
"Look up & subtract any existing Bank Transaction allocations"
copied = []
voucher_docs = [(voucher[1], voucher[2]) for voucher in vouchers]
voucher_allocated_amounts = get_total_allocated_amount(voucher_docs)
for voucher in vouchers:
rows = get_total_allocated_amount(voucher[1], voucher[2])
rows = voucher_allocated_amounts.get((voucher[1], voucher[2])) or []
amount = None
for row in rows:
if row["gl_account"] == gl_account:

View File

@@ -45,42 +45,41 @@ class AutoMatchbyAccountIBAN:
if not (self.bank_party_account_number or self.bank_party_iban):
return None
result = self.match_account_in_party()
return result
return self.match_account_in_party()
def match_account_in_party(self) -> tuple | None:
"""Check if there is a IBAN/Account No. match in Customer/Supplier/Employee"""
result = None
parties = get_parties_in_order(self.deposit)
or_filters = self.get_or_filters()
"""
Returns (Party Type, Party) if a matching account is found in Bank Account or Employee:
1. Get party from a matching (iban/account no) Bank Account
2. If not found, get party from Employee with matching bank account details (iban/account no)
"""
if not (self.bank_party_account_number or self.bank_party_iban):
# Nothing to match
return None
for party in parties:
party_result = frappe.db.get_all(
"Bank Account", or_filters=or_filters, pluck="party", limit_page_length=1
)
# Search for a matching Bank Account that has party set
party_result = frappe.db.get_all(
"Bank Account",
or_filters=self.get_or_filters(),
filters={"party_type": ("is", "set"), "party": ("is", "set")},
fields=["party", "party_type"],
limit_page_length=1,
)
if result := party_result[0] if party_result else None:
return (result["party_type"], result["party"])
if party == "Employee" and not party_result:
# Search in Bank Accounts first for Employee, and then Employee record
if "bank_account_no" in or_filters:
or_filters["bank_ac_no"] = or_filters.pop("bank_account_no")
# If no party is found, search in Employee (since it has bank account details)
if employee_result := frappe.db.get_all(
"Employee", or_filters=self.get_or_filters("Employee"), pluck="name", limit_page_length=1
):
return ("Employee", employee_result[0])
party_result = frappe.db.get_all(
party, or_filters=or_filters, pluck="name", limit_page_length=1
)
if party_result:
result = (
party,
party_result[0],
)
break
return result
def get_or_filters(self) -> dict:
def get_or_filters(self, party: str | None = None) -> dict:
"""Return OR filters for Bank Account and IBAN"""
or_filters = {}
if self.bank_party_account_number:
or_filters["bank_account_no"] = self.bank_party_account_number
bank_ac_field = "bank_ac_no" if party == "Employee" else "bank_account_no"
or_filters[bank_ac_field] = self.bank_party_account_number
if self.bank_party_iban:
or_filters["iban"] = self.bank_party_iban
@@ -100,8 +99,7 @@ class AutoMatchbyPartyNameDescription:
if not (self.bank_party_name or self.description):
return None
result = self.match_party_name_desc_in_party()
return result
return self.match_party_name_desc_in_party()
def match_party_name_desc_in_party(self) -> tuple | None:
"""Fuzzy search party name and/or description against parties in the system"""
@@ -110,7 +108,7 @@ class AutoMatchbyPartyNameDescription:
for party in parties:
filters = {"status": "Active"} if party == "Employee" else {"disabled": 0}
field = party.lower() + "_name"
field = f"{party.lower()}_name"
names = frappe.get_all(party, filters=filters, fields=[f"{field} as party_name", "name"])
for field in ["bank_party_name", "description"]:
@@ -137,13 +135,7 @@ class AutoMatchbyPartyNameDescription:
)
party_name, skip = self.process_fuzzy_result(result)
if not party_name:
return None, skip
return (
party,
party_name,
), skip
return ((party, party_name), skip) if party_name else (None, skip)
def process_fuzzy_result(self, result: list | None):
"""
@@ -161,8 +153,8 @@ class AutoMatchbyPartyNameDescription:
if len(result) == 1:
return (first_result[PARTY_ID] if first_result[SCORE] > CUTOFF else None), True
second_result = result[1]
if first_result[SCORE] > CUTOFF:
second_result = result[1]
# If multiple matches with the same score, return None but discontinue matching
# Matches were found but were too close to distinguish between
if first_result[SCORE] == second_result[SCORE]:
@@ -174,8 +166,8 @@ class AutoMatchbyPartyNameDescription:
def get_parties_in_order(deposit: float) -> list:
parties = ["Supplier", "Employee", "Customer"] # most -> least likely to receive
if flt(deposit) > 0:
parties = ["Customer", "Supplier", "Employee"] # most -> least likely to pay
return parties
return (
["Customer", "Supplier", "Employee"] # most -> least likely to pay us
if flt(deposit) > 0
else ["Supplier", "Employee", "Customer"] # most -> least likely to receive from us
)

View File

@@ -2,6 +2,7 @@
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.model.docstatus import DocStatus
from frappe.utils import flt
@@ -92,10 +93,16 @@ class BankTransaction(StatusUpdater):
- clear means: set the latest transaction date as clearance date
"""
remaining_amount = self.unallocated_amount
payment_entry_docs = [(pe.payment_document, pe.payment_entry) for pe in self.payment_entries]
pe_bt_allocations = get_total_allocated_amount(payment_entry_docs)
for payment_entry in self.payment_entries:
if payment_entry.allocated_amount == 0.0:
unallocated_amount, should_clear, latest_transaction = get_clearance_details(
self, payment_entry
self,
payment_entry,
pe_bt_allocations.get((payment_entry.payment_document, payment_entry.payment_entry))
or [],
)
if 0.0 == unallocated_amount:
@@ -156,13 +163,17 @@ class BankTransaction(StatusUpdater):
if self.party_type and self.party:
return
result = AutoMatchParty(
bank_party_account_number=self.bank_party_account_number,
bank_party_iban=self.bank_party_iban,
bank_party_name=self.bank_party_name,
description=self.description,
deposit=self.deposit,
).match()
result = None
try:
result = AutoMatchParty(
bank_party_account_number=self.bank_party_account_number,
bank_party_iban=self.bank_party_iban,
bank_party_name=self.bank_party_name,
description=self.description,
deposit=self.deposit,
).match()
except Exception:
frappe.log_error(title=_("Error in party matching for Bank Transaction {0}").format(self.name))
if result:
party_type, party = result
@@ -177,7 +188,7 @@ def get_doctypes_for_bank_reconciliation():
return frappe.get_hooks("bank_reconciliation_doctypes")
def get_clearance_details(transaction, payment_entry):
def get_clearance_details(transaction, payment_entry, bt_allocations):
"""
There should only be one bank gle for a voucher.
Could be none for a Bank Transaction.
@@ -186,7 +197,6 @@ def get_clearance_details(transaction, payment_entry):
"""
gl_bank_account = frappe.db.get_value("Bank Account", transaction.bank_account, "account")
gles = get_related_bank_gl_entries(payment_entry.payment_document, payment_entry.payment_entry)
bt_allocations = get_total_allocated_amount(payment_entry.payment_document, payment_entry.payment_entry)
unallocated_amount = min(
transaction.unallocated_amount,
@@ -242,44 +252,52 @@ def get_related_bank_gl_entries(doctype, docname):
return result
def get_total_allocated_amount(doctype, docname):
def get_total_allocated_amount(docs):
"""
Gets the sum of allocations for a voucher on each bank GL account
along with the latest bank transaction name & date
NOTE: query may also include just saved vouchers/payments but with zero allocated_amount
"""
if not docs:
return {}
# nosemgrep: frappe-semgrep-rules.rules.frappe-using-db-sql
result = frappe.db.sql(
"""
SELECT total, latest_name, latest_date, gl_account FROM (
SELECT total, latest_name, latest_date, gl_account, payment_document, payment_entry FROM (
SELECT
ROW_NUMBER() OVER w AS rownum,
SUM(btp.allocated_amount) OVER(PARTITION BY ba.account) AS total,
SUM(btp.allocated_amount) OVER(PARTITION BY ba.account, btp.payment_document, btp.payment_entry) AS total,
FIRST_VALUE(bt.name) OVER w AS latest_name,
FIRST_VALUE(bt.date) OVER w AS latest_date,
ba.account AS gl_account
ba.account AS gl_account,
btp.payment_document,
btp.payment_entry
FROM
`tabBank Transaction Payments` btp
LEFT JOIN `tabBank Transaction` bt ON bt.name=btp.parent
LEFT JOIN `tabBank Account` ba ON ba.name=bt.bank_account
WHERE
btp.payment_document = %(doctype)s
AND btp.payment_entry = %(docname)s
(btp.payment_document, btp.payment_entry) IN %(docs)s
AND bt.docstatus = 1
WINDOW w AS (PARTITION BY ba.account ORDER BY bt.date desc)
WINDOW w AS (PARTITION BY ba.account, btp.payment_document, btp.payment_entry ORDER BY bt.date DESC)
) temp
WHERE
rownum = 1
""",
dict(doctype=doctype, docname=docname),
dict(docs=docs),
as_dict=True,
)
payment_allocation_details = {}
for row in result:
# Why is this *sometimes* a byte string?
if isinstance(row["latest_name"], bytes):
row["latest_name"] = row["latest_name"].decode()
row["latest_date"] = frappe.utils.getdate(row["latest_date"])
return result
payment_allocation_details.setdefault((row["payment_document"], row["payment_entry"]), []).append(row)
return payment_allocation_details
def get_paid_amount(payment_entry, currency, gl_bank_account):

View File

@@ -460,13 +460,20 @@ def get_actual_expense(args):
def get_accumulated_monthly_budget(monthly_distribution, posting_date, fiscal_year, annual_budget):
distribution = {}
if monthly_distribution:
for d in frappe.db.sql(
"""select mdp.month, mdp.percentage_allocation
from `tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` md
where mdp.parent=md.name and md.fiscal_year=%s""",
fiscal_year,
as_dict=1,
):
mdp = frappe.qb.DocType("Monthly Distribution Percentage")
md = frappe.qb.DocType("Monthly Distribution")
res = (
frappe.qb.from_(mdp)
.join(md)
.on(mdp.parent == md.name)
.select(mdp.month, mdp.percentage_allocation)
.where(md.fiscal_year == fiscal_year)
.where(md.name == monthly_distribution)
.run(as_dict=True)
)
for d in res:
distribution.setdefault(d.month, d.percentage_allocation)
dt = frappe.db.get_value("Fiscal Year", fiscal_year, "year_start_date")

View File

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

View File

@@ -448,9 +448,8 @@ def unset_existing_data(company):
"Sales Taxes and Charges Template",
"Purchase Taxes and Charges Template",
]:
frappe.db.sql(
f'''delete from `tab{doctype}` where `company`="%s"''' % (company) # nosec
)
dt = frappe.qb.DocType(doctype)
frappe.qb.from_(dt).where(dt.company == company).delete().run()
def set_default_accounts(company):

View File

@@ -4,6 +4,8 @@
import unittest
import frappe
from frappe.query_builder.functions import Sum
from frappe.tests.utils import change_settings
from frappe.utils import add_days, today
from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
@@ -190,6 +192,31 @@ class TestCostCenterAllocation(unittest.TestCase):
coa2.cancel()
jv.cancel()
@change_settings("System Settings", {"rounding_method": "Commercial Rounding"})
def test_debit_credit_on_cost_center_allocation_for_commercial_rounding(self):
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
cca = create_cost_center_allocation(
"_Test Company",
"Main Cost Center 1 - _TC",
{"Sub Cost Center 2 - _TC": 50, "Sub Cost Center 3 - _TC": 50},
)
si = create_sales_invoice(rate=145.65, cost_center="Main Cost Center 1 - _TC")
gl_entry = frappe.qb.DocType("GL Entry")
gl_entries = (
frappe.qb.from_(gl_entry)
.select(Sum(gl_entry.credit).as_("cr"), Sum(gl_entry.debit).as_("dr"))
.where(gl_entry.voucher_type == "Sales Invoice")
.where(gl_entry.voucher_no == si.name)
).run(as_dict=1)
self.assertEqual(gl_entries[0].cr, gl_entries[0].dr)
si.cancel()
cca.cancel()
def create_cost_center_allocation(
company,

View File

@@ -19,7 +19,7 @@ frappe.ui.form.on("Currency Exchange Settings", {
to: "{to_currency}",
};
add_param(frm, r.message, params, result);
} else if (frm.doc.service_provider == "frankfurter.app") {
} else if (["frankfurter.app", "frankfurter.dev"].includes(frm.doc.service_provider)) {
let result = ["rates", "{to_currency}"];
let params = {
base: "{from_currency}",

View File

@@ -78,7 +78,7 @@
"fieldname": "service_provider",
"fieldtype": "Select",
"label": "Service Provider",
"options": "frankfurter.app\nexchangerate.host\nCustom",
"options": "frankfurter.dev\nexchangerate.host\nCustom",
"reqd": 1
},
{
@@ -104,7 +104,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2024-03-18 08:32:26.895076",
"modified": "2025-11-25 13:03:41.896424",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Currency Exchange Settings",
@@ -141,8 +141,9 @@
"write": 1
}
],
"sort_field": "modified",
"row_format": "Dynamic",
"sort_field": "creation",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
}

View File

@@ -35,7 +35,7 @@ class CurrencyExchangeSettings(Document):
self.append("req_params", {"key": "date", "value": "{transaction_date}"})
self.append("req_params", {"key": "from", "value": "{from_currency}"})
self.append("req_params", {"key": "to", "value": "{to_currency}"})
elif self.service_provider == "frankfurter.app":
elif self.service_provider in ("frankfurter.dev", "frankfurter.app"):
self.set("result_key", [])
self.set("req_params", [])
@@ -80,11 +80,13 @@ class CurrencyExchangeSettings(Document):
@frappe.whitelist()
def get_api_endpoint(service_provider: str | None = None, use_http: bool = False):
if service_provider and service_provider in ["exchangerate.host", "frankfurter.app"]:
if service_provider and service_provider in ["exchangerate.host", "frankfurter.dev", "frankfurter.app"]:
if service_provider == "exchangerate.host":
api = "api.exchangerate.host/convert"
elif service_provider == "frankfurter.app":
api = "api.frankfurter.app/{transaction_date}"
elif service_provider == "frankfurter.dev":
api = "api.frankfurter.dev/v1/{transaction_date}"
protocol = "https://"
if use_http:

View File

@@ -55,46 +55,46 @@ class Dunning(AccountsController):
"conversion_rate",
"cost_center",
]
inv = frappe.db.get_value("Sales Invoice", self.sales_invoice, invoice_fields, as_dict=1)
accounting_dimensions = get_accounting_dimensions()
invoice_fields.extend(accounting_dimensions)
inv = frappe.db.get_value("Sales Invoice", self.sales_invoice, invoice_fields, as_dict=1)
dunning_in_company_currency = flt(self.dunning_amount * inv.conversion_rate)
default_cost_center = frappe.get_cached_value("Company", self.company, "cost_center")
gl_entries.append(
self.get_gl_dict(
{
"account": inv.debit_to,
"party_type": "Customer",
"party": self.customer,
"due_date": self.due_date,
"against": self.income_account,
"debit": dunning_in_company_currency,
"debit_in_account_currency": self.dunning_amount,
"against_voucher": self.name,
"against_voucher_type": "Dunning",
"cost_center": inv.cost_center or default_cost_center,
"project": inv.project,
},
inv.party_account_currency,
item=inv,
)
)
gl_entries.append(
self.get_gl_dict(
{
"account": self.income_account,
"against": self.customer,
"credit": dunning_in_company_currency,
"cost_center": inv.cost_center or default_cost_center,
"credit_in_account_currency": self.dunning_amount,
"project": inv.project,
},
item=inv,
)
)
debit = {
"account": inv.debit_to,
"party_type": "Customer",
"party": self.customer,
"due_date": self.due_date,
"against": self.income_account,
"debit": dunning_in_company_currency,
"debit_in_account_currency": self.dunning_amount,
"against_voucher": self.name,
"against_voucher_type": "Dunning",
"cost_center": inv.cost_center or default_cost_center,
"project": inv.project,
}
credit = {
"account": self.income_account,
"against": self.customer,
"credit": dunning_in_company_currency,
"credit_in_account_currency": self.dunning_amount,
"cost_center": inv.cost_center or default_cost_center,
"project": inv.project,
}
for dimension in accounting_dimensions:
if val := inv.get(dimension):
debit[dimension] = credit[dimension] = val
gl_entries = [
self.get_gl_dict(debit, inv.party_account_currency, item=inv),
self.get_gl_dict(credit, item=inv),
]
make_gl_entries(
gl_entries, cancel=(self.docstatus == 2), update_outstanding="No", merge_entries=False
)

View File

@@ -7,7 +7,7 @@ from frappe import _
from frappe.model.document import Document
from frappe.model.meta import get_field_precision
from frappe.model.naming import set_name_from_naming_options
from frappe.utils import flt, fmt_money
from frappe.utils import flt, fmt_money, now
import erpnext
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
@@ -83,7 +83,7 @@ class GLEntry(Document):
if not self.get(k):
frappe.throw(_("{0} is required").format(_(self.meta.get_label(k))))
if not (self.party_type and self.party):
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(
@@ -261,7 +261,7 @@ def validate_balance_type(account, adv_adj=False):
if balance_must_be:
balance = frappe.db.sql(
"""select sum(debit) - sum(credit)
from `tabGL Entry` where account = %s""",
from `tabGL Entry` where is_cancelled = 0 and account = %s""",
account,
)[0][0]
@@ -405,7 +405,7 @@ def rename_temporarily_named_docs(doctype):
set_name_from_naming_options(frappe.get_meta(doctype).autoname, doc)
newname = doc.name
frappe.db.sql(
f"UPDATE `tab{doctype}` SET name = %s, to_rename = 0 where name = %s",
(newname, oldname),
f"UPDATE `tab{doctype}` SET name = %s, to_rename = 0, modified = %s where name = %s",
(newname, now(), oldname),
auto_commit=True,
)

View File

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

View File

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

View File

@@ -433,8 +433,22 @@ class JournalEntry(AccountsController):
if customers:
from erpnext.selling.doctype.customer.customer import check_credit_limit
customer_details = frappe._dict(
frappe.db.get_all(
"Customer Credit Limit",
filters={
"parent": ["in", customers],
"parenttype": ["=", "Customer"],
"company": ["=", self.company],
},
fields=["parent", "bypass_credit_limit_check"],
as_list=True,
)
)
for customer in customers:
check_credit_limit(customer, self.company)
ignore_outstanding_sales_order = bool(customer_details.get(customer))
check_credit_limit(customer, self.company, ignore_outstanding_sales_order)
def validate_cheque_info(self):
if self.voucher_type in ["Bank Entry"]:

View File

@@ -5,6 +5,7 @@
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.query_builder.functions import Sum
from frappe.utils import flt, today
@@ -18,22 +19,30 @@ def get_loyalty_details(
if not expiry_date:
expiry_date = today()
condition = ""
if company:
condition = " and company=%s " % frappe.db.escape(company)
if not include_expired_entry:
condition += " and expiry_date>='%s' " % expiry_date
LoyaltyPointEntry = frappe.qb.DocType("Loyalty Point Entry")
loyalty_point_details = frappe.db.sql(
f"""select sum(loyalty_points) as loyalty_points,
sum(purchase_amount) as total_spent from `tabLoyalty Point Entry`
where customer=%s and loyalty_program=%s and posting_date <= %s
{condition}
group by customer""",
(customer, loyalty_program, expiry_date),
as_dict=1,
query = (
frappe.qb.from_(LoyaltyPointEntry)
.select(
Sum(LoyaltyPointEntry.loyalty_points).as_("loyalty_points"),
Sum(LoyaltyPointEntry.purchase_amount).as_("total_spent"),
)
.where(
(LoyaltyPointEntry.customer == customer)
& (LoyaltyPointEntry.loyalty_program == loyalty_program)
& (LoyaltyPointEntry.posting_date <= expiry_date)
)
.groupby(LoyaltyPointEntry.customer)
)
if company:
query = query.where(LoyaltyPointEntry.company == company)
if not include_expired_entry:
query = query.where(LoyaltyPointEntry.expiry_date >= expiry_date)
loyalty_point_details = query.run(as_dict=True)
if loyalty_point_details:
return loyalty_point_details[0]
else:

View File

@@ -60,6 +60,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

@@ -319,7 +319,7 @@ frappe.ui.form.on('Payment Entry', {
"from_date": frm.doc.posting_date,
"to_date": moment(frm.doc.modified).format('YYYY-MM-DD'),
"company": frm.doc.company,
"group_by": "",
"categorize_by": "",
"show_cancelled_entries": frm.doc.docstatus === 2
};
frappe.set_route("query-report", "General Ledger");
@@ -330,7 +330,7 @@ frappe.ui.form.on('Payment Entry', {
payment_type: function(frm) {
set_default_party_type(frm);
if(frm.doc.payment_type == "Internal Transfer") {
$.each(["party", "party_balance", "paid_from", "paid_to",
$.each(["party", "party_type", "party_balance", "paid_from", "paid_to",
"references", "total_allocated_amount"], function(i, field) {
frm.set_value(field, null);
});
@@ -1088,6 +1088,24 @@ frappe.ui.form.on('Payment Entry', {
if (r.message) {
if (!frm.doc.mode_of_payment) {
frm.set_value(field, r.message.account);
} else {
frappe.call({
method: "frappe.client.get_value",
args: {
doctype: "Mode of Payment Account",
filters: {
parent: frm.doc.mode_of_payment,
company: frm.doc.company,
},
fieldname: "default_account",
parent: "Mode of Payment",
},
callback: function (res) {
if (!res.message.default_account) {
frm.set_value(field, r.message.account);
}
},
});
}
frm.set_value('bank', r.message.bank);
frm.set_value('bank_account_no', r.message.bank_account_no);

View File

@@ -350,15 +350,25 @@ class PaymentEntry(AccountsController):
self.set(self.party_account_field, party_account)
self.party_account = party_account
if self.paid_from and not (self.paid_from_account_currency or self.paid_from_account_balance):
if self.paid_from and (
not self.paid_from_account_currency
or not self.paid_from_account_balance
or not self.paid_from_account_type
):
acc = get_account_details(self.paid_from, self.posting_date, self.cost_center)
self.paid_from_account_currency = acc.account_currency
self.paid_from_account_balance = acc.account_balance
self.paid_from_account_type = acc.account_type
if self.paid_to and not (self.paid_to_account_currency or self.paid_to_account_balance):
if self.paid_to and (
not self.paid_to_account_currency
or not self.paid_to_account_balance
or not self.paid_to_account_type
):
acc = get_account_details(self.paid_to, self.posting_date, self.cost_center)
self.paid_to_account_currency = acc.account_currency
self.paid_to_account_balance = acc.account_balance
self.paid_to_account_type = acc.account_type
self.party_account_currency = (
self.paid_from_account_currency
@@ -465,7 +475,7 @@ class PaymentEntry(AccountsController):
if d.reference_doctype not in valid_reference_doctypes:
frappe.throw(
_("Reference Doctype must be one of {0}").format(
comma_or(_(d) for d in valid_reference_doctypes)
comma_or([_(d) for d in valid_reference_doctypes])
)
)
@@ -1519,7 +1529,7 @@ class PaymentEntry(AccountsController):
allocated_positive_outstanding = paid_amount + allocated_negative_outstanding
elif self.party_type in ("Supplier", "Employee"):
elif self.party_type in ("Supplier", "Customer"):
if paid_amount > total_negative_outstanding:
if total_negative_outstanding == 0:
frappe.msgprint(
@@ -1580,7 +1590,7 @@ class PaymentEntry(AccountsController):
# Re allocate amount to those references which have PR set (Higher priority)
for ref in self.references:
if not ref.payment_request:
if not (ref.reference_doctype and ref.reference_name and ref.payment_request):
continue
# fetch outstanding_amount of `Reference` (Payment Term) and `Payment Request` to allocate new amount
@@ -1631,7 +1641,7 @@ class PaymentEntry(AccountsController):
)
# Re allocate amount to those references which have no PR (Lower priority)
for ref in self.references:
if ref.payment_request:
if ref.payment_request or not (ref.reference_doctype and ref.reference_name):
continue
key = (ref.reference_doctype, ref.reference_name, ref.get("payment_term"))
@@ -2481,6 +2491,7 @@ def get_payment_entry(
pe.paid_amount = paid_amount
pe.received_amount = received_amount
pe.letter_head = doc.get("letter_head")
pe.bank_account = frappe.db.get_value("Bank Account", {"is_company_account": 1, "is_default": 1}, "name")
if dt in ["Purchase Order", "Sales Order", "Sales Invoice", "Purchase Invoice"]:
pe.project = doc.get("project") or reduce(

View File

@@ -270,6 +270,7 @@ class PaymentReconciliation(Document):
for payment in non_reconciled_payments:
row = self.append("payments", {})
row.update(payment)
row.is_advance = payment.book_advance_payments_in_separate_party_account
def get_invoice_entries(self):
# Fetch JVs, Sales and Purchase Invoices for 'invoices' to reconcile against
@@ -354,6 +355,9 @@ class PaymentReconciliation(Document):
def allocate_entries(self, args):
self.validate_entries()
exc_gain_loss_posting_date = frappe.db.get_single_value(
"Accounts Settings", "exchange_gain_loss_posting_date", cache=True
)
invoice_exchange_map = self.get_invoice_exchange_map(args.get("invoices"), args.get("payments"))
default_exchange_gain_loss_account = frappe.get_cached_value(
"Company", self.company, "exchange_gain_loss_account"
@@ -380,6 +384,11 @@ class PaymentReconciliation(Document):
res.difference_account = default_exchange_gain_loss_account
res.exchange_rate = inv.get("exchange_rate")
res.update({"gain_loss_posting_date": pay.get("posting_date")})
if not pay.get("is_advance"):
if exc_gain_loss_posting_date == "Invoice":
res.update({"gain_loss_posting_date": inv.get("invoice_date")})
elif exc_gain_loss_posting_date == "Reconciliation Date":
res.update({"gain_loss_posting_date": nowdate()})
if pay.get("amount") == 0:
entries.append(res)

View File

@@ -246,6 +246,7 @@ class PaymentRequest(Document):
"payer_name": data.customer_name,
"order_id": self.name,
"currency": self.currency,
"payment_gateway": self.payment_gateway,
}
)

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",
@@ -155,12 +160,50 @@
"fieldtype": "Currency",
"label": "Payment Amount (Company Currency)",
"options": "Company:company:default_currency"
},
{
"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": "2022-09-16 13:57:06.382859",
"modified": "2025-07-31 08:38:25.820701",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Schedule",
@@ -171,4 +214,4 @@
"sort_order": "DESC",
"states": [],
"track_changes": 1
}
}

View File

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

View File

@@ -11,9 +11,9 @@ frappe.ui.form.on("Period Closing Voucher", {
return {
filters: [
["Account", "company", "=", frm.doc.company],
["Account", "is_group", "=", "0"],
["Account", "is_group", "=", 0],
["Account", "freeze_account", "=", "No"],
["Account", "root_type", "in", "Liability, Equity"],
["Account", "root_type", "in", ["Liability", "Equity"]],
],
};
});
@@ -29,7 +29,7 @@ frappe.ui.form.on("Period Closing Voucher", {
from_date: frm.doc.posting_date,
to_date: moment(frm.doc.modified).format("YYYY-MM-DD"),
company: frm.doc.company,
group_by: "",
categorize_by: "",
show_cancelled_entries: frm.doc.docstatus === 2,
};
frappe.set_route("query-report", "General Ledger");

View File

@@ -32,8 +32,13 @@ class PeriodClosingVoucher(AccountsController):
def on_cancel(self):
self.validate_future_closing_vouchers()
self.ignore_linked_doctypes = (
"GL Entry",
"Stock Ledger Entry",
"Payment Ledger Entry",
"Account Closing Balance",
)
self.db_set("gle_processing_status", "In Progress")
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry", "Payment Ledger Entry")
gle_count = frappe.db.count(
"GL Entry",
{"voucher_type": "Period Closing Voucher", "voucher_no": self.name, "is_cancelled": 0},
@@ -201,6 +206,9 @@ class PeriodClosingVoucher(AccountsController):
return gl_entry
def get_gle_for_closing_account(self, acc):
debit = abs(flt(acc.bal_in_company_currency)) if flt(acc.bal_in_company_currency) > 0 else 0
credit = abs(flt(acc.bal_in_company_currency)) if flt(acc.bal_in_company_currency) < 0 else 0
gl_entry = self.get_gl_dict(
{
"company": self.company,
@@ -209,16 +217,10 @@ class PeriodClosingVoucher(AccountsController):
"cost_center": acc.cost_center,
"finance_book": acc.finance_book,
"account_currency": acc.account_currency,
"debit_in_account_currency": abs(flt(acc.bal_in_account_currency))
if flt(acc.bal_in_account_currency) > 0
else 0,
"debit": abs(flt(acc.bal_in_company_currency)) if flt(acc.bal_in_company_currency) > 0 else 0,
"credit_in_account_currency": abs(flt(acc.bal_in_account_currency))
if flt(acc.bal_in_account_currency) < 0
else 0,
"credit": abs(flt(acc.bal_in_company_currency))
if flt(acc.bal_in_company_currency) < 0
else 0,
"debit_in_account_currency": debit,
"debit": debit,
"credit_in_account_currency": credit,
"credit": credit,
"is_period_closing_voucher_entry": 1,
},
item=acc,

View File

@@ -1623,6 +1623,5 @@
"states": [],
"timeline_field": "customer",
"title_field": "title",
"track_changes": 1,
"track_seen": 1
}
"track_changes": 1
}

View File

@@ -560,7 +560,13 @@ class POSInvoice(SalesInvoice):
"Account", self.debit_to, "account_currency", cache=True
)
if not self.due_date and self.customer:
self.due_date = get_due_date(self.posting_date, "Customer", self.customer, self.company)
self.due_date = get_due_date(
self.posting_date,
"Customer",
self.customer,
self.company,
template_name=self.payment_terms_template,
)
super(SalesInvoice, self).set_missing_values(for_validate)

View File

@@ -53,6 +53,7 @@
"column_break_42",
"free_item_uom",
"round_free_qty",
"dont_enforce_free_item_qty",
"is_recursive",
"recurse_for",
"apply_recursion_over",
@@ -643,12 +644,19 @@
"fieldname": "has_priority",
"fieldtype": "Check",
"label": "Has Priority"
},
{
"default": "0",
"depends_on": "eval:doc.price_or_product_discount == 'Product'",
"fieldname": "dont_enforce_free_item_qty",
"fieldtype": "Check",
"label": "Don't Enforce Free Item Qty"
}
],
"icon": "fa fa-gift",
"idx": 1,
"links": [],
"modified": "2024-09-16 18:14:51.314765",
"modified": "2025-02-17 18:15:39.824639",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pricing Rule",

View File

@@ -553,7 +553,7 @@ def remove_pricing_rule_for_item(pricing_rules, item_details, item_code=None, ra
if pricing_rule.margin_type in ["Percentage", "Amount"]:
item_details.margin_rate_or_amount = 0.0
item_details.margin_type = None
elif pricing_rule.get("free_item"):
elif pricing_rule.get("free_item") and not pricing_rule.get("dont_enforce_free_item_qty"):
item_details.remove_free_item = (
item_code if pricing_rule.get("same_item") else pricing_rule.get("free_item")
)

View File

@@ -428,6 +428,54 @@ class TestPricingRule(FrappeTestCase):
self.assertEqual(so.items[1].is_free_item, 1)
self.assertEqual(so.items[1].item_code, "_Test Item 2")
def test_dont_enforce_free_item_qty(self):
# this test is only for testing non-enforcement as all other tests in this file already test with enforcement
frappe.delete_doc_if_exists("Pricing Rule", "_Test Pricing Rule")
test_record = {
"doctype": "Pricing Rule",
"title": "_Test Pricing Rule",
"apply_on": "Item Code",
"currency": "USD",
"items": [
{
"item_code": "_Test Item",
}
],
"selling": 1,
"rate_or_discount": "Discount Percentage",
"rate": 0,
"min_qty": 0,
"max_qty": 7,
"discount_percentage": 17.5,
"price_or_product_discount": "Product",
"same_item": 0,
"free_item": "_Test Item 2",
"free_qty": 1,
"company": "_Test Company",
}
pricing_rule = frappe.get_doc(test_record.copy()).insert()
# With enforcement
so = make_sales_order(item_code="_Test Item", qty=1, do_not_submit=True)
self.assertEqual(so.items[1].is_free_item, 1)
self.assertEqual(so.items[1].item_code, "_Test Item 2")
# Test 1 : Saving a document with an item with pricing list without it's corresponding free item will cause it the free item to be refetched on save
so.items.pop(1)
so.save()
so.reload()
self.assertEqual(len(so.items), 2)
# Without enforcement
pricing_rule.dont_enforce_free_item_qty = 1
pricing_rule.save()
# Test 2 : Deleted free item will not be fetched again on save without enforcement
so.items.pop(1)
so.save()
so.reload()
self.assertEqual(len(so.items), 1)
def test_cumulative_pricing_rule(self):
frappe.delete_doc_if_exists("Pricing Rule", "_Test Cumulative Pricing Rule")
test_record = {
@@ -1239,6 +1287,7 @@ def make_pricing_rule(**args):
"discount_amount": args.discount_amount or 0.0,
"apply_multiple_pricing_rules": args.apply_multiple_pricing_rules or 0,
"has_priority": args.has_priority or 0,
"enforce_free_item_qty": args.dont_enforce_free_item_qty or 0,
}
)

View File

@@ -691,7 +691,10 @@ def apply_pricing_rule_for_free_items(doc, pricing_rule_args):
args.pop((item.item_code, item.pricing_rules))
for free_item in args.values():
doc.append("items", free_item)
if doc.is_new() or not frappe.get_value(
"Pricing Rule", free_item["pricing_rules"], "dont_enforce_free_item_qty"
):
doc.append("items", free_item)
def get_pricing_rule_items(pr_doc, other_items=False) -> list:

View File

@@ -20,6 +20,7 @@
"is_advance",
"section_break_5",
"difference_amount",
"gain_loss_posting_date",
"column_break_7",
"difference_account",
"exchange_rate",
@@ -153,11 +154,16 @@
"fieldtype": "Check",
"in_list_view": 1,
"label": "Reconciled"
},
{
"fieldname": "gain_loss_posting_date",
"fieldtype": "Date",
"label": "Difference Posting Date"
}
],
"istable": 1,
"links": [],
"modified": "2023-03-20 21:05:43.121945",
"modified": "2025-01-23 16:09:01.058574",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Payment Reconciliation Log Allocations",

View File

@@ -12,7 +12,7 @@
"posting_date",
"company",
"account",
"group_by",
"categorize_by",
"cost_center",
"territory",
"ignore_exchange_rate_revaluation_journals",
@@ -172,14 +172,6 @@
"fieldtype": "Date",
"label": "Start Date"
},
{
"default": "Group by Voucher (Consolidated)",
"depends_on": "eval:(doc.report == 'General Ledger');",
"fieldname": "group_by",
"fieldtype": "Select",
"label": "Group By",
"options": "\nGroup by Voucher\nGroup by Voucher (Consolidated)"
},
{
"depends_on": "eval: (doc.report == 'General Ledger');",
"fieldname": "currency",
@@ -395,10 +387,18 @@
"fieldname": "show_remarks",
"fieldtype": "Check",
"label": "Show Remarks"
},
{
"default": "Categorize by Voucher (Consolidated)",
"depends_on": "eval:(doc.report == 'General Ledger');",
"fieldname": "categorize_by",
"fieldtype": "Select",
"label": "Categorize By",
"options": "\nCategorize by Voucher\nCategorize by Voucher (Consolidated)"
}
],
"links": [],
"modified": "2024-10-18 17:51:39.108481",
"modified": "2025-04-30 14:43:23.643006",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Statement Of Accounts",
@@ -433,4 +433,4 @@
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1
}
}

View File

@@ -145,7 +145,7 @@ def get_gl_filters(doc, entry, tax_id, presentation_currency):
"party": [entry.customer],
"party_name": [entry.customer_name] if entry.customer_name else None,
"presentation_currency": presentation_currency,
"group_by": doc.group_by,
"categorize_by": doc.categorize_by,
"currency": doc.currency,
"project": [p.project_name for p in doc.project],
"show_opening_entries": 0,
@@ -177,17 +177,21 @@ def get_ar_filters(doc, entry):
def get_html(doc, filters, entry, col, res, ageing):
base_template_path = "frappe/www/printview.html"
template_path = (
"erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.html"
if doc.report == "General Ledger"
else "erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts_accounts_receivable.html"
)
template_path = "erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts_accounts_receivable.html"
if doc.report == "General Ledger":
template_path = (
"erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.html"
)
process_soa_html = frappe.get_hooks("process_soa_html")
# fetching custom print format for Process Statement of Accounts
if process_soa_html and process_soa_html.get(doc.report):
template_path = process_soa_html[doc.report][-1]
if doc.letter_head:
from frappe.www.printview import get_letter_head
letter_head = get_letter_head(doc, 0)
html = frappe.render_template(
template_path,
{
@@ -203,7 +207,6 @@ def get_html(doc, filters, entry, col, res, ageing):
else None,
},
)
html = frappe.render_template(
base_template_path,
{"body": html, "css": get_print_style(), "title": "Statement For " + entry.customer},
@@ -262,9 +265,12 @@ def get_recipients_and_cc(customer, doc):
recipients = []
for clist in doc.customers:
if clist.customer == customer:
recipients.append(clist.billing_email)
if clist.billing_email:
for email in clist.billing_email.split(","):
recipients.append(email.strip())
if doc.primary_mandatory and clist.primary_email:
recipients.append(clist.primary_email)
for email in clist.primary_email.split(","):
recipients.append(email.strip())
cc = []
if doc.cc_to != "":
try:
@@ -443,7 +449,7 @@ def send_auto_email():
selected = frappe.get_list(
"Process Statement Of Accounts",
filters={"enable_auto_email": 1},
or_filters={"to_date": format_date(today()), "posting_date": format_date(today())},
or_filters={"to_date": today(), "posting_date": today()},
)
for entry in selected:
send_emails(entry.name, from_scheduler=True)

View File

@@ -29,7 +29,10 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
this.frm.set_query("expense_account", "items", function () {
return {
query: "erpnext.controllers.queries.get_expense_account",
filters: { company: doc.company },
filters: {
company: doc.company,
disabled: 0,
},
};
});
}
@@ -302,7 +305,11 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
if (this.frm.doc.__onload && this.frm.doc.__onload.load_after_mapping) return;
erpnext.utils.get_party_details(this.frm, "erpnext.accounts.party.get_party_details",
let payment_terms_template = this.frm.doc.payment_terms_template;
erpnext.utils.get_party_details(
this.frm,
"erpnext.accounts.party.get_party_details",
{
posting_date: this.frm.doc.posting_date,
bill_date: this.frm.doc.bill_date,
@@ -320,7 +327,14 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
me.frm.doc.tax_withholding_category = me.frm.supplier_tds;
me.frm.set_df_property("apply_tds", "read_only", me.frm.supplier_tds ? 0 : 1);
me.frm.set_df_property("tax_withholding_category", "hidden", me.frm.supplier_tds ? 0 : 1);
})
// while duplicating, don't change payment terms
if (me.frm.doc.__run_link_triggers === false) {
me.frm.set_value("payment_terms_template", payment_terms_template);
me.frm.refresh_field("payment_terms_template");
}
}
);
}
apply_tds(frm) {
@@ -366,6 +380,8 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying.
hide_fields(this.frm.doc);
if(cint(this.frm.doc.is_paid)) {
this.frm.set_value("allocate_advances_automatically", 0);
this.frm.set_value("payment_terms_template", "");
this.frm.set_value("payment_schedule", []);
if(!this.frm.doc.company) {
this.frm.set_value("is_paid", 0)
frappe.msgprint(__("Please specify Company to proceed"));

View File

@@ -10,7 +10,6 @@ from frappe.utils import cint, cstr, flt, formatdate, get_link_to_form, getdate,
import erpnext
from erpnext.accounts.deferred_revenue import validate_service_stop_date
from erpnext.accounts.doctype.gl_entry.gl_entry import update_outstanding_amt
from erpnext.accounts.doctype.repost_accounting_ledger.repost_accounting_ledger import (
validate_docs_for_deferred_accounting,
validate_docs_for_voucher_types,
@@ -33,7 +32,7 @@ from erpnext.accounts.general_ledger import (
merge_similar_entries,
)
from erpnext.accounts.party import get_due_date, get_party_account
from erpnext.accounts.utils import get_account_currency, get_fiscal_year
from erpnext.accounts.utils import get_account_currency, get_fiscal_year, update_voucher_outstanding
from erpnext.assets.doctype.asset.asset import is_cwip_accounting_enabled
from erpnext.assets.doctype.asset_category.asset_category import get_asset_category_account
from erpnext.buying.utils import check_on_hold_or_closed_status
@@ -174,7 +173,12 @@ class PurchaseInvoice(BuyingController):
)
if not self.due_date:
self.due_date = get_due_date(
self.posting_date, "Supplier", self.supplier, self.company, self.bill_date
self.posting_date,
"Supplier",
self.supplier,
self.company,
self.bill_date,
template_name=self.payment_terms_template,
)
tds_category = frappe.db.get_value("Supplier", self.supplier, "tax_withholding_category")
@@ -661,12 +665,12 @@ class PurchaseInvoice(BuyingController):
def update_supplier_outstanding(self, update_outstanding):
if update_outstanding == "No":
update_outstanding_amt(
self.credit_to,
"Supplier",
self.supplier,
self.doctype,
self.return_against if cint(self.is_return) and self.return_against else self.name,
update_voucher_outstanding(
voucher_type=self.doctype,
voucher_no=self.return_against if cint(self.is_return) and self.return_against else self.name,
account=self.credit_to,
party_type="Supplier",
party=self.supplier,
)
def get_gl_entries(self, warehouse_account=None):
@@ -782,7 +786,7 @@ class PurchaseInvoice(BuyingController):
self.get_provisional_accounts()
for item in self.get("items"):
if flt(item.base_net_amount):
if flt(item.base_net_amount) or (self.get("update_stock") and item.valuation_rate):
account_currency = get_account_currency(item.expense_account)
if item.item_code:
frappe.get_cached_value("Item", item.item_code, "asset_category")
@@ -1017,6 +1021,9 @@ class PurchaseInvoice(BuyingController):
def get_provisional_accounts(self):
self.provisional_accounts = frappe._dict()
linked_purchase_receipts = set([d.purchase_receipt for d in self.items if d.purchase_receipt])
if not linked_purchase_receipts:
return
pr_items = frappe.get_all(
"Purchase Receipt Item",
filters={"parent": ("in", linked_purchase_receipts)},
@@ -1125,6 +1132,30 @@ class PurchaseInvoice(BuyingController):
warehouse_debit_amount = stock_amount
elif self.is_return and self.update_stock and (self.is_internal_supplier or not self.return_against):
net_rate = item.base_net_amount
stock_amount = net_rate + item.item_tax_amount + flt(item.landed_cost_voucher_amount)
if flt(stock_amount, net_amt_precision) != flt(warehouse_debit_amount, net_amt_precision):
cost_of_goods_sold_account = self.get_company_default("default_expense_account")
stock_adjustment_amt = stock_amount - warehouse_debit_amount
gl_entries.append(
self.get_gl_dict(
{
"account": cost_of_goods_sold_account,
"against": item.expense_account,
"debit": stock_adjustment_amt,
"debit_in_transaction_currency": stock_adjustment_amt / self.conversion_rate,
"remarks": self.get("remarks") or _("Stock Adjustment"),
"cost_center": item.cost_center,
"project": item.project or self.project,
},
account_currency,
item=item,
)
)
return warehouse_debit_amount
def make_tax_gl_entries(self, gl_entries):
@@ -1443,7 +1474,12 @@ class PurchaseInvoice(BuyingController):
if pi:
pi = pi[0][0]
frappe.throw(_("Supplier Invoice No exists in Purchase Invoice {0}").format(pi))
frappe.throw(
_("Supplier Invoice No exists in Purchase Invoice {0}").format(
get_link_to_form("Purchase Invoice", pi)
)
)
def update_billing_status_in_pr(self, update_modified=True):
if self.is_return and not self.update_billed_amount_in_purchase_receipt:

View File

@@ -45,12 +45,16 @@ frappe.listview_settings["Purchase Invoice"] = {
},
onload: function (listview) {
listview.page.add_action_item(__("Purchase Receipt"), () => {
erpnext.bulk_transaction_processing.create(listview, "Purchase Invoice", "Purchase Receipt");
});
if (frappe.model.can_create("Purchase Receipt")) {
listview.page.add_action_item(__("Purchase Receipt"), () => {
erpnext.bulk_transaction_processing.create(listview, "Purchase Invoice", "Purchase Receipt");
});
}
listview.page.add_action_item(__("Payment"), () => {
erpnext.bulk_transaction_processing.create(listview, "Purchase Invoice", "Payment Entry");
});
if (frappe.model.can_create("Payment Entry")) {
listview.page.add_action_item(__("Payment"), () => {
erpnext.bulk_transaction_processing.create(listview, "Purchase Invoice", "Payment Entry");
});
}
},
};

View File

@@ -1816,19 +1816,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",
@@ -1852,9 +1849,8 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
1,
)
pi = make_pi_from_pr(pr.name)
self.assertEqual(pi.payment_schedule[0].payment_amount, 2500)
self.assertEqual(pi.payment_schedule[0].payment_amount, 1000)
automatically_fetch_payment_terms(enable=0)
frappe.db.set_value(
"Payment Terms Template",
"_Test Payment Term Template",
@@ -1984,6 +1980,78 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
self.assertRaises(frappe.ValidationError, dr_note.save)
def test_apply_discount_on_grand_total(self):
"""
To test if after applying discount on grand total,
the grand total is calculated correctly without any rounding errors
"""
invoice = make_purchase_invoice(qty=2, rate=100, do_not_save=True, do_not_submit=True)
invoice.append(
"items",
{
"item_code": "_Test Item",
"qty": 1,
"rate": 21.39,
},
)
invoice.append(
"taxes",
{
"charge_type": "On Net Total",
"account_head": "_Test Account VAT - _TC",
"description": "VAT",
"rate": 15.5,
},
)
# the grand total here will be 255.71
invoice.disable_rounded_total = 1
# apply discount on grand total to adjust the grand total to 255
invoice.discount_amount = 0.71
invoice.save()
# check if grand total is 496 and not something like 254.99 due to rounding errors
self.assertEqual(invoice.grand_total, 255)
def test_apply_discount_on_grand_total_with_previous_row_total_tax(self):
"""
To test if after applying discount on grand total,
where the tax is calculated on previous row total, the grand total is calculated correctly
"""
invoice = make_purchase_invoice(qty=2, rate=100, do_not_save=True, do_not_submit=True)
invoice.extend(
"taxes",
[
{
"charge_type": "Actual",
"account_head": "_Test Account VAT - _TC",
"description": "VAT",
"tax_amount": 100,
},
{
"charge_type": "On Previous Row Amount",
"account_head": "_Test Account VAT - _TC",
"description": "VAT",
"row_id": 1,
"rate": 10,
},
{
"charge_type": "On Previous Row Total",
"account_head": "_Test Account VAT - _TC",
"description": "VAT",
"row_id": 1,
"rate": 10,
},
],
)
# the total here will be 340, so applying 40 discount
invoice.discount_amount = 40
invoice.save()
self.assertEqual(invoice.grand_total, 300)
def check_gl_entries(
doc,

View File

@@ -14,7 +14,8 @@
"advance_amount",
"allocated_amount",
"exchange_gain_loss",
"ref_exchange_rate"
"ref_exchange_rate",
"difference_posting_date"
],
"fields": [
{
@@ -30,7 +31,7 @@
"width": "180px"
},
{
"columns": 3,
"columns": 2,
"fieldname": "reference_name",
"fieldtype": "Dynamic Link",
"in_list_view": 1,
@@ -40,7 +41,7 @@
"read_only": 1
},
{
"columns": 3,
"columns": 2,
"fieldname": "remarks",
"fieldtype": "Text",
"in_list_view": 1,
@@ -111,13 +112,20 @@
"label": "Reference Exchange Rate",
"non_negative": 1,
"read_only": 1
},
{
"columns": 2,
"fieldname": "difference_posting_date",
"fieldtype": "Date",
"in_list_view": 1,
"label": "Difference Posting Date"
}
],
"idx": 1,
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2021-09-26 15:47:28.167371",
"modified": "2024-12-20 12:04:46.729972",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Advance",

View File

@@ -6,6 +6,8 @@ from frappe import _, qb
from frappe.model.document import Document
from frappe.utils.data import comma_and
from erpnext.stock import get_warehouse_account_map
class RepostAccountingLedger(Document):
def __init__(self, *args, **kwargs):
@@ -77,6 +79,9 @@ class RepostAccountingLedger(Document):
doc = frappe.get_doc(x.voucher_type, x.voucher_no)
if doc.doctype in ["Payment Entry", "Journal Entry"]:
gle_map = doc.build_gl_map()
elif doc.doctype == "Purchase Receipt":
warehouse_account_map = get_warehouse_account_map(doc.company)
gle_map = doc.get_gl_entries(warehouse_account_map)
else:
gle_map = doc.get_gl_entries()
@@ -146,7 +151,7 @@ def start_repost(account_repost_doc=str) -> None:
if doc.doctype in ["Sales Invoice", "Purchase Invoice"]:
if not repost_doc.delete_cancelled_entries:
doc.docstatus = 2
doc.make_gl_entries_on_cancel()
doc.make_gl_entries_on_cancel(from_repost=True)
doc.docstatus = 1
if doc.doctype == "Sales Invoice":
@@ -155,6 +160,14 @@ def start_repost(account_repost_doc=str) -> None:
doc.force_set_against_expense_account()
doc.make_gl_entries()
elif doc.doctype == "Purchase Receipt":
if not repost_doc.delete_cancelled_entries:
doc.docstatus = 2
doc.make_gl_entries_on_cancel(from_repost=True)
doc.docstatus = 1
doc.make_gl_entries(from_repost=True)
elif doc.doctype in ["Payment Entry", "Journal Entry", "Expense Claim"]:
if not repost_doc.delete_cancelled_entries:
doc.make_gl_entries(1)

View File

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

View File

@@ -9,6 +9,10 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e
setup(doc) {
this.setup_posting_date_time_check();
super.setup(doc);
this.frm.make_methods = {
Dunning: this.make_dunning.bind(this),
"Invoice Discounting": this.make_invoice_discounting.bind(this),
};
}
company() {
super.company();
@@ -94,26 +98,35 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e
}
}
if (doc.outstanding_amount>0) {
cur_frm.add_custom_button(__('Payment Request'), function() {
me.make_payment_request();
}, __('Create'));
if (doc.outstanding_amount > 0) {
this.frm.add_custom_button(
__("Payment Request"),
function () {
me.make_payment_request();
},
__("Create")
);
this.frm.add_custom_button(
__("Invoice Discounting"),
this.make_invoice_discounting.bind(this),
__("Create")
);
cur_frm.add_custom_button(__('Invoice Discounting'), function() {
cur_frm.events.create_invoice_discounting(cur_frm);
}, __('Create'));
const payment_is_overdue = doc.payment_schedule
.map((row) => Date.parse(row.due_date) < Date.now())
.reduce((prev, current) => prev || current, false);
if (doc.due_date < frappe.datetime.get_today()) {
cur_frm.add_custom_button(__('Dunning'), function() {
cur_frm.events.create_dunning(cur_frm);
}, __('Create'));
if (payment_is_overdue) {
this.frm.add_custom_button(__("Dunning"), this.make_dunning.bind(this), __("Create"));
}
}
if (doc.docstatus === 1) {
cur_frm.add_custom_button(__('Maintenance Schedule'), function () {
cur_frm.cscript.make_maintenance_schedule();
}, __('Create'));
this.frm.add_custom_button(
__("Maintenance Schedule"),
this.make_maintenance_schedule.bind(this),
__("Create")
);
}
if(!doc.auto_repeat) {
@@ -146,6 +159,20 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e
erpnext.accounts.unreconcile_payment.add_unreconcile_btn(me.frm);
}
make_invoice_discounting() {
frappe.model.open_mapped_doc({
method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.create_invoice_discounting",
frm: this.frm,
});
}
make_dunning() {
frappe.model.open_mapped_doc({
method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.create_dunning",
frm: this.frm,
});
}
make_maintenance_schedule() {
frappe.model.open_mapped_doc({
method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_maintenance_schedule",
@@ -948,20 +975,6 @@ frappe.ui.form.on('Sales Invoice', {
frm.set_df_property('return_against', 'label', __('Adjustment Against'));
}
},
create_invoice_discounting: function(frm) {
frappe.model.open_mapped_doc({
method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.create_invoice_discounting",
frm: frm
});
},
create_dunning: function(frm) {
frappe.model.open_mapped_doc({
method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.create_dunning",
frm: frm
});
}
});
frappe.ui.form.on("Sales Invoice Timesheet", {

View File

@@ -24,7 +24,11 @@ from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category
)
from erpnext.accounts.general_ledger import get_round_off_account_and_cost_center
from erpnext.accounts.party import get_due_date, get_party_account, get_party_details
from erpnext.accounts.utils import cancel_exchange_gain_loss_journal, get_account_currency
from erpnext.accounts.utils import (
cancel_exchange_gain_loss_journal,
get_account_currency,
update_voucher_outstanding,
)
from erpnext.assets.doctype.asset.depreciation import (
depreciate_asset,
get_disposal_account_and_cost_center,
@@ -87,8 +91,8 @@ class SalesInvoice(SellingController):
self.indicator_title = _("Paid")
def validate(self):
super().validate()
self.validate_auto_set_posting_time()
super().validate()
if not (self.is_pos or self.is_debit_note):
self.so_dn_required()
@@ -494,7 +498,13 @@ class SalesInvoice(SellingController):
"Account", self.debit_to, "account_currency", cache=True
)
if not self.due_date and self.customer:
self.due_date = get_due_date(self.posting_date, "Customer", self.customer, self.company)
self.due_date = get_due_date(
self.posting_date,
"Customer",
self.customer,
self.company,
template_name=self.payment_terms_template,
)
super().set_missing_values(for_validate)
@@ -1015,18 +1025,17 @@ class SalesInvoice(SellingController):
self.make_exchange_gain_loss_journal()
elif self.docstatus == 2:
cancel_exchange_gain_loss_journal(frappe._dict(doctype=self.doctype, name=self.name))
make_reverse_gl_entries(voucher_type=self.doctype, voucher_no=self.name)
if update_outstanding == "No":
from erpnext.accounts.doctype.gl_entry.gl_entry import update_outstanding_amt
update_outstanding_amt(
self.debit_to,
"Customer",
self.customer,
self.doctype,
self.return_against if cint(self.is_return) and self.return_against else self.name,
update_voucher_outstanding(
voucher_type=self.doctype,
voucher_no=self.return_against
if cint(self.is_return) and self.return_against
else self.name,
account=self.debit_to,
party_type="Customer",
party=self.customer,
)
elif self.docstatus == 2 and cint(self.update_stock) and cint(auto_accounting_for_stock):

View File

@@ -32,12 +32,16 @@ frappe.listview_settings["Sales Invoice"] = {
right_column: "grand_total",
onload: function (listview) {
listview.page.add_action_item(__("Delivery Note"), () => {
erpnext.bulk_transaction_processing.create(listview, "Sales Invoice", "Delivery Note");
});
if (frappe.model.can_create("Delivery Note")) {
listview.page.add_action_item(__("Delivery Note"), () => {
erpnext.bulk_transaction_processing.create(listview, "Sales Invoice", "Delivery Note");
});
}
listview.page.add_action_item(__("Payment"), () => {
erpnext.bulk_transaction_processing.create(listview, "Sales Invoice", "Payment Entry");
});
if (frappe.model.can_create("Payment Entry")) {
listview.page.add_action_item(__("Payment"), () => {
erpnext.bulk_transaction_processing.create(listview, "Sales Invoice", "Payment Entry");
});
}
},
};

View File

@@ -36,6 +36,7 @@ from erpnext.stock.doctype.stock_entry.test_stock_entry import (
from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import (
create_stock_reconciliation,
)
from erpnext.stock.get_item_details import get_item_tax_map
from erpnext.stock.utils import get_incoming_rate, get_stock_balance
@@ -415,9 +416,9 @@ class TestSalesInvoice(FrappeTestCase):
for i, k in enumerate(expected_values["keys"]):
self.assertEqual(d.get(k), expected_values[d.account_head][i])
self.assertEqual(si.base_grand_total, 1500.01)
self.assertEqual(si.grand_total, 1500.01)
self.assertEqual(si.rounding_adjustment, -0.01)
self.assertEqual(si.base_grand_total, 1500)
self.assertEqual(si.grand_total, 1500)
self.assertEqual(si.rounding_adjustment, 0)
def test_discount_amount_gl_entry(self):
frappe.db.set_value("Company", "_Test Company", "round_off_account", "Round Off - _TC")
@@ -1772,17 +1773,6 @@ class TestSalesInvoice(FrappeTestCase):
self.assertTrue(gle)
def test_invoice_exchange_rate(self):
si = create_sales_invoice(
customer="_Test Customer USD",
debit_to="_Test Receivable USD - _TC",
currency="USD",
conversion_rate=1,
do_not_save=1,
)
self.assertRaises(frappe.ValidationError, si.save)
def test_invalid_currency(self):
# Customer currency = USD
@@ -2817,13 +2807,80 @@ class TestSalesInvoice(FrappeTestCase):
item.save()
sales_invoice = create_sales_invoice(item="T Shirt", rate=700, do_not_submit=True)
item_tax_map = get_item_tax_map(
company=sales_invoice.company,
item_tax_template=sales_invoice.items[0].item_tax_template,
)
self.assertEqual(sales_invoice.items[0].item_tax_template, "_Test Account Excise Duty @ 12 - _TC")
self.assertEqual(sales_invoice.items[0].item_tax_rate, item_tax_map)
# Apply discount
sales_invoice.apply_discount_on = "Net Total"
sales_invoice.discount_amount = 300
sales_invoice.save()
item_tax_map = get_item_tax_map(
company=sales_invoice.company,
item_tax_template=sales_invoice.items[0].item_tax_template,
)
self.assertEqual(sales_invoice.items[0].item_tax_template, "_Test Account Excise Duty @ 10 - _TC")
self.assertEqual(sales_invoice.items[0].item_tax_rate, item_tax_map)
def test_item_tax_template_change_with_grand_total_discount(self):
"""
Test that when item tax template changes due to discount on Grand Total,
the tax calculations are consistent.
"""
item = create_item("Test Item With Multiple Tax Templates")
item.set("taxes", [])
item.append(
"taxes",
{
"item_tax_template": "_Test Account Excise Duty @ 10 - _TC",
"minimum_net_rate": 0,
"maximum_net_rate": 500,
},
)
item.append(
"taxes",
{
"item_tax_template": "_Test Account Excise Duty @ 12 - _TC",
"minimum_net_rate": 501,
"maximum_net_rate": 1000,
},
)
item.save()
si = create_sales_invoice(item=item.name, rate=700, do_not_save=True)
si.append(
"taxes",
{
"charge_type": "On Net Total",
"account_head": "_Test Account Excise Duty - _TC",
"cost_center": "_Test Cost Center - _TC",
"description": "Excise Duty",
"rate": 0,
},
)
si.insert()
self.assertEqual(si.items[0].item_tax_template, "_Test Account Excise Duty @ 12 - _TC")
si.apply_discount_on = "Grand Total"
si.discount_amount = 300
si.save()
# Verify template changed to 10%
self.assertEqual(si.items[0].item_tax_template, "_Test Account Excise Duty @ 10 - _TC")
self.assertEqual(si.taxes[0].tax_amount, 70) # 10% of 700
self.assertEqual(si.grand_total, 470) # 700 + 70 - 300
si.submit()
@change_settings("Selling Settings", {"enable_discount_accounting": 1})
def test_sales_invoice_with_discount_accounting_enabled(self):
@@ -3284,6 +3341,7 @@ class TestSalesInvoice(FrappeTestCase):
si.posting_date = getdate()
si.submit()
@change_settings("Accounts Settings", {"over_billing_allowance": 0})
def test_over_billing_case_against_delivery_note(self):
"""
Test a case where duplicating the item with qty = 1 in the invoice
@@ -3291,24 +3349,23 @@ class TestSalesInvoice(FrappeTestCase):
"""
from erpnext.stock.doctype.delivery_note.test_delivery_note import create_delivery_note
over_billing_allowance = frappe.db.get_single_value("Accounts Settings", "over_billing_allowance")
frappe.db.set_value("Accounts Settings", None, "over_billing_allowance", 0)
dn = create_delivery_note()
dn.submit()
si = make_sales_invoice(dn.name)
# make a copy of first item and add it to invoice
item_copy = frappe.copy_doc(si.items[0])
si.save()
si.items = [] # Clear existing items
si.append("items", item_copy)
si.save()
si.append("items", item_copy)
with self.assertRaises(frappe.ValidationError) as err:
si.submit()
si.save()
self.assertTrue("cannot overbill" in str(err.exception).lower())
frappe.db.set_value("Accounts Settings", None, "over_billing_allowance", over_billing_allowance)
dn.cancel()
@change_settings(
"Accounts Settings",
@@ -3846,6 +3903,7 @@ class TestSalesInvoice(FrappeTestCase):
si = create_sales_invoice(do_not_submit=True)
project = frappe.new_doc("Project")
project.company = "_Test Company"
project.project_name = "Test Total Billed Amount"
project.save()
@@ -3856,6 +3914,89 @@ class TestSalesInvoice(FrappeTestCase):
doc = frappe.get_doc("Project", project.name)
self.assertEqual(doc.total_billed_amount, si.grand_total)
def test_create_return_invoice_for_self_update(self):
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.controllers.sales_and_purchase_return import make_return_doc
invoice = create_sales_invoice()
payment_entry = get_payment_entry(dt=invoice.doctype, dn=invoice.name)
payment_entry.reference_no = "test001"
payment_entry.reference_date = getdate()
payment_entry.save()
payment_entry.submit()
r_invoice = make_return_doc(invoice.doctype, invoice.name)
r_invoice.update_outstanding_for_self = 0
r_invoice.save()
self.assertEqual(r_invoice.update_outstanding_for_self, 1)
r_invoice.submit()
self.assertNotEqual(r_invoice.outstanding_amount, 0)
invoice.reload()
self.assertEqual(invoice.outstanding_amount, 0)
def test_system_generated_exchange_gain_or_loss_je_after_repost(self):
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from erpnext.accounts.doctype.repost_accounting_ledger.test_repost_accounting_ledger import (
update_repost_settings,
)
update_repost_settings()
si = create_sales_invoice(
customer="_Test Customer USD",
debit_to="_Test Receivable USD - _TC",
currency="USD",
conversion_rate=80,
)
pe = get_payment_entry("Sales Invoice", si.name)
pe.reference_no = "10"
pe.reference_date = nowdate()
pe.paid_from_account_currency = si.currency
pe.paid_to_account_currency = "INR"
pe.source_exchange_rate = 85
pe.target_exchange_rate = 1
pe.paid_amount = si.outstanding_amount
pe.received_amount = 8500
pe.insert()
pe.submit()
ral = frappe.new_doc("Repost Accounting Ledger")
ral.company = si.company
ral.append("vouchers", {"voucher_type": si.doctype, "voucher_no": si.name})
ral.save()
ral.submit()
je = frappe.qb.DocType("Journal Entry")
jea = frappe.qb.DocType("Journal Entry Account")
q = (
(
frappe.qb.from_(je)
.join(jea)
.on(je.name == jea.parent)
.select(je.docstatus)
.where(
(je.voucher_type == "Exchange Gain Or Loss")
& (jea.reference_name == si.name)
& (jea.reference_type == "Sales Invoice")
& (je.is_system_generated == 1)
)
)
.limit(1)
.run()
)
self.assertEqual(q[0][0], 1)
def check_gl_entries(doc, voucher_no, expected_gle, posting_date):
gl_entries = frappe.db.sql(

View File

@@ -14,7 +14,8 @@
"advance_amount",
"allocated_amount",
"exchange_gain_loss",
"ref_exchange_rate"
"ref_exchange_rate",
"difference_posting_date"
],
"fields": [
{
@@ -30,7 +31,7 @@
"width": "250px"
},
{
"columns": 3,
"columns": 2,
"fieldname": "reference_name",
"fieldtype": "Dynamic Link",
"in_list_view": 1,
@@ -41,7 +42,7 @@
"read_only": 1
},
{
"columns": 3,
"columns": 2,
"fieldname": "remarks",
"fieldtype": "Text",
"in_list_view": 1,
@@ -112,13 +113,20 @@
"label": "Reference Exchange Rate",
"non_negative": 1,
"read_only": 1
},
{
"columns": 2,
"fieldname": "difference_posting_date",
"fieldtype": "Date",
"in_list_view": 1,
"label": "Difference Posting Date"
}
],
"idx": 1,
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2021-09-26 15:47:46.911595",
"modified": "2024-12-20 11:58:28.962370",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Advance",

View File

@@ -80,7 +80,7 @@
"collapsible": 0,
"columns": 0,
"fieldname": "rate",
"fieldtype": "Int",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -102,7 +102,7 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
@@ -199,7 +199,7 @@
"collapsible": 0,
"columns": 0,
"fieldname": "amount",
"fieldtype": "Int",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -221,7 +221,7 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
@@ -324,7 +324,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2018-01-10 18:32:36.201124",
"modified": "2025-12-10 08:06:40.611761",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Share Balance",
@@ -339,4 +339,4 @@
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
}
}

View File

@@ -13,17 +13,15 @@
"fields": [
{
"fieldname": "voucher_type",
"fieldtype": "Link",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Voucher Type",
"options": "DocType"
"label": "Voucher Type"
},
{
"fieldname": "voucher_name",
"fieldtype": "Dynamic Link",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Voucher Name",
"options": "voucher_type"
"label": "Voucher Name"
},
{
"fieldname": "taxable_amount",
@@ -36,7 +34,7 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2023-01-13 13:40:41.479208",
"modified": "2025-02-05 16:39:14.863698",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Tax Withheld Vouchers",

View File

@@ -75,7 +75,7 @@
},
{
"default": "0",
"description": "Even invoices with apply tax withholding unchecked will be considered for checking cumulative threshold breach",
"description": "Only payment entries with apply tax withholding unchecked will be considered for checking cumulative threshold breach",
"fieldname": "consider_party_ledger_amount",
"fieldtype": "Check",
"label": "Consider Entire Party Ledger Amount",
@@ -102,10 +102,11 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-07-27 21:47:34.396071",
"modified": "2025-07-30 07:13:51.785735",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Tax Withholding Category",
"naming_rule": "Set by user",
"owner": "Administrator",
"permissions": [
{
@@ -148,4 +149,4 @@
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1
}
}

View File

@@ -124,6 +124,9 @@ def get_party_tax_withholding_details(inv, tax_withholding_category=None):
cost_center = get_cost_center(inv)
tax_row.update({"cost_center": cost_center})
if cint(tax_details.round_off_tax_amount):
inv.round_off_applicable_accounts_for_tax_withholding = tax_details.account_head
if inv.doctype == "Purchase Invoice":
return tax_row, tax_deducted_on_advances, voucher_wise_amount
else:
@@ -215,14 +218,14 @@ def get_tax_row_for_tds(tax_details, tax_amount):
}
def get_lower_deduction_certificate(company, tax_details, pan_no):
def get_lower_deduction_certificate(company, posting_date, tax_details, pan_no):
ldc_name = frappe.db.get_value(
"Lower Deduction Certificate",
{
"pan_no": pan_no,
"tax_withholding_category": tax_details.tax_withholding_category,
"valid_from": (">=", tax_details.from_date),
"valid_upto": ("<=", tax_details.to_date),
"valid_from": ("<=", posting_date),
"valid_upto": (">=", posting_date),
"company": company,
},
"name",
@@ -233,7 +236,7 @@ def get_lower_deduction_certificate(company, tax_details, pan_no):
def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=None):
vouchers, voucher_wise_amount = get_invoice_vouchers(
vouchers, voucher_wise_amount, zero_rate_ldc_invoices = get_invoice_vouchers(
parties, tax_details, inv.company, party_type=party_type
)
@@ -270,7 +273,7 @@ def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=N
tax_amount = 0
if party_type == "Supplier":
ldc = get_lower_deduction_certificate(inv.company, tax_details, pan_no)
ldc = get_lower_deduction_certificate(inv.company, posting_date, tax_details, pan_no)
if tax_deducted:
net_total = inv.tax_withholding_net_total
if ldc:
@@ -287,7 +290,8 @@ def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=N
# once tds is deducted, not need to add vouchers in the invoice
voucher_wise_amount = {}
else:
tax_amount = get_tds_amount(ldc, parties, inv, tax_details, vouchers)
taxable_vouchers = list(set(vouchers) - set(zero_rate_ldc_invoices))
tax_amount = get_tds_amount(ldc, parties, inv, tax_details, taxable_vouchers)
elif party_type == "Customer":
if tax_deducted:
@@ -306,12 +310,33 @@ def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=N
def get_invoice_vouchers(parties, tax_details, company, party_type="Supplier"):
doctype = "Purchase Invoice" if party_type == "Supplier" else "Sales Invoice"
field = (
"base_tax_withholding_net_total as base_net_total" if party_type == "Supplier" else "base_net_total"
)
field = [
"name",
"base_tax_withholding_net_total as base_net_total" if party_type == "Supplier" else "base_net_total",
"posting_date",
]
voucher_wise_amount = {}
vouchers = []
ldcs = frappe.db.get_all(
"Lower Deduction Certificate",
filters={
"valid_from": [">=", tax_details.from_date],
"valid_upto": ["<=", tax_details.to_date],
"company": company,
"supplier": ["in", parties],
},
fields=["supplier", "valid_from", "valid_upto", "rate"],
)
doctype = "Purchase Invoice" if party_type == "Supplier" else "Sales Invoice"
field = [
"base_tax_withholding_net_total as base_net_total" if party_type == "Supplier" else "base_net_total",
"name",
"grand_total",
"posting_date",
]
filters = {
"company": company,
frappe.scrub(party_type): ["in", parties],
@@ -325,11 +350,31 @@ def get_invoice_vouchers(parties, tax_details, company, party_type="Supplier"):
{"apply_tds": 1, "tax_withholding_category": tax_details.get("tax_withholding_category")}
)
invoices_details = frappe.get_all(doctype, filters=filters, fields=["name", field])
invoices_details = frappe.get_all(doctype, filters=filters, fields=field)
ldcs = frappe.db.get_all(
"Lower Deduction Certificate",
filters={
"valid_from": [">=", tax_details.from_date],
"valid_upto": ["<=", tax_details.to_date],
"company": company,
"supplier": ["in", parties],
"rate": 0,
},
fields=["name", "supplier", "valid_from", "valid_upto"],
)
zero_rate_ldc_invoices = []
for d in invoices_details:
vouchers.append(d.name)
voucher_wise_amount.update({d.name: {"amount": d.base_net_total, "voucher_type": doctype}})
_voucher_detail = {"amount": d.base_net_total, "voucher_type": doctype}
if ldc := [x for x in ldcs if d.posting_date >= x.valid_from and d.posting_date <= x.valid_upto]:
if ldc[0].supplier in parties:
_voucher_detail.update({"amount": 0})
zero_rate_ldc_invoices.append(d.name)
voucher_wise_amount.update({d.name: _voucher_detail})
journal_entries_details = frappe.db.sql(
"""
@@ -360,7 +405,7 @@ def get_invoice_vouchers(parties, tax_details, company, party_type="Supplier"):
vouchers.append(d.name)
voucher_wise_amount.update({d.name: {"amount": d.amount, "voucher_type": "Journal Entry"}})
return vouchers, voucher_wise_amount
return vouchers, voucher_wise_amount, zero_rate_ldc_invoices
def get_payment_entry_vouchers(parties, tax_details, company, party_type="Supplier"):
@@ -507,7 +552,7 @@ def get_tds_amount(ldc, parties, inv, tax_details, vouchers):
)
supp_credit_amt = supp_jv_credit_amt
supp_credit_amt += inv.tax_withholding_net_total
supp_credit_amt += inv.get("tax_withholding_net_total", 0)
for type in payment_entry_amounts:
if type.payment_type == "Pay":
@@ -519,13 +564,15 @@ def get_tds_amount(ldc, parties, inv, tax_details, vouchers):
cumulative_threshold = tax_details.get("cumulative_threshold", 0)
if inv.doctype != "Payment Entry":
tax_withholding_net_total = inv.base_tax_withholding_net_total
tax_withholding_net_total = inv.get("base_tax_withholding_net_total", 0)
else:
tax_withholding_net_total = inv.tax_withholding_net_total
tax_withholding_net_total = inv.get("tax_withholding_net_total", 0)
if (threshold and tax_withholding_net_total >= threshold) or (
has_cumulative_threshold_breached = (
cumulative_threshold and (supp_credit_amt + supp_inv_credit_amt) >= cumulative_threshold
):
)
if (threshold and tax_withholding_net_total >= threshold) or (has_cumulative_threshold_breached):
# Get net total again as TDS is calculated on net total
# Grand is used to just check for threshold breach
net_total = (
@@ -533,9 +580,7 @@ def get_tds_amount(ldc, parties, inv, tax_details, vouchers):
)
supp_credit_amt += net_total
if (cumulative_threshold and supp_credit_amt >= cumulative_threshold) and cint(
tax_details.tax_on_excess_amount
):
if has_cumulative_threshold_breached and cint(tax_details.tax_on_excess_amount):
supp_credit_amt = net_total + tax_withholding_net_total - cumulative_threshold
if ldc and is_valid_certificate(ldc, inv.get("posting_date") or inv.get("transaction_date"), 0):
@@ -577,6 +622,7 @@ def get_tcs_amount(parties, inv, tax_details, vouchers, adv_vouchers):
conditions.append(ple.party.isin(parties))
conditions.append(ple.voucher_no == ple.against_voucher_no)
conditions.append(ple.company == inv.company)
conditions.append(ple.posting_date[tax_details.from_date : tax_details.to_date])
advance_amt = (
qb.from_(ple).select(Abs(Sum(ple.amount))).where(Criterion.all(conditions)).run()[0][0] or 0.0

View File

@@ -7,7 +7,7 @@ import unittest
import frappe
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import add_days, today
from frappe.utils import add_days, add_months, today
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
from erpnext.accounts.utils import get_fiscal_year
@@ -243,17 +243,18 @@ class TestTaxWithholdingCategory(FrappeTestCase):
frappe.db.set_value(
"Customer", "Test TCS Customer", "tax_withholding_category", "Cumulative Threshold TCS"
)
fiscal_year = get_fiscal_year(today(), company="_Test Company")
vouchers = []
# create advance payment
pe = create_payment_entry(
pe1 = create_payment_entry(
payment_type="Receive", party_type="Customer", party="Test TCS Customer", paid_amount=20000
)
pe.paid_from = "Debtors - _TC"
pe.paid_to = "Cash - _TC"
pe.submit()
vouchers.append(pe)
pe1.paid_from = "Debtors - _TC"
pe1.paid_to = "Cash - _TC"
pe1.submit()
vouchers.append(pe1)
# create invoice
si1 = create_sales_invoice(customer="Test TCS Customer", rate=5000)
@@ -275,6 +276,17 @@ class TestTaxWithholdingCategory(FrappeTestCase):
# make another invoice
# sum of unallocated amount from payment entry and this sales invoice will breach cumulative threashold
# TDS should be calculated
# this payment should not be considered for TCS calculation as it is outside of fiscal year
pe2 = create_payment_entry(
payment_type="Receive", party_type="Customer", party="Test TCS Customer", paid_amount=10000
)
pe2.paid_from = "Debtors - _TC"
pe2.paid_to = "Cash - _TC"
pe2.posting_date = add_days(fiscal_year[1], -10)
pe2.submit()
vouchers.append(pe2)
si2 = create_sales_invoice(customer="Test TCS Customer", rate=15000)
si2.submit()
vouchers.append(si2)
@@ -614,6 +626,49 @@ class TestTaxWithholdingCategory(FrappeTestCase):
pi2.cancel()
pi3.cancel()
def test_ldc_at_0_rate(self):
frappe.db.set_value(
"Supplier",
"Test LDC Supplier",
{
"tax_withholding_category": "Test Service Category",
"pan": "ABCTY1234D",
},
)
fiscal_year = get_fiscal_year(today(), company="_Test Company")
valid_from = fiscal_year[1]
valid_upto = add_months(valid_from, 1)
create_lower_deduction_certificate(
supplier="Test LDC Supplier",
certificate_no="1AE0423AAJ",
tax_withholding_category="Test Service Category",
tax_rate=0,
limit=50000,
valid_from=valid_from,
valid_upto=valid_upto,
)
pi1 = create_purchase_invoice(
supplier="Test LDC Supplier", rate=35000, posting_date=valid_from, set_posting_time=True
)
pi1.submit()
self.assertEqual(pi1.taxes, [])
pi2 = create_purchase_invoice(
supplier="Test LDC Supplier",
rate=35000,
posting_date=add_days(valid_upto, 1),
set_posting_time=True,
)
pi2.submit()
self.assertEqual(len(pi2.taxes), 1)
# pi1 net total shouldn't be included as it lies within LDC at rate of '0'
self.assertEqual(pi2.taxes[0].tax_amount, 3500)
pi1.cancel()
pi2.cancel()
def set_previous_fy_and_tax_category(self):
test_company = "_Test Company"
category = "Cumulative Threshold TDS"
@@ -771,7 +826,8 @@ def create_purchase_invoice(**args):
pi = frappe.get_doc(
{
"doctype": "Purchase Invoice",
"posting_date": today(),
"set_posting_time": args.set_posting_time or False,
"posting_date": args.posting_date or today(),
"apply_tds": 0 if args.do_not_apply_tds else 1,
"supplier": args.supplier,
"company": "_Test Company",
@@ -1099,7 +1155,9 @@ def create_tax_withholding_category(
).insert()
def create_lower_deduction_certificate(supplier, tax_withholding_category, tax_rate, certificate_no, limit):
def create_lower_deduction_certificate(
supplier, tax_withholding_category, tax_rate, certificate_no, limit, valid_from=None, valid_upto=None
):
fiscal_year = get_fiscal_year(today(), company="_Test Company")
if not frappe.db.exists("Lower Deduction Certificate", certificate_no):
frappe.get_doc(
@@ -1110,8 +1168,8 @@ def create_lower_deduction_certificate(supplier, tax_withholding_category, tax_r
"certificate_no": certificate_no,
"tax_withholding_category": tax_withholding_category,
"fiscal_year": fiscal_year[0],
"valid_from": fiscal_year[1],
"valid_upto": fiscal_year[2],
"valid_from": valid_from or fiscal_year[1],
"valid_upto": valid_upto or fiscal_year[2],
"rate": tax_rate,
"certificate_limit": limit,
}

View File

@@ -179,6 +179,15 @@ def process_gl_map(gl_map, merge_entries=True, precision=None):
def distribute_gl_based_on_cost_center_allocation(gl_map, precision=None):
round_off_account, default_currency = frappe.get_cached_value(
"Company", gl_map[0].company, ["round_off_account", "default_currency"]
)
if not precision:
precision = get_field_precision(
frappe.get_meta("GL Entry").get_field("debit"),
currency=default_currency,
)
new_gl_map = []
for d in gl_map:
cost_center = d.get("cost_center")
@@ -192,6 +201,11 @@ def distribute_gl_based_on_cost_center_allocation(gl_map, precision=None):
new_gl_map.append(d)
continue
if d.account == round_off_account:
d.cost_center = cost_center_allocation[0][0]
new_gl_map.append(d)
continue
for sub_cost_center, percentage in cost_center_allocation:
gle = copy.deepcopy(d)
gle.cost_center = sub_cost_center

View File

@@ -552,12 +552,13 @@ def validate_party_accounts(doc):
@frappe.whitelist()
def get_due_date(posting_date, party_type, party, company=None, bill_date=None):
def get_due_date(posting_date, party_type, party, company=None, bill_date=None, template_name=None):
"""Get due date from `Payment Terms Template`"""
due_date = None
if (bill_date or posting_date) and party:
due_date = bill_date or posting_date
template_name = get_payment_terms_template(party, party_type, company)
if not template_name:
template_name = get_payment_terms_template(party, party_type, company)
if template_name:
due_date = get_due_date_from_template(template_name, posting_date, bill_date).strftime("%Y-%m-%d")
@@ -597,35 +598,34 @@ def get_due_date_from_template(template_name, posting_date, bill_date):
def validate_due_date(
posting_date, due_date, party_type, party, company=None, bill_date=None, template_name=None
posting_date, due_date, party_type, party, company=None, bill_date=None, template_name=None, doctype=None
):
if getdate(due_date) < getdate(posting_date):
frappe.throw(_("Due Date cannot be before Posting / Supplier Invoice Date"))
else:
if not template_name:
return
validate_due_date_with_template(posting_date, due_date, bill_date, template_name, doctype)
default_due_date = get_due_date_from_template(template_name, posting_date, bill_date).strftime(
"%Y-%m-%d"
)
if not default_due_date:
return
def validate_due_date_with_template(posting_date, due_date, bill_date, template_name, doctype=None):
if not template_name:
return
if default_due_date != posting_date and getdate(due_date) > getdate(default_due_date):
is_credit_controller = (
frappe.db.get_single_value("Accounts Settings", "credit_controller") in frappe.get_roles()
default_due_date = format(get_due_date_from_template(template_name, posting_date, bill_date))
if not default_due_date:
return
if default_due_date != posting_date and getdate(due_date) > getdate(default_due_date):
if frappe.db.get_single_value("Accounts Settings", "credit_controller") in frappe.get_roles():
party_type = "supplier" if doctype == "Purchase Invoice" else "customer"
msgprint(
_("Note: Due Date exceeds allowed {0} credit days by {1} day(s)").format(
party_type, date_diff(due_date, default_due_date)
)
)
if is_credit_controller:
msgprint(
_("Note: Due / Reference Date exceeds allowed customer credit days by {0} day(s)").format(
date_diff(due_date, default_due_date)
)
)
else:
frappe.throw(
_("Due / Reference Date cannot be after {0}").format(formatdate(default_due_date))
)
else:
frappe.throw(_("Due Date cannot be after {0}").format(formatdate(default_due_date)))
@frappe.whitelist()
@@ -903,12 +903,16 @@ def get_party_shipping_address(doctype: str, name: str) -> str | None:
["is_shipping_address", "=", 1],
["address_type", "=", "Shipping"],
],
pluck="name",
limit=1,
fields=["name", "is_shipping_address"],
order_by="is_shipping_address DESC",
)
return shipping_addresses[0] if shipping_addresses else None
if shipping_addresses and shipping_addresses[0].is_shipping_address == 1:
return shipping_addresses[0].name
if len(shipping_addresses) == 1:
return shipping_addresses[0].name
else:
return None
def get_partywise_advanced_payment_amount(

View File

@@ -111,6 +111,7 @@ frappe.query_reports["Accounts Payable"] = {
fieldname: "party",
label: __("Party"),
fieldtype: "MultiSelectList",
options: "party_type",
get_data: function (txt) {
if (!frappe.query_report.filters) return;

View File

@@ -88,6 +88,7 @@ frappe.query_reports["Accounts Payable Summary"] = {
fieldname: "party",
label: __("Party"),
fieldtype: "MultiSelectList",
options: "party_type",
get_data: function (txt) {
if (!frappe.query_report.filters) return;

View File

@@ -282,4 +282,4 @@
{% } %}
</tbody>
</table>
<p class="text-right text-muted">{{ __("Printed On ") }}{%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}</p>
<p class="text-right text-muted">{%= __("Printed on {0}", [frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string())]) %}</p>

View File

@@ -56,6 +56,7 @@ frappe.query_reports["Accounts Receivable"] = {
fieldname: "party",
label: __("Party"),
fieldtype: "MultiSelectList",
options: "party_type",
get_data: function (txt) {
if (!frappe.query_report.filters) return;

View File

@@ -6,6 +6,7 @@ from collections import OrderedDict
import frappe
from frappe import _, qb, query_builder, scrub
from frappe.database.schema import get_definition
from frappe.query_builder import Criterion
from frappe.query_builder.functions import Date, Substring, Sum
from frappe.utils import cint, cstr, flt, getdate, nowdate
@@ -14,7 +15,10 @@ from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
get_accounting_dimensions,
get_dimension_with_children,
)
from erpnext.accounts.utils import get_currency_precision
from erpnext.accounts.utils import (
build_qb_match_conditions,
get_currency_precision,
)
# This report gives a summary of all Outstanding Invoices considering the following
@@ -49,6 +53,10 @@ class ReceivablePayableReport:
self.age_as_on = (
getdate(nowdate()) if self.filters.report_date > getdate(nowdate()) else self.filters.report_date
)
self.ple_fetch_method = (
frappe.db.get_single_value("Accounts Settings", "receivable_payable_fetch_method")
or "Buffered Cursor"
) # Fail Safe
def run(self, args):
self.filters.update(args)
@@ -85,13 +93,7 @@ class ReceivablePayableReport:
self.skip_total_row = 1
def get_data(self):
self.get_ple_entries()
self.get_sales_invoices_or_customers_based_on_sales_person()
self.voucher_balance = OrderedDict()
self.init_voucher_balance() # invoiced, paid, credit_note, outstanding
# Build delivery note map against all sales invoices
self.build_delivery_note_map()
# Get invoice details like bill_no, due_date etc for all invoices
self.get_invoice_details()
@@ -105,12 +107,45 @@ class ReceivablePayableReport:
# Get Exchange Rate Revaluations
self.get_exchange_rate_revaluations()
self.prepare_ple_query()
self.data = []
self.voucher_balance = OrderedDict()
if self.ple_fetch_method == "Buffered Cursor":
self.fetch_ple_in_buffered_cursor()
elif self.ple_fetch_method == "UnBuffered Cursor":
self.fetch_ple_in_unbuffered_cursor()
elif self.ple_fetch_method == "Raw SQL":
self.fetch_ple_in_sql_procedures()
# Build delivery note map against all sales invoices
self.build_delivery_note_map()
self.build_data()
def fetch_ple_in_buffered_cursor(self):
self.ple_entries = self.ple_query.run(as_dict=True)
for ple in self.ple_entries:
self.init_voucher_balance(ple) # invoiced, paid, credit_note, outstanding
# This is unavoidable. Initialization and allocation cannot happen in same loop
for ple in self.ple_entries:
self.update_voucher_balance(ple)
self.build_data()
delattr(self, "ple_entries")
def fetch_ple_in_unbuffered_cursor(self):
self.ple_entries = []
with frappe.db.unbuffered_cursor():
for ple in self.ple_query.run(as_dict=True, as_iterator=True):
self.init_voucher_balance(ple) # invoiced, paid, credit_note, outstanding
self.ple_entries.append(ple)
# This is unavoidable. Initialization and allocation cannot happen in same loop
for ple in self.ple_entries:
self.update_voucher_balance(ple)
delattr(self, "ple_entries")
def build_voucher_dict(self, ple):
return frappe._dict(
@@ -129,26 +164,24 @@ class ReceivablePayableReport:
paid_in_account_currency=0.0,
credit_note_in_account_currency=0.0,
outstanding_in_account_currency=0.0,
cost_center=ple.cost_center,
)
def init_voucher_balance(self):
# build all keys, since we want to exclude vouchers beyond the report date
for ple in self.ple_entries:
# get the balance object for voucher_type
def init_voucher_balance(self, ple):
if self.filters.get("ignore_accounts"):
key = (ple.voucher_type, ple.voucher_no, ple.party)
else:
key = (ple.account, ple.voucher_type, ple.voucher_no, ple.party)
if self.filters.get("ignore_accounts"):
key = (ple.voucher_type, ple.voucher_no, ple.party)
else:
key = (ple.account, ple.voucher_type, ple.voucher_no, ple.party)
if key not in self.voucher_balance:
self.voucher_balance[key] = self.build_voucher_dict(ple)
if key not in self.voucher_balance:
self.voucher_balance[key] = self.build_voucher_dict(ple)
if ple.voucher_type == ple.against_voucher_type and ple.voucher_no == ple.against_voucher_no:
self.voucher_balance[key].cost_center = ple.cost_center
self.get_invoices(ple)
self.get_invoices(ple)
if self.filters.get("group_by_party"):
self.init_subtotal_row(ple.party)
if self.filters.get("group_by_party"):
self.init_subtotal_row(ple.party)
if self.filters.get("group_by_party") and not self.filters.get("in_party_currency"):
self.init_subtotal_row("Total")
@@ -270,8 +303,78 @@ class ReceivablePayableReport:
row.paid -= amount
row.paid_in_account_currency -= amount_in_account_currency
if not row.cost_center and ple.cost_center:
row.cost_center = str(ple.cost_center)
def fetch_ple_in_sql_procedures(self):
self.proc = InitSQLProceduresForAR()
build_balance = f"""
begin not atomic
declare done boolean default false;
declare rec1 row type of `{self.proc._row_def_table_name}`;
declare ple cursor for {self.ple_query.get_sql()};
declare continue handler for not found set done = true;
open ple;
fetch ple into rec1;
while not done do
call {self.proc.init_procedure_name}(rec1);
fetch ple into rec1;
end while;
close ple;
set done = false;
open ple;
fetch ple into rec1;
while not done do
call {self.proc.allocate_procedure_name}(rec1);
fetch ple into rec1;
end while;
close ple;
end;
"""
frappe.db.sql(build_balance)
balances = frappe.db.sql(
f"""select
name,
voucher_type,
voucher_no,
party,
party_account `account`,
posting_date,
account_currency,
cost_center,
sum(invoiced) `invoiced`,
sum(paid) `paid`,
sum(credit_note) `credit_note`,
sum(invoiced) - sum(paid) - sum(credit_note) `outstanding`,
sum(invoiced_in_account_currency) `invoiced_in_account_currency`,
sum(paid_in_account_currency) `paid_in_account_currency`,
sum(credit_note_in_account_currency) `credit_note_in_account_currency`,
sum(invoiced_in_account_currency) - sum(paid_in_account_currency) - sum(credit_note_in_account_currency) `outstanding_in_account_currency`
from `{self.proc._voucher_balance_name}` group by name order by posting_date;""",
as_dict=True,
)
for x in balances:
if self.filters.get("ignore_accounts"):
key = (x.voucher_type, x.voucher_no, x.party)
else:
key = (x.account, x.voucher_type, x.voucher_no, x.party)
_d = self.build_voucher_dict(x)
for field in [
"invoiced",
"paid",
"credit_note",
"outstanding",
"invoiced_in_account_currency",
"paid_in_account_currency",
"credit_note_in_account_currency",
"outstanding_in_account_currency",
"cost_center",
]:
_d[field] = x.get(field)
self.voucher_balance[key] = _d
def update_sub_total_row(self, row, party):
total_row = self.total_row_map.get(party)
@@ -499,7 +602,7 @@ class ReceivablePayableReport:
ps.description, ps.paid_amount, ps.discounted_amount
from `tab{row.voucher_type}` si, `tabPayment Schedule` ps
where
si.name = ps.parent and
si.name = ps.parent and ps.parenttype = '{row.voucher_type}' and
si.name = %s and
si.is_return = 0
order by ps.paid_amount desc, due_date
@@ -529,9 +632,7 @@ class ReceivablePayableReport:
self.append_payment_term(row, d, term)
def append_payment_term(self, row, d, term):
if (
self.filters.get("customer") or self.filters.get("supplier")
) and d.currency == d.party_account_currency:
if d.currency == d.party_account_currency:
invoiced = d.payment_amount
else:
invoiced = d.base_payment_amount
@@ -767,7 +868,7 @@ class ReceivablePayableReport:
index = 4
row["range" + str(index + 1)] = row.outstanding
def get_ple_entries(self):
def prepare_ple_query(self):
# get all the GL entries filtered by the given filters
self.prepare_conditions()
@@ -815,12 +916,15 @@ class ReceivablePayableReport:
else:
query = query.select(ple.remarks)
if match_conditions := build_qb_match_conditions("Payment Ledger Entry"):
query = query.where(Criterion.all(match_conditions))
if self.filters.get("group_by_party"):
query = query.orderby(self.ple.party, self.ple.posting_date)
else:
query = query.orderby(self.ple.posting_date, self.ple.party)
self.ple_entries = query.run(as_dict=True)
self.ple_query = query
def get_sales_invoices_or_customers_based_on_sales_person(self):
if self.filters.get("sales_person"):
@@ -1207,3 +1311,134 @@ def get_customer_group_with_children(customer_groups):
frappe.throw(_("Customer Group: {0} does not exist").format(d))
return list(set(all_customer_groups))
class InitSQLProceduresForAR:
"""
Initialize SQL Procedures, Functions and Temporary tables to build Receivable / Payable report
"""
_varchar_type = get_definition("Data")
_currency_type = get_definition("Currency")
# Temporary Tables
_voucher_balance_name = "_ar_voucher_balance"
_voucher_balance_definition = f"""
create temporary table `{_voucher_balance_name}`(
name {_varchar_type},
voucher_type {_varchar_type},
voucher_no {_varchar_type},
party {_varchar_type},
party_account {_varchar_type},
posting_date date,
account_currency {_varchar_type},
cost_center {_varchar_type},
invoiced {_currency_type},
paid {_currency_type},
credit_note {_currency_type},
invoiced_in_account_currency {_currency_type},
paid_in_account_currency {_currency_type},
credit_note_in_account_currency {_currency_type}) engine=memory;
"""
_row_def_table_name = "_ar_ple_row"
_row_def_table_definition = f"""
create temporary table `{_row_def_table_name}`(
name {_varchar_type},
account {_varchar_type},
voucher_type {_varchar_type},
voucher_no {_varchar_type},
against_voucher_type {_varchar_type},
against_voucher_no {_varchar_type},
party_type {_varchar_type},
cost_center {_varchar_type},
party {_varchar_type},
posting_date date,
due_date date,
account_currency {_varchar_type},
amount {_currency_type},
amount_in_account_currency {_currency_type}) engine=memory;
"""
# Function
genkey_function_name = "ar_genkey"
genkey_function_sql = f"""
create function `{genkey_function_name}`(rec row type of `{_row_def_table_name}`, allocate bool) returns char(40)
begin
if allocate then
return sha1(concat_ws(',', rec.account, rec.against_voucher_type, rec.against_voucher_no, rec.party));
else
return sha1(concat_ws(',', rec.account, rec.voucher_type, rec.voucher_no, rec.party));
end if;
end
"""
# Procedures
init_procedure_name = "ar_init_tmp_table"
init_procedure_sql = f"""
create procedure ar_init_tmp_table(in ple row type of `{_row_def_table_name}`)
begin
if not exists (select name from `{_voucher_balance_name}` where name = `{genkey_function_name}`(ple, false))
then
insert into `{_voucher_balance_name}` values (`{genkey_function_name}`(ple, false), ple.voucher_type, ple.voucher_no, ple.party, ple.account, ple.posting_date, ple.account_currency, ple.cost_center, 0, 0, 0, 0, 0, 0);
end if;
end;
"""
allocate_procedure_name = "ar_allocate_to_tmp_table"
allocate_procedure_sql = f"""
create procedure ar_allocate_to_tmp_table(in ple row type of `{_row_def_table_name}`)
begin
declare invoiced {_currency_type} default 0;
declare invoiced_in_account_currency {_currency_type} default 0;
declare paid {_currency_type} default 0;
declare paid_in_account_currency {_currency_type} default 0;
declare credit_note {_currency_type} default 0;
declare credit_note_in_account_currency {_currency_type} default 0;
if ple.amount > 0 then
if (ple.voucher_type in ("Journal Entry", "Payment Entry") and (ple.voucher_no != ple.against_voucher_no)) then
set paid = -1 * ple.amount;
set paid_in_account_currency = -1 * ple.amount_in_account_currency;
else
set invoiced = ple.amount;
set invoiced_in_account_currency = ple.amount_in_account_currency;
end if;
else
if ple.voucher_type in ("Sales Invoice", "Purchase Invoice") then
if (ple.voucher_no = ple.against_voucher_no) then
set paid = -1 * ple.amount;
set paid_in_account_currency = -1 * ple.amount_in_account_currency;
else
set credit_note = -1 * ple.amount;
set credit_note_in_account_currency = -1 * ple.amount_in_account_currency;
end if;
else
set paid = -1 * ple.amount;
set paid_in_account_currency = -1 * ple.amount_in_account_currency;
end if;
end if;
insert into `{_voucher_balance_name}` values (`{genkey_function_name}`(ple, true), ple.against_voucher_type, ple.against_voucher_no, ple.party, ple.account, ple.posting_date, ple.account_currency,'', invoiced, paid, 0, invoiced_in_account_currency, paid_in_account_currency, 0);
end;
"""
def __init__(self):
existing_procedures = frappe.db.get_routines()
if self.genkey_function_name not in existing_procedures:
frappe.db.sql(self.genkey_function_sql)
if self.init_procedure_name not in existing_procedures:
frappe.db.sql(self.init_procedure_sql)
if self.allocate_procedure_name not in existing_procedures:
frappe.db.sql(self.allocate_procedure_sql)
frappe.db.sql(f"drop table if exists `{self._voucher_balance_name}`")
frappe.db.sql(self._voucher_balance_definition)
frappe.db.sql(f"drop table if exists `{self._row_def_table_name}`")
frappe.db.sql(self._row_def_table_definition)

View File

@@ -21,7 +21,7 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase):
def tearDown(self):
frappe.db.rollback()
def create_sales_invoice(self, no_payment_schedule=False, do_not_submit=False):
def create_sales_invoice(self, no_payment_schedule=False, do_not_submit=False, **args):
frappe.set_user("Administrator")
si = create_sales_invoice(
item=self.item,
@@ -34,6 +34,7 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase):
rate=100,
price_list_rate=100,
do_not_save=1,
**args,
)
if not no_payment_schedule:
si.append(
@@ -111,7 +112,7 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase):
self.assertEqual(expected_data[0], [row.invoiced, row.paid, row.credit_note])
pos_inv.cancel()
def test_accounts_receivable(self):
def test_accounts_receivable_with_payment(self):
filters = {
"company": self.company,
"based_on_payment_terms": 1,
@@ -151,11 +152,15 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase):
cr_note = self.create_credit_note(si.name, do_not_submit=True)
cr_note.update_outstanding_for_self = False
cr_note.save().submit()
# as the invoice partially paid and returning the full amount so the outstanding amount should be True
self.assertEqual(cr_note.update_outstanding_for_self, True)
report = execute(filters)
expected_data_after_credit_note = [100, 0, 0, 40, -40, self.debit_to]
expected_data_after_credit_note = [0, 0, 100, 0, -100, self.debit_to]
row = report[1][0]
row = report[1][-1]
self.assertEqual(
expected_data_after_credit_note,
[
@@ -168,6 +173,105 @@ class TestAccountsReceivable(AccountsTestMixin, FrappeTestCase):
],
)
def test_accounts_receivable_without_payment(self):
filters = {
"company": self.company,
"based_on_payment_terms": 1,
"report_date": today(),
"range1": 30,
"range2": 60,
"range3": 90,
"range4": 120,
"show_remarks": True,
}
# check invoice grand total and invoiced column's value for 3 payment terms
si = self.create_sales_invoice()
report = execute(filters)
expected_data = [[100, 30, "No Remarks"], [100, 50, "No Remarks"], [100, 20, "No Remarks"]]
for i in range(3):
row = report[1][i - 1]
self.assertEqual(expected_data[i - 1], [row.invoice_grand_total, row.invoiced, row.remarks])
# check invoice grand total, invoiced, paid and outstanding column's value after credit note
cr_note = self.create_credit_note(si.name, do_not_submit=True)
cr_note.update_outstanding_for_self = False
cr_note.save().submit()
self.assertEqual(cr_note.update_outstanding_for_self, False)
report = execute(filters)
row = report[1]
self.assertTrue(len(row) == 0)
def test_accounts_receivable_with_partial_payment(self):
filters = {
"company": self.company,
"based_on_payment_terms": 1,
"report_date": today(),
"range1": 30,
"range2": 60,
"range3": 90,
"range4": 120,
"show_remarks": True,
}
# check invoice grand total and invoiced column's value for 3 payment terms
si = self.create_sales_invoice(qty=2)
report = execute(filters)
expected_data = [[200, 60, "No Remarks"], [200, 100, "No Remarks"], [200, 40, "No Remarks"]]
for i in range(3):
row = report[1][i - 1]
self.assertEqual(expected_data[i - 1], [row.invoice_grand_total, row.invoiced, row.remarks])
# check invoice grand total, invoiced, paid and outstanding column's value after payment
self.create_payment_entry(si.name)
report = execute(filters)
expected_data_after_payment = [[200, 60, 40, 20], [200, 100, 0, 100], [200, 40, 0, 40]]
for i in range(3):
row = report[1][i - 1]
self.assertEqual(
expected_data_after_payment[i - 1],
[row.invoice_grand_total, row.invoiced, row.paid, row.outstanding],
)
# check invoice grand total, invoiced, paid and outstanding column's value after credit note
cr_note = self.create_credit_note(si.name, do_not_submit=True)
cr_note.update_outstanding_for_self = False
cr_note.save().submit()
self.assertFalse(cr_note.update_outstanding_for_self)
report = execute(filters)
expected_data_after_credit_note = [
[200, 100, 0, 80, 20, self.debit_to],
[200, 40, 0, 0, 40, self.debit_to],
]
for i in range(2):
row = report[1][i - 1]
self.assertEqual(
expected_data_after_credit_note[i - 1],
[
row.invoice_grand_total,
row.invoiced,
row.paid,
row.credit_note,
row.outstanding,
row.party_account,
],
)
def test_cr_note_flag_to_update_self(self):
filters = {
"company": self.company,

View File

@@ -88,6 +88,7 @@ frappe.query_reports["Accounts Receivable Summary"] = {
fieldname: "party",
label: __("Party"),
fieldtype: "MultiSelectList",
options: "party_type",
get_data: function (txt) {
if (!frappe.query_report.filters) return;

View File

@@ -25,11 +25,26 @@ frappe.query_reports["Asset Depreciations and Balances"] = {
default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
reqd: 1,
},
{
fieldname: "group_by",
label: __("Group By"),
fieldtype: "Select",
options: ["Asset Category", "Asset"],
default: "Asset Category",
},
{
fieldname: "asset_category",
label: __("Asset Category"),
fieldtype: "Link",
options: "Asset Category",
depends_on: "eval: doc.group_by == 'Asset Category'",
},
{
fieldname: "asset",
label: __("Asset"),
fieldtype: "Link",
options: "Asset",
depends_on: "eval: doc.group_by == 'Asset'",
},
],
};

View File

@@ -14,21 +14,28 @@ def execute(filters=None):
def get_data(filters):
if filters.get("group_by") == "Asset Category":
return get_group_by_asset_category_data(filters)
elif filters.get("group_by") == "Asset":
return get_group_by_asset_data(filters)
def get_group_by_asset_category_data(filters):
data = []
asset_categories = get_asset_categories(filters)
assets = get_assets(filters)
asset_categories = get_asset_categories_for_grouped_by_category(filters)
assets = get_assets_for_grouped_by_category(filters)
for asset_category in asset_categories:
row = frappe._dict()
# row.asset_category = asset_category
row.update(asset_category)
row.cost_as_on_to_date = (
flt(row.cost_as_on_from_date)
+ flt(row.cost_of_new_purchase)
- flt(row.cost_of_sold_asset)
- flt(row.cost_of_scrapped_asset)
row.value_as_on_to_date = (
flt(row.value_as_on_from_date)
+ flt(row.value_of_new_purchase)
- flt(row.value_of_sold_asset)
- flt(row.value_of_scrapped_asset)
- flt(row.value_of_capitalized_asset)
)
row.update(
@@ -38,17 +45,19 @@ def get_data(filters):
if asset["asset_category"] == asset_category.get("asset_category", "")
)
)
row.accumulated_depreciation_as_on_to_date = (
flt(row.accumulated_depreciation_as_on_from_date)
+ flt(row.depreciation_amount_during_the_period)
- flt(row.depreciation_eliminated_during_the_period)
- flt(row.depreciation_eliminated_via_reversal)
)
row.net_asset_value_as_on_from_date = flt(row.cost_as_on_from_date) - flt(
row.net_asset_value_as_on_from_date = flt(row.value_as_on_from_date) - flt(
row.accumulated_depreciation_as_on_from_date
)
row.net_asset_value_as_on_to_date = flt(row.cost_as_on_to_date) - flt(
row.net_asset_value_as_on_to_date = flt(row.value_as_on_to_date) - flt(
row.accumulated_depreciation_as_on_to_date
)
@@ -57,52 +66,71 @@ def get_data(filters):
return data
def get_asset_categories(filters):
def get_asset_categories_for_grouped_by_category(filters):
condition = ""
if filters.get("asset_category"):
condition += " and asset_category = %(asset_category)s"
condition += " and a.asset_category = %(asset_category)s"
# nosemgrep
return frappe.db.sql(
f"""
SELECT asset_category,
ifnull(sum(case when purchase_date < %(from_date)s then
case when ifnull(disposal_date, 0) = 0 or disposal_date >= %(from_date)s then
gross_purchase_amount
SELECT a.asset_category,
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
else
0
end
else
0
end), 0) as cost_as_on_from_date,
ifnull(sum(case when purchase_date >= %(from_date)s then
gross_purchase_amount
end), 0) as value_as_on_from_date,
ifnull(sum(case when a.purchase_date >= %(from_date)s then
a.gross_purchase_amount
else
0
end), 0) as cost_of_new_purchase,
ifnull(sum(case when ifnull(disposal_date, 0) != 0
and disposal_date >= %(from_date)s
and disposal_date <= %(to_date)s then
case when status = "Sold" then
gross_purchase_amount
end), 0) as value_of_new_purchase,
ifnull(sum(case when ifnull(a.disposal_date, 0) != 0
and a.disposal_date >= %(from_date)s
and a.disposal_date <= %(to_date)s then
case when a.status = "Sold" then
a.gross_purchase_amount
else
0
end
else
0
end), 0) as cost_of_sold_asset,
ifnull(sum(case when ifnull(disposal_date, 0) != 0
and disposal_date >= %(from_date)s
and disposal_date <= %(to_date)s then
case when status = "Scrapped" then
gross_purchase_amount
end), 0) as value_of_sold_asset,
ifnull(sum(case when ifnull(a.disposal_date, 0) != 0
and a.disposal_date >= %(from_date)s
and a.disposal_date <= %(to_date)s then
case when a.status = "Scrapped" then
a.gross_purchase_amount
else
0
end
else
0
end), 0) as cost_of_scrapped_asset
from `tabAsset`
where docstatus=1 and company=%(company)s and purchase_date <= %(to_date)s {condition}
group by asset_category
end), 0) as value_of_scrapped_asset,
ifnull(sum(case when ifnull(a.disposal_date, 0) != 0
and a.disposal_date >= %(from_date)s
and a.disposal_date <= %(to_date)s then
case when a.status = "Capitalized" then
a.gross_purchase_amount
else
0
end
else
0
end), 0) as value_of_capitalized_asset
from `tabAsset` a
where a.docstatus=1 and a.company=%(company)s and a.purchase_date <= %(to_date)s {condition}
and not exists(
select 1 from `tabAsset Capitalization Asset Item` acai join `tabAsset Capitalization` ac on acai.parent=ac.name
where acai.asset = a.name
and ac.posting_date < %(from_date)s
and ac.docstatus=1
)
group by a.asset_category
""",
{
"to_date": filters.to_date,
@@ -114,14 +142,17 @@ def get_asset_categories(filters):
)
def get_assets(filters):
def get_assets_for_grouped_by_category(filters):
condition = ""
if filters.get("asset_category"):
condition = " and a.asset_category = '{}'".format(filters.get("asset_category"))
condition = f" and a.asset_category = '{filters.get('asset_category')}'"
# nosemgrep
return frappe.db.sql(
"""
f"""
SELECT results.asset_category,
sum(results.accumulated_depreciation_as_on_from_date) as accumulated_depreciation_as_on_from_date,
sum(results.depreciation_eliminated_via_reversal) as depreciation_eliminated_via_reversal,
sum(results.depreciation_eliminated_during_the_period) as depreciation_eliminated_during_the_period,
sum(results.depreciation_amount_during_the_period) as depreciation_amount_during_the_period
from (SELECT a.asset_category,
@@ -130,6 +161,11 @@ def get_assets(filters):
else
0
end), 0) as accumulated_depreciation_as_on_from_date,
ifnull(sum(case when gle.posting_date <= %(to_date)s and ifnull(a.disposal_date, 0) = 0 then
gle.credit
else
0
end), 0) as depreciation_eliminated_via_reversal,
ifnull(sum(case when ifnull(a.disposal_date, 0) != 0 and a.disposal_date >= %(from_date)s
and a.disposal_date <= %(to_date)s and gle.posting_date <= a.disposal_date then
gle.debit
@@ -149,15 +185,22 @@ def get_assets(filters):
aca.parent = a.asset_category and aca.company_name = %(company)s
join `tabCompany` company on
company.name = %(company)s
where a.docstatus=1 and a.company=%(company)s and a.purchase_date <= %(to_date)s and gle.debit != 0 and gle.is_cancelled = 0 and gle.account = ifnull(aca.depreciation_expense_account, company.depreciation_expense_account) {0}
where
a.docstatus=1
and a.company=%(company)s
and a.purchase_date <= %(to_date)s
and gle.is_cancelled = 0
and gle.account = ifnull(aca.depreciation_expense_account, company.depreciation_expense_account)
{condition}
group by a.asset_category
union
SELECT a.asset_category,
ifnull(sum(case when ifnull(a.disposal_date, 0) != 0 and (a.disposal_date < %(from_date)s or a.disposal_date > %(to_date)s) then
ifnull(sum(case when ifnull(a.disposal_date, 0) != 0 and a.disposal_date < %(from_date)s then
0
else
a.opening_accumulated_depreciation
end), 0) as accumulated_depreciation_as_on_from_date,
0 as depreciation_eliminated_via_reversal,
ifnull(sum(case when a.disposal_date >= %(from_date)s and a.disposal_date <= %(to_date)s then
a.opening_accumulated_depreciation
else
@@ -165,51 +208,272 @@ def get_assets(filters):
end), 0) as depreciation_eliminated_during_the_period,
0 as depreciation_amount_during_the_period
from `tabAsset` a
where a.docstatus=1 and a.company=%(company)s and a.purchase_date <= %(to_date)s {0}
where a.docstatus=1 and a.company=%(company)s and a.purchase_date <= %(to_date)s {condition}
group by a.asset_category) as results
group by results.asset_category
""".format(condition),
{"to_date": filters.to_date, "from_date": filters.from_date, "company": filters.company},
""",
{
"to_date": filters.to_date,
"from_date": filters.from_date,
"company": filters.company,
},
as_dict=1,
)
def get_group_by_asset_data(filters):
data = []
asset_details = get_asset_details_for_grouped_by_category(filters)
assets = get_assets_for_grouped_by_asset(filters)
for asset_detail in asset_details:
row = frappe._dict()
row.update(asset_detail)
row.value_as_on_to_date = (
flt(row.value_as_on_from_date)
+ flt(row.value_of_new_purchase)
- flt(row.value_of_sold_asset)
- flt(row.value_of_scrapped_asset)
- flt(row.value_of_capitalized_asset)
)
row.update(next(asset for asset in assets if asset["asset"] == asset_detail.get("name", "")))
row.accumulated_depreciation_as_on_to_date = (
flt(row.accumulated_depreciation_as_on_from_date)
+ flt(row.depreciation_amount_during_the_period)
- flt(row.depreciation_eliminated_during_the_period)
- flt(row.depreciation_eliminated_via_reversal)
)
row.net_asset_value_as_on_from_date = flt(row.value_as_on_from_date) - flt(
row.accumulated_depreciation_as_on_from_date
)
row.net_asset_value_as_on_to_date = flt(row.value_as_on_to_date) - flt(
row.accumulated_depreciation_as_on_to_date
)
data.append(row)
return data
def get_asset_details_for_grouped_by_category(filters):
condition = ""
if filters.get("asset"):
condition += " and a.name = %(asset)s"
# nosemgrep
return frappe.db.sql(
f"""
SELECT a.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
else
0
end
else
0
end), 0) as value_as_on_from_date,
ifnull(sum(case when a.purchase_date >= %(from_date)s then
a.gross_purchase_amount
else
0
end), 0) as value_of_new_purchase,
ifnull(sum(case when ifnull(a.disposal_date, 0) != 0
and a.disposal_date >= %(from_date)s
and a.disposal_date <= %(to_date)s then
case when a.status = "Sold" then
a.gross_purchase_amount
else
0
end
else
0
end), 0) as value_of_sold_asset,
ifnull(sum(case when ifnull(a.disposal_date, 0) != 0
and a.disposal_date >= %(from_date)s
and a.disposal_date <= %(to_date)s then
case when a.status = "Scrapped" then
a.gross_purchase_amount
else
0
end
else
0
end), 0) as value_of_scrapped_asset,
ifnull(sum(case when ifnull(a.disposal_date, 0) != 0
and a.disposal_date >= %(from_date)s
and a.disposal_date <= %(to_date)s then
case when a.status = "Capitalized" then
a.gross_purchase_amount
else
0
end
else
0
end), 0) as value_of_capitalized_asset
from `tabAsset` a
where a.docstatus=1 and a.company=%(company)s and a.purchase_date <= %(to_date)s {condition}
and not exists(
select 1 from `tabAsset Capitalization Asset Item` acai join `tabAsset Capitalization` ac on acai.parent=ac.name
where acai.asset = a.name
and ac.posting_date < %(from_date)s
and ac.docstatus=1
)
group by a.name
""",
{
"to_date": filters.to_date,
"from_date": filters.from_date,
"company": filters.company,
"asset": filters.get("asset"),
},
as_dict=1,
)
def get_assets_for_grouped_by_asset(filters):
condition = ""
if filters.get("asset"):
condition = f" and a.name = '{filters.get('asset')}'"
# nosemgrep
return frappe.db.sql(
f"""
SELECT results.name as asset,
sum(results.accumulated_depreciation_as_on_from_date) as accumulated_depreciation_as_on_from_date,
sum(results.depreciation_eliminated_via_reversal) as depreciation_eliminated_via_reversal,
sum(results.depreciation_eliminated_during_the_period) as depreciation_eliminated_during_the_period,
sum(results.depreciation_amount_during_the_period) as depreciation_amount_during_the_period
from (SELECT a.name as name,
ifnull(sum(case when gle.posting_date < %(from_date)s and (ifnull(a.disposal_date, 0) = 0 or a.disposal_date >= %(from_date)s) then
gle.debit
else
0
end), 0) as accumulated_depreciation_as_on_from_date,
ifnull(sum(case when gle.posting_date <= %(to_date)s and ifnull(a.disposal_date, 0) = 0 then
gle.credit
else
0
end), 0) as depreciation_eliminated_via_reversal,
ifnull(sum(case when ifnull(a.disposal_date, 0) != 0 and a.disposal_date >= %(from_date)s
and a.disposal_date <= %(to_date)s and gle.posting_date <= a.disposal_date then
gle.debit
else
0
end), 0) as depreciation_eliminated_during_the_period,
ifnull(sum(case when gle.posting_date >= %(from_date)s and gle.posting_date <= %(to_date)s
and (ifnull(a.disposal_date, 0) = 0 or gle.posting_date <= a.disposal_date) then
gle.debit
else
0
end), 0) as depreciation_amount_during_the_period
from `tabGL Entry` gle
join `tabAsset` a on
gle.against_voucher = a.name
join `tabAsset Category Account` aca on
aca.parent = a.asset_category and aca.company_name = %(company)s
join `tabCompany` company on
company.name = %(company)s
where
a.docstatus=1
and a.company=%(company)s
and a.purchase_date <= %(to_date)s
and gle.is_cancelled = 0
and gle.account = ifnull(aca.depreciation_expense_account, company.depreciation_expense_account)
{condition}
group by a.name
union
SELECT a.name as name,
ifnull(sum(case when ifnull(a.disposal_date, 0) != 0 and a.disposal_date < %(from_date)s then
0
else
a.opening_accumulated_depreciation
end), 0) as accumulated_depreciation_as_on_from_date,
0 as depreciation_as_on_from_date_credit,
ifnull(sum(case when a.disposal_date >= %(from_date)s and a.disposal_date <= %(to_date)s then
a.opening_accumulated_depreciation
else
0
end), 0) as depreciation_eliminated_during_the_period,
0 as depreciation_amount_during_the_period
from `tabAsset` a
where a.docstatus=1 and a.company=%(company)s and a.purchase_date <= %(to_date)s {condition}
group by a.name) as results
group by results.name
""",
{
"to_date": filters.to_date,
"from_date": filters.from_date,
"company": filters.company,
},
as_dict=1,
)
def get_columns(filters):
return [
columns = []
if filters.get("group_by") == "Asset Category":
columns.append(
{
"label": _("Asset Category"),
"fieldname": "asset_category",
"fieldtype": "Link",
"options": "Asset Category",
"width": 120,
}
)
elif filters.get("group_by") == "Asset":
columns.append(
{
"label": _("Asset"),
"fieldname": "asset",
"fieldtype": "Link",
"options": "Asset",
"width": 120,
}
)
columns += [
{
"label": _("Asset Category"),
"fieldname": "asset_category",
"fieldtype": "Link",
"options": "Asset Category",
"width": 120,
},
{
"label": _("Cost as on") + " " + formatdate(filters.day_before_from_date),
"fieldname": "cost_as_on_from_date",
"label": _("Value as on") + " " + formatdate(filters.day_before_from_date),
"fieldname": "value_as_on_from_date",
"fieldtype": "Currency",
"width": 140,
},
{
"label": _("Cost of New Purchase"),
"fieldname": "cost_of_new_purchase",
"label": _("Value of New Purchase"),
"fieldname": "value_of_new_purchase",
"fieldtype": "Currency",
"width": 140,
},
{
"label": _("Cost of Sold Asset"),
"fieldname": "cost_of_sold_asset",
"label": _("Value of Sold Asset"),
"fieldname": "value_of_sold_asset",
"fieldtype": "Currency",
"width": 140,
},
{
"label": _("Cost of Scrapped Asset"),
"fieldname": "cost_of_scrapped_asset",
"label": _("Value of Scrapped Asset"),
"fieldname": "value_of_scrapped_asset",
"fieldtype": "Currency",
"width": 140,
},
{
"label": _("Cost as on") + " " + formatdate(filters.to_date),
"fieldname": "cost_as_on_to_date",
"label": _("Value of New Capitalized Asset"),
"fieldname": "value_of_capitalized_asset",
"fieldtype": "Currency",
"width": 140,
},
{
"label": _("Value as on") + " " + formatdate(filters.to_date),
"fieldname": "value_as_on_to_date",
"fieldtype": "Currency",
"width": 140,
},
@@ -237,6 +501,12 @@ def get_columns(filters):
"fieldtype": "Currency",
"width": 270,
},
{
"label": _("Depreciation eliminated via reversal"),
"fieldname": "depreciation_eliminated_via_reversal",
"fieldtype": "Currency",
"width": 270,
},
{
"label": _("Net Asset value as on") + " " + formatdate(filters.day_before_from_date),
"fieldname": "net_asset_value_as_on_from_date",
@@ -250,3 +520,5 @@ def get_columns(filters):
"width": 200,
},
]
return columns

View File

@@ -1,6 +1,3 @@
<div style="margin-bottom: 7px;">
{%= frappe.boot.letter_heads[frappe.defaults.get_default("letter_head")] %}
</div>
<h2 class="text-center">{%= __("Bank Reconciliation Statement") %}</h2>
<h4 class="text-center">{%= filters.account && (filters.account + ", "+filters.report_date) || "" %} {%= filters.company %}</h4>
<hr>
@@ -46,4 +43,4 @@
{% } %}
</tbody>
</table>
<p class="text-right text-muted">Printed On {%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}</p>
<p class="text-right text-muted">{%= __("Printed on {0}", [frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string())]) %}</p>

View File

@@ -27,6 +27,7 @@ def get_report_filters(report_filters):
["Purchase Invoice", "docstatus", "=", 1],
["Purchase Invoice", "per_received", "<", 100],
["Purchase Invoice", "update_stock", "=", 0],
["Purchase Invoice", "is_opening", "!=", "Yes"],
]
if report_filters.get("purchase_invoice"):

View File

@@ -91,6 +91,7 @@ function get_filters() {
fieldname: "budget_against_filter",
label: __("Dimension Filter"),
fieldtype: "MultiSelectList",
options: "budget_against",
get_data: function (txt) {
if (!frappe.query_report.filters) return;

View File

@@ -263,6 +263,7 @@ def get_actual_details(name, filters):
and ba.account=gl.account
and b.{budget_against} = gl.{budget_against}
and gl.fiscal_year between %s and %s
and gl.is_cancelled = 0
and b.{budget_against} = %s
and exists(
select

View File

@@ -355,7 +355,7 @@ def get_data(companies, root_type, balance_must_be, fiscal_year, filters=None, i
gl_entries_by_account,
accounts_by_name,
accounts,
ignore_closing_entries=False,
ignore_closing_entries=ignore_closing_entries,
root_type=root_type,
)

View File

@@ -67,5 +67,5 @@
</tbody>
</table>
<p class="text-right text-muted">
Printed On {%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}
{%= __("Printed on {0}", [frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string())]) %}
</p>

View File

@@ -512,12 +512,16 @@ def get_accounting_entries(
.where(gl_entry.company == filters.company)
)
ignore_is_opening = frappe.db.get_single_value(
"Accounts Settings", "ignore_is_opening_check_for_reporting"
)
if doctype == "GL Entry":
query = query.select(gl_entry.posting_date, gl_entry.is_opening, gl_entry.fiscal_year)
query = query.where(gl_entry.is_cancelled == 0)
query = query.where(gl_entry.posting_date <= to_date)
if ignore_opening_entries:
if ignore_opening_entries and not ignore_is_opening:
query = query.where(gl_entry.is_opening == "No")
else:
query = query.select(gl_entry.closing_date.as_("posting_date"))
@@ -526,9 +530,15 @@ def get_accounting_entries(
query = apply_additional_conditions(doctype, query, from_date, ignore_closing_entries, filters)
query = query.where(gl_entry.account.isin(accounts))
entries = query.run(as_dict=True)
from frappe.desk.reportview import build_match_conditions
return entries
query, params = query.walk()
match_conditions = build_match_conditions(doctype)
if match_conditions:
query += "and" + match_conditions
return frappe.db.sql(query, params, as_dict=True)
def apply_additional_conditions(doctype, query, from_date, ignore_closing_entries, filters):

View File

@@ -78,4 +78,4 @@
{% } %}
</tbody>
</table>
<p class="text-right text-muted">Printed On {%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}</p>
<p class="text-right text-muted">{%= __("Printed on {0}", [frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string())]) %}</p>

View File

@@ -49,9 +49,14 @@ frappe.query_reports["General Ledger"] = {
label: __("Voucher No"),
fieldtype: "Data",
on_change: function () {
frappe.query_report.set_filter_value("group_by", "Group by Voucher (Consolidated)");
frappe.query_report.set_filter_value("categorize_by", "Categorize by Voucher (Consolidated)");
},
},
{
fieldname: "against_voucher_no",
label: __("Against Voucher No"),
fieldtype: "Data",
},
{
fieldtype: "Break",
},
@@ -61,13 +66,14 @@ frappe.query_reports["General Ledger"] = {
fieldtype: "Autocomplete",
options: Object.keys(frappe.boot.party_account_types),
on_change: function () {
frappe.query_report.set_filter_value("party", "");
frappe.query_report.set_filter_value("party", []);
},
},
{
fieldname: "party",
label: __("Party"),
fieldtype: "MultiSelectList",
options: "party_type",
get_data: function (txt) {
if (!frappe.query_report.filters) return;
@@ -106,29 +112,29 @@ frappe.query_reports["General Ledger"] = {
hidden: 1,
},
{
fieldname: "group_by",
label: __("Group by"),
fieldname: "categorize_by",
label: __("Categorize by"),
fieldtype: "Select",
options: [
"",
{
label: __("Group by Voucher"),
value: "Group by Voucher",
label: __("Categorize by Voucher"),
value: "Categorize by Voucher",
},
{
label: __("Group by Voucher (Consolidated)"),
value: "Group by Voucher (Consolidated)",
label: __("Categorize by Voucher (Consolidated)"),
value: "Categorize by Voucher (Consolidated)",
},
{
label: __("Group by Account"),
value: "Group by Account",
label: __("Categorize by Account"),
value: "Categorize by Account",
},
{
label: __("Group by Party"),
value: "Group by Party",
label: __("Categorize by Party"),
value: "Categorize by Party",
},
],
default: "Group by Voucher (Consolidated)",
default: "Categorize by Voucher (Consolidated)",
},
{
fieldname: "tax_id",
@@ -146,6 +152,7 @@ frappe.query_reports["General Ledger"] = {
fieldname: "cost_center",
label: __("Cost Center"),
fieldtype: "MultiSelectList",
options: "Cost Center",
get_data: function (txt) {
return frappe.db.get_link_options("Cost Center", txt, {
company: frappe.query_report.get_filter_value("company"),
@@ -156,6 +163,7 @@ frappe.query_reports["General Ledger"] = {
fieldname: "project",
label: __("Project"),
fieldtype: "MultiSelectList",
options: "Project",
get_data: function (txt) {
return frappe.db.get_link_options("Project", txt, {
company: frappe.query_report.get_filter_value("company"),
@@ -189,6 +197,11 @@ frappe.query_reports["General Ledger"] = {
label: __("Show Net Values in Party Account"),
fieldtype: "Check",
},
{
fieldname: "show_amount_in_company_currency",
label: __("Show Credit / Debit in Company Currency"),
fieldtype: "Check",
},
{
fieldname: "show_remarks",
label: __("Show Remarks"),

View File

@@ -72,13 +72,17 @@ def validate_filters(filters, account_details):
if not account_details.get(account):
frappe.throw(_("Account {0} does not exists").format(account))
if filters.get("account") and filters.get("group_by") == "Group by Account":
if not filters.get("categorize_by") and filters.get("group_by"):
filters["categorize_by"] = filters["group_by"]
filters["categorize_by"] = filters["categorize_by"].replace("Group by", "Categorize by")
if filters.get("account") and filters.get("categorize_by") == "Categorize by Account":
filters.account = frappe.parse_json(filters.get("account"))
for account in filters.account:
if account_details[account].is_group == 0:
frappe.throw(_("Can not filter based on Child Account, if grouped by Account"))
if filters.get("voucher_no") and filters.get("group_by") in ["Group by Voucher"]:
if filters.get("voucher_no") and filters.get("categorize_by") in ["Categorize by Voucher"]:
frappe.throw(_("Can not filter based on Voucher No, if grouped by Voucher"))
if filters.from_date > filters.to_date:
@@ -172,9 +176,9 @@ def get_gl_entries(filters, accounting_dimensions):
if filters.get("include_dimensions"):
order_by_statement = "order by posting_date, creation"
if filters.get("group_by") == "Group by Voucher":
if filters.get("categorize_by") == "Categorize by Voucher":
order_by_statement = "order by posting_date, voucher_type, voucher_no"
if filters.get("group_by") == "Group by Account":
if filters.get("categorize_by") == "Categorize by Account":
order_by_statement = "order by account, posting_date, creation"
if filters.get("include_default_book_entries"):
@@ -201,7 +205,7 @@ def get_gl_entries(filters, accounting_dimensions):
)
if filters.get("presentation_currency"):
return convert_to_presentation_currency(gl_entries, currency_map)
return convert_to_presentation_currency(gl_entries, currency_map, filters)
else:
return gl_entries
@@ -209,6 +213,10 @@ def get_gl_entries(filters, accounting_dimensions):
def get_conditions(filters):
conditions = []
ignore_is_opening = frappe.db.get_single_value(
"Accounts Settings", "ignore_is_opening_check_for_reporting"
)
if filters.get("account"):
filters.account = get_accounts_with_children(filters.account)
if filters.account:
@@ -221,6 +229,9 @@ def get_conditions(filters):
if filters.get("voucher_no"):
conditions.append("voucher_no=%(voucher_no)s")
if filters.get("against_voucher_no"):
conditions.append("against_voucher=%(against_voucher_no)s")
if filters.get("ignore_err"):
err_journals = frappe.db.get_all(
"Journal Entry",
@@ -254,7 +265,7 @@ def get_conditions(filters):
if filters.get("voucher_no_not_in"):
conditions.append("voucher_no not in %(voucher_no_not_in)s")
if filters.get("group_by") == "Group by Party" and not filters.get("party_type"):
if filters.get("categorize_by") == "Categorize by Party" and not filters.get("party_type"):
conditions.append("party_type in ('Customer', 'Supplier')")
if filters.get("party_type"):
@@ -266,11 +277,17 @@ def get_conditions(filters):
if not (
filters.get("account")
or filters.get("party")
or filters.get("group_by") in ["Group by Account", "Group by Party"]
or filters.get("categorize_by") in ["Categorize by Account", "Categorize by Party"]
):
conditions.append("(posting_date >=%(from_date)s or is_opening = 'Yes')")
if not ignore_is_opening:
conditions.append("(posting_date >=%(from_date)s or is_opening = 'Yes')")
else:
conditions.append("posting_date >=%(from_date)s")
conditions.append("(posting_date <=%(to_date)s or is_opening = 'Yes')")
if not ignore_is_opening:
conditions.append("(posting_date <=%(to_date)s or is_opening = 'Yes')")
else:
conditions.append("posting_date <=%(to_date)s")
if filters.get("project"):
conditions.append("project in %(project)s")
@@ -355,13 +372,13 @@ def get_data_with_opening_closing(filters, account_details, accounting_dimension
# Opening for filtered account
data.append(totals.opening)
if filters.get("group_by") != "Group by Voucher (Consolidated)":
if filters.get("categorize_by") != "Categorize by Voucher (Consolidated)":
for _acc, acc_dict in gle_map.items():
# acc
if acc_dict.entries:
# opening
data.append({})
if filters.get("group_by") != "Group by Voucher":
if filters.get("categorize_by") != "Categorize by Voucher":
data.append(acc_dict.totals.opening)
data += acc_dict.entries
@@ -370,7 +387,7 @@ def get_data_with_opening_closing(filters, account_details, accounting_dimension
data.append(acc_dict.totals.total)
# closing
if filters.get("group_by") != "Group by Voucher":
if filters.get("categorize_by") != "Categorize by Voucher":
data.append(acc_dict.totals.closing)
data.append({})
else:
@@ -403,9 +420,9 @@ def get_totals_dict():
def group_by_field(group_by):
if group_by == "Group by Party":
if group_by == "Categorize by Party":
return "party"
elif group_by in ["Group by Voucher (Consolidated)", "Group by Account"]:
elif group_by in ["Categorize by Voucher (Consolidated)", "Categorize by Account"]:
return "account"
else:
return "voucher_no"
@@ -413,7 +430,7 @@ def group_by_field(group_by):
def initialize_gle_map(gl_entries, filters):
gle_map = OrderedDict()
group_by = group_by_field(filters.get("group_by"))
group_by = group_by_field(filters.get("categorize_by"))
for gle in gl_entries:
gle_map.setdefault(gle.get(group_by), _dict(totals=get_totals_dict(), entries=[]))
@@ -424,8 +441,8 @@ def get_accountwise_gle(filters, accounting_dimensions, gl_entries, gle_map):
totals = get_totals_dict()
entries = []
consolidated_gle = OrderedDict()
group_by = group_by_field(filters.get("group_by"))
group_by_voucher_consolidated = filters.get("group_by") == "Group by Voucher (Consolidated)"
group_by = group_by_field(filters.get("categorize_by"))
group_by_voucher_consolidated = filters.get("categorize_by") == "Categorize by Voucher (Consolidated)"
if filters.get("show_net_values_in_party_account"):
account_type_map = get_account_type_map(filters.get("company"))
@@ -496,6 +513,7 @@ def get_accountwise_gle(filters, accounting_dimensions, gl_entries, gle_map):
for dim in accounting_dimensions:
keylist.append(gle.get(dim))
keylist.append(gle.get("cost_center"))
keylist.append(gle.get("project"))
key = tuple(keylist)
if key not in consolidated_gle:
@@ -520,17 +538,20 @@ def get_account_type_map(company):
def get_result_as_list(data, filters):
balance, _balance_in_account_currency = 0, 0
balance = 0
for d in data:
if not d.get("posting_date"):
balance, _balance_in_account_currency = 0, 0
balance = 0
balance = get_balance(d, balance, "debit", "credit")
d["balance"] = balance
d["account_currency"] = filters.account_currency
d["presentation_currency"] = filters.presentation_currency
return data
@@ -556,11 +577,21 @@ def get_columns(filters):
if filters.get("presentation_currency"):
currency = filters["presentation_currency"]
else:
if filters.get("company"):
currency = get_company_currency(filters["company"])
else:
company = get_default_company()
currency = get_company_currency(company)
company = filters.get("company") or get_default_company()
filters["presentation_currency"] = currency = get_company_currency(company)
company_currency = get_company_currency(filters.get("company") or get_default_company())
if (
filters.get("show_amount_in_company_currency")
and filters["presentation_currency"] != company_currency
):
frappe.throw(
_("Presentation Currency cannot be {0} , When {1} is enabled.").format(
frappe.bold(filters["presentation_currency"]),
frappe.bold("Show Credit / Debit in Company Currency"),
)
)
columns = [
{
@@ -581,19 +612,22 @@ def get_columns(filters):
{
"label": _("Debit ({0})").format(currency),
"fieldname": "debit",
"fieldtype": "Float",
"fieldtype": "Currency",
"options": "presentation_currency",
"width": 130,
},
{
"label": _("Credit ({0})").format(currency),
"fieldname": "credit",
"fieldtype": "Float",
"fieldtype": "Currency",
"options": "presentation_currency",
"width": 130,
},
{
"label": _("Balance ({0})").format(currency),
"fieldname": "balance",
"fieldtype": "Float",
"fieldtype": "Currency",
"options": "presentation_currency",
"width": 130,
},
{"label": _("Voucher Type"), "fieldname": "voucher_type", "width": 120},
@@ -607,10 +641,11 @@ def get_columns(filters):
{"label": _("Against Account"), "fieldname": "against", "width": 120},
{"label": _("Party Type"), "fieldname": "party_type", "width": 100},
{"label": _("Party"), "fieldname": "party", "width": 100},
{"label": _("Project"), "options": "Project", "fieldname": "project", "width": 100},
]
if filters.get("include_dimensions"):
columns.append({"label": _("Project"), "options": "Project", "fieldname": "project", "width": 100})
for dim in get_accounting_dimensions(as_list=False):
columns.append(
{"label": _(dim.label), "options": dim.label, "fieldname": dim.fieldname, "width": 100}

View File

@@ -155,7 +155,7 @@ class TestGeneralLedger(FrappeTestCase):
"from_date": today(),
"to_date": today(),
"account": [account.name],
"group_by": "Group by Voucher (Consolidated)",
"categorize_by": "Categorize by Voucher (Consolidated)",
}
)
)
@@ -246,7 +246,7 @@ class TestGeneralLedger(FrappeTestCase):
"from_date": today(),
"to_date": today(),
"account": [account.name],
"group_by": "Group by Voucher (Consolidated)",
"categorize_by": "Categorize by Voucher (Consolidated)",
"ignore_err": True,
}
)
@@ -261,7 +261,7 @@ class TestGeneralLedger(FrappeTestCase):
"from_date": today(),
"to_date": today(),
"account": [account.name],
"group_by": "Group by Voucher (Consolidated)",
"categorize_by": "Categorize by Voucher (Consolidated)",
"ignore_err": False,
}
)
@@ -308,7 +308,7 @@ class TestGeneralLedger(FrappeTestCase):
"from_date": si.posting_date,
"to_date": si.posting_date,
"account": [si.debit_to],
"group_by": "Group by Voucher (Consolidated)",
"categorize_by": "Categorize by Voucher (Consolidated)",
"ignore_cr_dr_notes": False,
}
)
@@ -325,7 +325,7 @@ class TestGeneralLedger(FrappeTestCase):
"from_date": si.posting_date,
"to_date": si.posting_date,
"account": [si.debit_to],
"group_by": "Group by Voucher (Consolidated)",
"categorize_by": "Categorize by Voucher (Consolidated)",
"ignore_cr_dr_notes": True,
}
)

View File

@@ -1,5 +1,5 @@
{
"add_total_row": 1,
"add_total_row": 0,
"columns": [],
"creation": "2013-02-25 17:03:34",
"disable_prepared_report": 0,
@@ -9,7 +9,7 @@
"filters": [],
"idx": 3,
"is_standard": "Yes",
"modified": "2022-02-11 10:18:36.956558",
"modified": "2025-01-27 18:40:24.493829",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Gross Profit",

View File

@@ -166,7 +166,14 @@ def get_data_when_grouped_by_invoice(columns, gross_profit_data, filters, group_
# removing Item Code and Item Name columns
del columns[4:6]
total_base_amount = 0
total_buying_amount = 0
for src in gross_profit_data.si_list:
if src.indent == 1:
total_base_amount += src.base_amount or 0.0
total_buying_amount += src.buying_amount or 0.0
row = frappe._dict()
row.indent = src.indent
row.parent_invoice = src.parent_invoice
@@ -177,17 +184,57 @@ def get_data_when_grouped_by_invoice(columns, gross_profit_data, filters, group_
data.append(row)
total_gross_profit = total_base_amount - total_buying_amount
data.append(
frappe._dict(
{
"sales_invoice": "Total",
"qty": None,
"avg._selling_rate": None,
"valuation_rate": None,
"selling_amount": total_base_amount,
"buying_amount": total_buying_amount,
"gross_profit": total_gross_profit,
"gross_profit_%": flt(
(total_gross_profit / total_base_amount) * 100.0,
cint(frappe.db.get_default("currency_precision")) or 3,
)
if total_base_amount
else 0,
}
)
)
def get_data_when_not_grouped_by_invoice(gross_profit_data, filters, group_wise_columns, data):
for src in gross_profit_data.grouped_data:
row = []
for col in group_wise_columns.get(scrub(filters.group_by)):
row.append(src.get(col))
total_base_amount = 0
total_buying_amount = 0
row.append(filters.currency)
group_columns = group_wise_columns.get(scrub(filters.group_by))
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
row = [src.get(col) for col in group_columns] + [filters.currency]
data.append(row)
total_gross_profit = total_base_amount - total_buying_amount
currency_precision = cint(frappe.db.get_default("currency_precision")) or 3
gross_profit_percent = (total_gross_profit / total_base_amount * 100.0) if total_base_amount else 0
total_row = {
group_columns[0]: "Total",
"base_amount": total_base_amount,
"buying_amount": total_buying_amount,
"gross_profit": total_gross_profit,
"gross_profit_percent": flt(gross_profit_percent, currency_precision),
}
total_row = [total_row.get(col, None) for col in [*group_columns, "currency"]]
data.append(total_row)
def get_columns(group_wise_columns, filters):
columns = []
@@ -726,12 +773,13 @@ class GrossProfitGenerator:
.inner_join(purchase_invoice)
.on(purchase_invoice.name == purchase_invoice_item.parent)
.select(
purchase_invoice.name,
purchase_invoice_item.base_rate / purchase_invoice_item.conversion_factor,
)
.where(purchase_invoice.docstatus == 1)
.where(purchase_invoice.posting_date <= self.filters.to_date)
.where(purchase_invoice_item.item_code == item_code)
.where(purchase_invoice.is_return == 0)
.where(purchase_invoice_item.parenttype == "Purchase Invoice")
)
if row.project:
@@ -768,7 +816,10 @@ class GrossProfitGenerator:
"""
if self.filters.group_by == "Sales Person":
sales_person_cols = ", sales.sales_person, sales.allocated_amount, sales.incentives"
sales_person_cols = """, sales.sales_person,
sales.allocated_percentage * `tabSales Invoice Item`.base_net_amount / 100 as allocated_amount,
sales.incentives
"""
sales_team_table = "left join `tabSales Team` sales on sales.parent = `tabSales Invoice`.name"
else:
sales_person_cols = ""

View File

@@ -558,3 +558,33 @@ class TestGrossProfit(FrappeTestCase):
}
gp_entry = [x for x in data if x.parent_invoice == sinv.name]
self.assertDictContainsSubset(expected_entry, gp_entry[0])
def test_gross_profit_groupby_invoices(self):
create_sales_invoice(
qty=1,
rate=100,
company=self.company,
customer=self.customer,
item_code=self.item,
item_name=self.item,
cost_center=self.cost_center,
warehouse=self.warehouse,
debit_to=self.debit_to,
parent_cost_center=self.cost_center,
update_stock=0,
currency="INR",
income_account=self.income_account,
expense_account=self.expense_account,
)
filters = frappe._dict(
company=self.company, from_date=nowdate(), to_date=nowdate(), 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)

View File

@@ -11,7 +11,7 @@ import erpnext
from erpnext.accounts.report.item_wise_sales_register.item_wise_sales_register import (
add_sub_total_row,
add_total_row,
apply_group_by_conditions,
apply_order_by_conditions,
get_grand_total,
get_group_by_and_display_fields,
get_tax_accounts,
@@ -305,12 +305,6 @@ def apply_conditions(query, pi, pii, filters):
if filters.get("item_group"):
query = query.where(pii.item_group == filters.get("item_group"))
if not filters.get("group_by"):
query = query.orderby(pi.posting_date, order=Order.desc)
query = query.orderby(pii.item_group, order=Order.desc)
else:
query = apply_group_by_conditions(query, pi, pii, filters)
return query
@@ -372,7 +366,17 @@ def get_items(filters, additional_table_columns):
query = apply_conditions(query, pi, pii, filters)
return query.run(as_dict=True)
from frappe.desk.reportview import build_match_conditions
query, params = query.walk()
match_conditions = build_match_conditions(doctype)
if match_conditions:
query += " and " + match_conditions
query = apply_order_by_conditions(query, pi, pii, filters)
return frappe.db.sql(query, params, as_dict=True)
def get_aii_accounts():

View File

@@ -384,27 +384,24 @@ def apply_conditions(query, si, sii, filters, additional_conditions=None):
| (si.unrealized_profit_loss_account == filters.get("income_account"))
)
if not filters.get("group_by"):
query = query.orderby(si.posting_date, order=Order.desc)
query = query.orderby(sii.item_group, order=Order.desc)
else:
query = apply_group_by_conditions(query, si, sii, filters)
for key, value in (additional_conditions or {}).items():
query = query.where(si[key] == value)
return query
def apply_group_by_conditions(query, si, ii, filters):
if filters.get("group_by") == "Invoice":
query = query.orderby(ii.parent, order=Order.desc)
def apply_order_by_conditions(query, si, ii, filters):
if not filters.get("group_by"):
query += f" order by {si.posting_date} desc, {ii.item_group} desc"
elif filters.get("group_by") == "Invoice":
query += f" order by {ii.parent} desc"
elif filters.get("group_by") == "Item":
query = query.orderby(ii.item_code)
query += f" order by {ii.item_code}"
elif filters.get("group_by") == "Item Group":
query = query.orderby(ii.item_group)
query += f" order by {ii.item_group}"
elif filters.get("group_by") in ("Customer", "Customer Group", "Territory", "Supplier"):
query = query.orderby(si[frappe.scrub(filters.get("group_by"))])
filter_field = frappe.scrub(filters.get("group_by"))
query += f" order by {filter_field} desc"
return query
@@ -479,7 +476,17 @@ def get_items(filters, additional_query_columns, additional_conditions=None):
query = apply_conditions(query, si, sii, filters, additional_conditions)
return query.run(as_dict=True)
from frappe.desk.reportview import build_match_conditions
query, params = query.walk()
match_conditions = build_match_conditions("Sales Invoice")
if match_conditions:
query += " and " + match_conditions
query = apply_order_by_conditions(query, si, sii, filters)
return frappe.db.sql(query, params, as_dict=True)
def get_delivery_notes_against_sales_order(item_list):

View File

@@ -51,6 +51,7 @@ function get_filters() {
fieldname: "party",
label: __("Party"),
fieldtype: "MultiSelectList",
options: "party_type",
get_data: function (txt) {
if (!frappe.query_report.filters) return;

View File

@@ -46,6 +46,7 @@ class PaymentLedger:
against_voucher_no=ple.against_voucher_no,
amount=ple.amount,
currency=ple.account_currency,
company=ple.company,
)
if self.filters.include_account_currency:
@@ -77,6 +78,7 @@ class PaymentLedger:
against_voucher_no="Outstanding:",
amount=total,
currency=voucher_data[0].currency,
company=voucher_data[0].company,
)
if self.filters.include_account_currency:
@@ -85,7 +87,12 @@ class PaymentLedger:
voucher_data.append(entry)
# empty row
voucher_data.append(frappe._dict())
voucher_data.append(
frappe._dict(
currency=voucher_data[0].currency,
company=voucher_data[0].company,
)
)
self.data.extend(voucher_data)
def build_conditions(self):

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