Compare commits

...

2004 Commits

Author SHA1 Message Date
Frappe PR Bot
37e00a66da chore(release): Bumped to Version 13.55.2
## [13.55.2](https://github.com/frappe/erpnext/compare/v13.55.1...v13.55.2) (2023-12-27)

### Bug Fixes

* incorrect price list in customer-wise item price report ([32f3365](32f3365ac7))
* **Payment Entry:** don't check empty references ([f0877ff](f0877ffa47))
2023-12-27 08:40:57 +00:00
rohitwaghchaure
4394c0113e Merge pull request #38951 from frappe/version-13-hotfix
chore: release v13
2023-12-27 14:09:51 +05:30
ruthra kumar
ab82e30fac Merge pull request #38947 from frappe/mergify/bp/version-13-hotfix/pr-38891
fix: incorrect price list in customer-wise item price report (backport #38891)
2023-12-26 12:16:39 +05:30
ruthra kumar
32f3365ac7 fix: incorrect price list in customer-wise item price report
(cherry picked from commit 9a00edb031)
2023-12-26 06:18:00 +00:00
Deepesh Garg
80012b7339 Merge pull request #38769 from frappe/deepeshgarg007-patch-1
chore: Loan Interest Accrual post topup
2023-12-22 08:40:48 +05:30
ruthra kumar
b049b52294 Merge pull request #38750 from barredterra/pe-empty-referneces
fix(Payment Entry): don't check empty references
2023-12-21 11:00:21 +05:30
Frappe PR Bot
82c28ac89f chore(release): Bumped to Version 13.55.1
## [13.55.1](https://github.com/frappe/erpnext/compare/v13.55.0...v13.55.1) (2023-12-20)

### Bug Fixes

* avoid over allocation during backdated assignment creation ([fee4eae](fee4eae96c))
* earned leave allocation in policy assignment ([14955c7](14955c70d4))
* earned leave exceeding annual allocation ([ee7c9ad](ee7c9add39))
* get customers for leaderboard ([10f02e6](10f02e60ce))
* get items for leaderboard ([3863c4e](3863c4e7fb))
* get sales partner for leaderboard ([b0f7de1](b0f7de1a0f))
* get sales person for leaderboard ([8dbb200](8dbb200fe3))
* get suppliers for leaderboard ([7df8425](7df8425756))
2023-12-20 04:45:38 +00:00
Deepesh Garg
692d98dd4d Merge pull request #38854 from frappe/version-13-hotfix
chore: release v13
2023-12-20 10:14:33 +05:30
Rucha Mahabal
5d1c35634c Merge pull request #38610 from ruchamahabal/EL-overallocation-v13
fix: earned leave exceeding annual allocation
2023-12-19 15:26:38 +05:30
Rucha Mahabal
9900274b27 test(fix): earned leave tests 2023-12-19 13:03:57 +05:30
Rucha Mahabal
14955c70d4 fix: earned leave allocation in policy assignment 2023-12-19 13:03:36 +05:30
Raffael Meyer
8c55e35d20 Merge pull request #38676 from frappe/mergify/bp/version-13-hotfix/pr-38672
fix: get data for leaderboard (backport #38672)
2023-12-15 16:27:22 +01:00
barredterra
e6e9f1dc26 chore: remove deprecation wrapper
not available in v13
2023-12-15 15:46:40 +01:00
Deepesh Garg
4f8b13ac57 chore: Loan Interest Accrual post topup 2023-12-15 12:46:59 +05:30
barredterra
f0877ffa47 fix(Payment Entry): don't check empty references
Manual partial backport of https://github.com/frappe/erpnext/pull/36649
2023-12-14 13:39:35 +01:00
barredterra
e291b5db3d chore: deprecate unused method
(cherry picked from commit 956c3c50a0)
2023-12-12 04:24:54 +00:00
barredterra
b0f7de1a0f fix: get sales partner for leaderboard
(cherry picked from commit 40c1acc961)
2023-12-12 04:24:54 +00:00
barredterra
8dbb200fe3 fix: get sales person for leaderboard
(cherry picked from commit 7babfd4ac4)
2023-12-12 04:24:54 +00:00
barredterra
7df8425756 fix: get suppliers for leaderboard
(cherry picked from commit 65df4b6aa8)
2023-12-12 04:24:54 +00:00
barredterra
3863c4e7fb fix: get items for leaderboard
(cherry picked from commit 2721ee3a8d)
2023-12-12 04:24:53 +00:00
barredterra
10f02e60ce fix: get customers for leaderboard
(cherry picked from commit 137b5a6108)
2023-12-12 04:24:53 +00:00
Rucha Mahabal
48eaa51c4a test: earned leave over-allocation 2023-12-07 13:04:51 +05:30
Rucha Mahabal
fee4eae96c fix: avoid over allocation during backdated assignment creation 2023-12-07 13:04:23 +05:30
Rucha Mahabal
ee7c9add39 fix: earned leave exceeding annual allocation 2023-12-07 13:01:57 +05:30
Frappe PR Bot
b6229515ef chore(release): Bumped to Version 13.55.0
# [13.55.0](https://github.com/frappe/erpnext/compare/v13.54.14...v13.55.0) (2023-12-05)

### Bug Fixes

* consider the `Valuation Method` while picking incorrect SLE (backport [#38592](https://github.com/frappe/erpnext/issues/38592)) ([#38596](https://github.com/frappe/erpnext/issues/38596)) ([1b78dd1](1b78dd17c9))
* make create button translatable (backport [#38165](https://github.com/frappe/erpnext/issues/38165)) ([#38412](https://github.com/frappe/erpnext/issues/38412)) ([bd371e6](bd371e697c))
* show difference amount in default currency ([6f44a16](6f44a1630f))
* update voucher currency for allocated entry ([3dfc145](3dfc1450a1))

### Features

* `Company` filter in `Stock Ledger Variance` report (backport [#38553](https://github.com/frappe/erpnext/issues/38553)) ([#38575](https://github.com/frappe/erpnext/issues/38575)) ([77e01eb](77e01ebacf))
* add currency column for allocated entries ([835c85a](835c85a087))
2023-12-05 13:50:34 +00:00
Deepesh Garg
6e25a5189c Merge pull request #38588 from frappe/version-13-hotfix
chore: release v13
2023-12-05 19:19:16 +05:30
mergify[bot]
1b78dd17c9 fix: consider the Valuation Method while picking incorrect SLE (backport #38592) (#38596)
* fix: incorrect SLE for `Moving Average` valuation method

(cherry picked from commit 8beec58670)

* feat: add `Valuation Method` column in `Stock Ledger Variance` report

(cherry picked from commit 16c297c2ec)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-05 18:14:19 +05:30
mergify[bot]
77e01ebacf feat: Company filter in Stock Ledger Variance report (backport #38553) (#38575)
feat: `Company` filter in `Stock Ledger Variance` report

(cherry picked from commit fb3421fcce)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-05 12:32:57 +05:30
mergify[bot]
bd371e697c fix: make create button translatable (backport #38165) (#38412)
fix: make create button translatable (#38165)

* fix: make all create buttons translatable

* style: use double quotes

---------

Co-authored-by: PatrickDenis-stack <77415730+PatrickDenis-stack@users.noreply.github.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
(cherry picked from commit 8e4b591ea2)

Co-authored-by: Patrick Eissler <77415730+PatrickDEissler@users.noreply.github.com>
2023-12-01 11:33:35 +05:30
Raffael Meyer
2c4cee025b ci: pin semgrep to old version (#38426)
* ci: pin semgrep to old version

current version has problem with PRs originating from fork

* ci: unpin semgrep

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2023-11-29 22:06:31 +05:30
Deepesh Garg
303becf1e3 Merge pull request #38390 from GursheenK/payment-reco-currency-symbol
fix: currency symbol in payment rec allocations
2023-11-29 17:22:12 +05:30
Frappe PR Bot
983c2133c2 chore(release): Bumped to Version 13.54.14
## [13.54.14](https://github.com/frappe/erpnext/compare/v13.54.13...v13.54.14) (2023-11-29)

### Bug Fixes

* patch - Duplicate entry quality inspection parameter (backport [#38262](https://github.com/frappe/erpnext/issues/38262)) ([#38265](https://github.com/frappe/erpnext/issues/38265)) ([095d99d](095d99dbd2))
* precision for invoice outstandings ([#38323](https://github.com/frappe/erpnext/issues/38323)) ([190f77a](190f77abff))
2023-11-29 04:55:27 +00:00
Deepesh Garg
a76c6ab042 Merge pull request #38385 from frappe/version-13-hotfix
chore: release v13
2023-11-29 10:24:11 +05:30
Gursheen Anand
6f44a1630f fix: show difference amount in default currency 2023-11-28 16:31:40 +05:30
Gursheen Anand
b7944a7c07 chore: hide currency column 2023-11-28 15:51:33 +05:30
Gursheen Anand
3dfc1450a1 fix: update voucher currency for allocated entry 2023-11-28 15:43:36 +05:30
Gursheen Anand
835c85a087 feat: add currency column for allocated entries 2023-11-28 15:42:30 +05:30
Gursheen Kaur Anand
190f77abff fix: precision for invoice outstandings (#38323)
fix: precision while setting inv outstanding
2023-11-26 18:56:34 +05:30
Frappe PR Bot
a37bdb54cd chore(release): Bumped to Version 13.54.13
## [13.54.13](https://github.com/frappe/erpnext/compare/v13.54.12...v13.54.13) (2023-11-22)

### Bug Fixes

* patch - Duplicate entry quality inspection parameter (backport [#38262](https://github.com/frappe/erpnext/issues/38262)) (backport [#38265](https://github.com/frappe/erpnext/issues/38265)) ([#38266](https://github.com/frappe/erpnext/issues/38266)) ([b28e29c](b28e29cab1))
2023-11-22 08:53:41 +00:00
mergify[bot]
b28e29cab1 fix: patch - Duplicate entry quality inspection parameter (backport #38262) (backport #38265) (#38266)
fix: patch - Duplicate entry quality inspection parameter (backport #38262) (#38265)

fix: patch - Duplicate entry quality inspection parameter (#38262)

(cherry picked from commit 0ca7527f7a)

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-11-22 14:22:30 +05:30
mergify[bot]
095d99dbd2 fix: patch - Duplicate entry quality inspection parameter (backport #38262) (#38265)
fix: patch - Duplicate entry quality inspection parameter (#38262)

(cherry picked from commit 0ca7527f7a)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-11-22 14:09:00 +05:30
Frappe PR Bot
01fc5f6865 chore(release): Bumped to Version 13.54.12
## [13.54.12](https://github.com/frappe/erpnext/compare/v13.54.11...v13.54.12) (2023-11-21)

### Bug Fixes

* `get_previous_allocation` return value ([6cb8a40](6cb8a40339))
* backward compatible query without pluck ([958db77](958db77cda))
* pass check permission in render_address ([65ae8d9](65ae8d9c05))
* **Timesheet:** reset billing hours equal to hours if they exceed actual hours (backport [#38134](https://github.com/frappe/erpnext/issues/38134)) ([#38154](https://github.com/frappe/erpnext/issues/38154)) ([1e43605](1e436052e2))
* **Timesheet:** warn user if billing hours > actual hours instead of resetting  (backport [#38239](https://github.com/frappe/erpnext/issues/38239)) ([#38242](https://github.com/frappe/erpnext/issues/38242)) ([a9429e1](a9429e160d))
* use `get_all` instead of `get_list` ([4b8ed0f](4b8ed0f6ae))

### Performance Improvements

* index most queried fields in Leave Ledger Entry ([eea7bbc](eea7bbcea7))
* limit rows to 1 for cf leave expiry query ([635c3d5](635c3d54f5))
2023-11-21 18:56:36 +00:00
Deepesh Garg
911e2c5b36 Merge pull request #38249 from frappe/version-13-hotfix
chore: release v13
2023-11-22 00:25:25 +05:30
mergify[bot]
a9429e160d fix(Timesheet): warn user if billing hours > actual hours instead of resetting (backport #38239) (#38242)
fix(Timesheet): warn user if billing hours > actual hours instead of resetting  (#38239)

* revert: "fix(Timesheet): reset billing hours equal to hours if they exceed actual hours"

This reverts commit 0ec8034507.

* fix: warn user if billing hours > actual hours

(cherry picked from commit ac91030b31)

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2023-11-21 13:42:36 +05:30
Sagar Vora
5342cd0dfa Merge pull request #38170 from frappe/mergify/bp/version-13-hotfix/pr-38167
fix: pass check permission in `render_address` (backport #38167)
2023-11-18 17:43:40 +05:30
Sagar Vora
3bf84e1464 chore: fix conflicts 2023-11-18 17:42:06 +05:30
Vishakh Desai
65ae8d9c05 fix: pass check permission in render_address
(cherry picked from commit 45299fe4b3)

# Conflicts:
#	erpnext/accounts/party.py
2023-11-18 12:09:18 +00:00
Rucha Mahabal
35717124cd Merge pull request #38158 from ruchamahabal/perf-leave-balance-report-v13
perf: faster Employee Leave Balance report
2023-11-17 22:57:49 +05:30
Rucha Mahabal
89c107ea8b chore: remove states from json 2023-11-17 22:56:42 +05:30
Rucha Mahabal
958db77cda fix: backward compatible query without pluck 2023-11-17 21:11:42 +05:30
Rucha Mahabal
bc1da4678a refactor: retain backward compatible type hints 2023-11-17 20:45:34 +05:30
Rucha Mahabal
6cb8a40339 fix: get_previous_allocation return value 2023-11-17 20:19:39 +05:30
Rucha Mahabal
9139c14639 refactor(Leave Balance Summary report): remove unused department approver queries 2023-11-17 20:19:10 +05:30
Rucha Mahabal
461eb7a50d refactor: rewrite queries with frappe.qb + refactor type hints 2023-11-17 20:17:31 +05:30
Rucha Mahabal
635c3d54f5 perf: limit rows to 1 for cf leave expiry query 2023-11-17 20:17:11 +05:30
Rucha Mahabal
1bd3f4eeef refactor: remove unnecessary approver queries 2023-11-17 20:16:58 +05:30
Rucha Mahabal
4b8ed0f6ae fix: use get_all instead of get_list
- query report already filters records based on permissions for link fields

- allow employees access to leave balance report by default
2023-11-17 20:16:43 +05:30
Rucha Mahabal
eea7bbcea7 perf: index most queried fields in Leave Ledger Entry 2023-11-17 20:16:24 +05:30
mergify[bot]
1e436052e2 fix(Timesheet): reset billing hours equal to hours if they exceed actual hours (backport #38134) (#38154)
fix(Timesheet): reset billing hours equal to hours if they exceed actual hours (#38134)

(cherry picked from commit 20c6e9fca2)

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2023-11-17 18:32:35 +05:30
Frappe PR Bot
91a132c011 chore(release): Bumped to Version 13.54.11
## [13.54.11](https://github.com/frappe/erpnext/compare/v13.54.10...v13.54.11) (2023-11-14)

### Bug Fixes

* close `Credit Limit Crossed` dialog (backport [#38052](https://github.com/frappe/erpnext/issues/38052)) ([#38057](https://github.com/frappe/erpnext/issues/38057)) ([5be5fde](5be5fde276))
2023-11-14 12:56:26 +00:00
Deepesh Garg
2263542a6b Merge pull request #38087 from frappe/version-13-hotfix
chore: release v13
2023-11-14 18:25:03 +05:30
mergify[bot]
5be5fde276 fix: close Credit Limit Crossed dialog (backport #38052) (#38057)
fix: close `Credit Limit Crossed` dialog (#38052)

(cherry picked from commit 94faa44697)

Co-authored-by: Arjun <arjun99c@gmail.com>
2023-11-12 18:07:50 +05:30
Frappe PR Bot
6a53e823f0 chore(release): Bumped to Version 13.54.10
## [13.54.10](https://github.com/frappe/erpnext/compare/v13.54.9...v13.54.10) (2023-11-08)

### Bug Fixes

* add missing disbursement account in update_old_loans patch ([37b1a0e](37b1a0e778))
* bump pygithub requirement to handle conflict ([#37800](https://github.com/frappe/erpnext/issues/37800)) ([13d5eec](13d5eec194))
* e-invoice jwt verification error ([#37818](https://github.com/frappe/erpnext/issues/37818)) ([8f4ded6](8f4ded6ad1))
* permission error while creating Supplier Quotation from Portal (backport [#37864](https://github.com/frappe/erpnext/issues/37864)) ([#37872](https://github.com/frappe/erpnext/issues/37872)) ([6952f0f](6952f0f082))
* Quality Inspection Parameter migration - DuplicateEntryError due to case sensitivity (backport [#37499](https://github.com/frappe/erpnext/issues/37499)) ([#37918](https://github.com/frappe/erpnext/issues/37918)) ([4789eca](4789ecacea))
* remove voucher type and no for Item and Warehouse based reposting (backport [#37849](https://github.com/frappe/erpnext/issues/37849)) (backport [#37850](https://github.com/frappe/erpnext/issues/37850)) ([#37938](https://github.com/frappe/erpnext/issues/37938)) ([8cb0f69](8cb0f690d5))
2023-11-08 06:04:16 +00:00
Deepesh Garg
c808607975 Merge pull request #37966 from frappe/version-13-hotfix
chore: release v13
2023-11-08 11:33:04 +05:30
mergify[bot]
8cb0f690d5 fix: remove voucher type and no for Item and Warehouse based reposting (backport #37849) (backport #37850) (#37938)
* fix: remove voucher type and no for Item and Warehouse based reposting (backport #37849) (#37850)

* fix: remove voucher type and no for Item and Warehouse based reposting

(cherry picked from commit 0104897d69)

* chore: fix test cases

---------

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
(cherry picked from commit e19cade12d)

# Conflicts:
#	erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py
#	erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py
#	erpnext/stock/doctype/stock_reposting_settings/stock_reposting_settings.json

* chore: fix conflicts

* chore: fix conflicts

* chore: fix conflicts

* fix: conflicts

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-11-07 16:07:17 +05:30
mergify[bot]
4789ecacea fix: Quality Inspection Parameter migration - DuplicateEntryError due to case sensitivity (backport #37499) (#37918)
fix: Quality Inspection Parameter migration - DuplicateEntryError due to case sensitivity (#37499)

* fix: account for case-insensitive database primary key for parameter names

* chore: linting

(cherry picked from commit b099590b2c)

Co-authored-by: Richard Case <110036763+casesolved-co-uk@users.noreply.github.com>
2023-11-05 06:22:42 +00:00
Anand Baburajan
d00257ffd7 Merge pull request #37891 from frappe/mergify/bp/version-13-hotfix/pr-37889
fix: add missing disbursement account in update_old_loans patch (backport #37889)
2023-11-03 21:48:57 +05:30
anandbaburajan
37b1a0e778 fix: add missing disbursement account in update_old_loans patch
(cherry picked from commit ad64065ec6)
2023-11-03 16:17:29 +00:00
mergify[bot]
6952f0f082 fix: permission error while creating Supplier Quotation from Portal (backport #37864) (#37872)
* fix: permission error while creating Supplier Quotation from Portal

(cherry picked from commit e019d43d0b)

# Conflicts:
#	erpnext/controllers/buying_controller.py

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-11-03 16:26:45 +05:30
Frappe PR Bot
c84384aa1b chore(release): Bumped to Version 13.54.9
## [13.54.9](https://github.com/frappe/erpnext/compare/v13.54.8...v13.54.9) (2023-11-01)

### Bug Fixes

* e-invoice jwt verification error (backport [#37818](https://github.com/frappe/erpnext/issues/37818)) ([#37820](https://github.com/frappe/erpnext/issues/37820)) ([428f7a6](428f7a61ef))
2023-11-01 07:59:52 +00:00
mergify[bot]
428f7a61ef fix: e-invoice jwt verification error (backport #37818) (#37820)
fix: e-invoice jwt verification error (#37818)

(cherry picked from commit 8f4ded6ad1)

Co-authored-by: Dany Robert <rtdany10@gmail.com>
2023-11-01 13:28:21 +05:30
Dany Robert
8f4ded6ad1 fix: e-invoice jwt verification error (#37818) 2023-11-01 13:27:24 +05:30
Frappe PR Bot
9607d69ada chore(release): Bumped to Version 13.54.8
## [13.54.8](https://github.com/frappe/erpnext/compare/v13.54.7...v13.54.8) (2023-10-31)

### Bug Fixes

* bump pygithub requirement to handle conflict (backport [#37800](https://github.com/frappe/erpnext/issues/37800)) ([#37808](https://github.com/frappe/erpnext/issues/37808)) ([aaba335](aaba335273))
2023-10-31 14:46:40 +00:00
mergify[bot]
aaba335273 fix: bump pygithub requirement to handle conflict (backport #37800) (#37808)
fix: bump pygithub requirement to handle conflict (#37800)

build: bump pygithub requirement

This conflicts with pyjwt

(cherry picked from commit 13d5eec194)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-10-31 20:04:31 +05:30
Ankush Menat
13d5eec194 fix: bump pygithub requirement to handle conflict (#37800)
build: bump pygithub requirement

This conflicts with pyjwt
2023-10-31 19:55:56 +05:30
Frappe PR Bot
411bba1b98 chore(release): Bumped to Version 13.54.7
## [13.54.7](https://github.com/frappe/erpnext/compare/v13.54.6...v13.54.7) (2023-10-31)

### Bug Fixes

* wrong german translation ([#37658](https://github.com/frappe/erpnext/issues/37658)) ([5669a89](5669a89afe))
2023-10-31 12:45:41 +00:00
rohitwaghchaure
49f2d868c7 Merge pull request #37786 from frappe/version-13-hotfix
chore: release v13
2023-10-31 18:14:20 +05:30
Raffael Meyer
335b6c84db Merge pull request #37666 from frappe/mergify/bp/version-13-hotfix/pr-37658
fix: wrong german translation (backport #37658)
2023-10-28 23:07:59 +02:00
barredterra
00dff0a219 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-37658 2023-10-28 22:42:43 +02:00
mergify[bot]
b55b428114 chore: fixed test case non_internal_transfer_delivery_note (backport #37671) (#37677)
chore: fixed test case non_internal_transfer_delivery_note (#37671)

(cherry picked from commit 2bcff4c7f2)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-25 13:55:17 +05:30
Frappe PR Bot
dd6498d347 chore(release): Bumped to Version 13.54.6
## [13.54.6](https://github.com/frappe/erpnext/compare/v13.54.5...v13.54.6) (2023-10-25)

### Bug Fixes

* incorrect cost center in the purchase invoice (backport [#37591](https://github.com/frappe/erpnext/issues/37591)) ([#37610](https://github.com/frappe/erpnext/issues/37610)) ([4fc45b0](4fc45b035a))
* remove from or target warehouse for non internal transfer entries (backport [#37612](https://github.com/frappe/erpnext/issues/37612)) ([#37629](https://github.com/frappe/erpnext/issues/37629)) ([b5b5187](b5b51879ee))
2023-10-25 03:45:08 +00:00
Raffael Meyer
5669a89afe fix: wrong german translation (#37658)
(cherry picked from commit fa5780ca81)
2023-10-25 03:44:15 +00:00
Deepesh Garg
6e871c51ef Merge pull request #37655 from frappe/version-13-hotfix
chore: release v13
2023-10-25 09:13:26 +05:30
mergify[bot]
b5b51879ee fix: remove from or target warehouse for non internal transfer entries (backport #37612) (#37629)
* fix: remove from or target warehouse for non internal transfer entries (#37612)

(cherry picked from commit 5136fe196b)

* chore: removed test cases

* chore: removed test case

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-24 08:41:41 +05:30
mergify[bot]
4fc45b035a fix: incorrect cost center in the purchase invoice (backport #37591) (#37610)
* fix: incorrect cost center in the purchase invoice (#37591)

(cherry picked from commit 14b009b093)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-20 17:03:25 +05:30
Frappe PR Bot
24103554f5 chore(release): Bumped to Version 13.54.5
## [13.54.5](https://github.com/frappe/erpnext/compare/v13.54.4...v13.54.5) (2023-10-19)

### Bug Fixes

* e-commerce permissions for address (backport [#37554](https://github.com/frappe/erpnext/issues/37554)) ([#37560](https://github.com/frappe/erpnext/issues/37560)) ([49d0ab5](49d0ab5867))
* **gp:** wrong `allocated_amount` on multi sales person invoice ([7805c3a](7805c3acf6))
* Issues related to RFQ and Supplier Quotation on Portal (backport [#37565](https://github.com/frappe/erpnext/issues/37565)) (backport [#37577](https://github.com/frappe/erpnext/issues/37577)) ([#37588](https://github.com/frappe/erpnext/issues/37588)) ([bc907b2](bc907b22d4))
* keep customer/supplier website role by default ([52aff1f](52aff1f703))
* negative valuation rate in PR return (backport [#37424](https://github.com/frappe/erpnext/issues/37424)) ([#37462](https://github.com/frappe/erpnext/issues/37462)) ([66ad823](66ad823417))
* use `flt` to ignore TypeError (backport [#37481](https://github.com/frappe/erpnext/issues/37481)) ([#37489](https://github.com/frappe/erpnext/issues/37489)) ([8b4e692](8b4e69235a))
2023-10-19 11:36:26 +00:00
Deepesh Garg
d459421175 Merge pull request #37544 from frappe/version-13-hotfix
chore: release v13
2023-10-19 17:04:53 +05:30
mergify[bot]
bc907b22d4 fix: Issues related to RFQ and Supplier Quotation on Portal (backport #37565) (backport #37577) (#37588)
* fix: Issues related to RFQ and Supplier Quotation on Portal (backport #37565) (#37577)

* fix: Issues related to RFQ and Supplier Quotation on Portal (#37565)

fix: RFQ and Supplier Quotation for Portal
(cherry picked from commit 2851a41310)

* chore: removed backport changes

---------

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

# Conflicts:
#	erpnext/templates/includes/rfq.js

* chore: fix conflicts

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-19 16:39:38 +05:30
mergify[bot]
7e26449b9f chore: rewrite query using query builder (backport #37310) (#37585)
* chore: rewrite query using query builder

(cherry picked from commit 25718f5cc7)

* chore: fix shopping cart tests

(cherry picked from commit fb51cae88b)

* chore: fix test case

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-10-19 15:58:45 +05:30
mergify[bot]
49d0ab5867 fix: e-commerce permissions for address (backport #37554) (#37560)
* fix: E-commerce permissions

(cherry picked from commit f4d74990fe)

# Conflicts:
#	erpnext/accounts/party.py
#	erpnext/controllers/selling_controller.py

* chore: conflicts

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-10-18 18:46:10 +05:30
Deepesh Garg
ddec91202a Merge branch 'version-13' into version-13-hotfix 2023-10-17 17:59:36 +05:30
Ankush Menat
fe681acaad Merge pull request #37534 from frappe/mergify/bp/version-13-hotfix/pr-37532
fix: keep customer/supplier website role by default (backport #37532)
2023-10-16 17:36:59 +05:30
Ankush Menat
52aff1f703 fix: keep customer/supplier website role by default
(cherry picked from commit d2096cfdb7)
2023-10-16 17:35:44 +05:30
ruthra kumar
1cfc6cfe5d Merge pull request #37509 from frappe/mergify/bp/version-13-hotfix/pr-37435
fix(gp): wrong `allocated_amount` when grouped by Sales Person (backport #37435)
2023-10-15 10:30:28 +05:30
Dany Robert
7805c3acf6 fix(gp): wrong allocated_amount on multi sales person invoice
(cherry picked from commit bda82bf1e9)
2023-10-15 08:14:26 +05:30
mergify[bot]
8b4e69235a fix: use flt to ignore TypeError (backport #37481) (#37489)
fix: use `flt` to ignore TypeError (#37481)

(cherry picked from commit d2b22db500)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-10-13 10:25:28 +05:30
Frappe PR Bot
35a62e2e8d chore(release): Bumped to Version 13.54.4
## [13.54.4](https://github.com/frappe/erpnext/compare/v13.54.3...v13.54.4) (2023-10-11)

### Bug Fixes

* negative valuation rate in PR return (backport [#37424](https://github.com/frappe/erpnext/issues/37424)) (backport [#37462](https://github.com/frappe/erpnext/issues/37462)) ([#37463](https://github.com/frappe/erpnext/issues/37463)) ([f6b3532](f6b35324ef))
2023-10-11 14:24:45 +00:00
mergify[bot]
f6b35324ef fix: negative valuation rate in PR return (backport #37424) (backport #37462) (#37463)
fix: negative valuation rate in PR return (backport #37424) (#37462)

* fix: negative valuation rate in PR return (#37424)

* fix: negative valuation rate in PR return

* test: add test case for PR return

(cherry picked from commit 26ad688584)

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

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
(cherry picked from commit 66ad823417)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-10-11 19:53:10 +05:30
mergify[bot]
66ad823417 fix: negative valuation rate in PR return (backport #37424) (#37462)
* fix: negative valuation rate in PR return (#37424)

* fix: negative valuation rate in PR return

* test: add test case for PR return

(cherry picked from commit 26ad688584)

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

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-10-11 19:17:02 +05:30
ruthra kumar
f674635ecf Merge pull request #37440 from ruthra-kumar/patch_for_exchange_rate_service_provider
chore: patch to set default exchange rate service providers
2023-10-10 21:02:10 +05:30
Frappe PR Bot
0000c38563 chore(release): Bumped to Version 13.54.3
## [13.54.3](https://github.com/frappe/erpnext/compare/v13.54.2...v13.54.3) (2023-10-10)

### Bug Fixes

* change currency exchange API to api.frankfurter.app ([76919c4](76919c4af2))
2023-10-10 14:47:51 +00:00
Deepesh Garg
23f12f6463 Merge pull request #37432 from frappe/version-13-hotfix
chore: release v13
2023-10-10 20:16:20 +05:30
ruthra kumar
6f6db432b5 chore: patch to set default exchange rate service provider 2023-10-10 17:37:04 +05:30
ruthra kumar
ba7a822682 Merge pull request #37389 from frappe/mergify/bp/version-13/pr-37385
refactor: multiple service providers for Currency Exchange rates (backport #37385)
2023-10-07 19:28:53 +05:30
ruthra kumar
32ae68eb5c refactor: access_key field for service_provider
(cherry picked from commit 22fb65621c)
2023-10-07 12:46:52 +00:00
ruthra kumar
9eb02637d8 refactor: selectable exchange rate service providers
(cherry picked from commit 55dfd8e995)
2023-10-07 12:46:52 +00:00
ruthra kumar
fd8543ebd3 Merge pull request #37385 from ruthra-kumar/multiple_currency_exchange_provider
refactor: multiple service providers for Currency Exchange rates
2023-10-07 15:34:05 +05:30
ruthra kumar
22fb65621c refactor: access_key field for service_provider 2023-10-07 14:28:32 +05:30
ruthra kumar
55dfd8e995 refactor: selectable exchange rate service providers 2023-10-06 15:05:57 +05:30
Frappe PR Bot
fa0eef96b9 chore(release): Bumped to Version 13.54.1
## [13.54.1](https://github.com/frappe/erpnext/compare/v13.54.0...v13.54.1) (2023-10-05)

### Bug Fixes

* change currency exchange API to api.frankfurter.app ([1da808a](1da808a125))
2023-10-05 03:51:29 +00:00
ruthra kumar
ee42b0a16b Merge pull request #37365 from frappe/mergify/bp/version-13/pr-37355
fix: change currency exchange API to api.frankfurter.app (backport #37355)
2023-10-05 09:20:03 +05:30
ruthra kumar
40e475836e refactor(test): update exchange rate based on 'frankfurter' provider
(cherry picked from commit a3fd4db450)
2023-10-05 03:14:51 +00:00
dsnetprofitxl
1da808a125 fix: change currency exchange API to api.frankfurter.app
(cherry picked from commit 76919c4af2)
2023-10-05 03:14:49 +00:00
ruthra kumar
c86cd99395 Merge pull request #37355 from dsnetprofitxl/fix-exchange-rate
fix: change currency exchange API to api.frankfurter.app
2023-10-04 21:58:13 +05:30
ruthra kumar
a3fd4db450 refactor(test): update exchange rate based on 'frankfurter' provider 2023-10-04 21:33:11 +05:30
dsnetprofitxl
76919c4af2 fix: change currency exchange API to api.frankfurter.app 2023-10-04 16:01:22 +05:30
Frappe PR Bot
b0708d29a8 chore(release): Bumped to Version 13.54.0
# [13.54.0](https://github.com/frappe/erpnext/compare/v13.53.0...v13.54.0) (2023-10-04)

### Bug Fixes

* incorrect stock ledger entries in DN (backport [#36944](https://github.com/frappe/erpnext/issues/36944)) ([#37067](https://github.com/frappe/erpnext/issues/37067)) ([5833c4d](5833c4dae2))
* trial balance report freezes when adding filters (backport [#37264](https://github.com/frappe/erpnext/issues/37264)) ([#37267](https://github.com/frappe/erpnext/issues/37267)) ([ff6b38c](ff6b38c9e7))
* Update `advance_paid` in SO/PO after unlinking from advance entry ([a6bef64](a6bef64c8e))

### Features

* `Stock Ledger Variance` report (backport [#37165](https://github.com/frappe/erpnext/issues/37165)) ([#37184](https://github.com/frappe/erpnext/issues/37184)) ([5092ea1](5092ea175e))
* provision to make reposting entries from Stock and Account Value Comparison Report (backport [#35365](https://github.com/frappe/erpnext/issues/35365)) ([#37171](https://github.com/frappe/erpnext/issues/37171)) ([48eb6a6](48eb6a6573))
2023-10-04 04:15:19 +00:00
ruthra kumar
caa8417306 Merge pull request #37340 from frappe/version-13-hotfix
chore: release v13
2023-10-04 09:43:53 +05:30
mergify[bot]
ff6b38c9e7 fix: trial balance report freezes when adding filters (backport #37264) (#37267)
fix: trial balance report freezes when adding filters (#37264)

fix: Only add onclick if correct data is returned

workaround for https://github.com/frappe/datatable/issues/177

(cherry picked from commit 2dc95e5d59)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-09-27 12:37:10 +05:30
Frappe PR Bot
4285bbcdc0 chore: release v13 (#37245)
* feat: provision to make reposting entries from Stock and Account Value Comparison Report (backport #35365) (#37171)

* feat: provision to make reposting entries from Stock and Account Value Comparison Report

(cherry picked from commit 7b818e9d34)

* fix: `linter`

* fix(ux): throw if no row selected to create repost entries

---------

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>

* fix: incorrect stock ledger entries in DN (backport #36944) (#37067)

* fix: incorrect stock ledger entries in DN (#36944)

(cherry picked from commit 0e83190c19)

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

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>

* feat: `Stock Ledger Variance` report (backport #37165) (#37184)

feat: `Stock Ledger Variance` report (#37165)

* feat: `Stock Ledger Variance` report

* refactor: `get_data()`

(cherry picked from commit acda72d616)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>

* fix: Update `advance_paid` in SO/PO after unlinking from advance entry

(cherry picked from commit 426350eee6)

* test: Impact on SO of advance PE submit and unlinking/replacement by SI

(cherry picked from commit 8a4954d713)

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
Co-authored-by: marination <maricadsouza221197@gmail.com>
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-09-27 09:25:47 +05:30
ruthra kumar
b6dc47ec8a Merge pull request #37197 from frappe/mergify/bp/version-13-hotfix/pr-37069
fix: Recalculate `advance_paid` in SO/PO after unlinking from advance entry (backport #37069)
2023-09-23 11:05:10 +05:30
marination
d0c6f286cf test: Impact on SO of advance PE submit and unlinking/replacement by SI
(cherry picked from commit 8a4954d713)
2023-09-22 03:06:37 +00:00
marination
a6bef64c8e fix: Update advance_paid in SO/PO after unlinking from advance entry
(cherry picked from commit 426350eee6)
2023-09-22 03:06:36 +00:00
mergify[bot]
5092ea175e feat: Stock Ledger Variance report (backport #37165) (#37184)
feat: `Stock Ledger Variance` report (#37165)

* feat: `Stock Ledger Variance` report

* refactor: `get_data()`

(cherry picked from commit acda72d616)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-09-21 07:59:13 +00:00
mergify[bot]
5833c4dae2 fix: incorrect stock ledger entries in DN (backport #36944) (#37067)
* fix: incorrect stock ledger entries in DN (#36944)

(cherry picked from commit 0e83190c19)

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

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-09-20 18:12:08 +05:30
mergify[bot]
48eb6a6573 feat: provision to make reposting entries from Stock and Account Value Comparison Report (backport #35365) (#37171)
* feat: provision to make reposting entries from Stock and Account Value Comparison Report

(cherry picked from commit 7b818e9d34)

* fix: `linter`

* fix(ux): throw if no row selected to create repost entries

---------

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-09-20 11:14:48 +00:00
Frappe PR Bot
7c1288f726 chore(release): Bumped to Version 13.53.0
# [13.53.0](https://github.com/frappe/erpnext/compare/v13.52.15...v13.53.0) (2023-09-19)

### Bug Fixes

* fetch logic for repay_from_salary in loan_repayment [v13] ([#37136](https://github.com/frappe/erpnext/issues/37136)) ([d4f8b05](d4f8b057e1))

### Features

* provision to create RIV from `Stock Ledger Invariant Check` report (backport [#37115](https://github.com/frappe/erpnext/issues/37115)) ([#37149](https://github.com/frappe/erpnext/issues/37149)) ([86b152f](86b152fe5c))
2023-09-19 13:22:41 +00:00
Deepesh Garg
c89715d6da Merge pull request #37154 from frappe/version-13-hotfix
chore: release v13
2023-09-19 18:50:07 +05:30
Anand Baburajan
d4f8b057e1 fix: fetch logic for repay_from_salary in loan_repayment [v13] (#37136)
fix: fetch logic for repay_from_salary in loan_repayment
2023-09-19 15:18:17 +05:30
mergify[bot]
86b152fe5c feat: provision to create RIV from Stock Ledger Invariant Check report (backport #37115) (#37149)
* feat: provision to create RIV from `Stock Ledger Invariant Check` report (#37115)

* feat: provision to create RIV from `Stock Ledger Invariant Check` report

* fix: `linter`

(cherry picked from commit 9c9d0ecb73)

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

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-09-19 09:19:46 +00:00
Frappe PR Bot
11b16569e5 chore(release): Bumped to Version 13.52.15
## [13.52.15](https://github.com/frappe/erpnext/compare/v13.52.14...v13.52.15) (2023-09-12)

### Bug Fixes

* prorate factor for subscription plan ([#36953](https://github.com/frappe/erpnext/issues/36953)) ([9a15ed8](9a15ed8083))
2023-09-12 12:21:41 +00:00
Deepesh Garg
cd99630457 Merge pull request #37044 from frappe/version-13-hotfix
chore: release v13
2023-09-12 17:50:08 +05:30
Frappe PR Bot
efab1e7361 chore(release): Bumped to Version 13.52.14
## [13.52.14](https://github.com/frappe/erpnext/compare/v13.52.13...v13.52.14) (2023-09-10)

### Bug Fixes

* prorate factor for subscription plan ([#36953](https://github.com/frappe/erpnext/issues/36953)) ([d7f09f8](d7f09f8795))
2023-09-10 18:30:02 +00:00
Deepesh Garg
63a6e7e35c Merge pull request #37018 from frappe/mergify/bp/version-13/pr-37009
fix: prorate factor for subscription plan (#36953)
2023-09-10 23:58:35 +05:30
Gursheen Kaur Anand
d7f09f8795 fix: prorate factor for subscription plan (#36953)
(cherry picked from commit fc79af5926)
(cherry picked from commit 9a15ed8083)
2023-09-10 17:58:33 +00:00
Deepesh Garg
437a294621 Merge pull request #37009 from frappe/mergify/bp/version-13-hotfix/pr-36953
fix: prorate factor for subscription plan (#36953)
2023-09-10 12:21:09 +05:30
Gursheen Kaur Anand
9a15ed8083 fix: prorate factor for subscription plan (#36953)
(cherry picked from commit fc79af5926)
2023-09-10 06:06:12 +00:00
mergify[bot]
3a49d4f9b3 chore: asset finance books validation (backport #36979) (#36982)
* chore: asset finance books validation (#36979)

(cherry picked from commit 0077659e93)

# Conflicts:
#	erpnext/assets/doctype/asset/asset.py

* chore: fix conflicts

* chore: fix tests

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-09-06 15:39:44 +05:30
Frappe PR Bot
8b2c6ed61a chore(release): Bumped to Version 13.52.13
## [13.52.13](https://github.com/frappe/erpnext/compare/v13.52.12...v13.52.13) (2023-09-06)

### Bug Fixes

* ask for asset related accounts only when needed (backport [#36960](https://github.com/frappe/erpnext/issues/36960)) ([#36972](https://github.com/frappe/erpnext/issues/36972)) ([3a71fa9](3a71fa9d96))
* update repay_from_salary, payment_account and payroll_payable_account fields ([#36949](https://github.com/frappe/erpnext/issues/36949)) ([6f40d0c](6f40d0cdf6))
2023-09-06 07:24:52 +00:00
Deepesh Garg
4f98e958a1 Merge pull request #36962 from frappe/version-13-hotfix
chore: release v13
2023-09-06 12:52:49 +05:30
mergify[bot]
3a71fa9d96 fix: ask for asset related accounts only when needed (backport #36960) (#36972)
fix: ask for asset related accounts only when needed (#36960)

* fix: only ask for asset_received_but_not_billed account when needed

* chore: remove unnecessary if condition

* fix: only ask for expenses_included_in_asset_valuation account when needed

(cherry picked from commit 174f95d699)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-09-05 18:14:49 +05:30
Anand Baburajan
6f40d0cdf6 fix: update repay_from_salary, payment_account and payroll_payable_account fields (#36949)
* fix: update repay_from_salary, payment_account and payroll_payable_account fields

* chore: formatting
2023-09-05 12:43:09 +05:30
Anand Baburajan
5bd6c27b05 chore: patch to correct asset values if je has workflow [v13] (#36916)
chore: patch to correct asset values if je has workflow
2023-09-02 18:32:23 +05:30
Frappe PR Bot
9876019c69 chore(release): Bumped to Version 13.52.12
## [13.52.12](https://github.com/frappe/erpnext/compare/v13.52.11...v13.52.12) (2023-08-22)

### Bug Fixes

* disallow mulitple SO with same PO No ([3b9ac9f](3b9ac9f46a))
* timeout error coming during reposting (backport [#36715](https://github.com/frappe/erpnext/issues/36715)) ([#36753](https://github.com/frappe/erpnext/issues/36753)) ([783bb93](783bb93913))
2023-08-22 16:59:52 +00:00
Deepesh Garg
f4fb878282 Merge pull request #36762 from frappe/version-13-hotfix
chore: release v13
2023-08-22 22:28:20 +05:30
mergify[bot]
783bb93913 fix: timeout error coming during reposting (backport #36715) (#36753)
fix: timeout error coming during reposting (#36715)

(cherry picked from commit 620b21fec5)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-08-22 13:22:48 +05:30
Frappe PR Bot
cfbd9af100 chore(release): Bumped to Version 13.52.11
## [13.52.11](https://github.com/frappe/erpnext/compare/v13.52.10...v13.52.11) (2023-08-17)

### Bug Fixes

* disallow mulitple SO with same PO No ([bdaae81](bdaae81171))
2023-08-17 10:12:01 +00:00
ruthra kumar
966c296872 Merge pull request #36680 from frappe/mergify/bp/version-13/pr-36590
fix: disallow mulitple SO with same Purchase Order No if not enabled in Settings (backport #36590)
2023-08-17 15:40:34 +05:30
ruthra kumar
0ff871e38e chore: resolve conflict 2023-08-17 09:11:47 +05:30
ruthra kumar
9df10dbc40 refactor(test): don't set po_no by default
(cherry picked from commit 64614cd915)

# Conflicts:
#	erpnext/stock/doctype/delivery_note/test_delivery_note.py
2023-08-17 03:33:56 +00:00
ruthra kumar
bdaae81171 fix: disallow mulitple SO with same PO No
(cherry picked from commit dbd3fdbb41)
2023-08-17 03:33:56 +00:00
ruthra kumar
066cf0e3bc Merge pull request #36671 from frappe/mergify/bp/version-13-hotfix/pr-36590
fix: disallow mulitple SO with same Purchase Order No if not enabled in Settings (backport #36590)
2023-08-16 16:21:33 +05:30
ruthra kumar
829298066f chore: resolve conflict 2023-08-16 15:02:04 +05:30
ruthra kumar
006da22d3f refactor(test): don't set po_no by default
(cherry picked from commit 64614cd915)

# Conflicts:
#	erpnext/stock/doctype/delivery_note/test_delivery_note.py
2023-08-16 09:12:18 +00:00
ruthra kumar
3b9ac9f46a fix: disallow mulitple SO with same PO No
(cherry picked from commit dbd3fdbb41)
2023-08-16 09:12:17 +00:00
Frappe PR Bot
8f977f40f0 chore(release): Bumped to Version 13.52.10
## [13.52.10](https://github.com/frappe/erpnext/compare/v13.52.9...v13.52.10) (2023-08-16)

### Bug Fixes

* Allow backdated repayment cancels for term loans ([c417365](c417365e03))
* payment allocation in invoice payment schedule ([#36440](https://github.com/frappe/erpnext/issues/36440)) ([e5b3860](e5b38607ce))

### Performance Improvements

* **invoice:** Faster return amount query (backport [#36556](https://github.com/frappe/erpnext/issues/36556)) ([#36558](https://github.com/frappe/erpnext/issues/36558)) ([a801bba](a801bba83e))
2023-08-16 02:46:48 +00:00
Deepesh Garg
3bc7c88133 Merge pull request #36657 from frappe/version-13-hotfix
chore: release v13
2023-08-16 08:15:05 +05:30
mergify[bot]
84b6f68108 chore: add validation for depreciation expense account in asset category (backport #36659) (#36662)
chore: add validation for depreciation expense account in asset category (#36659)

(cherry picked from commit e0c79d3b53)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-08-15 18:26:33 +05:30
mergify[bot]
e5b38607ce fix: payment allocation in invoice payment schedule (#36440)
fix: payment allocation in invoice payment schedule (#36440)
2023-08-13 13:21:04 +05:30
Deepesh Garg
b3c9d0d910 Merge pull request #36624 from frappe/mergify/bp/version-13-hotfix/pr-36614
fix: Allow backdated repayment cancels for term loans (#36614)
2023-08-13 13:20:02 +05:30
Deepesh Garg
c417365e03 fix: Allow backdated repayment cancels for term loans
(cherry picked from commit 1377cf4cf1)
2023-08-13 06:28:38 +00:00
mergify[bot]
b2a4175d43 chore: set default filter dates if missing (backport #36597) (#36599)
chore: set default filter dates if missing (#36597)

(cherry picked from commit 98e82e0d99)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-08-11 09:17:08 +00:00
mergify[bot]
a801bba83e perf(invoice): Faster return amount query (backport #36556) (#36558)
perf(invoice): Faster return amount query (#36556)

perf: Faster return amount query
(cherry picked from commit b0c79a0467)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-08-09 14:07:52 +05:30
Frappe PR Bot
3ccb511e25 chore(release): Bumped to Version 13.52.9
## [13.52.9](https://github.com/frappe/erpnext/compare/v13.52.8...v13.52.9) (2023-08-08)

### Bug Fixes

* Tax withholding against order via Payment Entry ([#36493](https://github.com/frappe/erpnext/issues/36493)) ([5dbca09](5dbca09899))
2023-08-08 18:37:46 +00:00
Deepesh Garg
8c51f2e5a1 Merge pull request #36545 from frappe/version-13-hotfix
chore: release v13
2023-08-09 00:05:16 +05:30
mergify[bot]
5dbca09899 fix: Tax withholding against order via Payment Entry (#36493)
* fix: Tax withholding against order via Payment Entry (#36493)

* fix: Tax withholding against order via Payment Entry

* test: Add test case

* fix: Nonetype exceptions

(cherry picked from commit 93767eb7fc)

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

* chore: resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-08-07 17:15:22 +05:30
mergify[bot]
9ec7bb9be3 chore: better cost center validation for assets (backport #36477) (#36478)
chore: better cost center validation for assets (#36477)

(cherry picked from commit 38a612c62e)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-08-03 17:19:05 +05:30
Frappe PR Bot
0281afcead chore(release): Bumped to Version 13.52.8
## [13.52.8](https://github.com/frappe/erpnext/compare/v13.52.7...v13.52.8) (2023-08-01)

### Bug Fixes

* added validation for unique serial numbers in pos invoice ([#36302](https://github.com/frappe/erpnext/issues/36302)) ([a165b37](a165b37fd7))
* only publish repost progress to doc subscriber (backport [#36400](https://github.com/frappe/erpnext/issues/36400)) ([#36403](https://github.com/frappe/erpnext/issues/36403)) ([e9df064](e9df06406f))
* removed "fetch_from" (backport [#36365](https://github.com/frappe/erpnext/issues/36365)) ([#36387](https://github.com/frappe/erpnext/issues/36387)) ([c574494](c574494ddd))

### Performance Improvements

* use `LEFT JOIN` instead of `NOT EXISTS` (backport [#36221](https://github.com/frappe/erpnext/issues/36221)) ([#36384](https://github.com/frappe/erpnext/issues/36384)) ([cdc86bd](cdc86bd76c))
2023-08-01 18:04:50 +00:00
Deepesh Garg
348e4616cb Merge pull request #36441 from frappe/version-13-hotfix
chore: release v13
2023-08-01 23:33:11 +05:30
RitvikSardana
a165b37fd7 fix: added validation for unique serial numbers in pos invoice (#36302)
* fix: added validation for unique serial numbers in pos invoice

* fix: updated title of validation

* fix: removed extra whitespace

* fix: added validation for duplicate batch numbers

---------

Co-authored-by: Ritvik Sardana <ritviksardana@Ritviks-MacBook-Air.local>
2023-07-31 23:28:10 +05:30
mergify[bot]
cdc86bd76c perf: use LEFT JOIN instead of NOT EXISTS (backport #36221) (#36384)
* perf: use `LEFT JOIN` instead of `NOT EXISTS`

(cherry picked from commit 58d867503b)

# Conflicts:
#	erpnext/manufacturing/doctype/bom_update_log/bom_updation_utils.py

* fix: long queue `process_boms_cost_level_wise`

(cherry picked from commit 148d466ae5)

* chore: `conflicts`

* fix: failing test case

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-07-31 17:39:31 +05:30
mergify[bot]
e9df06406f fix: only publish repost progress to doc subscriber (backport #36400) (#36403)
* fix: only publish repost progress to doc subscriber (#36400)

Huge size of string gets blasted to everyone on site. Due to some memory
leak (cause unknown) till sockets are open the strings are also in
process' memory.

related https://github.com/frappe/frappe/issues/21863

(cherry picked from commit c0642cf528)

# Conflicts:
#	erpnext/stock/stock_ledger.py

* chore: conflicts

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-07-29 18:14:26 +05:30
mergify[bot]
c574494ddd fix: removed "fetch_from" (backport #36365) (#36387)
fix: removed "fetch_from"

* fix: removed ("fetch_from": "goal.objective")
The field ended up being disabled because of this.

(cherry picked from commit 1c687a4afd)

Co-authored-by: xdlumertz <alexandrelumertz@gmail.com>
2023-07-28 18:15:24 +05:30
Frappe PR Bot
46966f4b7c chore(release): Bumped to Version 13.52.7
## [13.52.7](https://github.com/frappe/erpnext/compare/v13.52.6...v13.52.7) (2023-07-26)

### Bug Fixes

* allow both custodian and location while creating asset (backport [#36263](https://github.com/frappe/erpnext/issues/36263)) ([#36270](https://github.com/frappe/erpnext/issues/36270)) ([e4f28e8](e4f28e8a5b))
* apply discount on item after applying price list ([#36125](https://github.com/frappe/erpnext/issues/36125)) ([bde9e89](bde9e89582))
* group by in fixed asset register (copy [#36310](https://github.com/frappe/erpnext/issues/36310)) ([#36312](https://github.com/frappe/erpnext/issues/36312)) ([a5e1c47](a5e1c4798f))
2023-07-26 04:10:14 +00:00
Deepesh Garg
ded3b62c5a Merge pull request #36295 from frappe/version-13-hotfix
chore: release v13
2023-07-26 09:38:32 +05:30
mergify[bot]
a5e1c4798f fix: group by in fixed asset register (copy #36310) (#36312)
fix: group by in fixed asset register

(cherry picked from commit 1151e47f46)

Co-authored-by: anandbaburajan <anandbaburajan@gmail.com>
2023-07-25 21:01:47 +05:30
Anand Baburajan
bde9e89582 fix: apply discount on item after applying price list (#36125) 2023-07-25 20:32:57 +05:30
mergify[bot]
e4f28e8a5b fix: allow both custodian and location while creating asset (backport #36263) (#36270)
fix: allow both custodian and location while creating asset (#36263)

(cherry picked from commit 2b47f5815e)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-07-24 16:25:23 +05:30
Frappe PR Bot
128ea0d7fc chore(release): Bumped to Version 13.52.6
## [13.52.6](https://github.com/frappe/erpnext/compare/v13.52.5...v13.52.6) (2023-07-18)

### Bug Fixes

* allow manual asset receipt mov from nowhere (backport [#36093](https://github.com/frappe/erpnext/issues/36093)) ([#36095](https://github.com/frappe/erpnext/issues/36095)) ([2993eb5](2993eb5ce9))
* HSN code not showing up in GST itemised register reports ([#36142](https://github.com/frappe/erpnext/issues/36142)) ([1d3917b](1d3917b335))
* improve "Update Items" modal ([#36105](https://github.com/frappe/erpnext/issues/36105)) ([3bc899f](3bc899f354))

### Performance Improvements

* index in `Item` and `Item Variant Attribute` (backport [#36133](https://github.com/frappe/erpnext/issues/36133)) ([#36145](https://github.com/frappe/erpnext/issues/36145)) ([120de24](120de249dd))
2023-07-18 12:21:14 +00:00
Deepesh Garg
9566f4101d Merge pull request #36178 from frappe/version-13-hotfix
chore: release v13
2023-07-18 17:49:47 +05:30
Sagar Vora
4854c2e7f7 Merge pull request #36165 from frappe/mergify/bp/version-13-hotfix/pr-36163 2023-07-17 15:47:54 +05:30
Sagar Vora
a93c4b6c65 chore: use consistent quotes
(cherry picked from commit bccb718cc2)
2023-07-17 10:17:01 +00:00
mergify[bot]
287c67f7a2 chore: add validation for account type of party type and account (#36141)
chore: add validation for account type of party type and account (#36141)

chore: add validation to check if account type of party type and account match
(cherry picked from commit 305c37917f)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-07-17 11:51:45 +05:30
mergify[bot]
120de249dd perf: index in Item and Item Variant Attribute (backport #36133) (#36145)
* perf: index `variant_of` and `attribute` in `Item Variant Attribute`

(cherry picked from commit e4128a5c91)

* perf: index `disabled` in `Item`

(cherry picked from commit 04400eb2e4)

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

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-07-15 10:20:32 +05:30
Frappe PR Bot
cefa78b864 chore(release): Bumped to Version 13.52.5
## [13.52.5](https://github.com/frappe/erpnext/compare/v13.52.4...v13.52.5) (2023-07-14)

### Bug Fixes

* HSN code not showing up in GST itemised register reports (backport [#36142](https://github.com/frappe/erpnext/issues/36142)) ([#36143](https://github.com/frappe/erpnext/issues/36143)) ([73366de](73366de12f))
2023-07-14 14:49:30 +00:00
mergify[bot]
73366de12f fix: HSN code not showing up in GST itemised register reports (backport #36142) (#36143)
fix: HSN code not showing up in GST itemised register reports (#36142)

fix: hsn code not showing up in gst itemised registers
(cherry picked from commit 1d3917b335)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-07-14 20:18:07 +05:30
Anand Baburajan
1d3917b335 fix: HSN code not showing up in GST itemised register reports (#36142)
fix: hsn code not showing up in gst itemised registers
2023-07-14 20:16:49 +05:30
mergify[bot]
3bc899f354 fix: improve "Update Items" modal (#36105)
fix: improve "Update Items" modal (#36105)

* fix: make "Update Items" modal larger

* fix: remove conversion factor from overview

Conversion factor doesn't make much sense without two different UOMs
next to it, hence moving it to row detail view

(cherry picked from commit d5fe1432f8)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-07-14 13:03:43 +05:30
Ankush Menat
6b113c6abc ci: fix repo name in relase notes workflow
[skip ci]

(cherry picked from commit b5f6a1cc20)
2023-07-14 12:05:21 +05:30
mergify[bot]
82e2ff8731 ci: regen release notes with GH API (backport #36098) (#36100)
ci: regen release notes with GH API (#36098)

[skip ci]

(cherry picked from commit 0340bfc90d)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-07-12 12:18:34 +05:30
mergify[bot]
2993eb5ce9 fix: allow manual asset receipt mov from nowhere (backport #36093) (#36095)
* fix: allow manual asset receipt mov from nowhere (#36093)

(cherry picked from commit 4aaa1a15d7)

# Conflicts:
#	erpnext/assets/doctype/asset_movement/asset_movement.py

* chore: fix conflict

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-07-12 09:39:47 +05:30
Frappe PR Bot
12e27e96a8 chore(release): Bumped to Version 13.52.4
## [13.52.4](https://github.com/frappe/erpnext/compare/v13.52.3...v13.52.4) (2023-07-11)

### Bug Fixes

* also check on_hold ([#35910](https://github.com/frappe/erpnext/issues/35910)) ([5aa02b8](5aa02b8571))
* circular dependency during reposting causing timeout error ([ba69be1](ba69be1ced))
* **Employee Advance:** check if return amount is set before validating ([#36080](https://github.com/frappe/erpnext/issues/36080)) ([beaf13e](beaf13e00e))
* error messages while evaluating formulas and handle line boundaries ([#35989](https://github.com/frappe/erpnext/issues/35989)) ([4af57a7](4af57a7318))
* gst_hsn_code is ambiguous on gst reports ([3a00052](3a00052b49))
* incorrect status in MR created from PP (backport [#36085](https://github.com/frappe/erpnext/issues/36085)) ([#36087](https://github.com/frappe/erpnext/issues/36087)) ([e05bb10](e05bb103f3))
* payment entry `voucher_type` error ([#35779](https://github.com/frappe/erpnext/issues/35779)) ([9c3ec41](9c3ec41803))
* **Payment Entry:** compare rounded amount ([#36011](https://github.com/frappe/erpnext/issues/36011)) ([b04c190](b04c190e33))
* precision causing outstanding issue on partly paid invoices ([#36030](https://github.com/frappe/erpnext/issues/36030)) ([cf3ec93](cf3ec935a7))
* single column indexes ([#32425](https://github.com/frappe/erpnext/issues/32425)) ([53f7764](53f7764c67))

### Reverts

* Revert "perf: improve item wise register reports (backport #35908) (#35912)" ([b992366](b992366246)), closes [#35908](https://github.com/frappe/erpnext/issues/35908) [#35912](https://github.com/frappe/erpnext/issues/35912)
2023-07-11 14:12:25 +00:00
Deepesh Garg
30c9b15cdd Merge pull request #36084 from frappe/version-13-hotfix
chore: release v13
2023-07-11 19:41:00 +05:30
rohitwaghchaure
1d6bc68d87 Merge pull request #36090 from frappe/mergify/bp/version-13-hotfix/pr-36088
fix: circular dependency during reposting causing timeout error (backport #36088)
2023-07-11 19:09:36 +05:30
Rohit Waghchaure
ba69be1ced fix: circular dependency during reposting causing timeout error
(cherry picked from commit c16a5814d4)
2023-07-11 12:59:59 +00:00
Saurabh
4af57a7318 fix: error messages while evaluating formulas and handle line boundaries (#35989)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2023-07-11 18:04:31 +05:30
mergify[bot]
e05bb103f3 fix: incorrect status in MR created from PP (backport #36085) (#36087)
fix: incorrect status in MR created from PP (#36085)

(cherry picked from commit be5881280f)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-07-11 17:44:41 +05:30
Deepesh Garg
6f2fb89c49 Merge branch 'version-13' into version-13-hotfix 2023-07-11 16:17:56 +05:30
Rucha Mahabal
beaf13e00e fix(Employee Advance): check if return amount is set before validating (#36080) 2023-07-11 14:12:21 +05:30
mergify[bot]
9c3ec41803 fix: payment entry voucher_type error (#35779)
* fix: payment entry `voucher_type` error (#35779)

* fix: payment entry `voucher_type` error

* chore: linters

(cherry picked from commit 361a357088)

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

* chore: resolve conflicts

---------

Co-authored-by: Dany Robert <danyrt@wahni.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-07-11 10:19:55 +05:30
Anand Baburajan
06c85fa252 Revert "fix: gst_hsn_code is ambiguous on gst reports" (#36072) 2023-07-10 23:45:11 +05:30
mergify[bot]
0248fee533 refactor(Payment Entry): translatable strings (#36017)
* refactor(Payment Entry): translatable strings (#36017)

* refactor(Payment Entry): translatable strings

* fix: German translations

(cherry picked from commit af28f95c60)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.py
#	erpnext/translations/de.csv

* chore: resolve conflicts

---------

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-07-10 21:02:05 +05:30
RJPvT
5aa02b8571 fix: also check on_hold (#35910) 2023-07-10 19:43:12 +05:30
mergify[bot]
53f7764c67 fix: single column indexes (#32425)
fix: single column indexes (#32425)

refactor: move single column indexes to doctypes
(cherry picked from commit 8d1db0ea3d)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-07-10 18:12:55 +05:30
mergify[bot]
cf3ec935a7 fix: precision causing outstanding issue on partly paid invoices (#36030)
fix: precision causing outstanding issue on partly paid invoices (#36030)

* fix: precision causing outstanding issue on partly paid invoices

* chore: linters

(cherry picked from commit 5c820ecc20)

Co-authored-by: Dany Robert <danyrt@wahni.com>
2023-07-10 16:49:41 +05:30
mergify[bot]
2732276498 chore: add asset depr posting error in error log (backport #36052) (#36056)
chore: add asset depr posting error in error log (#36052)

(cherry picked from commit 0f9a6ee70a)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-07-10 14:12:43 +05:30
Frappe PR Bot
77eb11a6e3 chore(release): Bumped to Version 13.52.3
## [13.52.3](https://github.com/frappe/erpnext/compare/v13.52.2...v13.52.3) (2023-07-09)

### Reverts

* Revert "perf: improve item wise register reports (backport #35908) (#35912)" ([0feb393](0feb393fff)), closes [#35908](https://github.com/frappe/erpnext/issues/35908) [#35912](https://github.com/frappe/erpnext/issues/35912)
2023-07-09 07:53:45 +00:00
Deepesh Garg
5cfe4195ba Merge pull request #36035 from frappe/mergify/bp/version-13/pr-36034
Revert "perf: improve item wise register reports (backport #35908)" (backport #36034)
2023-07-09 13:22:03 +05:30
Deepesh Garg
0feb393fff Revert "perf: improve item wise register reports (backport #35908) (#35912)"
This reverts commit 41344593c9.

(cherry picked from commit b992366246)
2023-07-09 06:15:33 +00:00
Deepesh Garg
4b20f2a083 Merge pull request #36034 from frappe/revert-35912-mergify/bp/version-13-hotfix/pr-35908
Revert "perf: improve item wise register reports (backport #35908)"
2023-07-09 11:44:45 +05:30
Deepesh Garg
b992366246 Revert "perf: improve item wise register reports (backport #35908) (#35912)"
This reverts commit 41344593c9.
2023-07-09 11:42:23 +05:30
Frappe PR Bot
6490b7d561 chore(release): Bumped to Version 13.52.2
## [13.52.2](https://github.com/frappe/erpnext/compare/v13.52.1...v13.52.2) (2023-07-08)

### Bug Fixes

* gst_hsn_code is ambiguous on gst reports ([2893ae7](2893ae72f5))
2023-07-08 13:17:58 +00:00
ruthra kumar
a4d8f9cb94 Merge pull request #36031 from frappe/mergify/bp/version-13/pr-36028
fix: gst_hsn_code is ambiguous on gst reports (backport #36028)
2023-07-08 18:46:34 +05:30
ruthra kumar
2893ae72f5 fix: gst_hsn_code is ambiguous on gst reports
(cherry picked from commit 3a00052b49)
2023-07-08 12:38:53 +00:00
ruthra kumar
93acde7748 Merge pull request #36028 from ruthra-kumar/fix_ambiguous_gst_hsn_code
fix: gst_hsn_code is ambiguous on gst reports
2023-07-08 17:51:17 +05:30
ruthra kumar
3a00052b49 fix: gst_hsn_code is ambiguous on gst reports 2023-07-08 06:49:39 +05:30
Frappe PR Bot
1116cee831 chore(release): Bumped to Version 13.52.1
## [13.52.1](https://github.com/frappe/erpnext/compare/v13.52.0...v13.52.1) (2023-07-05)

### Bug Fixes

* **Payment Entry:** compare rounded amount ([#36011](https://github.com/frappe/erpnext/issues/36011)) ([a7d26b0](a7d26b0c20))
* **Payment Entry:** compare rounded amount ([#36011](https://github.com/frappe/erpnext/issues/36011)) ([a370dc3](a370dc3dcc))
2023-07-05 16:23:25 +00:00
Deepesh Garg
a7d26b0c20 fix(Payment Entry): compare rounded amount (#36011)
fix(Payment Entry): compare rounded amount (#36011)
2023-07-05 21:47:04 +05:30
mergify[bot]
a370dc3dcc fix(Payment Entry): compare rounded amount (#36011)
fix(Payment Entry): compare rounded amount (#36011)

(cherry picked from commit 4badac8e9e)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
(cherry picked from commit b04c190e33)
2023-07-05 16:09:00 +00:00
mergify[bot]
b04c190e33 fix(Payment Entry): compare rounded amount (#36011)
fix(Payment Entry): compare rounded amount (#36011)

(cherry picked from commit 4badac8e9e)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-07-05 21:38:11 +05:30
Frappe PR Bot
77d019cc3b chore(release): Bumped to Version 13.52.0
# [13.52.0](https://github.com/frappe/erpnext/compare/v13.51.7...v13.52.0) (2023-07-05)

### Bug Fixes

* conflicts ([b9833db](b9833db7bd))
* Expense Account filter in Sales Invoice ([#35944](https://github.com/frappe/erpnext/issues/35944)) ([b63fbe4](b63fbe4286))
* Further sort purchase_order_analysis to get consistent response ([0ef0ff4](0ef0ff470f))
* reposting has not changed valuation rate ([d4e680c](d4e680c109))
* Update no copy for received_qty field ([#35965](https://github.com/frappe/erpnext/issues/35965)) ([10c9640](10c9640cbd))

### Features

* **DATEV:** against account for opening entries ([#35941](https://github.com/frappe/erpnext/issues/35941)) ([0602ddc](0602ddcfc8))
2023-07-05 09:49:20 +00:00
Deepesh Garg
fd84119273 Merge pull request #35997 from frappe/version-13-hotfix
chore: release v13
2023-07-05 15:17:37 +05:30
Suraj Shetty
9b9d839835 Merge pull request #35986 from frappe/fix-report-sorting 2023-07-04 11:48:28 +05:30
Suraj Shetty
0ef0ff470f fix: Further sort purchase_order_analysis to get consistent response 2023-07-04 11:09:38 +05:30
mergify[bot]
10c9640cbd fix: Update no copy for received_qty field (#35965)
* fix: Update no copy for received_qty field (#35965)

(cherry picked from commit 5448859254)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
#	erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json

* chore: resolve conflicts

* chore: resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-07-03 16:38:26 +05:30
Raffael Meyer
da1218f324 chore: bump pandas (#35939) 2023-07-03 14:04:22 +05:30
rohitwaghchaure
407e5b5fa3 Merge pull request #35970 from frappe/mergify/bp/version-13-hotfix/pr-35955
fix: incorrect reposting causing stock adjustment entry (backport #35955)
2023-07-03 11:08:20 +05:30
rohitwaghchaure
b9833db7bd fix: conflicts 2023-07-03 09:53:16 +05:30
Rohit Waghchaure
d4e680c109 fix: reposting has not changed valuation rate
(cherry picked from commit c0c693d8b0)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
2023-07-03 04:21:32 +00:00
mergify[bot]
b63fbe4286 fix: Expense Account filter in Sales Invoice (#35944)
fix: Expense Account filter in Sales Invoice (#35944)

(cherry picked from commit d54f52474a)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-07-01 18:14:17 +05:30
Raffael Meyer
0602ddcfc8 feat(DATEV): against account for opening entries (#35941)
* fix: add missing german translations

* feat(DATEV): against account for opening entries

Allow to specify a separate temporary against account
for opening entries

* feat(DATEV Settings): validate account no. length

* style: format with black

* style: format with black

* test: new settings field, rename filter
2023-06-30 20:02:12 +05:30
mergify[bot]
18c3a668d9 chore: update translations (#35905)
chore: update translations

chore: update translations
(cherry picked from commit 1d1103f39c)

Co-authored-by: RJPvT <48353029+RJPvT@users.noreply.github.com>
2023-06-29 13:29:56 +05:30
Frappe PR Bot
26489121f3 chore(release): Bumped to Version 13.51.7
## [13.51.7](https://github.com/frappe/erpnext/compare/v13.51.6...v13.51.7) (2023-06-28)

### Bug Fixes

* asset movement (backport [#35918](https://github.com/frappe/erpnext/issues/35918)) ([#35924](https://github.com/frappe/erpnext/issues/35924)) ([0bcd047](0bcd0476a2))
* employee link fields in payroll reports ([#619](https://github.com/frappe/erpnext/issues/619)) ([#35845](https://github.com/frappe/erpnext/issues/35845)) ([6c4dff3](6c4dff38da))
* filter parent warehouses not showing (backport [#35897](https://github.com/frappe/erpnext/issues/35897)) ([#35900](https://github.com/frappe/erpnext/issues/35900)) ([bcfd770](bcfd7708f2))
* frappe.exceptions.DoesNotExistError: DocType KSA VAT Setting ([#35797](https://github.com/frappe/erpnext/issues/35797)) ([3785fe6](3785fe6927)), closes [#35795](https://github.com/frappe/erpnext/issues/35795)
* show non-depreciable assets in fixed asset register (backport [#35858](https://github.com/frappe/erpnext/issues/35858)) ([#35861](https://github.com/frappe/erpnext/issues/35861)) ([2e2c319](2e2c319f20))
* TDS amount calculation post LDC breach ([#35886](https://github.com/frappe/erpnext/issues/35886)) ([4dd088c](4dd088cba4))
* use correct fieldname for purchase receipt column in item_wise_purchase_register report (backport [#35828](https://github.com/frappe/erpnext/issues/35828)) ([#35848](https://github.com/frappe/erpnext/issues/35848)) ([de529f0](de529f0adf))
* **ux:** PO Get Items From Open Material Requests (backport [#35894](https://github.com/frappe/erpnext/issues/35894)) ([#35896](https://github.com/frappe/erpnext/issues/35896)) ([12b6257](12b62571b8))

### Performance Improvements

* improve item wise register reports (backport [#35908](https://github.com/frappe/erpnext/issues/35908)) ([#35912](https://github.com/frappe/erpnext/issues/35912)) ([4134459](41344593c9))
2023-06-28 16:08:20 +00:00
Deepesh Garg
41902c3676 Merge pull request #35902 from frappe/version-13-hotfix
chore: release v13
2023-06-28 21:33:23 +05:30
mergify[bot]
0bcd0476a2 fix: asset movement (backport #35918) (#35924)
* fix: asset movement (#35918)

fix: asset movement fixes
(cherry picked from commit e16c14863b)

# Conflicts:
#	erpnext/assets/doctype/asset_movement/asset_movement.py

* chore: fix conflict

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-06-28 21:00:02 +05:30
mergify[bot]
41344593c9 perf: improve item wise register reports (backport #35908) (#35912)
perf: improve item wise register reports (#35908)

(cherry picked from commit 33ee01174b)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-06-28 10:25:33 +05:30
mergify[bot]
bcfd7708f2 fix: filter parent warehouses not showing (backport #35897) (#35900)
* fix: filter parent warehouses not showing (#35897)

(cherry picked from commit af418d2342)

* chore: add company filter for parent warehouse

---------

Co-authored-by: HLD <hanglaoda@hotmail.com>
Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-06-27 14:27:33 +05:30
mergify[bot]
4dd088cba4 fix: TDS amount calculation post LDC breach (#35886)
* fix: TDS amount calculation post LDC breach

(cherry picked from commit 1f9ef6c48f)

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

* chore: resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-06-27 13:12:06 +05:30
mergify[bot]
12b62571b8 fix(ux): PO Get Items From Open Material Requests (backport #35894) (#35896)
fix(ux): PO Get Items From Open Material Requests

(cherry picked from commit 3a00bf83d6)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-06-27 12:30:08 +05:30
Ashish Shah
3785fe6927 fix: frappe.exceptions.DoesNotExistError: DocType KSA VAT Setting (#35797)
fix: frappe.exceptions.DoesNotExistError: DocType KSA VAT Setting not found

When migrating from v12->v13 migration fails
While migrating the doctype is not reloaded before adding permission. #35795
2023-06-24 16:40:12 +05:30
mergify[bot]
de529f0adf fix: use correct fieldname for purchase receipt column in item_wise_purchase_register report (backport #35828) (#35848)
fix: use correct fieldname for purchase receipt column in item_wise_purcchase_register report

(cherry picked from commit dcfc86e3af)

Co-authored-by: phot0n <ritwikpuri5678@gmail.com>
2023-06-23 11:37:38 +05:30
mergify[bot]
2e2c319f20 fix: show non-depreciable assets in fixed asset register (backport #35858) (#35861)
fix: show non-depreciable assets in fixed asset register (#35858)

fix: show non-depr assets in fixed asset register
(cherry picked from commit 42d09448ee)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-06-23 08:25:11 +05:30
mergify[bot]
8939e95c62 chore: asset scrap and restore fixes [v14] (backport #35851) (#35854)
* chore: asset scrap and restore fixes [v14] (#35851)

chore: better err msg on cancelling JE for asset scrap and allow restoring non-depr assets
(cherry picked from commit 69780da099)

# Conflicts:
#	erpnext/assets/doctype/asset/depreciation.py

* chore: fix conflict

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-06-22 23:01:59 +05:30
Rucha Mahabal
6c4dff38da fix: employee link fields in payroll reports (#619) (#35845) 2023-06-22 18:10:54 +05:30
saeedkola
000ebe4479 Fixes issue of asset value_after_depreciation field getting updated twice if workflow is enabled in Journal Entry (#35821)
* Fixes issue of asset value_after_depreciation field getting updated twice if workflow is enabled in Journal Entry

* chore: remove unnecessary line break

* chore: formatting

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-06-21 14:42:16 +05:30
Daizy Modi
0fe95bf77e chore: remove whitelisting for methods not used from UI (#35592) 2023-06-21 10:33:28 +05:30
Frappe PR Bot
60a170d1a4 chore(release): Bumped to Version 13.51.6
## [13.51.6](https://github.com/frappe/erpnext/compare/v13.51.5...v13.51.6) (2023-06-21)

### Bug Fixes

* account group totals calculation to consider include_in_gross ([f22969d](f22969d266))
* add total col for gross and net profit ([e899c30](e899c30428))
* add validation for QI in PR (backport [#35677](https://github.com/frappe/erpnext/issues/35677)) ([#35758](https://github.com/frappe/erpnext/issues/35758)) ([0a8b714](0a8b7148a5))
* Allocated amount validation for other party types ([#35741](https://github.com/frappe/erpnext/issues/35741)) ([3d0add8](3d0add81fa))
* date and finance book fixes in fixed asset register (backport [#35751](https://github.com/frappe/erpnext/issues/35751)) ([#35800](https://github.com/frappe/erpnext/issues/35800)) ([aa8446d](aa8446d794))
* don't add GL Entry for Acc. Depr. while scrapping non-depreciable assets (backport [#35714](https://github.com/frappe/erpnext/issues/35714)) ([#35716](https://github.com/frappe/erpnext/issues/35716)) ([0e11317](0e11317303))
* fix get outstanding invoices btn and add get outstanding orders btn (backport [#35776](https://github.com/frappe/erpnext/issues/35776)) ([#35788](https://github.com/frappe/erpnext/issues/35788)) ([04990d5](04990d51db))
* Incorrect field while calculating Tax withholding net total ([571c977](571c977e8e))
* Incorrect field while calculating Tax withholding net total ([b95d459](b95d459812))
* loan interest accrual date ([#35695](https://github.com/frappe/erpnext/issues/35695)) ([46d0b7d](46d0b7d317))

### Performance Improvements

* index `purpose` in `Stock Entry` (backport [#35782](https://github.com/frappe/erpnext/issues/35782)) ([#35784](https://github.com/frappe/erpnext/issues/35784)) ([7239e83](7239e839a0))
2023-06-21 02:06:13 +00:00
Deepesh Garg
51dd0ec876 Merge pull request #35806 from frappe/version-13-hotfix
chore: release v13
2023-06-21 07:34:34 +05:30
mergify[bot]
aa8446d794 fix: date and finance book fixes in fixed asset register (backport #35751) (#35800)
* fix: date and finance book fixes in fixed asset register (#35751)

* fix: handle finance books properly and show all assets by default in fixed asset register

* chore: rename value to depr amount

* chore: get asset value for correct fb properly

* chore: rename include_default_book_entries to include_default_book_assets

(cherry picked from commit 0d12588583)

# Conflicts:
#	erpnext/assets/report/fixed_asset_register/fixed_asset_register.py

* chore: resolving conflicts and renaming entries to assets

* chore: formatting

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-06-20 13:03:06 +05:30
mergify[bot]
7239e839a0 perf: index purpose in Stock Entry (backport #35782) (#35784)
* perf: index `purpose` in `Stock Entry`

(cherry picked from commit 4f941ac5c0)

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

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-06-20 12:02:04 +05:30
mergify[bot]
04990d51db fix: fix get outstanding invoices btn and add get outstanding orders btn (backport #35776) (#35788)
* fix: fix get outstanding invoices btn and add get outstanding orders btn (#35776)

* fix: fix get outstanding invoices btn and add get outstanding orders btn

* chore: remove unnecessary arg

(cherry picked from commit c1da3ddbbf)

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

* chore: resolving conflicts

* chore: resolving conflicts properly

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-06-19 20:42:28 +05:30
Frappe PR Bot
0ec74b059e chore(release): Bumped to Version 13.51.5
## [13.51.5](https://github.com/frappe/erpnext/compare/v13.51.4...v13.51.5) (2023-06-19)

### Bug Fixes

* Allocated amount validation for other party types ([#35741](https://github.com/frappe/erpnext/issues/35741)) ([75b3423](75b3423ab1))
2023-06-19 11:38:29 +00:00
Deepesh Garg
2a6e80214c Merge pull request #35775 from frappe/mergify/bp/version-13/pr-35771
fix: Allocated amount validation for other party types (#35741)
2023-06-19 17:06:48 +05:30
ruthra kumar
af10d8080b Merge pull request #35780 from frappe/mergify/bp/version-13-hotfix/pr-35320
fix: Gross and Net Profit Report - incorrect calculation of totals (backport #35320)
2023-06-19 16:48:17 +05:30
Anoop Kurungadam
e899c30428 fix: add total col for gross and net profit
(cherry picked from commit cb9b4fbb91)
2023-06-19 10:26:00 +00:00
Anoop Kurungadam
a53832e16e refactor: merge separate loops for calculating group / leaf node totals
rename function
remove return statement as the list is  mutated

(cherry picked from commit 1a3b9c5bdf)
2023-06-19 10:26:00 +00:00
Anoop Kurungadam
c6885e6789 refactor: remove unused parameters
(cherry picked from commit 50822f207e)
2023-06-19 10:26:00 +00:00
Anoop Kurungadam
f22969d266 fix: account group totals calculation to consider include_in_gross
(cherry picked from commit 8dcb9302b4)
2023-06-19 10:26:00 +00:00
mergify[bot]
75b3423ab1 fix: Allocated amount validation for other party types (#35741)
* fix: Allocated amount validation for other party types (#35741)

* fix: Allocated amount validation for other party types

* chore: Validation for return allocations

* chore: minor typo

---------

Co-authored-by: anandbaburajan <anandbaburajan@gmail.com>
(cherry picked from commit 9d27a25e5f)

* chore: remove unnecessary donor party type check

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
(cherry picked from commit 3d0add81fa)
2023-06-19 07:23:46 +00:00
mergify[bot]
3d0add81fa fix: Allocated amount validation for other party types (#35741)
* fix: Allocated amount validation for other party types (#35741)

* fix: Allocated amount validation for other party types

* chore: Validation for return allocations

* chore: minor typo

---------

Co-authored-by: anandbaburajan <anandbaburajan@gmail.com>
(cherry picked from commit 9d27a25e5f)

* chore: remove unnecessary donor party type check

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-06-19 12:53:00 +05:30
mergify[bot]
46d0b7d317 fix: loan interest accrual date (#35695)
fix: loan interest accrual date (#35695)

fix: loan interest accrual date

---------

Co-authored-by: Abhinav Raut <abhinav.raut@zerodha.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 2a24423ad2)

Co-authored-by: Abhinav Raut <abhinavrautcs@gmail.com>
2023-06-19 09:14:01 +05:30
mergify[bot]
0a8b7148a5 fix: add validation for QI in PR (backport #35677) (#35758)
fix: add validation for QI in PR

(cherry picked from commit 2c1ab569a7)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-06-17 13:08:06 +05:30
Frappe PR Bot
6400a574b6 chore(release): Bumped to Version 13.51.4
## [13.51.4](https://github.com/frappe/erpnext/compare/v13.51.3...v13.51.4) (2023-06-16)

### Bug Fixes

* Incorrect field while calculating Tax withholding net total ([a98a13b](a98a13b683))
2023-06-16 06:54:26 +00:00
Deepesh Garg
eaa1589331 Merge pull request #35734 from frappe/mergify/bp/version-13/pr-35733
fix: Incorrect field while calculating Tax withholding net total (backport #35733)
2023-06-16 12:22:48 +05:30
Deepesh Garg
d49a8ad74f chore: resolve conflicts 2023-06-16 12:22:23 +05:30
Deepesh Garg
a98a13b683 fix: Incorrect field while calculating Tax withholding net total
(cherry picked from commit 571c977e8e)

# Conflicts:
#	erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py
2023-06-16 06:51:29 +00:00
Deepesh Garg
e37b6bbbf1 Merge pull request #35733 from deepeshgarg007/tax_withholding_limit_consumed
fix: Incorrect field while calculating Tax withholding net total
2023-06-16 12:20:44 +05:30
Deepesh Garg
bcc8a45c4e Merge branch 'version-13-hotfix' into tax_withholding_limit_consumed 2023-06-16 12:18:57 +05:30
Deepesh Garg
571c977e8e fix: Incorrect field while calculating Tax withholding net total 2023-06-16 12:17:31 +05:30
Frappe PR Bot
ac9f1fefe6 chore(release): Bumped to Version 13.51.3
## [13.51.3](https://github.com/frappe/erpnext/compare/v13.51.2...v13.51.3) (2023-06-16)

### Bug Fixes

* Incorrect field while calculating Tax withholding net total ([f8a8cf3](f8a8cf3046))
2023-06-16 05:51:43 +00:00
Deepesh Garg
513da54b6d Merge pull request #35731 from frappe/mergify/bp/version-13/pr-35730
fix: Incorrect field while calculating Tax withholding net total (#35730)
2023-06-16 11:20:00 +05:30
Deepesh Garg
f8a8cf3046 fix: Incorrect field while calculating Tax withholding net total
(cherry picked from commit b95d459812)
2023-06-16 05:49:03 +00:00
Deepesh Garg
1685305b53 Merge pull request #35730 from deepeshgarg007/tax_ithholding_v13
fix: Incorrect field while calculating Tax withholding net total
2023-06-16 11:18:22 +05:30
Deepesh Garg
b95d459812 fix: Incorrect field while calculating Tax withholding net total 2023-06-16 11:15:42 +05:30
mergify[bot]
0e11317303 fix: don't add GL Entry for Acc. Depr. while scrapping non-depreciable assets (backport #35714) (#35716)
* fix: don't add GL Entry for Acc. Depr. while scrapping non-depreciable assets (#35714)

fix: on asset scrap, don't add gl entry for acc. depr. if no acc. depr.
(cherry picked from commit bb39a2cac7)

# Conflicts:
#	erpnext/assets/doctype/asset/depreciation.py

* chore: fix conflict

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-06-15 17:40:42 +05:30
Frappe PR Bot
9a659254e3 chore(release): Bumped to Version 13.51.2
## [13.51.2](https://github.com/frappe/erpnext/compare/v13.51.1...v13.51.2) (2023-06-14)

### Bug Fixes

* **accounts:** validate payment entry references with latest data. (backport [#31166](https://github.com/frappe/erpnext/issues/31166)) ([#35674](https://github.com/frappe/erpnext/issues/35674)) ([4d4f218](4d4f218175))
* Asset Depreciation Ledger Report - Add Total Row Checkbox Enabled ([3831c79](3831c7920d))
* calculate wdv depr schedule properly for existing assets [v13] ([#35615](https://github.com/frappe/erpnext/issues/35615)) ([97f4af8](97f4af8d97))
* CSS not applied to product title (backport [#35582](https://github.com/frappe/erpnext/issues/35582)) ([#35635](https://github.com/frappe/erpnext/issues/35635)) ([1b69b37](1b69b37229))
* don't set default payment amount in case of invoice return (backport [#35645](https://github.com/frappe/erpnext/issues/35645)) ([#35648](https://github.com/frappe/erpnext/issues/35648)) ([8e3636f](8e3636ff53))
* Lower deduction certificate not getting applied ([#35667](https://github.com/frappe/erpnext/issues/35667)) ([c2bf8e3](c2bf8e3502))
* make showing taxes as table in print configurable ([#35672](https://github.com/frappe/erpnext/issues/35672)) ([4c2c037](4c2c037a86))
* Project in item-wise sales register ([#35596](https://github.com/frappe/erpnext/issues/35596)) ([9d5b500](9d5b500060))
* savepoint policy assignment submission, log errors & inform the user about failures ([#35507](https://github.com/frappe/erpnext/issues/35507)) ([4a35ff0](4a35ff0e57))

### Performance Improvements

* refactor `get_all_nodes` in Org Chart ([986a90e](986a90efe0))
2023-06-14 06:09:31 +00:00
Deepesh Garg
e75ca14a88 Merge pull request #35665 from frappe/version-13-hotfix
chore: release v13
2023-06-14 11:37:59 +05:30
mergify[bot]
c2bf8e3502 fix: Lower deduction certificate not getting applied (#35667)
* fix: Lower deduction certificate not getting applied (#35667)

(cherry picked from commit 937c0feefe)

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

* chore: Resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-06-14 09:01:54 +05:30
mergify[bot]
4d4f218175 fix(accounts): validate payment entry references with latest data. (backport #31166) (#35674)
* fix(accounts): validate payment entry references with latest data. (#31166)

* test: payment entry over allocation.

* fix: validate allocated_amount against latest outstanding amount.

* fix: payment entry get outstanding documents for advance payments

* fix: only fetch latest outstanding_amount.

* fix: throw if reference is allocated

* test: throw error if a reference has been partially allocated after inital creation.

* chore: test name

* fix: remove unused part of test

* chore: linter

* chore: more user friendly error messages

* fix: only validate outstanding amount if partly paid and don't filter by cost center

* chore: minor refactor for doc.cost_center

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 20de27d480)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/test_payment_entry.py

* chore: resolve conflicts

* chore: resolve more conflicts

* chore: don't validate allocated amount in case of donation

---------

Co-authored-by: Devin Slauenwhite <devin.slauenwhite@gmail.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-06-13 23:01:51 +05:30
mergify[bot]
4c2c037a86 fix: make showing taxes as table in print configurable (#35672)
* fix: make showing taxes as table in print configurable (#35672)

(cherry picked from commit 491a50a027)

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

* chore: fixing conflicts

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-06-13 21:38:16 +05:30
mergify[bot]
4f79214ae6 Stock aging report fix when called in dashboard chart (backport #35671) (#35676)
fix: get_range_age conditions fixed (#35671)

see https://github.com/frappe/erpnext/issues/35669

(cherry picked from commit 9f669d4c2f)

Co-authored-by: Hossein Yousefian <86075967+ihosseinu@users.noreply.github.com>
2023-06-13 19:24:21 +05:30
Rucha Mahabal
5b37abd2d6 Merge pull request #35663 from ruchamahabal/perf-org-charts-v13 2023-06-13 13:20:09 +05:30
Rucha Mahabal
a24d488817 test: get children for org chart 2023-06-13 12:29:53 +05:30
Rucha Mahabal
986a90efe0 perf: refactor get_all_nodes in Org Chart 2023-06-13 12:07:15 +05:30
Rucha Mahabal
4a35ff0e57 fix: savepoint policy assignment submission, log errors & inform the user about failures (#35507) 2023-06-13 12:03:55 +05:30
mergify[bot]
8e3636ff53 fix: don't set default payment amount in case of invoice return (backport #35645) (#35648)
* fix: don't set default payment amount in case of invoice return (#35645)

(cherry picked from commit 79483cc90e)

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

* chore: fixing conflict

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-06-12 18:44:56 +05:30
Trusted Computer
1b69b37229 fix: CSS not applied to product title (backport #35582) (#35635)
In an erpnext website, the /all-products route shows website items that have been published to the web site.

In the list view (erpnext/e_commerce/product_ui/list.js), the css class is null for the product title. Instead, inline style statements have been added in that can not be modified by overriding CSS.

This fix uses a similar approach to that which is taken in the grid view (erpnext/e_commerce/product_ui/grid.js). It removes the null CSS parameter in the product title link as well as the inline style statement. Then, as in the grid view, the product title is wrapped in a div tag with the product_title CSS class.

This makes it possible to style the product title as desired with a CSS override.
2023-06-12 14:39:41 +05:30
Anand Baburajan
97f4af8d97 fix: calculate wdv depr schedule properly for existing assets [v13] (#35615)
* fix: calculate wdv depr schedule properly for existing assets

* fix: calculate wdv depr schedule properly for existing assets properly
2023-06-08 23:16:35 +05:30
mergify[bot]
9d5b500060 fix: Project in item-wise sales register (#35596)
fix: Project in item-wise sales register (#35596)

(cherry picked from commit f732cac678)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-06-07 22:36:49 +05:30
AJAY NATARAJAN
3831c7920d fix: Asset Depreciation Ledger Report - Add Total Row Checkbox Enabled 2023-06-07 21:48:27 +05:30
Frappe PR Bot
f182fc1f8e chore(release): Bumped to Version 13.51.1
## [13.51.1](https://github.com/frappe/erpnext/compare/v13.51.0...v13.51.1) (2023-06-07)

### Bug Fixes

* Interest Accrual on Loan Topup ([#35555](https://github.com/frappe/erpnext/issues/35555)) ([1415f40](1415f40dfb))
* Task gantt popup style ([5544801](55448017d7))
2023-06-07 06:18:08 +00:00
Deepesh Garg
1897d6f214 Merge pull request #35570 from frappe/version-13-hotfix
chore: release v13
2023-06-07 11:46:43 +05:30
mergify[bot]
1415f40dfb fix: Interest Accrual on Loan Topup (#35555)
fix: Interest Accrual on Loan Topup (#35555)

* fix: Interest Accrual on Loan Topup

* chore: CI

* chore: Ignore test

(cherry picked from commit 2ffcca6f10)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-06-07 10:11:54 +05:30
Suraj Shetty
09cf050b0d Merge pull request #35532 from frappe/mergify/bp/version-13-hotfix/pr-35530
fix: Task gantt popup style and info (backport #35530)
2023-06-02 11:11:35 +05:30
Suraj Shetty
55448017d7 fix: Task gantt popup style
(cherry picked from commit f7b2d103e7)
2023-06-02 05:39:53 +00:00
ruthra kumar
202513ae6a Merge pull request #35520 from frappe/mergify/bp/version-13-hotfix/pr-35112
refactor(Gross Profit): simplify group by invoice logic (backport #35112)
2023-06-01 15:13:02 +05:30
ruthra kumar
e3a8a8d195 refactor: simplify group by invoice logic
(cherry picked from commit 092c4b4c58)
2023-06-01 09:05:35 +00:00
Sagar Vora
169af8f9f8 Merge pull request #35502 from frappe/mergify/bp/version-13-hotfix/pr-35500 2023-05-31 14:46:24 +05:30
Sagar Vora
f0580b0e4d chore: remove whitelisting for method not accessed from UI
(cherry picked from commit 517d8a03ec)
2023-05-31 09:15:46 +00:00
Frappe PR Bot
b5b34c14b2 chore(release): Bumped to Version 13.51.0
# [13.51.0](https://github.com/frappe/erpnext/compare/v13.50.6...v13.51.0) (2023-05-31)

### Bug Fixes

* force to do reposting for cancelled document ([0228933](022893391b))
* **Gross Profit:** 'company' column is ambiguous in filter ([270eb1d](270eb1db4d))
* incorrect `POS Reserved Qty` in `Stock Projected Qty` Report ([#35437](https://github.com/frappe/erpnext/issues/35437)) ([139a193](139a193f1d))
* incorrect depr schedule and posting dates on selling of existing assets [v13] ([#35404](https://github.com/frappe/erpnext/issues/35404)) ([20d3381](20d3381010))
* monthly WDV depr schedule for existing assets [v13] ([#35461](https://github.com/frappe/erpnext/issues/35461)) ([6f43829](6f43829c32))
* retention stock entry: grab conversion factor from source ([d8dd22a](d8dd22adaf))

### Features

* Allow ceil & floor functions in salary slip formulae ([#35475](https://github.com/frappe/erpnext/issues/35475)) ([63fba9d](63fba9db39))
2023-05-31 05:49:42 +00:00
Deepesh Garg
839a1f0454 Merge pull request #35474 from frappe/version-13-hotfix
chore: release v13
2023-05-31 11:14:32 +05:30
Rucha Mahabal
63fba9db39 feat: Allow ceil & floor functions in salary slip formulae (#35475) 2023-05-30 16:11:44 +05:30
Sagar Sharma
00fd08c7bc Merge pull request #35468 from frappe/mergify/bp/version-13-hotfix/pr-35459
fix: retention stock entry: grab conversion factor from source (backport #35459)
2023-05-30 11:30:41 +05:30
Marc de Lima Lucio
d8dd22adaf fix: retention stock entry: grab conversion factor from source
(cherry picked from commit 6954f538c9)
2023-05-30 05:36:33 +00:00
Anand Baburajan
6f43829c32 fix: monthly WDV depr schedule for existing assets [v13] (#35461)
fix: monthly wdv depr schedule for existing assets
2023-05-29 23:18:04 +05:30
Sagar Sharma
3e95d56240 Merge pull request #35456 from frappe/mergify/bp/version-13-hotfix/pr-35328
fix: force to do reposting for cancelled document (backport #35328)
2023-05-29 15:56:54 +05:30
s-aga-r
44cb62824d chore: conflicts 2023-05-29 15:22:22 +05:30
Rohit Waghchaure
022893391b fix: force to do reposting for cancelled document
(cherry picked from commit 6e661e7c0e)

# Conflicts:
#	erpnext/controllers/stock_controller.py
2023-05-29 09:38:35 +00:00
mergify[bot]
139a193f1d fix: incorrect POS Reserved Qty in Stock Projected Qty Report (#35437)
* fix: incorrect `POS Reserved Qty` in `Stock Projected Qty` Report

(cherry picked from commit 027de41600)

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

* chore: `conflicts`

---------

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2023-05-29 09:24:20 +05:30
ruthra kumar
4f5ee6876d Merge pull request #35420 from frappe/mergify/bp/version-13-hotfix/pr-35417
fix(Gross Profit): 'company' column is ambiguous in filter (backport #35417)
2023-05-25 16:44:56 +05:30
ruthra kumar
270eb1db4d fix(Gross Profit): 'company' column is ambiguous in filter
(cherry picked from commit 448712f719)
2023-05-25 09:37:39 +00:00
Anand Baburajan
20d3381010 fix: incorrect depr schedule and posting dates on selling of existing assets [v13] (#35404)
fix: calc depr amount properly on selling of existing assets and fix incorrect posting dates
2023-05-24 14:24:18 +05:30
Frappe PR Bot
fd04bd0f72 chore(release): Bumped to Version 13.50.6
## [13.50.6](https://github.com/frappe/erpnext/compare/v13.50.5...v13.50.6) (2023-05-24)

### Bug Fixes

* allow over-payment against SO ([#35079](https://github.com/frappe/erpnext/issues/35079)) ([eb243c2](eb243c2470))
* bypass flag in Customer Group wasn't effective ([f0c9d89](f0c9d89aab))
* change field-type to remove currency field from total row in export ([f65be40](f65be40037))
* consider 0 if rate/qty are null (backport [#35338](https://github.com/frappe/erpnext/issues/35338)) ([#35341](https://github.com/frappe/erpnext/issues/35341)) ([387f8b9](387f8b9e1a))
* depreciation schedule for existing assets [v14] (backport [#35255](https://github.com/frappe/erpnext/issues/35255)) ([#35347](https://github.com/frappe/erpnext/issues/35347)) ([7506132](7506132861))
* error while saving job card ([d6427cf](d6427cfe53))
* get_query filters ([2aa7729](2aa7729243))
* Incorrect Earned Leaves Proration ([#35156](https://github.com/frappe/erpnext/issues/35156)) ([dc04b24](dc04b24234))
* linter ([0a42e6f](0a42e6ff0f))
* non manufacturing items/fixed asset items in BOM ([66ba74f](66ba74f3fc))
* Pick List TypeError ([137898d](137898d55d))
* tds incorrectly calculated for invoice that are below threshold ([6c170ab](6c170abdf9))
* **test:** cumulative threshold checks ([06deecb](06deecbd92))
* use flt instead of mandatory field ([f63b866](f63b866de3))
2023-05-24 03:03:13 +00:00
Deepesh Garg
166ec0e58c Merge pull request #35393 from frappe/version-13-hotfix
chore: release v13
2023-05-24 08:31:15 +05:30
Saurabh
1e1dddfe6c Merge pull request #35387 from saurabh6790/minor-fix
fix: change field-type to remove currency field from total row in export
2023-05-23 18:53:45 +05:30
Saurabh
0a42e6ff0f fix: linter 2023-05-23 15:36:23 +05:30
Sagar Sharma
97f9c0d53f Merge pull request #35391 from frappe/mergify/bp/version-13-hotfix/pr-35303
fix: Pick List TypeError (backport #35303)
2023-05-23 15:05:41 +05:30
Sagar Sharma
137898d55d fix: Pick List TypeError
(cherry picked from commit a111917114)
2023-05-23 08:51:32 +00:00
Saurabh
f65be40037 fix: change field-type to remove currency field from total row in export 2023-05-23 12:39:20 +05:30
Sagar Sharma
75f4a616f1 Merge pull request #35384 from frappe/mergify/bp/version-13-hotfix/pr-35380
fix: TypeError while saving Job card (backport #35380)
2023-05-23 10:59:15 +05:30
Sagar Sharma
8d97f8b0b7 chore: conflicts 2023-05-23 10:54:27 +05:30
vishnu
f63b866de3 fix: use flt instead of mandatory field
(cherry picked from commit 8c34cc0e00)

# Conflicts:
#	erpnext/manufacturing/doctype/job_card/job_card.json
2023-05-23 05:20:21 +00:00
vishnu
d6427cfe53 fix: error while saving job card
(cherry picked from commit a209fb4b64)

# Conflicts:
#	erpnext/manufacturing/doctype/job_card/job_card.json
2023-05-23 05:20:21 +00:00
rohitwaghchaure
774092343a Merge pull request #35374 from frappe/mergify/bp/version-13-hotfix/pr-35227
fix: non manufacturing items/fixed asset items in BOM (backport #35227)
2023-05-22 13:48:10 +05:30
rohitwaghchaure
2aa7729243 fix: get_query filters 2023-05-22 13:16:06 +05:30
Rohit Waghchaure
66ba74f3fc fix: non manufacturing items/fixed asset items in BOM
(cherry picked from commit aba8431d70)
2023-05-22 07:43:34 +00:00
JunKangChin
dc04b24234 fix: Incorrect Earned Leaves Proration (#35156) 2023-05-21 21:36:10 +05:30
mergify[bot]
eb243c2470 fix: allow over-payment against SO (#35079)
fix: allow over-payment against SO (#35079)

(cherry picked from commit 870b02b03c)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-05-20 21:03:59 +05:30
ruthra kumar
f7ed4ecd56 Merge pull request #35299 from ruthra-kumar/replace_join_with_subquery
refactor: replace join with subquery in PCV
2023-05-19 11:00:42 +05:30
Frappe PR Bot
6bc8749eaf chore(release): Bumped to Version 13.50.5
## [13.50.5](https://github.com/frappe/erpnext/compare/v13.50.4...v13.50.5) (2023-05-18)

### Bug Fixes

* tds incorrectly calculated for invoice that are below threshold ([2e3f8e8](2e3f8e8846))
* **test:** cumulative threshold checks ([d316955](d316955d18))
2023-05-18 14:55:22 +00:00
ruthra kumar
2747df78ac Merge pull request #35360 from frappe/mergify/bp/version-13/pr-35335
fix: tds incorrectly calculated for invoice that are below threshold (backport #35335)
2023-05-18 20:23:24 +05:30
ruthra kumar
d316955d18 fix(test): cumulative threshold checks
(cherry picked from commit 132846bbd1)
2023-05-18 14:29:45 +00:00
ruthra kumar
2e3f8e8846 fix: tds incorrectly calculated for invoice that are below threshold
Two purchase invoices for the same supplier, using different tax
withholding categories have this issue.

| Category | single | cumulative |
|----------+--------+------------|
| cat1     |    100 |        500 |
| cat2     |   1000 |       5000 |

1. PINV1 of net total: 105/- uses cat1. TDS is calculated as it
breached single threshold
2. PINV2 of net total: 200/- uses cat2. TDS incorrectly calculated as
PINV1 already has TDS calculated and 'consider_party_ledger_amount' is enabled.

(cherry picked from commit 84b7c1bba0)
2023-05-18 14:29:45 +00:00
ruthra kumar
9af4e117d4 Merge pull request #35354 from frappe/mergify/bp/version-13-hotfix/pr-35335
fix: tds incorrectly calculated for invoice that are below threshold (backport #35335)
2023-05-18 14:36:28 +05:30
ruthra kumar
6191cfee4c Merge pull request #35356 from frappe/mergify/bp/version-13-hotfix/pr-35142
fix: ineffective bypass flag for Credit Limit in Customer Group (backport #35142)
2023-05-18 13:31:14 +05:30
ruthra kumar
f0c9d89aab fix: bypass flag in Customer Group wasn't effective
(cherry picked from commit f9a4972cb6)
2023-05-18 07:32:36 +00:00
ruthra kumar
06deecbd92 fix(test): cumulative threshold checks
(cherry picked from commit 132846bbd1)
2023-05-18 07:09:19 +00:00
ruthra kumar
6c170abdf9 fix: tds incorrectly calculated for invoice that are below threshold
Two purchase invoices for the same supplier, using different tax
withholding categories have this issue.

| Category | single | cumulative |
|----------+--------+------------|
| cat1     |    100 |        500 |
| cat2     |   1000 |       5000 |

1. PINV1 of net total: 105/- uses cat1. TDS is calculated as it
breached single threshold
2. PINV2 of net total: 200/- uses cat2. TDS incorrectly calculated as
PINV1 already has TDS calculated and 'consider_party_ledger_amount' is enabled.

(cherry picked from commit 84b7c1bba0)
2023-05-18 07:09:19 +00:00
mergify[bot]
7506132861 fix: depreciation schedule for existing assets [v14] (backport #35255) (#35347)
* fix: depreciation schedule for existing assets [v14] (#35255)

* fix: depreciation schedule for existing assets

* chore: correct logic for existing assets and fix test

(cherry picked from commit 0a080efce2)

# Conflicts:
#	erpnext/assets/doctype/asset/asset.py

* chore: fix conflict

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-05-17 22:52:13 +05:30
mergify[bot]
387f8b9e1a fix: consider 0 if rate/qty are null (backport #35338) (#35341)
fix: consider 0 if rate/qty are null (#35338)

[skip ci]

(cherry picked from commit e5c86bc2e8)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-05-17 16:17:25 +05:30
Frappe PR Bot
c2ae8eaec0 chore(release): Bumped to Version 13.50.4
## [13.50.4](https://github.com/frappe/erpnext/compare/v13.50.3...v13.50.4) (2023-05-16)

### Bug Fixes

* add missing options for `Content Align` ([e37b903](e37b9030fb))
* cancelled vouchers in tax withheld vouchers list ([#35309](https://github.com/frappe/erpnext/issues/35309)) ([188cfc2](188cfc2e3c))
* internal transfer condition ([a1d7170](a1d717053a))
* **Salary Slip:** exchange rate overwritten on form load ([#507](https://github.com/frappe/erpnext/issues/507)) ([#35245](https://github.com/frappe/erpnext/issues/35245)) ([8b3d6ee](8b3d6ee7b0))
* update reference data for statistical component ([77f548c](77f548c814))
2023-05-16 16:59:38 +00:00
Deepesh Garg
f5f88bb62c Merge pull request #35323 from frappe/version-13-hotfix
chore: release v13
2023-05-16 22:28:02 +05:30
mergify[bot]
188cfc2e3c fix: cancelled vouchers in tax withheld vouchers list (#35309)
fix: cancelled vouchers in tax withheld vouchers list (#35309)

(cherry picked from commit 776a83066d)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-05-16 18:58:23 +05:30
Saurabh
c7c2bad6ab Merge pull request #35267 from saurabh6790/fix-statistical-component-calculation
fix: update reference data for statistical component
2023-05-15 11:09:50 +05:30
ruthra kumar
e6a9252f79 refactor: replace join with sub-query for fetching accounts 2023-05-14 16:54:56 +05:30
Sagar Sharma
4a9ad09c7f Merge pull request #35284 from frappe/mergify/bp/version-13-hotfix/pr-35275
fix: add missing options for `Content Align` (backport #35275)
2023-05-13 09:41:55 +05:30
Sagar Sharma
e37b9030fb fix: add missing options for Content Align
(cherry picked from commit d16caa2d2c)
2023-05-13 04:05:15 +00:00
Saurabh
77f548c814 fix: update reference data for statistical component 2023-05-12 12:10:40 +05:30
Frappe PR Bot
7626d51db1 chore(release): Bumped to Version 13.50.3
## [13.50.3](https://github.com/frappe/erpnext/compare/v13.50.2...v13.50.3) (2023-05-11)

### Bug Fixes

* internal transfer condition ([ac26e4b](ac26e4ba2a))
2023-05-11 17:26:55 +00:00
rohitwaghchaure
48e5846ed5 Merge pull request #35260 from frappe/mergify/bp/version-13/pr-35259
fix: internal transfer condition (backport #35158) (backport #35259)
2023-05-11 22:54:34 +05:30
Rohit Waghchaure
ac26e4ba2a fix: internal transfer condition
(cherry picked from commit b5a2ccf21d)
(cherry picked from commit a1d717053a)
2023-05-11 15:08:08 +00:00
rohitwaghchaure
8b9f8c6ab7 Merge pull request #35259 from frappe/mergify/bp/version-13-hotfix/pr-35158
fix: internal transfer condition (backport #35158)
2023-05-11 20:36:41 +05:30
Rohit Waghchaure
a1d717053a fix: internal transfer condition
(cherry picked from commit b5a2ccf21d)
2023-05-11 14:38:38 +00:00
Rucha Mahabal
8b3d6ee7b0 fix(Salary Slip): exchange rate overwritten on form load (#507) (#35245) 2023-05-10 16:16:50 +05:30
Frappe PR Bot
1380f7a7ec chore(release): Bumped to Version 13.50.2
## [13.50.2](https://github.com/frappe/erpnext/compare/v13.50.1...v13.50.2) (2023-05-10)

### Bug Fixes

* handle empty FBs properly in TB and GL [v14] (backport [#35189](https://github.com/frappe/erpnext/issues/35189)) ([#35192](https://github.com/frappe/erpnext/issues/35192)) ([e2af66c](e2af66c7be))
2023-05-10 05:40:17 +00:00
Deepesh Garg
2825253339 Merge pull request #35223 from frappe/version-13-hotfix
chore: release v13
2023-05-10 11:08:54 +05:30
Frappe PR Bot
40cfd5215c chore(release): Bumped to Version 13.50.1
## [13.50.1](https://github.com/frappe/erpnext/compare/v13.50.0...v13.50.1) (2023-05-06)

### Bug Fixes

* handle empty FBs properly in TB and GL [v14] (backport [#35189](https://github.com/frappe/erpnext/issues/35189)) (backport [#35192](https://github.com/frappe/erpnext/issues/35192)) ([#35195](https://github.com/frappe/erpnext/issues/35195)) ([af8142c](af8142cf85))
2023-05-06 18:13:48 +00:00
mergify[bot]
af8142cf85 fix: handle empty FBs properly in TB and GL [v14] (backport #35189) (backport #35192) (#35195)
fix: handle empty FBs properly in TB and GL [v14] (backport #35189) (#35192)

fix: handle empty FBs properly in TB and GL [v14] (#35189)

fix: handle empty FBs properly in TB and GL
(cherry picked from commit ed5f39c2c2)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
(cherry picked from commit e2af66c7be)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-05-06 23:41:57 +05:30
mergify[bot]
e2af66c7be fix: handle empty FBs properly in TB and GL [v14] (backport #35189) (#35192)
fix: handle empty FBs properly in TB and GL [v14] (#35189)

fix: handle empty FBs properly in TB and GL
(cherry picked from commit ed5f39c2c2)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-05-06 17:44:49 +05:30
Frappe PR Bot
ef2d4febdd chore(release): Bumped to Version 13.50.0
# [13.50.0](https://github.com/frappe/erpnext/compare/v13.49.14...v13.50.0) (2023-05-03)

### Bug Fixes

* allow user to set standard deductions in income tax slab without allowing other exemptions ([c5261cd](c5261cde9c))
* check for session user rather than owner ([7d6e2f9](7d6e2f979f))
* conflicts ([778ba69](778ba6956c))
* conflicts ([b19b0a4](b19b0a4a98))
* conflicts ([6bdf143](6bdf143084))
* don't allow to make reposting for the closed period ([b31d8ee](b31d8eec05))
* handle expected_value_after_useful_life properly in asset value adjustment (backport [#35117](https://github.com/frappe/erpnext/issues/35117)) ([#35120](https://github.com/frappe/erpnext/issues/35120)) ([635559d](635559d905))
* handle finance book properly in trial balance and general ledger ([#35136](https://github.com/frappe/erpnext/issues/35136)) ([9a37603](9a376039aa))
* Hyperlink in Quality Inspection Summary ([54388e8](54388e8d92))
* Naming series error in Journal Entry template ([#35084](https://github.com/frappe/erpnext/issues/35084)) ([d3c769c](d3c769c183))
* per_billed condition for Payment Entry ([#34969](https://github.com/frappe/erpnext/issues/34969)) ([563e5c0](563e5c0b69))
* test case ([db6d0e0](db6d0e03f5))

### Features

* validate repost item valuation against accounts freeze date ([a852dc1](a852dc1f11))
2023-05-03 06:38:15 +00:00
Deepesh Garg
cb0d567d7b Merge pull request #35130 from frappe/version-13-hotfix
chore: release v13
2023-05-03 12:06:38 +05:30
mergify[bot]
9a376039aa fix: handle finance book properly in trial balance and general ledger (#35136)
fix: handle finance book properly in trial balance and general ledger [v14] (#35136)

fix: handle FBs properly in general ledger and trial balance
(cherry picked from commit 344c339484)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-05-03 08:25:01 +05:30
Saurabh
2f74026513 Merge pull request #35114 from saurabh6790/consider-standard-exemption
fix: allow user to set standard deductions in income tax slab without allowing other exemptions
2023-05-02 11:38:30 +05:30
rohitwaghchaure
740313ff09 Merge pull request #35122 from frappe/mergify/bp/version-13-hotfix/pr-35118
fix: don't allow to make reposting for the closed period (backport #35118)
2023-05-02 00:00:58 +05:30
rohitwaghchaure
db6d0e03f5 fix: test case 2023-05-01 23:34:31 +05:30
rohitwaghchaure
778ba6956c fix: conflicts 2023-05-01 20:55:52 +05:30
rohitwaghchaure
b19b0a4a98 fix: conflicts 2023-05-01 20:54:32 +05:30
Rohit Waghchaure
b31d8eec05 fix: don't allow to make reposting for the closed period
(cherry picked from commit f751727149)

# Conflicts:
#	erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py
#	erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py
2023-05-01 15:12:01 +00:00
rohitwaghchaure
078161cf6b Merge pull request #35116 from frappe/mergify/bp/version-13-hotfix/pr-33013
fix: validate repost item valuation against accounts freeze date (backport #33013)
2023-05-01 20:41:00 +05:30
mergify[bot]
635559d905 fix: handle expected_value_after_useful_life properly in asset value adjustment (backport #35117) (#35120)
fix: handle expected_value_after_useful_life properly in asset value adjustment (#35117)

(cherry picked from commit 80230fec3e)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-05-01 20:00:04 +05:30
rohitwaghchaure
6bdf143084 fix: conflicts 2023-05-01 18:26:51 +05:30
Dany Robert
198a64d574 chore: pre-commit
(cherry picked from commit 88a0aa4077)
2023-05-01 11:50:17 +00:00
Dany Robert
7d6e2f979f fix: check for session user rather than owner
(cherry picked from commit b482e3876d)
2023-05-01 11:50:17 +00:00
Dany Robert
6992e727cf chore: pre-commit
(cherry picked from commit be15419bd5)

# Conflicts:
#	erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py
2023-05-01 11:50:16 +00:00
Dany Robert
a852dc1f11 feat: validate repost item valuation against accounts freeze date
(cherry picked from commit 61f05132db)

# Conflicts:
#	erpnext/stock/doctype/repost_item_valuation/test_repost_item_valuation.py
2023-05-01 11:50:16 +00:00
Saurabh
c5261cde9c fix: allow user to set standard deductions in income tax slab without allowing other exemptions 2023-05-01 13:33:26 +05:30
mergify[bot]
d3c769c183 fix: Naming series error in Journal Entry template (#35084)
fix: Naming series error in Journal Entry template (#35084)

(cherry picked from commit f3b3dabb9a)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-05-01 13:02:28 +05:30
mergify[bot]
563e5c0b69 fix: per_billed condition for Payment Entry (#34969)
fix: per_billed condition for Payment Entry (#34969)

fix: per_billed condition for Payment Entry (#34969)

(cherry picked from commit d6bc8bba8b)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
(cherry picked from commit f9f42c7e98)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-05-01 10:51:23 +05:30
Sagar Sharma
5746ddce84 Merge pull request #35089 from frappe/mergify/bp/version-13-hotfix/pr-35081
fix: Hyperlink in Quality Inspection Summary (backport #35081)
2023-04-28 12:53:51 +05:30
Nihantra Patel
54388e8d92 fix: Hyperlink in Quality Inspection Summary
(cherry picked from commit 72dd7884a8)
2023-04-28 07:19:14 +00:00
Deepesh Garg
784ea7cf48 Merge pull request #35073 from frappe/mergify/bp/version-13/pr-35032
chore: set correct currency symbol in salary register for multi-currency salary slip (backport #35032)
2023-04-27 13:29:08 +05:30
Saurabh
fc42e026ab chore: fix linter
(cherry picked from commit 31bda37970)
2023-04-27 06:10:17 +00:00
Saurabh
cef7126a35 chore: set correct currency symbol in salary register for multi-currency salary slip
(cherry picked from commit 83afaf48df)
2023-04-27 06:10:17 +00:00
Saurabh
297facc1cb Merge pull request #35032 from saurabh6790/salary-register-report-fix
chore: set correct currency symbol in salary register for multi-currency salary slip
2023-04-26 16:36:15 +05:30
Saurabh
31bda37970 chore: fix linter 2023-04-26 15:44:34 +05:30
Frappe PR Bot
1d6917f340 chore(release): Bumped to Version 13.49.14
## [13.49.14](https://github.com/frappe/erpnext/compare/v13.49.13...v13.49.14) (2023-04-25)

### Bug Fixes

* `PermissionError` in Work Order ([5680045](5680045f2b))
* Advance payment against payment terms ([#34872](https://github.com/frappe/erpnext/issues/34872)) ([d215a85](d215a85747))
* internal Purchase Receipt GL Entries ([b73422e](b73422e4ee))
* Payment entry with TDS in bank reco statement ([#34961](https://github.com/frappe/erpnext/issues/34961)) ([5f28b1d](5f28b1d330))
* Payment Request flow fixes from Order to Payment Entry ([#33350](https://github.com/frappe/erpnext/issues/33350)) ([d5a80b5](d5a80b5615))
* SLA permissions ([#34981](https://github.com/frappe/erpnext/issues/34981)) ([c1187be](c1187bed26))
* **test:** `test_backdated_stock_reco_cancellation_future_negative_stock` ([d010b04](d010b048dc))
* Unable to allocate advance against invoice ([#35007](https://github.com/frappe/erpnext/issues/35007)) ([61a3121](61a3121172))
* use filter_by_finance_book instead of only_depreciable_assets in fixed asset register (backport [#35031](https://github.com/frappe/erpnext/issues/35031)) ([#35036](https://github.com/frappe/erpnext/issues/35036)) ([be2095a](be2095ad03))
* validation for internal transfer entry ([91b5a33](91b5a33564))
* value of depreciable assets not updating after manual depr entry [v14] (backport [#35010](https://github.com/frappe/erpnext/issues/35010)) ([#35029](https://github.com/frappe/erpnext/issues/35029)) ([9087ac0](9087ac0829))
* wrong qty of remaining work orders to be created when using "Create" > "Work Order" ([#34726](https://github.com/frappe/erpnext/issues/34726)) ([189b020](189b020d22))
2023-04-25 16:57:14 +00:00
Deepesh Garg
b85d8946f7 Merge pull request #35033 from frappe/version-13-hotfix
chore: release v13
2023-04-25 22:24:49 +05:30
mergify[bot]
5f28b1d330 fix: Payment entry with TDS in bank reco statement (#34961)
fix: Payment entry with TDS in bank reco statement (#34961)

(cherry picked from commit ecea9b44a3)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-25 21:13:42 +05:30
mergify[bot]
61a3121172 fix: Unable to allocate advance against invoice (#35007)
fix: Unable to allocate advance against invoice (#35007)

(cherry picked from commit f7b50f2ade)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-25 20:51:35 +05:30
mergify[bot]
d5a80b5615 fix: Payment Request flow fixes from Order to Payment Entry (#33350)
* fix: Payment Request flow fixes from Order to Payment Entry

(cherry picked from commit dc178984ae)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.js
#	erpnext/public/js/controllers/transaction.js

* chore: Update test case

(cherry picked from commit e25b98b620)

* chore: More fixes

(cherry picked from commit 31c95deb88)

* chore: resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-25 20:49:18 +05:30
danjeremynavarro
189b020d22 fix: wrong qty of remaining work orders to be created when using "Create" > "Work Order" (#34726)
* fix: convert asynchronous field update to synchronous

* fix: wrong qty of remaining work orders to be created when using "Create" > "Work Order"
2023-04-25 18:53:52 +05:30
mergify[bot]
be2095ad03 fix: use filter_by_finance_book instead of only_depreciable_assets in fixed asset register (backport #35031) (#35036)
fix: use filter_by_finance_book instead of only_depreciable_assets in fixed asset register (#35031)

fix: use filter_by_finance_book instead of only_depreciable_assets
(cherry picked from commit e08d636bf7)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-04-25 15:53:06 +05:30
Saurabh
83afaf48df chore: set correct currency symbol in salary register for multi-currency salary slip 2023-04-25 14:58:37 +05:30
mergify[bot]
9087ac0829 fix: value of depreciable assets not updating after manual depr entry [v14] (backport #35010) (#35029)
* fix: value of depreciable assets not updating after manual depr entry [v14] (#35010)

* fix: update value of asset with calc_depr on after manual depr entry

* fix: value of asset with calc_depr on after manual depr entry not reflecting in asset_depr_and_bal report

* chore: add validation for depr journal entry

* test: manual_depr_for_depreciable_asset and manual_depr_w_incorrect_jv_voucher_type

* chore: unlink depreciable asset from manual depr entry

(cherry picked from commit 3c75e55cb9)

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

* chore: fixed conflicts

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-04-25 13:33:51 +05:30
Sagar Sharma
7759d1e390 Merge pull request #34990 from frappe/mergify/bp/version-13-hotfix/pr-34981
fix: SLA permissions (backport #34981)
2023-04-22 10:31:41 +05:30
s-aga-r
cfa1a2b050 chore: conflicts 2023-04-22 10:08:26 +05:30
Ankush Menat
c1187bed26 fix: SLA permissions (#34981)
(cherry picked from commit ac871797b2)

# Conflicts:
#	erpnext/support/doctype/service_level_agreement/service_level_agreement.json
2023-04-21 15:44:45 +00:00
rohitwaghchaure
9957981039 Merge pull request #34984 from frappe/mergify/bp/version-13-hotfix/pr-34980
fix: validation for internal transfer entry (backport #34980)
2023-04-21 18:53:28 +05:30
rohitwaghchaure
82b46f2bfe chore: fix conflicts 2023-04-21 17:52:11 +05:30
Rohit Waghchaure
91b5a33564 fix: validation for internal transfer entry
(cherry picked from commit 19911b48fd)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.js
2023-04-21 12:16:43 +00:00
mergify[bot]
d215a85747 fix: Advance payment against payment terms (#34872)
* fix: Advance payment against payment terms (#34872)

(cherry picked from commit 5c75894065)

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

* chore: resolve conflicts

* chore: fix tests

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-21 13:24:07 +05:30
Sagar Sharma
813b4d4de2 Merge pull request #34945 from frappe/mergify/bp/version-13-hotfix/pr-34912
fix: internal Purchase Receipt GL Entries (backport #34912)
2023-04-20 17:13:06 +05:30
Sagar Sharma
983140acd8 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-34912 2023-04-20 16:21:11 +05:30
s-aga-r
102ac9f74d chore: conflicts 2023-04-20 16:20:25 +05:30
Sagar Sharma
ebf8deb933 Merge pull request #34957 from frappe/mergify/bp/version-13-hotfix/pr-34953
fix: `PermissionError` in Work Order (backport #34953)
2023-04-20 16:01:36 +05:30
s-aga-r
5680045f2b fix: PermissionError in Work Order
(cherry picked from commit 8108b2de0a)
2023-04-20 10:28:04 +00:00
s-aga-r
d010b048dc fix(test): test_backdated_stock_reco_cancellation_future_negative_stock
(cherry picked from commit 11c8503180)
2023-04-20 06:06:05 +00:00
s-aga-r
046bf64fa3 test: add test case for internal PR GL Entries
(cherry picked from commit c86c543fbf)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
2023-04-20 06:06:05 +00:00
s-aga-r
b73422e4ee fix: internal Purchase Receipt GL Entries
(cherry picked from commit 6fca9adcd4)
2023-04-20 06:06:04 +00:00
Frappe PR Bot
acecd07fa2 chore(release): Bumped to Version 13.49.13
## [13.49.13](https://github.com/frappe/erpnext/compare/v13.49.12...v13.49.13) (2023-04-19)

### Bug Fixes

* change discuss forum url ([#34891](https://github.com/frappe/erpnext/issues/34891)) ([ba984ac](ba984acef2))
* unable to change `company` for manual `Serial No` entry ([5d51103](5d511035ec))
2023-04-19 01:36:18 +00:00
Deepesh Garg
5c6134f1b0 Merge pull request #34906 from frappe/version-13-hotfix
chore: release v13
2023-04-19 07:04:53 +05:30
Sagar Sharma
a2d2beb610 Merge pull request #34869 from frappe/mergify/bp/version-13-hotfix/pr-34858
fix: unable to change `company` for manual `Serial No` entry (backport #34858)
2023-04-18 21:29:02 +05:30
Sagar Sharma
3f4c322bef Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-34858 2023-04-18 11:38:11 +05:30
mergify[bot]
ba984acef2 fix: change discuss forum url (#34891)
fix: change discuss forum url (#34891)

[skip ci]

(cherry picked from commit dd93ea067e)

Co-authored-by: MohsinAli <mmatiyailol@gmail.com>
2023-04-18 07:42:18 +05:30
s-aga-r
98ed6445a8 chore: conflicts 2023-04-16 20:10:18 +05:30
s-aga-r
5d511035ec fix: unable to change company for manual Serial No entry
(cherry picked from commit fb3271c624)

# Conflicts:
#	erpnext/stock/doctype/serial_no/serial_no.json
2023-04-15 06:41:00 +00:00
mergify[bot]
7655a4f0d1 chore: update CODEOWNERS (#34817)
* chore: update CODEOWNERS

[skip ci]

(cherry picked from commit aa8b241d5a)

# Conflicts:
#	CODEOWNERS

* fix: conflicts

* chore: remove duplicates

* chore: remove duplicates

---------

Co-authored-by: Saqib Ansari <nextchamp.saqib@gmail.com>
2023-04-12 07:38:35 +05:30
Frappe PR Bot
c93a5ab8f0 chore(release): Bumped to Version 13.49.12
## [13.49.12](https://github.com/frappe/erpnext/compare/v13.49.11...v13.49.12) (2023-04-11)

### Bug Fixes

* `payment entry is already created` on posawesome. (backport [#34712](https://github.com/frappe/erpnext/issues/34712)) ([#34753](https://github.com/frappe/erpnext/issues/34753)) ([b48fca3](b48fca3e5a))
* Allocate tax loss to tax account head on early payment discount ([#34287](https://github.com/frappe/erpnext/issues/34287)) ([92a26dd](92a26dda3c))
* asset monthly WDV and DD schedule [v13] ([#34645](https://github.com/frappe/erpnext/issues/34645)) ([fed43ae](fed43aeb85))
* BOM Update Cost, when no actual qty ([9725698](9725698b79))
* bom update log not working for large batch size ([9cf30d7](9cf30d7621))
* don't include cancelled JVs in assdeprledger report ([#34737](https://github.com/frappe/erpnext/issues/34737)) ([3007ac3](3007ac3c20))
* enclose ternary operator in parentheses ([198830a](198830a6c8))
* filter out old allocation's cf leaves while fetching leave details ([#34723](https://github.com/frappe/erpnext/issues/34723)) ([50de045](50de045247))
* format currency/float as per number format in work history ([#34545](https://github.com/frappe/erpnext/issues/34545)) ([892c480](892c480408))
* incorrect arg name in asset value adjustment ([545807a](545807a91e))
* incorrect balance qty in the stock ledger report ([dab1f1a](dab1f1a0d0))
* Item tax validity comparison fixes ([#34784](https://github.com/frappe/erpnext/issues/34784)) ([71bafab](71bafab41b))
* lost opportunity report issue ([#34626](https://github.com/frappe/erpnext/issues/34626)) ([ab06cb4](ab06cb42a3))
* posting time issue ([f22e777](f22e7775b3))
* provide filter by depreciable assets in fixed asset register ([#34803](https://github.com/frappe/erpnext/issues/34803)) ([8609bf4](8609bf4a12))
* serial no with zero quantity issue in stock reco ([46638b1](46638b19db))
* Shop by category fixes (backport [#34688](https://github.com/frappe/erpnext/issues/34688)) ([#34751](https://github.com/frappe/erpnext/issues/34751)) ([af828e4](af828e4554))

### Reverts

* Revert "fix: `payment entry is already created` on posawesome. (#34712)" ([034e35e](034e35e7f6)), closes [#34712](https://github.com/frappe/erpnext/issues/34712) [#34712](https://github.com/frappe/erpnext/issues/34712) [#34753](https://github.com/frappe/erpnext/issues/34753)
* remove frappe.send_message (v13) ([#34820](https://github.com/frappe/erpnext/issues/34820)) ([77f1322](77f1322732)), closes [#34816](https://github.com/frappe/erpnext/issues/34816)
2023-04-11 11:41:15 +00:00
Deepesh Garg
12cbe38299 Merge pull request #34812 from frappe/version-13-hotfix
chore: release v13
2023-04-11 17:09:06 +05:30
mergify[bot]
77f1322732 revert: remove frappe.send_message (v13) (#34820)
revert: remove frappe.send_message (v14) (#34816)

revert: remove frappe.send_message
(cherry picked from commit 8a331e0f26)

Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
2023-04-11 16:22:51 +05:30
mergify[bot]
8609bf4a12 fix: provide filter by depreciable assets in fixed asset register (#34803)
fix: provide filter by depreciable assets in fixed asset register (#34803)

(cherry picked from commit c957a5cd2e)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-04-11 13:50:23 +05:30
mergify[bot]
71bafab41b fix: Item tax validity comparison fixes (#34784)
fix: Item tax validity comparison fixes (#34784)

fix: Item tax validity comparsion fixes
(cherry picked from commit 6f6928fa7b)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-10 12:39:44 +05:30
Anand Baburajan
ce151ddae4 Merge pull request #34780 from frappe/mergify/bp/version-13-hotfix/pr-34735
'Make Asset Movement' button translation fix in asset_list.js (backport #34735)
2023-04-07 15:34:32 +05:30
Hossein Yousefian
16ae117c97 'Make Asset Movement' button translation fix
(cherry picked from commit b70615ef18)
2023-04-07 10:01:19 +00:00
Frappe PR Bot
21cd789842 chore(release): Bumped to Version 13.49.11
## [13.49.11](https://github.com/frappe/erpnext/compare/v13.49.10...v13.49.11) (2023-04-05)

### Reverts

* Revert "fix: `payment entry is already created` on posawesome. (backport #34712)" (backport #34756) (#34757) ([98de1f2](98de1f201d)), closes [#34712](https://github.com/frappe/erpnext/issues/34712) [#34756](https://github.com/frappe/erpnext/issues/34756) [#34757](https://github.com/frappe/erpnext/issues/34757) [#34712](https://github.com/frappe/erpnext/issues/34712) [#34712](https://github.com/frappe/erpnext/issues/34712) [#34753](https://github.com/frappe/erpnext/issues/34753)
2023-04-05 11:45:33 +00:00
mergify[bot]
98de1f201d Revert "fix: payment entry is already created on posawesome. (backport #34712)" (backport #34756) (#34757)
Revert "fix: `payment entry is already created` on posawesome. (#34712)"

Revert "fix: `payment entry is already created` on posawesome. (backport #34712) (#34753)"

This reverts commit b48fca3e5a.

(cherry picked from commit 034e35e7f6)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-05 17:13:54 +05:30
Deepesh Garg
034e35e7f6 Revert "fix: payment entry is already created on posawesome. (#34712)"
Revert "fix: `payment entry is already created` on posawesome. (backport #34712) (#34753)"

This reverts commit b48fca3e5a.
2023-04-05 17:12:05 +05:30
mergify[bot]
b48fca3e5a fix: payment entry is already created on posawesome. (backport #34712) (#34753) 2023-04-05 13:55:33 +05:30
Frappe PR Bot
2c40be2337 chore: release v13 (#34732) 2023-04-05 13:48:11 +05:30
mergify[bot]
af828e4554 fix: Shop by category fixes (backport #34688) (#34751)
fix: Shop by category fixes (#34688)

* fix: Shop by category fixes

* chore: Update tests

(cherry picked from commit 56f5078357)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-04-05 13:09:49 +05:30
mergify[bot]
e76df6ff46 fix!: require sender and message for contact us page (#34707)
fix!: require sender and message for contact us page (#34707)

* fix: require sender and message for contact us page

* refactor: dont override frappe.send_message from client side

used override_whitelisted_method hook for the same

(cherry picked from commit f193393f57)

Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
2023-04-05 12:46:56 +05:30
mergify[bot]
3007ac3c20 fix: don't include cancelled JVs in assdeprledger report (#34737)
fix: don't include cancelled JVs in assdeprledger report

(cherry picked from commit 3896d41e95)

Co-authored-by: anandbaburajan <anandbaburajan@gmail.com>
2023-04-05 11:56:38 +05:30
mergify[bot]
92a26dda3c fix: Allocate tax loss to tax account head on early payment discount (#34287)
* fix: Taxes aren't discounted on early payment discount

- Deductions in payment entry must be split into income loss and tax loss
- Compute total discount in percentage, makes discounting different amounts proportionately easier

(cherry picked from commit 768c3a4927)

* fix: Recalculate difference amount after setting deductions

(cherry picked from commit 75ec0a0a85)

* fix: Set deductions in base currency

- Use field precision to get more accurate values

(cherry picked from commit dc2998f544)

* fix: Back update discounted amount in Invoice based on discount type

- Discount value was always trated as a percentage on back updation

(cherry picked from commit 2ae5834290)

* test: PE from SI with early payment discount amount & PE assertions in discount % test

(cherry picked from commit c217bb2018)

* fix: Set deduction amount in company currency on Doctype

- Even via JS, deductions amount is always in company currency
- Since there is nothing dynamic about this field, set it in the doctype spec itself
- fixed: Inconsistency between label currency and field currency formatted value

(cherry picked from commit 7f2e7badff)

* fix: Don't add to deductions if amount is 0

- misc: better docstring

(cherry picked from commit f02fc8acf0)

* fix: Paid amount must be discounted considering accounting currency

- Accounting is in the same currency if party currency and company currency is the same
- If accounting is in the same currency, paid and recvd amount is in the base currency
- Then, discount amount must also be in the base currency as it is deducted from paid amount
- Received amount must be in base currency if not multi currency
- cleanup: Deductions setting broken into smaller functions

(cherry picked from commit 761f68d7bf)

* fix: Multi-currency SI with base currency PE

- Return total discount loss in base currency
- Allocate payment based on terms: Set allocated amount in references table in base currency if accounting is in that currency
- Allocate payment based on terms: While back updating set paid amount (payment schedule) in transaction currency always
- minor: discount msgprint in correct currency

(cherry picked from commit b09c2381ca)

* test: Multi currency SI with multi-currency accounting and single currency accounting + Early payment discount

(cherry picked from commit 9abf0ef615)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/test_payment_entry.py

* fix: Handle rounding more gracefully

- Round off pending discount loss to avoid miniscule losses rounded to 0.0 that are added in deductions
- Use base amounts to calculate base losses instead of using conversion factor which increases rounding error
- Round of total base loss instead of individual income and tax losses to reduce rounding error
- Use default round off account for pending rounding loss in deductions

(cherry picked from commit caa1a3dccf)

* fix: Provision to apply early payment discount if payment is recorded late

- Party could have paid on time but payment is recorded late
- Prompt for reference date so that discount is applied while mapping
- Prompt only if discount in payment schedule of valid doctypes
- test: Reference date and impact on PE
- `make_payment_entry` (JS) must be able to access `this`

(cherry picked from commit d6d0163514)

# Conflicts:
#	erpnext/accounts/doctype/payment_entry/payment_entry.py
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
#	erpnext/buying/doctype/purchase_order/purchase_order.js
#	erpnext/public/js/controllers/transaction.js

* feat: Make Tax loss booking optional

- Checkbox in Accounts Settings
- Apply checkbox in PE deductions setting logic
- Adjust tests

(cherry picked from commit 216a46bd66)

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

* fix: Merge conflicts

* fix: 'Donation' does not have `company_currency` field

- Make sure check uses this field only for eligible documents

---------

Co-authored-by: marination <maricadsouza221197@gmail.com>
2023-04-05 11:55:22 +05:30
Anand Baburajan
fed43aeb85 fix: asset monthly WDV and DD schedule [v13] (#34645)
fix: monthly wdv and dd schedule
2023-04-05 11:45:15 +05:30
RJPvT
892c480408 fix: format currency/float as per number format in work history (#34545)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2023-04-04 11:08:55 +05:30
Rucha Mahabal
50de045247 fix: filter out old allocation's cf leaves while fetching leave details (#34723) 2023-04-03 20:19:11 +05:30
rohitwaghchaure
313aecf0ff Merge pull request #34720 from frappe/mergify/bp/version-13-hotfix/pr-34715
fix: bom update log not working for large batch size (backport #34715)
2023-04-03 16:55:37 +05:30
Rohit Waghchaure
9cf30d7621 fix: bom update log not working for large batch size
(cherry picked from commit d56070301c)
2023-04-03 10:20:07 +00:00
Sagar Sharma
e7fd47ae82 Merge pull request #34698 from frappe/mergify/bp/version-13-hotfix/pr-34656
fix: BOM Update Cost, when no actual qty (backport #34656)
2023-04-02 14:59:31 +05:30
s-aga-r
9725698b79 fix: BOM Update Cost, when no actual qty
(cherry picked from commit a4112c75c5)
2023-04-01 10:54:51 +00:00
ruthra kumar
008c985392 Merge pull request #34685 from frappe/mergify/bp/version-13-hotfix/pr-34679
fix: enclose ternary operator in parenthesis (backport #34679)
2023-03-31 14:05:16 +05:30
ruthra kumar
198830a6c8 fix: enclose ternary operator in parentheses
(cherry picked from commit 986daa6578)
2023-03-31 08:02:11 +00:00
Sagar Sharma
2770840946 Merge pull request #34682 from frappe/mergify/bp/version-13-hotfix/pr-34677
chore: make `Production Plan Item Reference` table hidden in Production Plan (backport #34677)
2023-03-31 12:43:26 +05:30
s-aga-r
45eb440b68 chore: conflicts 2023-03-31 12:42:51 +05:30
s-aga-r
85d8ed989d chore: make Production Plan Item Reference table hidden in Production Plan
(cherry picked from commit 706be2a415)

# Conflicts:
#	erpnext/manufacturing/doctype/production_plan/production_plan.json
2023-03-31 07:05:19 +00:00
rohitwaghchaure
6b026280c7 Merge pull request #34670 from frappe/mergify/bp/version-13-hotfix/pr-34664
fix: incorrect balance qty in the stock ledger report (backport #34664)
2023-03-30 18:17:51 +05:30
rohitwaghchaure
74280e0557 Merge pull request #34672 from frappe/mergify/bp/version-13-hotfix/pr-34636
fix: posting time issue (backport #34636)
2023-03-30 18:17:14 +05:30
Anand Baburajan
5f32696158 Merge pull request #34666 from frappe/mergify/bp/version-13-hotfix/pr-34661
chore: improve asset depr posting failure msg (backport #34661)
2023-03-30 17:50:32 +05:30
Rohit Waghchaure
f22e7775b3 fix: posting time issue
(cherry picked from commit 345e6facbe)
2023-03-30 11:56:41 +00:00
Rohit Waghchaure
dab1f1a0d0 fix: incorrect balance qty in the stock ledger report
(cherry picked from commit cbdaab940d)
2023-03-30 11:56:28 +00:00
Anand Baburajan
503c58edf8 chore: improve asset depr posting failure msg (#34661)
* chore: improve asset depr posting error msg

* chore: add period

* chore: improve msg

(cherry picked from commit d999dea3e4)
2023-03-30 11:09:34 +00:00
mergify[bot]
e54ff346ca chore: auto fill asset name and available for use date (backport #34660) (#34663)
* chore: auto fill asset name and available for use date

(cherry picked from commit af3e807607)

# Conflicts:
#	erpnext/assets/doctype/asset/asset.json

* Update asset.json

---------

Co-authored-by: anandbaburajan <anandbaburajan@gmail.com>
2023-03-30 16:36:56 +05:30
Frappe PR Bot
278f38f2aa chore(release): Bumped to Version 13.49.10
## [13.49.10](https://github.com/frappe/erpnext/compare/v13.49.9...v13.49.10) (2023-03-30)

### Bug Fixes

* serial no with zero quantity issue in stock reco ([4cf66f0](4cf66f0585))
2023-03-30 08:48:15 +00:00
rohitwaghchaure
b1bb749e23 Merge pull request #34655 from frappe/mergify/bp/version-13/pr-34653
fix: serial no with zero quantity issue in stock reco (backport #34648) (backport #34653)
2023-03-30 14:15:59 +05:30
Rohit Waghchaure
4cf66f0585 fix: serial no with zero quantity issue in stock reco
(cherry picked from commit 17131e5a02)
(cherry picked from commit 46638b19db)
2023-03-30 08:10:43 +00:00
rohitwaghchaure
a872a7a9eb Merge pull request #34653 from frappe/mergify/bp/version-13-hotfix/pr-34648
fix: serial no with zero quantity issue in stock reco (backport #34648)
2023-03-30 13:39:28 +05:30
Anand Baburajan
60046feac3 Merge pull request #34651 from frappe/mergify/bp/version-13-hotfix/pr-34649
fix: incorrect arg name in asset value adjustment (backport #34649)
2023-03-30 13:10:07 +05:30
Rohit Waghchaure
46638b19db fix: serial no with zero quantity issue in stock reco
(cherry picked from commit 17131e5a02)
2023-03-30 07:35:38 +00:00
anandbaburajan
545807a91e fix: incorrect arg name in asset value adjustment
(cherry picked from commit 2b0470d1f5)
2023-03-30 07:34:09 +00:00
mergify[bot]
ab06cb42a3 fix: lost opportunity report issue (#34626)
fix: lost opportunity report issue (#34626)

* fix: lost opportunity report issue

* chore: Linting Issues

---------

Co-authored-by: Komal Saraf <komal@frappe.io>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit d0660ad222)

Co-authored-by: Komal-Saraf0609 <81952590+Komal-Saraf0609@users.noreply.github.com>
2023-03-29 17:04:40 +05:30
Bevan Tony Medrano
625b8e8005 Asset maintenance task add dropdown "3 Yearly" (#34607)
* feat(asset_maintenance.json):Add 3 yearly in periodicity dropdown

* add server side implications for 3 yearly
2023-03-29 16:59:49 +05:30
Frappe PR Bot
0da6237d22 chore(release): Bumped to Version 13.49.9
## [13.49.9](https://github.com/frappe/erpnext/compare/v13.49.8...v13.49.9) (2023-03-28)

### Bug Fixes

* `Blanket Order` (backport [#34279](https://github.com/frappe/erpnext/issues/34279)) ([#34548](https://github.com/frappe/erpnext/issues/34548)) ([8ddbac5](8ddbac5158))
* **client:** Amount calculation for 0 qty debit notes ([#34455](https://github.com/frappe/erpnext/issues/34455)) ([19dda80](19dda807d1))
* exchange gain/loss GL's should be removed if advance is cancelled ([#34529](https://github.com/frappe/erpnext/issues/34529)) ([00518eb](00518eb384))
* german translations ([#34312](https://github.com/frappe/erpnext/issues/34312)) ([661030a](661030aba1))
* incorrect `Opening Value` in `Stock Balance` report (backport [#34461](https://github.com/frappe/erpnext/issues/34461)) ([#34622](https://github.com/frappe/erpnext/issues/34622)) ([e53a96a](e53a96ae1d))
* incorrect depr schedules after asset repair [v13] ([#34520](https://github.com/frappe/erpnext/issues/34520)) ([ae88ba5](ae88ba5d18))
* Overallocation of 'qty' from Cr Notes to Parent Invoice ([d2a1acc](d2a1acc2e2))
* Party Name in SOA print when viewed from Customer/Supplier master ([#34597](https://github.com/frappe/erpnext/issues/34597)) ([4bdea43](4bdea436e3))
* Percentage billing in Sales Order ([#34606](https://github.com/frappe/erpnext/issues/34606)) ([3aab6e6](3aab6e6fa8))
* recalculate WDV rate after asset repair [v13] ([#34567](https://github.com/frappe/erpnext/issues/34567)) ([c8bde39](c8bde399e5))
* Search field not working for customer, supplier ([#32693](https://github.com/frappe/erpnext/issues/32693)) ([dbe289e](dbe289e734))
* unset address and contact on trash (backport [#34495](https://github.com/frappe/erpnext/issues/34495)) ([#34561](https://github.com/frappe/erpnext/issues/34561)) ([7f83d15](7f83d15bda))
* valuation rate issue while making stock entry from PO ([3574d49](3574d490db))
2023-03-28 18:17:57 +00:00
Deepesh Garg
526e350d98 Merge pull request #34610 from frappe/version-13-hotfix
chore: release v13
2023-03-28 23:46:31 +05:30
mergify[bot]
e53a96ae1d fix: incorrect Opening Value in Stock Balance report (backport #34461) (#34622)
* fix: incorrect `Opening Value` in `Stock Balance` report

(cherry picked from commit b04a101c11)

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

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-03-28 21:09:09 +05:30
mergify[bot]
3aab6e6fa8 fix: Percentage billing in Sales Order (#34606)
* fix: Percentage billing in Sales Order (#34606)

(cherry picked from commit 12ad2aa2e5)

# Conflicts:
#	erpnext/controllers/status_updater.py

* chore: resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-28 18:38:52 +05:30
Deepesh Garg
2e9e6eef05 chore: Update ubuntu version (#34620) 2023-03-28 17:25:33 +05:30
mergify[bot]
4bdea436e3 fix: Party Name in SOA print when viewed from Customer/Supplier master (#34597)
fix: Party Name in SOA print when viewed from Customer/Supplier master (#34597)

fix: Party Name in SOA print when viewd from Customer/Supplier master
(cherry picked from commit 50c1172f29)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-28 16:49:20 +05:30
mergify[bot]
dbe289e734 fix: Search field not working for customer, supplier (#32693)
* fix: searchfield not working for cuctsomer, supplier as per customize form

(cherry picked from commit 46d148defd)

* test: added test case to validate seachfields for customer, supplier

(cherry picked from commit 5f84993bae)

* fix: not able to select customer / supplier

---------

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
2023-03-28 16:06:27 +05:30
Frappe PR Bot
8c4f45307e chore(release): Bumped to Version 13.49.8
## [13.49.8](https://github.com/frappe/erpnext/compare/v13.49.7...v13.49.8) (2023-03-25)

### Bug Fixes

* valuation rate issue while making stock entry from PO ([78bd698](78bd698f9e))
2023-03-25 14:50:08 +00:00
rohitwaghchaure
7b2dc2449d Merge pull request #34590 from frappe/mergify/bp/version-13/pr-34555
fix: valuation rate issue while making stock entry from PO (backport #34555)
2023-03-25 20:18:27 +05:30
Rohit Waghchaure
78bd698f9e fix: valuation rate issue while making stock entry from PO
(cherry picked from commit 3574d490db)
2023-03-25 13:32:41 +00:00
Frappe PR Bot
544e37ca5c chore(release): Bumped to Version 13.49.7
## [13.49.7](https://github.com/frappe/erpnext/compare/v13.49.6...v13.49.7) (2023-03-23)

### Bug Fixes

* recalculate WDV rate after asset repair [v13] ([#34567](https://github.com/frappe/erpnext/issues/34567)) ([5f5fa84](5f5fa843ac))
2023-03-23 15:43:53 +00:00
Anand Baburajan
c7bdb1bbf9 Merge pull request #34572 from frappe/mergify/bp/version-13/pr-34567
fix: recalculate WDV rate after asset repair [v13] (backport #34567)
2023-03-23 21:11:48 +05:30
Anand Baburajan
5f5fa843ac fix: recalculate WDV rate after asset repair [v13] (#34567)
fix: recalculate wdv rate after asset repair
(cherry picked from commit c8bde399e5)
2023-03-23 14:28:08 +00:00
Anand Baburajan
c8bde399e5 fix: recalculate WDV rate after asset repair [v13] (#34567)
fix: recalculate wdv rate after asset repair
2023-03-23 19:44:13 +05:30
mergify[bot]
7f83d15bda fix: unset address and contact on trash (backport #34495) (#34561)
fix: unset address and contact on trash (#34495)

* fix(Customer): unset address and contact on trash

* fix(Supplier): unset address and contact on trash

---------

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
(cherry picked from commit f7bf1b8a0c)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-03-23 12:58:54 +05:30
rohitwaghchaure
ad5eb6da4e Merge pull request #34555 from rohitwaghchaure/dont-raise-error-while-mkaing-ste
fix: valuation rate issue while making stock entry from PO
2023-03-22 23:36:57 +05:30
Rohit Waghchaure
3574d490db fix: valuation rate issue while making stock entry from PO 2023-03-22 16:52:07 +05:30
Frappe PR Bot
f17b2de420 chore(release): Bumped to Version 13.49.6
## [13.49.6](https://github.com/frappe/erpnext/compare/v13.49.5...v13.49.6) (2023-03-22)

### Bug Fixes

* `Blanket Order` (backport [#34279](https://github.com/frappe/erpnext/issues/34279)) (backport [#34548](https://github.com/frappe/erpnext/issues/34548)) ([#34553](https://github.com/frappe/erpnext/issues/34553)) ([d5efeec](d5efeec0a4))
2023-03-22 09:29:45 +00:00
mergify[bot]
d5efeec0a4 fix: Blanket Order (backport #34279) (backport #34548) (#34553)
fix: `Blanket Order` (backport #34279) (#34548)

* fix: hide `+` button based on `Blanket Order Type`

(cherry picked from commit abf9a28d6a)

* feat: add field `Over Order Allowance (%)` in `Buying Settings`

(cherry picked from commit f5937f46cb)

# Conflicts:
#	erpnext/buying/doctype/buying_settings/buying_settings.json

* refactor: rewrite `blanket_order.py` queries in `QB`

(cherry picked from commit f3993783a3)

* fix: don't map item row having `0` qty

(cherry picked from commit fc1088d9c4)

* feat: consider `over_order_allowance` while validating order qty

(cherry picked from commit 8bcbc45add)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.py

* feat: add field `Over Order Allowance (%)` in `Selling Settings`

(cherry picked from commit d7da8928ac)

# Conflicts:
#	erpnext/selling/doctype/selling_settings/selling_settings.json

* feat: consider `over_order_allowance` while validating sales order qty

(cherry picked from commit 53701c37b1)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.py

* test: add test cases for `Over Order Allowance` against `Blanket Order`

(cherry picked from commit 66f650061d)

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
(cherry picked from commit 8ddbac5158)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-03-22 14:58:10 +05:30
mergify[bot]
8ddbac5158 fix: Blanket Order (backport #34279) (#34548)
* fix: hide `+` button based on `Blanket Order Type`

(cherry picked from commit abf9a28d6a)

* feat: add field `Over Order Allowance (%)` in `Buying Settings`

(cherry picked from commit f5937f46cb)

# Conflicts:
#	erpnext/buying/doctype/buying_settings/buying_settings.json

* refactor: rewrite `blanket_order.py` queries in `QB`

(cherry picked from commit f3993783a3)

* fix: don't map item row having `0` qty

(cherry picked from commit fc1088d9c4)

* feat: consider `over_order_allowance` while validating order qty

(cherry picked from commit 8bcbc45add)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.py

* feat: add field `Over Order Allowance (%)` in `Selling Settings`

(cherry picked from commit d7da8928ac)

# Conflicts:
#	erpnext/selling/doctype/selling_settings/selling_settings.json

* feat: consider `over_order_allowance` while validating sales order qty

(cherry picked from commit 53701c37b1)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.py

* test: add test cases for `Over Order Allowance` against `Blanket Order`

(cherry picked from commit 66f650061d)

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-03-22 13:50:29 +05:30
Frappe PR Bot
6e492ec514 chore: release v13 (#34531)
* chore: Update user manual link (#34478)

* chore: Update user manual link (#34478)

(cherry picked from commit be723bb9d4)

# Conflicts:
#	erpnext/patches.txt

* chore: resolve conflicts

* chore: Update version

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

* chore: Update version

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

---------

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

* fix: Overallocation of 'qty' from Cr Notes to Parent Invoice

Cr Notes 'qty' are overallocated to parent invoice, when there are
mulitple instances of same item in Invoice.

(cherry picked from commit e2f19c6a14)

* refactor: Ignore linked Cr Notes in Report output

(cherry picked from commit d0715a82eb)

* test: Gross Profit report output for Cr notes

2 New test cases added.
1. Standalone Cr notes will be reported as normal Invoices
2. Cr notes against an Invoice will not overallocate qty if there are
multiple instances of same item

(cherry picked from commit cc61daeec4)

* fix: incorrect depr schedules after asset repair [v13] (#34520)

* fix: incorrect schedule after repair for WDV and DD

* chore: only fix schedules for assets with calc_depr true

* fix: incorrect schedule after repair for straight line and manual

* refactor: calc depr in asset repair and if statement (#34526)

refactor: minor asset repair of calc depr and if statement

* fix(client): Amount calculation for 0 qty debit notes (#34455)

fix(client): Amount calculation for 0 qty debit notes (#34455)

fix(client): Amount calculaton for 0 qty debit notes

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
(cherry picked from commit ee6c107d58)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>

* fix: german translations (#34312)

fix: german translations (#34312)

fix: some german translations
(cherry picked from commit 59c2e7ec3e)

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

* fix: exchange gain/loss GL's should be removed if advance is cancelled (#34529)

* fix: report GL for invoice when advance has different exchange rate

If deferred revenue/expense is enabled for any item, don't repost.

* test: cancelling advance should remove exchange gain/loss

If there are no deferred revenue/expense cancelling advance should
cancel the exchange gain/loss booked due to different exchange rates
of payment and its linked invoice

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
Co-authored-by: ruthra kumar <ruthra@erpnext.com>
Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-03-21 18:20:16 +05:30
ruthra kumar
00518eb384 fix: exchange gain/loss GL's should be removed if advance is cancelled (#34529)
* fix: report GL for invoice when advance has different exchange rate

If deferred revenue/expense is enabled for any item, don't repost.

* test: cancelling advance should remove exchange gain/loss

If there are no deferred revenue/expense cancelling advance should
cancel the exchange gain/loss booked due to different exchange rates
of payment and its linked invoice
2023-03-21 16:16:36 +05:30
mergify[bot]
661030aba1 fix: german translations (#34312)
fix: german translations (#34312)

fix: some german translations
(cherry picked from commit 59c2e7ec3e)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-03-21 16:08:50 +05:30
mergify[bot]
19dda807d1 fix(client): Amount calculation for 0 qty debit notes (#34455)
fix(client): Amount calculation for 0 qty debit notes (#34455)

fix(client): Amount calculaton for 0 qty debit notes

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
(cherry picked from commit ee6c107d58)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-21 16:06:10 +05:30
Anand Baburajan
0d5abf1c95 refactor: calc depr in asset repair and if statement (#34526)
refactor: minor asset repair of calc depr and if statement
2023-03-21 14:30:28 +05:30
Anand Baburajan
ae88ba5d18 fix: incorrect depr schedules after asset repair [v13] (#34520)
* fix: incorrect schedule after repair for WDV and DD

* chore: only fix schedules for assets with calc_depr true

* fix: incorrect schedule after repair for straight line and manual
2023-03-21 12:35:44 +05:30
ruthra kumar
d855b532e4 Merge pull request #34511 from ruthra-kumar/manual_backport_of_34456
fix: Gross Profit reports Invoices with -ve qty for Invoices with Cr Notes (manual backport to version 13)
2023-03-20 15:42:09 +05:30
ruthra kumar
4e38e8da1b test: Gross Profit report output for Cr notes
2 New test cases added.
1. Standalone Cr notes will be reported as normal Invoices
2. Cr notes against an Invoice will not overallocate qty if there are
multiple instances of same item

(cherry picked from commit cc61daeec4)
2023-03-20 14:48:53 +05:30
ruthra kumar
6eeac48f17 refactor: Ignore linked Cr Notes in Report output
(cherry picked from commit d0715a82eb)
2023-03-20 14:48:53 +05:30
ruthra kumar
d2a1acc2e2 fix: Overallocation of 'qty' from Cr Notes to Parent Invoice
Cr Notes 'qty' are overallocated to parent invoice, when there are
mulitple instances of same item in Invoice.

(cherry picked from commit e2f19c6a14)
2023-03-20 14:48:53 +05:30
mergify[bot]
a3aa4d536a chore: Update user manual link (#34478)
* chore: Update user manual link (#34478)

(cherry picked from commit be723bb9d4)

# Conflicts:
#	erpnext/patches.txt

* chore: resolve conflicts

* chore: Update version

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

* chore: Update version

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

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-03-19 18:08:15 +05:30
Frappe PR Bot
cfcbdfcaec chore(release): Bumped to Version 13.49.5
## [13.49.5](https://github.com/frappe/erpnext/compare/v13.49.4...v13.49.5) (2023-03-14)

### Bug Fixes

* `BOM Stock Report` ([eb1f8f9](eb1f8f932d))
* `required_qty` get reset to `1` for Alternative Item in WO ([d117101](d1171016b3))
* adjust excess cf leaves in new leaves taken if number exceeds cf leaves allocation ([bc12269](bc12269ef4))
* consider leaves taken while calculating expired carry-forwarded leaves ([e74e02b](e74e02b765))
* consider leaves taken within carry-forwarded period separately while calculating balance ([52108d5](52108d52e2))
* consider relieving date while calculating payment days based on lwp ([563f83f](563f83f0f5))
* Don't use get_list & get_all interchangeably ([b70a37f](b70a37f6fa))
* Error in consolidated financial statement ([#34330](https://github.com/frappe/erpnext/issues/34330)) ([470dc10](470dc10b15))
* exclude cancelled leave ledger entries ([91cad9e](91cad9e985))
* exclude carry forwarding leaves while updating leaves after submission ([88c5de5](88c5de533a))
* leave allocation tests ([2f62a96](2f62a9641e))
* linter ([341eab2](341eab2b2a))
* operation time for multi-level BOM in WO ([f4d07cc](f4d07cc84e))
* precision for newly allocated leaves ([238769e](238769e6b5))
* **test:** `get_leave_allocation_records` ([c01bed9](c01bed9862))
* **test:** `TestBomStockReport` ([4824302](4824302811))
* Total row in trail balance report (backport [#34395](https://github.com/frappe/erpnext/issues/34395)) ([#34431](https://github.com/frappe/erpnext/issues/34431)) ([809d6d6](809d6d638e))
* Use customer name instead of name(id) in PSOA (backport [#34412](https://github.com/frappe/erpnext/issues/34412)) ([#34426](https://github.com/frappe/erpnext/issues/34426)) ([a24f050](a24f0507e1))

### Performance Improvements

* `update_completed_qty()` in `material_request.py` ([5bc2b8f](5bc2b8f685))
* Stock Entry (Material Transfer) ([7a159a7](7a159a7187))

### Reverts

* Revert "fix: Default sales team not getting set" (#34376) ([42bda6e](42bda6e37b)), closes [#34376](https://github.com/frappe/erpnext/issues/34376) [#34376](https://github.com/frappe/erpnext/issues/34376) [#34284](https://github.com/frappe/erpnext/issues/34284)
2023-03-14 16:38:26 +00:00
Deepesh Garg
499987040b Merge pull request #34441 from frappe/version-13-hotfix
chore: release v13
2023-03-14 22:06:33 +05:30
Sagar Sharma
28027a9f94 Merge pull request #34449 from frappe/mergify/bp/version-13-hotfix/pr-34415
fix: operation time for multi-level BOM in WO (backport #34415)
2023-03-14 19:25:44 +05:30
Sagar Sharma
b4aabf3f35 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-34415 2023-03-14 18:55:49 +05:30
Sagar Sharma
cf49b0effb Merge pull request #34451 from frappe/mergify/bp/version-13-hotfix/pr-34381
chore: fix french translation (backport #34381)
2023-03-14 18:55:19 +05:30
HENRY Florian
0bb43a1be5 chore: fix french translation (#34381)
chore: update french translation
(cherry picked from commit d267111e13)
2023-03-14 13:20:05 +00:00
s-aga-r
f4d07cc84e fix: operation time for multi-level BOM in WO
(cherry picked from commit 442ee3adba)
2023-03-14 13:18:29 +00:00
mergify[bot]
809d6d638e fix: Total row in trail balance report (backport #34395) (#34431)
fix: Total row in trail balance report (#34395)

* fix: Total row in trail balance report

* fix: Calculate total after preparing opening and closing

(cherry picked from commit c6999fc687)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-14 15:07:30 +05:30
Rucha Mahabal
0834cb1bb6 Merge pull request #34436 from ruchamahabal/fix-leave-balance-editing-v13 2023-03-14 12:57:52 +05:30
Rucha Mahabal
2f62a9641e fix: leave allocation tests 2023-03-14 12:24:56 +05:30
Rucha Mahabal
cdf73bb781 test: update for total leaves allocated post submission 2023-03-14 11:49:32 +05:30
Rucha Mahabal
238769e6b5 fix: precision for newly allocated leaves 2023-03-14 11:49:24 +05:30
Rucha Mahabal
91cad9e985 fix: exclude cancelled leave ledger entries 2023-03-14 11:49:14 +05:30
Rucha Mahabal
7b9784ce10 refactor(tests): create_leave_type usage 2023-03-14 11:49:02 +05:30
Rucha Mahabal
fc10c8e44e test: leaves updated after submission with carry forwarding 2023-03-14 11:48:53 +05:30
Rucha Mahabal
88c5de533a fix: exclude carry forwarding leaves while updating leaves after submission 2023-03-14 11:48:42 +05:30
mergify[bot]
a24f0507e1 fix: Use customer name instead of name(id) in PSOA (backport #34412) (#34426)
fix: Use customer name instead of name(id) in PSOA (#34412)

(cherry picked from commit fa776d2987)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-13 20:29:17 +05:30
mergify[bot]
470dc10b15 fix: Error in consolidated financial statement (#34330)
fix: Error in consolidated financial statement (#34330)

(cherry picked from commit aae53bb910)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-13 14:02:28 +05:30
Saurabh
4d25091196 Merge pull request #34359 from saurabh6790/consider-relieving-date-in-lwp-calculation
fix: consider relieving date while calculating payment days based on lwp
2023-03-13 13:11:28 +05:30
Saurabh
44df522655 chore: fix linter #nosemgrep 2023-03-13 12:43:20 +05:30
Rucha Mahabal
8694d22b7a Merge pull request #34388 from ruchamahabal/fix-balance-edge-cases-v13 2023-03-10 14:39:03 +05:30
Rucha Mahabal
072c7e913d chore: fix linter 2023-03-10 11:44:33 +05:30
Rucha Mahabal
bc12269ef4 fix: adjust excess cf leaves in new leaves taken if number exceeds cf leaves allocation 2023-03-10 11:41:36 +05:30
Rucha Mahabal
7717a8a5e3 test: leave details with application across and after cf leave expiry 2023-03-10 11:41:17 +05:30
Rucha Mahabal
fd5d2ed87f refactor: consider cases for partially consumed cf and new leaves
- the above two cases weren't considering the split between cf leaves taken and new leaves taken and substracting all consumed leaves from cf leaves
2023-03-10 11:29:18 +05:30
Rucha Mahabal
c01bed9862 fix(test): get_leave_allocation_records 2023-03-10 11:29:12 +05:30
Rucha Mahabal
52108d52e2 fix: consider leaves taken within carry-forwarded period separately while calculating balance 2023-03-10 11:29:04 +05:30
Rucha Mahabal
e74e02b765 fix: consider leaves taken while calculating expired carry-forwarded leaves 2023-03-10 11:28:56 +05:30
gavin
b70a37f6fa fix: Don't use get_list & get_all interchangeably
* fix: Fetch all fields via get_returned_qty_map_for_row

* fix(update_billing_percentage): Remove permlevel checks on aggregated
value
2023-03-09 16:05:54 +05:30
Frappe PR Bot
5157f5dd0e chore(release): Bumped to Version 13.49.4
## [13.49.4](https://github.com/frappe/erpnext/compare/v13.49.3...v13.49.4) (2023-03-09)

### Reverts

* Revert "fix: Default sales team not getting set" (#34376) ([b712aea](b712aea3a4)), closes [#34376](https://github.com/frappe/erpnext/issues/34376) [#34376](https://github.com/frappe/erpnext/issues/34376) [#34284](https://github.com/frappe/erpnext/issues/34284)
2023-03-09 10:26:41 +00:00
Deepesh Garg
9ce5d84951 Merge pull request #34380 from frappe/mergify/bp/version-13/pr-34378
Revert "fix: Default sales team not getting set" (backport #34376) (backport #34378)
2023-03-09 15:43:02 +05:30
mergify[bot]
b712aea3a4 Revert "fix: Default sales team not getting set" (#34376)
Revert "fix: Default sales team not getting set" (#34376)

Revert "fix: Default sales team not getting set (#34284)"

This reverts commit 7d0199d743.

(cherry picked from commit 9a8f8e8b7d)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 42bda6e37b)
2023-03-09 10:12:06 +00:00
mergify[bot]
42bda6e37b Revert "fix: Default sales team not getting set" (#34376)
Revert "fix: Default sales team not getting set" (#34376)

Revert "fix: Default sales team not getting set (#34284)"

This reverts commit 7d0199d743.

(cherry picked from commit 9a8f8e8b7d)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-09 15:40:32 +05:30
Sagar Sharma
eb24f91341 Merge pull request #34369 from frappe/mergify/bp/version-13-hotfix/pr-34360
chore: `Alternative Item Code` error msg (backport #34360)
2023-03-09 13:54:59 +05:30
Saurabh
341eab2b2a fix: linter 2023-03-09 13:24:38 +05:30
Sagar Sharma
0857632359 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-34360 2023-03-09 12:07:45 +05:30
Sagar Sharma
e23f1555bb Merge pull request #34367 from frappe/mergify/bp/version-13-hotfix/pr-34362
fix: `required_qty` get reset to `1` for Alternative Item in WO (backport #34362)
2023-03-09 11:09:06 +05:30
s-aga-r
75c844a15a chore: Alternative Item Code error msg
(cherry picked from commit baef5ae1ef)
2023-03-09 04:38:21 +00:00
s-aga-r
d1171016b3 fix: required_qty get reset to 1 for Alternative Item in WO
(cherry picked from commit 046834a97a)
2023-03-09 04:35:58 +00:00
Saurabh
563f83f0f5 fix: consider relieving date while calculating payment days based on lwp 2023-03-08 19:02:46 +05:30
Sagar Sharma
9844508066 Merge pull request #34357 from frappe/mergify/bp/version-13-hotfix/pr-34352
fix: `BOM Stock Report` (backport #34352)
2023-03-08 18:14:42 +05:30
s-aga-r
4824302811 fix(test): TestBomStockReport 2023-03-08 17:44:51 +05:30
s-aga-r
08b9aaff26 test: add test cases for BOM Stock Report
(cherry picked from commit b53dcb04ed)
2023-03-08 10:56:43 +00:00
s-aga-r
eb1f8f932d fix: BOM Stock Report
(cherry picked from commit a65b80911b)
2023-03-08 10:56:43 +00:00
Frappe PR Bot
07ff956fd8 chore(release): Bumped to Version 13.49.3
## [13.49.3](https://github.com/frappe/erpnext/compare/v13.49.2...v13.49.3) (2023-03-07)

### Performance Improvements

* `update_completed_qty()` in `material_request.py` ([6841e22](6841e22ffe))
* Stock Entry (Material Transfer) ([56a422d](56a422deed))
2023-03-07 17:01:01 +00:00
Sagar Sharma
c575942acf Merge pull request #34341 from frappe/mergify/bp/version-13/pr-34336
perf: Stock Entry (Material Transfer) (backport #34313) (backport #34336)
2023-03-07 22:29:01 +05:30
s-aga-r
6841e22ffe perf: update_completed_qty() in material_request.py
(cherry picked from commit 8ad9e99cea)
(cherry picked from commit 5bc2b8f685)
2023-03-07 16:07:23 +00:00
s-aga-r
56a422deed perf: Stock Entry (Material Transfer)
(cherry picked from commit de18f98c5c)
(cherry picked from commit 7a159a7187)
2023-03-07 16:07:22 +00:00
Sagar Sharma
99b201d5d7 Merge pull request #34336 from frappe/mergify/bp/version-13-hotfix/pr-34313
perf: Stock Entry (Material Transfer) (backport #34313)
2023-03-07 21:34:09 +05:30
s-aga-r
5bc2b8f685 perf: update_completed_qty() in material_request.py
(cherry picked from commit 8ad9e99cea)
2023-03-07 12:33:46 +00:00
s-aga-r
7a159a7187 perf: Stock Entry (Material Transfer)
(cherry picked from commit de18f98c5c)
2023-03-07 12:33:46 +00:00
Frappe PR Bot
0ec34e5880 chore(release): Bumped to Version 13.49.2
## [13.49.2](https://github.com/frappe/erpnext/compare/v13.49.1...v13.49.2) (2023-03-07)

### Bug Fixes

* `rejected_serial_no` not getting copied from PR to PR(Return) ([bb55210](bb55210f49))
* `Serial No is mandatory` even if the `qty` is `0` ([9bea2fc](9bea2fcdfc))
* Default sales team not getting set ([#34284](https://github.com/frappe/erpnext/issues/34284)) ([65c0189](65c0189c4d))
* **minor:** Dirty the form after clicking on Get advances button in Invoices ([#34323](https://github.com/frappe/erpnext/issues/34323)) ([3a1475a](3a1475a90b))
* **test:** check for batch_no in returned dict ([8c5322c](8c5322c1cb))
* UI freeze while selecting batched items in sales invoice ([82a8f2b](82a8f2b1b2))
* Wrap unexpectedly long text in remark ([ba66a67](ba66a6714c))
2023-03-07 10:43:39 +00:00
Deepesh Garg
ba58c7ed59 Merge pull request #34326 from frappe/version-13-hotfix
chore: release v13
2023-03-07 16:11:57 +05:30
mergify[bot]
3a1475a90b fix(minor): Dirty the form after clicking on Get advances button in Invoices (#34323)
fix(minor): Dirty the form after clicking on Get advances button in Invoices (#34323)

fix(minor): Dirty form after clicking on Get advances button

(cherry picked from commit 2feb27e399)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2023-03-07 15:47:37 +05:30
mergify[bot]
65c0189c4d fix: Default sales team not getting set (#34284)
fix: Default sales team not getting set (#34284)

(cherry picked from commit 7d0199d743)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-03-07 13:33:55 +05:30
mergify[bot]
1b2c4bf868 chore: add german translations (#34167)
* chore: add german translations (#34167)

* chore: add german translations

* Apply suggestions from code review

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

---------

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
(cherry picked from commit bbb6a62a7d)

# Conflicts:
#	erpnext/translations/de.csv

* chore: resolve conflicts

---------

Co-authored-by: Patrick Eissler <77415730+PatrickDenis-stack@users.noreply.github.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-03-07 11:46:30 +05:30
ruthra kumar
88ed6e6cb4 Merge pull request #34304 from ruthra-kumar/ui_freeze_on_item_selection
fix: UI freeze while selecting batched items in sales invoice
2023-03-06 11:24:01 +05:30
ruthra kumar
8c5322c1cb fix(test): check for batch_no in returned dict 2023-03-05 20:47:31 +05:30
ruthra kumar
82a8f2b1b2 fix: UI freeze while selecting batched items in sales invoice 2023-03-05 20:47:29 +05:30
Sagar Sharma
3908b510bd Merge pull request #34276 from frappe/mergify/bp/version-13-hotfix/pr-34273
fix: `rejected_serial_no` not getting copied from PR to PR(Return) (backport #34273)
2023-03-04 15:35:00 +05:30
s-aga-r
14547d94b3 chore: conflicts 2023-03-04 15:04:50 +05:30
s-aga-r
9bea2fcdfc fix: Serial No is mandatory even if the qty is 0
(cherry picked from commit cb0b6de4b9)
2023-03-02 07:08:14 +00:00
s-aga-r
bb55210f49 fix: rejected_serial_no not getting copied from PR to PR(Return)
(cherry picked from commit a9f0a11ce6)

# Conflicts:
#	erpnext/controllers/sales_and_purchase_return.py
2023-03-02 07:08:14 +00:00
Frappe PR Bot
178be42369 chore(release): Bumped to Version 13.49.1
## [13.49.1](https://github.com/frappe/erpnext/compare/v13.49.0...v13.49.1) (2023-03-01)

### Bug Fixes

* Wrap unexpectedly long text in remark ([e694550](e6945508f1))
2023-03-01 10:55:31 +00:00
Suraj Shetty
b4e775b264 Merge pull request #34264 from frappe/mergify/bp/version-13/pr-34262
fix(General Ledger): Wrap unexpectedly long word  (backport #34262)
2023-03-01 16:23:56 +05:30
Suraj Shetty
e6945508f1 fix: Wrap unexpectedly long text in remark
(cherry picked from commit ba66a6714c)
2023-03-01 10:53:42 +00:00
Suraj Shetty
5354169f31 Merge pull request #34262 from frappe/fix-general-ledger-report 2023-03-01 16:22:28 +05:30
Suraj Shetty
ba66a6714c fix: Wrap unexpectedly long text in remark 2023-03-01 16:16:58 +05:30
Frappe PR Bot
573cd3c33b chore(release): Bumped to Version 13.49.0
# [13.49.0](https://github.com/frappe/erpnext/compare/v13.48.1...v13.49.0) (2023-02-28)

### Bug Fixes

* conversion factor not set ([59d5797](59d579764d))
* german translations ([#31732](https://github.com/frappe/erpnext/issues/31732)) ([d44da6c](d44da6c820))
* ignore remaining leaves calculation for cf leaves after expiry ([d82ba4e](d82ba4e86f))
* incorrect acc depr amount if multiple FBs with straight line or manual method ([304e6bb](304e6bb996))
* incorrect color in the BOM Stock Report ([e98b346](e98b34617f))
* incorrect leave balance after carry-forwarded leave expiry ([a3a9cd5](a3a9cd5174))
* manual depr schedule ([7176799](71767994a7))
* multiple pos conversion issue resolved ([de631e6](de631e65cc))
* not able to repost gl entries ([2039bd0](2039bd066d))
* **patch:** create only 80G custom fields instead of running the whole setup ([#34183](https://github.com/frappe/erpnext/issues/34183)) ([806f7e5](806f7e5eef))
* permission error while calling get_work_order_items ([3d7b2b1](3d7b2b1a6d))
* pos return throwing amount greater than grand total ([f6607a6](f6607a6050))
* Remove missing DocField in fetch_from ([45645c1](45645c1064))
* set `from_warehouse` and `to_warehouse` while mapping SE ([b1ecca3](b1ecca3a16))
* **test:** use standalone method to fetch work orders from SO ([7971c14](7971c149ed))
* ui freeze on item selection in sales invoice ([d1b611d](d1b611d37f))
* user shouldn't able to make item price for item template ([69f1247](69f1247fab))
* zero division error while making LCV ([91a95ad](91a95adcb6))

### Features

* provision to convert transaction based reposting to item warehouse based reposting ([59c6eb5](59c6eb591b))

### Performance Improvements

* fetch SLE's on demand and memoize ([642692a](642692a040))
2023-02-28 13:29:25 +00:00
ruthra kumar
b6edadb3cb Merge pull request #34239 from frappe/version-13-hotfix
chore: release v13
2023-02-28 18:57:46 +05:30
ruthra kumar
d65df443fc Merge pull request #34246 from frappe/mergify/bp/version-13-hotfix/pr-34241
fix: pos return throwing amount greater than grand total (backport #34241)
2023-02-28 18:33:47 +05:30
ruthra kumar
f6607a6050 fix: pos return throwing amount greater than grand total
(cherry picked from commit 35c70f39fa)
2023-02-28 12:53:30 +00:00
Sagar Sharma
75d98ef205 Merge pull request #34237 from frappe/mergify/bp/version-13-hotfix/pr-34060
fix: multiple Point of Sale conversion issue resolved (backport #34060)
2023-02-28 16:49:46 +05:30
Vishal
fd1d2cd203 chore: minor changes in pos_controller
(cherry picked from commit f18ae5856f)
2023-02-28 09:26:37 +00:00
Vishal
c66dc5658f chore: minor change
(cherry picked from commit a51bec0269)
2023-02-28 09:26:36 +00:00
Vishal
1ebf2dd2bf chore: minor changes added to code
(cherry picked from commit 3ebe7d861d)
2023-02-28 09:26:36 +00:00
Vishal
de631e65cc fix: multiple pos conversion issue resolved
(cherry picked from commit 1de531e56e)
2023-02-28 09:26:36 +00:00
ruthra kumar
02f2844db2 Merge pull request #34218 from frappe/mergify/bp/version-13-hotfix/pr-34207
fix: permission error while calling get_work_order_items (backport #34207)
2023-02-28 11:04:52 +05:30
Frappe PR Bot
c4d9576f9f chore(release): Bumped to Version 13.48.1
## [13.48.1](https://github.com/frappe/erpnext/compare/v13.48.0...v13.48.1) (2023-02-27)

### Bug Fixes

* not able to repost gl entries ([a34aff6](a34aff6f49))
2023-02-27 14:34:43 +00:00
rohitwaghchaure
74303b65cf Merge pull request #34228 from frappe/mergify/bp/version-13/pr-34209
fix: not able to repost gl entries (backport #34206) (backport #34209)
2023-02-27 20:03:15 +05:30
Rohit Waghchaure
a34aff6f49 fix: not able to repost gl entries
(cherry picked from commit 7d10dd9ea8)
(cherry picked from commit 2039bd066d)
2023-02-27 14:08:29 +00:00
Sagar Sharma
f105c1bd5e Merge pull request #34227 from frappe/mergify/bp/version-13-hotfix/pr-34225
fix: set `from_warehouse` and `to_warehouse` while mapping SE (backport #34225)
2023-02-27 17:56:08 +05:30
Sagar Sharma
264c314416 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-34225 2023-02-27 17:32:34 +05:30
Sagar Sharma
a71a336e59 chore: conflicts 2023-02-27 17:32:05 +05:30
Anand Baburajan
7db3645298 Merge pull request #34215 from frappe/mergify/bp/version-13-hotfix/pr-34205
fix: asset manual depr schedule (backport #34205)
2023-02-27 13:31:44 +05:30
s-aga-r
b1ecca3a16 fix: set from_warehouse and to_warehouse while mapping SE
(cherry picked from commit c09a61f360)

# Conflicts:
#	erpnext/stock/doctype/material_request/material_request.py
2023-02-27 07:23:20 +00:00
Anand Baburajan
cbfa188d3d Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-34205 2023-02-27 12:41:45 +05:30
Sagar Sharma
4f7344c278 Merge pull request #34224 from frappe/mergify/bp/version-13-hotfix/pr-34212
fix: Remove missing DocField in fetch_from (backport #34212)
2023-02-27 12:28:55 +05:30
Brian Pond
45645c1064 fix: Remove missing DocField in fetch_from
(cherry picked from commit 83f3e317e1)
2023-02-27 06:24:23 +00:00
mergify[bot]
d44da6c820 fix: german translations (#31732)
fix: german translations (#31732)

(cherry picked from commit 6b510546ae)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-02-27 11:50:12 +05:30
Sagar Sharma
95ea28f14d Merge pull request #34209 from frappe/mergify/bp/version-13-hotfix/pr-34206
fix: not able to repost gl entries (backport #34206)
2023-02-27 10:26:38 +05:30
ruthra kumar
7971c149ed fix(test): use standalone method to fetch work orders from SO
(cherry picked from commit a11d3327df)
2023-02-27 10:14:36 +05:30
ruthra kumar
3d7b2b1a6d fix: permission error while calling get_work_order_items
(cherry picked from commit b6bad728cd)
2023-02-27 10:14:31 +05:30
anandbaburajan
9942a9d40a chore: refactor long if conditions
(cherry picked from commit d56ca011fe)
2023-02-26 14:38:43 +00:00
anandbaburajan
9a607b9bd0 chore: should prepare schedule if not draft
(cherry picked from commit 75386e3653)
2023-02-26 14:38:42 +00:00
anandbaburajan
304e6bb996 fix: incorrect acc depr amount if multiple FBs with straight line or manual method
(cherry picked from commit dda6baea3e)
2023-02-26 14:38:42 +00:00
anandbaburajan
4a557b47d7 chore: handle change in opening_accumulated_depreciation properly
(cherry picked from commit b0d670a51d)
2023-02-26 14:38:42 +00:00
anandbaburajan
71767994a7 fix: manual depr schedule
(cherry picked from commit 971c0720e5)
2023-02-26 14:38:41 +00:00
Rohit Waghchaure
2039bd066d fix: not able to repost gl entries
(cherry picked from commit 7d10dd9ea8)
2023-02-24 15:41:22 +00:00
rohitwaghchaure
b599b93ae8 Merge pull request #34201 from frappe/mergify/bp/version-13-hotfix/pr-34199
fix: conversion factor not set (backport #34199)
2023-02-24 17:52:40 +05:30
Rohit Waghchaure
59d579764d fix: conversion factor not set
(cherry picked from commit 8e46aebc50)
2023-02-24 09:28:37 +00:00
Frappe PR Bot
5f25cea322 chore(release): Bumped to Version 13.48.0
# [13.48.0](https://github.com/frappe/erpnext/compare/v13.47.0...v13.48.0) (2023-02-24)

### Bug Fixes

* incorrect color in the BOM Stock Report ([0490e3b](0490e3bfe6))

### Features

* provision to convert transaction based reposting to item warehouse based reposting ([c8ec365](c8ec365594))
2023-02-24 09:08:54 +00:00
rohitwaghchaure
6a0c24e7b3 Merge pull request #34196 from frappe/mergify/bp/version-13/pr-34178
fix: incorrect color in the BOM Stock Report (backport #34173) (backport #34178)
2023-02-24 14:37:28 +05:30
rohitwaghchaure
8eb6053c97 Merge pull request #34198 from frappe/mergify/bp/version-13/pr-34197
feat: provision to convert transaction based reposting to item wareho… (backport #34115) (backport #34197)
2023-02-24 14:37:14 +05:30
Rohit Waghchaure
c8ec365594 feat: provision to convert transaction based reposting to item warehouse based reposting
(cherry picked from commit f1383b5ef9)
(cherry picked from commit 59c6eb591b)
2023-02-24 06:27:41 +00:00
rohitwaghchaure
0fbd29b16d Merge pull request #34197 from frappe/mergify/bp/version-13-hotfix/pr-34115
feat: provision to convert transaction based reposting to item wareho… (backport #34115)
2023-02-24 11:54:56 +05:30
Rucha Mahabal
806f7e5eef fix(patch): create only 80G custom fields instead of running the whole setup (#34183) 2023-02-24 11:32:46 +05:30
Rohit Waghchaure
59c6eb591b feat: provision to convert transaction based reposting to item warehouse based reposting
(cherry picked from commit f1383b5ef9)
2023-02-24 05:51:56 +00:00
Rohit Waghchaure
0490e3bfe6 fix: incorrect color in the BOM Stock Report
(cherry picked from commit a8f03ebf7f)
(cherry picked from commit e98b34617f)
2023-02-24 05:40:48 +00:00
rohitwaghchaure
0aeef34944 Merge pull request #34191 from frappe/mergify/bp/version-13-hotfix/pr-34189
fix: user shouldn't able to make item price for item template (backport #34189)
2023-02-24 09:23:41 +05:30
Rohit Waghchaure
69f1247fab fix: user shouldn't able to make item price for item template
(cherry picked from commit 6417ae0ee8)
2023-02-23 15:18:42 +00:00
rohitwaghchaure
2d01b72b04 Merge pull request #34178 from frappe/mergify/bp/version-13-hotfix/pr-34173
fix: incorrect color in the BOM Stock Report (backport #34173)
2023-02-23 20:47:07 +05:30
ruthra kumar
bb4c968d95 Merge pull request #34185 from frappe/mergify/bp/version-13-hotfix/pr-34022
perf: Gross Profit report will fetch SLE's on demand and memoize (backport #34022)
2023-02-23 12:54:47 +05:30
ruthra kumar
c40aa580c5 refactor: use docstatus from Delivery Note Item
(cherry picked from commit 88d888d9d0)
2023-02-23 06:26:15 +00:00
ruthra kumar
642692a040 perf: fetch SLE's on demand and memoize
(cherry picked from commit 3e5691072a)
2023-02-23 06:26:15 +00:00
rohitwaghchaure
fd24d52d86 Merge pull request #34182 from frappe/mergify/bp/version-13-hotfix/pr-34172
fix: zero division error while making LCV (backport #34172)
2023-02-23 11:25:24 +05:30
Rohit Waghchaure
91a95adcb6 fix: zero division error while making LCV
(cherry picked from commit 80e94a08cf)
2023-02-23 05:24:56 +00:00
ruthra kumar
fe04b5a2b9 Merge pull request #34179 from frappe/mergify/bp/version-13-hotfix/pr-34176
fix: ui freeze upon item selection in sales invoice (backport #34176)
2023-02-23 10:52:12 +05:30
ruthra kumar
d1b611d37f fix: ui freeze on item selection in sales invoice
(cherry picked from commit 6412583e98)
2023-02-23 05:06:50 +00:00
Rohit Waghchaure
e98b34617f fix: incorrect color in the BOM Stock Report
(cherry picked from commit a8f03ebf7f)
2023-02-23 04:25:45 +00:00
Rucha Mahabal
6391ccd56a Merge pull request #34175 from ruchamahabal/fix-leave-balances 2023-02-22 20:17:13 +05:30
Rucha Mahabal
b848b77815 test: leave details with expired cf leaves 2023-02-22 19:46:08 +05:30
Rucha Mahabal
d82ba4e86f fix: ignore remaining leaves calculation for cf leaves after expiry
- calculate correct cf expiry in the entire allocation period
2023-02-22 19:44:23 +05:30
Rucha Mahabal
aea9d82672 test: leaves allocated before and after cf leave expiry is same 2023-02-22 19:44:06 +05:30
Rucha Mahabal
a3a9cd5174 fix: incorrect leave balance after carry-forwarded leave expiry 2023-02-22 19:43:56 +05:30
Frappe PR Bot
9766827a08 chore(release): Bumped to Version 13.47.0
# [13.47.0](https://github.com/frappe/erpnext/compare/v13.46.1...v13.47.0) (2023-02-21)

### Bug Fixes

* add missing import ([8add12d](8add12d568))
* Amount for debit and credit notes with 0 qty line items (backport [#33902](https://github.com/frappe/erpnext/issues/33902)) ([#34123](https://github.com/frappe/erpnext/issues/34123)) ([2408966](2408966090))
* asset repair status after deletion and asset status after manual depr entry ([922b30a](922b30a566))
* asset_depreciation_and_balances report doesn't reflect manual depr entries ([6227c16](6227c16374))
* check for duplicate in pos closing and pos merge log entry ([92da1ed](92da1ed3c2))
* don't get chart data if data is empty ([acdf7fd](acdf7fd8df))
* **ecommerce:** throw invalid doctype error in shop by category ([#33901](https://github.com/frappe/erpnext/issues/33901)) ([de87786](de87786db4))
* Filters in item-wise sales history report ([#34145](https://github.com/frappe/erpnext/issues/34145)) ([9826245](9826245d8a))
* fiscal year error for existing assets in fixed asset register ([1fb3a28](1fb3a28128))
* opening_accumulated_depreciation and precision in charts ([4f10f48](4f10f48f7c))
* should never get cutomer price on purchase document ([#34002](https://github.com/frappe/erpnext/issues/34002)) ([117dbe3](117dbe38c4)), closes [#33998](https://github.com/frappe/erpnext/issues/33998)
* update `reserved_qty` when `Sales Order` marked as `Hold` ([2391c37](2391c37238))
* Use normal rounding for Tax Withholding Category ([#34114](https://github.com/frappe/erpnext/issues/34114)) ([26ed460](26ed460a4f))
* **ux:** `ReferenceError: me is not defined` Delivery Note ([495d1b2](495d1b2548))

### Features

* **UX:** Add option to disable consolidating leave types in balance reports ([ccd2568](ccd25684f9))
2023-02-21 17:21:05 +00:00
Deepesh Garg
eeaa8b2479 Merge pull request #34160 from frappe/version-13-hotfix
chore: release v13
2023-02-21 22:49:22 +05:30
ruthra kumar
c7093b6e96 Merge pull request #34165 from frappe/mergify/bp/version-13-hotfix/pr-34102
fix: check for duplicate pos invoices in closing entry (backport #34102)
2023-02-21 20:04:02 +05:30
ruthra kumar
92da1ed3c2 fix: check for duplicate in pos closing and pos merge log entry
(cherry picked from commit 47add0b751)
2023-02-21 13:16:32 +00:00
mergify[bot]
9826245d8a fix: Filters in item-wise sales history report (#34145)
fix: Filters in item-wise sales history report (#34145)

(cherry picked from commit c88444a6c4)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-21 15:06:21 +05:30
mergify[bot]
26ed460a4f fix: Use normal rounding for Tax Withholding Category (#34114)
fix: Use normal rounding for Tax Withholding Category (#34114)

(cherry picked from commit 35cdd996a9)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-21 14:23:16 +05:30
Anand Baburajan
7bed6cddc7 Merge pull request #34156 from frappe/mergify/bp/version-13-hotfix/pr-34153
fix: fiscal year error for existing assets in fixed asset register (backport #34153)
2023-02-21 14:19:45 +05:30
anandbaburajan
1fb3a28128 fix: fiscal year error for existing assets in fixed asset register
(cherry picked from commit 76861eb332)
2023-02-21 08:25:47 +00:00
Rucha Mahabal
c49c621e43 Merge pull request #34150 from ruchamahabal/consolidate-balance-entries 2023-02-21 13:01:32 +05:30
Rucha Mahabal
8add12d568 fix: add missing import 2023-02-21 12:33:47 +05:30
Rucha Mahabal
acdf7fd8df fix: don't get chart data if data is empty 2023-02-21 12:30:52 +05:30
Rucha Mahabal
ccd25684f9 feat(UX): Add option to disable consolidating leave types in balance reports 2023-02-21 12:30:24 +05:30
Sagar Sharma
e34f5c9cf7 Merge pull request #34147 from frappe/mergify/bp/version-13-hotfix/pr-34138
fix(ux): `ReferenceError: me is not defined` Delivery Note (backport #34138)
2023-02-21 10:31:27 +05:30
s-aga-r
bdefd700af chore: Linters
(cherry picked from commit 44ee9f0f19)
2023-02-21 04:57:40 +00:00
s-aga-r
495d1b2548 fix(ux): ReferenceError: me is not defined Delivery Note
(cherry picked from commit 1b010add26)
2023-02-21 04:57:40 +00:00
mergify[bot]
2408966090 fix: Amount for debit and credit notes with 0 qty line items (backport #33902) (#34123)
fix: Amount for debit and credit notes with 0 qty line items (#33902)

(cherry picked from commit 47c91324b1)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-19 11:37:44 +05:30
Anand Baburajan
58a006ff64 Merge pull request #34113 from frappe/mergify/bp/version-13-hotfix/pr-34112
fix: repair status after deletion, asset status after manual depr entry and other misc bugs [v14] (backport #34112)
2023-02-17 16:52:28 +05:30
anandbaburajan
3585b90ce5 chore: fixing conflict 2023-02-17 16:29:09 +05:30
anandbaburajan
922b30a566 fix: asset repair status after deletion and asset status after manual depr entry
(cherry picked from commit 03f07a20e7)

# Conflicts:
#	erpnext/assets/doctype/asset/asset.py
2023-02-17 10:44:04 +00:00
Deepesh Garg
5fc68a3dfe Merge pull request #34017 from frappe/mergify/bp/version-13-hotfix/pr-33901
fix(ecommerce): throw invalid doctype error in shop by category (backport #33901)
2023-02-15 16:59:18 +05:30
Frappe PR Bot
4a95c9d642 chore(release): Bumped to Version 13.46.1
## [13.46.1](https://github.com/frappe/erpnext/compare/v13.46.0...v13.46.1) (2023-02-15)

### Bug Fixes

* asset_depreciation_and_balances report doesn't reflect manual depr entries ([62dc68b](62dc68bb57))
* opening_accumulated_depreciation and precision in charts ([6308fca](6308fca587))
2023-02-15 10:33:52 +00:00
Anand Baburajan
f6707b2b92 Merge pull request #34075 from frappe/mergify/bp/version-13/pr-34073
fix: manual depr entries in asset_depreciations_and_balances report and some misc bugs [v14] (backport #34058) (backport #34073)
2023-02-15 16:02:25 +05:30
Sagar Sharma
f6d8adc921 Merge pull request #34068 from frappe/mergify/bp/version-13-hotfix/pr-34002
fix: should never get cutomer price on purchase document (backport #34002)
2023-02-15 16:01:17 +05:30
Sagar Sharma
48f2bd9add Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-34002 2023-02-15 15:22:02 +05:30
anandbaburajan
62dc68bb57 fix: asset_depreciation_and_balances report doesn't reflect manual depr entries
(cherry picked from commit 1535c3d856)
(cherry picked from commit 6227c16374)
2023-02-15 08:36:50 +00:00
anandbaburajan
f80fb97c71 chore: break look if je processed
(cherry picked from commit a220dc0c9c)
(cherry picked from commit ff2e617c0c)
2023-02-15 08:36:50 +00:00
anandbaburajan
6308fca587 fix: opening_accumulated_depreciation and precision in charts
(cherry picked from commit 47cc8ab6c6)
(cherry picked from commit 4f10f48f7c)
2023-02-15 08:36:50 +00:00
Anand Baburajan
fb3a411d1f Merge pull request #34073 from frappe/mergify/bp/version-13-hotfix/pr-34058
fix: manual depr entries in asset_depreciations_and_balances report and some misc bugs [v14] (backport #34058)
2023-02-15 13:43:36 +05:30
anandbaburajan
6227c16374 fix: asset_depreciation_and_balances report doesn't reflect manual depr entries
(cherry picked from commit 1535c3d856)
2023-02-15 07:04:18 +00:00
anandbaburajan
ff2e617c0c chore: break look if je processed
(cherry picked from commit a220dc0c9c)
2023-02-15 07:04:18 +00:00
anandbaburajan
4f10f48f7c fix: opening_accumulated_depreciation and precision in charts
(cherry picked from commit 47cc8ab6c6)
2023-02-15 07:04:17 +00:00
Anand Baburajan
612ceb59c7 Merge pull request #34063 from frappe/mergify/bp/version-13-hotfix/pr-34059
chore: add anand to asset's codeowner (backport #34059)
2023-02-15 11:44:41 +05:30
HENRY Florian
117dbe38c4 fix: should never get cutomer price on purchase document (#34002)
* fix: never get cutomer price on purchase document

chores: syntax

chore: typo in stock_entry get_uom_details (#33998)

fix: typo in stock_entry get_uom_details

chores: syntax

* feat: add test for get_item_detail price list oriented

* feat: add test for get_item_detail price price oriented

* feat: add test for get_item_detail price price oriented

* chore: clean test code

(cherry picked from commit 231fe4156f)
2023-02-15 02:38:50 +00:00
Anand Baburajan
1223e31e7d Update CODEOWNERS 2023-02-14 20:33:40 +05:30
anandbaburajan
bc59ea0d55 chore: add anand to asset's codeowner
(cherry picked from commit d003370f61)

# Conflicts:
#	CODEOWNERS
2023-02-14 14:22:03 +00:00
Sabu Siyad
6ae1cc020a resolve conflicts 2023-02-14 19:34:39 +05:30
Sabu Siyad
4278bfe7b3 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-33901 2023-02-14 19:05:14 +05:30
Sagar Sharma
574791f2c9 Merge pull request #34056 from frappe/mergify/bp/version-13-hotfix/pr-34018
fix: update `reserved_qty` when `Sales Order` marked as `Hold` (backport #34018)
2023-02-14 17:40:40 +05:30
s-aga-r
2391c37238 fix: update reserved_qty when Sales Order marked as Hold
(cherry picked from commit d76759e066)
2023-02-14 11:23:16 +00:00
Frappe PR Bot
ab71a7bba8 chore(release): Bumped to Version 13.46.0
# [13.46.0](https://github.com/frappe/erpnext/compare/v13.45.1...v13.46.0) (2023-02-14)

### Bug Fixes

* `amount` in `Material Request` ([813e8bb](813e8bb664))
* allow PI cancel if linked asset is cancelled ([fbeaabf](fbeaabffc9))
* conflicts ([a9f5be3](a9f5be3f98))
* currency formatting in item-wise sales history ([#33903](https://github.com/frappe/erpnext/issues/33903)) ([f641039](f6410393ce))
* Debit and Credit not equal while submitting PI containing asset item ([#33092](https://github.com/frappe/erpnext/issues/33092)) ([5be4c6f](5be4c6ffbc))
* german chart of accounts "SKR03" ([#33909](https://github.com/frappe/erpnext/issues/33909)) ([b2a3e01](b2a3e014e9))
* incorrect actual qty in Bin ([8f42833](8f42833fba))
* LWP calculation ([c1de4e4](c1de4e4420))
* negative stock error ([2f4ffe1](2f4ffe137e))
* stock entry from item dashboard (stock levels) ([8106c64](8106c64c91))
* **UX:** make Item attachments public by default (backport [#32196](https://github.com/frappe/erpnext/issues/32196)) ([#33949](https://github.com/frappe/erpnext/issues/33949)) ([124d7de](124d7dea1b))
* validate working day list against holidays ([a8ea3ef](a8ea3efae2))

### Features

* Setting to allow Sales Order creation against expired quotation ([#33952](https://github.com/frappe/erpnext/issues/33952)) ([f04542e](f04542eac9))
2023-02-14 10:40:00 +00:00
Deepesh Garg
958a3320e8 Merge pull request #34052 from frappe/version-13-hotfix
chore: release v13
2023-02-14 16:07:17 +05:30
Saurabh
60d2bf939b Merge pull request #34041 from saurabh6790/fix-lwp-calculations
fix: LWP calculation
2023-02-14 15:26:01 +05:30
Saurabh
a8ea3efae2 fix: validate working day list against holidays 2023-02-14 13:14:58 +05:30
Saurabh
c1de4e4420 fix: LWP calculation 2023-02-14 10:52:10 +05:30
mergify[bot]
f04542eac9 feat: Setting to allow Sales Order creation against expired quotation (#33952)
* feat: Setting to allow Sales Order creation against expired quotation (#33952)

* feat: Setting to allow Sales Order creation against expired quotation

* chore: linting issues

(cherry picked from commit 148703bfc2)

# Conflicts:
#	erpnext/selling/doctype/selling_settings/selling_settings.json

* chore: Resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-13 11:39:30 +05:30
Sabu Siyad
de87786db4 fix(ecommerce): throw invalid doctype error in shop by category (#33901)
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 0df28c7174)

# Conflicts:
#	erpnext/www/shop-by-category/index.py
2023-02-12 06:58:27 +00:00
mergify[bot]
f6410393ce fix: currency formatting in item-wise sales history (#33903)
fix: currency formatting in item-wise sales history (#33903)

* fix(item-sales-history): currency formatting

* chore: linting issues

* fix: convert raw sql to qb

(cherry picked from commit 2cc7239dd5)

Co-authored-by: Dany Robert <danyrt@wahni.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-11 11:10:58 +05:30
mergify[bot]
5be4c6ffbc fix: Debit and Credit not equal while submitting PI containing asset item (#33092)
fix: Debit and Credit not equal while submitting PI containing asset item

(cherry picked from commit dc8d635120)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-02-11 09:02:06 +05:30
mergify[bot]
124d7dea1b fix(UX): make Item attachments public by default (backport #32196) (#33949)
* fix(UX): make Item attachments public by default (#32196)

(cherry picked from commit fffc245922)

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

* chore: conflicts

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-02-10 21:39:33 +05:30
mergify[bot]
bbcdd1e2e2 chore: typo in stock_entry get_uom_details (backport #33998) (#34004)
chore: typo in stock_entry get_uom_details (#33998)

fix: typo in stock_entry get_uom_details
(cherry picked from commit 185c543b73)

Co-authored-by: Akshay <60477442+akshayitzme@users.noreply.github.com>
2023-02-10 20:55:52 +05:30
Anand Baburajan
b6bc29ac92 Merge pull request #33963 from frappe/mergify/bp/version-13-hotfix/pr-33946
fix: allow cancelling purchase invoice if linked asset is already cancelled (backport #33946)
2023-02-10 14:15:44 +05:30
Anand Baburajan
e9a453c430 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-33946 2023-02-08 23:23:31 +05:30
rohitwaghchaure
7e1d5e3595 Merge pull request #33956 from frappe/mergify/bp/version-13-hotfix/pr-33936
fix: negative stock error (backport #33936)
2023-02-07 19:13:35 +05:30
rohitwaghchaure
a9f5be3f98 fix: conflicts 2023-02-07 13:46:40 +05:30
anandbaburajan
d6b0e622ea chore: use continue, not break
(cherry picked from commit 3380dc5dea)
2023-02-05 10:38:00 +00:00
anandbaburajan
fbeaabffc9 fix: allow PI cancel if linked asset is cancelled
(cherry picked from commit b961321de5)
2023-02-05 10:38:00 +00:00
Sagar Sharma
c7c611d929 Merge pull request #33959 from frappe/mergify/bp/version-13-hotfix/pr-33942
fix: stock entry from item dashboard (stock levels) (backport #33942)
2023-02-05 10:06:14 +05:30
s-aga-r
8106c64c91 fix: stock entry from item dashboard (stock levels)
(cherry picked from commit dc0ddf8d7e)
2023-02-05 04:17:35 +00:00
Rohit Waghchaure
bd1191783b test: test case
(cherry picked from commit 9ae7578b07)
2023-02-04 18:06:07 +00:00
Rohit Waghchaure
2f4ffe137e fix: negative stock error
(cherry picked from commit 6d513e2519)

# Conflicts:
#	erpnext/stock/stock_ledger.py
2023-02-04 18:06:07 +00:00
Sagar Sharma
6735b09dd9 Merge pull request #33951 from frappe/mergify/bp/version-13-hotfix/pr-33940
chore: report `Warehouse wise Item Balance Age and Value` (backport #33940)
2023-02-04 18:58:46 +05:30
s-aga-r
745bef8ebc chore: conflicts 2023-02-04 13:51:17 +05:30
s-aga-r
5a9673ae1f chore: add Item Name column in Warehouse wise Item Balance Age and Value report
(cherry picked from commit 56356ffbb9)
2023-02-04 07:59:04 +00:00
s-aga-r
8d0b45b835 chore: column width in Warehouse wise Item Balance Age and Value report
(cherry picked from commit d7a665cb84)

# Conflicts:
#	erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py
2023-02-04 07:59:04 +00:00
Frappe PR Bot
6a9660de65 chore(release): Bumped to Version 13.45.1
## [13.45.1](https://github.com/frappe/erpnext/compare/v13.45.0...v13.45.1) (2023-02-01)

### Bug Fixes

* incorrect actual qty in Bin ([e3ad0b1](e3ad0b1655))
2023-02-01 17:46:11 +00:00
rohitwaghchaure
edbbb2469f Merge pull request #33928 from frappe/mergify/bp/version-13/pr-33922
fix: incorrect actual qty in Bin (backport #33918) (backport #33922)
2023-02-01 23:14:23 +05:30
Rohit Waghchaure
e3ad0b1655 fix: incorrect actual qty in Bin
(cherry picked from commit f8c852c54c)
(cherry picked from commit 8f42833fba)
2023-02-01 16:51:50 +00:00
rohitwaghchaure
7738ca1ce0 Merge pull request #33922 from frappe/mergify/bp/version-13-hotfix/pr-33918
fix: incorrect actual qty in Bin (backport #33918)
2023-02-01 22:20:31 +05:30
Rohit Waghchaure
8f42833fba fix: incorrect actual qty in Bin
(cherry picked from commit f8c852c54c)
2023-02-01 12:54:28 +00:00
mergify[bot]
b2a3e014e9 fix: german chart of accounts "SKR03" (#33909)
fix: german chart of accounts "SKR03" (#33909)

* fix: german chart of accounts "SKR03"

- Added some missing account types and tax rates
- Added some missing accounts

* style: convert indentation to tabs

* fix: space before percentage sign

* feat: add some expense accounts

* refactor: replace unicode characters with utf-8

for better readability

* revert: add back groups for Bank and Cash accounts

Removed in 7d0d9c6900

(cherry picked from commit 3c7b460fd8)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-02-01 14:17:59 +05:30
Sagar Sharma
64018c29f3 Merge pull request #33898 from frappe/mergify/bp/version-13-hotfix/pr-33869
fix: `amount` in `Material Request` (backport #33869)
2023-01-31 16:01:49 +05:30
s-aga-r
813e8bb664 fix: amount in Material Request
(cherry picked from commit 6b781d78e0)
2023-01-31 09:15:48 +00:00
Frappe PR Bot
81e4be37ff chore(release): Bumped to Version 13.45.0
# [13.45.0](https://github.com/frappe/erpnext/compare/v13.44.0...v13.45.0) (2023-01-31)

### Bug Fixes

* disposal_was_made_on_original_schedule_date ([939a312](939a3121b7))
* enable customs in Selling Workpace by default ([#33853](https://github.com/frappe/erpnext/issues/33853)) ([54c1642](54c1642e3b))
* Fetch commission rate from sales partner ([#33851](https://github.com/frappe/erpnext/issues/33851)) ([3425a3b](3425a3bef9))
* **gp:** fetch buying amount from dn related to so ([be5edd3](be5edd329f))
* item rate not fetching ([bb56415](bb5641535b))
* manual depr entry not updating asset value [v13] ([#33890](https://github.com/frappe/erpnext/issues/33890)) ([f5efb20](f5efb2057c))
* use correct filter name in `item_query` (backport [#33814](https://github.com/frappe/erpnext/issues/33814)) ([#33817](https://github.com/frappe/erpnext/issues/33817)) ([b38ad66](b38ad66012))

### Features

* **gp:** test for inv and dn related via so ([b72a35a](b72a35a622))

### Performance Improvements

* show update items dialog ([0ff5099](0ff5099cbc))
* Timeout while doing payment reconciliation (v13) ([#33818](https://github.com/frappe/erpnext/issues/33818)) ([4bf3e31](4bf3e310e1))
2023-01-31 06:19:21 +00:00
Deepesh Garg
62edb118eb Merge pull request #33872 from frappe/version-13-hotfix
chore: release v13
2023-01-31 11:47:48 +05:30
Anand Baburajan
f5efb2057c fix: manual depr entry not updating asset value [v13] (#33890)
fix: asset value for manual depr entries
2023-01-31 11:00:06 +05:30
mergify[bot]
3425a3bef9 fix: Fetch commission rate from sales partner (#33851)
* fix: Fetch commission rate from sales partner (#33851)
2023-01-31 10:17:05 +05:30
Deepesh Garg
4bf3e310e1 perf: Timeout while doing payment reconciliation (v13) (#33818)
perf: Timeout while doing payment reconciliation
2023-01-31 09:37:45 +05:30
ruthra kumar
abb466e2fb Merge pull request #33876 from frappe/mergify/bp/version-13-hotfix/pr-33736
fix(gp): fetch buying amount from dn related to so (backport #33736)
2023-01-31 09:29:56 +05:30
HENRY Florian
54c1642e3b fix: enable customs in Selling Workpace by default (#33853)
* fix: enable customs in Selling Workpace by default

* fix: enable customs in Selling Workpace by default
2023-01-31 08:50:34 +05:30
mergify[bot]
b6839d8f51 ci: bump isort to 5.12.0 (backport #33875) (#33880)
ci: bump isort to 5.12.0 (#33875)

[skip ci]

(cherry picked from commit 2bad86d8d8)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-01-31 08:49:28 +05:30
Anand Baburajan
af3ad155e5 Merge pull request #33885 from AnandBaburajan/fix_disposal_was_made_on_original_schedule_date_v13
fix: disposal_was_made_on_original_schedule_date [v13]
2023-01-30 22:55:34 +05:30
anandbaburajan
939a3121b7 fix: disposal_was_made_on_original_schedule_date 2023-01-30 22:10:51 +05:30
Dany Robert
ac6186e16f chore: linting issues
(cherry picked from commit d69c839369)
2023-01-30 13:35:51 +00:00
Dany Robert
b72a35a622 feat(gp): test for inv and dn related via so
(cherry picked from commit 1f6ab86a65)
2023-01-30 13:35:50 +00:00
Dany Robert
0d8a4bf936 chore: linting issue
(cherry picked from commit ef90e24931)
2023-01-30 13:35:50 +00:00
Dany Robert
be5edd329f fix(gp): fetch buying amount from dn related to so
(cherry picked from commit e8e20da78e)
2023-01-30 13:35:50 +00:00
rohitwaghchaure
0902a5c440 Merge pull request #33847 from frappe/mergify/bp/version-13-hotfix/pr-33845
fix: item rate not fetching (backport #33845)
2023-01-28 22:41:06 +05:30
Rohit Waghchaure
bb5641535b fix: item rate not fetching
(cherry picked from commit 0d7f98b496)
2023-01-28 09:41:20 +00:00
Sagar Vora
fc7aac9d41 Merge pull request #33833 from frappe/mergify/bp/version-13-hotfix/pr-33831
perf: show update items dialog (backport #33831)
2023-01-27 04:19:30 +00:00
Devin Slauenwhite
0ff5099cbc perf: show update items dialog
(cherry picked from commit a835c1a418)
2023-01-27 04:18:50 +00:00
mergify[bot]
b38ad66012 fix: use correct filter name in item_query (backport #33814) (#33817)
fix: use correct filter name in `item_query` (#33814)

(cherry picked from commit da323cbb40)

Co-authored-by: Daizy Modi <modidaizy5217@gmail.com>
2023-01-25 17:38:03 +05:30
Frappe PR Bot
71395b9a8e chore(release): Bumped to Version 13.44.0
# [13.44.0](https://github.com/frappe/erpnext/compare/v13.43.2...v13.44.0) (2023-01-25)

### Bug Fixes

* accumulated_depreciation in reverse_depreciation_entry_made_after_disposal ([b7e9e4a](b7e9e4a7c5))
* backport of [#32226](https://github.com/frappe/erpnext/issues/32226) ([d6913ff](d6913fffe6))
* calculate correct amount for qty == 0 (backport [#33739](https://github.com/frappe/erpnext/issues/33739)) ([#33752](https://github.com/frappe/erpnext/issues/33752)) ([d650432](d6504320b1))
* conflicts ([d717ca0](d717ca0325))
* conflicts ([055f853](055f8536c3))
* don't add template item in sales/purchase transaction ([f81d4a7](f81d4a79ea))
* e-Invoicing for SEZ Customer(v13) ([#33796](https://github.com/frappe/erpnext/issues/33796)) ([1b11566](1b11566485))
* **ecommerce:** breadcrumb: fallback to `/all-products` ([#33718](https://github.com/frappe/erpnext/issues/33718)) ([2da543e](2da543ebd4))
* fb issue in asset chart ([ae031ce](ae031cea63))
* incorrect actual qty for the packed item ([09e13d2](09e13d279c))
* incorrect row order and accumulated_depreciation when schedule with multiple FBs is scrapped ([7174a2c](7174a2cd93))
* linter issue ([593d7f3](593d7f3dd6))
* linting ([13906cb](13906cba9a))
* **minor:** Label updates in Statement of Accounts ([#33639](https://github.com/frappe/erpnext/issues/33639)) ([47e500c](47e500c2eb))
* missing constant definition ([fc4be1b](fc4be1b337))
* patch item_reposting_for_incorrect_sl_and_gl ([1c5c067](1c5c06716b))
* rewrite logic for duplicate check in Item Attribute ([4741ce1](4741ce13c6))
* Short closed order, receipt and delivery note status on cancellation ([#33743](https://github.com/frappe/erpnext/issues/33743)) ([3daaa02](3daaa021eb))

### Features

* provision to select date type based on filter ([5ed6a74](5ed6a74fc4))
2023-01-25 04:00:37 +00:00
Deepesh Garg
d3aa37aece Merge pull request #33801 from frappe/version-13-hotfix
chore: release v13
2023-01-25 09:29:03 +05:30
Deepesh Garg
1b11566485 fix: e-Invoicing for SEZ Customer(v13) (#33796) 2023-01-25 08:57:52 +05:30
mergify[bot]
28f5d28201 ci: documentation helper (backport #33757) (#33799)
ci: documentation helper (#33757)

refactor: documentation helper
(cherry picked from commit d155042edd)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-01-24 16:47:13 +05:30
Anand Baburajan
421814e9b3 Merge pull request #33773 from AnandBaburajan/asset_bug_fixes_13
fix: backport #32226 and fix some asset bugs related to finance books [v13]
2023-01-23 21:09:05 +05:30
Anand Baburajan
814333b0cc Merge branch 'version-13-hotfix' into asset_bug_fixes_13 2023-01-23 14:22:46 +05:30
rohitwaghchaure
0862f670ee Merge pull request #33787 from frappe/mergify/bp/version-13-hotfix/pr-33684
feat: [minor] date type based on filter in Work Order Summary report (backport #33684)
2023-01-23 14:16:43 +05:30
rohitwaghchaure
593d7f3dd6 fix: linter issue 2023-01-23 13:22:24 +05:30
Rohit Waghchaure
5ed6a74fc4 feat: provision to select date type based on filter
(cherry picked from commit 20c8873208)
2023-01-23 07:44:08 +00:00
Anand Baburajan
76b6833b61 Merge branch 'version-13-hotfix' into asset_bug_fixes_13 2023-01-22 13:57:31 +05:30
anandbaburajan
b7e9e4a7c5 fix: accumulated_depreciation in reverse_depreciation_entry_made_after_disposal 2023-01-22 13:56:56 +05:30
Sagar Sharma
54b2f78a99 Merge pull request #33780 from frappe/mergify/bp/version-13-hotfix/pr-33778
fix: missing constant definition (backport #33778)
2023-01-21 22:32:59 +05:30
barredterra
fc4be1b337 fix: missing constant definition
(cherry picked from commit 547d37b1db)
2023-01-21 16:59:37 +00:00
Anand Baburajan
b9b110674e Merge branch 'version-13-hotfix' into asset_bug_fixes_13 2023-01-21 20:04:20 +05:30
anandbaburajan
7959e41a81 chore: fix circular import issue and rename date_of_sale to date_of_disposal 2023-01-21 19:58:26 +05:30
anandbaburajan
d6913fffe6 fix: backport of #32226 2023-01-21 19:29:39 +05:30
anandbaburajan
7174a2cd93 fix: incorrect row order and accumulated_depreciation when schedule with multiple FBs is scrapped 2023-01-21 18:41:19 +05:30
mergify[bot]
47e500c2eb fix(minor): Label updates in Statement of Accounts (#33639)
fix(minor): Label updates in Statement of Accounts (#33639)
2023-01-21 15:44:27 +05:30
mergify[bot]
4511d41329 Removed an unnecessary check in code which always evaluates to true (#33710)
fix: removed an unnecessary check which always evaluates to true
2023-01-21 12:03:33 +05:30
rohitwaghchaure
7243f71d7d Merge pull request #33762 from frappe/mergify/bp/version-13-hotfix/pr-33759
fix: incorrect actual qty for the packed item (backport #33759)
2023-01-21 09:46:59 +05:30
mergify[bot]
3daaa021eb fix: Short closed order, receipt and delivery note status on cancellation (#33743)
fix: Short closed order, receipt, and delivery note status on cancellation (#33743)
2023-01-20 23:41:14 +05:30
Rohit Waghchaure
09e13d279c fix: incorrect actual qty for the packed item
(cherry picked from commit 02566a02a8)
2023-01-20 18:10:16 +00:00
mergify[bot]
d6504320b1 fix: calculate correct amount for qty == 0 (backport #33739) (#33752)
fix: calculate correct amount for qty == 0 (#33739)

(cherry picked from commit 327b6fdb32)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-01-20 23:38:37 +05:30
Raffael Meyer
af3a0e56f6 chore: bump python version for docs-checker (#33756) 2023-01-20 22:52:33 +05:30
mergify[bot]
2da543ebd4 fix(ecommerce): breadcrumb: fallback to /all-products (#33718)
fix(ecommerce): breadcrumb: fallback to `/all-products` (#33718)

* fix(ecommerce): breadcrumb: fallback to `/all-products`

* fix(item_group): use `==` instead of `is`

* test(ecommerce): breadcrumb

(cherry picked from commit a94aa7a79f)

Co-authored-by: Sabu Siyad <hello@ssiyad.com>
2023-01-20 19:26:05 +05:30
anandbaburajan
ae031cea63 fix: fb issue in asset chart 2023-01-20 15:39:01 +05:30
rohitwaghchaure
6135d2972e Merge pull request #33742 from frappe/mergify/bp/version-13-hotfix/pr-33695
fix: patch item_reposting_for_incorrect_sl_and_gl (backport #33695)
2023-01-20 14:35:10 +05:30
rohitwaghchaure
d717ca0325 fix: conflicts 2023-01-20 14:05:14 +05:30
Rohit Waghchaure
1c5c06716b fix: patch item_reposting_for_incorrect_sl_and_gl
(cherry picked from commit dbde3a3421)

# Conflicts:
#	erpnext/patches.txt
2023-01-20 06:14:02 +00:00
rohitwaghchaure
61d06dd702 Merge pull request #33732 from frappe/mergify/bp/version-13-hotfix/pr-33723
fix: don't add template item in sales/purchase transaction (backport #33723)
2023-01-20 08:30:41 +05:30
Sagar Sharma
b702a02f61 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-33723 2023-01-19 22:04:05 +05:30
rohitwaghchaure
055f8536c3 fix: conflicts 2023-01-19 16:57:17 +05:30
Sagar Sharma
40ab5b034c Merge pull request #33734 from frappe/mergify/bp/version-13-hotfix/pr-33619
fix: rewrite logic for duplicate check in Item Attribute (backport #33619)
2023-01-19 15:29:17 +05:30
unknown
13906cba9a fix: linting
(cherry picked from commit 2ca4d3fb71)
2023-01-19 07:59:03 +00:00
unknown
4741ce13c6 fix: rewrite logic for duplicate check in Item Attribute
Previously, Item Attribute values were not checked for case-insensitive duplicates, and Item tttribute abbreviations were forced to be uppercase. This commit fixes both problems.

(cherry picked from commit 974e12c837)
2023-01-19 07:59:02 +00:00
Rohit Waghchaure
f81d4a79ea fix: don't add template item in sales/purchase transaction
(cherry picked from commit 2c83fff1a1)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/test_purchase_order.py
2023-01-19 07:13:29 +00:00
Frappe PR Bot
550daf2108 chore(release): Bumped to Version 13.43.2
## [13.43.2](https://github.com/frappe/erpnext/compare/v13.43.1...v13.43.2) (2023-01-17)

### Bug Fixes

* allow to create sales order from expired quotation ([#33582](https://github.com/frappe/erpnext/issues/33582)) ([2f81f15](2f81f15f02))
* asset value in fixed asset register ([#33608](https://github.com/frappe/erpnext/issues/33608)) ([42fe63d](42fe63da2c))
* better comparision of difference value between stock and account ([a450c8d](a450c8dce9))
* don't check other warehouse ledgers to calculate valuation rate ([66bf107](66bf1071bb))
* handle post depr entries fail and fix asset repair link ([5f7dc8a](5f7dc8a5b9))
* only group similar items in print format if group_same_items is checked in pick list (backport [#33627](https://github.com/frappe/erpnext/issues/33627)) ([#33631](https://github.com/frappe/erpnext/issues/33631)) ([7dcf0f0](7dcf0f0866))
* Return against internal purchase invoice ([#33635](https://github.com/frappe/erpnext/issues/33635)) ([eef0f45](eef0f453d2))
* Sales ORder Connections on Material Request ([97488ae](97488aee88))
* Updating SO throws ordered_qty not allowed to change after submission ([a46aa80](a46aa808be))

### Reverts

* Reverting changes done on 33495 ([#33662](https://github.com/frappe/erpnext/issues/33662)) ([0f0a2b1](0f0a2b100c))
2023-01-17 15:36:54 +00:00
Deepesh Garg
959eae1b5c Merge pull request #33702 from frappe/version-13-hotfix
chore: release v13
2023-01-17 21:05:24 +05:30
Anand Baburajan
f2d83b1b21 Merge pull request #33689 from AnandBaburajan/misc_asset_fixes_v13
fix: handle asset depr entries posting failure and fix asset repair link [v13]
2023-01-17 15:14:10 +05:30
Anand Baburajan
f1670e922f Merge branch 'version-13-hotfix' into misc_asset_fixes_v13 2023-01-17 11:21:29 +05:30
Ankush Menat
ec780ac263 chore: ignore b028 2023-01-17 10:59:03 +05:30
Sagar Sharma
847171bd14 Merge pull request #33693 from frappe/mergify/bp/version-13-hotfix/pr-33690
fix: Sales Order Connections Tabs do not show linked Material Request or "+" button  (intoduce by #33304) (backport #33690)
2023-01-17 10:08:17 +05:30
Florian HENRY
97488aee88 fix: Sales ORder Connections on Material Request
(cherry picked from commit e19161a8ee)
2023-01-17 04:37:12 +00:00
Anand Baburajan
2b3a0ba9c4 Merge branch 'version-13-hotfix' into misc_asset_fixes_v13 2023-01-17 00:44:05 +05:30
anandbaburajan
5f7dc8a5b9 fix: handle post depr entries fail and fix asset repair link 2023-01-17 00:39:35 +05:30
ruthra kumar
edc20ae8b8 Merge pull request #33672 from frappe/mergify/bp/version-13-hotfix/pr-33646
Revert "fix: Updating SO throws ordered_qty not allowed to change after submission" (backport #33646)
2023-01-16 15:28:33 +05:30
ruthra kumar
6ebc9c5c82 Merge pull request #33669 from frappe/mergify/bp/version-13-hotfix/pr-33662
revert: Reverting changes done on 33495 (backport #33662)
2023-01-16 14:25:55 +05:30
Sagar Sharma
5a4d92b1bc Merge pull request #33666 from frappe/mergify/bp/version-13-hotfix/pr-33664
chore: `Sales Order` link in `Pick List` (backport #33664)
2023-01-16 13:53:28 +05:30
Sagar Sharma
ff48c44496 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-33664 2023-01-16 10:30:13 +05:30
mergify[bot]
2f81f15f02 fix: allow to create sales order from expired quotation (#33582)
fix: allow to create sales order from expired quotation (#33582)

(cherry picked from commit dceef0397a)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
2023-01-16 10:02:41 +05:30
ruthra kumar
f1bb8933c1 Revert "fix: Updating SO throws ordered_qty not allowed to change after submission" (#33646)
(cherry picked from commit 333907b7a5)
2023-01-16 04:09:26 +00:00
ruthra kumar
0f0a2b100c revert: Reverting changes done on 33495 (#33662)
'ordered_qty' will not be fetched from `tabBin`

(cherry picked from commit be382054e5)
2023-01-16 04:03:32 +00:00
mergify[bot]
eef0f453d2 fix: Return against internal purchase invoice (#33635)
fix: Return against internal purchase invoice (#33635)

(cherry picked from commit 906ad10d16)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-16 08:48:52 +05:30
s-aga-r
e4af69bc93 chore: Sales Order link in Pick List
(cherry picked from commit b3759890d7)
2023-01-15 17:35:52 +00:00
mergify[bot]
42fe63da2c fix: asset value in fixed asset register (#33608)
fix: asset value in fixed asset register

(cherry picked from commit aa1f2a7297)

Co-authored-by: anandbaburajan <anandbaburajan@gmail.com>
2023-01-15 17:33:17 +05:30
ruthra kumar
e23d7aa968 Merge pull request #33629 from frappe/mergify/bp/version-13-hotfix/pr-33622
fix: Updating SO throws ordered_qty not allowed to change after submission (backport #33622)
2023-01-13 10:15:14 +05:30
ruthra kumar
a46aa808be fix: Updating SO throws ordered_qty not allowed to change after submission
(cherry picked from commit 391f42db04)
2023-01-13 08:22:50 +05:30
mergify[bot]
f3b6b4609e chore: reuse doc object in test_pick_list_grouping_before_print (backport #33636) (#33638)
chore: reuse doc object in test_pick_list_grouping_before_print (#33636)

(cherry picked from commit e22d56484d)

Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
2023-01-13 01:33:46 +05:30
mergify[bot]
7dcf0f0866 fix: only group similar items in print format if group_same_items is checked in pick list (backport #33627) (#33631)
fix: only group similar items in print format if group_same_items is checked in pick list (#33627)

* fix: only group similar items if group same items is checked in pick list

* test: non grouping of locations if group_same_items is false

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
(cherry picked from commit cfb0bb1eaa)

Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
2023-01-12 20:32:37 +05:30
Sagar Sharma
29dcce53db Merge pull request #33615 from frappe/mergify/bp/version-13-hotfix/pr-33611
fix: better comparision of `difference_value` of Stock and Account (backport #33611)
2023-01-11 15:44:03 +05:30
Smit Vora
a450c8dce9 fix: better comparision of difference value between stock and account
(cherry picked from commit be05aea101)
2023-01-11 09:24:10 +00:00
Sagar Sharma
287411667a Merge pull request #33602 from frappe/mergify/bp/version-13-hotfix/pr-33597
fix: don't check other warehouse ledgers to calculate valuation rate (backport #33597)
2023-01-10 22:58:10 +05:30
Frappe PR Bot
ab30e2a9c7 chore(release): Bumped to Version 13.43.1
## [13.43.1](https://github.com/frappe/erpnext/compare/v13.43.0...v13.43.1) (2023-01-10)

### Bug Fixes

* better handling of duplicate bundle items ([0b952e8](0b952e8bba))
* remove hard-coded roles for populating leave balance reports ([#249](https://github.com/frappe/erpnext/issues/249)) ([#33557](https://github.com/frappe/erpnext/issues/33557)) ([c20d469](c20d469f31))
* remove unnecessary permissions from Appointment and Appointment Booking Settings ([#33468](https://github.com/frappe/erpnext/issues/33468)) ([a50ad1d](a50ad1d292))
2023-01-10 16:51:45 +00:00
Deepesh Garg
65dd72a0b0 Merge pull request #33600 from frappe/version-13-hotfix
chore: release v13
2023-01-10 22:20:15 +05:30
Rohit Waghchaure
66bf1071bb fix: don't check other warehouse ledgers to calculate valuation rate
(cherry picked from commit ef2bf3c223)
2023-01-10 10:05:12 +00:00
Sagar Sharma
410e617834 Merge pull request #33587 from frappe/mergify/bp/version-13-hotfix/pr-33562
fix: better handling of duplicate bundle items (backport #33562)
2023-01-09 22:55:56 +05:30
ruthra kumar
0b952e8bba fix: better handling of duplicate bundle items
(cherry picked from commit c717e87c9e)
2023-01-09 16:54:55 +00:00
mergify[bot]
e9d85a3ee4 ci: bump node in release workflow (backport #33574) (#33576)
ci: bump node in release workflow (#33574)

[skip ci]

(cherry picked from commit 1ad1fc4c7d)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-01-09 13:26:18 +05:30
Rucha Mahabal
c20d469f31 fix: remove hard-coded roles for populating leave balance reports (#249) (#33557) 2023-01-06 14:28:15 +05:30
Sagar Sharma
7d0a118eab Merge pull request #33546 from frappe/mergify/bp/version-13-hotfix/pr-33543
chore: enable `No Copy` attribute for `route` in Item Group (backport #33543)
2023-01-05 13:32:52 +05:30
s-aga-r
2394f64872 chore: enable No Copy attribute for route in Item Group
(cherry picked from commit 348dc32514)
2023-01-05 07:33:04 +00:00
Daizy Modi
a50ad1d292 fix: remove unnecessary permissions from Appointment and Appointment Booking Settings (#33468)
* fix: remove unnecessary permissions from Appointment and Appointment Booking Settings

* fix: remove line

* fix: use more intuitive import

Co-authored-by: Sagar Vora <sagar@resilient.tech>
2023-01-04 21:44:44 +05:30
Frappe PR Bot
3efa5215a0 chore(release): Bumped to Version 13.43.0
# [13.43.0](https://github.com/frappe/erpnext/compare/v13.42.7...v13.43.0) (2023-01-04)

### Bug Fixes

* `shipping_address` for non-drop shipping item ([19feebb](19feebbcb6))
* `shipping_address` in PO ([1068d0e](1068d0ec63))
* add missing 'ordered_qty' to get_bin_details ([66ba098](66ba098462))
* conflicts ([8521e12](8521e12753))
* conflicts ([1c7c591](1c7c591ee2))
* conflicts ([c18a451](c18a451362))
* consider child nodes while getting bin details ([c9bf062](c9bf062f63))
* Conversion factor error for invoices without item code (petty expenses) ([#32714](https://github.com/frappe/erpnext/issues/32714)) ([acf8b46](acf8b464f3))
* debit note not pulled on reconciliation tool ([cf133b2](cf133b2f1c))
* Deferred revenue date comparison (backport [#33515](https://github.com/frappe/erpnext/issues/33515)) ([#33517](https://github.com/frappe/erpnext/issues/33517)) ([ea99ac9](ea99ac9c29))
* **ecommerce:** remove query parameters from referrer (backport [#33269](https://github.com/frappe/erpnext/issues/33269)) ([#33513](https://github.com/frappe/erpnext/issues/33513)) ([6516e80](6516e8042b))
* ERR journals reported in AR/AP ([c850635](c850635551))
* linter ([f0475e9](f0475e9cc5))
* Missing opening entry in general ledger (backport [#33519](https://github.com/frappe/erpnext/issues/33519)) ([#33527](https://github.com/frappe/erpnext/issues/33527)) ([865f233](865f233add))
* Multi-currency issues in Bank Reconciliation Tool (backport [#33488](https://github.com/frappe/erpnext/issues/33488)) ([#33493](https://github.com/frappe/erpnext/issues/33493)) ([4ba2f1e](4ba2f1ec96))
* No permission to read doctype ([8e1c0cd](8e1c0cd234))
* patch ([7b813d6](7b813d6045))
* provision to set tax_deducted_till_date after document is subnmmited ([64454e0](64454e0d4e))
* reconciled credit notes being fetched again in Payment Reconciliation tool ([#33471](https://github.com/frappe/erpnext/issues/33471)) ([5ec11ba](5ec11bad4f))
* Tax withheld vouchers naming rule ([#33467](https://github.com/frappe/erpnext/issues/33467)) ([334219e](334219e36a))
* **test:** holiday list dates in attendance test setup ([8df1151](8df11516be))
* **test:** monthly attendance sheet ([e5a187e](e5a187e08c))
* typerror on multi warehouse in Packed Items ([6a394c5](6a394c5be7))
* use base_net_amount in case of missing stock qty ([#33457](https://github.com/frappe/erpnext/issues/33457)) ([6e363a6](6e363a62db))
* use get_all instead of get_value as get_value api dont supports between condition ([bc04e05](bc04e05b46))

### Features

* explicit time period for mark attendance ([d2f86ea](d2f86ead74))
* provision to setup opening balances for earnings and deductions while creating SSA ([c3b9059](c3b9059c1b))
2023-01-04 15:44:05 +00:00
Deepesh Garg
1fa0fe7434 Merge pull request #33512 from frappe/version-13-hotfix
chore: release v13
2023-01-04 21:12:18 +05:30
Deepesh Garg
be48b4a028 chore: resolve conflicts 2023-01-04 08:24:20 +05:30
Deepesh Garg
b6ed0698b4 chore: resolve conflicts 2023-01-03 22:56:58 +05:30
Deepesh Garg
208d541373 Merge branch 'version-13' into version-13-hotfix 2023-01-03 22:22:12 +05:30
mergify[bot]
865f233add fix: Missing opening entry in general ledger (backport #33519) (#33527)
fix: Missing opening entry in general ledger (#33519)

(cherry picked from commit c78399c618)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-03 22:13:44 +05:30
mergify[bot]
ea99ac9c29 fix: Deferred revenue date comparison (backport #33515) (#33517)
fix: Deferred revenue date comparison (#33515)

(cherry picked from commit a3ab8f973a)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-03 18:41:40 +05:30
mergify[bot]
6516e8042b fix(ecommerce): remove query parameters from referrer (backport #33269) (#33513)
fix(ecommerce): remove query parameters from referer

inclusion of query parameters results in logic failure

example:
- logic check if referrer is `all-products`
- `http://shop.example/all-products` -> `all-products`, valid outcome
- `http://shop.example/all-products?start=1` -> `all-products?start=1`,
  invalid outcome

Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit b6bd408f19)

Co-authored-by: Sabu Siyad <hello@ssiyad.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-03 17:51:57 +05:30
Rucha Mahabal
3c83ec5613 Merge pull request #33510 from ruchamahabal/mark-attendance-period 2023-01-03 16:47:31 +05:30
Rucha Mahabal
e5a187e08c fix(test): monthly attendance sheet 2023-01-03 16:18:42 +05:30
Rucha Mahabal
8df11516be fix(test): holiday list dates in attendance test setup 2023-01-03 15:44:58 +05:30
Rucha Mahabal
03af48b50b chore(style): fix formatting 2023-01-03 14:36:36 +05:30
Samuel Danieli
a2bd8d22cb test: get_unmarked_days 2023-01-03 13:15:36 +05:30
Samuel Danieli
d2f86ead74 feat: explicit time period for mark attendance 2023-01-03 13:12:15 +05:30
Sagar Sharma
985c47fe3b Merge pull request #33501 from frappe/mergify/bp/version-13-hotfix/pr-33444
fix: consider child nodes while getting bin details (backport #33444)
2023-01-02 19:29:33 +05:30
s-aga-r
6c7815cd72 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-33444 2023-01-02 19:12:19 +05:30
Sagar Sharma
9b1384f79c Merge pull request #33499 from frappe/mergify/bp/version-13-hotfix/pr-33495
fix(stock): missing ordered_qty in get_bin_details (backport #33495)
2023-01-02 18:53:59 +05:30
s-aga-r
299e02ae46 chore: linter 2023-01-02 18:23:50 +05:30
s-aga-r
4fb2d2c000 chore: use frappe.qb instead of frappe.db.get_value
(cherry picked from commit c3911a592a)
2023-01-02 06:25:22 +00:00
s-aga-r
c9bf062f63 fix: consider child nodes while getting bin details
(cherry picked from commit c716dcc01e)
2023-01-02 06:25:22 +00:00
Devin Slauenwhite
196ba6759e test: get_item_details contains bin details
(cherry picked from commit 239a5f8bf4)
2023-01-02 05:45:43 +00:00
Devin Slauenwhite
66ba098462 fix: add missing 'ordered_qty' to get_bin_details
(cherry picked from commit 8d62cdfd5f)
2023-01-02 05:45:42 +00:00
mergify[bot]
4ba2f1ec96 fix: Multi-currency issues in Bank Reconciliation Tool (backport #33488) (#33493)
fix: Multi-currency issues in Bank Recociliation Tool

(cherry picked from commit ad53ecf2b4)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-01-02 08:52:04 +05:30
Deepesh Garg
6ab91348fd Merge pull request #33478 from frappe/mergify/bp/version-13-hotfix/pr-32714
fix: Conversion factor error for invoices without item code (petty expenses) (backport #32714)
2022-12-31 13:06:11 +05:30
Deepesh Garg
3f9b8923a9 chore: resolve conflicts 2022-12-30 20:57:38 +05:30
Deepesh Garg
038fa4dbe2 chore: resolve conflicts 2022-12-30 20:56:50 +05:30
Frappe PR Bot
d97e673874 chore(release): Bumped to Version 13.42.7
## [13.42.7](https://github.com/frappe/erpnext/compare/v13.42.6...v13.42.7) (2022-12-30)

### Bug Fixes

* debit note not pulled on reconciliation tool ([e01ff0d](e01ff0df40))
2022-12-30 15:21:51 +00:00
Deepesh Garg
b16bfa541d Merge pull request #33491 from frappe/mergify/bp/version-13/pr-33483
fix: debit note not pulled on reconciliation tool (#33483)
2022-12-30 20:49:48 +05:30
rohitwaghchaure
8156cb4db0 Merge pull request #33490 from frappe/mergify/bp/version-13-hotfix/pr-33487
Revert "fix: daily scheduler to identify and fix stock transfer entries having incorrect valuation" (backport #33487)
2022-12-30 16:13:20 +05:30
Deepesh Garg
65688684a7 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-32714 2022-12-30 16:00:59 +05:30
ruthra kumar
e01ff0df40 fix: debit note not pulled on reconciliation tool
(cherry picked from commit cf133b2f1c)
2022-12-30 10:05:59 +00:00
rohitwaghchaure
f0475e9cc5 fix: linter 2022-12-30 15:32:38 +05:30
ruthra kumar
b2333d3b5f Merge pull request #33483 from ruthra-kumar/debit_note_not_pulled_in_reconciliation_tool
fix: debit note not pulled on reconciliation tool
2022-12-30 15:02:49 +05:30
rohitwaghchaure
8521e12753 fix: conflicts 2022-12-30 14:35:12 +05:30
rohitwaghchaure
1c7c591ee2 fix: conflicts 2022-12-30 14:30:35 +05:30
rohitwaghchaure
c18a451362 fix: conflicts 2022-12-30 14:28:18 +05:30
rohitwaghchaure
529fb411ab Revert "fix: daily scheduler to identify and fix stock transfer entries having incorrect valuation"
(cherry picked from commit 728dc1acf4)

# Conflicts:
#	erpnext/hooks.py
#	erpnext/stock/doctype/stock_entry/stock_entry.py
#	erpnext/stock/doctype/stock_entry/test_stock_entry.py
2022-12-30 08:51:54 +00:00
ruthra kumar
4acaa3eecf Merge pull request #33475 from frappe/mergify/bp/version-13-hotfix/pr-33457
fix: use base_net_amount in case of missing stock qty (backport #33457)
2022-12-30 13:39:54 +05:30
ruthra kumar
cf133b2f1c fix: debit note not pulled on reconciliation tool 2022-12-29 18:02:16 +05:30
ruthra kumar
92c895aa1c Merge pull request #33460 from frappe/mergify/bp/version-13-hotfix/pr-33380
fix: ERR journals should be reported in AR/AP (backport #33380)
2022-12-29 11:27:05 +05:30
Frappe PR Bot
8d99763bea chore(release): Bumped to Version 13.42.6
## [13.42.6](https://github.com/frappe/erpnext/compare/v13.42.5...v13.42.6) (2022-12-29)

### Bug Fixes

* reconciled credit notes being fetched again in Payment Reconciliation tool ([#33471](https://github.com/frappe/erpnext/issues/33471)) ([b4589d8](b4589d8b8f))
* reconciled credit notes being fetched again in Payment Reconciliation tool ([#33471](https://github.com/frappe/erpnext/issues/33471)) ([37ae2df](37ae2dfe7f))
2022-12-29 05:30:04 +00:00
Deepesh Garg
b4589d8b8f fix: reconciled credit notes being fetched again in Payment Reconciliation tool (#33471)
fix: reconciled credit notes being fetched again in Payment Reconciliation tool (#33471)
2022-12-29 10:58:09 +05:30
ruthra kumar
ec15965a6c test: err for party should be in AR/AP report
(cherry picked from commit 2ed86760d7)
2022-12-29 10:53:55 +05:30
ruthra kumar
c850635551 fix: ERR journals reported in AR/AP
Exchange Rate Revaluation on Receivable/Payable will included in AR/AP report

(cherry picked from commit b09eade3e4)
2022-12-29 10:53:07 +05:30
Deepesh Garg
acf8b464f3 fix: Conversion factor error for invoices without item code (petty expenses) (#32714)
* fix: Set default uom conversion factor to 1 for invoices

* chore: set default conversion_factor as 1

* chore: remove print statements

(cherry picked from commit 617518389a)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
2022-12-29 05:12:48 +00:00
ruthra kumar
37ae2dfe7f fix: reconciled credit notes being fetched again in Payment Reconciliation tool (#33471)
fix: reconciled cr note showing up as Payments
(cherry picked from commit 5ec11bad4f)
2022-12-29 05:01:57 +00:00
ruthra kumar
5ec11bad4f fix: reconciled credit notes being fetched again in Payment Reconciliation tool (#33471)
fix: reconciled cr note showing up as Payments
2022-12-29 10:31:06 +05:30
ruthra kumar
6e363a62db fix: use base_net_amount in case of missing stock qty (#33457)
(cherry picked from commit e3a0ce5d63)
2022-12-29 04:05:54 +00:00
Deepesh Garg
334219e36a fix: Tax withheld vouchers naming rule (#33467) 2022-12-28 18:05:24 +05:30
Frappe PR Bot
cbda28d739 chore: release v13 (#33453)
* fix: typerror on multi warehouse in Packed Items

DN(with bundled item with varying warehouses)-> Sales Invoice.

(cherry picked from commit e684eb32d0)

* test: type error on bundled products with different warehouses

(cherry picked from commit 5918bb03f7)

* fix: No permission to read doctype

(cherry picked from commit c0da948a4e)

* fix: `shipping_address` in PO

(cherry picked from commit 7e1b6b3c2a)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.json

* chore: conflicts

* chore: linter

* refactor: Customer and Supplier Ledger summary will have hidden fields for better handling of user permission (#33432)

* feat: provision to setup opening balances for earnings and deductions while creating SSA

* fix: use get_all instead of get_value as get_value api dont supports between condition

* fix: patch

* fix: provision to set tax_deducted_till_date after document is subnmmited

* fix: `shipping_address` for non-drop shipping item

(cherry picked from commit 67a7ccf3ce)

* chore: linter (#33455)

fix: linter

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Saurabh <saurabh6790@gmail.com>
2022-12-27 17:49:51 +05:30
Saurabh
79643a5716 chore: linter (#33455)
fix: linter
2022-12-27 17:49:38 +05:30
Sagar Sharma
707eb9e8d5 Merge pull request #33446 from frappe/mergify/bp/version-13-hotfix/pr-33437
fix: `shipping_address` in PO for non-drop ship item (backport #33437)
2022-12-27 10:16:50 +05:30
s-aga-r
19feebbcb6 fix: shipping_address for non-drop shipping item
(cherry picked from commit 67a7ccf3ce)
2022-12-26 15:51:49 +00:00
Nabin Hait
0cf9702a21 Merge pull request #33412 from saurabh6790/provision-to-set-earnings-and-deductions-till-date
feat: provision to setup opening balances for earnings and deductions while creating SSA
2022-12-26 17:26:35 +05:30
Saurabh
64454e0d4e fix: provision to set tax_deducted_till_date after document is subnmmited 2022-12-26 12:48:37 +05:30
Saurabh
7b813d6045 fix: patch 2022-12-26 12:22:34 +05:30
Saurabh
bc04e05b46 fix: use get_all instead of get_value as get_value api dont supports between condition 2022-12-26 12:09:03 +05:30
Saurabh
c3b9059c1b feat: provision to setup opening balances for earnings and deductions while creating SSA 2022-12-26 12:09:03 +05:30
Sagar Sharma
7f1574478b Merge pull request #33436 from frappe/mergify/bp/version-13-hotfix/pr-33434
fix(ux): `shipping_address` in PO (backport #33434)
2022-12-26 11:19:01 +05:30
Sagar Sharma
b634e44fac Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-33434 2022-12-26 10:49:48 +05:30
mergify[bot]
3aa335d36a refactor: Customer and Supplier Ledger summary will have hidden fields for better handling of user permission (#33432) 2022-12-26 10:12:35 +05:30
s-aga-r
820e82265b chore: linter 2022-12-25 21:46:58 +05:30
s-aga-r
91dad909ec chore: conflicts 2022-12-25 21:40:49 +05:30
s-aga-r
1068d0ec63 fix: shipping_address in PO
(cherry picked from commit 7e1b6b3c2a)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.json
2022-12-25 14:11:23 +00:00
ruthra kumar
ae3581c7d0 Merge pull request #33416 from frappe/mergify/bp/version-13-hotfix/pr-32219
fix: No permission to read doctype (backport #32219)
2022-12-24 07:34:39 +05:30
ruthra kumar
7a97cc4629 Merge pull request #33413 from frappe/mergify/bp/version-13-hotfix/pr-33410
fix: TypeError on GP Report due to multiple warehouse on bundled items (backport #33410)
2022-12-22 12:06:55 +05:30
Nabin Hait
8e1c0cd234 fix: No permission to read doctype
(cherry picked from commit c0da948a4e)
2022-12-22 04:12:14 +00:00
ruthra kumar
d58719a30a test: type error on bundled products with different warehouses
(cherry picked from commit 5918bb03f7)
2022-12-21 12:58:15 +00:00
ruthra kumar
6a394c5be7 fix: typerror on multi warehouse in Packed Items
DN(with bundled item with varying warehouses)-> Sales Invoice.

(cherry picked from commit e684eb32d0)
2022-12-21 12:58:13 +00:00
Frappe PR Bot
35c71f5923 chore(release): Bumped to Version 13.42.5
## [13.42.5](https://github.com/frappe/erpnext/compare/v13.42.4...v13.42.5) (2022-12-20)

### Bug Fixes

* conflict ([7ef0c6b](7ef0c6bb01))
* conflict in hooks file ([2a18067](2a18067aad))
* conflict in stock_entry ([4587bb3](4587bb3767))
* conflicts ([086e747](086e74791b))
* Consolidated financial report ([7825c56](7825c564eb))
* Cost center filter not working in cash flow report ([684a45f](684a45f234))
* daily scheduler to identify and fix stock transfer entries having incorrect valuation ([b82154c](b82154cb9e))
* disabled items showing in the report 'Itemwise Recommended Reorder Level ([c3fca3c](c3fca3cfcb))
* get_serial_nos not defined ([e5b3748](e5b3748b49))
* get_serial_nos_for_fg() missing 1 required positional argument: 'args' ([eddb7b4](eddb7b429e))
* linter issue ([ab2f250](ab2f250960))
* translation for warning on Overbilling/-receipt/-delivery ([b13ee4f](b13ee4fc8c))
* unsupported operand type(s) for +: 'int' and 'NoneType' ([a6241fc](a6241fc813))
* unsupported operand type(s) for +=: 'int' and 'NoneType' ([b573d97](b573d9739f))
2022-12-20 14:02:06 +00:00
Deepesh Garg
52d4e2acf8 Merge pull request #33403 from frappe/version-13-hotfix
chore: release v13
2022-12-20 19:30:24 +05:30
Deepesh Garg
3691eec66c Merge pull request #33401 from frappe/mergify/bp/version-13-hotfix/pr-33393
fix: Cost center filter not working in cash flow report (backport #33393)
2022-12-20 18:22:46 +05:30
rohitwaghchaure
e93af962a1 Merge pull request #33390 from frappe/mergify/bp/version-13-hotfix/pr-33387
fix: daily scheduler to identify and fix stock transfer entries having incorrect valuation (backport #33387)
2022-12-20 16:59:58 +05:30
rohitwaghchaure
9692eeeb15 Merge pull request #33392 from frappe/mergify/bp/version-13-hotfix/pr-33382
fix: unsupported operand type(s) for +=: 'int' and 'NoneType' (backport #33382)
2022-12-20 16:59:40 +05:30
Deepesh Garg
7825c564eb fix: Consolidated financial report 2022-12-20 16:52:28 +05:30
Deepesh Garg
e5fd95bb21 chore: remove print statement
(cherry picked from commit 068df9f815)
2022-12-20 08:17:21 +00:00
Deepesh Garg
684a45f234 fix: Cost center filter not working in cash flow report
(cherry picked from commit d0dbfec052)
2022-12-20 08:17:20 +00:00
rohitwaghchaure
7ef0c6bb01 fix: conflict 2022-12-20 11:55:22 +05:30
rohitwaghchaure
4587bb3767 fix: conflict in stock_entry 2022-12-20 11:52:33 +05:30
rohitwaghchaure
2a18067aad fix: conflict in hooks file 2022-12-20 11:49:22 +05:30
Rohit Waghchaure
b573d9739f fix: unsupported operand type(s) for +=: 'int' and 'NoneType'
(cherry picked from commit 2b4eae5f84)
2022-12-20 04:19:14 +00:00
Rohit Waghchaure
4dbce87660 test: added test case to validate audit for incorrect entries
(cherry picked from commit f31612376a)

# Conflicts:
#	erpnext/hooks.py
#	erpnext/stock/doctype/stock_entry/test_stock_entry.py
2022-12-20 04:18:19 +00:00
Rohit Waghchaure
b82154cb9e fix: daily scheduler to identify and fix stock transfer entries having incorrect valuation
(cherry picked from commit b1721b79ce)

# Conflicts:
#	erpnext/stock/doctype/stock_entry/stock_entry.py
2022-12-20 04:18:18 +00:00
Deepesh Garg
2105193594 Merge pull request #33367 from ruthra-kumar/using_subquery_for_fetching_dr_cr_notes
perf: using subquery in get_dr_or_cr_notes() to improve performance
2022-12-17 16:41:58 +05:30
Deepesh Garg
ef74c6689b Merge pull request #33360 from frappe/mergify/bp/version-13-hotfix/pr-33355
fix: disabled items showing in the report Itemwise Recommended Reorder Level (backport #33355)
2022-12-16 16:12:29 +05:30
ruthra kumar
799d7b254e refactor: using subquery in get_dr_or_cr_notes to improve performance 2022-12-16 14:06:05 +05:30
rohitwaghchaure
086e74791b fix: conflicts 2022-12-16 11:41:22 +05:30
Rohit Waghchaure
c3fca3cfcb fix: disabled items showing in the report 'Itemwise Recommended Reorder Level
'

(cherry picked from commit ae31ff1c48)

# Conflicts:
#	erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.py
2022-12-15 12:39:14 +00:00
rohitwaghchaure
1634448864 Merge pull request #33357 from frappe/mergify/bp/version-13-hotfix/pr-33354
fix: unsupported operand type(s) for +: 'int' and 'NoneType' (backport #33354)
2022-12-15 18:08:33 +05:30
Rohit Waghchaure
a6241fc813 fix: unsupported operand type(s) for +: 'int' and 'NoneType'
(cherry picked from commit 0f28074e5a)
2022-12-15 11:44:56 +00:00
Deepesh Garg
896bac10bc Merge pull request #33343 from frappe/mergify/bp/version-13-hotfix/pr-33323
fix: translatability of warning on overbilling/-receipt/-delivery (backport #33323)
2022-12-15 09:17:19 +05:30
Raffael Meyer
0992ca40b0 chore: resolve merge conflict (2) 2022-12-15 00:13:13 +01:00
Raffael Meyer
10ac8d6e67 chore: resolve merge conflicts 2022-12-15 00:11:35 +01:00
rohitwaghchaure
c8a2f9f857 Merge pull request #33334 from frappe/mergify/bp/version-13-hotfix/pr-33332
fix: get_serial_nos_for_fg() missing 1 required positional argument: … (backport #33332)
2022-12-15 00:55:00 +05:30
barredterra
b13ee4fc8c fix: translation for warning on Overbilling/-receipt/-delivery
(cherry picked from commit 36997d9788)

# Conflicts:
#	erpnext/controllers/status_updater.py
#	erpnext/translations/de.csv
2022-12-14 17:55:29 +00:00
rohitwaghchaure
ab2f250960 fix: linter issue 2022-12-14 23:23:19 +05:30
rohitwaghchaure
e5b3748b49 fix: get_serial_nos not defined 2022-12-14 23:06:38 +05:30
Rohit Waghchaure
eddb7b429e fix: get_serial_nos_for_fg() missing 1 required positional argument: 'args'
(cherry picked from commit 410a58b3de)
2022-12-14 10:38:38 +00:00
Frappe PR Bot
b3a9c1eb2a chore(release): Bumped to Version 13.42.4
## [13.42.4](https://github.com/frappe/erpnext/compare/v13.42.3...v13.42.4) (2022-12-13)

### Bug Fixes

* `Enough Parts to Build` in `BOM Stock Report` ([50b2898](50b2898a2c))
* `Material Request` reference in internal `Sales Order` ([988a327](988a327b58))
* incorrect balance on parent company due to key mismatch ([b17ac52](b17ac522f5))
* order status in `Production Planning Report` ([2880469](2880469706))

### Performance Improvements

* add indexes on payment entry reference (backport [#33288](https://github.com/frappe/erpnext/issues/33288)) ([#33290](https://github.com/frappe/erpnext/issues/33290)) ([45f79ef](45f79ef644))
2022-12-13 12:31:01 +00:00
Ankush Menat
e44646054c Merge pull request #33317 from frappe/version-13-hotfix
chore: release v13
2022-12-13 17:59:05 +05:30
Sagar Sharma
12f11a6976 Merge pull request #33321 from frappe/mergify/bp/version-13-hotfix/pr-33314
fix: `Enough Parts to Build` in `BOM Stock Report` (backport #33314)
2022-12-13 15:58:15 +05:30
s-aga-r
50b2898a2c fix: Enough Parts to Build in BOM Stock Report
(cherry picked from commit 723c64ba73)
2022-12-13 09:50:30 +00:00
ruthra kumar
23830266f2 Merge pull request #33310 from frappe/mergify/bp/version-13-hotfix/pr-33303
fix: incorrect balance on parent company on consolidate Balance sheet due to key mismatch (backport #33303)
2022-12-13 13:56:31 +05:30
ruthra kumar
b17ac522f5 fix: incorrect balance on parent company due to key mismatch
(cherry picked from commit 7b3316dc31)
2022-12-13 03:36:32 +00:00
Sagar Sharma
1b22f53fde Merge pull request #33307 from frappe/mergify/bp/version-13-hotfix/pr-33304
fix: `Material Request` reference in internal `Sales Order` (backport #33304)
2022-12-13 00:01:25 +05:30
s-aga-r
988a327b58 fix: Material Request reference in internal Sales Order
(cherry picked from commit 78b438f6cf)
2022-12-12 18:19:15 +00:00
mergify[bot]
45f79ef644 perf: add indexes on payment entry reference (backport #33288) (#33290)
perf: add indexes on payment entry reference (#33288)

Adds index on:
1. reference doctype
2. reference name

*Why not composite index?*

There are three type of queries on this doctype

- filtering ref_doctype - doctype index helps here
- filtering ref_name - name index helps here
- filtering both - name index helps here too. Since it has sufficiently
  high cardinality. Composite index wont help in case where ref_doctype
  isn't specfied.

[skip ci]

(cherry picked from commit 593626f502)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-12-12 13:02:08 +05:30
Sagar Sharma
bce3506e90 Merge pull request #33257 from frappe/mergify/bp/version-13-hotfix/pr-33255
fix: order status in `Production Planning Report` (backport #33255)
2022-12-08 00:04:53 +05:30
s-aga-r
2880469706 fix: order status in Production Planning Report
(cherry picked from commit 632c08f7e0)
2022-12-07 18:07:23 +00:00
Frappe PR Bot
104967881d chore(release): Bumped to Version 13.42.3
## [13.42.3](https://github.com/frappe/erpnext/compare/v13.42.2...v13.42.3) (2022-12-06)

### Bug Fixes

* add company filter in RFQ Items ([a716f78](a716f780a8))
* key error on p/l and balance sheet reports on foreign currency ([0003e0c](0003e0cb5b))
* key error while filtering on date range and different currency ([84ef814](84ef814f45))
* non empty FG batch picked while completing work order ([635d80d](635d80dc2f))
* remove duplicate schema ([4ad9aa2](4ad9aa29ee))
* replace sql code with fields list in get_cached_value ([b3ccad8](b3ccad8cf4))
2022-12-06 14:37:49 +00:00
Deepesh Garg
b2ef5f7cd2 Merge pull request #33232 from frappe/version-13-hotfix
chore: release v13
2022-12-06 20:06:03 +05:30
Deepesh Garg
cd5b8aeb64 Merge pull request #33234 from frappe/mergify/bp/version-13-hotfix/pr-33191
fix: key error while filtering on date range and reporting on foreign currency (backport #33191)
2022-12-06 17:36:37 +05:30
ruthra kumar
0003e0cb5b fix: key error on p/l and balance sheet reports on foreign currency
(cherry picked from commit a6794c3606)
2022-12-06 16:52:26 +05:30
ruthra kumar
b3ccad8cf4 fix: replace sql code with fields list in get_cached_value
(cherry picked from commit 19db7e2989)
2022-12-06 16:52:22 +05:30
ruthra kumar
84ef814f45 fix: key error while filtering on date range and different currency
(cherry picked from commit 9b8d6fe411)
2022-12-06 10:13:40 +00:00
rohitwaghchaure
ac432ea52f Merge pull request #33226 from frappe/mergify/bp/version-13-hotfix/pr-33224
fix: non empty FG batch picked while completing work order (backport #33224)
2022-12-05 23:58:52 +05:30
Rohit Waghchaure
635d80dc2f fix: non empty FG batch picked while completing work order
(cherry picked from commit 713330cbf6)
2022-12-05 15:00:38 +00:00
Sagar Sharma
0c4de03baa Merge pull request #33176 from frappe/mergify/bp/version-13-hotfix/pr-33174
fix: add company filter in RFQ Items (backport #33174)
2022-11-30 12:25:15 +05:30
s-aga-r
a716f780a8 fix: add company filter in RFQ Items
(cherry picked from commit ca0485a503)
2022-11-30 05:07:27 +00:00
Deepesh Garg
6f6598878e Merge pull request #33173 from frappe/mergify/bp/version-13-hotfix/pr-33115
fix: remove product schema block from additional info section on item template (backport #33115)
2022-11-30 09:46:49 +05:30
ruthra kumar
4ad9aa29ee fix: remove duplicate schema
(cherry picked from commit 2c18a95115)
2022-11-30 03:49:36 +00:00
Frappe PR Bot
e54b23d71b chore(release): Bumped to Version 13.42.2
## [13.42.2](https://github.com/frappe/erpnext/compare/v13.42.1...v13.42.2) (2022-11-29)

### Bug Fixes

* `production_item` filter in `Job Card Summary Report` ([ce54198](ce5419888b))
* `Work Order` filter typo in `Job Card Summary Report` ([2de239c](2de239c73b))
* cannot update auth token until token expiry if credentials change ([2121714](2121714856))
* company name with `,` in `Job Card Summary Report` ([ffef0cb](ffef0cb771))
* company name with `,` in `Work Order Summary Report` ([11978fc](11978fca4e))
* create rounding gl entry for PCV during gle post processing ([7af4597](7af45972ae))
* disbursable amount on currrent security price ([eca2d96](eca2d96419))
* Dispatch address display ([10cfcb5](10cfcb5e8a))
* incorrect balance qty ([78e64fa](78e64fa486))
* linter ([b91860d](b91860ddf2))
* MR Item `description` and `item_name` gets reset on `qty` change ([b66976b](b66976bd36))
* Multicurrency invoice with exchange gain and loss showing up in AR/AP report ([d38a289](d38a2895b0))
* only consider draft pending asset repair docs ([6da7b38](6da7b38f6e))
* only show serial no batch selector only once ([0c6a7ce](0c6a7cef95))
* reset `voucher_type` and `voucher_no` if `based_on` is set to `Item and Warehouse` ([ff59483](ff594831b0))
* validate voucher type while checking journal entry against payroll entry ([07c25ac](07c25ace5c))
2022-11-29 13:19:11 +00:00
Deepesh Garg
ba9220f9d2 Merge pull request #33164 from frappe/version-13-hotfix
chore: release v13
2022-11-29 18:47:36 +05:30
Sagar Sharma
354f258543 Merge pull request #33160 from frappe/mergify/bp/version-13-hotfix/pr-33136
fix: reset `voucher_type` and `voucher_no` if `based_on` is set to `Transaction` (backport #33136)
2022-11-29 13:24:45 +05:30
s-aga-r
f7d3f136c5 chore: make posting_date and posting_time read-only if based_on is set to Transaction
(cherry picked from commit 4e10352b48)
2022-11-29 06:44:57 +00:00
s-aga-r
ff594831b0 fix: reset voucher_type and voucher_no if based_on is set to Item and Warehouse
(cherry picked from commit eeec008547)
2022-11-29 06:44:57 +00:00
rohitwaghchaure
b08d36cb7b Merge pull request #33150 from frappe/mergify/bp/version-13-hotfix/pr-33144
fix: incorrect balance qty (backport #33144)
2022-11-29 12:06:09 +05:30
Sagar Sharma
cdb6a4e3f7 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-33144 2022-11-29 11:17:07 +05:30
Deepesh Garg
99188afa16 Merge pull request #33157 from frappe/mergify/bp/version-13-hotfix/pr-33116
fix: only show serial no batch selector only once (backport #33116)
2022-11-29 11:07:09 +05:30
Deepesh Garg
64fda0d4b7 Merge pull request #33028 from saurabh6790/small-fixes
chore: link payroll entry reference in accrual payroll journal entry
2022-11-29 10:53:42 +05:30
Shariq Ansari
0c6a7cef95 fix: only show serial no batch selector only once
(cherry picked from commit 0f87d329d6)
2022-11-29 04:51:41 +00:00
Rohit Waghchaure
c930d64e8d test: test case for serialized batched item
(cherry picked from commit b606a9684b)
2022-11-29 03:19:16 +00:00
Rohit Waghchaure
78e64fa486 fix: incorrect balance qty
(cherry picked from commit b2105a8be7)
2022-11-29 03:19:15 +00:00
Deepesh Garg
2a0d7acc2b Merge pull request #33122 from deepeshgarg007/receivable_payable_multi_currency
fix: Multicurrency invoice with exchange gain and loss showing up in AR/AP report
2022-11-28 22:49:06 +05:30
Sagar Sharma
24a3da55e6 Merge pull request #33124 from frappe/mergify/bp/version-13-hotfix/pr-33120
fix: `Work Order Summary` and `Job Card Summary` Report (backport #33120)
2022-11-27 23:23:06 +05:30
Sagar Sharma
c3289c265a Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-33120 2022-11-27 22:11:06 +05:30
s-aga-r
b39f367dbd chore: conflicts 2022-11-27 22:10:10 +05:30
Deepesh Garg
d76e291927 Merge pull request #33114 from frappe/mergify/bp/version-13-hotfix/pr-33111
fix: Loan disbursable amount on current security price (backport #33111)
2022-11-27 20:50:19 +05:30
s-aga-r
ce5419888b fix: production_item filter in Job Card Summary Report
(cherry picked from commit ef7fd670fc)

# Conflicts:
#	erpnext/manufacturing/report/job_card_summary/job_card_summary.py
2022-11-26 16:25:16 +00:00
s-aga-r
ffef0cb771 fix: company name with , in Job Card Summary Report
(cherry picked from commit 481149814e)

# Conflicts:
#	erpnext/manufacturing/report/job_card_summary/job_card_summary.py
2022-11-26 16:25:15 +00:00
s-aga-r
2de239c73b fix: Work Order filter typo in Job Card Summary Report
(cherry picked from commit 2e4f3e9317)
2022-11-26 16:25:14 +00:00
s-aga-r
11978fca4e fix: company name with , in Work Order Summary Report
(cherry picked from commit 87b39f045c)
2022-11-26 16:25:14 +00:00
Deepesh Garg
d38a2895b0 fix: Multicurrency invoice with exchange gain and loss showing up in AR/AP report 2022-11-26 20:21:22 +05:30
Sagar Sharma
4492ee4771 Merge pull request #33109 from frappe/mergify/bp/version-13-hotfix/pr-33090
fix: MR Item `item_name` and `description` gets reset on `qty` change (backport #33090)
2022-11-26 10:07:37 +05:30
Abhinav Raut
eca2d96419 fix: disbursable amount on currrent security price
(cherry picked from commit fe87c27acd)
2022-11-25 09:49:03 +00:00
s-aga-r
b66976bd36 fix: MR Item description and item_name gets reset on qty change
(cherry picked from commit df0fee2312)
2022-11-25 05:50:10 +00:00
Deepesh Garg
776c8c6d6a Merge pull request #33093 from frappe/einv-reset-client-creds
fix: cannot update auth token until token expiry if credentials change
2022-11-24 21:25:46 +05:30
Deepesh Garg
452db7ed15 Merge pull request #33105 from frappe/mergify/bp/version-13-hotfix/pr-33100
fix: Dispatch address display (backport #33100)
2022-11-24 21:22:13 +05:30
Deepesh Garg
10cfcb5e8a fix: Dispatch address display
(cherry picked from commit 104fdcb9f9)
2022-11-24 12:31:40 +00:00
Saqib Ansari
b91860ddf2 fix: linter 2022-11-24 15:26:32 +05:30
Deepesh Garg
eda89a467c Merge pull request #33086 from AnandBaburajan/pending_asset_repair
fix: only consider draft pending asset repair docs
2022-11-24 14:37:36 +05:30
Saqib Ansari
2121714856 fix: cannot update auth token until token expiry if credentials change 2022-11-23 21:33:04 +05:30
Saurabh
8b46da39ea Merge branch 'version-13-hotfix' into small-fixes 2022-11-23 18:16:49 +05:30
anandbaburajan
6da7b38f6e fix: only consider draft pending asset repair docs 2022-11-23 13:05:52 +05:30
Deepesh Garg
7688239fc0 Merge pull request #33084 from frappe/mergify/bp/version-13-hotfix/pr-33062
fix: create rounding gl entry for PCV during gle post processing (backport #33062)
2022-11-23 11:50:14 +05:30
Saurabh
07c25ace5c fix: validate voucher type while checking journal entry against payroll entry 2022-11-23 11:45:50 +05:30
Saurabh
6ae21c92de chore: link payroll entry reference in accrual payroll journal entry 2022-11-23 11:45:50 +05:30
Nabin Hait
7af45972ae fix: create rounding gl entry for PCV during gle post processing
(cherry picked from commit 022d8d5d79)
2022-11-23 05:07:10 +00:00
Frappe PR Bot
f106b9e884 chore(release): Bumped to Version 13.42.1
## [13.42.1](https://github.com/frappe/erpnext/compare/v13.42.0...v13.42.1) (2022-11-22)

### Bug Fixes

* Accounting Dimension filtering for Sales and Purchase Report ([58f3f2b](58f3f2b6d9))
* cast POS query inputs to integers  (backport [#32975](https://github.com/frappe/erpnext/issues/32975)) ([#32978](https://github.com/frappe/erpnext/issues/32978)) ([3aba14f](3aba14f71a))
* GP incorrect buying amount if no upd on SI and Delivery Note ([40bb2cb](40bb2cba93))
* incorrect fix of conversion factor in PP ([726c3d3](726c3d32be))
* linter issue ([72f9308](72f9308df6))
* make `is_internal_supplier` read-only ([30b5d1c](30b5d1c400))
* Opening journal entry templates ([4ad3e28](4ad3e28147))
* **pos:** item selector image border radius ([ab31eb4](ab31eb4ee7))
* **realtime:** Restrict updates to only last modified or current user ([#33034](https://github.com/frappe/erpnext/issues/33034)) ([ecdd849](ecdd8493ea))
* use `list()` on self mutating iteration ([0070b5e](0070b5ef9a))
2022-11-22 16:00:21 +00:00
Deepesh Garg
b839c53572 Merge pull request #33075 from frappe/version-13-hotfix
chore: release v13
2022-11-22 21:28:29 +05:30
ruthra kumar
30b42b22ab Merge pull request #32942 from frappe/mergify/bp/version-13-hotfix/pr-32866
fix: incorrect buying amount on Gross Profit (backport #32866)
2022-11-22 15:59:28 +05:30
ruthra kumar
4834b78ed2 refactor: clean up code in test suite
Remove doctypes that are not in v13
2022-11-22 15:06:46 +05:30
ruthra kumar
72f9308df6 fix: linter issue 2022-11-22 15:06:27 +05:30
Deepesh Garg
dc9b81d216 Merge pull request #33041 from frappe/mergify/bp/version-13-hotfix/pr-33032
fix: Accounting Dimension filtering for Sales and Purchase Report (backport #33032)
2022-11-19 18:53:34 +05:30
Deepesh Garg
61b20c81c2 Merge pull request #33036 from frappe/mergify/bp/version-13-hotfix/pr-33034
fix(realtime): Restrict updates to only last modified or current user (backport #33034)
2022-11-19 18:22:17 +05:30
Deepesh Garg
58f3f2b6d9 fix: Accounting Dimension filtering for Sales and Purchase Report
(cherry picked from commit 8b394afaa9)
2022-11-19 12:50:19 +00:00
rohitwaghchaure
e3435369a0 Merge pull request #33037 from frappe/mergify/bp/version-13-hotfix/pr-32947
fix: incorrect fix of conversion factor in PP (backport #32947)
2022-11-19 11:50:05 +05:30
Rohit Waghchaure
726c3d32be fix: incorrect fix of conversion factor in PP
(cherry picked from commit 490b0e3cdf)
2022-11-18 14:39:27 +00:00
gavin
ecdd8493ea fix(realtime): Restrict updates to only last modified or current user (#33034)
(cherry picked from commit dd2493a541)
2022-11-18 11:49:11 +00:00
Deepesh Garg
431a94b961 Merge pull request #33016 from frappe/mergify/bp/version-13-hotfix/pr-33009
fix(pos): item selector image border radius (backport #33009)
2022-11-18 15:09:17 +05:30
Sagar Sharma
00f990e3f4 Merge pull request #33024 from frappe/mergify/bp/version-13-hotfix/pr-33019
fix: use `list()` on self mutating iteration (backport #33019)
2022-11-18 10:59:54 +05:30
Sabu Siyad
0070b5ef9a fix: use list() on self mutating iteration
https://github.com/frappe/erpnext/issues/30325

Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit 546c809cbe)
2022-11-18 04:56:12 +00:00
Sabu Siyad
ab31eb4ee7 fix(pos): item selector image border radius
Signed-off-by: Sabu Siyad <hello@ssiyad.com>
(cherry picked from commit 2f4940cc26)
2022-11-17 12:02:46 +00:00
mergify[bot]
357ae939d1 refactor: search queries (backport #33004) (#33008)
* refactor: search queries (#33004)

- guard clauses for readability
- use values or format

(cherry picked from commit 34e4903ed7)

# Conflicts:
#	erpnext/stock/doctype/material_request/material_request.py
#	erpnext/stock/doctype/quality_inspection/quality_inspection.py

* chore: conflicts

[skip ci]

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-11-17 14:24:45 +05:30
Sagar Sharma
b8aa63b5e2 Merge pull request #33011 from frappe/mergify/bp/version-13-hotfix/pr-33006
fix: make `is_internal_supplier` read-only in PO (backport #33006)
2022-11-17 14:23:28 +05:30
s-aga-r
9191c54b90 chore: conflicts 2022-11-17 14:19:01 +05:30
s-aga-r
30b5d1c400 fix: make is_internal_supplier read-only
(cherry picked from commit 5efbc2cbf8)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.json
2022-11-17 08:41:11 +00:00
Ankush Menat
9d5c4ffadf chore: hardcode doctype 2022-11-17 12:03:02 +05:30
Deepesh Garg
85d8540379 Merge pull request #32995 from frappe/mergify/bp/version-13-hotfix/pr-32983
fix: Opening journal entry templates (backport #32983)
2022-11-17 11:15:52 +05:30
Deepesh Garg
4ad3e28147 fix: Opening journal entry templates
(cherry picked from commit 33b61aef5a)
2022-11-16 15:12:34 +00:00
Deepesh Garg
ec6a01de4c Merge pull request #32991 from frappe/mergify/bp/version-13-hotfix/pr-32989
ci: fix flake8 URL (backport #32989)
2022-11-16 17:05:25 +05:30
Deepesh Garg
7831744064 ci: fix flake8 URL
(cherry picked from commit e81bec5fc9)
2022-11-16 10:56:43 +00:00
mergify[bot]
3aba14f71a fix: cast POS query inputs to integers (backport #32975) (#32978)
* fix: cast POS query inputs to integers  (#32975)

fix: cast POS query inputs to integers
(cherry picked from commit c013db6ea1)

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

* chore: conflicts

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-11-15 18:50:32 +05:30
Frappe PR Bot
f3f6d35a84 chore(release): Bumped to Version 13.42.0
# [13.42.0](https://github.com/frappe/erpnext/compare/v13.41.1...v13.42.0) (2022-11-15)

### Bug Fixes

* add Document Date in E-Invoice print format ([a16347f](a16347f325))
* ambiguous 'cost_center' on payment reconciliation ([e9e5ded](e9e5ded36b))
* check type for reference name ([ad648f3](ad648f313c))
* don't set WIP Warehouse if  is checked in WO ([4a17711](4a177113c6))
* Label for applicable dimension table ([cbc8b2d](cbc8b2da0a))
* Pricing rule item group consider UOM ([1ed0b6e](1ed0b6e89b)), closes [#32566](https://github.com/frappe/erpnext/issues/32566)
* query condition change ([88ce59a](88ce59a1ca))
* repayment schedule regeneration ([a19031c](a19031cf9a))
* set `WIP Warehouse` in Job Card ([f09e427](f09e4273d9))
* set stock UOM in args to ensure item price is fetched ([bd2242b](bd2242b285))
* wrong totals in hsn summary report ([79d508f](79d508f4ff))

### Features

* page break in SoA pdf ([e93ac3c](e93ac3c9a8))
2022-11-15 13:02:04 +00:00
Deepesh Garg
1cf5b23d9c Merge pull request #32973 from frappe/version-13-hotfix
chore: release v13
2022-11-15 18:17:49 +05:30
Deepesh Garg
de3453e477 Merge pull request #32934 from rtdany10/hsn-summary-report
fix: wrong hsn summary totals
2022-11-15 16:33:46 +05:30
Deepesh Garg
ee015273c9 Merge pull request #32953 from gavindsouza/rm-dead-validation-pe
chore(payment_entry): Remove dead validations
2022-11-15 13:56:38 +05:30
Deepesh Garg
db3f8d2768 Merge pull request #32961 from frappe/mergify/bp/version-13-hotfix/pr-32956
fix: Label for applicable dimension table (backport #32956)
2022-11-15 13:01:34 +05:30
Gavin D'souza
e1ecc9a819 chore(payment_entry): Remove dead validations 2022-11-15 10:43:47 +05:30
Deepesh Garg
9e340a8307 Merge branch 'version-13-hotfix' into hsn-summary-report 2022-11-15 09:26:00 +05:30
Deepesh Garg
cbc8b2da0a fix: Label for applicable dimension table
(cherry picked from commit 8c13f70fc5)
2022-11-15 03:56:00 +00:00
ruthra kumar
b7ff5fb426 Merge pull request #32930 from ruthra-kumar/ambiguous_cost_center_field
fix: ambiguous 'cost_center' while using payment reconciliation
2022-11-14 16:56:36 +05:30
Sagar Sharma
2b2a4f66ad Merge pull request #32949 from frappe/mergify/bp/version-13-hotfix/pr-32937
refactor: rewrite `job_card.py` queries in QB (backport #32937)
2022-11-14 12:22:59 +05:30
s-aga-r
78ca078474 refactor: rewrite job_card.py queries in QB
(cherry picked from commit 7df2921d38)
2022-11-14 05:57:03 +00:00
Deepesh Garg
65c9941aa4 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-32866 2022-11-14 10:45:09 +05:30
Deepesh Garg
5e46567a0b Merge pull request #32940 from deepeshgarg007/psa_pdf_issue_v13
feat: page break in SoA pdf
2022-11-14 10:44:56 +05:30
Deepesh Garg
079cf6899e Merge pull request #32943 from frappe/mergify/bp/version-13-hotfix/pr-32938
chore: Remove raw SQL query (backport #32938)
2022-11-14 10:44:24 +05:30
Sagar Vora
ad648f313c fix: check type for reference name
(cherry picked from commit b06345af46)
2022-11-13 15:11:50 +00:00
Deepesh Garg
9c9c6607f8 chore: Remove qb doc reference
(cherry picked from commit 4b9921782b)
2022-11-13 15:11:49 +00:00
Deepesh Garg
d6901e51ad chore: Remove raw SQL query
(cherry picked from commit 42a59d5c17)
2022-11-13 15:11:48 +00:00
Deepesh Garg
8733ce5ca9 Merge branch 'version-13-hotfix' into psa_pdf_issue_v13 2022-11-13 20:41:38 +05:30
Deepesh Garg
1ee5c2ff87 chore: Resolve conflicts 2022-11-13 19:49:07 +05:30
ruthra kumar
09ef8eeaea test: buying amount of invoices
1. Invoice with unset `update_stock`, with and without Delivery Notes

(cherry picked from commit 2c8b0b17a7)
2022-11-13 13:46:48 +00:00
ruthra kumar
40bb2cba93 fix: GP incorrect buying amount if no upd on SI and Delivery Note
(cherry picked from commit e4d16c31da)

# Conflicts:
#	erpnext/accounts/report/gross_profit/gross_profit.py
2022-11-13 13:46:47 +00:00
Dany Robert
95f81d3563 chore: remove commented line 2022-11-13 18:53:10 +05:30
Dany Robert
88ce59a1ca fix: query condition change 2022-11-13 18:52:57 +05:30
Dany Robert
e93ac3c9a8 feat: page break in SoA pdf 2022-11-13 18:52:44 +05:30
Sagar Sharma
079fc2dc34 Merge pull request #32936 from frappe/mergify/bp/version-13-hotfix/pr-32913
fix: set stock UOM in args to ensure item price is fetched (backport #32913)
2022-11-12 12:46:54 +05:30
Sagar Vora
bd2242b285 fix: set stock UOM in args to ensure item price is fetched
(cherry picked from commit 57038c3969)
2022-11-12 04:39:52 +00:00
Dany Robert
79d508f4ff fix: wrong totals in hsn summary report 2022-11-12 05:22:31 +01:00
Deepesh Garg
a0cab4c5e7 Merge pull request #32931 from frappe/mergify/bp/version-13-hotfix/pr-32878
fix: repayment schedule regeneration (backport #32878)
2022-11-11 15:15:32 +05:30
Abhinav Raut
a19031cf9a fix: repayment schedule regeneration
(cherry picked from commit d6ab2b3b87)
2022-11-11 08:53:31 +00:00
ruthra kumar
e9e5ded36b fix: ambiguous 'cost_center' on payment reconciliation 2022-11-11 10:14:04 +05:30
Sagar Sharma
fcb6ee22ba Merge pull request #32920 from frappe/mergify/bp/version-13-hotfix/pr-32918
fix: WO Skip Material Transfer to WIP Warehouse (backport #32918)
2022-11-10 18:42:25 +05:30
Sagar Sharma
f09e4273d9 fix: set WIP Warehouse in Job Card
(cherry picked from commit e7fa2e08ad)
2022-11-10 11:43:23 +00:00
Sagar Sharma
4a177113c6 fix: don't set WIP Warehouse if is checked in WO
(cherry picked from commit 9730cd0aec)
2022-11-10 11:43:22 +00:00
Deepesh Garg
972893d00e Merge pull request #32908 from maharshivpatel/item-group-pricing-rule-backport
fix: Pricing rule item group consider UOM
2022-11-10 09:58:50 +05:30
Maharshi Patel
1ed0b6e89b fix: Pricing rule item group consider UOM
Pricing rule's apply_on_field == "item_group" didn't check for UOM. I have added the required checks.

Same as #32566
2022-11-09 17:17:35 +05:30
Deepesh Garg
dafb575500 Merge pull request #32894 from maharshivpatel/add-einvoice-document-date
fix: add Document Date in E-Invoice print format
2022-11-08 21:45:17 +05:30
Frappe PR Bot
9cf5e9e61e chore(release): Bumped to Version 13.41.1
## [13.41.1](https://github.com/frappe/erpnext/compare/v13.41.0...v13.41.1) (2022-11-08)

### Bug Fixes

* `Material Consumption` option in case of `Skip Transfer to WIP` in WO ([418c131](418c131331))
* Create POS Opening Entry POS Profile filter. ([76e4bb4](76e4bb44f1))
* Disable tax included prices for internal transfers ([#32794](https://github.com/frappe/erpnext/issues/32794)) ([84ee1b8](84ee1b86af))
* for asset's purchase_date, if bill_date is set, use that instead of posting_date ([1d23c9a](1d23c9a9fd))
* Reset advance paid amount on Oreder cancel and amend ([e32e0bc](e32e0bc8fa))
* use `flt` instead of `cint` in `get_batch_no` ([601b1e3](601b1e3821))
2022-11-08 12:14:53 +00:00
Deepesh Garg
af8b99a5e0 Merge pull request #32892 from frappe/version-13-hotfix
chore: release v13
2022-11-08 17:43:28 +05:30
Maharshi Patel
a16347f325 fix: add Document Date in E-Invoice print format 2022-11-08 16:35:34 +05:30
Deepesh Garg
19b9875ba8 Merge pull request #32781 from frappe/mergify/bp/version-13-hotfix/pr-32777
fix: Reset advance paid amount on Order cancel and amend (backport #32777)
2022-11-08 10:53:02 +05:30
Deepesh Garg
43aa670e90 Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into mergify/bp/version-13-hotfix/pr-32777 2022-11-08 10:40:07 +05:30
Deepesh Garg
4f76ed1c68 chore: Resolve conflicts 2022-11-08 10:39:21 +05:30
Deepesh Garg
b93d13feef Merge pull request #32865 from frappe/mergify/bp/version-13-hotfix/pr-32846
fix: add german translations (backport #32846)
2022-11-07 18:42:38 +05:30
Raffael Meyer
e1a32cc620 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-32846 2022-11-07 13:18:06 +01:00
barredterra
550f5f280c chore: resolve merge conflicts 2022-11-07 13:15:38 +01:00
Deepesh Garg
fbbfeb8563 Merge pull request #32873 from frappe/mergify/bp/version-13-hotfix/pr-32802
fix: `Material Consumption` option in case of `Skip Transfer to WIP` in WO (backport #32802)
2022-11-07 10:18:14 +05:30
Sagar Sharma
418c131331 fix: Material Consumption option in case of Skip Transfer to WIP in WO
(cherry picked from commit 8ea6983734)
2022-11-07 04:06:55 +00:00
Raffael Meyer
a8bf17e560 chore: add german translations (#32846)
Mostly for balance sheet

(cherry picked from commit d2b6490bca)

# Conflicts:
#	erpnext/translations/de.csv
2022-11-06 04:53:43 +00:00
Deepesh Garg
9961037f71 Merge pull request #32860 from frappe/mergify/bp/version-13-hotfix/pr-32794
fix: Disable tax included prices for internal transfers (backport #32794)
2022-11-05 21:17:09 +05:30
Deepesh Garg
84ee1b86af fix: Disable tax included prices for internal transfers (#32794)
* fix: Disable tax-included prices for internal transfers

(cherry picked from commit 8d30ebb12b)
2022-11-05 15:22:30 +00:00
Deepesh Garg
afe86d83aa Merge pull request #32857 from frappe/mergify/bp/version-13-hotfix/pr-32847
fix: Create POS Opening Entry POS Profile filter. (backport #32847)
2022-11-05 20:52:12 +05:30
Maharshi Patel
76e4bb44f1 fix: Create POS Opening Entry POS Profile filter.
pos_profile_query was variable instead of function.

(cherry picked from commit 1328a45f2a)
2022-11-05 11:15:58 +00:00
Deepesh Garg
c1bc1040b8 Merge pull request #32834 from frappe/mergify/bp/version-13-hotfix/pr-32773
fix: for asset's purchase_date, if bill_date is set, use that instead of posting_date (backport #32773)
2022-11-03 12:06:50 +05:30
anandbaburajan
1d23c9a9fd fix: for asset's purchase_date, if bill_date is set, use that instead of posting_date
(cherry picked from commit f322c608cf)
2022-11-03 06:28:37 +00:00
Sagar Sharma
5a211813d3 Merge pull request #32821 from frappe/mergify/bp/version-13-hotfix/pr-32788
fix: use `flt` instead of `cint` in `get_batch_no` (backport #32788)
2022-11-02 17:08:08 +05:30
Sagar Sharma
601b1e3821 fix: use flt instead of cint in get_batch_no
(cherry picked from commit 9fb3fb4c83)
2022-11-02 10:25:54 +00:00
Frappe PR Bot
6d1ae68d70 chore(release): Bumped to Version 13.41.0
# [13.41.0](https://github.com/frappe/erpnext/compare/v13.40.3...v13.41.0) (2022-11-01)

### Bug Fixes

* add `Sales Order` reference in Material Request Dashboard ([cb89dba](cb89dba5ab))
* Do not force eligibilgity of itc for reverse charge ([9dc0edf](9dc0edfb8a))
* filter return pos in reconciliation tool ([b877b0d](b877b0d3a2))
* group warehouse filter not working for Batch-wise Balance history report ([310e7c5](310e7c522c))
* Issues while cancel/amending Purchase Invoice with TDS enabled ([8888957](8888957952))
* Mode of payment for returns in POS Sales Invoice ([9b63a1a](9b63a1a2e9))

### Features

* Repayment schedule types for term loans ([c2817be](c2817bed0b))
2022-11-01 17:19:09 +00:00
Deepesh Garg
19ebebdc47 Merge pull request #32792 from frappe/version-13-hotfix
chore: release v13
2022-11-01 22:46:15 +05:30
Deepesh Garg
a91483899b Merge pull request #32806 from frappe/mergify/bp/version-13-hotfix/pr-32779
fix: Mode of payment for returns in POS Sales Invoice (backport #32779)
2022-11-01 22:11:50 +05:30
Deepesh Garg
2f6d55d8d2 Merge pull request #32803 from frappe/mergify/bp/version-13-hotfix/pr-32801
fix: Issues while cancel/amending Purchase Invoice with TDS enabled (backport #32801)
2022-11-01 22:11:26 +05:30
Deepesh Garg
4a10454d89 chore: Resolve conflicts 2022-11-01 21:30:36 +05:30
Deepesh Garg
12b15347bc chore: Update tests
(cherry picked from commit 5b74161195)
2022-11-01 15:59:54 +00:00
Deepesh Garg
9b63a1a2e9 fix: Mode of payment for returns in POS Sales Invoice
(cherry picked from commit 06e8e28531)
2022-11-01 15:59:53 +00:00
Deepesh Garg
8888957952 fix: Issues while cancel/amending Purchase Invoice with TDS enabled
(cherry picked from commit f7c9258770)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
2022-11-01 15:18:48 +00:00
ruthra kumar
a9660bf026 Merge pull request #32798 from ruthra-kumar/better_approach_to_list_item_removal
fix: filter return pos in reconciliation tool
2022-11-01 17:28:01 +05:30
ruthra kumar
b877b0d3a2 fix: filter return pos in reconciliation tool 2022-11-01 16:56:35 +05:30
Deepesh Garg
e4082093b8 Merge pull request #32796 from deepeshgarg007/itc_eligibility_reverse_charge
fix: Do not force eligibilgity of itc for reverse charge
2022-11-01 16:32:39 +05:30
Deepesh Garg
9dc0edfb8a fix: Do not force eligibilgity of itc for reverse charge 2022-11-01 16:03:32 +05:30
rohitwaghchaure
e13f05ce19 Merge pull request #32784 from rohitwaghchaure/fixed-warehouse-group-for-batch
fix: group warehouse filter not working for Batch-wise Balance history report
2022-10-31 23:34:00 +05:30
Rohit Waghchaure
310e7c522c fix: group warehouse filter not working for Batch-wise Balance history report 2022-10-31 23:21:29 +05:30
Deepesh Garg
e32e0bc8fa fix: Reset advance paid amount on Oreder cancel and amend
(cherry picked from commit 92f37ca111)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.js
2022-10-31 16:09:48 +00:00
Deepesh Garg
0c24ba0118 Merge pull request #32690 from frappe/mergify/bp/version-13-hotfix/pr-32424
feat: Repayment schedule types for term loans (backport #32424)
2022-10-31 11:57:57 +05:30
Deepesh Garg
60fa87751a chore: Update payroll loan tests 2022-10-31 11:28:32 +05:30
Deepesh Garg
50bc7785f7 chore: reload doctypes 2022-10-31 10:39:03 +05:30
Deepesh Garg
d2aea0cd2e chore: fix datetime value 2022-10-30 11:01:41 +05:30
Deepesh Garg
e9006582fb chore: Add removed field 2022-10-30 10:48:37 +05:30
Deepesh Garg
3483e0e2a5 Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into mergify/bp/version-13-hotfix/pr-32424 2022-10-30 10:46:21 +05:30
Deepesh Garg
65b047c94c chore: Resync Loan Doc 2022-10-30 10:44:15 +05:30
Sagar Sharma
ada3ce21c0 Merge pull request #32757 from frappe/mergify/bp/version-13-hotfix/pr-32754
fix: add `Sales Order` reference in Material Request Dashboard (backport #32754)
2022-10-29 13:52:28 +05:30
Sagar Sharma
cb89dba5ab fix: add Sales Order reference in Material Request Dashboard
(cherry picked from commit 15ebf4a0cf)
2022-10-29 07:07:45 +00:00
Deepesh Garg
d73237e896 chore: Resolve conflicts 2022-10-29 11:06:53 +05:30
Sagar Sharma
8e0d393cd4 Merge pull request #32741 from frappe/mergify/bp/version-13-hotfix/pr-32738
fix: Added Material Request Reference in Purchase Recipt Dashboard for Tracking (backport #32738)
2022-10-28 16:06:35 +05:30
Vishal
292ff1bd6b chore: minor linting issue fixed
(cherry picked from commit e8c0157017)
2022-10-28 08:55:07 +00:00
Vishal
804cf40f69 chore: Added Material Request Reference in Purchase Recipt Dashboard for Tracking
(cherry picked from commit a04c44fe34)
2022-10-28 08:55:06 +00:00
Frappe PR Bot
1d31ab1ab7 chore(release): Bumped to Version 13.40.3
## [13.40.3](https://github.com/frappe/erpnext/compare/v13.40.2...v13.40.3) (2022-10-26)

### Bug Fixes

* allow to create Sales Order from expired Quotation ([#32641](https://github.com/frappe/erpnext/issues/32641)) ([ea03289](ea032893d3))
* Billing Address for inter-company purchase docs ([3a2f08f](3a2f08fbda))
* BOM cost update message ([98bcb72](98bcb7255d))
* conflicts ([447485a](447485ae90))
* incorrect qty in material request ([1741501](1741501ea8))
* overlap error not raised for job card in case of workstation with production capacity ([b5376ce](b5376ce5cb))
* unset contact details ([7afb19f](7afb19f965))
2022-10-26 05:09:20 +00:00
Deepesh Garg
dd493fb46f Merge pull request #32706 from frappe/version-13-hotfix
chore: release v13
2022-10-26 10:37:31 +05:30
Deepesh Garg
85f48dd6bd chore: Update tests
(cherry picked from commit e59b147a62)
2022-10-23 14:09:20 +00:00
Deepesh Garg
fa0a137a38 chore: Add repayment date on option
(cherry picked from commit ef0cb17faf)
2022-10-23 14:09:19 +00:00
Deepesh Garg
5fc8d20e96 chore: label post save
(cherry picked from commit bf7a51791a)
2022-10-23 14:09:18 +00:00
Deepesh Garg
7ddcfc00fc chore: Add patch to update repayment schedule type in loan documents
(cherry picked from commit 679b5ed551)

# Conflicts:
#	erpnext/patches.txt
2022-10-23 14:09:17 +00:00
Deepesh Garg
3f02059085 chore: Update labels as per repayment type
(cherry picked from commit 2ddee50f27)

# Conflicts:
#	erpnext/loan_management/doctype/loan/loan.json
2022-10-23 14:09:14 +00:00
Deepesh Garg
71b21086b1 chore: Remove print statements
(cherry picked from commit 3466461eb3)
2022-10-23 14:09:13 +00:00
Deepesh Garg
c2817bed0b feat: Repayment schedule types for term loans
(cherry picked from commit 76c6ccab5d)

# Conflicts:
#	erpnext/loan_management/doctype/loan/loan.json
#	erpnext/loan_management/doctype/loan/loan.py
2022-10-23 14:09:12 +00:00
Deepesh Garg
dc972718d5 Merge pull request #32687 from frappe/mergify/bp/version-13-hotfix/pr-32650
fix: unset contact details (backport #32650)
2022-10-23 18:32:15 +05:30
barredterra
7afb19f965 fix: unset contact details
(cherry picked from commit 23f0bb45b0)
2022-10-23 12:52:29 +00:00
Deepesh Garg
0ca137808b Merge pull request #32656 from frappe/mergify/bp/version-13-hotfix/pr-32641
fix: allow to create Sales Order from expired Quotation (backport #32641)
2022-10-20 17:34:31 +05:30
rohitwaghchaure
99e0106193 Merge pull request #32670 from frappe/mergify/bp/version-13-hotfix/pr-32667
fix: BOM cost update message (backport #32667)
2022-10-20 16:52:56 +05:30
rohitwaghchaure
447485ae90 fix: conflicts 2022-10-20 15:01:22 +05:30
Rohit Waghchaure
98bcb7255d fix: BOM cost update message
(cherry picked from commit 9cfe527492)

# Conflicts:
#	erpnext/manufacturing/doctype/bom/test_bom.py
2022-10-20 09:09:02 +00:00
Deepesh Garg
2df24ec459 Merge pull request #32664 from frappe/mergify/bp/version-13-hotfix/pr-32659
fix: Billing Address for inter-company purchase docs (backport #32659)
2022-10-20 12:42:38 +05:30
Deepesh Garg
3a2f08fbda fix: Billing Address for inter-company purchase docs
(cherry picked from commit 796f2d3c09)
2022-10-20 06:29:56 +00:00
rohitwaghchaure
7c9b535514 Merge pull request #32661 from frappe/mergify/bp/version-13-hotfix/pr-32654
fix: incorrect qty in material request created from PP (backport #32654)
2022-10-20 10:27:41 +05:30
Rohit Waghchaure
4f0c2909ab test: validate qty and purchase uom in material request which is created from PP
(cherry picked from commit 4d5ef721f7)
2022-10-20 04:30:29 +00:00
Rohit Waghchaure
1741501ea8 fix: incorrect qty in material request
(cherry picked from commit ad278b2007)
2022-10-20 04:30:28 +00:00
Raffael Meyer
ea032893d3 fix: allow to create Sales Order from expired Quotation (#32641)
(cherry picked from commit 4ad3002861)
2022-10-19 16:38:19 +00:00
rohitwaghchaure
7601a016b8 Merge pull request #32653 from frappe/mergify/bp/version-13-hotfix/pr-32645
fix: overlap error not raised for job card in case of workstation with production capacity (backport #32645)
2022-10-19 18:09:44 +05:30
Rohit Waghchaure
b5376ce5cb fix: overlap error not raised for job card in case of workstation with production capacity
(cherry picked from commit 8b2165e0d1)
2022-10-19 11:35:59 +00:00
Frappe PR Bot
7ba029b140 chore(release): Bumped to Version 13.40.2
## [13.40.2](https://github.com/frappe/erpnext/compare/v13.40.1...v13.40.2) (2022-10-19)

### Bug Fixes

* `Brand Defaults` filters ([b1c70af](b1c70af4db))
* don't try to update youtube data if disabled in settings (backport [#32588](https://github.com/frappe/erpnext/issues/32588)) ([#32590](https://github.com/frappe/erpnext/issues/32590)) ([7e7122b](7e7122b668))
* Ignore linked purchase invoice on cancel ([eec770a](eec770a4a8))
* Party account for multi-order invoices ([0ae2a4f](0ae2a4f1c4))
* pricing rule item code UOM apply & conversions (backport [#32566](https://github.com/frappe/erpnext/issues/32566)) ([#32636](https://github.com/frappe/erpnext/issues/32636)) ([b8d97b8](b8d97b82b8))
2022-10-19 03:57:46 +00:00
Deepesh Garg
cf74d24400 Merge pull request #32634 from frappe/version-13-hotfix
chore: release v13
2022-10-19 09:24:40 +05:30
mergify[bot]
b8d97b82b8 fix: pricing rule item code UOM apply & conversions (backport #32566) (#32636)
* fix: pricing rule for non stock UOM and conversions

* fix: pricing rule for non stock UOM and conversions

(cherry picked from commit 96b4211ea1)

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

* chore: resolve conflicts

Co-authored-by: Maharshi Patel <39730881+maharshivpatel@users.noreply.github.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2022-10-18 23:31:31 +05:30
Deepesh Garg
56c4c3186b Merge pull request #32624 from frappe/mergify/bp/version-13-hotfix/pr-32622
fix: Ignore linked purchase invoice on cancel (backport #32622)
2022-10-18 14:49:36 +05:30
Deepesh Garg
015a221d8d chore: Resolve conflicts 2022-10-18 09:11:58 +05:30
Deepesh Garg
eec770a4a8 fix: Ignore linked purchase invoice on cancel
(cherry picked from commit faadf78332)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
2022-10-17 14:09:12 +00:00
Deepesh Garg
44f5ccc9dc Merge pull request #32605 from frappe/mergify/bp/version-13-hotfix/pr-32594
fix: Party account for multi-order invoices (backport #32594)
2022-10-15 18:25:25 +05:30
Deepesh Garg
0ae2a4f1c4 fix: Party account for multi-order invoices
(cherry picked from commit fd49503ba2)
2022-10-15 11:29:21 +00:00
mergify[bot]
5fdaddad86 chore: drop dead code (backport #32595) (#32597)
chore: drop dead code (#32595)

[skip ci]

(cherry picked from commit 50e9698932)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-10-13 15:27:09 +05:30
Sagar Sharma
03ccddc1cc Merge pull request #32587 from frappe/mergify/bp/version-13-hotfix/pr-32576
fix: `Brand Defaults` filters (backport #32576)
2022-10-13 14:42:29 +05:30
Sagar Sharma
e00ebcd9e5 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-32576 2022-10-13 14:38:26 +05:30
mergify[bot]
7e7122b668 fix: don't try to update youtube data if disabled in settings (backport #32588) (#32590)
* fix: don't try to update youtube data if disabled in settings (#32588)

fix: cast value from db

[skip ci]

(cherry picked from commit e543dca6a0)

* chore: qualified path

not imported 

[skip ci]

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-10-13 11:57:08 +05:30
Sagar Sharma
b1c70af4db fix: Brand Defaults filters
(cherry picked from commit 7da32c7db3)
2022-10-12 13:53:56 +00:00
Frappe PR Bot
1609129e1e chore(release): Bumped to Version 13.40.1
## [13.40.1](https://github.com/frappe/erpnext/compare/v13.40.0...v13.40.1) (2022-10-12)

### Bug Fixes

* conflct in test purchase receipt ([6ae2f90](6ae2f90683))
* conflict ([cb7aef5](cb7aef505d))
* consider outgoingrate while valuation rate calculate ([6f43133](6f43133c04))
* consider sales rate as incoming rate for transit warehouse in purchase flow ([f72602e](f72602ebf3))
* Hanlde rounding loss for internal transfer ([dd26ef9](dd26ef96e0))
* Incoming rate precision fixes for intra company transfer ([227ce5f](227ce5f8a2))
* incorrect import ([8238b89](8238b89907))
* linter issue ([aa0552d](aa0552d788))
* test case ([acd64ba](acd64ba7c1))
* value error on pos submit ([4383980](4383980bcc))
2022-10-12 12:34:41 +00:00
Deepesh Garg
9b02455c09 Merge pull request #32585 from frappe/version-13-hotfix
chore: version 13 release
2022-10-12 18:03:01 +05:30
Deepesh Garg
ff3bfb060a Merge pull request #32584 from frappe/mergify/bp/version-13-hotfix/pr-32557
fix: Value error on validation of POS invoices with Serial Nos (backport #32557)
2022-10-12 17:17:01 +05:30
rohitwaghchaure
63e087d31e Merge pull request #32580 from frappe/mergify/bp/version-13-hotfix/pr-32563
fix: consider sales rate as incoming rate for transit warehouse in purchase flow (backport #32563)
2022-10-12 17:08:33 +05:30
Deepesh Garg
b62a397397 Merge pull request #32581 from frappe/mergify/bp/version-13-hotfix/pr-32272
fix: Incoming rate precision fixes for intra company transfer (backport #32272)
2022-10-12 17:04:52 +05:30
ruthra kumar
48efcc82b6 test: value error on serial no validation on pos
(cherry picked from commit 9e2bd10d03)
2022-10-12 11:12:09 +00:00
ruthra kumar
4383980bcc fix: value error on pos submit
(cherry picked from commit 4b908ebcd6)
2022-10-12 11:12:08 +00:00
rohitwaghchaure
aa0552d788 fix: linter issue 2022-10-12 16:33:53 +05:30
Deepesh Garg
3b5889ef85 chore: resolve conflicts 2022-10-12 16:30:23 +05:30
rohitwaghchaure
8238b89907 fix: incorrect import 2022-10-12 16:28:31 +05:30
rohitwaghchaure
6ae2f90683 fix: conflct in test purchase receipt 2022-10-12 16:26:52 +05:30
rohitwaghchaure
cb7aef505d fix: conflict 2022-10-12 16:24:50 +05:30
Deepesh Garg
4a8c42d62b chore: check only for inter-company transfers
(cherry picked from commit 9aa5e20ef7)
2022-10-12 10:54:15 +00:00
Deepesh Garg
c67bdcf3c6 chore: fix precision condition
(cherry picked from commit 49601558c6)
2022-10-12 10:54:14 +00:00
Deepesh Garg
7a9e7b66ac chore: Use proper accounts
(cherry picked from commit 1c05c004cd)
2022-10-12 10:54:13 +00:00
Deepesh Garg
151b9d4d7b chore: Increase precision for other doc fields
(cherry picked from commit c8d2181498)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
#	erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
2022-10-12 10:54:13 +00:00
Deepesh Garg
b966f10711 chore: GL Entries for SLE diff
(cherry picked from commit df2a0e265b)
2022-10-12 10:54:11 +00:00
Deepesh Garg
0b48f13873 test: Internal tranfer precision loss test
(cherry picked from commit dc20b21fb5)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
2022-10-12 10:54:10 +00:00
Deepesh Garg
b531a38efe chore: Increase incoming_rate field precision to 6
(cherry picked from commit b31c3bd35d)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
2022-10-12 10:54:08 +00:00
Deepesh Garg
dd26ef96e0 fix: Hanlde rounding loss for internal transfer
(cherry picked from commit 6e47fd54a0)
2022-10-12 10:54:07 +00:00
Deepesh Garg
227ce5f8a2 fix: Incoming rate precision fixes for intra company transfer
(cherry picked from commit 083309c056)
2022-10-12 10:54:06 +00:00
Rohit Waghchaure
acd64ba7c1 fix: test case
(cherry picked from commit 98bf8e1304)
2022-10-12 10:51:22 +00:00
Rohit Waghchaure
6f43133c04 fix: consider outgoingrate while valuation rate calculate
(cherry picked from commit 3266e54e33)
2022-10-12 10:51:22 +00:00
Rohit Waghchaure
f72602ebf3 fix: consider sales rate as incoming rate for transit warehouse in purchase flow
(cherry picked from commit 683a47f7a1)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
#	erpnext/stock/stock_ledger.py
2022-10-12 10:51:21 +00:00
Frappe PR Bot
49c9c68e14 chore(release): Bumped to Version 13.40.0
# [13.40.0](https://github.com/frappe/erpnext/compare/v13.39.5...v13.40.0) (2022-10-12)

### Bug Fixes

* Do not add tax withheld vouchers post tax withheding in one document ([e1c41b9](e1c41b9195))
* future attendance marking ([cb4fbd5](cb4fbd5432))
* make readings status mandatory in Quality Inspection ([257a2a3](257a2a3d71))
* mark attendance issue with joining date ([6f8d620](6f8d62088e))
* mark attendance issue with relieving date ([a9546dd](a9546dd01f))
* PO cancel post advance payment cancel against PO ([41599cf](41599cf29f))
* set Quality Inspection status based on readings status ([d67b44f](d67b44fcec))
* Tax withholding related fixes ([32a9575](32a9575f07))
* **test:** `test_rejected_qi_validation` ([2763d06](2763d06307))
* TooManyWritesError during reposting of stock ([476175b](476175b307))

### Features

* cst ux improvement ([552c595](552c5951bd))
* **JE:** trigger account field when fetched from template ([baa4fec](baa4fec611)), closes [#32409](https://github.com/frappe/erpnext/issues/32409)
2022-10-12 07:21:47 +00:00
Ankush Menat
9ce765b268 Merge pull request #32561 from frappe/version-13-hotfix
chore: release v13
2022-10-12 12:49:45 +05:30
Ankush Menat
002ae8ae13 ci: disable test orchestrator v13 (#32574) 2022-10-12 12:13:51 +05:30
Deepesh Garg
558dc57b94 Merge pull request #32539 from frappe/mergify/bp/version-13-hotfix/pr-32536
fix: PO cancel post advance payment cancel against PO (backport #32536)
2022-10-11 13:58:24 +05:30
Deepesh Garg
cd942d36a8 chore: resolve conflicts 2022-10-11 10:16:31 +05:30
Sagar Sharma
3257533ee3 Merge pull request #32544 from frappe/mergify/bp/version-13-hotfix/pr-32497
chore: set `Quality Inspection` status based on readings status (backport #32497)
2022-10-10 12:10:29 +05:30
Sagar Sharma
2763d06307 fix(test): test_rejected_qi_validation
(cherry picked from commit 4992e4a2b8)
2022-10-10 05:21:09 +00:00
Sagar Sharma
a0772ea8d7 test: add test cases for Quality Inspection status
(cherry picked from commit fcc1272d42)
2022-10-10 05:21:08 +00:00
Sagar Sharma
d67b44fcec fix: set Quality Inspection status based on readings status
(cherry picked from commit 2657ece2cd)
2022-10-10 05:21:08 +00:00
Sagar Sharma
257a2a3d71 fix: make readings status mandatory in Quality Inspection
(cherry picked from commit d7c3b7633a)
2022-10-10 05:21:07 +00:00
Sagar Sharma
e6abbd1c83 chore: add Manual Inspection field in Quality Inspection DocType
(cherry picked from commit 39707757a6)
2022-10-10 05:21:06 +00:00
Deepesh Garg
41599cf29f fix: PO cancel post advance payment cancel against PO
(cherry picked from commit d806e32030)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.py
2022-10-09 13:05:46 +00:00
Frappe PR Bot
c66ebcdf9a chore(release): Bumped to Version 13.39.5
## [13.39.5](https://github.com/frappe/erpnext/compare/v13.39.4...v13.39.5) (2022-10-07)

### Bug Fixes

* Do not add tax withheld vouchers post tax withheding in one document ([be404b7](be404b77a1))
* Tax withholding related fixes ([6e9b52d](6e9b52d268))
2022-10-07 13:08:29 +00:00
Deepesh Garg
4623b986a3 Merge pull request #32526 from frappe/mergify/bp/version-13/pr-32523
fix: Tax withholding related fixes (backport #32522) (backport #32523)
2022-10-07 18:36:57 +05:30
Deepesh Garg
611dd5c073 chore: resolve conflicts
(cherry picked from commit 2bf76f64bd)
2022-10-07 12:39:14 +00:00
Deepesh Garg
be404b77a1 fix: Do not add tax withheld vouchers post tax withheding in one document
(cherry picked from commit 781d160c68)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
(cherry picked from commit e1c41b9195)
2022-10-07 12:39:13 +00:00
Deepesh Garg
6e9b52d268 fix: Tax withholding related fixes
(cherry picked from commit abf5b6be3e)
(cherry picked from commit 32a9575f07)
2022-10-07 12:39:13 +00:00
Deepesh Garg
997990c69f Merge pull request #32523 from frappe/mergify/bp/version-13-hotfix/pr-32522
fix: Tax withholding related fixes (backport #32522)
2022-10-07 18:08:31 +05:30
Deepesh Garg
2bf76f64bd chore: resolve conflicts 2022-10-07 17:33:03 +05:30
Deepesh Garg
e1c41b9195 fix: Do not add tax withheld vouchers post tax withheding in one document
(cherry picked from commit 781d160c68)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
2022-10-07 11:03:16 +00:00
Deepesh Garg
32a9575f07 fix: Tax withholding related fixes
(cherry picked from commit abf5b6be3e)
2022-10-07 11:03:15 +00:00
Deepesh Garg
e031e095dd Merge pull request #32521 from FHenry/13_fr_translation
chore: fr translation (backport #32385)
2022-10-07 08:48:43 +05:30
Florian HENRY
39ce3756c8 chore: fr translation 2022-10-06 22:39:40 +02:00
Deepesh Garg
f2515d9c9c Merge pull request #32449 from rtdany10/cst-ux-improvement
feat(ux): improved course scheduling tool
2022-10-05 18:44:05 +05:30
Deepesh Garg
27fe9c9179 Merge pull request #32426 from AnandBaburajan/fix_mark_attendance_joining_date_and_future
fix: mark attendance issue with joining and relieving date, and fix future attendance marking
2022-10-05 18:34:31 +05:30
Deepesh Garg
503183cb0b Merge pull request #32502 from frappe/mergify/bp/version-13-hotfix/pr-32499
fix: TooManyWritesError during reposting of stock (backport #32499)
2022-10-05 17:29:25 +05:30
Deepesh Garg
f1ea5de022 Merge pull request #32504 from frappe/mergify/bp/version-13-hotfix/pr-32478
feat(JE): trigger account field when fetched from template (backport #32478)
2022-10-05 17:29:05 +05:30
Dany Robert
baa4fec611 feat(JE): trigger account field when fetched from template
Closes #32409

(cherry picked from commit c35adcf5a1)
2022-10-05 10:38:21 +00:00
Rohit Waghchaure
476175b307 fix: TooManyWritesError during reposting of stock
(cherry picked from commit aaabba9b1e)
2022-10-05 10:35:55 +00:00
Frappe PR Bot
de584535e9 chore(release): Bumped to Version 13.39.4
## [13.39.4](https://github.com/frappe/erpnext/compare/v13.39.3...v13.39.4) (2022-10-04)

### Bug Fixes

* asset requiring maintenance sold status ([14ab9d9](14ab9d9158))
* conflict ([0f8e34e](0f8e34e972))
* Disbursement Account in patch to update old loans ([b4a511c](b4a511cbb4))
* e-Way bill JSON for Intra-state internal transfers ([b7fbf75](b7fbf75e10))
* fetch swift_number in payment_request ([6074570](60745705a8))
* Incorrect TCS amount deducted in Sales Invoice ([32456bf](32456bff30))
* Item details fetching on making transaction from item dashboard ([1aed76f](1aed76f778))
* linter issue ([4757a65](4757a65863))
* not able to return sold expired batches ([2fd4485](2fd4485f2f))
* payment reconciliation tool consider cost_center for JV ([9f98891](9f988910b5))
* payment request make bank field Link instead of Read Only ([299175e](299175e6fe))
* pick list picked-qty for batch item ([96a6db0](96a6db0422))
* SEZ Without Payment of Tax don't add tax rows ([a13eecc](a13eecc961))
* show `Make Purchase Invoice` button based on permission ([7124328](7124328640))
* typo in sales_register's filter mode_of_payment (backport [#32371](https://github.com/frappe/erpnext/issues/32371)) ([#32447](https://github.com/frappe/erpnext/issues/32447)) ([cdc8297](cdc8297083))
* update with new Frappe color. fix [#32455](https://github.com/frappe/erpnext/issues/32455) ([#32456](https://github.com/frappe/erpnext/issues/32456)) ([ad43b18](ad43b18ace))

### Reverts

* Revert "fix: fetch swift_number in payment_request" ([8251b84](8251b843ec))
2022-10-04 12:14:27 +00:00
Deepesh Garg
d95d234aa4 Merge pull request #32494 from frappe/version-13-hotfix
chore: release v13
2022-10-04 17:41:06 +05:30
rohitwaghchaure
3648745e5e Merge pull request #32470 from frappe/mergify/bp/version-13-hotfix/pr-32466
fix: not able to return sold expired batches (backport #32466)
2022-10-04 07:35:10 +05:30
Deepesh Garg
8e1e6a194b Merge pull request #32467 from frappe/mergify/bp/version-13-hotfix/pr-32394
fix: fetch swift number in payment request from bank doctype (backport #32394)
2022-10-03 21:54:05 +05:30
Ankush Menat
663e9b403f chore: codeowners 2022-10-03 16:27:32 +05:30
Ankush Menat
3219b7c766 chore: codeowners 2022-10-03 16:27:13 +05:30
Sagar Sharma
3a6e4c8da7 Merge pull request #32474 from frappe/mergify/bp/version-13-hotfix/pr-32472
fix: pick list picked-qty for batch item (backport #32472)
2022-10-03 15:24:02 +05:30
Sagar Sharma
96a6db0422 fix: pick list picked-qty for batch item
(cherry picked from commit ba02209f1d)
2022-10-03 09:17:03 +00:00
rohitwaghchaure
4757a65863 fix: linter issue 2022-10-03 13:27:38 +05:30
rohitwaghchaure
0f8e34e972 fix: conflict 2022-10-03 13:18:58 +05:30
Rohit Waghchaure
2fd4485f2f fix: not able to return sold expired batches
(cherry picked from commit 0b1727cf79)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
2022-10-03 07:46:13 +00:00
Maharshi Patel
299175e6fe fix: payment request make bank field Link instead of Read Only
(cherry picked from commit dc8d49260c)
2022-10-03 07:26:06 +00:00
Maharshi Patel
8251b843ec Revert "fix: fetch swift_number in payment_request"
This reverts commit f42a8e4e03.

(cherry picked from commit 9245d3b5cd)
2022-10-03 07:26:05 +00:00
Maharshi Patel
60745705a8 fix: fetch swift_number in payment_request
There isn't direct link between payment_request and bank so swift_number wasn't fetched using Fetch form. I fixed it by fetching swift_number on_change of bank_account.

(cherry picked from commit f42a8e4e03)
2022-10-03 07:26:04 +00:00
Deepesh Garg
caedc9f6ad Merge pull request #32462 from frappe/mergify/bp/version-13-hotfix/pr-32456
fix: update with new Frappe color. fix #32455 (backport #32456)
2022-10-03 09:15:21 +05:30
Deepesh Garg
fbeb86b9c0 Merge pull request #32453 from deepeshgarg007/intra_state_transfer_eway_bill_v13
fix: e-Way bill JSON for Intra-state internal transfers
2022-10-03 09:07:26 +05:30
Muvuk
ad43b18ace fix: update with new Frappe color. fix #32455 (#32456)
* Update with new Frappe color.

* refactor: use css variables

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
(cherry picked from commit 73e5a7d671)
2022-10-02 17:02:25 +00:00
Frappe PR Bot
34284216cd chore(release): Bumped to Version 13.39.3
## [13.39.3](https://github.com/frappe/erpnext/compare/v13.39.2...v13.39.3) (2022-10-02)

### Bug Fixes

* asset requiring maintenance sold status ([a668d4e](a668d4e789))
2022-10-02 15:39:08 +00:00
Deepesh Garg
5c6c9812c0 Merge pull request #32458 from frappe/mergify/bp/version-13/pr-32413
fix: status of assets with maintenance_required changing back to 'Partially Depreciated' some time after being sold [v13] (backport #32413)
2022-10-02 21:07:00 +05:30
anandbaburajan
4afd2b7470 chore: refactor by just using a filter
(cherry picked from commit 6b21deedae)
2022-10-02 12:14:41 +00:00
anandbaburajan
bc21ce412b chore: refactor by creating is_sold
(cherry picked from commit 430a4c98a0)
2022-10-02 12:14:41 +00:00
anandbaburajan
a668d4e789 fix: asset requiring maintenance sold status
(cherry picked from commit 14ab9d9158)
2022-10-02 12:14:40 +00:00
Deepesh Garg
9f8d3e43ea Merge pull request #32413 from AnandBaburajan/fix_asset_sold_status_v13
fix: status of assets with maintenance_required changing back to 'Partially Depreciated' some time after being sold [v13]
2022-10-02 17:43:09 +05:30
Deepesh Garg
9dbb2bf512 Merge pull request #32369 from maharshivpatel/fix-taxes-sez-without-payment-of-tax
fix: SEZ Without Payment of Tax don't add tax rows
2022-10-01 16:13:11 +05:30
Deepesh Garg
8c52c71299 Merge pull request #32344 from maharshivpatel/fix-payment-reconciliation-jv-cost-center
fix: consider cost center for journal entry in payment reconciliation tool
2022-10-01 16:12:30 +05:30
Deepesh Garg
c4c52c1cd3 chore: Linting Issues 2022-10-01 16:06:31 +05:30
Deepesh Garg
b7fbf75e10 fix: e-Way bill JSON for Intra-state internal transfers 2022-10-01 15:58:31 +05:30
Dany Robert
6dabfbedf1 Merge branch 'version-13-hotfix' into cst-ux-improvement 2022-10-01 14:19:31 +05:30
Dany Robert
68c592377b chore: pre-commit 2022-09-30 23:41:01 -07:00
Deepesh Garg
d69d2217f6 Merge pull request #32431 from frappe/mergify/bp/version-13-hotfix/pr-32402
fix: Item details fetching on making transaction from item dashboard (backport #32402)
2022-10-01 12:05:26 +05:30
mergify[bot]
cdc8297083 fix: typo in sales_register's filter mode_of_payment (backport #32371) (#32447)
fix: typo in sales_register's filter mode_of_payment (#32371)
2022-10-01 12:04:40 +05:30
Dany Robert
f24f71f387 Merge branch 'version-13-hotfix' into cst-ux-improvement 2022-10-01 12:03:05 +05:30
Dany Robert
552c5951bd feat: cst ux improvement 2022-09-30 23:25:55 -07:00
Deepesh Garg
562025eb45 Merge branch 'version-13-hotfix' into fix-payment-reconciliation-jv-cost-center 2022-10-01 11:10:21 +05:30
Deepesh Garg
f0a37f545a chore: resolve conflicts 2022-10-01 11:02:40 +05:30
Deepesh Garg
001afb96ba Merge pull request #32435 from frappe/mergify/bp/version-13-hotfix/pr-32412
fix: Incorrect TCS amount deducted in Sales Invoice (backport #32412)
2022-10-01 11:01:05 +05:30
Deepesh Garg
61d3370527 chore: Remove print statements
(cherry picked from commit bff3cd9068)
2022-09-30 10:36:20 +00:00
Deepesh Garg
32456bff30 fix: Incorrect TCS amount deducted in Sales Invoice
(cherry picked from commit 08443c6421)
2022-09-30 10:36:20 +00:00
Deepesh Garg
1aed76f778 fix: Item details fetching on making transaction from item dashboard
(cherry picked from commit 0439e41a44)

# Conflicts:
#	erpnext/stock/doctype/item/item.js
2022-09-30 10:27:36 +00:00
anandbaburajan
308c400c6a chore: make linter happy 2022-09-30 15:33:34 +05:30
anandbaburajan
a9546dd01f fix: mark attendance issue with relieving date 2022-09-30 15:27:03 +05:30
anandbaburajan
cb4fbd5432 fix: future attendance marking 2022-09-30 14:48:30 +05:30
anandbaburajan
6f8d62088e fix: mark attendance issue with joining date 2022-09-30 14:46:57 +05:30
Anand Baburajan
5d66646fcd Merge branch 'version-13-hotfix' into fix_asset_sold_status_v13 2022-09-29 22:49:10 +05:30
Sagar Sharma
6a58d15497 Merge pull request #32419 from frappe/mergify/bp/version-13-hotfix/pr-32404
fix(ux): show `Make Purchase Invoice` button based on permission (backport #32404)
2022-09-29 17:16:15 +05:30
anandbaburajan
6b21deedae chore: refactor by just using a filter 2022-09-29 15:37:04 +05:30
Sagar Sharma
7124328640 fix: show Make Purchase Invoice button based on permission
(cherry picked from commit 80080a3d7b)
2022-09-29 09:27:03 +00:00
anandbaburajan
430a4c98a0 chore: refactor by creating is_sold 2022-09-29 08:59:49 +05:30
Anand Baburajan
c65fb64578 Merge branch 'version-13-hotfix' into fix_asset_sold_status_v13 2022-09-28 21:36:48 +05:30
anandbaburajan
14ab9d9158 fix: asset requiring maintenance sold status 2022-09-28 21:25:42 +05:30
Deepesh Garg
1095052479 Merge pull request #32410 from frappe/mergify/bp/version-13-hotfix/pr-32403
fix: Disbursement Account in patch to update old loans (backport #32403)
2022-09-28 20:13:45 +05:30
Deepesh Garg
b4a511cbb4 fix: Disbursement Account in patch to update old loans
(cherry picked from commit be623ce8e8)
2022-09-28 14:06:42 +00:00
Frappe PR Bot
a77388d520 chore(release): Bumped to Version 13.39.2
## [13.39.2](https://github.com/frappe/erpnext/compare/v13.39.1...v13.39.2) (2022-09-28)

### Bug Fixes

* `For Quantity` error msg in `Stock Entry` ([a194d28](a194d28b69))
* Add return against indexes for POS Invoice ([9e8e7aa](9e8e7aab70))
* Add return against indexes for POS Invoice ([6c528d4](6c528d469d))
* allow to return expired batches using purchase return ([02468a9](02468a902f))
* consider overproduction percentage for WO finish button ([ed4ac10](ed4ac100ba))
* difference amount calculation on payment reconciliation ([d68cdb4](d68cdb4f5e))
* don't count half day in absent days in Monthly Attendance Sheet summarized view ([#32399](https://github.com/frappe/erpnext/issues/32399)) ([255aa7a](255aa7a84a))
* **e-invoicing:** local variable 'res' referenced before assignment ([#32352](https://github.com/frappe/erpnext/issues/32352)) ([8f961ab](8f961abe8b))
* get amount in words for debit note ([0cd1cac](0cd1cacc29))
* GST Itemised Sales Register GSTIN filter ([#32367](https://github.com/frappe/erpnext/issues/32367)) ([988c5b9](988c5b95e6))
* item_code key error in production plan ([638d5e9](638d5e9dc3))
* Move subscription process to hourly long quque ([447c553](447c553954))
* opening entry causing discepancy between stock and trial balance ([70c68f0](70c68f011a))
* POS only validate QTY if is_stock_item ([ac8100f](ac8100f1e5))
* POS properly validate stock for bundle products ([96fa14b](96fa14be88))
* Reduce font size for Process Statement of accounts print/pdf ([1cfeb93](1cfeb9371c))
* remove no_copy for ignore_pricing_rule ([8abfdb6](8abfdb6598))
* total value in all keys ([80d046a](80d046a38c))
2022-09-28 10:10:58 +00:00
Deepesh Garg
eda6076a43 Merge pull request #32374 from frappe/version-13-hotfix
chore: release v13
2022-09-28 15:39:01 +05:30
Deepesh Garg
0b2405bbdf Merge pull request #32395 from frappe/mergify/bp/version-13-hotfix/pr-32379
fix: POS only validate QTY if is_stock_item (backport #32379)
2022-09-28 15:12:47 +05:30
Rucha Mahabal
255aa7a84a fix: don't count half day in absent days in Monthly Attendance Sheet summarized view (#32399) 2022-09-28 15:02:21 +05:30
Deepesh Garg
a604eed1b9 chore: Resolve conflicts 2022-09-28 14:49:25 +05:30
Maharshi Patel
96fa14be88 fix: POS properly validate stock for bundle products
Stock availability was not calculated properly for Product Bundle with non stock item so i have added logic to properly calculate that as well.

(cherry picked from commit e392ea1104)

# Conflicts:
#	erpnext/selling/page/point_of_sale/pos_item_details.js
2022-09-28 08:16:02 +00:00
Maharshi Patel
ac8100f1e5 fix: POS only validate QTY if is_stock_item
POS invoice raised " Item not available " validation error even though item is non_stock.

(cherry picked from commit e39e088f18)
2022-09-28 08:16:00 +00:00
Deepesh Garg
07cc05785e Merge pull request #32386 from frappe/mergify/bp/version-13-hotfix/pr-32382
fix: Move subscription process to hourly long queue (backport #32382)
2022-09-28 10:39:08 +05:30
Deepesh Garg
f03fbc0e6d chore: Resolve conflicts 2022-09-28 08:10:37 +05:30
Deepesh Garg
447c553954 fix: Move subscription process to hourly long quque
(cherry picked from commit 82a2f31ada)

# Conflicts:
#	erpnext/hooks.py
2022-09-27 18:09:32 +00:00
Deepesh Garg
b2e9dccc8c Merge pull request #32384 from frappe/mergify/bp/version-13-hotfix/pr-32378
fix: Add return against indexes for POS Invoice (backport #32378)
2022-09-27 23:34:50 +05:30
Deepesh Garg
9e8e7aab70 fix: Add return against indexes for POS Invoice
(cherry picked from commit cbfe28286a)
2022-09-27 16:52:59 +00:00
Deepesh Garg
6c528d469d fix: Add return against indexes for POS Invoice
(cherry picked from commit 1f6205e1ea)
2022-09-27 16:52:59 +00:00
Maharshi Patel
988c5b95e6 fix: GST Itemised Sales Register GSTIN filter (#32367)
fix: GST Itemised Sales Register GSTIN filte
2022-09-27 22:21:14 +05:30
Sagar Sharma
1f2887d601 Merge pull request #32381 from frappe/mergify/bp/version-13-hotfix/pr-32377
fix: consider overproduction percentage for WO finish button (backport #32377)
2022-09-27 18:51:37 +05:30
Sagar Sharma
ed4ac100ba fix: consider overproduction percentage for WO finish button
(cherry picked from commit 05392e0918)
2022-09-27 12:15:43 +00:00
Sagar Sharma
a194d28b69 fix: For Quantity error msg in Stock Entry
(cherry picked from commit 9049db41ae)
2022-09-27 12:15:42 +00:00
rohitwaghchaure
3217924242 Merge pull request #32373 from frappe/mergify/bp/version-13-hotfix/pr-32370
fix: Not allowing to return expired batches using purchase return (backport #32370)
2022-09-27 14:44:30 +05:30
Rohit Waghchaure
02468a902f fix: allow to return expired batches using purchase return
(cherry picked from commit a4a86ee23f)
2022-09-27 08:51:26 +00:00
Maharshi Patel
a13eecc961 fix: SEZ Without Payment of Tax don't add tax rows
taxes were added even when gst_category was SEZ and export_type was Without Payment of Tax
2022-09-27 13:40:04 +05:30
rohitwaghchaure
776ee53a25 Merge pull request #32358 from frappe/mergify/bp/version-13-hotfix/pr-32346
refactor: rewrite `Item Price Stock Report` queries in `QB` (backport #32346)
2022-09-27 10:44:05 +05:30
rohitwaghchaure
ddf5565c67 Merge pull request #32366 from frappe/mergify/bp/version-13-hotfix/pr-32339
fix: opening entry causing discrepancy between stock and trial balance (backport #32339)
2022-09-27 09:57:01 +05:30
Maharshi Patel
4152a9f026 Merge branch 'version-13-hotfix' into fix-payment-reconciliation-jv-cost-center 2022-09-26 23:03:39 +05:30
Saqib Ansari
8f961abe8b fix(e-invoicing): local variable 'res' referenced before assignment (#32352) 2022-09-26 22:42:07 +05:30
Rohit Waghchaure
70c68f011a fix: opening entry causing discepancy between stock and trial balance
(cherry picked from commit bc3ab45af2)
2022-09-26 15:03:48 +00:00
Sagar Sharma
9066009e89 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-32346 2022-09-26 18:18:41 +05:30
Sagar Sharma
9332e7f96f Merge pull request #32360 from frappe/mergify/bp/version-13-hotfix/pr-32347
refactor: rewrite `Incorrect Stock Value Report` queries in `QB` (backport #32347)
2022-09-26 18:18:01 +05:30
Sagar Sharma
d6a335e59f refactor: rewrite Incorrect Stock Value Report queries in QB
(cherry picked from commit b93331e844)
2022-09-26 11:40:21 +00:00
Sagar Sharma
a66002f774 refactor: rewrite Item Price Stock Report queries in QB
(cherry picked from commit 22299d2382)
2022-09-26 11:39:24 +00:00
ruthra kumar
6eb3428f8e Merge pull request #32348 from frappe/mergify/bp/version-13-hotfix/pr-32303
fix: difference amount calculation and popup on payment reconciliation (backport #32303)
2022-09-26 14:18:09 +05:30
ruthra kumar
d158784472 Merge pull request #32350 from frappe/mergify/bp/version-13-hotfix/pr-32310
fix: total value in all keys (backport #32310)
2022-09-26 12:05:04 +05:30
nishibakabeer
80d046a38c fix: total value in all keys
Gross and net profit report showing wrong values in monthly quarterly and half yearly filters which is the total value
@ruthra-kumar added in develop branch as suggested ( https://github.com/frappe/erpnext/pull/32020)

(cherry picked from commit 6919f389aa)
2022-09-26 06:03:15 +00:00
ruthra kumar
d68cdb4f5e fix: difference amount calculation on payment reconciliation
(cherry picked from commit 122d5f2729)
2022-09-26 10:36:08 +05:30
Maharshi Patel
9f988910b5 fix: payment reconciliation tool consider cost_center for JV
We need to consider cost center in all four cases of get_conditions. I have removed check in if statement for get_invoices, get_payments, get_return_invoices as it is not required.
2022-09-25 23:24:59 +05:30
Deepesh Garg
09cd480c81 Merge pull request #32333 from frappe/mergify/bp/version-13-hotfix/pr-32117
fix: Reduce font size for Process Statement of accounts print/pdf (backport #32117)
2022-09-25 17:20:57 +05:30
Sagar Sharma
4777991a74 Merge pull request #32338 from frappe/mergify/bp/version-13-hotfix/pr-32324
refactor: rewrite `Production Planning Report` queries in `QB` (backport #32324)
2022-09-23 10:38:20 +05:30
Sagar Sharma
1301a6ff7f refactor: rewrite Production Planning Report queries in QB
(cherry picked from commit 8417b9b99c)
2022-09-23 04:20:42 +00:00
Sagar Sharma
a6a5f63af2 Merge pull request #32328 from s-aga-r/backport/v13-h/32309
fix: item_code key error in production plan (backport #32309)
2022-09-23 09:48:25 +05:30
Deepesh Garg
1cfeb9371c fix: Reduce font size for Process Statement of accounts print/pdf
(cherry picked from commit 6bfd193b0d)
2022-09-22 19:38:55 +00:00
Rohit Waghchaure
638d5e9dc3 fix: item_code key error in production plan 2022-09-22 18:09:12 +05:30
Sagar Sharma
b4ee72e15e Merge pull request #32316 from s-aga-r/backport/v13-h/32304
refactor: rewrite `Exponential Smoothing Forecasting` queries in `QB` (backport #32304)
2022-09-22 11:16:22 +05:30
Sagar Sharma
2a9b519773 Merge branch 'version-13-hotfix' into backport/v13-h/32304 2022-09-22 01:32:20 +05:30
Sagar Sharma
57136fa921 Merge pull request #32315 from s-aga-r/backport/v13-h/32153
refactor: rewrite Work Order Stock Report queries in QB (backport #32153)
2022-09-22 01:31:18 +05:30
Sagar Sharma
882542c2d5 Merge branch 'version-13-hotfix' into backport/v13-h/32153 2022-09-22 01:31:04 +05:30
Sagar Sharma
0a4025e7e0 Merge pull request #32314 from s-aga-r/backport/v13-h/32161
refactor: rewrite Process Loss Report queries in QB (backport #32161)
2022-09-22 01:30:40 +05:30
Sagar Sharma
54dfd50391 refactor: rewrite Exponential Smoothing Forecasting queries in QB 2022-09-21 21:27:04 +05:30
Sagar Sharma
45d02ceb4e refactor: rewrite Work Order Stock Report queries in QB 2022-09-21 21:20:03 +05:30
Sagar Sharma
f72bb18da7 refactor: rewrite Process Loss Report queries in QB 2022-09-21 21:13:10 +05:30
Deepesh Garg
f371008cd9 Merge pull request #32293 from frappe/mergify/bp/version-13-hotfix/pr-32284
fix: remove no_copy for ignore_pricing_rule (backport #32284)
2022-09-21 16:41:25 +05:30
Deepesh Garg
82e5a784cb Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-32284 2022-09-21 13:08:41 +05:30
Deepesh Garg
d267372334 Merge pull request #32299 from frappe/mergify/bp/version-13-hotfix/pr-32296
fix: get amount in words for debit note (backport #32296)
2022-09-21 13:07:39 +05:30
Sagar Sharma
92c7d074dd Merge pull request #32307 from s-aga-r/backport/13/refactor/report/exponential-smoothing-forecasting
refactor: rewrite `BOM Variance Report` queries in `QB` (backport #32297)
2022-09-21 12:42:10 +05:30
Sagar Sharma
cedc8d28e4 refactor: rewrite BOM Variance Report queries in QB 2022-09-21 12:13:05 +05:30
Frappe PR Bot
be4fdca6c7 chore(release): Bumped to Version 13.39.1
## [13.39.1](https://github.com/frappe/erpnext/compare/v13.39.0...v13.39.1) (2022-09-20)

### Bug Fixes

* Add child table for tax withheld vouchers ([4165fee](4165fee6a7))
* Change Department fieldtype to Link in Leave Balance Report ([#32252](https://github.com/frappe/erpnext/issues/32252)) ([e2e69dc](e2e69dced7))
* dont show zero qty available items in stock ageing report ([37dbc70](37dbc7043a))
* fetch description only if empty on the payment schedule ([07a7fdb](07a7fdbe6c))
* Fetch vouchers to show in Invoice ([51d7c0b](51d7c0bfe4))
* incorrect gl if tax on multi currency payment entry ([d9d6a07](d9d6a07bbb))
* item wise sales register taxes and charges ([e65990e](e65990eb34))
* make `po_detail` or `sco_rm_detail` mandatory for SE `Send to Subcontractor` ([0329642](0329642116))
* Parent Level project linkning on creating PO from project ([3c3e3cf](3c3e3cfcf8))
* pending accrual entries ([ef86b43](ef86b437cb))
* production plan pending-qty ([2dcb35d](2dcb35da33))
* remove return pos from pos reconciliation tool ([e9bf74e](e9bf74e589))
* TDS deduction via journal entry ([ca0cce7](ca0cce7599))
* use default supplier currency if default supplier is enabled ([3c10e50](3c10e5066a))
* warehouse filter in `BOM Stock Calculated Report` ([96bf1e2](96bf1e2a0a))
2022-09-20 19:12:47 +00:00
Deepesh Garg
2694438163 Merge pull request #32291 from frappe/version-13-hotfix
chore: release v13
2022-09-21 00:41:03 +05:30
Deepesh Garg
d0bd78ddcd Merge pull request #32289 from frappe/mergify/bp/version-13-hotfix/pr-32204
fix(UX): More predictable tax withholding application in invoices (backport #32204)
2022-09-21 00:11:37 +05:30
Deepesh Garg
e2912caeae chore: Handle edge cases 2022-09-20 23:50:16 +05:30
Sagar Sharma
6f9c2e6c80 Merge pull request #32302 from frappe/mergify/bp/version-13-hotfix/pr-32295
refactor: rewrite `BOM Stock Report` queries in `QB` (backport #32295)
2022-09-20 23:10:19 +05:30
Sagar Sharma
96bf1e2a0a fix: warehouse filter in BOM Stock Calculated Report
(cherry picked from commit 390ce5719d)
2022-09-20 17:37:41 +00:00
Sagar Sharma
1f633b293d refactor: rewrite BOM Stock Report queries in QB
(cherry picked from commit 8fd7c04920)
2022-09-20 17:37:40 +00:00
ruthra kumar
0cd1cacc29 fix: get amount in words for debit note
(cherry picked from commit 70f6484d9d)
2022-09-20 12:43:45 +00:00
Deepesh Garg
21154c8bee chore: fix tests 2022-09-20 17:52:37 +05:30
ruthra kumar
9270e58969 Merge pull request #32277 from frappe/remove_return_pos_from_reconciliation_tool
fix: remove return pos from pos reconciliation tool
2022-09-20 17:20:25 +05:30
Deepesh Garg
de8f44bbff chore: Resolve conflicts 2022-09-20 16:42:30 +05:30
ruthra kumar
e9bf74e589 fix: remove return pos from pos reconciliation tool 2022-09-20 16:41:28 +05:30
Maharshi Patel
8abfdb6598 fix: remove no_copy for ignore_pricing_rule
(cherry picked from commit 8c5b420aea)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
#	erpnext/buying/doctype/purchase_order/purchase_order.json
#	erpnext/selling/doctype/quotation/quotation.json
#	erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
2022-09-20 10:49:59 +00:00
Nabin Hait
305693b562 Merge pull request #32281 from maharshivpatel/fix-item-wise-sales-register-v13
fix: item wise sales register taxes and charges
2022-09-20 14:56:23 +05:30
Deepesh Garg
794eeebabc chore: resolve conflicts 2022-09-20 14:48:06 +05:30
Deepesh Garg
75768d780f Merge pull request #32282 from frappe/mergify/bp/version-13-hotfix/pr-32217
fix: incorrect gl if tax on multi currency payment entry (backport #32217)
2022-09-20 14:39:37 +05:30
Deepesh Garg
fe252b48f7 chore: fix tests
(cherry picked from commit 9aa1f84d45)
2022-09-20 09:07:06 +00:00
Deepesh Garg
ca0cce7599 fix: TDS deduction via journal entry
(cherry picked from commit 36d0906ea2)
2022-09-20 09:07:05 +00:00
Deepesh Garg
e07fd46a46 test: Add tests
(cherry picked from commit b6184ce471)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
2022-09-20 09:07:04 +00:00
Deepesh Garg
51d7c0bfe4 fix: Fetch vouchers to show in Invoice
(cherry picked from commit 3fb1595a4e)
2022-09-20 09:07:03 +00:00
Deepesh Garg
4165fee6a7 fix: Add child table for tax withheld vouchers
(cherry picked from commit 246c1a9380)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
2022-09-20 09:07:02 +00:00
Deepesh Garg
d251ef9ce5 Merge pull request #32279 from frappe/mergify/bp/version-13-hotfix/pr-32235
fix: fetch description only if empty on the payment schedule (backport #32235)
2022-09-20 14:35:35 +05:30
Sagar Sharma
afda4bdb17 Merge pull request #32286 from frappe/mergify/bp/version-13-hotfix/pr-32280
refactor: rewrite `Item Shortage Report` queries in QB (backport #32280)
2022-09-20 11:43:41 +05:30
Sagar Sharma
c4452360da test: add test cases for Item Shortage Report
(cherry picked from commit 3dc754cac2)
2022-09-20 05:45:29 +00:00
Sagar Sharma
13527d6154 refactor: rewrite Item Shortage Report queries in QB
(cherry picked from commit f0a78aa559)
2022-09-20 05:45:28 +00:00
ruthra kumar
5c0a46110e test: gl entries of payments with advance tax
(cherry picked from commit 5bd5dd7262)
2022-09-20 11:09:37 +05:30
ruthra kumar
d9d6a07bbb fix: incorrect gl if tax on multi currency payment entry
(cherry picked from commit f0ae77b23b)
2022-09-20 04:30:42 +00:00
Maharshi Patel
e65990eb34 fix: item wise sales register taxes and charges
I have added a separate column for other charges. Instead of adding all values to tax_total, it checks if account_type is tax, and then only it adds to total_tax otherwise it adds to the total_other_charges.
2022-09-20 09:47:47 +05:30
Maharshi Patel
07a7fdbe6c fix: fetch description only if empty on the payment schedule
added fetch_if_empty on description field of payment_schedule.

(cherry picked from commit f4b64686ae)
2022-09-20 03:44:50 +00:00
Sagar Sharma
2fca8b541e Merge pull request #32261 from frappe/mergify/bp/version-13-hotfix/pr-32250
fix: make `po_detail` or `sco_rm_detail` mandatory for SE Send to Subcontractor (backport #32250)
2022-09-19 19:53:57 +05:30
Sagar Sharma
7fc460bb32 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-32250 2022-09-19 19:22:31 +05:30
Solufyin
e2e69dced7 fix: Change Department fieldtype to Link in Leave Balance Report (#32252)
Co-authored-by: Nihantra C. Patel <n.patel.serpentcs@gmail.com>
2022-09-19 15:42:05 +05:30
Deepesh Garg
5e49b6ea0f Merge pull request #32269 from frappe/mergify/bp/version-13-hotfix/pr-32251
fix: use default supplier currency if default supplier is enabled (backport #32251)
2022-09-19 15:20:44 +05:30
Ritwik Puri
2e3445fad9 chore: patch for removing stale values in Naming Series (#32271) 2022-09-19 13:35:08 +05:30
ruthra kumar
3c10e5066a fix: use default supplier currency if default supplier is enabled
(cherry picked from commit 77fdc37cb7)
2022-09-19 07:32:58 +00:00
Sagar Sharma
e8d2e49155 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-32250 2022-09-18 20:30:21 +05:30
Deepesh Garg
5690e9771a Merge pull request #32256 from frappe/mergify/bp/version-13-hotfix/pr-32244
fix: Parent Level project linkning on creating PO from project (backport #32244)
2022-09-18 19:41:57 +05:30
Sagar Sharma
ec6cac8043 chore: conflicts 2022-09-18 16:38:09 +05:30
Sagar Sharma
0329642116 fix: make po_detail or sco_rm_detail mandatory for SE Send to Subcontractor
(cherry picked from commit b90875575c)

# Conflicts:
#	erpnext/stock/doctype/stock_entry/stock_entry.py
2022-09-18 09:25:10 +00:00
Deepesh Garg
3c3e3cfcf8 fix: Parent Level project linkning on creating PO from project
(cherry picked from commit 93e134aab0)
2022-09-17 15:00:56 +00:00
Sagar Sharma
7c4f5fa5c5 Merge pull request #32241 from frappe/mergify/bp/version-13-hotfix/pr-32236
fix: production plan pending-qty (backport #32236)
2022-09-16 20:43:28 +05:30
Sagar Sharma
367e05f808 test: update test case for production plan pending-qty
(cherry picked from commit bd6af7c613)
2022-09-16 13:00:59 +00:00
Sagar Sharma
2dcb35da33 fix: production plan pending-qty
(cherry picked from commit 5be7d42dfd)
2022-09-16 13:00:58 +00:00
Sagar Sharma
94732479f5 Merge pull request #32237 from frappe/mergify/bp/version-13-hotfix/pr-32233
refactor: rewrite Production Plan queries in QB (backport #32233)
2022-09-16 17:35:38 +05:30
Sagar Sharma
b4dec4630d chore: conflicts 2022-09-16 17:08:35 +05:30
Sagar Sharma
c415a47d25 refactor: rewrite Production Plan queries in QB
(cherry picked from commit b8cf3b4c77)

# Conflicts:
#	erpnext/manufacturing/doctype/production_plan/production_plan.py
2022-09-16 09:30:11 +00:00
rohitwaghchaure
1e0cc65c61 Merge pull request #32220 from frappe/mergify/bp/version-13-hotfix/pr-31681
fix: dont show zero qty available items in stock ageing report (backport #31681)
2022-09-15 12:39:22 +05:30
Rohit Waghchaure
37dbc7043a fix: dont show zero qty available items in stock ageing report
(cherry picked from commit 5da7e01db2)
2022-09-15 06:01:10 +00:00
Deepesh Garg
0e88496607 Merge pull request #32209 from frappe/mergify/bp/version-13-hotfix/pr-32208
fix: Loans pending accrual entries (backport #32208)
2022-09-14 15:34:10 +05:30
Abhinav Raut
ef86b437cb fix: pending accrual entries
(cherry picked from commit f2209045f8)
2022-09-14 08:45:27 +00:00
Frappe PR Bot
47aa191004 chore(release): Bumped to Version 13.39.0
# [13.39.0](https://github.com/frappe/erpnext/compare/v13.38.0...v13.39.0) (2022-09-13)

### Bug Fixes

* add missing warehouse filter in BOM Stock Calculated report ([ab32c09](ab32c09ff9))
* calculate amount based on payment days for statistical components too ([3f99522](3f99522764))
* conflict ([6f2a567](6f2a567c95))
* linter ([e177f1e](e177f1e51b))
* Loan amount post write off ([e78a767](e78a7679a4))
* option to start reposting from repost item valuation ([a1826f2](a1826f215a))
* pick_list - picked qty getting set to 1 ([3256e2b](3256e2b8b7))
* Purchase Order creation from Sales Order ([d79aacd](d79aacd1cb))
* Rate for internal PI have non stock UOM items ([638d6b7](638d6b7177))
* reposting not working for internal transferred purchase receipt ([bb41d8b](bb41d8bc47))
* require barcode item barcode ([#32112](https://github.com/frappe/erpnext/issues/32112)) ([44c3a32](44c3a322d3)), closes [#31957](https://github.com/frappe/erpnext/issues/31957)
* required_qty in BOM Stock Calculated report ([f2e63bc](f2e63bc491))
* **Salary Slip:** set default amount to 0 if None ([#32184](https://github.com/frappe/erpnext/issues/32184)) ([d29a033](d29a033c09))

### Features

* Ability to manually update loan amount in Salary Slips ([ac320e4](ac320e4d55))
2022-09-13 11:15:15 +00:00
Deepesh Garg
5840913320 Merge pull request #32200 from frappe/version-13-hotfix
chore: release v13
2022-09-13 16:43:21 +05:30
Deepesh Garg
b7b0076743 Merge pull request #32194 from deepeshgarg007/loan_amount_post_write_off
fix: Loan amount post write off
2022-09-13 13:41:21 +05:30
Deepesh Garg
ef5dd1d693 Merge pull request #32165 from frappe/mergify/bp/version-13-hotfix/pr-32144
fix: Rate for internal PI have non stock UOM items (backport #32144)
2022-09-13 12:02:12 +05:30
Deepesh Garg
a53b40ba93 chore: Remove print 2022-09-13 12:00:06 +05:30
Deepesh Garg
e78a7679a4 fix: Loan amount post write off 2022-09-13 11:53:11 +05:30
Deepesh Garg
6a5beecb36 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-32144 2022-09-13 09:39:37 +05:30
Rucha Mahabal
2b900e2f0e Merge pull request #32187 from ruchamahabal/stat-comp-pd
fix: calculate amount based on payment days for statistical components too
2022-09-13 02:09:39 +05:30
Rucha Mahabal
bc14dbbcad refactor(tests): add a test utility file for commonly used functions in tests 2022-09-13 01:42:27 +05:30
Rucha Mahabal
f4e53a5c91 test: statistical component based on payment days 2022-09-13 00:59:59 +05:30
Rucha Mahabal
3f99522764 fix: calculate amount based on payment days for statistical components too 2022-09-13 00:59:03 +05:30
Sagar Sharma
81dd9722fe Merge pull request #32179 from Havenir/fix-picklist-picked-qty
fix: pick_list - picked qty getting set to 1
2022-09-12 22:19:26 +05:30
Sagar Sharma
9c5d335360 Merge pull request #32186 from frappe/mergify/bp/version-13-hotfix/pr-32150
refactor: BOM Stock Calculated report, fix required-qty (backport #32150)
2022-09-12 19:48:38 +05:30
Sagar Sharma
c5c28615f5 test: add test cases for BOM Stock Calculated report
(cherry picked from commit e1a98c1ff7)
2022-09-12 13:52:31 +00:00
Sagar Sharma
ab32c09ff9 fix: add missing warehouse filter in BOM Stock Calculated report
(cherry picked from commit 7a968a5f0d)
2022-09-12 13:52:30 +00:00
Sagar Sharma
f2e63bc491 fix: required_qty in BOM Stock Calculated report
(cherry picked from commit 56192daabf)
2022-09-12 13:52:30 +00:00
Sagar Sharma
882aa96973 refactor: BOM Stock Calculated report
(cherry picked from commit 723fa9eebc)
2022-09-12 13:52:29 +00:00
Rucha Mahabal
d29a033c09 fix(Salary Slip): set default amount to 0 if None (#32184) 2022-09-12 19:21:58 +05:30
Deepesh Garg
b3125a56ed Merge pull request #32178 from deepeshgarg007/manual_update_loan_amount
feat: Ability to manually update loan amount in Salary Slips
2022-09-12 17:41:02 +05:30
rohitwaghchaure
adfc57487b Merge pull request #32167 from frappe/mergify/bp/version-13-hotfix/pr-32118
fix: option to start reposting from repost item valuation (backport #32118)
2022-09-12 16:16:26 +05:30
Deepesh Garg
ac320e4d55 feat: Ability to manually update loan amount in Salary Slips 2022-09-12 15:05:42 +05:30
Ahmad
3256e2b8b7 fix: pick_list - picked qty getting set to 1 2022-09-12 14:23:44 +05:00
mergify[bot]
b4ec4ccc56 chore: correct license text for GPLv3 (backport #32170) (#32172)
* chore: correct license text for GPLv3 (#32170)

[skip ci]



Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-09-12 14:00:14 +05:30
Rohit Waghchaure
a1826f215a fix: option to start reposting from repost item valuation
(cherry picked from commit f1c4aea7b5)
2022-09-12 06:44:59 +00:00
Deepesh Garg
181c0acf99 Merge pull request #32127 from SolufyPrivateLimited/Solufy-so-to-po-v13
fix: Purchase Order creation from Sales Order
2022-09-12 09:25:24 +05:30
Deepesh Garg
638d6b7177 fix: Rate for internal PI have non stock UOM items
(cherry picked from commit 0f655e4430)
2022-09-12 03:40:23 +00:00
rohitwaghchaure
f5132411eb Merge pull request #32152 from frappe/mergify/bp/version-13-hotfix/pr-32135
fix: reposting not working for internal transferred purchase receipt (backport #32135)
2022-09-10 23:29:56 +05:30
rohitwaghchaure
e177f1e51b fix: linter 2022-09-10 23:01:48 +05:30
rohitwaghchaure
6f2a567c95 fix: conflict 2022-09-10 16:41:39 +05:30
Rohit Waghchaure
bb41d8bc47 fix: reposting not working for internal transferred purchase receipt
(cherry picked from commit a03b4ce213)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
2022-09-09 17:13:21 +00:00
Nihantra C. Patel
d79aacd1cb fix: Purchase Order creation from Sales Order 2022-09-08 13:51:11 +05:30
Sagar Sharma
44c3a322d3 fix: require barcode item barcode (#32112)
fix: require barcode item barcode. (#31957)

* fix: require barcode item barcode.

* fix: make supplier mandatory in Item Supplier DocType

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>

Co-authored-by: Devin Slauenwhite <devin.slauenwhite@gmail.com>
2022-09-07 14:24:53 +05:30
Frappe PR Bot
2af489d69d chore(release): Bumped to Version 13.38.0
# [13.38.0](https://github.com/frappe/erpnext/compare/v13.37.0...v13.38.0) (2022-09-06)

### Bug Fixes

* consider Stock Entry purpose while getting total supplied qty ([8964612](8964612b8e))
* force delete old report docs (backport [#32026](https://github.com/frappe/erpnext/issues/32026)) ([#32028](https://github.com/frappe/erpnext/issues/32028)) ([0f1f67d](0f1f67dcae))
* incorrect import parameter for cancel PDA ([814dd36](814dd36a3e))
* key error on consolidated financial report ([20919c8](20919c8626))
* KSA VAT report multi currency amount issue ([56d8962](56d8962e40))
* Loan Interest accruals for 0 rated loans ([a369852](a3698524ca))
* lost quotation not to expired ([ea995de](ea995de4a3))
* Naming series in Journal Entry Template ([66cb3fd](66cb3fd63f))
* **pos:** error while consolidating pos invoices ([0527393](0527393b09))
* QR Code multi currency issue ([b10a2b8](b10a2b87b6))

### Features

* better Item Price list view ([#31954](https://github.com/frappe/erpnext/issues/31954)) ([25d2847](25d2847881))
2022-09-06 16:05:26 +00:00
Deepesh Garg
bb1c450c33 Merge pull request #32104 from frappe/version-13-hotfix
chore: release v13
2022-09-06 21:33:13 +05:30
Sagar Sharma
5707118d58 Merge pull request #32099 from s-aga-r/fix/stock-entry/send-to-subcontractor
fix: consider Stock Entry purpose while getting total supplied qty
2022-09-06 15:49:38 +05:30
Sagar Sharma
8964612b8e fix: consider Stock Entry purpose while getting total supplied qty 2022-09-06 13:04:03 +05:30
Deepesh Garg
514d280ee7 Merge pull request #32086 from Havenir/qr_code_multi_currency_issue
fix: QR Code multi currency issue
2022-09-05 12:42:43 +05:30
hamzaali15
b10a2b87b6 fix: QR Code multi currency issue
When try to scan qr code on app it is showing correct values for multi currencies because it is not getting base amount
2022-09-05 11:15:43 +05:00
Deepesh Garg
3664a12bb9 Merge pull request #32078 from frappe/mergify/bp/version-13-hotfix/pr-31954
feat: better Item Price list view (backport #31954)
2022-09-04 18:15:13 +05:30
Deepesh Garg
0605cbf26b Merge pull request #32076 from frappe/mergify/bp/version-13-hotfix/pr-32045
fix: Naming series in Journal Entry Template (backport #32045)
2022-09-04 18:14:40 +05:30
HENRY Florian
25d2847881 feat: better Item Price list view (#31954)
* feat: better Item Price list view

(cherry picked from commit 86395c6adb)
2022-09-04 12:38:43 +00:00
Solufyin
66cb3fd63f fix: Naming series in Journal Entry Template
(cherry picked from commit 2085626390)
2022-09-04 11:04:44 +00:00
Deepesh Garg
d22104ad40 Merge pull request #32072 from frappe/mergify/bp/version-13-hotfix/pr-31822
fix(pos): error while consolidating pos invoices (backport #31822)
2022-09-04 15:57:37 +05:30
Saqib Ansari
0527393b09 fix(pos): error while consolidating pos invoices
(cherry picked from commit 33762dbbac)
2022-09-04 07:56:06 +00:00
Deepesh Garg
741d6fcb9a Merge pull request #32053 from Havenir/version-13-hotfix
fix: KSA VAT report multi currency amount issue
2022-09-04 13:12:21 +05:30
ruthra kumar
1870dbf9a8 Merge pull request #32059 from frappe/mergify/bp/version-13-hotfix/pr-32054
fix: type error on cancellation of Process Deferred Accounting (backport #32054)
2022-09-02 17:10:01 +05:30
ruthra kumar
69a9724422 test: pda document submission and cancellation
(cherry picked from commit 1c385541fa)
2022-09-02 11:15:13 +00:00
ruthra kumar
814dd36a3e fix: incorrect import parameter for cancel PDA
(cherry picked from commit 08f2e4edc3)
2022-09-02 11:15:12 +00:00
ruthra kumar
17ad96998e Merge pull request #32057 from frappe/mergify/bp/version-13-hotfix/pr-32052
fix: key error on consolidated financial report (backport #32052)
2022-09-02 16:41:56 +05:30
ruthra kumar
20919c8626 fix: key error on consolidated financial report
accounts with same name but different account number will throw key
error on consolidated report

(cherry picked from commit 6e8395cccd)
2022-09-02 10:46:23 +00:00
hamzaali15
56d8962e40 fix: KSA VAT report multi currency amount issue
In KSA VAT report amount is not showing correctly for multi currencies because net_amount field is fetched instead of base_net_amount
2022-09-01 15:02:21 +05:00
Deepesh Garg
0a3ac82232 Merge pull request #32031 from frappe/mergify/bp/version-13-hotfix/pr-32030
fix: Loan Interest accruals for 0 rated loans (backport #32030)
2022-08-31 21:04:27 +05:30
Deepesh Garg
b736df3f0b Merge pull request #32036 from niyazrazak/patch-5
fix: lost quotation not to expired
2022-08-31 21:03:31 +05:30
MOHAMMED NIYAS
ea995de4a3 fix: lost quotation not to expired
code is merged in version-14 and conflict in version 13
2022-08-31 15:31:07 +05:30
Deepesh Garg
b7c94e38a6 chore: Add check for principal amount
(cherry picked from commit a76d3827ec)
2022-08-30 15:46:39 +00:00
Deepesh Garg
a3698524ca fix: Loan Interest accruals for 0 rated loans
(cherry picked from commit eefc9b7172)
2022-08-30 15:46:38 +00:00
mergify[bot]
0f1f67dcae fix: force delete old report docs (backport #32026) (#32028)
fix: force delete old report docs (#32026)

(cherry picked from commit ffa3071d36)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-08-30 15:45:47 +05:30
Frappe PR Bot
11b04acf8b chore(release): Bumped to Version 13.37.0
# [13.37.0](https://github.com/frappe/erpnext/compare/v13.36.5...v13.37.0) (2022-08-30)

### Bug Fixes

* Add docstatus filter for voucher_no in Repost Item Valuation ([2cf2885](2cf2885470))
* Cash and non trade discount calculation ([20e9599](20e9599fc1))
* do not clear promotion/transfer details if doc is amended ([#32000](https://github.com/frappe/erpnext/issues/32000)) ([074d484](074d484d3c))
* filter leave types and render leave application dashboard w/o from date ([#32001](https://github.com/frappe/erpnext/issues/32001)) ([7686c9e](7686c9e450))
* Loan Write-off for term loans ([e64e812](e64e812679))
* **minor:** don't print tax rate if its '0' ([#31838](https://github.com/frappe/erpnext/issues/31838)) ([a46dca5](a46dca57cb))
* permissions for Task Type ([#32016](https://github.com/frappe/erpnext/issues/32016)) ([1157bf8](1157bf887f))
* **pos:** edge case while closing pos (backport [#31748](https://github.com/frappe/erpnext/issues/31748)) ([#31893](https://github.com/frappe/erpnext/issues/31893)) ([261405c](261405cec1))
* Purposes not set ([edfaf99](edfaf99388))
* Route condition set for stock ledger (backport [#31935](https://github.com/frappe/erpnext/issues/31935)) ([#31946](https://github.com/frappe/erpnext/issues/31946)) ([34537c9](34537c9dc2))
* Set the condition to create a purchase receipt ([b4c992d](b4c992dd4d))
* Test cases ([7c85b48](7c85b487cd))

### Features

* In BOM,  Operation time can be fix (backport [#27063](https://github.com/frappe/erpnext/issues/27063)) ([#31923](https://github.com/frappe/erpnext/issues/31923)) ([c2b8d1b](c2b8d1bd9a))
2022-08-30 08:05:05 +00:00
Deepesh Garg
4c1156a816 Merge pull request #32023 from frappe/version-13-hotfix
chore: weekly version 13 release
2022-08-30 13:32:35 +05:30
Deepesh Garg
570729b73e Merge pull request #32024 from frappe/mergify/bp/version-13-hotfix/pr-31838
fix(minor): don't print tax rate if its '0' (backport #31838)
2022-08-30 13:32:16 +05:30
ruthra kumar
a46dca57cb fix(minor): don't print tax rate if its '0' (#31838)
(cherry picked from commit 3b4c0a3fc0)
2022-08-30 07:34:26 +00:00
Deepesh Garg
821c1cddfc Merge pull request #32011 from deepeshgarg007/loan_write_off_salary_slip
fix: Loan Write-off for term loans
2022-08-30 11:36:09 +05:30
Deepesh Garg
8217c6dd9f chore: Linting issues and test case fixes 2022-08-30 10:24:31 +05:30
Deepesh Garg
fc030a7de9 Merge pull request #32018 from frappe/mergify/bp/version-13-hotfix/pr-32016
fix: permissions for Task Type (backport #32016)
2022-08-30 08:38:25 +05:30
Raffael Meyer
1157bf887f fix: permissions for Task Type (#32016)
(cherry picked from commit 73f4d5931d)
2022-08-29 16:27:24 +00:00
Deepesh Garg
e64e812679 fix: Loan Write-off for term loans 2022-08-29 18:33:40 +05:30
Deepesh Garg
6025df97ef Merge pull request #31931 from frappe/mergify/bp/version-13-hotfix/pr-31910
fix: Cash and non trade discount calculation (backport #31910)
2022-08-29 15:06:00 +05:30
Deepesh Garg
4793adfefd chore: rounded total for cash and non trade discounts 2022-08-29 14:02:18 +05:30
Rucha Mahabal
7686c9e450 fix: filter leave types and render leave application dashboard w/o from date (#32001) 2022-08-29 12:26:05 +05:30
Rucha Mahabal
074d484d3c fix: do not clear promotion/transfer details if doc is amended (#32000) 2022-08-29 12:10:15 +05:30
Deepesh Garg
332e86af7e Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-31910 2022-08-28 17:32:41 +05:30
Deepesh Garg
8eded437d2 Merge pull request #31971 from frappe/mergify/bp/version-13-hotfix/pr-31955
chore: update french translation (backport #31955)
2022-08-28 11:32:34 +05:30
Deepesh Garg
bef7f6114d Merge pull request #31989 from frappe/mergify/bp/version-13-hotfix/pr-31988
chore: remove precision on discount_percentage of Sales Invoice Item (backport #31988)
2022-08-28 11:32:14 +05:30
Deepesh Garg
4095a3dae2 chore: Resolve conflicts 2022-08-26 18:10:09 +05:30
ruthra kumar
0b40117bfd chore: remove precision on discount_percentage of Sales Invoice Item
(cherry picked from commit c42fef541a)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
2022-08-26 10:34:31 +00:00
ruthra kumar
09de1cba92 Merge pull request #31972 from frappe/mergify/bp/version-13-hotfix/pr-31934
refactor: disable discount accounting on Buying module(PI) (backport #31934)
2022-08-25 17:14:44 +05:30
ruthra kumar
51a40ad2fc test: remove discount accounting tests
(cherry picked from commit 277ef04b60)
2022-08-25 16:05:01 +05:30
mergify[bot]
261405cec1 fix(pos): edge case while closing pos (backport #31748) (#31893) 2022-08-25 14:50:24 +05:30
ruthra kumar
1ac9d7f43e refactor: disable discount accounting on Buying module(PI)
(cherry picked from commit a956e20f29)
2022-08-25 14:44:54 +05:30
Florian HENRY
69b3145be4 chore: update fr translation
(cherry picked from commit 299da5d596)
2022-08-25 07:37:26 +00:00
Florian HENRY
5e1d367d7a chore: update fr translation
(cherry picked from commit 1f6f2747d4)
2022-08-25 07:37:25 +00:00
Florian HENRY
10f0baf6ad chore: update french translation
(cherry picked from commit 264f98af14)
2022-08-25 07:37:25 +00:00
Deepesh Garg
20694eb509 Merge pull request #31965 from frappe/mergify/bp/version-13-hotfix/pr-31909
fix: Add docstatus filter for voucher_no in Repost Item Valuation (backport #31909)
2022-08-25 11:25:14 +05:30
HENRY Florian
c2b8d1bd9a feat: In BOM, Operation time can be fix (backport #27063) (#31923)
* feat: In BOM Operation time can be fix (backport #27063)

* chore: only changes necessary for feature

* chore: add test

* chore: linter

* chore: linter

* chore: linter

* chore: fix date in json

* chore: fix test order

* chore: revert test from version-13 not develop

* chore: make test ok
2022-08-25 11:14:35 +05:30
rohitwaghchaure
49bf05c1c2 Merge pull request #31962 from frappe/mergify/bp/version-13-hotfix/pr-31951
fix: Purposes not set in Maintenance Visit (backport #31951)
2022-08-25 10:51:12 +05:30
Sagar Sharma
2cf2885470 fix: Add docstatus filter for voucher_no in Repost Item Valuation
(cherry picked from commit 520306dc87)
2022-08-25 05:20:46 +00:00
Rohit Waghchaure
edfaf99388 fix: Purposes not set
(cherry picked from commit f9a7b31b5b)
2022-08-25 05:19:36 +00:00
Deepesh Garg
3a7a53ab72 Merge pull request #31919 from SolufyPrivateLimited/Solufy-pur_inv_docstatus
fix: Set the condition to create a purchase receipt
2022-08-25 10:35:14 +05:30
mergify[bot]
34537c9dc2 fix: Route condition set for stock ledger (backport #31935) (#31946)
fix: Route condition set for stock ledger (#31935)

(cherry picked from commit 0e26df331c)

Co-authored-by: Solufyin <34390782+Solufyin@users.noreply.github.com>
2022-08-24 13:30:49 +05:30
Frappe PR Bot
f6248d0259 chore(release): Bumped to Version 13.36.5
## [13.36.5](https://github.com/frappe/erpnext/compare/v13.36.4...v13.36.5) (2022-08-23)

### Bug Fixes

* added employee name to call log ([476ded2](476ded2972))
* added field to show called group, user_id ([66578a5](66578a58cf))
* added tests ([aa8a063](aa8a063103))
* added type of call select field, additional status for agent rejecting call ([b65bce8](b65bce8f98))
* call status fix ([ffb1196](ffb1196516))
* call type doctype, fixes ([b94154f](b94154f00a))
* Handle exception where no employee is returned ([baab96d](baab96d02c))
* incorrect buying amount in Gross Profit rpt ([6405a93](6405a9378d))
* incorrect tax amt due to different exchange rate in PR and PI ([ba5ee1c](ba5ee1ca96))
* interview rescheduling not working ([a482840](a4828407d0))
* limit pos recent order page result ([9751f10](9751f1060e))
* linter, sider fixes ([b529627](b52962751c))
* **minor:** save the employee doc on promotion/transfer update ([36130c6](36130c6292))
* process loan interest accrual ([acbed43](acbed434c2))
* Replace walrus operator ([23a4412](23a441252b))
* sider fixes ([90ed14a](90ed14a055))
* TDS calculation for advance payment ([a452143](a452143782))
* term loan interest calculation ([8dea238](8dea238d12))
* Update received_by if "to" is changed ([9263d5f](9263d5ff4d))
* used get_employees_with_number, strip_number methods ([3f46b2a](3f46b2a0ce))
2022-08-23 13:37:34 +00:00
Deepesh Garg
4e6ef5d6fa Merge pull request #31939 from frappe/version-13-hotfix
chore: Weekly version 13 release
2022-08-23 19:05:53 +05:30
mergify[bot]
154adcbb58 chore: add Work Order test dependencies (backport #31936) (#31938)
chore: add Work Order test dependencies (#31936)

(cherry picked from commit fe73d55f70)

Co-authored-by: HENRY Florian <florian.henry@open-concept.pro>
2022-08-23 16:10:27 +05:30
Deepesh Garg
6a9d13ff28 chore: Linting issues
(cherry picked from commit 1cb7ae16ab)
2022-08-23 04:50:19 +00:00
Deepesh Garg
7c85b487cd fix: Test cases
(cherry picked from commit ae3dce0cbd)
2022-08-23 04:50:18 +00:00
Deepesh Garg
20e9599fc1 fix: Cash and non trade discount calculation
(cherry picked from commit 3b15966cc9)
2022-08-23 04:50:17 +00:00
Solufyin
b4c992dd4d fix: Set the condition to create a purchase receipt 2022-08-22 12:00:21 +05:30
Suraj Shetty
d46ce05dcd Merge pull request #31903 from frappe/exotel_fixes_v13 2022-08-22 10:52:18 +05:30
Deepesh Garg
6bc6681f92 Merge pull request #31825 from frappe/mergify/bp/version-13-hotfix/pr-31817
fix: limit pos recent order page result (backport #31817)
2022-08-22 10:32:30 +05:30
Deepesh Garg
75d57c1f77 Merge pull request #31889 from frappe/mergify/bp/version-13-hotfix/pr-31871
fix: incorrect buying amount in Gross Profit rpt (backport #31871)
2022-08-22 10:29:47 +05:30
Deepesh Garg
fc7285cc85 Merge pull request #31826 from frappe/mergify/bp/version-13-hotfix/pr-31799
fix: process loan interest accrual (backport #31799)
2022-08-22 10:28:04 +05:30
Suraj Shetty
23a441252b fix: Replace walrus operator 2022-08-22 09:49:15 +05:30
Deepesh Garg
474f34c04c Merge pull request #31868 from frappe/mergify/bp/version-13-hotfix/pr-31856
fix: incorrect tax amt due to different exchange rate in PR and PI (backport #31856)
2022-08-22 09:09:53 +05:30
Deepesh Garg
6606028062 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-31799 2022-08-22 09:00:14 +05:30
Deepesh Garg
f58427bffe Merge pull request #31894 from maharshivpatel/fix-tax-withholding-advance-vouchers
fix: TDS calculation for advance payment
2022-08-22 08:58:59 +05:30
Suraj Shetty
89f889068e style: Fix formatting 2022-08-20 14:19:15 +05:30
Suraj Shetty
9263d5ff4d fix: Update received_by if "to" is changed 2022-08-20 14:15:54 +05:30
Suraj Shetty
4df197a282 test: Do not overwrite frappe.form_dict to retain proxy reference
Set frappe.local.form_dict instead
2022-08-20 14:14:16 +05:30
Suraj Shetty
b495969eb8 test: Clean up form_dict
To avoid failures like
https://github.com/frappe/erpnext/runs/5887687369?check_suite_focus=true#step:12:783
2022-08-20 14:14:10 +05:30
Suraj Shetty
5f4760985c test: Fix used frappe._dict to avoid AttributeError down the line
ref: https://github.com/frappe/erpnext/runs/5816574721?check_suite_focus=true#step:12:880
2022-08-20 14:14:03 +05:30
Suraj Shetty
4a61840e39 test: Use FrappeAPITestCase to track coverage 2022-08-20 14:13:56 +05:30
Suraj Shetty
ca48b9de54 test: Fix erroneous code 2022-08-20 14:13:50 +05:30
Suraj Shetty
baab96d02c fix: Handle exception where no employee is returned 2022-08-20 14:13:40 +05:30
Suraj Shetty
f5b967a947 chore: Remove unused code
- and simplify get_call_log
2022-08-20 14:13:24 +05:30
Suraj Shetty
06b1bcbf59 test: Refactor exotel test setup
- Remove unnecessary code
- Move test data to separate file
- Make proper test assertions
2022-08-20 14:12:17 +05:30
Subin Tom
aa8a063103 fix: added tests 2022-08-20 14:11:48 +05:30
Subin Tom
3f46b2a0ce fix: used get_employees_with_number, strip_number methods 2022-08-20 14:10:18 +05:30
Subin Tom
b52962751c fix: linter, sider fixes 2022-08-20 14:07:17 +05:30
Subin Tom
b94154f00a fix: call type doctype, fixes 2022-08-20 14:06:52 +05:30
Subin Tom
90ed14a055 fix: sider fixes 2022-08-20 14:05:49 +05:30
Subin Tom
b65bce8f98 fix: added type of call select field, additional status for agent rejecting call 2022-08-20 14:05:27 +05:30
Subin Tom
66578a58cf fix: added field to show called group, user_id 2022-08-20 14:04:01 +05:30
Subin Tom
476ded2972 fix: added employee name to call log 2022-08-20 14:03:40 +05:30
Subin Tom
ffb1196516 fix: call status fix 2022-08-20 14:03:14 +05:30
Maharshi Patel
a452143782 fix: TDS calculation for advance payment
"against_voucher": ["is", "not set"] was used in query due to which if TDS was added on "advance" payment vouchers and then reconciled against purchase invoice. it will not find those vouchers and consider this as first-time threshold due to which it will calculate Tax for all transactions.
2022-08-19 12:30:47 +05:30
ruthra kumar
6405a9378d fix: incorrect buying amount in Gross Profit rpt
(cherry picked from commit 967dd398e7)
2022-08-18 13:28:45 +00:00
Rucha Mahabal
2471ca58ee Merge pull request #31884 from ruchamahabal/fix-promotion 2022-08-18 12:29:31 +05:30
Rucha Mahabal
a4828407d0 fix: interview rescheduling not working 2022-08-18 12:02:32 +05:30
Frappe PR Bot
bafa3ce150 chore(release): Bumped to Version 13.36.4
## [13.36.4](https://github.com/frappe/erpnext/compare/v13.36.3...v13.36.4) (2022-08-18)

### Bug Fixes

* check item_code in all rows of po_items (backport [#31741](https://github.com/frappe/erpnext/issues/31741)) ([#31843](https://github.com/frappe/erpnext/issues/31843)) ([ba8dc89](ba8dc8925f))
* conflicts ([41b8563](41b8563b7a))
* contact search in request for quotation (backport [#31828](https://github.com/frappe/erpnext/issues/31828)) ([#31841](https://github.com/frappe/erpnext/issues/31841)) ([2a615af](2a615af00a))
* incorrect produced-qty in production-plan-item (backport [#31706](https://github.com/frappe/erpnext/issues/31706)) ([#31862](https://github.com/frappe/erpnext/issues/31862)) ([7ddb332](7ddb332f47))
* incorrect rate in BOM exploded items (backport [#31513](https://github.com/frappe/erpnext/issues/31513)) ([#31865](https://github.com/frappe/erpnext/issues/31865)) ([3274e76](3274e7681d))
* Make expense account editable in Purchase Receipt Item (backport [#31730](https://github.com/frappe/erpnext/issues/31730)) ([#31879](https://github.com/frappe/erpnext/issues/31879)) ([4775c42](4775c42593))
* not able to issue expired batches ([7ee75ff](7ee75ff762))
* set `billing_address` for purchases in `get_party_details` ([a7d66fa](a7d66fa352))
* set `company_address` for purchases in `party.js` ([d1de4b0](d1de4b027c))
* Transit filter for Default Target Warehouse in SE (backport [#31839](https://github.com/frappe/erpnext/issues/31839)) ([#31874](https://github.com/frappe/erpnext/issues/31874)) ([b0917aa](b0917aaf8a))
* use old style for `_dict.update` ([15654aa](15654aae8b))
2022-08-18 06:15:23 +00:00
Deepesh Garg
cff140db3d Merge pull request #31880 from frappe/version-13-hotfix
chore: weekly version-13 release
2022-08-18 11:43:42 +05:30
Rucha Mahabal
36130c6292 fix(minor): save the employee doc on promotion/transfer update 2022-08-18 11:42:29 +05:30
mergify[bot]
4775c42593 fix: Make expense account editable in Purchase Receipt Item (backport #31730) (#31879)
* fix: Make expense account editable in Purchase Receipt Item (#31730)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
(cherry picked from commit 1a6508972e)

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

* chore: conflicts

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-18 11:15:26 +05:30
mergify[bot]
b0917aaf8a fix: Transit filter for Default Target Warehouse in SE (backport #31839) (#31874)
fix: Transit filter for Default Target Warehouse in SE (#31839)

(cherry picked from commit f1a612245c)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-17 17:25:31 +05:30
rohitwaghchaure
d349a337e1 Merge pull request #31866 from frappe/mergify/bp/version-13-hotfix/pr-31863
fix: not able to issue expired batches (backport #31863)
2022-08-17 15:43:22 +05:30
ruthra kumar
ba5ee1ca96 fix: incorrect tax amt due to different exchange rate in PR and PI
(cherry picked from commit 5fd0770372)
2022-08-17 09:40:36 +00:00
rohitwaghchaure
41b8563b7a fix: conflicts 2022-08-17 14:47:47 +05:30
Rohit Waghchaure
7ee75ff762 fix: not able to issue expired batches
(cherry picked from commit 795c94384a)

# Conflicts:
#	erpnext/stock/doctype/stock_entry/test_stock_entry.py
2022-08-17 09:16:37 +00:00
mergify[bot]
3274e7681d fix: incorrect rate in BOM exploded items (backport #31513) (#31865)
* fix: incorrect rate in BOM exploded items (#31513)

(cherry picked from commit 313625c349)

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

* chore: conflicts

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-17 14:39:15 +05:30
mergify[bot]
7ddb332f47 fix: incorrect produced-qty in production-plan-item (backport #31706) (#31862)
fix: incorrect produced-qty in production-plan-item (#31706)

(cherry picked from commit 538cd6fdcf)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-17 13:49:51 +05:30
mergify[bot]
2a615af00a fix: contact search in request for quotation (backport #31828) (#31841)
* fix: contact search in request for quotation (#31828)

(cherry picked from commit e5e88bb9f1)

# Conflicts:
#	erpnext/buying/doctype/request_for_quotation/request_for_quotation.py

* chore: conflicts

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-17 11:23:24 +05:30
mergify[bot]
ba8dc8925f fix: check item_code in all rows of po_items (backport #31741) (#31843)
fix: check item_code in all rows of po_items (#31741)

fix: check item-code in each row of po-items
(cherry picked from commit 0047e18a9b)

Co-authored-by: Sagar Sharma <sagarsharma.s312@gmail.com>
2022-08-17 11:21:47 +05:30
Sagar Vora
14891ccf18 Merge pull request #31792 from frappe/mergify/bp/version-13-hotfix/pr-31733
fix: set `billing_address` for purchases in `get_party_details` (backport #31733)
2022-08-16 05:48:48 +00:00
Sagar Vora
15654aae8b fix: use old style for _dict.update 2022-08-13 08:00:27 +00:00
Sagar Vora
d1de4b027c fix: set company_address for purchases in party.js
(cherry picked from commit d05082987f)
2022-08-13 08:00:27 +00:00
Sagar Vora
a7d66fa352 fix: set billing_address for purchases in get_party_details
(cherry picked from commit a3625b3817)
2022-08-13 08:00:27 +00:00
Abhinav Raut
8dea238d12 fix: term loan interest calculation
(cherry picked from commit 534d7ce64b)
2022-08-11 10:18:04 +00:00
Abhinav Raut
acbed434c2 fix: process loan interest accrual
(cherry picked from commit 9ef8d5c5c3)
2022-08-11 10:18:04 +00:00
ruthra kumar
9751f1060e fix: limit pos recent order page result
(cherry picked from commit bb40e38451)
2022-08-11 08:40:05 +00:00
Frappe PR Bot
c15cff05b0 chore(release): Bumped to Version 13.36.3
## [13.36.3](https://github.com/frappe/erpnext/compare/v13.36.2...v13.36.3) (2022-08-09)

### Bug Fixes

* (india) HSN wise report ([08c69c7](08c69c7a76))
* add asset repair to accounting dimension list ([809d5ca](809d5caf80))
* consider precision while validating advance amount against sanctioned amount ([63cd434](63cd4349a6))
* **ecommerce:** remove query to non-existing field (backport [#31771](https://github.com/frappe/erpnext/issues/31771)) ([#31774](https://github.com/frappe/erpnext/issues/31774)) ([0e46b33](0e46b33ee3))
* f-string and where clause ([42b3959](42b395916d))
* getting error to show sales invoice group or print rep… (backport [#31756](https://github.com/frappe/erpnext/issues/31756)) ([#31768](https://github.com/frappe/erpnext/issues/31768)) ([473a43b](473a43b6b1))
* incorrect incoming rate set for inter transfer purchase receipt ([4e8b39a](4e8b39ab3f))
* incorrect tax calculation in case of reduced payment days ([80981d0](80981d025f))
* intercompany SO throws exception ([a17acfd](a17acfdaa2))
* minor changed link ([e9e53a7](e9e53a74c9))
* Payment Entry button is visible even when claim is fully paid ([d820757](d820757359))
* pending principal- amount ([16c94d2](16c94d292c))
* **pos:** validate product bundles while submitting pos invoice (backport [#31615](https://github.com/frappe/erpnext/issues/31615)) ([#31657](https://github.com/frappe/erpnext/issues/31657)) ([b145fe3](b145fe3b3e))
* specify allowed doctype in queries ([#31765](https://github.com/frappe/erpnext/issues/31765)) ([0dbfb15](0dbfb1589e))
* statistical component showing up in salary slip ([#31746](https://github.com/frappe/erpnext/issues/31746)) ([26aef4f](26aef4fb1c))
* sum stock_value and group by warehouse ([18d93f8](18d93f8398))
* taxable_value and gst_account_heads ([6c574fb](6c574fbf33))
* update To Date in Employee Work History ([#31811](https://github.com/frappe/erpnext/issues/31811)) ([0057c10](0057c10a7d))
2022-08-09 14:09:11 +00:00
Deepesh Garg
b80526f226 Merge pull request #31812 from frappe/version-13-hotfix
chore: weekly version 13 release
2022-08-09 19:37:13 +05:30
Deepesh Garg
0569f8a857 Merge pull request #31736 from maharshivpatel/fix-india-hsn-report
fix: (india) HSN wise report
2022-08-09 18:58:25 +05:30
Rucha Mahabal
63715bf229 Merge pull request #31813 from ruchamahabal/fix-claim 2022-08-09 18:52:22 +05:30
Rucha Mahabal
63cd4349a6 fix: consider precision while validating advance amount against sanctioned amount 2022-08-09 18:28:19 +05:30
Maharshi Patel
42b395916d fix: f-string and where clause
Used f-string formatting and added conditions to WHERE clause
2022-08-09 18:22:05 +05:30
Rucha Mahabal
0057c10a7d fix: update To Date in Employee Work History (#31811) 2022-08-09 18:19:09 +05:30
Deepesh Garg
3c8c5d01fb Merge pull request #31797 from frappe/mergify/bp/version-13-hotfix/pr-31779
Bug add accouting dimension in asset repair (backport #31779)
2022-08-09 18:18:42 +05:30
Rucha Mahabal
d820757359 fix: Payment Entry button is visible even when claim is fully paid 2022-08-09 18:15:41 +05:30
mergify[bot]
14e59c86aa Tds report (backport #31801) (#31808)
* fix: TDS Computation Summary Report not loading, too many values to unpack
2022-08-09 18:11:13 +05:30
Deepesh Garg
9e16f4e412 chore: resolve conflicts 2022-08-09 17:55:02 +05:30
rohitwaghchaure
6d269a4d89 Merge pull request #31805 from frappe/mergify/bp/version-13-hotfix/pr-31804
fix: incorrect incoming rate set for inter transfer purchase receipt (backport #31804)
2022-08-09 16:26:34 +05:30
Rohit Waghchaure
4e8b39ab3f fix: incorrect incoming rate set for inter transfer purchase receipt
(cherry picked from commit ddd24ea8c8)
2022-08-09 10:31:14 +00:00
Rucha Mahabal
9925eb9982 Merge pull request #31802 from ruchamahabal/fix-salary-slip-tds-v13 2022-08-09 15:33:54 +05:30
Rucha Mahabal
301d199ece test: default amount in slip 2022-08-09 14:57:10 +05:30
Maharshi Patel
6c574fbf33 fix: taxable_value and gst_account_heads
used taxable_value instead of base_net_amount and only appended required GST accounts
2022-08-09 14:39:13 +05:30
Rucha Mahabal
80981d025f fix: incorrect tax calculation in case of reduced payment days 2022-08-09 12:40:06 +05:30
ruthra kumar
a420d0242c chore: patch for creating existing dimensions in asset repair
(cherry picked from commit 80f508c4b1)

# Conflicts:
#	erpnext/patches.txt
2022-08-08 11:09:55 +00:00
ruthra kumar
809d5caf80 fix: add asset repair to accounting dimension list
(cherry picked from commit 452584c4bd)
2022-08-08 11:09:53 +00:00
Deepesh Garg
6f442d14cf Merge pull request #31795 from frappe/mergify/bp/version-13-hotfix/pr-31777
fix: intercompany SO created from Purchase Order throws exception (backport #31777)
2022-08-08 16:37:39 +05:30
ruthra kumar
a17acfdaa2 fix: intercompany SO throws exception
(cherry picked from commit af0a353b79)
2022-08-08 10:37:25 +00:00
Deepesh Garg
3673dea03b Merge pull request #31783 from frappe/mergify/bp/version-13-hotfix/pr-31780
Fix: Loan pending principal amount  (backport #31780)
2022-08-08 14:48:06 +05:30
Deepesh Garg
fb3725752f chore: resolve conflicts 2022-08-08 11:53:49 +05:30
Abhinav Raut
16c94d292c fix: pending principal- amount
(cherry picked from commit a272d73dd9)

# Conflicts:
#	erpnext/loan_management/doctype/loan_repayment/loan_repayment.json
2022-08-05 10:35:05 +00:00
mergify[bot]
0e46b33ee3 fix(ecommerce): remove query to non-existing field (backport #31771) (#31774)
fix(ecommerce): remove query to non-existing field (#31771)

(cherry picked from commit 17b9bfd249)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-08-03 17:08:46 +05:30
mergify[bot]
df716fbd0c ci: fix automated release regex (backport #31770) (#31772)
ci: fix automated release regex (#31770)

[skip ci]

(cherry picked from commit 2defb89962)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-08-03 16:37:39 +05:30
mergify[bot]
0dbfb1589e fix: specify allowed doctype in queries (#31765)
Co-authored-by: Sagar Vora <sagar@resilient.tech>
2022-08-03 12:03:53 +05:30
mergify[bot]
473a43b6b1 fix: getting error to show sales invoice group or print rep… (backport #31756) (#31768)
fix: getting error to show sales invoice group or print rep… (#31756)

fix: formatter getting error to show sales invoice group or print report.

1 - When I view the Gross Profit report in Sales Invoice mode, the table is all broken.
Error on browser console:
TypeError: Cannot read properties of undefined (reading 'indent')

2 - When I try to print, no matter the Group (Sales Invoice, Item Code, Item Group...) nothing happens. in browser log console I have the following error:
TypeError: Cannot read properties of undefined (reading 'content')

i fixed both errors and all working perfectly.

(cherry picked from commit ea88451875)

Co-authored-by: HarryPaulo <paulo_fabris@hotmail.com>
2022-08-03 11:23:10 +05:30
rohitwaghchaure
1a3b3b96c2 Merge pull request #31751 from frappe/mergify/bp/version-13-hotfix/pr-31750
fix: minor URL link (backport #31750)
2022-08-01 14:34:12 +05:30
Rohit Waghchaure
e9e53a74c9 fix: minor changed link
(cherry picked from commit 0e7c4314b4)
2022-08-01 09:02:07 +00:00
Rucha Mahabal
26aef4fb1c fix: statistical component showing up in salary slip (#31746)
* fix: statistical component showing up in salary slip

* fix(test): payment days effect on timesheet salary slio
2022-08-01 12:54:25 +05:30
mergify[bot]
b145fe3b3e fix(pos): validate product bundles while submitting pos invoice (backport #31615) (#31657) 2022-07-31 19:12:14 +05:30
Marica
d83c869d73 Merge pull request #31717 from frappe/mergify/bp/version-13-hotfix/pr-31601
perf: reduce db calls for warehouse wise stock value chart (backport #31601)
2022-07-31 18:26:27 +05:30
Maharshi Patel
08c69c7a76 fix: (india) HSN wise report
Problem:
The previous approach for calculating tax_rate was incorrect.
```
['tax_rate'] * ['number of unique rows']
```
Joining `tabSales Taxes and Charges` was adding unnecessary rows & complexity.

Solution:
Instead of trying to get tax_rate from the main query itself, I used the get_tax_accounts's data to calculate the correct tax_rate.

Todo:
Union Territory
2022-07-29 14:22:31 +05:30
Frappe PR Bot
84e6cead56 chore(release): Bumped to Version 13.36.2
## [13.36.2](https://github.com/frappe/erpnext/compare/v13.36.1...v13.36.2) (2022-07-28)

### Bug Fixes

* (india) (e-invoice) margin & internal company transfer ([b97d30a](b97d30aad0))
* (india) add overseas in HSN wise report ([1d69ce1](1d69ce1932))
* Allow allocating advance amount against Expense Claim taxes ([42f3592](42f3592e95))
* assign duplicate_items_msg outside conditional ([#31639](https://github.com/frappe/erpnext/issues/31639)) ([8e23c6a](8e23c6ad69))
* correct Brazilian portuguese translations (backport [#31498](https://github.com/frappe/erpnext/issues/31498)) ([#31660](https://github.com/frappe/erpnext/issues/31660)) ([794fd08](794fd0819f))
* discount and test added ([a843e78](a843e784e6))
* display customer name on picking list ([dbf245c](dbf245c687))
* do not update component amount for timesheet components ([#31696](https://github.com/frappe/erpnext/issues/31696)) ([bc7cfe6](bc7cfe6919))
* enable tax withholding checkbox in PI with supplier_tds ([bc74942](bc7494278d))
* ensure defaults removed in bad frappe patch get set again (backport [#31659](https://github.com/frappe/erpnext/issues/31659)) ([#31661](https://github.com/frappe/erpnext/issues/31661)) ([763787b](763787b0a5))
* hero image not loading in portal homepage ([#31699](https://github.com/frappe/erpnext/issues/31699)) ([8a6432e](8a6432ec3f))
* **india:** e-way bill json for unregistered gst category ([01d6df4](01d6df45d0))
* make customer_name field read only. ([2381b81](2381b81aac))
* manually generated salary slips overwritten by structure amount ([#31711](https://github.com/frappe/erpnext/issues/31711)) ([32c1bb6](32c1bb61de))
* Map `Item` image to `Website Item` website_image only if published via UI (v13) ([9b1544a](9b1544aa14))
* payment entry to student ([#31708](https://github.com/frappe/erpnext/issues/31708)) ([4f02375](4f023757de))
* Reload loan Table in Salary Slip when change Employee ([#31525](https://github.com/frappe/erpnext/issues/31525)) ([a95c011](a95c011a93))
* rounding errors while closing pos (backport [#31654](https://github.com/frappe/erpnext/issues/31654)) ([#31658](https://github.com/frappe/erpnext/issues/31658)) ([529a47b](529a47bc88))
* Route condition set with proper filter ([#31556](https://github.com/frappe/erpnext/issues/31556)) ([5cdc267](5cdc267aee))
* The Fee details are not fetched in Program Enrollment ([#31153](https://github.com/frappe/erpnext/issues/31153)) ([0602848](0602848caa))
* update fr translations ([#31687](https://github.com/frappe/erpnext/issues/31687)) ([89348c1](89348c1bb4))
* update fr translations (backport [#31526](https://github.com/frappe/erpnext/issues/31526)) ([#31666](https://github.com/frappe/erpnext/issues/31666)) ([95e1021](95e1021caf))
* update SO's percentage billed on credit note ([2f2d3de](2f2d3de306))
* use current pos profile on sales return ([c442b4a](c442b4aef1))
2022-07-28 12:13:57 +00:00
Deepesh Garg
590e48fa1d Merge pull request #31725 from frappe/version-13-hotfix
chore: weekly version-13 release
2022-07-28 17:42:15 +05:30
Deepesh Garg
25da4d28ff Merge pull request #31727 from frappe/mergify/bp/version-13-hotfix/pr-31656
fix: use current pos profile on sales return (backport #31656)
2022-07-28 16:32:36 +05:30
Deepesh Garg
f57d2fadbc Merge pull request #31728 from frappe/mergify/bp/version-13-hotfix/pr-31676
fix: enable tax withholding checkbox in PI with supplier_tds (backport #31676)
2022-07-28 16:32:17 +05:30
Deepesh Garg
9e7edd677a Merge pull request #31726 from frappe/mergify/bp/version-13-hotfix/pr-31576
fix: credite note for returned delivery note updates SO's billed percentage (backport #31576)
2022-07-28 16:32:05 +05:30
ruthra kumar
bc7494278d fix: enable tax withholding checkbox in PI with supplier_tds
(cherry picked from commit b461724416)
2022-07-28 10:42:58 +00:00
ruthra kumar
c442b4aef1 fix: use current pos profile on sales return
(cherry picked from commit 5b85af5f1a)
2022-07-28 10:36:23 +00:00
ruthra kumar
ef9b25cf08 test: SO percentage billed when cr_note made against delivery return
(cherry picked from commit 243f66fcd3)
2022-07-28 10:21:19 +00:00
ruthra kumar
2f2d3de306 fix: update SO's percentage billed on credit note
Credit Note created from Sales Return will update precentage billed in
Sales Order accordingly

(cherry picked from commit 04c1019242)
2022-07-28 10:21:18 +00:00
Rucha Mahabal
13639682ce Merge pull request #31724 from ruchamahabal/expense-claim-adv 2022-07-28 14:51:15 +05:30
Rucha Mahabal
c01adae8a5 test: advance amount allocation against expense claim with taxes 2022-07-28 14:27:09 +05:30
Deepesh Garg
8ae691d9dc Merge branch 'version-13' into version-13-hotfix 2022-07-28 13:59:25 +05:30
Alaa Alsalehi
a95c011a93 fix: Reload loan Table in Salary Slip when change Employee (#31525)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
Co-authored-by: bahaaabed <bahaa.9999.sh@gmail.com>
Co-authored-by: newhr1 <104132586+newhr1@users.noreply.github.com>
2022-07-28 13:22:07 +05:30
Rucha Mahabal
42f3592e95 fix: Allow allocating advance amount against Expense Claim taxes 2022-07-28 13:21:29 +05:30
Syed Mujeer Hashmi
0602848caa fix: The Fee details are not fetched in Program Enrollment (#31153) 2022-07-28 12:30:39 +05:30
Rucha Mahabal
9985d28571 chore: Add HR & Payroll deprecation warning (#31720) 2022-07-28 11:43:49 +05:30
Marica
31824c2280 Merge pull request #31716 from frappe/mergify/bp/version-13-hotfix/pr-31687
fix: update fr translations (backport #31687)
2022-07-27 18:01:30 +05:30
Devin Slauenwhite
18d93f8398 fix: sum stock_value and group by warehouse
(cherry picked from commit 1e20358c28)
2022-07-27 12:18:39 +00:00
Devin Slauenwhite
c9443123f9 chore: remove unused import
(cherry picked from commit bc3023318e)
2022-07-27 12:18:38 +00:00
Devin Slauenwhite
0fdec8fac8 pref: reduce count of db calls from n to 2
(cherry picked from commit 73ade04dcf)
2022-07-27 12:18:38 +00:00
marination
6fbb06a878 chore: Merge Conflict 2022-07-27 17:30:46 +05:30
HENRY Florian
89348c1bb4 fix: update fr translations (#31687)
* fix: update fr translations

* fix: update fr translation

* fix: update fr translation

* chore: Replace apostrophe encoding by symbol

Co-authored-by: marination <maricadsouza221197@gmail.com>
(cherry picked from commit cc1f837685)

# Conflicts:
#	erpnext/translations/fr.csv
2022-07-27 11:52:03 +00:00
Marica
598dbc93ac Merge pull request #31669 from frappe/mergify/bp/version-13-hotfix/pr-31579
fix: display customer name on picking list (backport #31579)
2022-07-27 16:45:07 +05:30
Marica
51a4ef3069 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-31579 2022-07-27 16:23:22 +05:30
Marica
49fb177f86 chore: Merge Conflicts 2022-07-27 16:22:17 +05:30
Marica
b0aae8a297 Merge pull request #31713 from frappe/mergify/bp/version-13-hotfix/pr-31469
chore: Make `image` field obsolete in Website Item (redundant) (backport #31469)
2022-07-27 16:12:32 +05:30
Marica
e310347ca4 chore: Merge Conflicts 2022-07-27 15:51:01 +05:30
marination
9b1544aa14 fix: Map Item image to Website Item website_image only if published via UI (v13)
- For v12 Items, `website_image` should be mapped from `Item` to `Website Item`

(cherry picked from commit af38baeb3b)

# Conflicts:
#	erpnext/e_commerce/doctype/website_item/website_item.py
2022-07-27 10:14:20 +00:00
marination
a8da5f4566 chore: Remove image use in website item list
(cherry picked from commit 7a6ee8cf2d)
2022-07-27 10:14:18 +00:00
marination
0e469f6d95 chore: Remove image from ProductQuery fields
(cherry picked from commit eec07833f4)
2022-07-27 10:14:18 +00:00
marination
b393c230bd chore: Make image field obsolete in Website Item (redundant)
- Delete Image field and set `website_image` as form's image field for uploads
- Remove instances of `image` field access via Website Item
- Item -> Web Item via Desk: Map Item's `image` to Web Item's `website_image`
- Item -> Web Item via patch: `website_image` will be mapped with thumbnail
- Remove magic that auto-sets `website_image` from `image` in Website Item

(cherry picked from commit 9541354ec7)

# Conflicts:
#	erpnext/e_commerce/doctype/website_item/website_item.py
2022-07-27 10:14:16 +00:00
Rucha Mahabal
32c1bb61de fix: manually generated salary slips overwritten by structure amount (#31711) 2022-07-27 12:44:26 +05:30
MohsinAli
4f023757de fix: payment entry to student (#31708)
Payment entry to student via Payment References(From Journal Entry)
2022-07-27 11:50:15 +05:30
Deepesh Garg
d2d25e17bb Merge pull request #31698 from maharshivpatel/fix-einvoice-margin-internal-transfer
fix: (india) (e-invoice) margin & internal company transfer
2022-07-26 21:59:44 +05:30
Maharshi Patel
a843e784e6 fix: discount and test added
only report net rate if discount is less than 0 and added test.
2022-07-26 17:40:59 +05:30
Rucha Mahabal
8a6432ec3f fix: hero image not loading in portal homepage (#31699) 2022-07-26 13:43:36 +05:30
Maharshi Patel
b97d30aad0 fix: (india) (e-invoice) margin & internal company transfer
When the item price is more than the price list rate ( margin added ) discount value becomes negative. The previous attempt to solve this was to convert discount to absolute value. However, that gives incorrect unit price and discount value. To solve this, I have made changes to report net rates in cases where the margin is added or is an internal company transfer.
2022-07-26 12:57:47 +05:30
Rucha Mahabal
bc7cfe6919 fix: do not update component amount for timesheet components (#31696)
* fix: do not update component amount for timesheet components

* fix: warn the user about overwriting timesheet component amount
2022-07-26 12:35:50 +05:30
Deepesh Garg
85802b0f97 Merge pull request #31602 from rtdany10/patch-19
fix(india): e-way bill json for unregistered gst category
2022-07-22 13:11:19 +05:30
Deepesh Garg
dc67d39ce6 Merge pull request #31665 from maharshivpatel/fix-add-overseas-hsn-report
fix: (india) add entries from overseas invoices in HSN wise report
2022-07-22 13:06:30 +05:30
mergify[bot]
529a47bc88 fix: rounding errors while closing pos (backport #31654) (#31658) 2022-07-22 11:17:59 +05:30
Devin Slauenwhite
2381b81aac fix: make customer_name field read only.
(cherry picked from commit 7083b3148b)

# Conflicts:
#	erpnext/stock/doctype/pick_list/pick_list.json
2022-07-21 13:08:41 +00:00
Devin Slauenwhite
dbf245c687 fix: display customer name on picking list
(cherry picked from commit 0a633a212d)

# Conflicts:
#	erpnext/stock/doctype/pick_list/pick_list.json
2022-07-21 13:08:40 +00:00
Nihantra C. Patel
5cdc267aee fix: Route condition set with proper filter (#31556)
* fix: Redirect to report with proper filter

* Update member.js

* fix: Route condition set with proper filter

* fix: Route condition set with proper filter

* fix: Route condition set with proper filter

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2022-07-21 18:29:06 +05:30
mergify[bot]
95e1021caf fix: update fr translations (backport #31526) (#31666)
fix: update fr translations (#31526)

* fix: update fr translations

* fix: update fr translations

* fix: update fr translations

* fix: update fr translations

* chore: Update french translation

Co-authored-by: Marica <maricadsouza221197@gmail.com>
(cherry picked from commit 3ba0d6cc5c)

Co-authored-by: HENRY Florian <florian.henry@open-concept.pro>
2022-07-21 18:11:32 +05:30
mergify[bot]
7d50f8798a Update de.csv (backport #31596) (#31667)
Update de.csv (#31596)

IN,IM to IN,EIN

Co-authored-by: Marica <maricadsouza221197@gmail.com>
(cherry picked from commit 8629d01dd5)

Co-authored-by: billy995 <48571007+billy995@users.noreply.github.com>
2022-07-21 18:10:46 +05:30
Marica
dd751c6e92 Merge pull request #31664 from frappe/mergify/bp/version-13-hotfix/pr-31544
FIX: quality inspection quick creation from purchase receipt: pre-fill sample size if available (backport #31544)
2022-07-21 14:13:48 +05:30
Frappe PR Bot
69087b8790 chore(release): Bumped to Version 13.36.1
## [13.36.1](https://github.com/frappe/erpnext/compare/v13.36.0...v13.36.1) (2022-07-21)

### Bug Fixes

* ensure defaults removed in bad frappe patch get set again (backport [#31659](https://github.com/frappe/erpnext/issues/31659)) ([2ae3bd9](2ae3bd9fed))
2022-07-21 08:26:20 +00:00
mergify[bot]
763787b0a5 fix: ensure defaults removed in bad frappe patch get set again (backport #31659) (#31661)
fix: ensure defaults removed in bad frappe patch get set again (#31659)

(cherry picked from commit bf2833b8ee)

Co-authored-by: Sagar Vora <sagar@resilient.tech>
2022-07-21 13:54:55 +05:30
mergify[bot]
2ae3bd9fed fix: ensure defaults removed in bad frappe patch get set again (backport #31659)
fix: ensure defaults removed in bad frappe patch get set again (#31659)

(cherry picked from commit bf2833b8ee)
(cherry picked from commit 9071018e4e)

Co-authored-by: Sagar Vora <sagar@resilient.tech>
2022-07-21 13:54:40 +05:30
Marc de Lima Lucio
1998223ee3 FIX: quality inspection quick creation from purchase receipt: pre-fill sample size if available (#31544)
FIX: quality inspection quick creation from transaction documents: pre-fill sample size if available

Co-authored-by: Marica <maricadsouza221197@gmail.com>
(cherry picked from commit 048c037842)
2022-07-21 08:17:48 +00:00
mergify[bot]
794fd0819f fix: correct Brazilian portuguese translations (backport #31498) (#31660)
fix: correct Brazilian portuguese translations (#31498)

* fix brazilian portuguese translations

* minor adjustments

* fix minor adjustments

* fix: remove legacy pt_br.csv

* chore: Fix translation quotation marks

Co-authored-by: Marica <maricadsouza221197@gmail.com>
(cherry picked from commit d30f8387d9)

Co-authored-by: Marco Fonseca <62901164+treasuryesc@users.noreply.github.com>
2022-07-21 13:47:18 +05:30
Maharshi Patel
1d69ce1932 fix: (india) add overseas in HSN wise report
SQL query had WHERE `tabSales Taxes and Charges`.parent = `tabSales Invoice`.name. However, In overseas, there is no `tabSales Taxes and Charges` so I changed the query to use a combination of INNER JOIN and LEFT JOIN to fetch all entries.
2022-07-21 13:27:30 +05:30
Maharshi Patel
8e23c6ad69 fix: assign duplicate_items_msg outside conditional (#31639)
duplicate_items_msg was defined inside if the statement  of stock_item so when duplicate was found in non_stock_item it raised referenced before assignment
2022-07-20 21:25:36 +05:30
Frappe PR Bot
32ba8c7d6d chore(release): Bumped to Version 13.36.0
# [13.36.0](https://github.com/frappe/erpnext/compare/v13.35.3...v13.36.0) (2022-07-20)

### Bug Fixes

* (india) (e-invoice) allow generation for UIN Holders ([82539fc](82539fc18a))
* (india) (e-invoice) CN / DN with 0 qty ([84f260e](84f260e1d8))
* (india) (e-invoice) discount calculation ([1f4d434](1f4d434675))
* (india) (e-invoice) discount in CN/DN ([6e6b55e](6e6b55ece0))
* (india) (e-invoice) qty should not be changed to 1 ([b0efb98](b0efb98237))
* (india)(einvoice) discount for CN DN ([844758a](844758a27c))
* added Section translation in German for Salary Slip (backport [#31608](https://github.com/frappe/erpnext/issues/31608)) ([#31616](https://github.com/frappe/erpnext/issues/31616)) ([12d3d6a](12d3d6ab49))
* Allow multi currency invoice against single party account ([9ac9c46](9ac9c46dab))
* **India:** Inward supplies from Composition Supplier in 3B report ([b147ce4](b147ce4206))
* LCV updates wrong future qty/Bin qty ([f0ecdbe](f0ecdbef5a))
* linter ([9a3c846](9a3c84663f))
* move auto attendance job to long queue ([8eb9aaa](8eb9aaafe9))
* on cancel for loan refund ([8237d94](8237d94b11))
* Opening Invoice Creation Tool msgprint ([cb80bcd](cb80bcd0ee))
* Patch to make accounting dimension in orders ([55399f2](55399f2e58))
* Remove unnecessary list comprehensions ([711501b](711501be5e))
* Removed 'Allow Monthly Depreciation' checkbox and fixed wdv depreciation rate ([616e3c6](616e3c66b9))
* Renamed status field to gle_processing_status ([1180135](1180135067))
* Set Amount in Supplied Item table ([72e8c02](72e8c02ae0))
* set default_bom for item ([def622c](def622c13e))
* set status on submit/cancel ([04b077a](04b077a89f))
* slow stock reposting ([a5dae92](a5dae9264d))
* Supplier details in TDS monthly report ([#31599](https://github.com/frappe/erpnext/issues/31599)) ([431d79f](431d79f516))
* Tax amount not considered in Expense Claim Journal Entry ([90c751f](90c751f648))
* test ([9631ffd](9631ffd215))

### Features

* add adjustment amount to loan ([d5ce780](d5ce780e87))

### Performance Improvements

* index shift type and employee in checkins and assignment to avoid full table scans ([6938025](6938025952))
* Optimization of gl entry processing logic in period closing voucher ([903e42f](903e42fbdd))
* Replace `db.get_all` with `db.exists` in `is_holiday` ([85c554e](85c554eab5))
* Replace `get_doc` with `db.get_value` in `get_shift_details` ([abb7ac5](abb7ac5a0b))
* Use `get_cached_value` and `get_cached_doc` ([8c9035d](8c9035d914))
2022-07-20 15:21:11 +00:00
Deepesh Garg
4d67695294 Merge pull request #31647 from frappe/version-13-hotfix
chore: weekly version-13 release
2022-07-20 20:49:09 +05:30
Deepesh Garg
50fbfd9839 Merge pull request #31649 from frappe/mergify/bp/version-13-hotfix/pr-31648
fix: Patch to make accounting dimension in orders (backport #31648)
2022-07-20 20:01:27 +05:30
Deepesh Garg
e36c74ac44 chore: resolve conflicts 2022-07-20 19:39:18 +05:30
Deepesh Garg
45e25b2d56 chore: do not re run patch
(cherry picked from commit cad2035e07)

# Conflicts:
#	erpnext/patches.txt
2022-07-20 13:32:41 +00:00
Deepesh Garg
55399f2e58 fix: Patch to make accounting dimension in orders
(cherry picked from commit d46e406db7)

# Conflicts:
#	erpnext/patches.txt
2022-07-20 13:32:41 +00:00
Deepesh Garg
a5cd81c73c Merge branch 'version-13' into version-13-hotfix 2022-07-20 17:52:28 +05:30
Nabin Hait
52c8e0a6ea Merge pull request #31644 from nabinhait/asset-monthly-depreciation-v13-hotfix
fix: Removed 'Allow Monthly Depreciation' checkbox
2022-07-20 17:33:15 +05:30
Nabin Hait
616e3c66b9 fix: Removed 'Allow Monthly Depreciation' checkbox and fixed wdv depreciation rate 2022-07-20 17:32:28 +05:30
Nabin Hait
a6e97ea9ab Merge pull request #31626 from nabinhait/pcv-perf-enhancements
perf: Optimization of gl entry processing logic in period closing voucher
2022-07-20 15:39:39 +05:30
Deepesh Garg
2c5e117f01 Merge pull request #31629 from maharshivpatel/fix-einvoice-discounts
fix: (india) (e-invoice) convert discount to absolute value
2022-07-20 13:18:14 +05:30
Marica
a65dd58444 Merge pull request #31416 from frappe/mergify/bp/version-13-hotfix/pr-31412
fix: set default_bom for item (backport #31412)
2022-07-20 11:31:55 +05:30
Nabin Hait
04b077a89f fix: set status on submit/cancel 2022-07-20 11:10:36 +05:30
Nabin Hait
1180135067 fix: Renamed status field to gle_processing_status 2022-07-20 10:50:44 +05:30
Rucha Mahabal
eae4b06a80 Merge pull request #31630 from ruchamahabal/auto-attendance-perf 2022-07-20 10:25:02 +05:30
Maharshi Patel
b0efb98237 fix: (india) (e-invoice) qty should not be changed to 1
Qty of 0 is allowed so can't change item.qty to 1  instead created item_qty and used it.
2022-07-19 22:29:38 +05:30
rohitwaghchaure
e7e1847ec9 Merge pull request #31634 from frappe/mergify/bp/version-13-hotfix/pr-31631
fix: slow stock reposting (backport #31631)
2022-07-19 19:26:35 +05:30
Rohit Waghchaure
a5dae9264d fix: slow stock reposting
(cherry picked from commit 1d80d37ccf)
2022-07-19 13:18:13 +00:00
Marica
284095106c Merge pull request #31588 from SolufyPrivateLimited/Solufyin-oict
fix: Opening Invoice Creation Tool msgprint
2022-07-19 17:47:44 +05:30
Rucha Mahabal
8eb9aaafe9 fix: move auto attendance job to long queue 2022-07-19 16:07:18 +05:30
Rucha Mahabal
6938025952 perf: index shift type and employee in checkins and assignment to avoid full table scans 2022-07-19 16:02:31 +05:30
Maharshi Patel
6e6b55ece0 fix: (india) (e-invoice) discount in CN/DN
discount fixes
2022-07-19 15:31:34 +05:30
Rucha Mahabal
8c9035d914 perf: Use get_cached_value and get_cached_doc 2022-07-19 14:47:14 +05:30
Nabin Hait
cfb11f4b84 test: Added test for PCV cancellation 2022-07-19 14:31:02 +05:30
Marica
feffc3af27 Merge pull request #31627 from frappe/mergify/bp/version-13-hotfix/pr-31515
fix: LCV updates wrong future qty/Bin qty (backport #31515)
2022-07-19 14:21:33 +05:30
marination
ca9c6e1651 test: LCV impact on future stock balancees
(cherry picked from commit de9ea70ce3)
2022-07-19 08:10:22 +00:00
marination
f0ecdbef5a fix: LCV updates wrong future qty/Bin qty
- As -ve LCV SLE case is returned from `repost_current_voucher`, future qty is not updated
- This just doubly shifts all future qty which is then fixed by a repost
- Until the repost balance values are wrong
- Bin continues to show wrong projected qty even after repost, this is fixed by next SLE that recalculates Bin

(cherry picked from commit 7a5fd71a6c)
2022-07-19 08:10:21 +00:00
Marica
31930a16fa Merge pull request #31624 from marination/sub-contract-amount
fix: Set `amount` in Raw Supplied Items table
2022-07-19 12:55:20 +05:30
Deepesh Garg
4f55fef782 Merge pull request #31623 from frappe/mergify/bp/version-13-hotfix/pr-31599
fix: Supplier details in TDS monthly report (backport #31599)
2022-07-19 12:20:29 +05:30
marination
72e8c02ae0 fix: Set Amount in Supplied Item table 2022-07-19 11:47:25 +05:30
Deepesh Garg
f02596242c Merge pull request #31609 from deepeshgarg007/gstr_3b_gst_category
fix(India): Inward supplies from Composition Supplier in GST 3B report
2022-07-19 10:23:44 +05:30
Deepesh Garg
431d79f516 fix: Supplier details in TDS monthly report (#31599)
(cherry picked from commit a6ff4db2ec)
2022-07-19 04:45:28 +00:00
Rucha Mahabal
711501be5e fix: Remove unnecessary list comprehensions 2022-07-18 21:32:04 +05:30
Rucha Mahabal
abb7ac5a0b perf: Replace get_doc with db.get_value in get_shift_details 2022-07-18 21:13:02 +05:30
Rucha Mahabal
85c554eab5 perf: Replace db.get_all with db.exists in is_holiday
- widely used function call, fetching all rows for holidays
2022-07-18 21:08:15 +05:30
Nabin Hait
903e42fbdd perf: Optimization of gl entry processing logic in period closing voucher 2022-07-18 17:59:42 +05:30
mergify[bot]
12d3d6ab49 fix: added Section translation in German for Salary Slip (backport #31608) (#31616)
Co-authored-by: Wolfram Schmidt <wolfram.schmidt@phamos.eu>
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2022-07-18 13:41:42 +05:30
Rucha Mahabal
26497f9c0e Merge pull request #31614 from ruchamahabal/fix-claim-payment
fix: Tax amount not considered in Expense Claim Journal Entry
2022-07-18 13:24:12 +05:30
Rucha Mahabal
6a7549d4b2 test: Journal Entry against Expense Claim 2022-07-18 12:57:50 +05:30
Rucha Mahabal
90c751f648 fix: Tax amount not considered in Expense Claim Journal Entry
- add a helper function `get_outstanding_amount_for_claim` for uniformity in usages
2022-07-18 12:39:09 +05:30
Frappe PR Bot
1090862296 chore(release): Bumped to Version 13.35.3
## [13.35.3](https://github.com/frappe/erpnext/compare/v13.35.2...v13.35.3) (2022-07-18)

### Bug Fixes

* (india) (e-invoice) CN / DN with 0 qty and discount issues ([425abcd](425abcdea7))
2022-07-18 05:21:17 +00:00
mergify[bot]
425abcdea7 fix: (india) (e-invoice) CN / DN with 0 qty and discount issues
* fix: (india) (e-invoice) CN / DN with 0 qty
2022-07-18 10:49:41 +05:30
Deepesh Garg
144057f7e3 Merge pull request #31583 from maharshivpatel/fix-e_invoice-cn-dn-qty-0-error
fix: (india) (e-invoice) CN / DN with 0 qty and discount issues
2022-07-18 09:09:19 +05:30
Maharshi Patel
9631ffd215 fix: test
change setting to run test with correct use case.
2022-07-17 15:40:55 +05:30
Maharshi Patel
9a3c84663f fix: linter 2022-07-17 15:22:37 +05:30
Maharshi Patel
2066e5a53a discount settings for e-invoice added and test cases 2022-07-17 15:08:40 +05:30
Deepesh Garg
b147ce4206 fix(India): Inward supplies from Composition Supplier in 3B report 2022-07-17 00:43:25 +05:30
Deepesh Garg
0d6beed546 test: Update test case 2022-07-16 14:06:01 +05:30
Maharshi Patel
844758a27c fix: (india)(einvoice) discount for CN DN 2022-07-15 16:54:10 +05:30
Maharshi Patel
1f4d434675 fix: (india) (e-invoice) discount calculation
I have added fixes for discount in e-inovice.
2022-07-15 16:03:42 +05:30
Dany Robert
01d6df45d0 fix(india): e-way bill json for unregistered gst category 2022-07-15 11:17:41 +05:30
Deepesh Garg
8c7b836de8 Merge pull request #31595 from maharshivpatel/fix-uin-e_invoice
fix: (india) (e-invoice) allow generation for UIN Holders
2022-07-14 21:25:45 +05:30
Deepesh Garg
9fd1fad259 Merge pull request #31572 from frappe/mergify/bp/version-13-hotfix/pr-31566
fix: Allow multi currency invoice against single party account (backport #31566)
2022-07-14 21:25:17 +05:30
Deepesh Garg
dfa0638baf Merge pull request #31577 from frappe/mergify/bp/version-13-hotfix/pr-31543
feat: Loan balance adjustment doctypes (backport #31543)
2022-07-14 21:24:49 +05:30
Deepesh Garg
0a5bc86d1b chore: resolve conflicts 2022-07-14 17:20:32 +05:30
Deepesh Garg
bdd15895ff chore: resolve conflicts 2022-07-14 17:06:01 +05:30
Maharshi Patel
82539fc18a fix: (india) (e-invoice) allow generation for UIN Holders
e-invoice is required for UIN Holders and they should be treated as Registered Regular. there was incorrect if hasattr check that prevented UIN number validation.
2022-07-14 15:12:51 +05:30
Solufyin
cb80bcd0ee fix: Opening Invoice Creation Tool msgprint 2022-07-13 11:55:47 +05:30
Maharshi Patel
84f260e1d8 fix: (india) (e-invoice) CN / DN with 0 qty
Qty 0 is allowed when creating Credit or Debit Note this caused ZeroDivisionError during unit_rate calculation.
fixed the issue by adding required conditionals.
2022-07-13 01:39:36 +05:30
Sagar Sharma
023c5db3bc Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-31412 2022-07-12 23:33:48 +05:30
Deepesh Garg
0b3958d692 chore: Linting Issues
(cherry picked from commit 0bac030ca7)
2022-07-12 12:56:46 +00:00
Deepesh Garg
c2a7dc7754 chore: Linting Issues
(cherry picked from commit d933ff5cf6)
2022-07-12 12:56:46 +00:00
Abhinav Raut
8237d94b11 fix: on cancel for loan refund
(cherry picked from commit 13b7ed1e2c)
2022-07-12 12:56:45 +00:00
Labeeb Mattra
0713a240a7 Consider refund_amount in pending principal amount
(cherry picked from commit 35f2717ad2)
2022-07-12 12:56:45 +00:00
Labeeb Mattra
61b2a1c3cb fix excess amount calculation in loan refund
(cherry picked from commit 9df1413adb)
2022-07-12 12:56:44 +00:00
Labeeb Mattra
94be7a95f7 Update adjustment_type field options
(cherry picked from commit 245b0c7818)
2022-07-12 12:56:44 +00:00
Labeeb Mattra
7ba0326bdd fix adjustment amount field name
(cherry picked from commit 6cc09ef3a2)
2022-07-12 12:56:43 +00:00
Labeeb Mattra
86af1ef6ed fix indent and imports
(cherry picked from commit 0ed6382ab6)
2022-07-12 12:56:43 +00:00
Labeeb Mattra
b995338d0c fix lint
(cherry picked from commit 8434ec09c3)
2022-07-12 12:56:43 +00:00
Labeeb Mattra
0856e14c13 Use adjustment amounts in pending principal amnt
(cherry picked from commit 1b5b2138ee)
2022-07-12 12:56:42 +00:00
Labeeb Mattra
ff5ee2bbac Add ref no to balance adjustment remarks
(cherry picked from commit a1a51ce1a6)
2022-07-12 12:56:42 +00:00
Labeeb Mattra
a36e8a83d8 Add reference number to repayment remarks
(cherry picked from commit 74dbf8c5d9)

# Conflicts:
#	erpnext/loan_management/doctype/loan_repayment/loan_repayment.py
2022-07-12 12:56:41 +00:00
Labeeb Mattra
d81e7e2421 Add NPA checkbox in Loan
(cherry picked from commit 27a8e16b28)
2022-07-12 12:56:41 +00:00
Labeeb Mattra
8181d61293 Update list view for Accrual and Shortfall
(cherry picked from commit 7d6e4898c4)
2022-07-12 12:56:40 +00:00
Labeeb Mattra
548aac5b11 Remove loan account field from doctype
(cherry picked from commit 6febcd529b)
2022-07-12 12:56:40 +00:00
Labeeb Mattra
de69fee6aa Use new adjustment amount fields
(cherry picked from commit 7d468a8778)
2022-07-12 12:56:39 +00:00
Labeeb Mattra
c3e6d7ba29 Seperate credit and debit adjust amount fields in Loan
(cherry picked from commit d6f632a770)
2022-07-12 12:56:38 +00:00
Abhinav Raut
d5ce780e87 feat: add adjustment amount to loan
- fix: bugs in loan balance adjustment

(cherry picked from commit 5c0a25012c)
2022-07-12 12:56:38 +00:00
Labeeb Mattra
a2125e694d Add Loan Balance Adjustment doctype
(cherry picked from commit 2e8f056514)
2022-07-12 12:56:37 +00:00
Labeeb Mattra
0d94653c5b Add Loan Refund doctype
(cherry picked from commit e1682965c5)
2022-07-12 12:56:36 +00:00
Labeeb Mattra
d9723a12c4 Add refund amount to loan
(cherry picked from commit 88cd780ca1)
2022-07-12 12:56:36 +00:00
Labeeb Mattra
d24cb01a9d Add more loan interest accrual types
(cherry picked from commit a81da2ea85)
2022-07-12 12:56:35 +00:00
Labeeb Mattra
ab214bcdfc update loan interest accrual types
(cherry picked from commit 900c878e03)
2022-07-12 12:56:35 +00:00
Frappe PR Bot
751fbd6794 chore(release): Bumped to Version 13.35.2
## [13.35.2](https://github.com/frappe/erpnext/compare/v13.35.1...v13.35.2) (2022-07-12)

### Bug Fixes

* components in the same table don't get updated value of prev payment-days based component ([01beb6f](01beb6f391))
* conflicts ([2045df1](2045df19f9))
* Incorrect provisional expense booking while reposting ([d182137](d182137ed1))
* timeout error while reposting ([07b80c2](07b80c295d))
* Use Contact Name instead of Supplier in RFQ Email ([b0e17de](b0e17dea2a))
* Use fallback conversion factor while setting incoming rate for petty purchase ([2a432c2](2a432c22d4))
* Validate payment-days-based dependent component ([a28c7cf](a28c7cf094))
2022-07-12 09:29:26 +00:00
Deepesh Garg
36566c1d14 Merge pull request #31574 from frappe/version-13-hotfix
chore: weekly version-13 release
2022-07-12 14:57:39 +05:30
Rucha Mahabal
28e4e4320e Merge pull request #31521 from ruchamahabal/fix-salary-calc-pd
fix: components in the same table don't get updated value of prev payment-days based component
2022-07-12 12:06:21 +05:30
Rucha Mahabal
1133062bfc Merge branch 'version-13-hotfix' into fix-salary-calc-pd 2022-07-12 11:42:07 +05:30
Rucha Mahabal
a28c7cf094 fix: Validate payment-days-based dependent component 2022-07-12 11:39:00 +05:30
Deepesh Garg
1c686c732e chore: fix query
(cherry picked from commit e04e67c6bf)
2022-07-11 15:44:49 +00:00
Deepesh Garg
66c5290dee chore: Ignore validation
(cherry picked from commit 3cf609fab1)
2022-07-11 15:44:49 +00:00
Deepesh Garg
9ac9c46dab fix: Allow multi currency invoice against single party account
(cherry picked from commit c83fbd5c50)

# Conflicts:
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.json
2022-07-11 15:44:48 +00:00
Sagar Sharma
faa489bc73 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-31412 2022-07-11 17:11:21 +05:30
Sagar Sharma
b17850ac3e chore: conflicts 2022-07-11 17:09:30 +05:30
Marica
7d36bdf292 Merge pull request #31565 from frappe/mergify/bp/version-13-hotfix/pr-31550
fix: Use Contact Name instead of Supplier in RFQ Email (backport #31550)
2022-07-11 12:35:18 +05:30
marination
b331c462ef chore: Instantiate variable unconditionally
(cherry picked from commit 300e812a1f)
2022-07-11 05:52:08 +00:00
marination
b0e17dea2a fix: Use Contact Name instead of Supplier in RFQ Email
(cherry picked from commit 88ac519b24)
2022-07-11 05:52:07 +00:00
Frappe PR Bot
be3b010b44 chore(release): Bumped to Version 13.35.1
## [13.35.1](https://github.com/frappe/erpnext/compare/v13.35.0...v13.35.1) (2022-07-08)

### Bug Fixes

* Use fallback conversion factor while setting incoming rate for petty purchase ([bac8546](bac854628f))
2022-07-08 10:20:30 +00:00
Deepesh Garg
45799f51b3 Merge pull request #31558 from frappe/mergify/bp/version-13/pr-31529
fix: Use fallback conversion factor while setting incoming rate for petty purchase (backport #31529)
2022-07-08 15:48:47 +05:30
marination
bac854628f fix: Use fallback conversion factor while setting incoming rate for petty purchase
- PIs for petty items (that do not need an Item record) are allowed using Item Name field
- If a different UOM is used in this case, conversion factor stays 0 and causes an error
- Fallback to 1 in `set_incoming_rate` for buying
- Selling will need a proper item, so this change is not needed there

(cherry picked from commit aa043fe961)
2022-07-08 09:47:05 +00:00
Deepesh Garg
6d04bafb04 Merge pull request #31518 from frappe/mergify/bp/version-13-hotfix/pr-31516
fix: Incorrect provisional expense booking while reposting (backport #31516)
2022-07-07 11:53:58 +05:30
rohitwaghchaure
c4f39c7b8b Merge pull request #31538 from frappe/mergify/bp/version-13-hotfix/pr-31519
fix: timeout error while reposting (backport #31519)
2022-07-06 14:33:26 +05:30
rohitwaghchaure
2045df19f9 fix: conflicts 2022-07-06 12:34:10 +05:30
Rohit Waghchaure
07b80c295d fix: timeout error while reposting
(cherry picked from commit 78c8bb251e)

# Conflicts:
#	erpnext/stock/doctype/stock_entry/test_stock_entry.py
2022-07-06 07:02:31 +00:00
Marica
a8c3882400 Merge pull request #31534 from frappe/mergify/bp/version-13-hotfix/pr-31529
fix: Use fallback conversion factor while setting incoming rate for petty purchase (backport #31529)
2022-07-06 01:20:51 +05:30
marination
2a432c22d4 fix: Use fallback conversion factor while setting incoming rate for petty purchase
- PIs for petty items (that do not need an Item record) are allowed using Item Name field
- If a different UOM is used in this case, conversion factor stays 0 and causes an error
- Fallback to 1 in `set_incoming_rate` for buying
- Selling will need a proper item, so this change is not needed there

(cherry picked from commit aa043fe961)
2022-07-05 19:09:36 +00:00
Deepesh Garg
776e807ade Merge pull request #31530 from vorasmit/warn-remove-india
chore: deprecation warning for remove-india
2022-07-05 22:46:33 +05:30
Smit Vora
6bda2a0865 chore: deprecation warning for remove-india 2022-07-05 21:20:51 +05:30
Frappe PR Bot
5072e6b1dc chore(release): Bumped to Version 13.35.0
# [13.35.0](https://github.com/frappe/erpnext/compare/v13.34.2...v13.35.0) (2022-07-05)

### Bug Fixes

* **India:** Discounts in E-Invoicing ([9ba7290](9ba7290dc9))
* Internal PI link in Sales Invoice ([8727a6c](8727a6c5da))
* Modify opts parameter misspell (backport [#31476](https://github.com/frappe/erpnext/issues/31476)) ([#31477](https://github.com/frappe/erpnext/issues/31477)) ([4d987a9](4d987a9510)), closes [#31474](https://github.com/frappe/erpnext/issues/31474)
* offset some scheduled jobs to avoid locks (backport [#31466](https://github.com/frappe/erpnext/issues/31466)) ([#31489](https://github.com/frappe/erpnext/issues/31489)) ([b1c6d78](b1c6d789a9))
* **UX:** dont apply price list  when changing batch on mapped docs (backport [#31503](https://github.com/frappe/erpnext/issues/31503)) ([#31504](https://github.com/frappe/erpnext/issues/31504)) ([31fd263](31fd263825))

### Features

* Cash and Non trade discounts in Sales Invoice ([fd2ec25](fd2ec25588))
2022-07-05 08:55:20 +00:00
Deepesh Garg
a8180796db Merge pull request #31524 from frappe/version-13-hotfix
chore: weekly version-13 release
2022-07-05 14:22:20 +05:30
Rucha Mahabal
01beb6f391 fix: components in the same table don't get updated value of prev payment-days based component 2022-07-04 23:14:26 +05:30
Deepesh Garg
d182137ed1 fix: Incorrect provisional expense booking while reposting
(cherry picked from commit 60aad31162)
2022-07-04 14:58:41 +00:00
mergify[bot]
31fd263825 fix(UX): dont apply price list when changing batch on mapped docs (backport #31503) (#31504)
fix(UX): dont apply price list  when changing batch on mapped docs (#31503)

fix(UX): dont apply price list batch change on mapped docs

(cherry picked from commit 7e40c86c56)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-07-04 17:02:11 +05:30
Ankush Menat
5fc93076f4 chore: ignore late binding warnings
Most are false positives

[skip ci]
2022-07-04 13:22:01 +05:30
Deepesh Garg
827794b676 Merge pull request #31510 from frappe/mergify/bp/version-13-hotfix/pr-31405
feat: Cash and Non trade discounts in Sales Invoice (backport #31405)
2022-07-04 11:58:45 +05:30
Deepesh Garg
c72ae178fa chore: resolve conflicts 2022-07-03 14:05:34 +05:30
Deepesh Garg
4a5d681c77 chore: use get instead of . operator
(cherry picked from commit e54ec4b9b6)
2022-07-03 08:05:23 +00:00
Deepesh Garg
57dc1026c8 test: Add test for einvoice discounts
(cherry picked from commit 38352b3e46)
2022-07-03 08:05:22 +00:00
Deepesh Garg
9ba7290dc9 fix(India): Discounts in E-Invoicing
(cherry picked from commit f337213f33)
2022-07-03 08:05:21 +00:00
Deepesh Garg
fd2ec25588 feat: Cash and Non trade discounts in Sales Invoice
(cherry picked from commit 169ff5a0dd)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.js
2022-07-03 08:05:19 +00:00
Deepesh Garg
eb85ef974a Merge pull request #31508 from frappe/mergify/bp/version-13-hotfix/pr-31493
fix: Internal PI link in Sales Invoice (backport #31493)
2022-07-03 10:09:51 +05:30
Deepesh Garg
8727a6c5da fix: Internal PI link in Sales Invoice
(cherry picked from commit 536e768ba9)
2022-07-02 17:17:50 +00:00
Ankush Menat
1b9a4483d4 chore(meta): update CODEOWNERS 2022-07-01 15:44:18 +05:30
Deepesh Garg
fecf567e92 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-31412 2022-06-30 16:46:59 +05:30
Ankush Menat
2e130c335a ci: reduce container count on v13 2022-06-30 11:38:12 +05:30
mergify[bot]
b1c6d789a9 fix: offset some scheduled jobs to avoid locks (backport #31466) (#31489)
fix: offset some scheduled jobs to avoid locks (#31466)

If your site has multiple background workers then there's possibility
that two jobs will execute in parallal, this creates problem when both
are on operating on same data.

This PR adds a separate section for hourly and daily jobs which have
frequency offset from default frequency to avoid such conflicts.

(cherry picked from commit 5d73697c64)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-06-30 11:35:01 +05:30
mergify[bot]
4d987a9510 fix: Modify opts parameter misspell (backport #31476) (#31477)
fix: Modify opts parameter misspell (#31476)

Modify opts parameter misspell

closes #31474

(cherry picked from commit 2a619fd789)

Co-authored-by: gn306029 <gn306029@users.noreply.github.com>
2022-06-29 14:58:03 +05:30
Frappe PR Bot
43cb4fcbb1 chore(release): Bumped to Version 13.34.2
## [13.34.2](https://github.com/frappe/erpnext/compare/v13.34.1...v13.34.2) (2022-06-28)

### Bug Fixes

* add UOM validation for planned-qty ([559bde3](559bde3135))
* dont update RM items table if not required (backport [#31408](https://github.com/frappe/erpnext/issues/31408)) ([#31457](https://github.com/frappe/erpnext/issues/31457)) ([8155306](815530650c))
* General Ledger and TB opening entries mismatch issues ([a0c5c73](a0c5c730f5))
* Monthly depreciation using WDV method ([e7659a1](e7659a10e4))
* Quotation and Sales Order item sync ([2219132](2219132fdb))
* Respect system precision for user facing balance qty values ([#30837](https://github.com/frappe/erpnext/issues/30837)) ([642b9c5](642b9c5466))
* **Salary Slip:** Components not updated when amount evaluates to 0 due to payment days ([#31425](https://github.com/frappe/erpnext/issues/31425)) ([abfe926](abfe926a45))
* translation for filter status on report ([736f206](736f20656d))
* update ru translate (backport [#31404](https://github.com/frappe/erpnext/issues/31404)) ([#31417](https://github.com/frappe/erpnext/issues/31417)) ([8b78a12](8b78a122e7))
2022-06-28 07:31:44 +00:00
Deepesh Garg
0d5bb92149 Merge pull request #31464 from frappe/version-13-hotfix
chore: weekly version-13 release
2022-06-28 13:00:06 +05:30
mergify[bot]
815530650c fix: dont update RM items table if not required (backport #31408) (#31457)
fix: dont update RM items table if not required (#31408)

Currently on PO update RM item table is auto computed again and again,
if there was any transfer/consumption against that then it will be lost.

This change:
1. Disables updating RM table if no change in qty of FG was made. Since
   RM table can't possibly be different with same FG qty.
2. Blocks update completely if qty is changed and RM items are already
   transferred.

(cherry picked from commit dd11f26eba)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-06-28 10:28:11 +05:30
Deepesh Garg
8ab65bc44e Merge pull request #31453 from frappe/mergify/bp/version-13-hotfix/pr-31446
fix: Quotation and Sales Order item sync (backport #31446)
2022-06-28 08:49:21 +05:30
mergify[bot]
5e7cad476f refactor: clean up product bundle client side code (backport #31455) (#31456)
refactor: clean up product bundle client side code (#31455)

refactor: clean up product bundle cient side code

- Remove deprecated CUR_FRM scripts
- Remove client side fetches and move it to doctype schema

(cherry picked from commit 20dac08f5f)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-06-27 18:33:17 +05:30
Deepesh Garg
2219132fdb fix: Quotation and Sales Order item sync
(cherry picked from commit 58fe220479)
2022-06-27 05:48:39 +00:00
Deepesh Garg
873d1ecdf0 Merge pull request #31447 from frappe/mergify/bp/version-13-hotfix/pr-31439
fix: General Ledger and TB opening entries mismatch issues (backport #31439)
2022-06-27 09:47:00 +05:30
Deepesh Garg
a0c5c730f5 fix: General Ledger and TB opening entries mismatch issues
(cherry picked from commit 6acd0325be)
2022-06-24 16:15:38 +00:00
Nabin Hait
e7659a10e4 fix: Monthly depreciation using WDV method 2022-06-24 21:12:31 +05:30
Sagar Sharma
96bd493a6f Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-31412 2022-06-24 13:17:43 +05:30
Marica
5f8d8c096c Merge pull request #31440 from frappe/mergify/bp/version-13-hotfix/pr-31421
fix: add UOM validation for planned-qty (backport #31421)
2022-06-24 13:02:44 +05:30
s-aga-r
559bde3135 fix: add UOM validation for planned-qty
(cherry picked from commit 00807abe31)
2022-06-24 07:10:55 +00:00
Deepesh Garg
d1bb94bb1d Merge pull request #31431 from frappe/mergify/bp/version-13-hotfix/pr-31395
fix: filter set in Bank Clearance Summary (backport #31395)
2022-06-23 14:26:45 +05:30
Rucha Mahabal
abfe926a45 fix(Salary Slip): Components not updated when amount evaluates to 0 due to payment days (#31425)
* fix(Salary Slip): Components not updated when amount evaluates to 0 due to payment days

* fix: remove 0 valued components that have been updated later
2022-06-23 11:01:00 +05:30
Nihantra C. Patel
4b53ec22c5 Update bank_clearance_summary.py
(cherry picked from commit 0097a2b60c)
2022-06-23 05:25:17 +00:00
Marica
87f77813ea Merge pull request #31422 from frappe/mergify/bp/version-13-hotfix/pr-31420
fix: translation for filter status on report (backport #31420)
2022-06-22 14:01:42 +05:30
Marica
b4e64d0ebb Merge pull request #31423 from marination/bom-update-log-cleanup-perf-hotfix
chore: Clear Progress section for completed logs & `on_submit` UX
2022-06-22 14:01:19 +05:30
marination
fcec318588 chore: Clear Progress section for completed logs & on_submit UX
- Delete `BOM Update Batch` table on 'Completed' log, to save space
- Hide Progress section on 'Completed' log
- Enqueue `on_submit` for 'Update Cost' job, getting leaf boms could take time for huge DBs. Users have to wait for screen to unfreeze.
- Add error handling to `process_boms_cost_level_wise` (Called via cron job and on submit, both in background)
2022-06-22 12:27:08 +05:30
hrzzz
736f20656d fix: translation for filter status on report
(cherry picked from commit 8b1ff96e30)
2022-06-22 06:16:52 +00:00
mergify[bot]
8b78a122e7 fix: update ru translate (backport #31404) (#31417)
* fix: update ru translate (#31404)

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

fix logic

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

(cherry picked from commit ce1b4e40a1)

# Conflicts:
#	erpnext/translations/ru.csv

* chore: Fix merge conflicts

Co-authored-by: Vladislav <integration.into.society@gmail.com>
Co-authored-by: Marica <maricadsouza221197@gmail.com>
2022-06-21 20:14:13 +05:30
Marica
1e34616c91 Merge pull request #31393 from frappe/mergify/bp/version-13-hotfix/pr-30837
fix: Respect system precision for user facing balance qty values (backport #30837)
2022-06-21 20:13:23 +05:30
Frappe PR Bot
0a25d28e34 chore(release): Bumped to Version 13.34.1
## [13.34.1](https://github.com/frappe/erpnext/compare/v13.34.0...v13.34.1) (2022-06-21)

### Bug Fixes

* Conversion rate validation for multi-currency invoices ([4186aaf](4186aafd07))
* **india:** e-invoice eligibility if company gstin is not configured ([#31247](https://github.com/frappe/erpnext/issues/31247)) ([7696ae4](7696ae4de1))
* internal transfer GLE validation ([8a4cd2a](8a4cd2aba1))
* Merge Conflicts ([0f3a02d](0f3a02db57))
* Pick Template BOM if variant BOM absent in WO popup from SO ([7c35887](7c35887d07))
* Quotation lost update ([3b9f943](3b9f943335))
* Spelling mistake in quotation depend on (backport [#31362](https://github.com/frappe/erpnext/issues/31362)) ([#31363](https://github.com/frappe/erpnext/issues/31363)) ([ebcdaf7](ebcdaf7c82))
* transaction date gets unset in material request ([#31387](https://github.com/frappe/erpnext/issues/31387)) ([4e2ed6f](4e2ed6f9d9)), closes [#31327](https://github.com/frappe/erpnext/issues/31327)
* UOM handling for transaction without item (backport [#31389](https://github.com/frappe/erpnext/issues/31389)) ([#31391](https://github.com/frappe/erpnext/issues/31391)) ([051e5cd](051e5cd741))

### Performance Improvements

* GLE reposting with progress and chunking (backport [#31343](https://github.com/frappe/erpnext/issues/31343)) ([#31373](https://github.com/frappe/erpnext/issues/31373)) ([f19ed0b](f19ed0b74c))
2022-06-21 11:14:34 +00:00
s-aga-r
def622c13e fix: set default_bom for item
(cherry picked from commit dc2830da4d)

# Conflicts:
#	erpnext/manufacturing/doctype/bom/test_bom.py
2022-06-21 11:13:31 +00:00
Ankush Menat
d6d2215d8e Merge pull request #31414 from frappe/version-13-hotfix
chore: weekly version-13 release
2022-06-21 16:39:04 +05:30
Deepesh Garg
e43e442448 Merge pull request #31413 from frappe/mergify/bp/version-13-hotfix/pr-31264
fix: internal transfer GLE validation (backport #31264)
2022-06-21 14:56:56 +05:30
Ankush Menat
8a4cd2aba1 fix: internal transfer GLE validation
(cherry picked from commit 65b21ee7d6)
2022-06-21 09:02:02 +00:00
Marica
3f4d00d288 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-30837 2022-06-21 11:02:46 +05:30
Deepesh Garg
8b3fc15ca8 Merge pull request #31397 from frappe/mergify/bp/version-13-hotfix/pr-31396
fix: Quotation lost update (backport #31396)
2022-06-21 10:28:45 +05:30
Deepesh Garg
760ba0877c Merge pull request #31411 from frappe/mergify/bp/version-13-hotfix/pr-31350
fix: Conversion rate validation for multi-currency invoices (backport #31350)
2022-06-21 10:28:15 +05:30
Deepesh Garg
da70b69d68 test: Add test case
(cherry picked from commit 8f37393044)
2022-06-21 03:40:13 +00:00
Deepesh Garg
4186aafd07 fix: Conversion rate validation for multi-currency invoices
(cherry picked from commit d05d15346a)
2022-06-21 03:40:13 +00:00
marination
70a7dfe2f0 chore: Missing import flt 2022-06-20 17:18:01 +05:30
Marica
e982abbe4d chore: Change autoname to v13 compatible value (#31407)
- 'autoincrement' is present only in v14
- 'hash' is automatically still used in tables but change value for safety
2022-06-20 17:09:52 +05:30
marination
5bcfbbe124 chore: fix merge conflict 2022-06-20 16:59:18 +05:30
Deepesh Garg
8e2e61ef84 chore: resolve conflicts 2022-06-18 20:23:58 +05:30
Deepesh Garg
b3169edfc8 Merge pull request #31275 from frappe/mergify/bp/version-13-hotfix/pr-31247
fix(india): e-invoice eligibility if company gstin is not configured (backport #31247)
2022-06-17 21:41:44 +05:30
Deepesh Garg
8d63abb442 chore: fix condition
(cherry picked from commit e457288dba)

# Conflicts:
#	erpnext/selling/doctype/quotation/quotation.py
2022-06-17 15:39:53 +00:00
Deepesh Garg
3b9f943335 fix: Quotation lost update
(cherry picked from commit 02f9441e1a)

# Conflicts:
#	erpnext/selling/doctype/quotation/quotation.py
2022-06-17 15:39:52 +00:00
Marica
642b9c5466 fix: Respect system precision for user facing balance qty values (#30837)
* fix: Respect system precision for user facing balance qty values

- `get_precision` -> `set_precision`
- Use system wide currency precision for `stock_value`
- Round of qty defiiciency as per user defined precision (system flt precision), so that it is WYSIWYG for users

* fix: Consider system precision when validating future negative qty

* test: Immediate Negative Qty precision test

- Test for Immediate Negative Qty precision
- Stock Entry Negative Qty message: Format available qty in system precision
- Pass `stock_uom` as confugrable option in `make_item`

* test: Future Negative Qty validation with precision

* fix: Use `get_field_precision` for currency precision as it used to

- `get_field_precision` defaults to number format for precision (maintain old behaviour)
- Don't pass `currency` to `get_field_precision` as its not used anymore

(cherry picked from commit d6078aa911)

# Conflicts:
#	erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py
2022-06-17 09:46:09 +00:00
mergify[bot]
051e5cd741 fix: UOM handling for transaction without item (backport #31389) (#31391)
fix: UOM handling for transaction without item (#31389)

If invoice is made without item code then UOM, Stock UOM and
conversion_factor all need to be manually added, this is confusing and
leads missing them out leads to errors.

Simplest solution:

- if either UOM exists then set both to same uom conversion factor to
- also set conversion factor based on UOM conversions

(cherry picked from commit 10583eb3ce)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-06-17 15:11:28 +05:30
mergify[bot]
4e2ed6f9d9 fix: transaction date gets unset in material request (#31387)
* fix: transaction date gets unset in material request (#31327)

* fix: set date correctly in material request

* fix: use only `transaction_date` in `get_item_details`

* fix: resolve merge conflict

Co-authored-by: Sagar Vora <sagar@resilient.tech>
2022-06-17 12:04:10 +05:30
Marica
2d6e518f87 Merge pull request #31380 from frappe/mergify/bp/version-13-hotfix/pr-31372
chore: Fix a potential variable misuse bug (backport #31372)
2022-06-16 12:47:58 +05:30
Marica
0f3a02db57 fix: Merge Conflicts 2022-06-16 12:23:13 +05:30
Jingxuan He
2cd03196a4 chore: Fix a potential variable misuse bug (#31372)
* Fix a potential variable misuse bug

* chore: Separate check (separate line) for empty table in Pricing Rule

* chore: Code readability & check for field in row (now row itself)

Co-authored-by: marination <maricadsouza221197@gmail.com>
(cherry picked from commit b4a93da9f3)

# Conflicts:
#	erpnext/accounts/doctype/pricing_rule/pricing_rule.py
2022-06-16 06:47:49 +00:00
Ankush Menat
f19ed0b74c perf: GLE reposting with progress and chunking (backport #31343) (#31373)
* fix: dont use cached doc for GLE reposts

ported from https://github.com/frappe/erpnext/pull/31240

* perf: GLE reposting with progress and chunking

If stock voucher count goes >1000 then fetching all gles and reposting
them all at once requires much more memory and can cause crash.

- This PR ensures that GLE reposting is done in chunks of 100 vouchers.
- This PR also starts keeping track of how many such chunks were
  processed so in future progress is resumed in event of timeout.

* test: add "actual" test for chunked GLE reposting
2022-06-15 20:54:20 +05:30
Marica
001130c0da Merge pull request #31368 from frappe/mergify/bp/version-13-hotfix/pr-31353
fix: Pick Template BOM if variant BOM absent in WO popup from SO (backport #31353)
2022-06-15 15:42:58 +05:30
marination
7c35887d07 fix: Pick Template BOM if variant BOM absent in WO popup from SO
- Use `get_default_bom` in sales_order.py (reduce duplicate utility functions)
- Remove redundant if else in `get_work_order_items`
- `get_default_bom`: If no BOM and template exists try to fetch template BOM
- test: `get_work_order_items` via SO and if right BOM is picked

(cherry picked from commit 9f2d325e67)
2022-06-15 09:07:54 +00:00
mergify[bot]
ebcdaf7c82 fix: Spelling mistake in quotation depend on (backport #31362) (#31363)
* fix: Spelling mistake in quotation depend on (#31362)

Update quotation.json

(cherry picked from commit 37e9622426)

* chore: bump modified

Co-authored-by: Nihantra C. Patel <99652762+nihantra@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-06-15 12:05:46 +05:30
Frappe PR Bot
943d83b739 chore(release): Bumped to Version 13.34.0
# [13.34.0](https://github.com/frappe/erpnext/compare/v13.33.0...v13.34.0) (2022-06-14)

### Bug Fixes

* (auto-merge) Use `frappe.log_error` instead of `doc.log_error` ([bced6a0](bced6a07b4))
* `test_work_order_with_non_stock_item` ([b827c3b](b827c3b3c9))
* Add cost center in loan document ([c19dfbe](c19dfbe98a))
* **asset:** failing test case ([#31277](https://github.com/frappe/erpnext/issues/31277)) ([8a4c9d1](8a4c9d1238))
* Auto Insert Item Price If Missing when discount & blank UOM (backport [#31168](https://github.com/frappe/erpnext/issues/31168)) ([#31267](https://github.com/frappe/erpnext/issues/31267)) ([e69bff0](e69bff0caa))
* Call `calculate_cost` for Draft BOM and typo in argument ([d035aa2](d035aa2afb))
* Company address filter in quotation ([d375939](d375939475))
* DB update child items, remove redundancy, fix perf ([cbc52a2](cbc52a2e45))
* Depreciate Asset before generating GL Entries on sale ([#30759](https://github.com/frappe/erpnext/issues/30759)) ([dfbfe40](dfbfe403e9))
* Get fresh RM rate in `calculate_rm_cost` ([9a513fd](9a513fda74))
* **India:** Incorrect taxable in GSTR-3B report ([e5d2c59](e5d2c59929))
* **India:** Sales taxes and charges template fetching in quotation ([a1ba847](a1ba8475d0))
* locale Currency and Float setting in update_employee ([391ed9c](391ed9c567))
* misaligned columns in print format of AR/AP report ([81e32e2](81e32e2855))
* Partially Ordered status for quotation ([37ba550](37ba550398))
* purchase invoice standalone return GLEs (backport [#31209](https://github.com/frappe/erpnext/issues/31209)) ([#31263](https://github.com/frappe/erpnext/issues/31263)) ([6d99b5a](6d99b5a95a))
* Reset represents company on disabling internal customer and supplier (backport [#31302](https://github.com/frappe/erpnext/issues/31302)) ([#31306](https://github.com/frappe/erpnext/issues/31306)) ([fb9b302](fb9b302ecf))
* Safe cast `row.rate` (in case of faulty exploded items, edge case but oh well) ([6d65e2b](6d65e2bab4))
* Supplied Qty not updated on Stock Entry cancel ([79b2062](79b20622c9))
* Trial Balance failing to ignore Finance Book ([00371f4](00371f4a22))
* typo in sql condition ([894f945](894f945be7))
* update fr translation (backport [#31232](https://github.com/frappe/erpnext/issues/31232)) ([#31334](https://github.com/frappe/erpnext/issues/31334)) ([5d0f271](5d0f271451))
* update Period Closing Voucher per Company ([5ebbe81](5ebbe81543))
* update ru translate (backport [#31200](https://github.com/frappe/erpnext/issues/31200)) ([#31304](https://github.com/frappe/erpnext/issues/31304)) ([77e4755](77e4755c1f))
* Use `frappe.as_unicode` to decode output of redis module list (backport [#31282](https://github.com/frappe/erpnext/issues/31282)) ([#31283](https://github.com/frappe/erpnext/issues/31283)) ([633a452](633a4521e4))
* **ux:** hide new version btn on unsaved BOM (backport [#31297](https://github.com/frappe/erpnext/issues/31297)) ([#31298](https://github.com/frappe/erpnext/issues/31298)) ([9f6b32a](9f6b32af12))
* **UX:** use doc.status for Job Card status ([#31320](https://github.com/frappe/erpnext/issues/31320)) ([78473b8](78473b8d99))

### Features

* Add german translations ([a3f2cf3](a3f2cf3917))
* Level-wise BOM cost updation ([74d7d81](74d7d81d6e))
* Only update exploded items rate and amount ([a26da58](a26da58718))
* Track progress in Log Batch/Job wise ([3b2a8bf](3b2a8bf837))

### Performance Improvements

* `get_boms_in_bottom_up_order` ([87c2b3b](87c2b3be0b))
* `get_next_higher_level_boms` ([767a775](767a775709))
* Use cached doc instead of `get_doc` ([faa69c9](faa69c942b))
2022-06-14 07:45:40 +00:00
Deepesh Garg
662a63b3f5 Merge pull request #31349 from frappe/version-13-hotfix
chore: weekly version-13 release
2022-06-14 13:13:45 +05:30
Deepesh Garg
55e0c03ef0 Merge pull request #31347 from frappe/mergify/bp/version-13-hotfix/pr-31322
fix: Company address filter in quotation (backport #31322)
2022-06-14 12:44:59 +05:30
Deepesh Garg
da1a948a28 chore: resolve conflicts 2022-06-14 11:36:43 +05:30
Deepesh Garg
823cf88c3c chore: linting issues
(cherry picked from commit fb3da124e5)
2022-06-14 05:47:58 +00:00
Deepesh Garg
37ba550398 fix: Partially Ordered status for quotation
(cherry picked from commit 118c786e63)

# Conflicts:
#	erpnext/selling/doctype/quotation/quotation.json
2022-06-14 05:47:57 +00:00
Deepesh Garg
a1ba8475d0 fix(India): Sales taxes and charges template fetching in quotation
(cherry picked from commit 243625898e)
2022-06-14 05:47:55 +00:00
Deepesh Garg
d375939475 fix: Company address filter in quotation
(cherry picked from commit 2fc04f661a)
2022-06-14 05:47:54 +00:00
Marica
c5bda9cb09 Merge pull request #31344 from frappe/mergify/bp/version-13-hotfix/pr-31341
fix: Supplied Qty not updated on Stock Entry cancel (backport #31341)
2022-06-13 23:24:49 +05:30
Marica
6064ca6fed test: Pass "yes" instead of 1 for is_subcontracted in create_purchase_order 2022-06-13 21:06:04 +05:30
marination
86a0ba5c9f test: PO Supplied Qty reset on cancel/submit
(cherry picked from commit b8f468cb4f)
2022-06-13 15:13:54 +00:00
marination
79b20622c9 fix: Supplied Qty not updated on Stock Entry cancel
- Loop over PO supplied items and update them as data from SE will exclude a row if supplied qty becomes 0 on cancel
- Use DB API insteaf of raw SQL

(cherry picked from commit fa1d9d548e)
2022-06-13 15:13:53 +00:00
Saqib Ansari
fb1325d7a5 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-31247 2022-06-13 17:08:23 +05:30
mergify[bot]
5d0f271451 fix: update fr translation (backport #31232) (#31334)
* fix: update fr translation (#31232)

* update fr translation

* fix:update fr translation

* fix:update fr translation

* fix:update fr translation

* fix:update fr translation

* fix:update fr translation

* fix:update fr translation

* fix:update fr translation

* Update fr.csv

update typo

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* update fr translation

* fix: Use elision instead of HTML code equivalent

* fix: Use elision instead of HTML code equivalent (pt 2)

* fix: Use elision/single quote instead of HTML code equivalent (pt 3)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
(cherry picked from commit 83367bfe5e)

* fix: Accidental '=' instead of comma

Co-authored-by: HENRY Florian <florian.henry@open-concept.pro>
Co-authored-by: Marica <maricadsouza221197@gmail.com>
2022-06-13 12:18:46 +05:30
Marica
1e6e652988 Merge pull request #31314 from frappe/mergify/bp/version-13-hotfix/pr-31303
fix: locale Currency and Float setting in update_employee (backport #31303)
2022-06-13 10:49:29 +05:30
Marica
ff770bbf04 Merge pull request #31321 from frappe/mergify/bp/version-13-hotfix/pr-31320
fix(UX): use doc.status for Job Card status (backport #31320)
2022-06-13 10:30:05 +05:30
Ankush Menat
78473b8d99 fix(UX): use doc.status for Job Card status (#31320)
- Use doc.status directly for indicator - single source of truth
- Update status to cancelled when doc is cancelled

(cherry picked from commit 39ec0aca95)
2022-06-13 10:04:53 +05:30
Deepesh Garg
977d6969d5 Merge pull request #31318 from frappe/mergify/bp/version-13-hotfix/pr-31295
fix: update Period Closing Voucher per Company (backport #31295)
2022-06-11 23:44:22 +05:30
mergify[bot]
50a4c2e9dc refactor: remove add_fetch (backport #31315) (#31319)
* refactor: remove add_fetch (#31315)

- Sales Team already had fetch from set up
- Set up fetch from on sales partner in sales transaction

Reason for removal: the JS code applies arbitrarily to any field called "sales_person"

(cherry picked from commit 1646fbe478)

# Conflicts:
#	erpnext/selling/sales_common.js

* chore: conflicts

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-06-10 18:30:50 +05:30
hendrik
5ebbe81543 fix: update Period Closing Voucher per Company
Validate period closing voucher company-wise

(cherry picked from commit 74b274f555)
2022-06-10 09:23:36 +00:00
Deepesh Garg
395f86f42b Merge pull request #31310 from frappe/mergify/bp/version-13-hotfix/pr-31294
fix(India): Incorrect taxable in GSTR-3B report (backport #31294)
2022-06-10 14:27:20 +05:30
Deepesh Garg
9e0cb2a467 Merge pull request #31262 from frappe/mergify/bp/version-13-hotfix/pr-30155
fix: Add cost center in loan document (backport #30155)
2022-06-10 13:16:33 +05:30
Deepesh Garg
1aaca097b3 chore: Linting Issues 2022-06-10 12:51:16 +05:30
Deepesh Garg
309bdf257d Merge pull request #31139 from frappe/mergify/bp/version-13-hotfix/pr-31102
feat: Add german translations (backport #31102)
2022-06-10 12:42:10 +05:30
Deepesh Garg
4c9422fb1b chore: resolve conflicts 2022-06-10 12:39:12 +05:30
RJPvT
391ed9c567 fix: locale Currency and Float setting in update_employee
In fieldtypes locale settings (example NL) . and , changes whereby the field is inproperly filled

(cherry picked from commit 17887cde71)
2022-06-10 06:05:51 +00:00
Deepesh Garg
95f8784ea9 chore: Resolve conflicts 2022-06-10 10:59:46 +05:30
Deepesh Garg
176a6722e5 chore: cleanup
(cherry picked from commit 50aafdbe99)
2022-06-10 05:19:55 +00:00
Deepesh Garg
e5d2c59929 fix(India): Incorrect taxable in GSTR-3B report
(cherry picked from commit 20f568c159)
2022-06-10 05:19:54 +00:00
Deepesh Garg
384ce92b4b Merge pull request #31307 from frappe/mergify/bp/version-13-hotfix/pr-31216
fix: Trial Balance failing to ignore Finance Book (backport #31216)
2022-06-10 00:10:23 +05:30
Sun Howwrongbum
894f945be7 fix: typo in sql condition
(cherry picked from commit ee2949aa3f)
2022-06-09 15:05:15 +00:00
Deepesh Garg
44642dba39 chore: Linting Issues
(cherry picked from commit b9dbb36d0e)
2022-06-09 15:05:14 +00:00
Sun Howwrongbum
00371f4a22 fix: Trial Balance failing to ignore Finance Book
(cherry picked from commit 48bde2de2a)
2022-06-09 15:05:14 +00:00
mergify[bot]
fb9b302ecf fix: Reset represents company on disabling internal customer and supplier (backport #31302) (#31306)
fix: Reset represents company on disabling internal customer and supplier (#31302)

(cherry picked from commit c13e5ad741)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2022-06-09 19:20:53 +05:30
mergify[bot]
77e4755c1f fix: update ru translate (backport #31200) (#31304)
* fix: update ru translate (#31200)

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

* Update ru.csv

fix logic

* Update ru.csv

* Update ru.csv

* Update ru.csv

(cherry picked from commit 2675751d6c)

# Conflicts:
#	erpnext/translations/ru.csv

* fix: Merge conflicts

Co-authored-by: Vladislav <integration.into.society@gmail.com>
Co-authored-by: Marica <maricadsouza221197@gmail.com>
2022-06-09 19:16:48 +05:30
Marica
bb431bb21f Merge pull request #31299 from frappe/mergify/bp/version-13-hotfix/pr-31296
fix: misaligned columns in print format of AR/AP report (backport #31296)
2022-06-09 18:31:20 +05:30
Marica
48de5ab62a Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-31296 2022-06-09 18:09:09 +05:30
Marica
3816ae21bb Merge pull request #31078 from marination/v13-perf-bom-update-tool
perf: BOM Update Tool (backport)
2022-06-09 17:51:28 +05:30
meaziz
9347cbbc9f chore: Asset Arabic translation Fix (#31221)
Update ar.csv

Fix Translation arabic translation that caused an error when submitting an asset if user language was arabic
2022-06-09 17:43:31 +05:30
ruthra kumar
81e32e2855 fix: misaligned columns in print format of AR/AP report
(cherry picked from commit bbaa14af16)
2022-06-09 12:06:11 +00:00
mergify[bot]
9f6b32af12 fix(ux): hide new version btn on unsaved BOM (backport #31297) (#31298)
fix(ux): hide new version btn on unsaved BOM (#31297)

(cherry picked from commit d9a5213952)

Co-authored-by: Ankush Menat <me@ankush.dev>
2022-06-09 17:22:50 +05:30
marination
5a08850aa1 chore: Less hacky tests, versioning (replace bom) and clearing log data (update cost)
- Remove `auto_commit_on_many_writes` in `update_cost_in_level()` as commits happen every N BOMs
- Auto commit every 50 BOMs
- test: Remove hacky `frappe.flags.in_test` returns
- test: Enqueue `now` if in tests (for update cost and replace bom)
- Replace BOM: Copy bom object to `_doc_before_save` so that version.py finds a difference between the two
- Replace BOM: Add reference to version
- Update Cost: Unset `processed_boms` if Log is completed (useless after completion)
- test: `update_cost_in_all_boms_in_test` works close to actual prod implementation (only call Cron job manually)
- Test: use `enqueue_replace_bom`  so that test works closest to production behaviour

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2022-06-09 16:56:19 +05:30
Marica
7a868a46d5 Merge branch 'version-13-hotfix' into v13-perf-bom-update-tool 2022-06-09 13:33:52 +05:30
mergify[bot]
633a4521e4 fix: Use frappe.as_unicode to decode output of redis module list (backport #31282) (#31283)
fix: Use `frappe.as_unicode` to decode output of redis module list (#31282)

- As of redis 7, a list is added to the result of fetching the module list
- This list cannot be "decoded",so use `frappe.as_unicode` that handles bytes as well as other types

(cherry picked from commit 2832731601)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2022-06-08 18:12:02 +05:30
Saqib Ansari
e1fe901a91 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-31247 2022-06-08 14:21:31 +05:30
Saqib Ansari
8a4c9d1238 fix(asset): failing test case (#31277) 2022-06-08 14:12:59 +05:30
Marica
8656020c00 Merge branch 'version-13-hotfix' into v13-perf-bom-update-tool 2022-06-08 14:09:51 +05:30
marination
289d65a4ed chore: get_valuation_rate sider fixes
- Use qb instead of db.sql
- Don't use `args` as argument for function
- Cleaner variable names
2022-06-08 14:08:45 +05:30
marination
b529a610fb test: Fix test_update_bom_cost_in_all_boms
- Use base_rate for assertions as rate is subject to change due to conversion factor (USD)
2022-06-08 14:08:12 +05:30
marination
c7accb9c33 test: Util to update cost in all BOMs
- Utility to update cost in all BOMs without cron jobs or background jobs (run immediately)
- Re-use util wherever all bom costs are to be updated
- Skip explicit commits if in test
- Specify company in test records (dirty data sometimes, company wh mismatch)
- Skip background jobs queueing if in test
2022-06-08 14:07:34 +05:30
Saqib Ansari
7696ae4de1 fix(india): e-invoice eligibility if company gstin is not configured (#31247)
(cherry picked from commit fb4f8d870b)
2022-06-08 04:06:58 +00:00
Ganga Manoj
dfbfe403e9 fix: Depreciate Asset before generating GL Entries on sale (#30759) 2022-06-08 09:35:43 +05:30
mergify[bot]
e69bff0caa fix: Auto Insert Item Price If Missing when discount & blank UOM (backport #31168) (#31267)
fix: Auto Insert Item Price If Missing when discount & blank UOM (#31168)

* fix: Auto Insert Item Price If Missing when discount and blank UOM

fixes wrong item price insert when discount is used and adds uom=stock_uom instead of blank as price is converted to stock uom

* unit tests added for item with discount

I have added test  for auto_insert_price where discount is used.

* unit test issue fixed

fixed make_sales_order as some of the test that depended on it were failing due to passing of incorrect parameters.

Co-authored-by: Ankush Menat <me@ankush.dev>
(cherry picked from commit b3ccc4bfb9)

Co-authored-by: maharshivpatel <39730881+maharshivpatel@users.noreply.github.com>
2022-06-07 16:04:00 +05:30
Ankush Menat
0e53edfd49 test: sales register report with conditions (#31266) 2022-06-07 16:03:29 +05:30
mergify[bot]
6d99b5a95a fix: purchase invoice standalone return GLEs (backport #31209) (#31263)
* test: create stock test mixin for assertion/utils

(cherry picked from commit 293eb8d722)

# Conflicts:
#	erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py
#	erpnext/stock/tests/test_utils.py

* fix: purchase invoice return GLe

voucher_wise_stock_value contains tuples and the condition was looking
for string, so it's never triggered.

Caused by https://github.com/frappe/erpnext/pull/24200

(cherry picked from commit 7726271e2a)

* chore: conflicts

Co-authored-by: Ankush Menat <me@ankush.dev>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-06-07 15:43:37 +05:30
Frappe PR Bot
3b1f9fe03b chore(release): Bumped to Version 13.33.0
# [13.33.0](https://github.com/frappe/erpnext/compare/v13.32.0...v13.33.0) (2022-06-07)

### Bug Fixes

* Close unsecured terms loans ([d6d1d79](d6d1d79ba0))
* Consider only Approved leave applications in LWP, Employee Benefit calculations ([7f84c86](7f84c86d43))
* display currencies in validation message. ([ef22337](ef22337a9b))
* incorrect billed_qty in sales order analysis report when multiple delivery notes for item (backport [#31194](https://github.com/frappe/erpnext/issues/31194)) ([#31250](https://github.com/frappe/erpnext/issues/31250)) ([3b1f6da](3b1f6da741))
* incorrect LWP calculation for half days in employee benefit application ([10f0c93](10f0c935fe))
* **India:** GSTIN filter in GSTR-1 report ([abe9fe7](abe9fe70ce))
* **India:** Supplies from composite dealer not showing up ([15712c7](15712c742b))
* **job card:** only hold during draft state (backport [#31243](https://github.com/frappe/erpnext/issues/31243)) ([#31249](https://github.com/frappe/erpnext/issues/31249)) ([a7fc278](a7fc278b60))
* **Leave Application:** 'Cancelled' status shown as 'Open' in list view ([8b48d45](8b48d45286))
* leave balance for earned leaves in backdated Leave Application dashboard (backport [#31253](https://github.com/frappe/erpnext/issues/31253)) ([#31256](https://github.com/frappe/erpnext/issues/31256)) ([a22d92f](a22d92f946))
* only fetch membership expiry if not already set in `member.js` ([#31259](https://github.com/frappe/erpnext/issues/31259)) ([d433784](d433784171))
* Parent dimension filters in orders ([b3cbcd8](b3cbcd871b))
* Pluralize year text instead of optional bracket (backport [#31210](https://github.com/frappe/erpnext/issues/31210)) ([#31212](https://github.com/frappe/erpnext/issues/31212)) ([b31709c](b31709c793))
* re-validate warehouse after 'update items' (backport [#31203](https://github.com/frappe/erpnext/issues/31203)) ([#31206](https://github.com/frappe/erpnext/issues/31206)) ([3a718c7](3a718c7d5f))
* remove leave policy assignment creation patch (backport [#31097](https://github.com/frappe/erpnext/issues/31097)) ([#31204](https://github.com/frappe/erpnext/issues/31204)) ([4aeb448](4aeb448fea))
* Remove redundant query ([3c4cf59](3c4cf5929f))
* Reverse provisional entries on Purchase Invoice cancel ([1fba432](1fba432786))
* **Sales Register:** incorrect query with dimensions (backport [#31242](https://github.com/frappe/erpnext/issues/31242)) ([#31251](https://github.com/frappe/erpnext/issues/31251)) ([0badfc8](0badfc8748))
* Simply cancel reverse entries ([100b8d9](100b8d9b96))

### Features

* **india:** Improve E-way Bill Cancellation. ([#31088](https://github.com/frappe/erpnext/issues/31088)) ([622d25e](622d25e126))
2022-06-07 09:59:51 +00:00
Deepesh Garg
5f7f8361d9 Merge pull request #31265 from frappe/version-13-hotfix
chore: weekly version-13 release
2022-06-07 15:28:17 +05:30
Deepesh Garg
f087246e38 Merge pull request #31261 from frappe/mergify/bp/version-13-hotfix/pr-31258
fix: Close unsecured terms loans (backport #31258)
2022-06-07 14:52:47 +05:30
Deepesh Garg
c19dfbe98a fix: Add cost center in loan document
(cherry picked from commit 5d66cc4c4a)

# Conflicts:
#	erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py
#	erpnext/patches.txt
2022-06-07 08:40:48 +00:00
Deepesh Garg
ef8483d2ea chore: Resolve conflicts 2022-06-07 14:10:44 +05:30
Deepesh Garg
8cb85fa90b Merge pull request #31260 from frappe/mergify/bp/version-13-hotfix/pr-31233
fix: Reverse provisional entries on Purchase Invoice cancel (backport #31233)
2022-06-07 14:03:44 +05:30
Rucha Mahabal
d433784171 fix: only fetch membership expiry if not already set in member.js (#31259) 2022-06-07 14:01:12 +05:30
Deepesh Garg
d6d1d79ba0 fix: Close unsecured terms loans
(cherry picked from commit 815141bf57)

# Conflicts:
#	erpnext/loan_management/doctype/loan/loan.py
2022-06-07 08:24:23 +00:00
Deepesh Garg
42a0b82c71 test: Add test coverage for cancellation
(cherry picked from commit dc8e80ea81)
2022-06-07 08:01:46 +00:00
Deepesh Garg
100b8d9b96 fix: Simply cancel reverse entries
(cherry picked from commit 86a24f3d22)
2022-06-07 08:01:45 +00:00
Deepesh Garg
1fba432786 fix: Reverse provisional entries on Purchase Invoice cancel
(cherry picked from commit 61fa4eb6c9)
2022-06-07 08:01:45 +00:00
Rucha Mahabal
149c6031a1 chore: add missing import 2022-06-07 11:08:29 +05:30
Rucha Mahabal
ad1b419368 test: Employee Benefit Application
- make `get_no_of_days` a function for reusability
2022-06-07 11:08:29 +05:30
Rucha Mahabal
10f0c935fe fix: incorrect LWP calculation for half days in employee benefit application 2022-06-07 11:08:29 +05:30
Rucha Mahabal
8b48d45286 fix(Leave Application): 'Cancelled' status shown as 'Open' in list view 2022-06-07 11:08:29 +05:30
Rucha Mahabal
144d71c6af refactor: rewrite lwp queries using query builder 2022-06-07 11:08:29 +05:30
Rucha Mahabal
7f84c86d43 fix: Consider only Approved leave applications in LWP, Employee Benefit calculations
- do not allow submitting leave applications with 'Cancelled' status
2022-06-07 11:08:29 +05:30
mergify[bot]
a22d92f946 fix: leave balance for earned leaves in backdated Leave Application dashboard (backport #31253) (#31256)
fix: leave balance for earned leaves in backdated Leave Application dashboard

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2022-06-07 10:22:27 +05:30
Deepesh Garg
86856491b7 Merge pull request #31235 from frappe/mergify/bp/version-13-hotfix/pr-31219
fix: Parent dimension filters in orders (backport #31219)
2022-06-06 20:53:33 +05:30
Deepesh Garg
60d378aed2 chore: Resolve conflicts 2022-06-06 20:36:40 +05:30
mergify[bot]
3b1f6da741 fix: incorrect billed_qty in sales order analysis report when multiple delivery notes for item (backport #31194) (#31250)
* fix: incorrect billed_qty when item has multiple Delivery note

sales order analysis report returns incorrect billed_qty value for
an SO item has multiple delivery notes

(cherry picked from commit 0331e37982)

* test: multiple delivery notes and billed quantity

(cherry picked from commit 4f1bfbb93d)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2022-06-06 19:55:18 +05:30
mergify[bot]
a7fc278b60 fix(job card): only hold during draft state (backport #31243) (#31249)
* fix(job card): only hold during draft state (#31243)

(cherry picked from commit ee5bc58e9b)

# Conflicts:
#	erpnext/patches.txt

* chore: conflicts

Co-authored-by: Ankush Menat <me@ankush.dev>
2022-06-06 19:54:56 +05:30
mergify[bot]
0badfc8748 fix(Sales Register): incorrect query with dimensions (backport #31242) (#31251)
fix(Sales Register): incorrect query with dimensions

If accounting dimension is also part of the default filters then same
query is repeated with incorrect syntax.

e.g. `item_group = (child1, child2)` instead of `in` query.

fix: don't add default filter if they are part of dimensions to be
added.

(cherry picked from commit c3219ebad1)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-06-06 19:54:41 +05:30
marination
d3b06a682c chore: get_valuation_rate in bom.py must always return float & goto Item master if no bins 2022-06-06 18:15:07 +05:30
marination
7bd5558c31 chore: Miscellanous fixes/enhancements
- `get_valuation_rate`: if no bins are found return 0, SLEs do not exist either
- `get_valuation_rate`: Compute average valuation rate via query
- `get_rm_rate_map`: set order_by as None to avoid creating sort index (modified) each time query runs (seen in process list)
- BOM Update Batch: add status field and hide `boms_updated` so that  users can see progress without loading all updated boms (too much data)
- BOM Update Batch: set batch row status to completed after job runs
- BOM Update Log: remove `parent_boms` field (just pass parent boms to processing function) & remove Paused state (not used)
- Move job to long queue to avoid choking default queue
- `update_cost_in_boms`: use `get_doc` as each BOM is accessed only once. Use `for_update` to lock BOM row
- Commit after every 100 BOMs
2022-06-06 17:04:06 +05:30
Deepesh Garg
b58c7750c6 Merge pull request #31237 from frappe/mergify/bp/version-13-hotfix/pr-31223
fix: display currencies in validation message. (backport #31223)
2022-06-06 14:48:21 +05:30
Deepesh Garg
aaaacf9a8f Merge pull request #31241 from frappe/mergify/bp/version-13-hotfix/pr-31230
fix: Remove redundant query (backport #31230)
2022-06-06 14:48:00 +05:30
Deepesh Garg
3c4cf5929f fix: Remove redundant query
(cherry picked from commit a200e7e1fb)
2022-06-06 06:54:41 +00:00
Deepesh Garg
ed89963d65 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-31223 2022-06-06 12:24:34 +05:30
Deepesh Garg
281fe34457 Merge pull request #31236 from frappe/mergify/bp/version-13-hotfix/pr-31231
fix(India): Supplies from composite dealer not showing up (backport #31231)
2022-06-06 12:24:20 +05:30
Deepesh Garg
d07014340f Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-31223 2022-06-06 11:50:30 +05:30
Deepesh Garg
fa0984f192 Merge pull request #31234 from frappe/mergify/bp/version-13-hotfix/pr-31218
fix(India): GSTIN filter in GSTR-1 report (backport #31218)
2022-06-06 11:45:41 +05:30
Deepesh Garg
3ea2c95768 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-31223 2022-06-06 10:42:48 +05:30
Deepesh Garg
23d94c135f Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-31231 2022-06-06 10:42:41 +05:30
Deepesh Garg
66bc9a974e Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-31218 2022-06-06 10:42:28 +05:30
Deepesh Garg
91716e9c26 Merge pull request #31238 from frappe/mergify/bp/version-13-hotfix/pr-31217
ci: stale apt cache (backport #31217)
2022-06-06 10:06:41 +05:30
Ankush Menat
2db12d7bfa ci: stale apt cache (#31217)
(cherry picked from commit c7efa3b44d)
2022-06-06 04:03:14 +00:00
Devin Slauenwhite
f4a4dacb22 chore: linter
(cherry picked from commit b061ea4cd2)
2022-06-06 03:37:41 +00:00
Devin Slauenwhite
ef22337a9b fix: display currencies in validation message.
(cherry picked from commit 3a1c923e76)
2022-06-06 03:37:40 +00:00
Deepesh Garg
15712c742b fix(India): Supplies from composite dealer not showing up
(cherry picked from commit db07831db7)
2022-06-06 03:30:59 +00:00
Deepesh Garg
b3cbcd871b fix: Parent dimension filters in orders
(cherry picked from commit 3f376cc3a5)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.js
2022-06-06 03:29:07 +00:00
Deepesh Garg
abe9fe70ce fix(India): GSTIN filter in GSTR-1 report
(cherry picked from commit f0ac394d6e)
2022-06-06 03:28:38 +00:00
marination
3b2a8bf837 feat: Track progress in Log Batch/Job wise
- This was done due to stale reads while the background jobs tried updating status of the log
- Added a table where all bom jobs within log will be tracked with what level they are processing
- Cron job will check if table jobs are all processed every 5 mins
- If yes, it will prepare parents and call `process_boms_cost_level_wise` to start next level
- If pending jobs, do nothing
- Current BOM Level is being tracked that helps adding rows to the table
- Individual bom cost jobs (that are queued) will process and update boms > will update BOM Update Batch table row with list of updated BOMs
2022-06-02 13:41:56 +05:30
mergify[bot]
b31709c793 fix: Pluralize year text instead of optional bracket (backport #31210) (#31212)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
Co-authored-by: Mohammad Hussain Nagaria <34810212+NagariaHussain@users.noreply.github.com>
2022-06-01 16:47:02 +05:30
mergify[bot]
3a718c7d5f fix: re-validate warehouse after 'update items' (backport #31203) (#31206)
fix: re-validate warehouse after 'update items' (#31203)

(cherry picked from commit c84e11ac82)

Co-authored-by: Ankush Menat <me@ankush.dev>
2022-06-01 15:24:55 +05:30
mergify[bot]
8b985d632f test: fix attendance tests for unmarked days (backport #31205) (#31208)
test: fix attendance tests for unmarked days (#31205)

* test: fix attendance tests for unmarked days

* chore: remove unused import

(cherry picked from commit 536f1dfc4b)

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2022-06-01 14:15:59 +05:30
mergify[bot]
4aeb448fea fix: remove leave policy assignment creation patch (backport #31097) (#31204)
* fix: remove leave policy assignment creation patch (#31097)

(cherry picked from commit d4b9cc0242)

# Conflicts:
#	erpnext/patches.txt

* chore: fix conflicts

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2022-06-01 12:46:17 +05:30
Deepesh Garg
910ab405ae Merge pull request #31188 from frappe/mergify/bp/version-13-hotfix/pr-31088
feat(india): Check E-way Bill Status before Cancellation. (backport #31088)
2022-05-31 21:41:54 +05:30
Frappe PR Bot
56070c7b86 chore(release): Bumped to Version 13.32.0
# [13.32.0](https://github.com/frappe/erpnext/compare/v13.31.1...v13.32.0) (2022-05-31)

### Bug Fixes

* add list view settings for Gratuity ([e4426ad](e4426addeb))
* amount precision for Tax Exemption Proof Submission ([bb04e4b](bb04e4b6de))
* component pay calculation ([b1e119d](b1e119d97d))
* conflicts ([cdb884b](cdb884bbf2))
* conflicts ([c02a89d](c02a89db4d))
* conflicts ([6aa6114](6aa6114757))
* date filter on quality inspection report (backport [#31148](https://github.com/frappe/erpnext/issues/31148)) ([#31164](https://github.com/frappe/erpnext/issues/31164)) ([f19747c](f19747cee0))
* Exchange rate reste to 1 on making mapped doc ([91863c7](91863c7457))
* Gratuity status not updated on salary slip submission ([0a014ed](0a014edd7a))
* HRA Exemption calculation in case of multiple salary structure assignments ([de8f5f8](de8f5f87d0))
* Improve button labels in Warehouse (backport [#31101](https://github.com/frappe/erpnext/issues/31101)) ([#31150](https://github.com/frappe/erpnext/issues/31150)) ([d891394](d891394dc8))
* **india:** duplicate qrcode and hide button ([#31154](https://github.com/frappe/erpnext/issues/31154)) ([f40100d](f40100d483))
* Job Opening linked to Staffing Plan cannot be created/updated if there are existing employees ([b4a3a53](b4a3a533c8))
* **pos:** freeze screen while processing pos invoices ([#30850](https://github.com/frappe/erpnext/issues/30850)) ([a7bf236](a7bf236c28))
* skip existing batch number during autogen (backport [#31140](https://github.com/frappe/erpnext/issues/31140)) ([#31144](https://github.com/frappe/erpnext/issues/31144)) ([a380bae](a380bae298))
* Tax Declaration tests and amount precision ([1e728df](1e728df54c))
* validation message ([096ae21](096ae210e1))

### Features

* Auto accrue loan interest for backdated term loans ([89c4d51](89c4d518e1))
* live preview of naming series on naming series tool (backport [#31141](https://github.com/frappe/erpnext/issues/31141)) ([#31146](https://github.com/frappe/erpnext/issues/31146)) ([fd2f3b9](fd2f3b9061))
* provision to exclude exploded items in the BOM (backport [#29450](https://github.com/frappe/erpnext/issues/29450)) ([#31174](https://github.com/frappe/erpnext/issues/31174)) ([50d338d](50d338df30))
2022-05-31 13:22:25 +00:00
Ankush Menat
683256eccc Merge pull request #31197 from frappe/version-13-hotfix
chore: weekly release for version-13
2022-05-31 18:50:44 +05:30
marination
e6ad56cd68 chore: Limit Update Cost jobs & db_update only if changed values
- If `Update Cost` job is ongoing, then block creation of new ones since all BOMs are updated
- `db_update` in `calculate_rm_cost` only if changed values to reduce redundant row updates
- Misc: Use variable for batch size
2022-05-31 16:01:22 +05:30
Rucha Mahabal
cdb884bbf2 fix: conflicts 2022-05-31 13:11:32 +05:30
Rucha Mahabal
2c26ab599a test: HRA Exemption in Proof Submission
(cherry picked from commit ed1ba677d6)
2022-05-31 13:11:32 +05:30
Rucha Mahabal
bb04e4b6de fix: amount precision for Tax Exemption Proof Submission
(cherry picked from commit cfe2f8cac1)
2022-05-31 13:11:32 +05:30
Rucha Mahabal
66deee1582 test: set country to India before running regional tests
(cherry picked from commit 2e98e9e0b9)
2022-05-31 13:11:32 +05:30
Rucha Mahabal
1e728df54c fix: Tax Declaration tests and amount precision
(cherry picked from commit 00adda7c8d)
2022-05-31 13:11:32 +05:30
Rucha Mahabal
c1f6f11e91 test: HRA Exemption in Employee Tax Exemption Declaration
(cherry picked from commit 5e96a46c87)
2022-05-31 13:11:32 +05:30
Rucha Mahabal
b1e119d97d fix: component pay calculation
(cherry picked from commit 2b65c9616f)
2022-05-31 13:11:32 +05:30
Rucha Mahabal
de8f5f87d0 fix: HRA Exemption calculation in case of multiple salary structure assignments
(cherry picked from commit 34925a3a8c)

# Conflicts:
#	erpnext/regional/india/utils.py
2022-05-31 13:11:32 +05:30
maharshivpatel
622d25e126 feat(india): Improve E-way Bill Cancellation. (#31088)
(cherry picked from commit a8f98f3f96)
2022-05-31 06:45:23 +00:00
Deepesh Garg
99917af73f Merge pull request #31156 from frappe/mergify/bp/version-13-hotfix/pr-30850
fix(pos): freeze screen while processing pos invoices (backport #30850)
2022-05-31 10:56:32 +05:30
Deepesh Garg
698c9ed3bc Merge pull request #31186 from frappe/mergify/bp/version-13-hotfix/pr-31127
feat: Auto accrue loan interest for backdated term loans (backport #31127)
2022-05-31 10:28:38 +05:30
Deepesh Garg
3344823b7d Merge pull request #31185 from frappe/mergify/bp/version-13-hotfix/pr-31184
fix(accounts): Ignore Cancelled GL Entries (backport #31184)
2022-05-31 10:28:27 +05:30
Deepesh Garg
89c4d518e1 feat: Auto accrue loan interest for backdated term loans
(cherry picked from commit 96d8b1ef3c)
2022-05-31 04:28:29 +00:00
Mitchy25
d8531f20a0 Ignore Cancelled GL Entries
Profitability Analysis includes 'is_cancelled' GL Entries which means that the profit numbers are incorrect. This change will ensure that the profit figures ignore cancelled GL Entries.

(cherry picked from commit a0c412a0dd)
2022-05-31 04:19:35 +00:00
Rucha Mahabal
2fe54e5435 chore: add Interview doctypes to HR workspace (#31181) 2022-05-30 18:26:20 +05:30
mergify[bot]
0759a8aee3 chore: remove unused bill no & date from purchase receipt (backport #31163) (#31177)
chore: remove unused bill no & date from purchase receipt (#31163)

(cherry picked from commit 08bf0baaae)

Co-authored-by: Saqib Ansari <nextchamp.saqib@gmail.com>
2022-05-30 15:50:04 +05:30
mergify[bot]
50d338df30 feat: provision to exclude exploded items in the BOM (backport #29450) (#31174)
* feat: provision to exclude exploded items in the BOM (#29450)

(cherry picked from commit b75b00fefc)

* fix(ux): "New Version" button BOM

"duplicate" technically creates a new version but that's not intuitive
at all.

* fix: only erase BOM when do_not_explode is set

* fix: allow non-explosive recrusive BOMs

Recursion should be allowed as long as child item is not "exploded"
further by a BOM.

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-05-30 15:43:49 +05:30
Ankush Menat
eb8d30fe06 chore: remove framework tests from erpnext
Similar tests exist in FW and this is failing because someone updated
the translations
2022-05-30 15:42:34 +05:30
mergify[bot]
7767dc1ee3 chore: update translation fr for BOM (backport #31126) (#31165)
* chore: update translation fr for BOM (#31126)

* fix: update translation

* fix: fr translation for BOM

(cherry picked from commit ce8e05146e)

* chore: format

Co-authored-by: HENRY Florian <florian.henry@open-concept.pro>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-05-29 22:10:46 +05:30
marination
bced6a07b4 fix: (auto-merge) Use frappe.log_error instead of doc.log_error
- The latter is only on develop
2022-05-27 22:06:12 +05:30
marination
6d65e2bab4 fix: Safe cast row.rate (in case of faulty exploded items, edge case but oh well) 2022-05-27 22:01:26 +05:30
marination
767a775709 perf: get_next_higher_level_boms
- Separate getting dependants and checking if they are valid (loop within loop led to redundant processing that slowed down function)
- Adding to above, the same dependant(parent) was repeatedly processed as many children shared it. Expensive.
- Use a parent-child map similar to child-parent map to check if all children are resolved
- `map.get()` reduced time: 10 mins -> 0.9s~1 second (as compared to `get_cached_doc` or query)
- Total time: 17 seconds to process 6599 leaf boms and 4.2L parent boms
- Previous Total time: >10 mins (I terminated it due to not wanting to waste time XD)
2022-05-27 21:16:07 +05:30
mergify[bot]
f19747cee0 fix: date filter on quality inspection report (backport #31148) (#31164)
fix: date filter on quality inspection report (#31148)

* fix: date filter

fix from date to to date filter btw those days

* fix: remove unnecessary conditions

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
(cherry picked from commit 7ff8acac51)

Co-authored-by: MOHAMMED NIYAS <76736615+niyazrazak@users.noreply.github.com>
2022-05-27 17:32:24 +05:30
marination
12f0a9a183 chore: Change BOM Progress field types to Long Text 2022-05-27 17:05:29 +05:30
Rucha Mahabal
b98f3647ec Merge pull request #31162 from frappe/mergify/bp/version-13-hotfix/pr-31160
fix: Gratuity status not updated on salary slip submission (backport #31160)
2022-05-27 15:49:08 +05:30
Rucha Mahabal
c02a89db4d fix: conflicts 2022-05-27 15:30:29 +05:30
Rucha Mahabal
6aa6114757 fix: conflicts 2022-05-27 15:11:49 +05:30
marination
a26da58718 feat: Only update exploded items rate and amount
- Generate RM-Rate map from Items table (will include subassembly items with rate)
- Function to reset exploded item rate from above map
- `db_update` exploded item rate only if rate is changed
- Via Update Cost, only update exploded items rate, do not regenerate table again
- Exploded Items are regenerated on Save and Replace BOM job
- `calculate_exploded_cost` is run only via non doc events (Update Cost button, Update BOMs Cost Job)
2022-05-27 15:10:50 +05:30
Rucha Mahabal
30cbe8feb6 test: make holiday list before running gratuity tests
(cherry picked from commit c9e070393d)
2022-05-27 09:36:21 +00:00
Rucha Mahabal
e4426addeb fix: add list view settings for Gratuity
(cherry picked from commit 79b0aede00)

# Conflicts:
#	erpnext/payroll/doctype/gratuity/gratuity.json
2022-05-27 09:36:21 +00:00
Rucha Mahabal
b5d66877d8 refactor: clean-up gratuity tests
(cherry picked from commit 6c66bbbbfe)

# Conflicts:
#	erpnext/payroll/doctype/gratuity/test_gratuity.py
2022-05-27 09:36:20 +00:00
Rucha Mahabal
00a6bc7970 test: Gratuity status for payment via salary slip
(cherry picked from commit b81d7519c1)

# Conflicts:
#	erpnext/payroll/doctype/gratuity/test_gratuity.py
2022-05-27 09:36:20 +00:00
Rucha Mahabal
0a014edd7a fix: Gratuity status not updated on salary slip submission
(cherry picked from commit 385e22a067)
2022-05-27 09:36:19 +00:00
Frappe PR Bot
1bffd06e3a chore(release): Bumped to Version 13.31.1
## [13.31.1](https://github.com/frappe/erpnext/compare/v13.31.0...v13.31.1) (2022-05-27)

### Bug Fixes

* Exchange rate reste to 1 on making mapped doc ([e5b586f](e5b586ffd5))
2022-05-27 06:50:43 +00:00
Deepesh Garg
0371c62eae Merge pull request #31158 from frappe/mergify/bp/version-13/pr-31155
fix: Exchange rate reste to 1 on making mapped doc (backport #31155)
2022-05-27 12:19:09 +05:30
Deepesh Garg
f820d8d35e Merge pull request #31157 from frappe/mergify/bp/version-13-hotfix/pr-31155
fix: Exchange rate reste to 1 on making mapped doc (backport #31155)
2022-05-27 12:18:26 +05:30
Deepesh Garg
e5b586ffd5 fix: Exchange rate reste to 1 on making mapped doc
(cherry picked from commit 2a10f09d8d)
2022-05-27 06:47:55 +00:00
Deepesh Garg
91863c7457 fix: Exchange rate reste to 1 on making mapped doc
(cherry picked from commit 2a10f09d8d)
2022-05-27 06:47:35 +00:00
mergify[bot]
f40100d483 fix(india): duplicate qrcode and hide button (#31154) 2022-05-27 12:16:47 +05:30
HarryPaulo
a7bf236c28 fix(pos): freeze screen while processing pos invoices (#30850)
(cherry picked from commit 4b04694c2c)
2022-05-27 06:46:26 +00:00
mergify[bot]
d891394dc8 fix: Improve button labels in Warehouse (backport #31101) (#31150)
* style: format warehouse js

(cherry picked from commit c704ad889d)

* fix: improve labels, simplify logic

(cherry picked from commit a6ddd86d31)

* fix: german translations

(cherry picked from commit 9356eb11de)

* fix: remove unsupported arguments

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
(cherry picked from commit e77c379cbb)

* refactor: set queries during setup

(cherry picked from commit 1b16eb7667)

* style: format

(cherry picked from commit 1e9f9c452f)

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
2022-05-27 12:11:12 +05:30
mergify[bot]
a380bae298 fix: skip existing batch number during autogen (backport #31140) (#31144)
* fix: skip existing batch number during autogen (#31140)

* test: correctly check for existing item

* test: batch no for test PR generation

Co-authored-by: Ankush Menat <me@ankush.dev>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-05-26 20:55:29 +05:30
mergify[bot]
fd2f3b9061 feat: live preview of naming series on naming series tool (backport #31141) (#31146)
* chore: resave naming series doctype schema

separate commit to avoid mixing actual changes

(cherry picked from commit 82cd54b40b)

* feat: preview next numbers on naming series tool

(cherry picked from commit 24d1bf5328)

* docs: update help information on naming series

(cherry picked from commit 4d0e2aa33a)

* test: add basic tests for naming series tool

(cherry picked from commit 964b4184a6)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-05-26 17:10:49 +05:30
Rucha Mahabal
2ce90afa25 Merge pull request #31142 from frappe/mergify/bp/version-13-hotfix/pr-31130 2022-05-26 13:42:48 +05:30
Rucha Mahabal
096ae210e1 fix: validation message
(cherry picked from commit 2bc6d46070)
2022-05-26 07:54:35 +00:00
Rucha Mahabal
ec63912253 test: Job Opening against a Staffing Plan
(cherry picked from commit ab0ef60918)
2022-05-26 07:54:35 +00:00
Rucha Mahabal
b4a3a533c8 fix: Job Opening linked to Staffing Plan cannot be created/updated if there are existing employees
(cherry picked from commit 29228575fa)
2022-05-26 07:54:34 +00:00
barredterra
a3f2cf3917 feat: Add german translations
(cherry picked from commit 2388d86623)

# Conflicts:
#	erpnext/translations/de.csv
2022-05-26 06:20:15 +00:00
Frappe PR Bot
91e935fee7 chore(release): Bumped to Version 13.31.0
# [13.31.0](https://github.com/frappe/erpnext/compare/v13.30.0...v13.31.0) (2022-05-26)

### Bug Fixes

* Account currency validation for first transaction ([228f10b](228f10bf30))
* Add party account validation for journal entry ([7f853b1](7f853b1f0f))
* always update item_name for stock entry (backport [#31068](https://github.com/frappe/erpnext/issues/31068)) ([#31071](https://github.com/frappe/erpnext/issues/31071)) ([f519dc6](f519dc613c))
* change project's actual_start_date fieldtype from Data to Date (backport [#31085](https://github.com/frappe/erpnext/issues/31085)) ([#31135](https://github.com/frappe/erpnext/issues/31135)) ([8c2f203](8c2f203361))
* Chart data for monthly periodicity in Cash Flow report ([#31039](https://github.com/frappe/erpnext/issues/31039)) ([f14e9b7](f14e9b7502))
* corrective job card creation (backport [#31083](https://github.com/frappe/erpnext/issues/31083)) ([#31084](https://github.com/frappe/erpnext/issues/31084)) ([c17c260](c17c260a65))
* don't capture payments with invoice_id as donations ([168a9d4](168a9d417b))
* employee advance status update on return via additional salary ([d59c3d2](d59c3d2142))
* Handle missing HSN Codes ([ce3a21e](ce3a21eb03))
* Healthcare module accounting test cases ([09a42a1](09a42a122f))
* **India:** Async issue in company address trigger ([2ea3318](2ea331852a))
* **india:** error while parsing e-invoice ([#31061](https://github.com/frappe/erpnext/issues/31061)) ([1461d66](1461d66dda))
* **india:** eway bill cancel api is disabled ([#31060](https://github.com/frappe/erpnext/issues/31060)) ([95491e1](95491e1718))
* Job Card excess transfer behaviour (backport [#31054](https://github.com/frappe/erpnext/issues/31054)) ([#31096](https://github.com/frappe/erpnext/issues/31096)) ([3984f04](3984f04a49))
* Leave Encashment calculations (backport [#31062](https://github.com/frappe/erpnext/issues/31062)) ([#31091](https://github.com/frappe/erpnext/issues/31091)) ([ba76b64](ba76b6419e))
* Loan Doc query in Bank Reconciliation Statement ([611d1af](611d1af526))
* Loan repayment entries for payroll payable account ([ea6d754](ea6d754f73))
* multiple entries for same payment term ([90b1147](90b1147365))
* Party account validation in JV ([d10c2e5](d10c2e50be))
* payments duplicate on pos closing entry (backport [#30976](https://github.com/frappe/erpnext/issues/30976)) ([#31005](https://github.com/frappe/erpnext/issues/31005)) ([0efbabe](0efbabe7cf))
* **pos:** paid amount calculation for multicurrency invoice ([#31122](https://github.com/frappe/erpnext/issues/31122)) ([98eb7da](98eb7da06a))
* remove bad default for Membership From Date ([34928d2](34928d29f1))
* Remove validation from Journal Entry ([4ca6cdc](4ca6cdca76))
* replace document states with list settings ([78e9e66](78e9e66d63))
* timesheet fetching in sales invoice ([216c32f](216c32f4bc))
* Use directly <a> and style it as button instead of using button ([0ab9fc0](0ab9fc0040))

### Features

* **Employee Advance:** add 'Returned' and 'Partly Claimed and Returned' status ([42e7a86](42e7a86a3b))

### Reverts

* Revert "fix: Add party account validation for journal entry" ([9d43a90](9d43a90eb0))
2022-05-26 05:38:49 +00:00
Deepesh Garg
63288fcd6c Merge pull request #31137 from frappe/version-13-hotfix
chore: Weekly release for version-13
2022-05-26 11:07:11 +05:30
mergify[bot]
8c2f203361 fix: change project's actual_start_date fieldtype from Data to Date (backport #31085) (#31135)
Co-authored-by: sersaber <93864988+sersaber@users.noreply.github.com>
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2022-05-26 10:32:10 +05:30
Deepesh Garg
0b0d57f7c2 Merge pull request #31128 from frappe/mergify/bp/version-13-hotfix/pr-26916
fix: Account currency validation for first transaction (backport #26916)
2022-05-26 09:41:19 +05:30
Deepesh Garg
5748af7d53 Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-26916 2022-05-26 09:23:46 +05:30
Deepesh Garg
7df829f9cc chore: Update test case 2022-05-26 09:03:18 +05:30
Deepesh Garg
3d51d125bf chore: Update test case 2022-05-25 23:52:40 +05:30
Deepesh Garg
68d1787eeb Merge pull request #31124 from nextchamp-saqib/fix-timesheet-fetch
fix: timesheet fetching in sales invoice
2022-05-25 20:15:19 +05:30
Deepesh Garg
a61d7558eb Merge pull request #31132 from frappe/mergify/bp/version-13-hotfix/pr-31039
fix: Chart data for monthly periodicity in Cash Flow report (backport #31039)
2022-05-25 20:10:08 +05:30
Deepesh Garg
14422eaf59 chore: Update test cases 2022-05-25 20:06:31 +05:30
Deepesh Garg
4aed7eda91 Merge pull request #31131 from frappe/mergify/bp/version-13-hotfix/pr-31129
fix: Loan Doc query in Bank Reconciliation Statement (backport #31129)
2022-05-25 19:41:40 +05:30
xdlumertz
f14e9b7502 fix: Chart data for monthly periodicity in Cash Flow report (#31039)
fix: Chart data for monthly periodicity in Cash Flow report
(cherry picked from commit c5e922c76b)
2022-05-25 14:10:33 +00:00
Deepesh Garg
cd00cb2fb7 chore: Linting Issues
(cherry picked from commit 9e4a36089e)
2022-05-25 13:52:10 +00:00
Deepesh Garg
74ddf261e9 chore: Linting Issues
(cherry picked from commit a1f53f8d31)
2022-05-25 13:52:09 +00:00
Deepesh Garg
611d1af526 fix: Loan Doc query in Bank Reconciliation Statement
(cherry picked from commit 147fc8fde7)
2022-05-25 13:52:08 +00:00
Deepesh Garg
3fab8a2213 chore: Remove unintended changes 2022-05-25 19:20:09 +05:30
Deepesh Garg
f724f6d1bb chore: Resolve conflicts 2022-05-25 19:04:20 +05:30
Deepesh Garg
a5bd76bbb1 Merge pull request #31076 from frappe/mergify/bp/version-13-hotfix/pr-31004
fix: duplicate entries in payment terms report output (backport #31004)
2022-05-25 17:09:15 +05:30
Deepesh Garg
761669c7ca chore: Update test case
(cherry picked from commit bc34737709)

# Conflicts:
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
2022-05-25 11:33:46 +00:00
Deepesh Garg
0628785c64 test: Update test cases
(cherry picked from commit 65232edfd5)

# Conflicts:
#	erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py
#	erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
2022-05-25 11:33:45 +00:00
Deepesh Garg
4ca6cdca76 fix: Remove validation from Journal Entry
(cherry picked from commit 5b8726405d)

# Conflicts:
#	erpnext/accounts/doctype/journal_entry/journal_entry.py
2022-05-25 11:33:44 +00:00
Deepesh Garg
d10c2e50be fix: Party account validation in JV
(cherry picked from commit 417d6abcf4)

# Conflicts:
#	erpnext/accounts/doctype/journal_entry/journal_entry.py
2022-05-25 11:33:43 +00:00
Deepesh Garg
4727482737 test: Set default currency for patient
(cherry picked from commit 30876a105c)

# Conflicts:
#	erpnext/healthcare/doctype/patient_appointment/test_patient_appointment.py
2022-05-25 11:33:43 +00:00
Deepesh Garg
e28f6b7d31 test: fix property name
(cherry picked from commit c10a22529c)

# Conflicts:
#	erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
2022-05-25 11:33:42 +00:00
Deepesh Garg
8f969fbd66 test: Update test cases for currency change validation
(cherry picked from commit 60915e874d)

# Conflicts:
#	erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py
#	erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
#	erpnext/healthcare/doctype/therapy_plan/therapy_plan.py
#	erpnext/non_profit/doctype/membership/membership.py
2022-05-25 11:33:42 +00:00
Deepesh Garg
9d43a90eb0 Revert "fix: Add party account validation for journal entry"
This reverts commit f00620a3ca.

(cherry picked from commit 0a618817dc)
2022-05-25 11:33:39 +00:00
Deepesh Garg
09a42a122f fix: Healthcare module accounting test cases
(cherry picked from commit bcaf475295)

# Conflicts:
#	erpnext/healthcare/doctype/lab_test/test_lab_test.py
2022-05-25 11:33:39 +00:00
Deepesh Garg
7f853b1f0f fix: Add party account validation for journal entry
(cherry picked from commit f00620a3ca)
2022-05-25 11:33:38 +00:00
Deepesh Garg
228f10bf30 fix: Account currency validation for first transaction
(cherry picked from commit 80c85dd17c)

# Conflicts:
#	erpnext/controllers/accounts_controller.py
2022-05-25 11:33:38 +00:00
marination
196a824c4f style: Update docstrings and fix/add type hints + Collapsible progress section in Log 2022-05-25 16:48:07 +05:30
marination
74d7d81d6e feat: Level-wise BOM cost updation
- Process BOMs level wise and Pause after level is complete
- Cron job will resume Paused jobs, which will again process the new level and pause at the end
- This will go on until all BOMs are updated
- Added Progress section with fields to track updated BOMs in Log
- Cleanup: Add BOM Updation utils file to contain helper functions/sub-functions
- Cleanup: BOM Update Log file will only contain functions that are in direct context of the Log

Co-authored-by: Gavin D'souza <gavin18d@gmail.com>
2022-05-25 16:47:54 +05:30
Deepesh Garg
3528d6fbdb Merge pull request #31121 from frappe/mergify/bp/version-13-hotfix/pr-31077
fix: Loan repayment entries for payroll payable account (backport #31077)
2022-05-25 12:37:17 +05:30
Deepesh Garg
2ae085d258 Merge pull request #31123 from deepeshgarg007/hsn_wise_tax_rate_none_type
fix: Handle missing HSN Codes
2022-05-25 12:34:26 +05:30
Deepesh Garg
187768892d Merge pull request #31120 from frappe/mergify/bp/version-13-hotfix/pr-31080
fix(India): Async issue in company address trigger (backport #31080)
2022-05-25 12:33:37 +05:30
mergify[bot]
98eb7da06a fix(pos): paid amount calculation for multicurrency invoice (#31122) 2022-05-25 12:24:09 +05:30
Saqib Ansari
216c32f4bc fix: timesheet fetching in sales invoice 2022-05-25 12:12:35 +05:30
Deepesh Garg
ce3a21eb03 fix: Handle missing HSN Codes 2022-05-25 11:51:07 +05:30
Deepesh Garg
ea6d754f73 fix: Loan repayment entries for payroll payable account
(cherry picked from commit 3128f9603e)
2022-05-25 05:54:08 +00:00
Deepesh Garg
559fc509e7 chore: Linting issues
(cherry picked from commit 8fd0b3b9f5)
2022-05-25 05:53:45 +00:00
Deepesh Garg
2ea331852a fix(India): Async issue in company address trigger
(cherry picked from commit c41f9f046f)
2022-05-25 05:53:45 +00:00
Rucha Mahabal
22aeacb088 Merge pull request #31104 from ruchamahabal/emp-adv-status-v13
feat(Employee Advance): add 'Returned' and 'Partly Claimed and Returned'
2022-05-25 11:09:52 +05:30
Rucha Mahabal
7ac0624f68 Merge branch 'version-13-hotfix' into emp-adv-status-v13 2022-05-25 10:46:25 +05:30
Rucha Mahabal
a071095886 Merge pull request #31110 from ruchamahabal/fix-npo-membership 2022-05-24 18:38:43 +05:30
Rucha Mahabal
168a9d417b fix: don't capture payments with invoice_id as donations
- if donations and subscriptions are set up in the same dashboard, membership payments also trigger payment webhook

- in order to differentiate there is already a check for RP's auto generated description but if subscriptions are configured using subscription links, RP doesn't send descriptions

- use invoice_id to ignore such payments instead
2022-05-24 18:16:56 +05:30
Rucha Mahabal
34928d29f1 fix: remove bad default for Membership From Date 2022-05-24 18:14:06 +05:30
Ankush Menat
e9968cc6fc chore: disable feed for material request 2022-05-24 14:33:57 +05:30
Rucha Mahabal
ab9744fe97 Merge branch 'version-13-hotfix' into emp-adv-status-v13 2022-05-24 11:49:24 +05:30
Rucha Mahabal
78e9e66d63 fix: replace document states with list settings 2022-05-24 11:29:58 +05:30
Rucha Mahabal
b265ca467c test: test advance filters in expense claim and cancelled status 2022-05-24 11:19:14 +05:30
Rucha Mahabal
806752111e test: employee advance status 2022-05-24 11:13:18 +05:30
Rucha Mahabal
d59c3d2142 fix: employee advance status update on return via additional salary 2022-05-24 11:11:44 +05:30
Rucha Mahabal
cac9e245b6 patch: Employee Advance return statuses 2022-05-24 11:11:10 +05:30
Rucha Mahabal
42e7a86a3b feat(Employee Advance): add 'Returned' and 'Partly Claimed and Returned' status 2022-05-24 11:09:42 +05:30
mergify[bot]
c2a08f1285 chore: error logging for auto material requests (backport #31103) (#31105)
chore: error logging for auto material requests (#31103)

(cherry picked from commit ecb39d81e0)

Co-authored-by: Ankush Menat <me@ankush.dev>
2022-05-24 10:41:50 +05:30
mergify[bot]
3984f04a49 fix: Job Card excess transfer behaviour (backport #31054) (#31096)
* fix: Job Card excess transfer behaviour

- Block excess transfer of items if not allowed in settings
- Behaviour made consistent with js behaviour (button disappears if not pending and not allowed in settings)
- Test for same case

(cherry picked from commit e07ce6efe0)

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

* chore: Run `_validate_over_transfer` only if excess transfer is blocked in settings

(cherry picked from commit 9f6e10663b)

* chore: conflicts

* chore: missing conflict resolution changes

Co-authored-by: marination <maricadsouza221197@gmail.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-05-23 15:20:47 +05:30
mergify[bot]
f6b2f36ca8 test: search test failing because of stale data (backport #31098) (#31099)
test: search test failing because of stale data (#31098)

(cherry picked from commit a36174afdf)

Co-authored-by: Ankush Menat <me@ankush.dev>
2022-05-23 15:13:13 +05:30
Suraj Shetty
1c3ad13f6c Merge pull request #31094 from frappe/mergify/bp/version-13-hotfix/pr-31092 2022-05-23 12:20:53 +05:30
mergify[bot]
ddee0893e6 fix translation German "Designation" (backport #31082) (#31093)
fix translation German "Designation" (#31082)

changed "Bezeichnung" to "Position" as the is more precice in the field of employment which erpnext refers to here

(cherry picked from commit 348a674df9)

Co-authored-by: Wolfram Schmidt <wolfram.schmidt@phamos.eu>
2022-05-23 12:02:30 +05:30
Suraj Shetty
0ab9fc0040 fix: Use directly <a> and style it as button instead of using button
Since few email servers (like outlook) strips out link in the button making them unclickable.

(cherry picked from commit a29b92febc)
2022-05-23 06:27:37 +00:00
mergify[bot]
ba76b6419e fix: Leave Encashment calculations (backport #31062) (#31091)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2022-05-23 10:32:41 +05:30
mergify[bot]
c17c260a65 fix: corrective job card creation (backport #31083) (#31084)
* test: simplify job card tests

(cherry picked from commit e625394488)

* fix: creation of corrective job card fails

This used to fail because sub_operations is a child table that's not
initalized by default till v13, in develop branch we init tables with
empty list.

(cherry picked from commit 66cf9aa344)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-05-21 14:28:27 +05:30
marination
b827c3b3c9 fix: test_work_order_with_non_stock_item
- Use the right price list and currency to avoid rate conversion (1000/62.9), since rates are reset correctly now
- Use RM rate based on Price List in BOM. Non stock item has no valuation
2022-05-20 12:34:15 +05:30
marination
9a513fda74 fix: Get fresh RM rate in calculate_rm_cost 2022-05-20 12:23:52 +05:30
marination
faa69c942b perf: Use cached doc instead of get_doc
- Doc is only used to iterate over items(which wont change) and change rate/amount of rows
- These changes are inserted in db via `db_update`, so no harm
- Tested locally: refetching cached doc after db update, reflects fresh data.
2022-05-20 12:23:42 +05:30
marination
d035aa2afb fix: Call calculate_cost for Draft BOM and typo in argument 2022-05-20 12:23:32 +05:30
marination
cbc52a2e45 fix: DB update child items, remove redundancy, fix perf
- Move `get_boms_in_bottom_up_order` in bom update tool’s file
- Remove repeated rm cost update from `update_cost`. `calculate_cost` handles RM cost update
- db_update children in `calculate_cost` optionally
- Don’t call `update_exploded_items` and regenerate exploded items in `update_cost`. They will stay the same (except cost)
2022-05-20 12:23:18 +05:30
marination
87c2b3be0b perf: get_boms_in_bottom_up_order
- Create child-parent map once and fetch value from child key to get parents
- Get parents recursively for a leaf node (get all ancestors)
- Approx. 44 secs for 4lakh 70k boms
2022-05-20 12:20:24 +05:30
ruthra kumar
90b1147365 fix: multiple entries for same payment term
(cherry picked from commit e826093150)
2022-05-20 02:24:23 +00:00
mergify[bot]
f519dc613c fix: always update item_name for stock entry (backport #31068) (#31071)
fix: always update item_name for stock entry (#31068)

If item_name is already set and for some reason becomes outdated then
it's not updated in backend.

Fix: always set item_name and stock_uom when fetching item details
(cherry picked from commit 6d6616dbcd)

Co-authored-by: Ankush Menat <me@ankush.dev>
2022-05-19 16:02:20 +05:30
mergify[bot]
0efbabe7cf fix: payments duplicate on pos closing entry (backport #30976) (#31005) 2022-05-19 14:27:19 +05:30
mergify[bot]
1461d66dda fix(india): error while parsing e-invoice (#31061) 2022-05-18 12:44:24 +05:30
mergify[bot]
95491e1718 fix(india): eway bill cancel api is disabled (#31060) 2022-05-18 12:44:07 +05:30
Frappe PR Bot
d9f76478da chore(release): Bumped to Version 13.30.0
# [13.30.0](https://github.com/frappe/erpnext/compare/v13.29.2...v13.30.0) (2022-05-17)

### Bug Fixes

* `set_missing_values` in SE and re-use the same on all SE mappings ([fe52c1f](fe52c1f354))
* Add validation for SEZ and Export invoices without payment of taxes ([cb8453d](cb8453dac8))
* allow to use formatting for the field to_discuss in opportunity ([e126d4e](e126d4e592))
* Block 0 Qty via Update Items to be consistent with form validation ([5647875](56478752e4))
* Calculate totals even though pricing rule is not applied on mapped doc ([678a01d](678a01d4bd))
* **charts:** Pass fieldtype for chart data in selling reports ([917e7c3](917e7c34af))
* conflicts ([87fd933](87fd93370a))
* conflicts ([fb62bbf](fb62bbf61a))
* disable pricing rules for internal transfers (backport [#31034](https://github.com/frappe/erpnext/issues/31034)) ([#31036](https://github.com/frappe/erpnext/issues/31036)) ([d5eb9fb](d5eb9fb3fd))
* discount ledger entry in case of multicurrency invoice ([#31047](https://github.com/frappe/erpnext/issues/31047)) ([c3417e4](c3417e4103))
* dont fail repost for recoverable errors (backport [#30979](https://github.com/frappe/erpnext/issues/30979)) ([#31023](https://github.com/frappe/erpnext/issues/31023)) ([a019cb6](a019cb6caa))
* **Employee Advance:** Return/Deduction from Salary button visibility (backport [#31011](https://github.com/frappe/erpnext/issues/31011)) ([#31012](https://github.com/frappe/erpnext/issues/31012)) ([5b1d85e](5b1d85e8bf))
* Failing accounting dimension patch ([b14a7b8](b14a7b8a5d))
* german translations for Employee ([b9bda04](b9bda04a83))
* gl entry validation for miniscule loan penalty ([e958ef2](e958ef26e0))
* hide template items from sales/purchase order ([8b99f43](8b99f43c61))
* IN time not captured in Attendance through Employee Checkin (backport [#31029](https://github.com/frappe/erpnext/issues/31029)) ([#31031](https://github.com/frappe/erpnext/issues/31031)) ([477bbcc](477bbcc9e5))
* Item rate reset on changing posting date ([#30990](https://github.com/frappe/erpnext/issues/30990)) ([8ef649f](8ef649f65d))
* Just add one rate in GST HSN Code ([ed76687](ed76687dac))
* Merge Conflicts ([3abf264](3abf26428c))
* Multiple fixes in GSTR-1 report ([f2cbb70](f2cbb70325))
* **patch:** avoid checking for return field if it doesnt exits (backport [#30995](https://github.com/frappe/erpnext/issues/30995)) ([#30997](https://github.com/frappe/erpnext/issues/30997)) ([a94b5c0](a94b5c0d8b))
* per_billed for return DN (backport [#30868](https://github.com/frappe/erpnext/issues/30868)) ([#30971](https://github.com/frappe/erpnext/issues/30971)) ([97ea1f5](97ea1f5123))
* precision loss when transferring  (backport [#30834](https://github.com/frappe/erpnext/issues/30834)) ([#31032](https://github.com/frappe/erpnext/issues/31032)) ([fc80a50](fc80a50640))
* precision of total penalty paid ([ad21853](ad21853b01))
* precision of total penalty paid ([5c45737](5c45737a8f))
* prevent bypassing forced valuation rate (backport [#30987](https://github.com/frappe/erpnext/issues/30987)) ([#31020](https://github.com/frappe/erpnext/issues/31020)) ([706c19d](706c19db70))
* pro rata calculation for monthly depreciation ([#30989](https://github.com/frappe/erpnext/issues/30989)) ([408d952](408d952332))
* remove item attribute limit from variant selector (backport [#31026](https://github.com/frappe/erpnext/issues/31026)) ([#31028](https://github.com/frappe/erpnext/issues/31028)) ([1f016e9](1f016e9137))
* Set actual qty and basic rate in SE on warehouse triggers (`get_warehouse_details`) ([30b0aee](30b0aee013))
* stock analytics report shows incorrect data there's no stock movement in a period (backport [#30945](https://github.com/frappe/erpnext/issues/30945)) ([#30980](https://github.com/frappe/erpnext/issues/30980)) ([295ffb3](295ffb3f1a))
* translation for status filter ([e5f8231](e5f8231632))
* **translations:** Update ru translations ([#30992](https://github.com/frappe/erpnext/issues/30992)) ([f797005](f797005384))
* TypeError in add_indicator_for_multicompany (backport [#31042](https://github.com/frappe/erpnext/issues/31042)) ([#31048](https://github.com/frappe/erpnext/issues/31048)) ([e24bb1d](e24bb1dbf1))
* unlink Attendance from Employee Checkins on cancellation (backport [#31045](https://github.com/frappe/erpnext/issues/31045)) ([#31049](https://github.com/frappe/erpnext/issues/31049)) ([e03fe97](e03fe97a6e))
* UOM in HSN-wise summary of outward supply ([cd7d5cd](cd7d5cdb22))
* user can select disabled accounts in taxes table ([047c879](047c879bec))
* validate disabled accounts before posting ledger entries ([515e49b](515e49bb90))
* validate on hold purchase invoices in payment entry ([9fbd170](9fbd170fa4))

### Features

* add Employee Status filter in leave balance reports ([716b525](716b5253a4))
* add Link to Opportunity ([#30614](https://github.com/frappe/erpnext/issues/30614)) ([bc23bc7](bc23bc738e))
* request_for_quotation ([db4e264](db4e264d92))
* request_for_quotation - refactor ([b6a3e69](b6a3e693ae))
* select multiple values for accounting dimension (backport [#31015](https://github.com/frappe/erpnext/issues/31015)) ([#31041](https://github.com/frappe/erpnext/issues/31041)) ([9c21eb5](9c21eb5b94))
2022-05-17 07:41:35 +00:00
Ankush Menat
3f8816f2ce Merge pull request #31050 from ankush/v13_release
chore: release
2022-05-17 13:09:46 +05:30
mergify[bot]
e03fe97a6e fix: unlink Attendance from Employee Checkins on cancellation (backport #31045) (#31049)
* fix: unlink Attendance from Employee Checkins on cancellation (#31045)

(cherry picked from commit 28fe4f3d54)

* fix: import missing function

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2022-05-17 12:35:27 +05:30
mergify[bot]
c3417e4103 fix: discount ledger entry in case of multicurrency invoice (#31047) 2022-05-17 12:22:08 +05:30
mergify[bot]
9c21eb5b94 feat: select multiple values for accounting dimension (backport #31015) (#31041)
fix: select multiple values for accounting dimenssion

(cherry picked from commit 69be22ba7c)

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
2022-05-17 11:56:31 +05:30
mergify[bot]
e24bb1dbf1 fix: TypeError in add_indicator_for_multicompany (backport #31042) (#31048)
fix: TypeError in add_indicator_for_multicompany (#31042)

Minor fix in add_indicator_for_multicompany

In case of multi-company transactions add (+) buttons in connection dashboard pf customer aren't being loaded due to TypeError (TypeError: e.dashboard.stats_area.removeClass is not a function) created by "frm.dashboard.stats_area.removeClass('hidden');" during the stats section creation.

(cherry picked from commit 867f2c6282)

Co-authored-by: Deepak <36790711+dpk404@users.noreply.github.com>
2022-05-17 11:54:50 +05:30
Ganga Manoj
408d952332 fix: pro rata calculation for monthly depreciation (#30989) 2022-05-17 11:21:10 +05:30
mergify[bot]
d5eb9fb3fd fix: disable pricing rules for internal transfers (backport #31034) (#31036)
fix: disable pricing rules for internal transfers (#31034)

* fix: disable pricing rules for internal transfers

* fix: only apply validation on internal transfers

* fix: internal_party_field undefined

(cherry picked from commit 3714e36b44)

Co-authored-by: Ankush Menat <me@ankush.dev>
Co-authored-by: Marica <maricadsouza221197@gmail.com>
2022-05-16 18:34:39 +05:30
Marica
d7bea97095 Merge pull request #31030 from frappe/mergify/bp/version-13-hotfix/pr-30992
fix(translations): Update ru translations (backport #30992)
2022-05-16 17:35:17 +05:30
Marica
3abf26428c fix: Merge Conflicts 2022-05-16 17:13:00 +05:30
mergify[bot]
477bbcc9e5 fix: IN time not captured in Attendance through Employee Checkin (backport #31029) (#31031)
* fix: IN time not captured in Attendance through Employee Checkin (#31029)

(cherry picked from commit 1b7ce9649b)

# Conflicts:
#	erpnext/hr/doctype/employee_checkin/test_employee_checkin.py

* fix: conflicts

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2022-05-16 17:05:26 +05:30
mergify[bot]
fc80a50640 fix: precision loss when transferring (backport #30834) (#31032)
* fix: stock transfer value when precision differs

(cherry picked from commit b1c90e9949)

# Conflicts:
#	erpnext/stock/doctype/stock_ledger_entry/test_stock_ledger_entry.py

* fix: Merge conflicts

* chore: Remove unused `flt` (sider)

Co-authored-by: Ankush Menat <ankush@frappe.io>
Co-authored-by: Marica <maricadsouza221197@gmail.com>
2022-05-16 17:02:47 +05:30
Vladislav
f797005384 fix(translations): Update ru translations (#30992)
* fix incorrect translation

* Update ru.csv

* Update ru.csv

* Update erpnext/translations/ru.csv

Co-authored-by: Marica <maricadsouza221197@gmail.com>

Co-authored-by: Marica <maricadsouza221197@gmail.com>
(cherry picked from commit af1eab5d54)

# Conflicts:
#	erpnext/translations/ru.csv
2022-05-16 09:49:23 +00:00
mergify[bot]
1f016e9137 fix: remove item attribute limit from variant selector (backport #31026) (#31028)
fix: remove item attribute limit from variant selector

(cherry picked from commit 6bd1cb9235)

Co-authored-by: Ankush Menat <me@ankush.dev>
2022-05-16 14:13:38 +05:30
Marica
a0930a5619 Merge pull request #31027 from frappe/mergify/bp/version-13-hotfix/pr-31025
fix: hide template items from sales/purchase order (backport #31025)
2022-05-16 14:11:24 +05:30
Ankush Menat
8b99f43c61 fix: hide template items from sales/purchase order
(cherry picked from commit 0e875f5049)
2022-05-16 08:31:07 +00:00
mergify[bot]
a019cb6caa fix: dont fail repost for recoverable errors (backport #30979) (#31023)
recoverable erros:
1. timeout
2. lock/deadlocks

(cherry picked from commit 80d959c579)

Co-authored-by: Ankush Menat <me@ankush.dev>
2022-05-16 12:08:32 +05:30
mergify[bot]
6adeaa1de6 test: check translation files (backport #31006) (#31007)
This is an automatic backport of pull request #31006 done by [Mergify](https://mergify.com).


---


<details>
<summary>Mergify commands and options</summary>

<br />

More conditions and actions can be found in the [documentation](https://docs.mergify.com/).

You can also trigger Mergify actions by commenting on this pull request:

- `@Mergifyio refresh` will re-evaluate the rules
- `@Mergifyio rebase` will rebase this PR on its base branch
- `@Mergifyio update` will merge the base branch into this PR
- `@Mergifyio backport <destination>` will backport this PR on `<destination>` branch

Additionally, on Mergify [dashboard](https://dashboard.mergify.com/) you can:

- look at your merge queues
- generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com
</details>
2022-05-16 06:13:32 +00:00
Deepesh Garg
e2028a0d6d Merge pull request #31021 from frappe/mergify/bp/version-13-hotfix/pr-31010
fix: GL entry validation for minuscule loan penalty (backport #31010)
2022-05-15 23:38:07 +05:30
mergify[bot]
706c19db70 fix: prevent bypassing forced valuation rate (backport #30987) (#31020)
fix: prevent bypassing forced valuation rate

if you edit "margin_rate_or_amount" after saving DN then based on
selected margin the rate gets updated which isn't valuation rate.

(cherry picked from commit ee0a277540)

Co-authored-by: Ankush Menat <me@ankush.dev>
2022-05-15 21:15:24 +05:30
Abhinav Raut
ad21853b01 fix: precision of total penalty paid
(cherry picked from commit 589dd17e58)
2022-05-15 15:21:09 +00:00
Abhinav Raut
5c45737a8f fix: precision of total penalty paid
(cherry picked from commit 9a86885c0a)
2022-05-15 15:21:09 +00:00
Abhinav Raut
e958ef26e0 fix: gl entry validation for miniscule loan penalty
(cherry picked from commit aef65e7417)
2022-05-15 15:21:08 +00:00
Deepesh Garg
c7f4a1595a Merge pull request #30978 from deepeshgarg007/gstr_export_sez_tax_rates
fix: Multiple fixes in GST reporting
2022-05-15 20:33:32 +05:30
Deepesh Garg
5b02b5b3cd chore: Remove unintended changes 2022-05-15 16:42:34 +05:30
Deepesh Garg
ed76687dac fix: Just add one rate in GST HSN Code 2022-05-15 16:40:33 +05:30
Deepesh Garg
c54c01e0de Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into gstr_export_sez_tax_rates 2022-05-14 21:33:16 +05:30
Rucha Mahabal
c4650160ce Merge pull request #31014 from frappe/mergify/bp/version-13-hotfix/pr-31013 2022-05-13 22:33:48 +05:30
Rucha Mahabal
64b58ac031 test: employee status filter in leave balance reports
(cherry picked from commit 260cfa5d1e)
2022-05-13 16:37:57 +00:00
Rucha Mahabal
e5f8231632 fix: translation for status filter
(cherry picked from commit 08fb9a4318)
2022-05-13 16:37:56 +00:00
Rucha Mahabal
716b5253a4 feat: add Employee Status filter in leave balance reports
(cherry picked from commit ed8a49737a)
2022-05-13 16:37:56 +00:00
mergify[bot]
5b1d85e8bf fix(Employee Advance): Return/Deduction from Salary button visibility (backport #31011) (#31012)
fix(Employee Advance): Return/Deduction from Salary button visibility (#31011)

(cherry picked from commit 3016ed958e)

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2022-05-13 20:06:26 +05:30
Deepesh Garg
cb8453dac8 fix: Add validation for SEZ and Export invoices without payment of taxes 2022-05-13 18:12:18 +05:30
Deepesh Garg
8af30bcc16 chore: Linting Issues 2022-05-13 18:12:18 +05:30
Deepesh Garg
cd7d5cdb22 fix: UOM in HSN-wise summary of outward supply 2022-05-13 18:12:18 +05:30
Frappe PR Bot
7369db59aa chore(release): Bumped to Version 13.29.0
# [13.29.0](https://github.com/frappe/erpnext/compare/v13.28.0...v13.29.0) (2022-05-10)

### Bug Fixes

* Consider paryt and party type as well in group by consolidated view ([189fc89](189fc89e2d))
* disable form save on naming series tool ([#30909](https://github.com/frappe/erpnext/issues/30909)) ([#30910](https://github.com/frappe/erpnext/issues/30910)) ([d60a6cb](d60a6cb2f8))
* double future qty updates ([0db3013](0db3013c9b))
* HSN-wise-summary of outward supplies Updated Report ([3637525](363752510e))
* Ignore loan repayments made from salary slip ([b7e1d40](b7e1d40e43))
* **india:** invoice type for a debit note e-invoice ([#30948](https://github.com/frappe/erpnext/issues/30948)) ([c46add3](c46add3760))
* **india:** keyerror while generating e-way bill from an e-invoice ([#30879](https://github.com/frappe/erpnext/issues/30879)) ([98d799e](98d799e7cc))
* **india:** re-arrange e-way bill dialog fields ([#30941](https://github.com/frappe/erpnext/issues/30941)) ([7ce5c93](7ce5c93f44))
* Item Alternative Test ([964de1f](964de1fc69))
* patch for renaming membership settings ([#30929](https://github.com/frappe/erpnext/issues/30929)) ([9189653](9189653f2e))
* **pos:** creating pos returns resets pricing rules & discounts ([#30936](https://github.com/frappe/erpnext/issues/30936)) ([a0e39db](a0e39db200))
* remove check for already allocated earned leaves ([#30931](https://github.com/frappe/erpnext/issues/30931)) ([#30932](https://github.com/frappe/erpnext/issues/30932)) ([80f7d66](80f7d66255))
* Remove commit from stock entry test. The assertion is not important ([c449b35](c449b35cc1))
* Set available-for-use date if missing ([#30838](https://github.com/frappe/erpnext/issues/30838)) ([bf2eaec](bf2eaecb1d))
* show group warehouse in Sales Order ([#30891](https://github.com/frappe/erpnext/issues/30891)) ([#30893](https://github.com/frappe/erpnext/issues/30893)) ([c458e14](c458e14e68))
* Show linked time sheets in sales invoice dashboard ([4f4af52](4f4af523e0))
* sort before picking next stock reco ([e27fb58](e27fb58130))
* subtract change_amount from paid_amount field on POS Register ([#30937](https://github.com/frappe/erpnext/issues/30937)) ([b7e873b](b7e873b55d))
* Unlink and delete batch created from stock reco on cancel ([fc35323](fc35323106))
* Wrap SLE actual_qty in `flt` to avoid NoneType operation ([d53228b](d53228b153))

### Features

* **HR:** Leave Type configuration to allow over allocation (backport [#30940](https://github.com/frappe/erpnext/issues/30940)) ([#30944](https://github.com/frappe/erpnext/issues/30944)) ([64440fc](64440fc4fb))
* **india:** cancel e-way bill is enabled with e-invoicing APIs. ([#30924](https://github.com/frappe/erpnext/issues/30924)) ([4ef2ffd](4ef2ffd14c))
* **india:** generate qrcode button for e-invoice ([#30946](https://github.com/frappe/erpnext/issues/30946)) ([7bd5b2b](7bd5b2ba29))
* **india:** store e-way bill auto calculated distance in sales invoice ([#30923](https://github.com/frappe/erpnext/issues/30923)) ([b96f156](b96f1565c5))
2022-05-13 18:12:18 +05:30
Frappe PR Bot
8cc2ea0ddb chore(release): Bumped to Version 13.28.0
# [13.28.0](https://github.com/frappe/erpnext/compare/v13.27.1...v13.28.0) (2022-05-03)

### Bug Fixes

* Consistent accounting dimensions across Sales and Purchase docs ([5df5058](5df50588cf))
* convert default_item_manufacturer to link field ([#30835](https://github.com/frappe/erpnext/issues/30835)) ([#30866](https://github.com/frappe/erpnext/issues/30866)) ([37fad7e](37fad7e04c))
* Cost center filter on payment reconciliation ([22e7f03](22e7f03a03))
* filters not working in Shift Assignment Calendar view ([#30822](https://github.com/frappe/erpnext/issues/30822)) ([3cdbb65](3cdbb65b5a))
* Ignore custom field validation while setup ([ee54bf7](ee54bf7fe2))
* **india:** e-invoice generation for registered composition gst category type ([#30814](https://github.com/frappe/erpnext/issues/30814)) ([#30877](https://github.com/frappe/erpnext/issues/30877)) ([246869d](246869dd28))
* Multi currency opening invoices ([2e62d51](2e62d518e8))
* payment days calculation for employees joining/leaving mid-month ([#30863](https://github.com/frappe/erpnext/issues/30863)) ([#30883](https://github.com/frappe/erpnext/issues/30883)) ([a1b0813](a1b0813966))
* Period Closing Voucher is considering GL entries with is_cancelled=1 ([#30865](https://github.com/frappe/erpnext/issues/30865)) ([5a5b49b](5a5b49b61a))
* **pos:** number pad translations ([b01f855](b01f8555e5))
* **pos:** search field doesn't reset on checkout ([edbf551](edbf5513da))
* Supply type for overseas invoices with payment of tax ([fdcc591](fdcc591a5e))
* supply type for sez invoices with payment of tax ([cf08710](cf087103cb))
* Use `account_type == 'Stock'` to filter stock accounts ([93482f3](93482f3302))
* **UX:** misleading stock entry lables ([#30870](https://github.com/frappe/erpnext/issues/30870)) ([#30871](https://github.com/frappe/erpnext/issues/30871)) ([57b03f0](57b03f0bf2))
* **UX:** record reason for skipping attendance or marking absent for auto attendance ([#30846](https://github.com/frappe/erpnext/issues/30846)) ([f7bf4a3](f7bf4a3e62))
* Vat Audit report fixes ([d5319a4](d5319a4826))

### Features

* Copy task color from project template (backport [#30857](https://github.com/frappe/erpnext/issues/30857)) ([#30859](https://github.com/frappe/erpnext/issues/30859)) ([7ee18e8](7ee18e86a2))
* support product bundles in picklist (backport [#30762](https://github.com/frappe/erpnext/issues/30762)) ([#30826](https://github.com/frappe/erpnext/issues/30826)) ([645ee2d](645ee2d822))
2022-05-13 18:12:18 +05:30
Frappe PR Bot
096dcf0e54 chore(release): Bumped to Version 13.27.1
## [13.27.1](https://github.com/frappe/erpnext/compare/v13.27.0...v13.27.1) (2022-04-26)

### Bug Fixes

* Add accounting dimensions for round off GL Entry ([dedb90e](dedb90ea72))
* batch_no filtering not working when batch no is also a number in scientific notation ([#30770](https://github.com/frappe/erpnext/issues/30770)) ([#30771](https://github.com/frappe/erpnext/issues/30771)) ([c339305](c339305e9c))
* Check if accounting dimension exists ([1834671](1834671d59))
* dependent gle reposting (backport [#30726](https://github.com/frappe/erpnext/issues/30726)) ([#30772](https://github.com/frappe/erpnext/issues/30772)) ([a6d0938](a6d0938591))
* Do not validate while creating accounting dimension ([153b41a](153b41a269))
* e_commerce_settings.js ([3a5f5d5](3a5f5d5cd0))
* e_commerce_settings.py ([86c5f4d](86c5f4db85))
* First preference to parent cost center rather than round off cost center ([a2d95fc](a2d95fc62b))
* Handle Multiselect field mapping separately ([dc2f694](dc2f694547))
* **india:** 401 & 403 client error while generating IRN ([198bdcf](198bdcfdc6))
* **india:** cess value not considered while validating e-invoice totals ([#30800](https://github.com/frappe/erpnext/issues/30800)) ([f70fca1](f70fca1c9e))
* **india:** transporter name is null while generating e-way bill ([#30736](https://github.com/frappe/erpnext/issues/30736)) ([6291b28](6291b28c37))
* linter ([6dddbb9](6dddbb9f27))
* Loan doctypes in bank reconciliation ([e69c715](e69c71576d))
* Mistyped variable name in patch ([e76220e](e76220e819))
* monthly attendance sheet ([#30748](https://github.com/frappe/erpnext/issues/30748)) ([0b4e3f1](0b4e3f1467))
* Must not be able to start Job Card if it is related to Work Order that is not started yet ([#29072](https://github.com/frappe/erpnext/issues/29072)) ([#30755](https://github.com/frappe/erpnext/issues/30755)) ([b656ffa](b656ffa45e))
* Query filter fields from Website Item instead of Item master ([bed9e09](bed9e09153))
* select doctype as payment_document ([44f0b69](44f0b69152))
* **Selling,E-Commerce:** Shopping cart quotation without website item. ([#29085](https://github.com/frappe/erpnext/issues/29085)) ([ea0fe5e](ea0fe5e10c))
* SO analysis rpt will fetch SO's without Delivery note as well ([f9d89c7](f9d89c7ce6))
* translation ([#30781](https://github.com/frappe/erpnext/issues/30781)) ([#30783](https://github.com/frappe/erpnext/issues/30783)) ([8335ca6](8335ca6331))
* Update token to allow updates on protected branch ([baab379](baab3797ca))
* update translation ([#30725](https://github.com/frappe/erpnext/issues/30725)) ([#30776](https://github.com/frappe/erpnext/issues/30776)) ([b585262](b585262842))
* Use parent cost center for Sales and Purchase Invoice ([fe9f329](fe9f32946c))
* Use right precision for asset value after full schedule ([#30745](https://github.com/frappe/erpnext/issues/30745)) ([269e192](269e1923c9))
* Validate field filter wrt to Website Item & re-use validation in Item Group ([34437a8](34437a83df))
2022-05-13 18:12:18 +05:30
Deepesh Garg
f2cbb70325 fix: Multiple fixes in GSTR-1 report 2022-05-13 18:12:18 +05:30
Deepesh Garg
7d8e3344e9 Merge pull request #31002 from frappe/mergify/bp/version-13-hotfix/pr-30990
fix: Item rate reset on changing posting date (backport #30990)
2022-05-13 14:44:04 +05:30
Marica
f7eb3ca1c0 Merge pull request #31000 from frappe/mergify/bp/version-13-hotfix/pr-30894
chore: added RFQ Link to Opportunity Dashboard (backport #30894)
2022-05-13 13:17:12 +05:30
Ankush Menat
0ec5adeed8 chore:conflicts 2022-05-13 13:14:08 +05:30
Marica
44d892fb70 Merge pull request #30999 from frappe/mergify/bp/version-13-hotfix/pr-30614
feat: add Link to Opportunity (backport #30614)
2022-05-13 13:12:50 +05:30
Deepesh Garg
8ef649f65d fix: Item rate reset on changing posting date (#30990)
* fix: Item rate reset on changing posting date

* chore: Remove debugger

(cherry picked from commit 54d6cf18fc)

# Conflicts:
#	erpnext/public/js/controllers/transaction.js
2022-05-13 07:37:57 +00:00
mergify[bot]
a94b5c0d8b fix(patch): avoid checking for return field if it doesnt exits (backport #30995) (#30997)
(cherry picked from commit b08180092e)

Co-authored-by: Ankush Menat <me@ankush.dev>
2022-05-13 13:07:51 +05:30
Marica
a829072353 Merge pull request #31001 from frappe/mergify/bp/version-13-hotfix/pr-30911
fix: German translations for Employee doctype (backport #30911)
2022-05-13 12:55:11 +05:30
Marica
eb1245e9f8 Merge pull request #30998 from frappe/mergify/bp/version-13-hotfix/pr-30818
feat: request_for_quotation - show supplier name (backport #30818)
2022-05-13 12:24:02 +05:30
barredterra
b9bda04a83 fix: german translations for Employee
(cherry picked from commit 02b38a439f)
2022-05-13 06:54:02 +00:00
Wolfram Schmidt
24851a8577 chore: added RFQ Link to Opportunity Dashboard (#30894)
added Link to Dashboard

added backlink to Request for Quotation in the Quotation dashboard for transparency and ease of navigation.

(cherry picked from commit c4a2778359)
2022-05-13 06:48:34 +00:00
Wolfram Schmidt
bc23bc738e feat: add Link to Opportunity (#30614)
Adding Link to Opportunity

Following the process of Opportunity to Quotation I added a section and link field to Opportunity for a backlink when using "create"-> Request for Quotation from Opportunity.

(cherry picked from commit 0bbed414f8)
2022-05-13 06:48:08 +00:00
Ahmad
b6a3e693ae feat: request_for_quotation - refactor
- Set supplier as link in while selecting supplier to create quotation

(cherry picked from commit 04c96b547e)
2022-05-13 06:47:19 +00:00
Ahmad
db4e264d92 feat: request_for_quotation
- Show supplier name if supplier ID is not equal to supplier name

(cherry picked from commit b226e7d2ac)
2022-05-13 06:47:18 +00:00
Saqib Ansari
1ecbf33960 Merge pull request #30991 from frappe/mergify/bp/version-13-hotfix/pr-30968
fix(accounts): minor fixes & validations (backport #30968)
2022-05-13 12:03:52 +05:30
Saqib Ansari
013ac26231 test: sales_invoice_with_disabled_account
(cherry picked from commit 6c16422beb)
2022-05-12 16:37:27 +00:00
Saqib Ansari
7c750571cd test: payment_entry_against_onhold_purchase_invoice
(cherry picked from commit 92613777b9)
2022-05-12 16:37:26 +00:00
Saqib Ansari
515e49bb90 fix: validate disabled accounts before posting ledger entries
(cherry picked from commit 95b059a98c)
2022-05-12 16:37:26 +00:00
Saqib Ansari
047c879bec fix: user can select disabled accounts in taxes table
(cherry picked from commit a1e3ae8869)
2022-05-12 16:37:25 +00:00
Saqib Ansari
9fbd170fa4 fix: validate on hold purchase invoices in payment entry
(cherry picked from commit b0f302e579)
2022-05-12 16:37:24 +00:00
Deepesh Garg
43ebe946f1 Merge pull request #30982 from deepeshgarg007/failing_patch_for_dimensisons
fix: Failing accounting dimension patch
2022-05-12 14:57:01 +05:30
Deepesh Garg
b14a7b8a5d fix: Failing accounting dimension patch 2022-05-12 13:54:47 +05:30
mergify[bot]
295ffb3f1a fix: stock analytics report shows incorrect data there's no stock movement in a period (backport #30945) (#30980)
* test: basic test for stock analytics report

(cherry picked from commit d81422fb58)

* fix: consider previous balance is missing

Also remove `total`, total of total is a meaningless value.

(cherry picked from commit 6ab0046e9c)

* fix: batch_no doesn't maintain qty_after_transaction

(cherry picked from commit 287b255ad6)

* fix: only carry-forward balances till today's period

Showing data in future doesn't make sense. Only carry-forward till last
bucket that contains today's day.

(cherry picked from commit 198b91f8d4)

Co-authored-by: Ankush Menat <me@ankush.dev>
2022-05-12 13:06:52 +05:30
Marica
d697515125 Merge pull request #30975 from frappe/mergify/bp/version-13-hotfix/pr-30950
fix: Set actual qty and basic rate in SE on warehouse triggers (`get_warehouse_details`) (backport #30950)
2022-05-12 12:54:12 +05:30
marination
6ef1261afd test: Test for mapped SE and fix for failing tests
- Remove `set_missing_values` from mapper util function since a lot of item data is set after this function is run
- `split_batch` can skip `set_missing_values` since no warehouses are set on mapping and relies on user input

(cherry picked from commit 4fa15b50ca)
2022-05-11 14:44:42 +00:00
marination
fe52c1f354 fix: set_missing_values in SE and re-use the same on all SE mappings
- `set_missing_values` in SE will set actual qty, transfer qty and calculate rate/amount
- Re-use `set_missing_values` wherever SE is doc is being mapped

(cherry picked from commit 90a8e924f5)
2022-05-11 14:44:42 +00:00
marination
678a01d4bd fix: Calculate totals even though pricing rule is not applied on mapped doc
- `apply_pricing_rule` is triggered due to change in some data which most likely contributes to Total.

(cherry picked from commit 494ddd1eb4)
2022-05-11 14:44:38 +00:00
marination
30b0aee013 fix: Set actual qty and basic rate in SE on warehouse triggers (get_warehouse_details)
- set `actual_qty` on source and target warehouse change

(cherry picked from commit 1ce45f623e)
2022-05-11 14:44:37 +00:00
mergify[bot]
97ea1f5123 fix: per_billed for return DN (backport #30868) (#30971)
This is a semi-automatic backport of pull request #30868 done by [Mergify](https://mergify.com).
2022-05-11 14:33:58 +00:00
rohitwaghchaure
60964a48c4 Merge pull request #30947 from frappe/mergify/bp/version-13-hotfix/pr-30938
fix: allow to use formatting for the field to_discuss in opportunity (backport #30938)
2022-05-11 17:48:23 +05:30
rohitwaghchaure
87fd93370a fix: conflicts 2022-05-11 16:07:24 +05:30
rohitwaghchaure
fb62bbf61a fix: conflicts 2022-05-11 16:05:19 +05:30
Ankush Menat
b008efbfdb Merge pull request #30970 from frappe/mergify/bp/version-13-hotfix/pr-30969
chore: fifo queue vs qty after transaction comparison report (backport #30969)
2022-05-11 15:55:17 +05:30
Ankush Menat
78f694ca4e chore: incompatible changes 2022-05-11 15:22:33 +05:30
Ankush Menat
8c2bfe1d5c chore: fifo queue vs qty after transaction comparison report
(cherry picked from commit f6d6463a33)
2022-05-11 09:43:15 +00:00
Marica
c873950f41 Merge pull request #30967 from frappe/mergify/bp/version-13-hotfix/pr-30962
fix: Block 0 Qty via Update Items to be consistent with form validation (backport #30962)
2022-05-11 13:04:10 +05:30
marination
56478752e4 fix: Block 0 Qty via Update Items to be consistent with form validation
(cherry picked from commit 0c9154389b)
2022-05-11 07:12:29 +00:00
gavin
a761c5c62c Merge pull request #30961 from frappe/mergify/bp/version-13-hotfix/pr-30958
fix(charts): Pass fieldtype for chart data in selling reports (backport #30958)
2022-05-10 17:55:19 +05:30
Gavin D'souza
917e7c34af fix(charts): Pass fieldtype for chart data in selling reports
(cherry picked from commit 7bf0e4f8e5)
2022-05-10 12:10:48 +00:00
Rohit Waghchaure
e126d4e592 fix: allow to use formatting for the field to_discuss in opportunity
(cherry picked from commit 3f41cb762d)

# Conflicts:
#	erpnext/crm/doctype/opportunity/opportunity.py
#	erpnext/crm/doctype/opportunity/test_opportunity.py
2022-05-10 06:41:34 +00:00
642 changed files with 180243 additions and 18067 deletions

View File

@@ -31,6 +31,7 @@ ignore =
E124, # closing bracket, irritating while writing QB code
E131, # continuation line unaligned for hanging indent
E123, # closing bracket does not match indentation of opening bracket's line
E101, # ensured by use of black
max-line-length = 200
exclude=.github/helper/semgrep_rules

View File

@@ -66,6 +66,8 @@ ignore =
F841,
E713,
E712,
B023,
B028
max-line-length = 200

View File

@@ -3,52 +3,71 @@ from urllib.parse import urlparse
import requests
docs_repos = [
"frappe_docs",
"erpnext_documentation",
WEBSITE_REPOS = [
"erpnext_com",
"frappe_io",
]
DOCUMENTATION_DOMAINS = [
"docs.erpnext.com",
"frappeframework.com",
]
def uri_validator(x):
result = urlparse(x)
return all([result.scheme, result.netloc, result.path])
def docs_link_exists(body):
for line in body.splitlines():
for word in line.split():
if word.startswith('http') and uri_validator(word):
parsed_url = urlparse(word)
if parsed_url.netloc == "github.com":
parts = parsed_url.path.split('/')
if len(parts) == 5 and parts[1] == "frappe" and parts[2] in docs_repos:
return True
elif parsed_url.netloc == "docs.erpnext.com":
return True
def is_valid_url(url: str) -> bool:
parts = urlparse(url)
return all((parts.scheme, parts.netloc, parts.path))
def is_documentation_link(word: str) -> bool:
if not word.startswith("http") or not is_valid_url(word):
return False
parsed_url = urlparse(word)
if parsed_url.netloc in DOCUMENTATION_DOMAINS:
return True
if parsed_url.netloc == "github.com":
parts = parsed_url.path.split("/")
if len(parts) == 5 and parts[1] == "frappe" and parts[2] in WEBSITE_REPOS:
return True
return False
def contains_documentation_link(body: str) -> bool:
return any(
is_documentation_link(word)
for line in body.splitlines()
for word in line.split()
)
def check_pull_request(number: str) -> "tuple[int, str]":
response = requests.get(f"https://api.github.com/repos/frappe/erpnext/pulls/{number}")
if not response.ok:
return 1, "Pull Request Not Found! ⚠️"
payload = response.json()
title = (payload.get("title") or "").lower().strip()
head_sha = (payload.get("head") or {}).get("sha")
body = (payload.get("body") or "").lower()
if (
not title.startswith("feat")
or not head_sha
or "no-docs" in body
or "backport" in body
):
return 0, "Skipping documentation checks... 🏃"
if contains_documentation_link(body):
return 0, "Documentation Link Found. You're Awesome! 🎉"
return 1, "Documentation Link Not Found! ⚠️"
if __name__ == "__main__":
pr = sys.argv[1]
response = requests.get("https://api.github.com/repos/frappe/erpnext/pulls/{}".format(pr))
if response.ok:
payload = response.json()
title = (payload.get("title") or "").lower().strip()
head_sha = (payload.get("head") or {}).get("sha")
body = (payload.get("body") or "").lower()
if (title.startswith("feat")
and head_sha
and "no-docs" not in body
and "backport" not in body
):
if docs_link_exists(body):
print("Documentation Link Found. You're Awesome! 🎉")
else:
print("Documentation Link Not Found! ⚠️")
sys.exit(1)
else:
print("Skipping documentation checks... 🏃")
exit_code, message = check_pull_request(sys.argv[1])
print(message)
sys.exit(exit_code)

View File

@@ -11,7 +11,7 @@ fi
cd ~ || exit
sudo apt-get install redis-server libcups2-dev
sudo apt update && sudo apt install redis-server libcups2-dev
pip install frappe-bench

View File

@@ -12,7 +12,7 @@ jobs:
- name: 'Setup Environment'
uses: actions/setup-python@v2
with:
python-version: 3.6
python-version: '3.10'
- name: 'Clone repo'
uses: actions/checkout@v2

View File

@@ -11,10 +11,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.10'
- name: Install and Run Pre-commit
uses: pre-commit/action@v2.0.3
@@ -22,10 +22,8 @@ jobs:
- name: Download Semgrep rules
run: git clone --depth 1 https://github.com/frappe/semgrep-rules.git frappe-semgrep-rules
- uses: returntocorp/semgrep-action@v1
env:
SEMGREP_TIMEOUT: 120
with:
config: >-
r/python.lang.correctness
./frappe-semgrep-rules/rules
- name: Download semgrep
run: pip install semgrep
- name: Run Semgrep rules
run: semgrep ci --config ./frappe-semgrep-rules/rules --config r/python.lang.correctness

View File

@@ -14,7 +14,7 @@ concurrency:
jobs:
test:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
timeout-minutes: 60
name: Patch Test

View File

@@ -13,10 +13,10 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js v14
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14
node-version: 18
- name: Setup dependencies
run: |
npm install @semantic-release/git @semantic-release/exec --no-save
@@ -28,4 +28,4 @@ jobs:
GIT_AUTHOR_EMAIL: "developers@frappe.io"
GIT_COMMITTER_NAME: "Frappe PR Bot"
GIT_COMMITTER_EMAIL: "developers@frappe.io"
run: npx semantic-release
run: npx semantic-release

38
.github/workflows/release_notes.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
# This action:
#
# 1. Generates release notes using github API.
# 2. Strips unnecessary info like chore/style etc from notes.
# 3. Updates release info.
# This action needs to be maintained on all branches that do releases.
name: 'Release Notes'
on:
workflow_dispatch:
inputs:
tag_name:
description: 'Tag of release like v13.0.0'
required: true
type: string
release:
types: [released]
permissions:
contents: read
jobs:
regen-notes:
name: 'Regenerate release notes'
runs-on: ubuntu-latest
steps:
- name: Update notes
run: |
NEW_NOTES=$(gh api --method POST -H "Accept: application/vnd.github+json" /repos/frappe/erpnext/releases/generate-notes -f tag_name=$RELEASE_TAG | jq -r '.body' | sed -E '/^\* (chore|ci|test|docs|style)/d' )
RELEASE_ID=$(gh api -H "Accept: application/vnd.github+json" /repos/frappe/erpnext/releases/tags/$RELEASE_TAG | jq -r '.id')
gh api --method PATCH -H "Accept: application/vnd.github+json" /repos/frappe/erpnext/releases/$RELEASE_ID -f body="$NEW_NOTES"
env:
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
RELEASE_TAG: ${{ github.event.inputs.tag_name || github.event.release.tag_name }}

View File

@@ -18,14 +18,14 @@ concurrency:
jobs:
test:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
container: [1, 2, 3]
container: [1, 2]
name: Python Unit Tests
@@ -93,7 +93,7 @@ jobs:
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
- name: Run Tests
run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --use-orchestrator
run: 'cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --app erpnext --total-builds 2 --build-number ${{ matrix.container }}'
env:
TYPE: server
CI_BUILD_ID: ${{ github.run_id }}

View File

@@ -8,7 +8,7 @@ on:
jobs:
check_translation:
name: Translation Syntax Check
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup python3

View File

@@ -1,117 +0,0 @@
name: UI
on:
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:
concurrency:
group: ui-v13-${{ github.event.number }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-18.04
timeout-minutes: 60
strategy:
fail-fast: false
name: UI Tests (Cypress)
services:
mysql:
image: mariadb:10.3
env:
MYSQL_ALLOW_EMPTY_PASSWORD: YES
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- name: Clone
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- uses: actions/setup-node@v2
with:
node-version: 14
check-latest: true
- name: Add to Hosts
run: |
echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Cache cypress binary
uses: actions/cache@v2
with:
path: ~/.cache
key: ${{ runner.os }}-cypress-
restore-keys: |
${{ runner.os }}-cypress-
${{ runner.os }}-
- name: Install
run: bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
env:
DB: mariadb
TYPE: ui
- name: Site Setup
run: cd ~/frappe-bench/ && bench --site test_site execute erpnext.setup.utils.before_tests
- name: cypress pre-requisites
run: cd ~/frappe-bench/apps/frappe && yarn add cypress-file-upload@^5 @testing-library/cypress@^8 --no-lockfile
- name: Build Assets
run: cd ~/frappe-bench/ && bench build
env:
CI: Yes
- name: UI Tests
run: cd ~/frappe-bench/ && bench --site test_site run-ui-tests erpnext --headless
env:
CYPRESS_RECORD_KEY: 60a8e3bf-08f5-45b1-9269-2b207d7d30cd
- name: Show bench console if tests failed
if: ${{ failure() }}
run: cat ~/frappe-bench/bench_run_logs.txt

View File

@@ -16,8 +16,8 @@ repos:
- id: check-merge-conflict
- id: check-ast
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies: [
@@ -32,8 +32,8 @@ repos:
- id: black
additional_dependencies: ['click==8.0.4']
- repo: https://github.com/timothycrosley/isort
rev: 5.9.1
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
exclude: ".*setup.py$"

View File

@@ -10,7 +10,7 @@
"@semantic-release/release-notes-generator",
[
"@semantic-release/exec", {
"prepareCmd": 'sed -ir "s/[0-9]*\.[0-9]*\.[0-9]*/${nextRelease.version}/" erpnext/__init__.py'
"prepareCmd": 'sed -ir -E "s/\"[0-9]+\.[0-9]+\.[0-9]+\"/\"${nextRelease.version}\"/" erpnext/__init__.py'
}
],
[

View File

@@ -3,33 +3,24 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
erpnext/accounts/ @nextchamp-saqib @deepeshgarg007
erpnext/assets/ @nextchamp-saqib @deepeshgarg007
erpnext/erpnext_integrations/ @nextchamp-saqib
erpnext/loan_management/ @nextchamp-saqib @deepeshgarg007
erpnext/regional @nextchamp-saqib @deepeshgarg007
erpnext/selling @nextchamp-saqib @deepeshgarg007
erpnext/support/ @nextchamp-saqib @deepeshgarg007
pos* @nextchamp-saqib
erpnext/accounts/ @deepeshgarg007 @ruthra-kumar
erpnext/assets/ @anandbaburajan @deepeshgarg007
erpnext/loan_management/ @deepeshgarg007
erpnext/regional @deepeshgarg007 @ruthra-kumar
erpnext/selling @deepeshgarg007 @ruthra-kumar
erpnext/support/ @deepeshgarg007
pos*
erpnext/buying/ @marination @rohitwaghchaure @ankush
erpnext/e_commerce/ @marination
erpnext/maintenance/ @marination @rohitwaghchaure
erpnext/manufacturing/ @marination @rohitwaghchaure @ankush
erpnext/portal/ @marination
erpnext/quality_management/ @marination @rohitwaghchaure
erpnext/shopping_cart/ @marination
erpnext/stock/ @marination @rohitwaghchaure @ankush
erpnext/buying/ @rohitwaghchaure @s-aga-r
erpnext/maintenance/ @rohitwaghchaure @s-aga-r
erpnext/manufacturing/ @rohitwaghchaure @s-aga-r
erpnext/quality_management/ @rohitwaghchaure @s-aga-r
erpnext/stock/ @rohitwaghchaure @s-aga-r
erpnext/crm/ @ruchamahabal @pateljannat
erpnext/education/ @ruchamahabal @pateljannat
erpnext/healthcare/ @ruchamahabal @pateljannat @chillaranand
erpnext/hr/ @ruchamahabal @pateljannat
erpnext/non_profit/ @ruchamahabal
erpnext/payroll @ruchamahabal @pateljannat
erpnext/projects/ @ruchamahabal @pateljannat
erpnext/controllers @deepeshgarg007 @rohitwaghchaure
erpnext/patches/ @deepeshgarg007 @rohitwaghchaure
requirements.txt @ankush
erpnext/controllers @deepeshgarg007 @nextchamp-saqib @rohitwaghchaure @marination
.github/ @deepeshgarg007
pyproject.toml @ankush
.github/ @surajshetty3416 @ankush
requirements.txt @gavindsouza

View File

@@ -65,6 +65,8 @@ GNU/General Public License (see [license.txt](license.txt))
The ERPNext code is licensed as GNU General Public License (v3) and the Documentation is licensed as Creative Commons (CC-BY-SA-3.0) and the copyright is owned by Frappe Technologies Pvt Ltd (Frappe) and Contributors.
By contributing to ERPNext, you agree that your contributions will be licensed under its GNU General Public License (v3).
---
## Contributing

View File

@@ -4,7 +4,7 @@ import frappe
from erpnext.hooks import regional_overrides
__version__ = "13.29.2"
__version__ = "13.55.2"
def get_default_company(user=None):
@@ -149,6 +149,7 @@ def allow_regional(fn):
return caller
@frappe.whitelist()
def get_last_membership(member):
"""Returns last membership if exists"""
last_membership = frappe.get_all(

View File

@@ -378,7 +378,7 @@ def book_deferred_income_or_expense(doc, deferred_process, posting_date=None):
return
# check if books nor frozen till endate:
if accounts_frozen_upto and (end_date) <= getdate(accounts_frozen_upto):
if accounts_frozen_upto and getdate(end_date) <= getdate(accounts_frozen_upto):
end_date = get_last_day(add_days(accounts_frozen_upto, 1))
if via_journal_entry:

View File

@@ -1,38 +1,38 @@
{
"country_code": "de",
"name": "SKR03 mit Kontonummern",
"tree": {
"Aktiva": {
"is_group": 1,
"country_code": "de",
"name": "SKR03 mit Kontonummern",
"tree": {
"Aktiva": {
"is_group": 1,
"root_type": "Asset",
"A - Anlagevermögen": {
"is_group": 1,
"EDV-Software": {
"account_number": "0027",
"account_type": "Fixed Asset"
},
"Gesch\u00e4ftsausstattung": {
"account_number": "0410",
"account_type": "Fixed Asset"
},
"B\u00fcroeinrichtung": {
"account_number": "0420",
"account_type": "Fixed Asset"
},
"Darlehen": {
"account_number": "0565"
},
"Maschinen": {
"account_number": "0210",
"account_type": "Fixed Asset"
},
"Betriebsausstattung": {
"account_number": "0400",
"account_type": "Fixed Asset"
},
"Ladeneinrichtung": {
"account_number": "0430",
"account_type": "Fixed Asset"
"A - Anlagevermögen": {
"is_group": 1,
"EDV-Software": {
"account_number": "0027",
"account_type": "Fixed Asset"
},
"Geschäftsausstattung": {
"account_number": "0410",
"account_type": "Fixed Asset"
},
"Büroeinrichtung": {
"account_number": "0420",
"account_type": "Fixed Asset"
},
"Darlehen": {
"account_number": "0565"
},
"Maschinen": {
"account_number": "0210",
"account_type": "Fixed Asset"
},
"Betriebsausstattung": {
"account_number": "0400",
"account_type": "Fixed Asset"
},
"Ladeneinrichtung": {
"account_number": "0430",
"account_type": "Fixed Asset"
},
"Accumulated Depreciation": {
"account_type": "Accumulated Depreciation"
@@ -60,36 +60,46 @@
"Durchlaufende Posten": {
"account_number": "1590"
},
"Gewinnermittlung \u00a74/3 nicht Ergebniswirksam": {
"Verrechnungskonto Gewinnermittlung § 4 Abs. 3 EStG, nicht ergebniswirksam": {
"account_number": "1371"
},
"Abziehbare Vorsteuer": {
"account_type": "Tax",
"is_group": 1,
"Abziehbare Vorsteuer 7%": {
"account_number": "1571"
"Abziehbare Vorsteuer 7 %": {
"account_number": "1571",
"account_type": "Tax",
"tax_rate": 7.0
},
"Abziehbare Vorsteuer 19%": {
"account_number": "1576"
"Abziehbare Vorsteuer 19 %": {
"account_number": "1576",
"account_type": "Tax",
"tax_rate": 19.0
},
"Abziehbare Vorsteuer nach \u00a713b UStG 19%": {
"account_number": "1577"
},
"Leistungen \u00a713b UStG 19% Vorsteuer, 19% Umsatzsteuer": {
"account_number": "3120"
"Abziehbare Vorsteuer nach § 13b UStG 19 %": {
"account_number": "1577",
"account_type": "Tax",
"tax_rate": 19.0
}
}
},
"III. Wertpapiere": {
"is_group": 1
"is_group": 1,
"Anteile an verbundenen Unternehmen (Umlaufvermögen)": {
"account_number": "1340"
},
"Anteile an herrschender oder mit Mehrheit beteiligter Gesellschaft": {
"account_number": "1344"
},
"Sonstige Wertpapiere": {
"account_number": "1348"
}
},
"IV. Kassenbestand, Bundesbankguthaben, Guthaben bei Kreditinstituten und Schecks.": {
"is_group": 1,
"Kasse": {
"account_type": "Cash",
"is_group": 1,
"account_type": "Cash",
"Kasse": {
"is_group": 1,
"account_number": "1000",
"account_type": "Cash"
}
@@ -111,21 +121,21 @@
"C - Rechnungsabgrenzungsposten": {
"is_group": 1,
"Aktive Rechnungsabgrenzung": {
"account_number": "0980"
"account_number": "0980"
}
},
"D - Aktive latente Steuern": {
"is_group": 1,
"Aktive latente Steuern": {
"account_number": "0983"
"account_number": "0983"
}
},
"E - Aktiver Unterschiedsbetrag aus der Vermögensverrechnung": {
"is_group": 1
}
},
"Passiva": {
"is_group": 1,
},
"Passiva": {
"is_group": 1,
"root_type": "Liability",
"A. Eigenkapital": {
"is_group": 1,
@@ -200,26 +210,32 @@
},
"Umsatzsteuer": {
"is_group": 1,
"account_type": "Tax",
"Umsatzsteuer 7%": {
"account_number": "1771"
"Umsatzsteuer 7 %": {
"account_number": "1771",
"account_type": "Tax",
"tax_rate": 7.0
},
"Umsatzsteuer 19%": {
"account_number": "1776"
"Umsatzsteuer 19 %": {
"account_number": "1776",
"account_type": "Tax",
"tax_rate": 19.0
},
"Umsatzsteuer-Vorauszahlung": {
"account_number": "1780"
"account_number": "1780",
"account_type": "Tax"
},
"Umsatzsteuer-Vorauszahlung 1/11": {
"account_number": "1781"
},
"Umsatzsteuer \u00a7 13b UStG 19%": {
"account_number": "1787"
"Umsatzsteuer nach § 13b UStG 19 %": {
"account_number": "1787",
"account_type": "Tax",
"tax_rate": 19.0
},
"Umsatzsteuer Vorjahr": {
"account_number": "1790"
},
"Umsatzsteuer fr\u00fchere Jahre": {
"Umsatzsteuer frühere Jahre": {
"account_number": "1791"
}
}
@@ -234,44 +250,56 @@
"E. Passive latente Steuern": {
"is_group": 1
}
},
"Erl\u00f6se u. Ertr\u00e4ge 2/8": {
"is_group": 1,
"root_type": "Income",
"Erl\u00f6skonten 8": {
},
"Erlöse u. Erträge 2/8": {
"is_group": 1,
"root_type": "Income",
"Erlöskonten 8": {
"is_group": 1,
"Erl\u00f6se": {
"account_number": "8200",
"account_type": "Income Account"
},
"Erl\u00f6se USt. 19%": {
"account_number": "8400",
"account_type": "Income Account"
},
"Erl\u00f6se USt. 7%": {
"account_number": "8300",
"account_type": "Income Account"
}
},
"Ertragskonten 2": {
"is_group": 1,
"sonstige Zinsen und \u00e4hnliche Ertr\u00e4ge": {
"account_number": "2650",
"account_type": "Income Account"
},
"Au\u00dferordentliche Ertr\u00e4ge": {
"account_number": "2500",
"account_type": "Income Account"
},
"Sonstige Ertr\u00e4ge": {
"account_number": "2700",
"account_type": "Income Account"
}
}
},
"Aufwendungen 2/4": {
"is_group": 1,
"Erlöse": {
"account_number": "8200",
"account_type": "Income Account"
},
"Erlöse USt. 19 %": {
"account_number": "8400",
"account_type": "Income Account"
},
"Erlöse USt. 7 %": {
"account_number": "8300",
"account_type": "Income Account"
}
},
"Ertragskonten 2": {
"is_group": 1,
"sonstige Zinsen und ähnliche Erträge": {
"account_number": "2650",
"account_type": "Income Account"
},
"Außerordentliche Erträge": {
"account_number": "2500",
"account_type": "Income Account"
},
"Sonstige Erträge": {
"account_number": "2700",
"account_type": "Income Account"
}
}
},
"Aufwendungen 2/4": {
"is_group": 1,
"root_type": "Expense",
"Fremdleistungen": {
"account_number": "3100",
"account_type": "Expense Account"
},
"Fremdleistungen ohne Vorsteuer": {
"account_number": "3109",
"account_type": "Expense Account"
},
"Bauleistungen eines im Inland ansässigen Unternehmers 19 % Vorsteuer und 19 % Umsatzsteuer": {
"account_number": "3120",
"account_type": "Expense Account"
},
"Wareneingang": {
"account_number": "3200"
},
@@ -298,234 +326,234 @@
"Gegenkonto 4996-4998": {
"account_number": "4999"
},
"Abschreibungen": {
"is_group": 1,
"Abschreibungen": {
"is_group": 1,
"Abschreibungen auf Sachanlagen (ohne AfA auf Kfz und Gebäude)": {
"account_number": "4830",
"account_type": "Accumulated Depreciation"
"account_number": "4830",
"account_type": "Accumulated Depreciation"
},
"Abschreibungen auf Gebäude": {
"account_number": "4831",
"account_type": "Depreciation"
"account_number": "4831",
"account_type": "Depreciation"
},
"Abschreibungen auf Kfz": {
"account_number": "4832",
"account_type": "Depreciation"
"account_number": "4832",
"account_type": "Depreciation"
},
"Sofortabschreibung GWG": {
"account_number": "4855",
"account_type": "Expense Account"
"account_number": "4855",
"account_type": "Expense Account"
}
},
"Kfz-Kosten": {
"is_group": 1,
"Kfz-Steuer": {
"account_number": "4510",
"account_type": "Expense Account"
},
"Kfz-Versicherungen": {
"account_number": "4520",
"account_type": "Expense Account"
},
"laufende Kfz-Betriebskosten": {
"account_number": "4530",
"account_type": "Expense Account"
},
"Kfz-Reparaturen": {
"account_number": "4540",
"account_type": "Expense Account"
},
"Fremdfahrzeuge": {
"account_number": "4570",
"account_type": "Expense Account"
},
"sonstige Kfz-Kosten": {
"account_number": "4580",
"account_type": "Expense Account"
}
},
"Personalkosten": {
"is_group": 1,
"Geh\u00e4lter": {
"account_number": "4120",
"account_type": "Expense Account"
},
"gesetzliche soziale Aufwendungen": {
"account_number": "4130",
"account_type": "Expense Account"
},
"Aufwendungen f\u00fcr Altersvorsorge": {
"account_number": "4165",
"account_type": "Expense Account"
},
"Verm\u00f6genswirksame Leistungen": {
"account_number": "4170",
"account_type": "Expense Account"
},
"Aushilfsl\u00f6hne": {
"account_number": "4190",
"account_type": "Expense Account"
}
},
"Raumkosten": {
"is_group": 1,
"Miete und Nebenkosten": {
"account_number": "4210",
"account_type": "Expense Account"
},
"Gas, Wasser, Strom (Verwaltung, Vertrieb)": {
"account_number": "4240",
"account_type": "Expense Account"
},
"Reinigung": {
"account_number": "4250",
"account_type": "Expense Account"
}
},
"Reparatur/Instandhaltung": {
"is_group": 1,
"Reparatur u. Instandh. von Anlagen/Maschinen u. Betriebs- u. Gesch\u00e4ftsausst.": {
"account_number": "4805",
"account_type": "Expense Account"
}
},
"Versicherungsbeitr\u00e4ge": {
"is_group": 1,
"Versicherungen": {
"account_number": "4360",
"account_type": "Expense Account"
},
"Beitr\u00e4ge": {
"account_number": "4380",
"account_type": "Expense Account"
},
"sonstige Ausgaben": {
"account_number": "4390",
"account_type": "Expense Account"
},
"steuerlich abzugsf\u00e4hige Versp\u00e4tungszuschl\u00e4ge und Zwangsgelder": {
"account_number": "4396",
"account_type": "Expense Account"
}
},
"Werbe-/Reisekosten": {
"is_group": 1,
"Werbekosten": {
"account_number": "4610",
"account_type": "Expense Account"
},
"Aufmerksamkeiten": {
"account_number": "4653",
"account_type": "Expense Account"
},
"nicht abzugsf\u00e4hige Betriebsausg. aus Werbe-, Repr\u00e4s.- u. Reisekosten": {
"account_number": "4665",
"account_type": "Expense Account"
},
"Reisekosten Unternehmer": {
"account_number": "4670",
"account_type": "Expense Account"
}
},
"verschiedene Kosten": {
"is_group": 1,
"Porto": {
"account_number": "4910",
"account_type": "Expense Account"
},
"Telekom": {
"account_number": "4920",
"account_type": "Expense Account"
},
"Mobilfunk D2": {
"account_number": "4921",
"account_type": "Expense Account"
},
"Internet": {
"account_number": "4922",
"account_type": "Expense Account"
},
"B\u00fcrobedarf": {
"account_number": "4930",
"account_type": "Expense Account"
},
"Zeitschriften, B\u00fccher": {
"account_number": "4940",
"account_type": "Expense Account"
},
"Fortbildungskosten": {
"account_number": "4945",
"account_type": "Expense Account"
},
"Buchf\u00fchrungskosten": {
"account_number": "4955",
"account_type": "Expense Account"
},
"Abschlu\u00df- u. Pr\u00fcfungskosten": {
"account_number": "4957",
"account_type": "Expense Account"
},
"Nebenkosten des Geldverkehrs": {
"account_number": "4970",
"account_type": "Expense Account"
},
"Werkzeuge und Kleinger\u00e4te": {
"account_number": "4985",
"account_type": "Expense Account"
}
},
"Zinsaufwendungen": {
"is_group": 1,
"Zinsaufwendungen f\u00fcr kurzfristige Verbindlichkeiten": {
"account_number": "2110",
"account_type": "Expense Account"
},
"Zinsaufwendungen f\u00fcr KFZ Finanzierung": {
"account_number": "2121",
"account_type": "Expense Account"
}
}
},
"Anfangsbestand 9": {
"is_group": 1,
"root_type": "Equity",
"Saldenvortragskonten": {
"is_group": 1,
"Saldenvortrag Sachkonten": {
"account_number": "9000"
},
"Saldenvortr\u00e4ge Debitoren": {
"account_number": "9008"
},
"Saldenvortr\u00e4ge Kreditoren": {
"account_number": "9009"
}
}
},
"Privatkonten 1": {
"is_group": 1,
"root_type": "Equity",
"Privatentnahmen/-einlagen": {
"is_group": 1,
"Privatentnahme allgemein": {
"account_number": "1800"
},
"Privatsteuern": {
"account_number": "1810"
},
"Sonderausgaben beschr\u00e4nkt abzugsf\u00e4hig": {
"account_number": "1820"
},
"Sonderausgaben unbeschr\u00e4nkt abzugsf\u00e4hig": {
"account_number": "1830"
},
"Au\u00dfergew\u00f6hnliche Belastungen": {
"account_number": "1850"
},
"Privateinlagen": {
"account_number": "1890"
}
}
}
}
},
"Kfz-Kosten": {
"is_group": 1,
"Kfz-Steuer": {
"account_number": "4510",
"account_type": "Expense Account"
},
"Kfz-Versicherungen": {
"account_number": "4520",
"account_type": "Expense Account"
},
"laufende Kfz-Betriebskosten": {
"account_number": "4530",
"account_type": "Expense Account"
},
"Kfz-Reparaturen": {
"account_number": "4540",
"account_type": "Expense Account"
},
"Fremdfahrzeuge": {
"account_number": "4570",
"account_type": "Expense Account"
},
"sonstige Kfz-Kosten": {
"account_number": "4580",
"account_type": "Expense Account"
}
},
"Personalkosten": {
"is_group": 1,
"Gehälter": {
"account_number": "4120",
"account_type": "Expense Account"
},
"gesetzliche soziale Aufwendungen": {
"account_number": "4130",
"account_type": "Expense Account"
},
"Aufwendungen für Altersvorsorge": {
"account_number": "4165",
"account_type": "Expense Account"
},
"Vermögenswirksame Leistungen": {
"account_number": "4170",
"account_type": "Expense Account"
},
"Aushilfslöhne": {
"account_number": "4190",
"account_type": "Expense Account"
}
},
"Raumkosten": {
"is_group": 1,
"Miete und Nebenkosten": {
"account_number": "4210",
"account_type": "Expense Account"
},
"Gas, Wasser, Strom (Verwaltung, Vertrieb)": {
"account_number": "4240",
"account_type": "Expense Account"
},
"Reinigung": {
"account_number": "4250",
"account_type": "Expense Account"
}
},
"Reparatur/Instandhaltung": {
"is_group": 1,
"Reparaturen und Instandhaltungen von anderen Anlagen und Betriebs- und Geschäftsausstattung": {
"account_number": "4805",
"account_type": "Expense Account"
}
},
"Versicherungsbeiträge": {
"is_group": 1,
"Versicherungen": {
"account_number": "4360",
"account_type": "Expense Account"
},
"Beiträge": {
"account_number": "4380",
"account_type": "Expense Account"
},
"sonstige Ausgaben": {
"account_number": "4390",
"account_type": "Expense Account"
},
"steuerlich abzugsfähige Verspätungszuschläge und Zwangsgelder": {
"account_number": "4396",
"account_type": "Expense Account"
}
},
"Werbe-/Reisekosten": {
"is_group": 1,
"Werbekosten": {
"account_number": "4610",
"account_type": "Expense Account"
},
"Aufmerksamkeiten": {
"account_number": "4653",
"account_type": "Expense Account"
},
"nicht abzugsfähige Betriebsausg. aus Werbe-, Repräs.- u. Reisekosten": {
"account_number": "4665",
"account_type": "Expense Account"
},
"Reisekosten Unternehmer": {
"account_number": "4670",
"account_type": "Expense Account"
}
},
"verschiedene Kosten": {
"is_group": 1,
"Porto": {
"account_number": "4910",
"account_type": "Expense Account"
},
"Telekom": {
"account_number": "4920",
"account_type": "Expense Account"
},
"Mobilfunk D2": {
"account_number": "4921",
"account_type": "Expense Account"
},
"Internet": {
"account_number": "4922",
"account_type": "Expense Account"
},
"Bürobedarf": {
"account_number": "4930",
"account_type": "Expense Account"
},
"Zeitschriften, Bücher": {
"account_number": "4940",
"account_type": "Expense Account"
},
"Fortbildungskosten": {
"account_number": "4945",
"account_type": "Expense Account"
},
"Buchführungskosten": {
"account_number": "4955",
"account_type": "Expense Account"
},
"Abschluß- u. Prüfungskosten": {
"account_number": "4957",
"account_type": "Expense Account"
},
"Nebenkosten des Geldverkehrs": {
"account_number": "4970",
"account_type": "Expense Account"
},
"Werkzeuge und Kleingeräte": {
"account_number": "4985",
"account_type": "Expense Account"
}
},
"Zinsaufwendungen": {
"is_group": 1,
"Zinsaufwendungen für kurzfristige Verbindlichkeiten": {
"account_number": "2110",
"account_type": "Expense Account"
},
"Zinsaufwendungen für KFZ Finanzierung": {
"account_number": "2121",
"account_type": "Expense Account"
}
}
},
"Anfangsbestand 9": {
"is_group": 1,
"root_type": "Equity",
"Saldenvortragskonten": {
"is_group": 1,
"Saldenvortrag Sachkonten": {
"account_number": "9000"
},
"Saldenvorträge Debitoren": {
"account_number": "9008"
},
"Saldenvorträge Kreditoren": {
"account_number": "9009"
}
}
},
"Privatkonten 1": {
"is_group": 1,
"root_type": "Equity",
"Privatentnahmen/-einlagen": {
"is_group": 1,
"Privatentnahme allgemein": {
"account_number": "1800"
},
"Privatsteuern": {
"account_number": "1810"
},
"Sonderausgaben beschränkt abzugsfähig": {
"account_number": "1820"
},
"Sonderausgaben unbeschränkt abzugsfähig": {
"account_number": "1830"
},
"Außergewöhnliche Belastungen": {
"account_number": "1850"
},
"Privateinlagen": {
"account_number": "1890"
}
}
}
}
}

View File

@@ -297,7 +297,7 @@ def _make_test_records(verbose=None):
# fixed asset depreciation
["_Test Fixed Asset", "Current Assets", 0, "Fixed Asset", None],
["_Test Accumulated Depreciations", "Current Assets", 0, "Accumulated Depreciation", None],
["_Test Depreciations", "Expenses", 0, None, None],
["_Test Depreciations", "Expenses", 0, "Depreciation", None],
["_Test Gain/Loss on Asset Disposal", "Expenses", 0, None, None],
# Receivable / Payable Account
["_Test Receivable", "Current Assets", 0, "Receivable", None],

View File

@@ -234,17 +234,19 @@ def get_checks_for_pl_and_bs_accounts():
return dimensions
def get_dimension_with_children(doctype, dimension):
def get_dimension_with_children(doctype, dimensions):
if isinstance(dimension, list):
dimension = dimension[0]
if isinstance(dimensions, str):
dimensions = [dimensions]
all_dimensions = []
lft, rgt = frappe.db.get_value(doctype, dimension, ["lft", "rgt"])
children = frappe.get_all(
doctype, filters={"lft": [">=", lft], "rgt": ["<=", rgt]}, order_by="lft"
)
all_dimensions += [c.name for c in children]
for dimension in dimensions:
lft, rgt = frappe.db.get_value(doctype, dimension, ["lft", "rgt"])
children = frappe.get_all(
doctype, filters={"lft": [">=", lft], "rgt": ["<=", rgt]}, order_by="lft"
)
all_dimensions += [c.name for c in children]
return all_dimensions

View File

@@ -3,10 +3,6 @@
frappe.ui.form.on('Accounting Dimension Filter', {
refresh: function(frm, cdt, cdn) {
if (frm.doc.accounting_dimension) {
frm.set_df_property('dimensions', 'label', frm.doc.accounting_dimension, cdn, 'dimension_value');
}
let help_content =
`<table class="table table-bordered" style="background-color: var(--scrollbar-track-color);">
<tr><td>
@@ -68,6 +64,7 @@ frappe.ui.form.on('Accounting Dimension Filter', {
frm.clear_table("dimensions");
let row = frm.add_child("dimensions");
row.accounting_dimension = frm.doc.accounting_dimension;
frm.fields_dict["dimensions"].grid.update_docfield_property("dimension_value", "label", frm.doc.accounting_dimension);
frm.refresh_field("dimensions");
frm.trigger('setup_filters');
},

View File

@@ -4,6 +4,12 @@
frappe.ui.form.on('Accounts Settings', {
refresh: function(frm) {
},
validate_access_key(frm) {
frappe.call({
doc: frm.doc,
method: "validate_access_key"
});
}
});

View File

@@ -19,12 +19,14 @@
"book_asset_depreciation_entry_automatically",
"unlink_advance_payment_on_cancelation_of_order",
"enable_common_party_accounting",
"allow_multi_currency_invoices_against_single_party_account",
"post_change_gl_entries",
"enable_discount_accounting",
"tax_settings_section",
"determine_address_tax_category_from",
"column_break_19",
"add_taxes_from_item_tax_template",
"book_tax_discount_loss",
"period_closing_settings_section",
"acc_frozen_upto",
"frozen_accounts_modifier",
@@ -38,11 +40,16 @@
"submit_journal_entries",
"print_settings",
"show_inclusive_tax_in_print",
"show_taxes_as_table_in_print",
"column_break_12",
"show_payment_schedule_in_print",
"currency_exchange_section",
"allow_stale",
"stale_days",
"service_provider",
"column_break_eiyok",
"access_key",
"validate_access_key",
"report_settings_sb",
"use_custom_cash_flow"
],
@@ -173,6 +180,7 @@
},
{
"default": "0",
"description": "Payment Terms from orders will be fetched into the invoices as is",
"fieldname": "automatically_fetch_payment_terms",
"fieldtype": "Check",
"label": "Automatically Fetch Payment Terms from Order"
@@ -276,6 +284,50 @@
"fieldname": "enable_common_party_accounting",
"fieldtype": "Check",
"label": "Enable Common Party Accounting"
},
{
"default": "0",
"description": "Enabling this will allow creation of multi-currency invoices against single party account in company currency",
"fieldname": "allow_multi_currency_invoices_against_single_party_account",
"fieldtype": "Check",
"label": "Allow multi-currency invoices against single party account"
},
{
"default": "0",
"description": "Split Early Payment Discount Loss into Income and Tax Loss",
"fieldname": "book_tax_discount_loss",
"fieldtype": "Check",
"label": "Book Tax Loss on Early Payment Discount"
},
{
"default": "0",
"fieldname": "show_taxes_as_table_in_print",
"fieldtype": "Check",
"label": "Show Taxes as Table in Print"
},
{
"default": "frankfurter.app",
"fieldname": "service_provider",
"fieldtype": "Select",
"label": "Service Provider",
"options": "frankfurter.app\nexchangerate.host"
},
{
"depends_on": "eval:doc.service_provider == \"exchangerate.host\"",
"description": "Access Key is mandatory for exchangerate.host",
"fieldname": "access_key",
"fieldtype": "Data",
"label": "Access Key"
},
{
"depends_on": "eval:doc.service_provider == \"exchangerate.host\"",
"fieldname": "validate_access_key",
"fieldtype": "Button",
"label": "Validate Access Key"
},
{
"fieldname": "column_break_eiyok",
"fieldtype": "Column Break"
}
],
"icon": "icon-cog",
@@ -283,7 +335,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2021-10-11 17:42:36.427699",
"modified": "2023-10-07 14:20:01.779208",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",

View File

@@ -8,12 +8,43 @@ import frappe
from frappe import _
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
from frappe.model.document import Document
from frappe.utils import cint
from frappe.utils import cint, nowdate
from erpnext.stock.utils import check_pending_reposting
class AccountsSettings(Document):
@frappe.whitelist()
def validate_access_key(self):
if self.service_provider == "exchangerate.host":
if not self.access_key:
frappe.throw(_("Access Key is required for exchangerate.host"))
else:
import requests
# Validate access key
api_url = "https://api.exchangerate.host/convert"
response = requests.get(
api_url,
params={
"access_key": self.access_key,
"transaction_date": nowdate(),
"amount": 1,
"from": "USD",
"to": "INR",
},
)
# exchangerate.host return 200 for all requests. Can't rely on it to raise exception
if not response.json()["success"]:
frappe.throw(
title=_("Service Provider Error"),
msg=_("Currency exchange rate serivce provider: {0} returned Error. {1}").format(
frappe.bold(self.service_provider), response.json()
),
exc=frappe.ValidationError,
)
frappe.msgprint(msg=_("Success"), title=_("Access Key Validation"))
def on_update(self):
frappe.clear_cache()

View File

@@ -56,7 +56,7 @@ class BankClearance(Document):
select
"Payment Entry" as payment_document, name as payment_entry,
reference_no as cheque_number, reference_date as cheque_date,
if(paid_from=%(account)s, paid_amount, 0) as credit,
if(paid_from=%(account)s, paid_amount + total_taxes_and_charges, 0) as credit,
if(paid_from=%(account)s, 0, received_amount) as debit,
posting_date, ifnull(party,if(paid_from=%(account)s,paid_to,paid_from)) as against_account, clearance_date,
if(paid_to=%(account)s, paid_to_account_currency, paid_from_account_currency) as account_currency

View File

@@ -43,20 +43,13 @@ frappe.ui.form.on('Bank Guarantee', {
reference_docname: function(frm) {
if (frm.doc.reference_docname && frm.doc.reference_doctype) {
let fields_to_fetch = ["grand_total"];
let party_field = frm.doc.reference_doctype == "Sales Order" ? "customer" : "supplier";
if (frm.doc.reference_doctype == "Sales Order") {
fields_to_fetch.push("project");
}
fields_to_fetch.push(party_field);
frappe.call({
method: "erpnext.accounts.doctype.bank_guarantee.bank_guarantee.get_vouchar_detials",
method: "erpnext.accounts.doctype.bank_guarantee.bank_guarantee.get_voucher_details",
args: {
"column_list": fields_to_fetch,
"doctype": frm.doc.reference_doctype,
"docname": frm.doc.reference_docname
"bank_guarantee_type": frm.doc.bg_type,
"reference_name": frm.doc.reference_docname
},
callback: function(r) {
if (r.message) {

View File

@@ -2,11 +2,8 @@
# For license information, please see license.txt
import json
import frappe
from frappe import _
from frappe.desk.search import sanitize_searchfield
from frappe.model.document import Document
@@ -25,14 +22,18 @@ class BankGuarantee(Document):
@frappe.whitelist()
def get_vouchar_detials(column_list, doctype, docname):
column_list = json.loads(column_list)
for col in column_list:
sanitize_searchfield(col)
return frappe.db.sql(
""" select {columns} from `tab{doctype}` where name=%s""".format(
columns=", ".join(column_list), doctype=doctype
),
docname,
as_dict=1,
)[0]
def get_voucher_details(bank_guarantee_type: str, reference_name: str):
if not isinstance(reference_name, str):
raise TypeError("reference_name must be a string")
fields_to_fetch = ["grand_total"]
if bank_guarantee_type == "Receiving":
doctype = "Sales Order"
fields_to_fetch.append("customer")
fields_to_fetch.append("project")
else:
doctype = "Purchase Order"
fields_to_fetch.append("supplier")
return frappe.db.get_value(doctype, reference_name, fields_to_fetch, as_dict=True)

View File

@@ -299,7 +299,7 @@ def reconcile_vouchers(bank_transaction_name, vouchers):
dict(
account=account, voucher_type=voucher["payment_doctype"], voucher_no=voucher["payment_name"]
),
["credit", "debit"],
["credit_in_account_currency as credit", "debit_in_account_currency as debit"],
as_dict=1,
)
gl_amount, transaction_amount = (

View File

@@ -138,7 +138,7 @@ def get_paid_amount(payment_entry, currency, bank_account):
)
elif doc.payment_type == "Pay":
paid_amount_field = (
"paid_amount" if doc.paid_to_account_currency == currency else "base_paid_amount"
"paid_amount" if doc.paid_from_account_currency == currency else "base_paid_amount"
)
return frappe.db.get_value(

View File

@@ -169,5 +169,6 @@ def auto_create_fiscal_year():
def get_from_and_to_date(fiscal_year):
fields = ["year_start_date as from_date", "year_end_date as to_date"]
return frappe.db.get_value("Fiscal Year", fiscal_year, fields, as_dict=1)
fields = ["year_start_date", "year_end_date"]
cached_results = frappe.get_cached_value("Fiscal Year", fiscal_year, fields, as_dict=1)
return dict(from_date=cached_results.year_start_date, to_date=cached_results.year_end_date)

View File

@@ -43,7 +43,7 @@ class GLEntry(Document):
self.validate_and_set_fiscal_year()
self.pl_must_have_cost_center()
if not self.flags.from_repost:
if not self.flags.from_repost and self.voucher_type != "Period Closing Voucher":
self.check_mandatory()
self.validate_cost_center()
self.check_pl_account()
@@ -52,7 +52,7 @@ class GLEntry(Document):
def on_update(self):
adv_adj = self.flags.adv_adj
if not self.flags.from_repost:
if not self.flags.from_repost and self.voucher_type != "Period Closing Voucher":
self.validate_account_details(adv_adj)
self.validate_dimensions_for_pl_and_bs()
self.validate_allowed_dimensions()
@@ -358,7 +358,8 @@ def update_outstanding_amt(
if against_voucher_type in ["Sales Invoice", "Purchase Invoice", "Fees"]:
ref_doc = frappe.get_doc(against_voucher_type, against_voucher)
# Didn't use db_set for optimisation purpose
bal = flt(bal, frappe.get_precision(against_voucher_type, "outstanding_amount"))
# Didn't use db_set for optimization purpose
ref_doc.outstanding_amount = bal
frappe.db.set_value(against_voucher_type, against_voucher, "outstanding_amount", bal)

View File

@@ -8,7 +8,7 @@ frappe.provide("erpnext.journal_entry");
frappe.ui.form.on("Journal Entry", {
setup: function(frm) {
frm.add_fetch("bank_account", "account", "account");
frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice'];
frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice', 'Asset', 'Asset Movement'];
},
refresh: function(frm) {
@@ -149,22 +149,6 @@ frappe.ui.form.on("Journal Entry", {
}
});
}
else if(frm.doc.voucher_type=="Opening Entry") {
return frappe.call({
type:"GET",
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_opening_accounts",
args: {
"company": frm.doc.company
},
callback: function(r) {
frappe.model.clear_table(frm.doc, "accounts");
if(r.message) {
update_jv_details(frm.doc, r.message);
}
cur_frm.set_value("is_opening", "Yes");
}
});
}
}
},
@@ -189,8 +173,8 @@ frappe.ui.form.on("Journal Entry", {
var update_jv_details = function(doc, r) {
$.each(r, function(i, d) {
var row = frappe.model.add_child(doc, "Journal Entry Account", "accounts");
row.account = d.account;
row.balance = d.balance;
frappe.model.set_value(row.doctype, row.name, "account", d.account)
frappe.model.set_value(row.doctype, row.name, "balance", d.balance)
});
refresh_field("accounts");
}

View File

@@ -137,7 +137,8 @@
"fieldname": "finance_book",
"fieldtype": "Link",
"label": "Finance Book",
"options": "Finance Book"
"options": "Finance Book",
"read_only": 1
},
{
"fieldname": "2_add_edit_gl_entries",
@@ -538,7 +539,7 @@
"idx": 176,
"is_submittable": 1,
"links": [],
"modified": "2022-04-06 17:18:46.865259",
"modified": "2022-06-23 22:01:32.348337",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry",

View File

@@ -25,7 +25,10 @@ from erpnext.accounts.utils import (
get_stock_and_account_balance,
)
from erpnext.controllers.accounts_controller import AccountsController
from erpnext.hr.doctype.expense_claim.expense_claim import update_reimbursed_amount
from erpnext.hr.doctype.expense_claim.expense_claim import (
get_outstanding_amount_for_claim,
update_reimbursed_amount,
)
class StockAccountInvalidTransaction(frappe.ValidationError):
@@ -72,6 +75,7 @@ class JournalEntry(AccountsController):
self.validate_empty_accounts_table()
self.set_account_and_party_balance()
self.validate_inter_company_accounts()
self.validate_depr_entry_voucher_type()
if self.docstatus == 0:
self.apply_tax_withholding()
@@ -84,6 +88,7 @@ class JournalEntry(AccountsController):
self.check_credit_limit()
self.make_gl_entries()
self.update_advance_paid()
self.update_asset_value()
self.update_expense_claim()
self.update_inter_company_jv()
self.update_invoice_discounting()
@@ -130,6 +135,13 @@ class JournalEntry(AccountsController):
if self.total_credit != doc.total_debit or self.total_debit != doc.total_credit:
frappe.throw(_("Total Credit/ Debit Amount should be same as linked Journal Entry"))
def validate_depr_entry_voucher_type(self):
if (
any(d.account_type == "Depreciation" for d in self.get("accounts"))
and self.voucher_type != "Depreciation Entry"
):
frappe.throw(_("Journal Entry type should be set as Depreciation Entry for asset depreciation"))
def validate_stock_accounts(self):
stock_accounts = get_stock_accounts(self.company, self.doctype, self.name)
for account in stock_accounts:
@@ -191,7 +203,9 @@ class JournalEntry(AccountsController):
}
)
tax_withholding_details = get_party_tax_withholding_details(inv, self.tax_withholding_category)
tax_withholding_details, advance_taxes, voucher_wise_amount = get_party_tax_withholding_details(
inv, self.tax_withholding_category
)
if not tax_withholding_details:
return
@@ -230,6 +244,34 @@ class JournalEntry(AccountsController):
for d in to_remove:
self.remove(d)
def update_asset_value(self):
if self.flags.planned_depr_entry or self.voucher_type != "Depreciation Entry":
return
for d in self.get("accounts"):
if (
d.reference_type == "Asset"
and d.reference_name
and d.account_type == "Depreciation"
and d.debit
):
asset = frappe.get_doc("Asset", d.reference_name)
if asset.calculate_depreciation:
fb_idx = 1
if self.finance_book:
for fb_row in asset.get("finance_books"):
if fb_row.finance_book == self.finance_book:
fb_idx = fb_row.idx
break
fb_row = asset.get("finance_books")[fb_idx - 1]
fb_row.value_after_depreciation -= d.debit
fb_row.db_update()
else:
asset.db_set("value_after_depreciation", asset.value_after_depreciation - d.debit)
asset.set_status()
def update_inter_company_jv(self):
if (
self.voucher_type == "Inter Company Journal Entry"
@@ -289,18 +331,44 @@ class JournalEntry(AccountsController):
def unlink_asset_reference(self):
for d in self.get("accounts"):
if d.reference_type == "Asset" and d.reference_name:
if (
self.voucher_type == "Depreciation Entry"
and d.reference_type == "Asset"
and d.reference_name
and d.account_type == "Depreciation"
and d.debit
):
asset = frappe.get_doc("Asset", d.reference_name)
for s in asset.get("schedules"):
if s.journal_entry == self.name:
s.db_set("journal_entry", None)
idx = cint(s.finance_book_id) or 1
finance_books = asset.get("finance_books")[idx - 1]
finance_books.value_after_depreciation += s.depreciation_amount
finance_books.db_update()
if asset.calculate_depreciation:
fb_idx = None
for s in asset.get("schedules"):
if s.journal_entry == self.name:
s.db_set("journal_entry", None)
fb_idx = cint(s.finance_book_id) or 1
break
if not fb_idx:
fb_idx = 1
if self.finance_book:
for fb_row in asset.get("finance_books"):
if fb_row.finance_book == self.finance_book:
fb_idx = fb_row.idx
break
fb_row = asset.get("finance_books")[fb_idx - 1]
fb_row.value_after_depreciation += d.debit
fb_row.db_update()
else:
asset.db_set("value_after_depreciation", asset.value_after_depreciation + d.debit)
asset.set_status()
elif self.voucher_type == "Journal Entry" and d.reference_type == "Asset" and d.reference_name:
journal_entry_for_scrap = frappe.db.get_value(
"Asset", d.reference_name, "journal_entry_for_scrap"
)
asset.set_status()
if journal_entry_for_scrap == self.name:
frappe.throw(
_("Journal Entry for Asset scrapping cannot be cancelled. Please restore the Asset.")
)
def unlink_inter_company_jv(self):
if (
@@ -332,6 +400,15 @@ class JournalEntry(AccountsController):
d.idx, d.account
)
)
elif (
d.party_type
and frappe.db.get_value("Party Type", d.party_type, "account_type") != account_type
):
frappe.throw(
_("Row {0}: Account {1} and Party Type {2} have different account types").format(
d.idx, d.account, d.party_type
)
)
def check_credit_limit(self):
customers = list(
@@ -935,15 +1012,12 @@ class JournalEntry(AccountsController):
def validate_expense_claim(self):
for d in self.accounts:
if d.reference_type == "Expense Claim":
sanctioned_amount, reimbursed_amount = frappe.db.get_value(
"Expense Claim", d.reference_name, ("total_sanctioned_amount", "total_amount_reimbursed")
)
pending_amount = flt(sanctioned_amount) - flt(reimbursed_amount)
if d.debit > pending_amount:
outstanding_amt = get_outstanding_amount_for_claim(d.reference_name)
if d.debit > outstanding_amt:
frappe.throw(
_(
"Row No {0}: Amount cannot be greater than Pending Amount against Expense Claim {1}. Pending Amount is {2}"
).format(d.idx, d.reference_name, pending_amount)
"Row No {0}: Amount cannot be greater than the Outstanding Amount against Expense Claim {1}. Outstanding Amount is {2}"
).format(d.idx, d.reference_name, outstanding_amt)
)
def validate_credit_debit_note(self):
@@ -1192,24 +1266,6 @@ def get_payment_entry(ref_doc, args):
return je if args.get("journal_entry") else je.as_dict()
@frappe.whitelist()
def get_opening_accounts(company):
"""get all balance sheet accounts for opening entry"""
accounts = frappe.db.sql_list(
"""select
name from tabAccount
where
is_group=0 and report_type='Balance Sheet' and company={0} and
name not in (select distinct account from tabWarehouse where
account is not null and account != '')
order by name asc""".format(
frappe.db.escape(company)
)
)
return [{"account": a, "balance": get_balance_on(a)} for a in accounts]
@frappe.whitelist()
@frappe.validate_and_sanitize_search_inputs
def get_against_jv(doctype, txt, searchfield, start, page_len, filters):

View File

@@ -2,7 +2,22 @@
// For license information, please see license.txt
frappe.ui.form.on("Journal Entry Template", {
setup: function(frm) {
onload: function(frm) {
if(frm.is_new()) {
frappe.call({
type: "GET",
method: "erpnext.accounts.doctype.journal_entry_template.journal_entry_template.get_naming_series",
callback: function(r){
if(r.message) {
frm.set_df_property("naming_series", "options", r.message.split("\n"));
frm.set_value("naming_series", r.message.split("\n")[0]);
frm.refresh_field("naming_series");
}
}
});
}
},
refresh: function(frm) {
frappe.model.set_default_values(frm.doc);
frm.set_query("account" ,"accounts", function(){
@@ -19,18 +34,6 @@ frappe.ui.form.on("Journal Entry Template", {
return { filters: filters };
});
frappe.call({
type: "GET",
method: "erpnext.accounts.doctype.journal_entry_template.journal_entry_template.get_naming_series",
callback: function(r){
if(r.message){
frm.set_df_property("naming_series", "options", r.message.split("\n"));
frm.set_value("naming_series", r.message.split("\n")[0]);
frm.refresh_field("naming_series");
}
}
});
},
voucher_type: function(frm) {
var add_accounts = function(doc, r) {
@@ -45,21 +48,6 @@ frappe.ui.form.on("Journal Entry Template", {
frm.trigger("clear_child");
switch(frm.doc.voucher_type){
case "Opening Entry":
frm.set_value("is_opening", "Yes");
frappe.call({
type:"GET",
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_opening_accounts",
args: {
"company": frm.doc.company
},
callback: function(r) {
if(r.message) {
add_accounts(frm.doc, r.message);
}
}
});
break;
case "Bank Entry":
case "Cash Entry":
frappe.call({

View File

@@ -20,7 +20,6 @@ frappe.ui.form.on('Opening Invoice Creation Tool', {
frm.dashboard.reset();
frm.doc.import_in_progress = true;
}
if (data.user != frappe.session.user) return;
if (data.count == data.total) {
setTimeout((title) => {
frm.doc.import_in_progress = false;
@@ -49,7 +48,15 @@ frappe.ui.form.on('Opening Invoice Creation Tool', {
doc: frm.doc,
btn: $(btn_primary),
method: "make_invoices",
freeze_message: __("Creating {0} Invoice", [frm.doc.invoice_type])
freeze: 1,
freeze_message: __("Creating {0} Invoice", [frm.doc.invoice_type]),
callback: function(r) {
if (r.message.length == 1) {
frappe.msgprint(__("{0} Invoice created successfully.", [frm.doc.invoice_type]));
} else if (r.message.length < 50) {
frappe.msgprint(__("{0} Invoices created successfully.", [frm.doc.invoice_type]));
}
}
});
});

View File

@@ -271,10 +271,10 @@ def publish(index, total, doctype):
dict(
title=_("Opening Invoice Creation In Progress"),
message=_("Creating {} out of {} {}").format(index + 1, total, doctype),
user=frappe.session.user,
count=index + 1,
total=total,
),
user=frappe.session.user,
)

View File

@@ -256,8 +256,6 @@ frappe.ui.form.on('Payment Entry', {
frm.set_currency_labels(["total_amount", "outstanding_amount", "allocated_amount"],
party_account_currency, "references");
frm.set_currency_labels(["amount"], company_currency, "deductions");
cur_frm.set_df_property("source_exchange_rate", "description",
("1 " + frm.doc.paid_from_account_currency + " = [?] " + company_currency));
@@ -625,7 +623,7 @@ frappe.ui.form.on('Payment Entry', {
frm.events.set_unallocated_amount(frm);
},
get_outstanding_invoice: function(frm) {
get_outstanding_invoices_or_orders: function(frm, get_outstanding_invoices, get_orders_to_be_billed) {
const today = frappe.datetime.get_today();
const fields = [
{fieldtype:"Section Break", label: __("Posting Date")},
@@ -655,12 +653,29 @@ frappe.ui.form.on('Payment Entry', {
{fieldtype:"Check", label: __("Allocate Payment Amount"), fieldname:"allocate_payment_amount", default:1},
];
let btn_text = "";
if (get_outstanding_invoices) {
btn_text = "Get Outstanding Invoices";
}
else if (get_orders_to_be_billed) {
btn_text = "Get Outstanding Orders";
}
frappe.prompt(fields, function(filters){
frappe.flags.allocate_payment_amount = true;
frm.events.validate_filters_data(frm, filters);
frm.doc.cost_center = filters.cost_center;
frm.events.get_outstanding_documents(frm, filters);
}, __("Filters"), __("Get Outstanding Documents"));
frm.events.get_outstanding_documents(frm, filters, get_outstanding_invoices, get_orders_to_be_billed);
}, __("Filters"), __(btn_text));
},
get_outstanding_invoices: function(frm) {
frm.events.get_outstanding_invoices_or_orders(frm, true, false);
},
get_outstanding_orders: function(frm) {
frm.events.get_outstanding_invoices_or_orders(frm, false, true);
},
validate_filters_data: function(frm, filters) {
@@ -686,7 +701,7 @@ frappe.ui.form.on('Payment Entry', {
}
},
get_outstanding_documents: function(frm, filters) {
get_outstanding_documents: function(frm, filters, get_outstanding_invoices, get_orders_to_be_billed) {
frm.clear_table("references");
if(!frm.doc.party) {
@@ -710,6 +725,13 @@ frappe.ui.form.on('Payment Entry', {
args[key] = filters[key];
}
if (get_outstanding_invoices) {
args["get_outstanding_invoices"] = true;
}
else if (get_orders_to_be_billed) {
args["get_orders_to_be_billed"] = true;
}
frappe.flags.allocate_payment_amount = filters['allocate_payment_amount'];
return frappe.call({
@@ -1111,7 +1133,7 @@ frappe.ui.form.on('Payment Entry', {
$.each(tax_fields, function(i, fieldname) { tax[fieldname] = 0.0; });
frm.doc.paid_amount_after_tax = frm.doc.paid_amount;
frm.doc.paid_amount_after_tax = frm.doc.base_paid_amount;
});
},
@@ -1202,7 +1224,7 @@ frappe.ui.form.on('Payment Entry', {
}
cumulated_tax_fraction += tax.tax_fraction_for_current_item;
frm.doc.paid_amount_after_tax = flt(frm.doc.paid_amount/(1+cumulated_tax_fraction))
frm.doc.paid_amount_after_tax = flt(frm.doc.base_paid_amount/(1+cumulated_tax_fraction))
});
},
@@ -1234,6 +1256,7 @@ frappe.ui.form.on('Payment Entry', {
frm.doc.total_taxes_and_charges = 0.0;
frm.doc.base_total_taxes_and_charges = 0.0;
let company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
let actual_tax_dict = {};
// maintain actual tax rate based on idx
@@ -1254,8 +1277,8 @@ frappe.ui.form.on('Payment Entry', {
}
}
tax.tax_amount = current_tax_amount;
tax.base_tax_amount = tax.tax_amount * frm.doc.source_exchange_rate;
// tax accounts are only in company currency
tax.base_tax_amount = current_tax_amount;
current_tax_amount *= (tax.add_deduct_tax == "Deduct") ? -1.0 : 1.0;
if(i==0) {
@@ -1264,9 +1287,29 @@ frappe.ui.form.on('Payment Entry', {
tax.total = flt(frm.doc["taxes"][i-1].total + current_tax_amount, precision("total", tax));
}
tax.base_total = tax.total * frm.doc.source_exchange_rate;
frm.doc.total_taxes_and_charges += current_tax_amount;
frm.doc.base_total_taxes_and_charges += current_tax_amount * frm.doc.source_exchange_rate;
// tac accounts are only in company currency
tax.base_total = tax.total
// calculate total taxes and base total taxes
if(frm.doc.payment_type == "Pay") {
// tax accounts only have company currency
if(tax.currency != frm.doc.paid_to_account_currency) {
//total_taxes_and_charges has the target currency. so using target conversion rate
frm.doc.total_taxes_and_charges += flt(current_tax_amount / frm.doc.target_exchange_rate);
} else {
frm.doc.total_taxes_and_charges += current_tax_amount;
}
} else if(frm.doc.payment_type == "Receive") {
if(tax.currency != frm.doc.paid_from_account_currency) {
//total_taxes_and_charges has the target currency. so using source conversion rate
frm.doc.total_taxes_and_charges += flt(current_tax_amount / frm.doc.source_exchange_rate);
} else {
frm.doc.total_taxes_and_charges += current_tax_amount;
}
}
frm.doc.base_total_taxes_and_charges += tax.base_tax_amount;
frm.refresh_field('taxes');
frm.refresh_field('total_taxes_and_charges');

View File

@@ -48,7 +48,8 @@
"base_received_amount",
"base_received_amount_after_tax",
"section_break_14",
"get_outstanding_invoice",
"get_outstanding_invoices",
"get_outstanding_orders",
"references",
"section_break_34",
"total_allocated_amount",
@@ -353,12 +354,6 @@
"fieldtype": "Section Break",
"label": "Reference"
},
{
"depends_on": "eval:doc.docstatus==0",
"fieldname": "get_outstanding_invoice",
"fieldtype": "Button",
"label": "Get Outstanding Invoice"
},
{
"fieldname": "references",
"fieldtype": "Table",
@@ -726,12 +721,24 @@
"fieldname": "section_break_60",
"fieldtype": "Section Break",
"hide_border": 1
},
{
"depends_on": "eval:doc.docstatus==0",
"fieldname": "get_outstanding_invoices",
"fieldtype": "Button",
"label": "Get Outstanding Invoices"
},
{
"depends_on": "eval:doc.docstatus==0",
"fieldname": "get_outstanding_orders",
"fieldtype": "Button",
"label": "Get Outstanding Orders"
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2022-02-23 20:08:39.559814",
"modified": "2023-06-19 11:38:04.387219",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry",

View File

@@ -7,7 +7,16 @@ from functools import reduce
import frappe
from frappe import ValidationError, _, scrub, throw
from frappe.utils import cint, comma_or, flt, getdate, nowdate
from frappe.utils import (
cint,
comma_and,
comma_or,
flt,
fmt_money,
get_link_to_form,
getdate,
nowdate,
)
from six import iteritems, string_types
import erpnext
@@ -30,7 +39,10 @@ from erpnext.controllers.accounts_controller import (
get_supplier_block_status,
validate_taxes_and_charges,
)
from erpnext.hr.doctype.expense_claim.expense_claim import update_reimbursed_amount
from erpnext.hr.doctype.expense_claim.expense_claim import (
get_outstanding_amount_for_claim,
update_reimbursed_amount,
)
from erpnext.setup.utils import get_exchange_rate
@@ -64,7 +76,6 @@ class PaymentEntry(AccountsController):
self.set_missing_values()
self.validate_payment_type()
self.validate_party_details()
self.validate_bank_accounts()
self.set_exchange_rate()
self.validate_mandatory()
self.validate_reference_documents()
@@ -148,26 +159,99 @@ class PaymentEntry(AccountsController):
)
def validate_allocated_amount(self):
for d in self.get("references"):
if (flt(d.allocated_amount)) > 0:
if flt(d.allocated_amount) > flt(d.outstanding_amount):
if self.payment_type == "Internal Transfer":
return
if self.party_type in ("Customer", "Supplier"):
self.validate_allocated_amount_with_latest_data()
else:
fail_message = _("Row #{0}: Allocated Amount cannot be greater than outstanding amount.")
for d in self.get("references"):
if (flt(d.allocated_amount)) > 0 and flt(d.allocated_amount) > flt(d.outstanding_amount):
frappe.throw(fail_message.format(d.idx))
# Check for negative outstanding invoices as well
if flt(d.allocated_amount) < 0 and flt(d.allocated_amount) < flt(d.outstanding_amount):
frappe.throw(fail_message.format(d.idx))
def validate_allocated_amount_with_latest_data(self):
if self.references:
latest_references = get_outstanding_reference_documents(
{
"posting_date": self.posting_date,
"company": self.company,
"party_type": self.party_type,
"payment_type": self.payment_type,
"party": self.party,
"party_account": self.paid_from if self.payment_type == "Receive" else self.paid_to,
"get_outstanding_invoices": True,
"get_orders_to_be_billed": True,
}
)
# Group latest_references by (voucher_type, voucher_no)
latest_lookup = {}
for d in latest_references:
d = frappe._dict(d)
latest_lookup.update({(d.voucher_type, d.voucher_no): d})
for d in self.get("references"):
latest = latest_lookup.get((d.reference_doctype, d.reference_name))
# The reference has already been fully paid
if not latest:
frappe.throw(
_("Row #{0}: Allocated Amount cannot be greater than outstanding amount.").format(d.idx)
_("{0} {1} has already been fully paid.").format(_(d.reference_doctype), d.reference_name)
)
# The reference has already been partly paid
elif latest.outstanding_amount < latest.invoice_amount and flt(
d.outstanding_amount, d.precision("outstanding_amount")
) != flt(latest.outstanding_amount, d.precision("outstanding_amount")):
frappe.throw(
_(
"{0} {1} has already been partly paid. Please use the 'Get Outstanding Invoice' or the 'Get Outstanding Orders' button to get the latest outstanding amounts."
).format(_(d.reference_doctype), d.reference_name)
)
# Check for negative outstanding invoices as well
if flt(d.allocated_amount) < 0:
if flt(d.allocated_amount) < flt(d.outstanding_amount):
frappe.throw(
_("Row #{0}: Allocated Amount cannot be greater than outstanding amount.").format(d.idx)
)
fail_message = _("Row #{0}: Allocated Amount cannot be greater than outstanding amount.")
if (flt(d.allocated_amount)) > 0 and flt(d.allocated_amount) > flt(latest.outstanding_amount):
frappe.throw(fail_message.format(d.idx))
# Check for negative outstanding invoices as well
if flt(d.allocated_amount) < 0 and flt(d.allocated_amount) < flt(latest.outstanding_amount):
frappe.throw(fail_message.format(d.idx))
def delink_advance_entry_references(self):
for reference in self.references:
if reference.reference_doctype in ("Sales Invoice", "Purchase Invoice"):
doc = frappe.get_doc(reference.reference_doctype, reference.reference_name)
repost_required = False
for adv_reference in doc.get("advances"):
if adv_reference.exchange_gain_loss != 0:
repost_required = True
break
if repost_required:
for item in doc.get("items"):
if item.get("enable_deferred_revenue") or item.get("enable_deferred_expense"):
frappe.msgprint(
_(
"Linked Invoice {0} has Exchange Gain/Loss GL entries due to this Payment. Submit a Journal manually to reverse its effects."
).format(get_link_to_form(doc.doctype, doc.name))
)
repost_required = False
doc.delink_advance_entries(self.name)
if repost_required:
doc.reload()
doc.docstatus = 2
doc.make_gl_entries()
doc.docstatus = 1
doc.make_gl_entries()
def set_missing_values(self):
if self.payment_type == "Internal Transfer":
for field in (
@@ -245,24 +329,7 @@ class PaymentEntry(AccountsController):
def validate_party_details(self):
if self.party:
if not frappe.db.exists(self.party_type, self.party):
frappe.throw(_("Invalid {0}: {1}").format(self.party_type, self.party))
if self.party_account and self.party_type in ("Customer", "Supplier"):
self.validate_account_type(
self.party_account, [erpnext.get_party_account_type(self.party_type)]
)
def validate_bank_accounts(self):
if self.payment_type in ("Pay", "Internal Transfer"):
self.validate_account_type(self.paid_from, ["Bank", "Cash"])
if self.payment_type in ("Receive", "Internal Transfer"):
self.validate_account_type(self.paid_to, ["Bank", "Cash"])
def validate_account_type(self, account, account_types):
account_type = frappe.db.get_value("Account", account, "account_type")
# if account_type not in account_types:
# frappe.throw(_("Account Type for {0} must be {1}").format(account, comma_or(account_types)))
frappe.throw(_("{0} {1} does not exist").format(_(self.party_type), self.party))
def set_exchange_rate(self, ref_doc=None):
self.set_source_exchange_rate(ref_doc)
@@ -302,7 +369,7 @@ class PaymentEntry(AccountsController):
def validate_reference_documents(self):
if self.party_type == "Student":
valid_reference_doctypes = "Fees"
valid_reference_doctypes = ("Fees", "Journal Entry")
elif self.party_type == "Customer":
valid_reference_doctypes = ("Sales Order", "Sales Invoice", "Journal Entry", "Dunning")
elif self.party_type == "Supplier":
@@ -319,7 +386,9 @@ class PaymentEntry(AccountsController):
continue
if d.reference_doctype not in valid_reference_doctypes:
frappe.throw(
_("Reference Doctype must be one of {0}").format(comma_or(valid_reference_doctypes))
_("Reference Doctype must be one of {0}").format(
comma_or((_(d) for d in valid_reference_doctypes))
)
)
elif d.reference_name:
@@ -332,7 +401,7 @@ class PaymentEntry(AccountsController):
if self.party != ref_doc.get(scrub(self.party_type)):
frappe.throw(
_("{0} {1} is not associated with {2} {3}").format(
d.reference_doctype, d.reference_name, self.party_type, self.party
_(d.reference_doctype), d.reference_name, _(self.party_type), self.party
)
)
else:
@@ -353,12 +422,18 @@ class PaymentEntry(AccountsController):
if ref_party_account != self.party_account:
frappe.throw(
_("{0} {1} is associated with {2}, but Party Account is {3}").format(
d.reference_doctype, d.reference_name, ref_party_account, self.party_account
_(d.reference_doctype), d.reference_name, ref_party_account, self.party_account
)
)
if ref_doc.doctype == "Purchase Invoice" and ref_doc.get("on_hold"):
frappe.throw(
_("{0} {1} is on hold").format(_(d.reference_doctype), d.reference_name),
title=_("Invalid Purchase Invoice"),
)
if ref_doc.docstatus != 1:
frappe.throw(_("{0} {1} must be submitted").format(d.reference_doctype, d.reference_name))
frappe.throw(_("{0} {1} must be submitted").format(_(d.reference_doctype), d.reference_name))
def validate_paid_invoices(self):
no_oustanding_refs = {}
@@ -374,14 +449,13 @@ class PaymentEntry(AccountsController):
if outstanding_amount <= 0 and not is_return:
no_oustanding_refs.setdefault(d.reference_doctype, []).append(d)
for k, v in no_oustanding_refs.items():
for reference_doctype, references in no_oustanding_refs.items():
frappe.msgprint(
_(
"{} - {} now have {} as they had no outstanding amount left before submitting the Payment Entry."
"References {0} of type {1} had no outstanding amount left before submitting the Payment Entry. Now they have a negative outstanding amount."
).format(
_(k),
frappe.bold(", ".join(d.reference_name for d in v)),
frappe.bold(_("negative outstanding amount")),
frappe.bold(comma_and((d.reference_name for d in references))),
_(reference_doctype),
)
+ "<br><br>"
+ _("If this is undesirable please cancel the corresponding Payment Entry."),
@@ -416,7 +490,7 @@ class PaymentEntry(AccountsController):
if not valid:
frappe.throw(
_("Against Journal Entry {0} does not have any unmatched {1} entry").format(
d.reference_name, dr_or_cr
d.reference_name, _(dr_or_cr)
)
)
@@ -426,7 +500,7 @@ class PaymentEntry(AccountsController):
for ref in self.get("references"):
if ref.payment_term and ref.reference_name:
key = (ref.payment_term, ref.reference_name)
key = (ref.payment_term, ref.reference_name, ref.reference_doctype)
invoice_payment_amount_map.setdefault(key, 0.0)
invoice_payment_amount_map[key] += ref.allocated_amount
@@ -434,20 +508,37 @@ class PaymentEntry(AccountsController):
payment_schedule = frappe.get_all(
"Payment Schedule",
filters={"parent": ref.reference_name},
fields=["paid_amount", "payment_amount", "payment_term", "discount", "outstanding"],
fields=[
"paid_amount",
"payment_amount",
"payment_term",
"discount",
"outstanding",
"discount_type",
],
)
for term in payment_schedule:
invoice_key = (term.payment_term, ref.reference_name)
invoice_key = (term.payment_term, ref.reference_name, ref.reference_doctype)
invoice_paid_amount_map.setdefault(invoice_key, {})
invoice_paid_amount_map[invoice_key]["outstanding"] = term.outstanding
invoice_paid_amount_map[invoice_key]["discounted_amt"] = ref.total_amount * (
term.discount / 100
)
if not (term.discount_type and term.discount):
continue
if term.discount_type == "Percentage":
invoice_paid_amount_map[invoice_key]["discounted_amt"] = ref.total_amount * (
term.discount / 100
)
else:
invoice_paid_amount_map[invoice_key]["discounted_amt"] = term.discount
for idx, (key, allocated_amount) in enumerate(iteritems(invoice_payment_amount_map), 1):
if not invoice_paid_amount_map.get(key):
frappe.throw(_("Payment term {0} not used in {1}").format(key[0], key[1]))
allocated_amount = self.get_allocated_amount_in_transaction_currency(
allocated_amount, key[2], key[1]
)
outstanding = flt(invoice_paid_amount_map.get(key, {}).get("outstanding"))
discounted_amt = flt(invoice_paid_amount_map.get(key, {}).get("discounted_amt"))
@@ -466,7 +557,7 @@ class PaymentEntry(AccountsController):
if allocated_amount > outstanding:
frappe.throw(
_("Row #{0}: Cannot allocate more than {1} against payment term {2}").format(
idx, outstanding, key[0]
idx, fmt_money(outstanding), key[0]
)
)
@@ -482,6 +573,33 @@ class PaymentEntry(AccountsController):
(allocated_amount - discounted_amt, discounted_amt, allocated_amount, key[1], key[0]),
)
def get_allocated_amount_in_transaction_currency(
self, allocated_amount, reference_doctype, reference_docname
):
"""
Payment Entry could be in base currency while reference's payment schedule
is always in transaction currency.
E.g.
* SI with base=INR and currency=USD
* SI with payment schedule in USD
* PE in INR (accounting done in base currency)
"""
ref_currency, ref_exchange_rate = frappe.db.get_value(
reference_doctype, reference_docname, ["currency", "conversion_rate"]
)
is_single_currency = self.paid_from_account_currency == self.paid_to_account_currency
# PE in different currency
reference_is_multi_currency = self.paid_from_account_currency != ref_currency
if not (is_single_currency and reference_is_multi_currency):
return allocated_amount
allocated_amount = flt(
allocated_amount / ref_exchange_rate, self.precision("total_allocated_amount")
)
return allocated_amount
def set_status(self):
if self.docstatus == 2:
self.status = "Cancelled"
@@ -499,7 +617,9 @@ class PaymentEntry(AccountsController):
if not self.apply_tax_withholding_amount:
return
net_total = self.paid_amount
order_amount = self.get_order_net_total()
net_total = flt(order_amount) + flt(self.unallocated_amount)
# Adding args as purchase invoice to get TDS amount
args = frappe._dict(
@@ -544,6 +664,20 @@ class PaymentEntry(AccountsController):
for d in to_remove:
self.remove(d)
def get_order_net_total(self):
if self.party_type == "Supplier":
doctype = "Purchase Order"
else:
doctype = "Sales Order"
docnames = [d.reference_name for d in self.references if d.reference_doctype == doctype]
tax_withholding_net_total = frappe.db.get_value(
doctype, {"name": ["in", docnames]}, ["sum(base_net_total)"]
)
return tax_withholding_net_total
def apply_taxes(self):
self.initialize_taxes()
self.determine_exclusive_rate()
@@ -716,7 +850,7 @@ class PaymentEntry(AccountsController):
_("Cannot {0} {1} {2} without any negative outstanding invoice").format(
_(self.payment_type),
(_("to") if self.party_type == "Customer" else _("from")),
self.party_type,
_(self.party_type),
),
InvalidPaymentEntry,
)
@@ -724,7 +858,7 @@ class PaymentEntry(AccountsController):
elif paid_amount - additional_charges > total_negative_outstanding:
frappe.throw(
_("Paid Amount cannot be greater than total negative outstanding amount {0}").format(
total_negative_outstanding
fmt_money(total_negative_outstanding)
),
InvalidPaymentEntry,
)
@@ -935,6 +1069,13 @@ class PaymentEntry(AccountsController):
)
if not d.included_in_paid_amount:
if get_account_currency(payment_account) != self.company_currency:
if self.payment_type == "Receive":
exchange_rate = self.target_exchange_rate
elif self.payment_type in ["Pay", "Internal Transfer"]:
exchange_rate = self.source_exchange_rate
base_tax_amount = flt((tax_amount / exchange_rate), self.precision("paid_amount"))
gl_entries.append(
self.get_gl_dict(
{
@@ -1050,7 +1191,7 @@ class PaymentEntry(AccountsController):
for fieldname in tax_fields:
tax.set(fieldname, 0.0)
self.paid_amount_after_tax = self.paid_amount
self.paid_amount_after_tax = self.base_paid_amount
def determine_exclusive_rate(self):
if not any((cint(tax.included_in_paid_amount) for tax in self.get("taxes"))):
@@ -1069,7 +1210,7 @@ class PaymentEntry(AccountsController):
cumulated_tax_fraction += tax.tax_fraction_for_current_item
self.paid_amount_after_tax = flt(self.paid_amount / (1 + cumulated_tax_fraction))
self.paid_amount_after_tax = flt(self.base_paid_amount / (1 + cumulated_tax_fraction))
def calculate_taxes(self):
self.total_taxes_and_charges = 0.0
@@ -1092,7 +1233,7 @@ class PaymentEntry(AccountsController):
current_tax_amount += actual_tax_dict[tax.idx]
tax.tax_amount = current_tax_amount
tax.base_tax_amount = tax.tax_amount * self.source_exchange_rate
tax.base_tax_amount = current_tax_amount
if tax.add_deduct_tax == "Deduct":
current_tax_amount *= -1.0
@@ -1106,14 +1247,20 @@ class PaymentEntry(AccountsController):
self.get("taxes")[i - 1].total + current_tax_amount, self.precision("total", tax)
)
tax.base_total = tax.total * self.source_exchange_rate
tax.base_total = tax.total
if self.payment_type == "Pay":
self.base_total_taxes_and_charges += flt(current_tax_amount / self.source_exchange_rate)
self.total_taxes_and_charges += flt(current_tax_amount / self.target_exchange_rate)
else:
self.base_total_taxes_and_charges += flt(current_tax_amount / self.target_exchange_rate)
self.total_taxes_and_charges += flt(current_tax_amount / self.source_exchange_rate)
if tax.currency != self.paid_to_account_currency:
self.total_taxes_and_charges += flt(current_tax_amount / self.target_exchange_rate)
else:
self.total_taxes_and_charges += current_tax_amount
elif self.payment_type == "Receive":
if tax.currency != self.paid_from_account_currency:
self.total_taxes_and_charges += flt(current_tax_amount / self.source_exchange_rate)
else:
self.total_taxes_and_charges += current_tax_amount
self.base_total_taxes_and_charges += tax.base_tax_amount
if self.get("taxes"):
self.paid_amount_after_tax = self.get("taxes")[-1].base_total
@@ -1207,6 +1354,9 @@ def get_outstanding_reference_documents(args):
if args.get("party_type") == "Member":
return
if not args.get("get_outstanding_invoices") and not args.get("get_orders_to_be_billed"):
args["get_outstanding_invoices"] = True
# confirm that Supplier is not blocked
if args.get("party_type") == "Supplier":
supplier_status = get_supplier_block_status(args["party"])
@@ -1247,31 +1397,48 @@ def get_outstanding_reference_documents(args):
if args.get("company"):
condition += " and company = {0}".format(frappe.db.escape(args.get("company")))
outstanding_invoices = get_outstanding_invoices(
args.get("party_type"),
args.get("party"),
args.get("party_account"),
filters=args,
condition=condition,
)
outstanding_invoices = []
negative_outstanding_invoices = []
outstanding_invoices = split_invoices_based_on_payment_terms(outstanding_invoices)
if args.get("get_outstanding_invoices"):
outstanding_invoices = get_outstanding_invoices(
args.get("party_type"),
args.get("party"),
args.get("party_account"),
args.get("company"),
filters=args,
condition=condition,
)
for d in outstanding_invoices:
d["exchange_rate"] = 1
if party_account_currency != company_currency:
if d.voucher_type in ("Sales Invoice", "Purchase Invoice", "Expense Claim"):
d["exchange_rate"] = frappe.db.get_value(d.voucher_type, d.voucher_no, "conversion_rate")
elif d.voucher_type == "Journal Entry":
d["exchange_rate"] = get_exchange_rate(
party_account_currency, company_currency, d.posting_date
)
if d.voucher_type in ("Purchase Invoice"):
d["bill_no"] = frappe.db.get_value(d.voucher_type, d.voucher_no, "bill_no")
outstanding_invoices = split_invoices_based_on_payment_terms(outstanding_invoices)
for d in outstanding_invoices:
d["exchange_rate"] = 1
if party_account_currency != company_currency:
if d.voucher_type in ("Sales Invoice", "Purchase Invoice", "Expense Claim"):
d["exchange_rate"] = frappe.db.get_value(d.voucher_type, d.voucher_no, "conversion_rate")
elif d.voucher_type == "Journal Entry":
d["exchange_rate"] = get_exchange_rate(
party_account_currency, company_currency, d.posting_date
)
if d.voucher_type in ("Purchase Invoice"):
d["bill_no"] = frappe.db.get_value(d.voucher_type, d.voucher_no, "bill_no")
# Get negative outstanding sales /purchase invoices
negative_outstanding_invoices = []
if args.get("party_type") not in ["Student", "Employee"] and not args.get("voucher_no"):
negative_outstanding_invoices = get_negative_outstanding_invoices(
args.get("party_type"),
args.get("party"),
args.get("party_account"),
party_account_currency,
company_currency,
condition=condition,
)
# Get all SO / PO which are not fully billed or against which full advance not paid
orders_to_be_billed = []
if args.get("party_type") != "Student":
if args.get("get_orders_to_be_billed") and args.get("party_type") != "Student":
orders_to_be_billed = get_orders_to_be_billed(
args.get("posting_date"),
args.get("party_type"),
@@ -1282,25 +1449,22 @@ def get_outstanding_reference_documents(args):
filters=args,
)
# Get negative outstanding sales /purchase invoices
negative_outstanding_invoices = []
if args.get("party_type") not in ["Student", "Employee"] and not args.get("voucher_no"):
negative_outstanding_invoices = get_negative_outstanding_invoices(
args.get("party_type"),
args.get("party"),
args.get("party_account"),
party_account_currency,
company_currency,
condition=condition,
)
data = negative_outstanding_invoices + outstanding_invoices + orders_to_be_billed
if not data:
if args.get("get_outstanding_invoices") and args.get("get_orders_to_be_billed"):
ref_document_type = "invoices or orders"
elif args.get("get_outstanding_invoices"):
ref_document_type = "invoices"
elif args.get("get_orders_to_be_billed"):
ref_document_type = "orders"
frappe.msgprint(
_(
"No outstanding invoices found for the {0} {1} which qualify the filters you have specified."
).format(_(args.get("party_type")).lower(), frappe.bold(args.get("party")))
"No outstanding {0} found for the {1} {2} which qualify the filters you have specified."
).format(
_(ref_document_type), _(args.get("party_type")).lower(), frappe.bold(args.get("party"))
)
)
return data
@@ -1374,66 +1538,71 @@ def get_orders_to_be_billed(
cost_center=None,
filters=None,
):
voucher_type = None
if party_type == "Customer":
voucher_type = "Sales Order"
elif party_type == "Supplier":
voucher_type = "Purchase Order"
elif party_type == "Employee":
voucher_type = None
if not voucher_type:
return []
# Add cost center condition
if voucher_type:
doc = frappe.get_doc({"doctype": voucher_type})
condition = ""
if doc and hasattr(doc, "cost_center"):
condition = " and cost_center='%s'" % cost_center
doc = frappe.get_doc({"doctype": voucher_type})
condition = ""
if doc and hasattr(doc, "cost_center") and doc.cost_center:
condition = " and cost_center='%s'" % cost_center
orders = []
if voucher_type:
if party_account_currency == company_currency:
grand_total_field = "base_grand_total"
rounded_total_field = "base_rounded_total"
else:
grand_total_field = "grand_total"
rounded_total_field = "rounded_total"
if party_account_currency == company_currency:
grand_total_field = "base_grand_total"
rounded_total_field = "base_rounded_total"
else:
grand_total_field = "grand_total"
rounded_total_field = "rounded_total"
orders = frappe.db.sql(
"""
select
name as voucher_no,
if({rounded_total_field}, {rounded_total_field}, {grand_total_field}) as invoice_amount,
(if({rounded_total_field}, {rounded_total_field}, {grand_total_field}) - advance_paid) as outstanding_amount,
transaction_date as posting_date
from
`tab{voucher_type}`
where
{party_type} = %s
and docstatus = 1
and company = %s
and ifnull(status, "") != "Closed"
and if({rounded_total_field}, {rounded_total_field}, {grand_total_field}) > advance_paid
and abs(100 - per_billed) > 0.01
{condition}
order by
transaction_date, name
""".format(
**{
"rounded_total_field": rounded_total_field,
"grand_total_field": grand_total_field,
"voucher_type": voucher_type,
"party_type": scrub(party_type),
"condition": condition,
}
),
(party, company),
as_dict=True,
)
orders = frappe.db.sql(
"""
select
name as voucher_no,
if({rounded_total_field}, {rounded_total_field}, {grand_total_field}) as invoice_amount,
(if({rounded_total_field}, {rounded_total_field}, {grand_total_field}) - advance_paid) as outstanding_amount,
transaction_date as posting_date
from
`tab{voucher_type}`
where
{party_type} = %s
and docstatus = 1
and company = %s
and ifnull(status, "") != "Closed"
and if({rounded_total_field}, {rounded_total_field}, {grand_total_field}) > advance_paid
and abs(100 - per_billed) > 0.01
{condition}
order by
transaction_date, name
""".format(
**{
"rounded_total_field": rounded_total_field,
"grand_total_field": grand_total_field,
"voucher_type": voucher_type,
"party_type": scrub(party_type),
"condition": condition,
}
),
(party, company),
as_dict=True,
)
order_list = []
for d in orders:
if not (
flt(d.outstanding_amount) >= flt(filters.get("outstanding_amt_greater_than"))
and flt(d.outstanding_amount) <= flt(filters.get("outstanding_amt_less_than"))
if (
filters
and filters.get("outstanding_amt_greater_than")
and filters.get("outstanding_amt_less_than")
and not (
flt(filters.get("outstanding_amt_greater_than"))
<= flt(d.outstanding_amount)
<= flt(filters.get("outstanding_amt_less_than"))
)
):
continue
@@ -1454,6 +1623,8 @@ def get_negative_outstanding_invoices(
cost_center=None,
condition=None,
):
if party_type not in ["Customer", "Supplier"]:
return []
voucher_type = "Sales Invoice" if party_type == "Customer" else "Purchase Invoice"
supplier_condition = ""
if voucher_type == "Purchase Invoice":
@@ -1502,7 +1673,7 @@ def get_negative_outstanding_invoices(
def get_party_details(company, party_type, party, date, cost_center=None):
bank_account = ""
if not frappe.db.exists(party_type, party):
frappe.throw(_("Invalid {0}: {1}").format(party_type, party))
frappe.throw(_("{0} {1} does not exist").format(_(party_type), party))
party_account = get_party_account(party_type, party, company)
@@ -1643,12 +1814,7 @@ def get_reference_details(reference_doctype, reference_name, party_account_curre
outstanding_amount = ref_doc.get("outstanding_amount")
bill_no = ref_doc.get("bill_no")
elif reference_doctype == "Expense Claim":
outstanding_amount = (
flt(ref_doc.get("total_sanctioned_amount"))
+ flt(ref_doc.get("total_taxes_and_charges"))
- flt(ref_doc.get("total_amount_reimbursed"))
- flt(ref_doc.get("total_advance_amount"))
)
outstanding_amount = get_outstanding_amount_for_claim(ref_doc)
elif reference_doctype == "Employee Advance":
outstanding_amount = flt(ref_doc.advance_amount) - flt(ref_doc.paid_amount)
if party_account_currency != ref_doc.currency:
@@ -1778,11 +1944,21 @@ def get_bill_no_and_update_amounts(
@frappe.whitelist()
def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=None):
def get_payment_entry(
dt,
dn,
party_amount=None,
bank_account=None,
bank_amount=None,
reference_date=None,
):
reference_doc = None
doc = frappe.get_doc(dt, dn)
if dt in ("Sales Order", "Purchase Order") and flt(doc.per_billed, 2) > 0:
frappe.throw(_("Can only make payment against unbilled {0}").format(dt))
over_billing_allowance = frappe.db.get_single_value("Accounts Settings", "over_billing_allowance")
if dt in ("Sales Order", "Purchase Order") and flt(doc.per_billed, 2) >= (
100.0 + over_billing_allowance
):
frappe.throw(_("Can only make payment against unbilled {0}").format(_(dt)))
party_type = set_party_type(dt)
party_account = set_party_account(dt, dn, doc, party_type)
@@ -1799,8 +1975,9 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
dt, party_account_currency, bank, outstanding_amount, payment_type, bank_amount, doc
)
paid_amount, received_amount, discount_amount = apply_early_payment_discount(
paid_amount, received_amount, doc
reference_date = getdate(reference_date)
paid_amount, received_amount, discount_amount, valid_discounts = apply_early_payment_discount(
paid_amount, received_amount, doc, party_account_currency, reference_date
)
pe = frappe.new_doc("Payment Entry")
@@ -1808,6 +1985,7 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
pe.company = doc.company
pe.cost_center = doc.get("cost_center")
pe.posting_date = nowdate()
pe.reference_date = reference_date
pe.mode_of_payment = doc.get("mode_of_payment")
pe.party_type = party_type
pe.party = doc.get(scrub(party_type))
@@ -1841,14 +2019,19 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
if doc.doctype == "Purchase Invoice" and doc.invoice_is_blocked():
frappe.msgprint(_("{0} is on hold till {1}").format(doc.name, doc.release_date))
else:
if doc.doctype in ("Sales Invoice", "Purchase Invoice") and frappe.get_value(
if doc.doctype in (
"Sales Invoice",
"Purchase Invoice",
"Purchase Order",
"Sales Order",
) and frappe.get_value(
"Payment Terms Template",
{"name": doc.payment_terms_template},
"allocate_payment_based_on_payment_terms",
):
for reference in get_reference_as_per_payment_terms(
doc.payment_schedule, dt, dn, doc, grand_total, outstanding_amount
doc.payment_schedule, dt, dn, doc, grand_total, outstanding_amount, party_account_currency
):
pe.append("references", reference)
else:
@@ -1899,16 +2082,17 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
reference_doc = doc
pe.set_exchange_rate(ref_doc=reference_doc)
pe.set_amounts()
if discount_amount:
pe.set_gain_or_loss(
account_details={
"account": frappe.get_cached_value("Company", pe.company, "default_discount_account"),
"cost_center": pe.cost_center
or frappe.get_cached_value("Company", pe.company, "cost_center"),
"amount": discount_amount * (-1 if payment_type == "Pay" else 1),
}
base_total_discount_loss = 0
if frappe.db.get_single_value("Accounts Settings", "book_tax_discount_loss"):
base_total_discount_loss = split_early_payment_discount_loss(pe, doc, valid_discounts)
set_pending_discount_loss(
pe, doc, discount_amount, base_total_discount_loss, party_account_currency
)
pe.set_difference_amount()
pe.set_difference_amount()
return pe
@@ -2044,20 +2228,30 @@ def set_paid_amount_and_received_amount(
return paid_amount, received_amount
def apply_early_payment_discount(paid_amount, received_amount, doc):
def apply_early_payment_discount(
paid_amount, received_amount, doc, party_account_currency, reference_date
):
total_discount = 0
valid_discounts = []
eligible_for_payments = ["Sales Order", "Sales Invoice", "Purchase Order", "Purchase Invoice"]
has_payment_schedule = hasattr(doc, "payment_schedule") and doc.payment_schedule
if doc.doctype in eligible_for_payments and has_payment_schedule:
# Non eligible documents may not have `company_currency` field
is_multi_currency = party_account_currency != doc.company_currency
for term in doc.payment_schedule:
if not term.discounted_amount and term.discount and getdate(nowdate()) <= term.discount_date:
if not term.discounted_amount and term.discount and reference_date <= term.discount_date:
if term.discount_type == "Percentage":
discount_amount = flt(doc.get("grand_total")) * (term.discount / 100)
grand_total = doc.get("grand_total") if is_multi_currency else doc.get("base_grand_total")
discount_amount = flt(grand_total) * (term.discount / 100)
else:
discount_amount = term.discount
discount_amount_in_foreign_currency = discount_amount * doc.get("conversion_rate", 1)
# if accounting is done in the same currency, paid_amount = received_amount
conversion_rate = doc.get("conversion_rate", 1) if is_multi_currency else 1
discount_amount_in_foreign_currency = discount_amount * conversion_rate
if doc.doctype == "Sales Invoice":
paid_amount -= discount_amount
@@ -2066,23 +2260,151 @@ def apply_early_payment_discount(paid_amount, received_amount, doc):
received_amount -= discount_amount
paid_amount -= discount_amount_in_foreign_currency
valid_discounts.append({"type": term.discount_type, "discount": term.discount})
total_discount += discount_amount
if total_discount:
money = frappe.utils.fmt_money(total_discount, currency=doc.get("currency"))
currency = doc.get("currency") if is_multi_currency else doc.company_currency
money = frappe.utils.fmt_money(total_discount, currency=currency)
frappe.msgprint(_("Discount of {} applied as per Payment Term").format(money), alert=1)
return paid_amount, received_amount, total_discount
return paid_amount, received_amount, total_discount, valid_discounts
def set_pending_discount_loss(
pe, doc, discount_amount, base_total_discount_loss, party_account_currency
):
# If multi-currency, get base discount amount to adjust with base currency deductions/losses
if party_account_currency != doc.company_currency:
discount_amount = discount_amount * doc.get("conversion_rate", 1)
# Avoid considering miniscule losses
discount_amount = flt(discount_amount - base_total_discount_loss, doc.precision("grand_total"))
# Set base discount amount (discount loss/pending rounding loss) in deductions
if discount_amount > 0.0:
positive_negative = -1 if pe.payment_type == "Pay" else 1
# If tax loss booking is enabled, pending loss will be rounding loss.
# Otherwise it will be the total discount loss.
book_tax_loss = frappe.db.get_single_value("Accounts Settings", "book_tax_discount_loss")
account_type = "round_off_account" if book_tax_loss else "default_discount_account"
pe.set_gain_or_loss(
account_details={
"account": frappe.get_cached_value("Company", pe.company, account_type),
"cost_center": pe.cost_center or frappe.get_cached_value("Company", pe.company, "cost_center"),
"amount": discount_amount * positive_negative,
}
)
def split_early_payment_discount_loss(pe, doc, valid_discounts) -> float:
"""Split early payment discount into Income Loss & Tax Loss."""
total_discount_percent = get_total_discount_percent(doc, valid_discounts)
if not total_discount_percent:
return 0.0
base_loss_on_income = add_income_discount_loss(pe, doc, total_discount_percent)
base_loss_on_taxes = add_tax_discount_loss(pe, doc, total_discount_percent)
# Round off total loss rather than individual losses to reduce rounding error
return flt(base_loss_on_income + base_loss_on_taxes, doc.precision("grand_total"))
def get_total_discount_percent(doc, valid_discounts) -> float:
"""Get total percentage and amount discount applied as a percentage."""
total_discount_percent = (
sum(
discount.get("discount") for discount in valid_discounts if discount.get("type") == "Percentage"
)
or 0.0
)
# Operate in percentages only as it makes the income & tax split easier
total_discount_amount = (
sum(discount.get("discount") for discount in valid_discounts if discount.get("type") == "Amount")
or 0.0
)
if total_discount_amount:
discount_percentage = (total_discount_amount / doc.get("grand_total")) * 100
total_discount_percent += discount_percentage
return total_discount_percent
return total_discount_percent
def add_income_discount_loss(pe, doc, total_discount_percent) -> float:
"""Add loss on income discount in base currency."""
precision = doc.precision("total")
base_loss_on_income = doc.get("base_total") * (total_discount_percent / 100)
pe.append(
"deductions",
{
"account": frappe.get_cached_value("Company", pe.company, "default_discount_account"),
"cost_center": pe.cost_center or frappe.get_cached_value("Company", pe.company, "cost_center"),
"amount": flt(base_loss_on_income, precision),
},
)
return base_loss_on_income # Return loss without rounding
def add_tax_discount_loss(pe, doc, total_discount_percentage) -> float:
"""Add loss on tax discount in base currency."""
tax_discount_loss = {}
base_total_tax_loss = 0
precision = doc.precision("tax_amount_after_discount_amount", "taxes")
# The same account head could be used more than once
for tax in doc.get("taxes", []):
base_tax_loss = tax.get("base_tax_amount_after_discount_amount") * (
total_discount_percentage / 100
)
account = tax.get("account_head")
if not tax_discount_loss.get(account):
tax_discount_loss[account] = base_tax_loss
else:
tax_discount_loss[account] += base_tax_loss
for account, loss in tax_discount_loss.items():
base_total_tax_loss += loss
if loss == 0.0:
continue
pe.append(
"deductions",
{
"account": account,
"cost_center": pe.cost_center or frappe.get_cached_value("Company", pe.company, "cost_center"),
"amount": flt(loss, precision),
},
)
return base_total_tax_loss # Return loss without rounding
def get_reference_as_per_payment_terms(
payment_schedule, dt, dn, doc, grand_total, outstanding_amount
payment_schedule, dt, dn, doc, grand_total, outstanding_amount, party_account_currency
):
references = []
is_multi_currency_acc = (doc.currency != doc.company_currency) and (
party_account_currency != doc.company_currency
)
for payment_term in payment_schedule:
payment_term_outstanding = flt(
payment_term.payment_amount - payment_term.paid_amount, payment_term.precision("payment_amount")
)
if not is_multi_currency_acc:
# If accounting is done in company currency for multi-currency transaction
payment_term_outstanding = flt(
payment_term_outstanding * doc.get("conversion_rate"), payment_term.precision("payment_amount")
)
if payment_term_outstanding:
references.append(

View File

@@ -4,6 +4,8 @@
import unittest
import frappe
from frappe import qb
from frappe.tests.utils import change_settings
from frappe.utils import flt, nowdate
from erpnext.accounts.doctype.payment_entry.payment_entry import (
@@ -251,10 +253,25 @@ class TestPaymentEntry(unittest.TestCase):
},
)
si.save()
si.submit()
frappe.db.set_single_value("Accounts Settings", "book_tax_discount_loss", 1)
pe_with_tax_loss = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Cash - _TC")
self.assertEqual(pe_with_tax_loss.references[0].payment_term, "30 Credit Days with 10% Discount")
self.assertEqual(pe_with_tax_loss.references[0].allocated_amount, 236.0)
self.assertEqual(pe_with_tax_loss.paid_amount, 212.4)
self.assertEqual(pe_with_tax_loss.deductions[0].amount, 20.0) # Loss on Income
self.assertEqual(pe_with_tax_loss.deductions[1].amount, 3.6) # Loss on Tax
self.assertEqual(pe_with_tax_loss.deductions[1].account, "_Test Account Service Tax - _TC")
frappe.db.set_single_value("Accounts Settings", "book_tax_discount_loss", 0)
pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Cash - _TC")
self.assertEqual(pe.references[0].allocated_amount, 236.0)
self.assertEqual(pe.paid_amount, 212.4)
self.assertEqual(pe.deductions[0].amount, 23.6)
pe.submit()
si.load_from_db()
@@ -264,6 +281,190 @@ class TestPaymentEntry(unittest.TestCase):
self.assertEqual(si.payment_schedule[0].outstanding, 0)
self.assertEqual(si.payment_schedule[0].discounted_amount, 23.6)
def test_payment_entry_against_payment_terms_with_discount_amount(self):
si = create_sales_invoice(do_not_save=1, qty=1, rate=200)
si.payment_terms_template = "Test Discount Amount Template"
create_payment_terms_template_with_discount(
name="30 Credit Days with Rs.50 Discount",
discount_type="Amount",
discount=50,
template_name="Test Discount Amount Template",
)
frappe.db.set_value("Company", si.company, "default_discount_account", "Write Off - _TC")
si.append(
"taxes",
{
"charge_type": "On Net Total",
"account_head": "_Test Account Service Tax - _TC",
"cost_center": "_Test Cost Center - _TC",
"description": "Service Tax",
"rate": 18,
},
)
si.save()
si.submit()
# Set reference date past discount cut off date
pe_1 = get_payment_entry(
"Sales Invoice",
si.name,
bank_account="_Test Cash - _TC",
reference_date=frappe.utils.add_days(si.posting_date, 2),
)
self.assertEqual(pe_1.paid_amount, 236.0) # discount not applied
# Test if tax loss is booked on enabling configuration
frappe.db.set_single_value("Accounts Settings", "book_tax_discount_loss", 1)
pe_with_tax_loss = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Cash - _TC")
self.assertEqual(pe_with_tax_loss.deductions[0].amount, 42.37) # Loss on Income
self.assertEqual(pe_with_tax_loss.deductions[1].amount, 7.63) # Loss on Tax
self.assertEqual(pe_with_tax_loss.deductions[1].account, "_Test Account Service Tax - _TC")
frappe.db.set_single_value("Accounts Settings", "book_tax_discount_loss", 0)
pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Cash - _TC")
self.assertEqual(pe.references[0].allocated_amount, 236.0)
self.assertEqual(pe.paid_amount, 186)
self.assertEqual(pe.deductions[0].amount, 50.0)
pe.submit()
si.load_from_db()
self.assertEqual(si.payment_schedule[0].payment_amount, 236.0)
self.assertEqual(si.payment_schedule[0].paid_amount, 186)
self.assertEqual(si.payment_schedule[0].outstanding, 0)
self.assertEqual(si.payment_schedule[0].discounted_amount, 50)
@change_settings(
"Accounts Settings",
{
"allow_multi_currency_invoices_against_single_party_account": 1,
"book_tax_discount_loss": 1,
},
)
def test_payment_entry_multicurrency_si_with_base_currency_accounting_early_payment_discount(
self,
):
"""
1. Multi-currency SI with single currency accounting (company currency)
2. PE with early payment discount
3. Test if Paid Amount is calculated in company currency
4. Test if deductions are calculated in company currency
SI is in USD to document agreed amounts that are in USD, but the accounting is in base currency.
"""
si = create_sales_invoice(
customer="_Test Customer",
currency="USD",
conversion_rate=50,
do_not_save=1,
)
create_payment_terms_template_with_discount()
si.payment_terms_template = "Test Discount Template"
frappe.db.set_value("Company", si.company, "default_discount_account", "Write Off - _TC")
si.save()
si.submit()
pe = get_payment_entry(
"Sales Invoice",
si.name,
bank_account="_Test Bank - _TC",
)
pe.reference_no = si.name
pe.reference_date = nowdate()
# Early payment discount loss on income
self.assertEqual(pe.paid_amount, 4500.0) # Amount in company currency
self.assertEqual(pe.received_amount, 4500.0)
self.assertEqual(pe.deductions[0].amount, 500.0)
self.assertEqual(pe.deductions[0].account, "Write Off - _TC")
self.assertEqual(pe.difference_amount, 0.0)
pe.insert()
pe.submit()
expected_gle = dict(
(d[0], d)
for d in [
["Debtors - _TC", 0, 5000, si.name],
["_Test Bank - _TC", 4500, 0, None],
["Write Off - _TC", 500.0, 0, None],
]
)
self.validate_gl_entries(pe.name, expected_gle)
outstanding_amount = flt(frappe.db.get_value("Sales Invoice", si.name, "outstanding_amount"))
self.assertEqual(outstanding_amount, 0)
def test_payment_entry_multicurrency_accounting_si_with_early_payment_discount(self):
"""
1. Multi-currency SI with multi-currency accounting
2. PE with early payment discount and also exchange loss
3. Test if Paid Amount is calculated in transaction currency
4. Test if deductions are calculated in base/company currency
5. Test if exchange loss is reflected in difference
"""
si = create_sales_invoice(
customer="_Test Customer USD",
debit_to="_Test Receivable USD - _TC",
currency="USD",
conversion_rate=50,
do_not_save=1,
)
create_payment_terms_template_with_discount()
si.payment_terms_template = "Test Discount Template"
frappe.db.set_value("Company", si.company, "default_discount_account", "Write Off - _TC")
si.save()
si.submit()
pe = get_payment_entry(
"Sales Invoice", si.name, bank_account="_Test Bank - _TC", bank_amount=4700
)
pe.reference_no = si.name
pe.reference_date = nowdate()
# Early payment discount loss on income
self.assertEqual(pe.paid_amount, 90.0)
self.assertEqual(pe.received_amount, 4200.0) # 5000 - 500 (discount) - 300 (exchange loss)
self.assertEqual(pe.deductions[0].amount, 500.0)
self.assertEqual(pe.deductions[0].account, "Write Off - _TC")
# Exchange loss
self.assertEqual(pe.difference_amount, 300.0)
pe.append(
"deductions",
{
"account": "_Test Exchange Gain/Loss - _TC",
"cost_center": "_Test Cost Center - _TC",
"amount": 300.0,
},
)
pe.insert()
pe.submit()
self.assertEqual(pe.difference_amount, 0.0)
expected_gle = dict(
(d[0], d)
for d in [
["_Test Receivable USD - _TC", 0, 5000, si.name],
["_Test Bank - _TC", 4200, 0, None],
["Write Off - _TC", 500.0, 0, None],
["_Test Exchange Gain/Loss - _TC", 300.0, 0, None],
]
)
self.validate_gl_entries(pe.name, expected_gle)
outstanding_amount = flt(frappe.db.get_value("Sales Invoice", si.name, "outstanding_amount"))
self.assertEqual(outstanding_amount, 0)
def test_payment_against_purchase_invoice_to_check_status(self):
pi = make_purchase_invoice(
supplier="_Test Supplier USD",
@@ -743,6 +944,85 @@ class TestPaymentEntry(unittest.TestCase):
flt(payment_entry.total_taxes_and_charges, 2), flt(10 / payment_entry.target_exchange_rate, 2)
)
def test_gl_of_multi_currency_payment_with_taxes(self):
payment_entry = create_payment_entry(
party="_Test Supplier USD", paid_to="_Test Payable USD - _TC", save=True
)
payment_entry.append(
"taxes",
{
"account_head": "_Test Account Service Tax - _TC",
"charge_type": "Actual",
"tax_amount": 100,
"add_deduct_tax": "Add",
"description": "Test",
},
)
payment_entry.target_exchange_rate = 80
payment_entry.received_amount = 12.5
payment_entry = payment_entry.submit()
gle = qb.DocType("GL Entry")
gl_entries = (
qb.from_(gle)
.select(
gle.account,
gle.debit,
gle.credit,
gle.debit_in_account_currency,
gle.credit_in_account_currency,
)
.orderby(gle.account)
.where(gle.voucher_no == payment_entry.name)
.run()
)
expected_gl_entries = (
("_Test Account Service Tax - _TC", 100.0, 0.0, 100.0, 0.0),
("_Test Bank - _TC", 0.0, 1100.0, 0.0, 1100.0),
("_Test Payable USD - _TC", 1000.0, 0.0, 12.5, 0),
)
self.assertEqual(gl_entries, expected_gl_entries)
def test_payment_entry_against_onhold_purchase_invoice(self):
pi = make_purchase_invoice()
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Bank USD - _TC")
pe.reference_no = "1"
pe.reference_date = "2016-01-01"
# block invoice after creating payment entry
# since `get_payment_entry` will not attach blocked invoice to payment
pi.block_invoice()
with self.assertRaises(frappe.ValidationError) as err:
pe.save()
self.assertTrue("is on hold" in str(err.exception).lower())
def test_duplicate_payment_entry_allocate_amount(self):
si = create_sales_invoice()
pe_draft = get_payment_entry("Sales Invoice", si.name)
pe_draft.insert()
pe = get_payment_entry("Sales Invoice", si.name)
pe.submit()
self.assertRaises(frappe.ValidationError, pe_draft.submit)
def test_duplicate_payment_entry_partial_allocate_amount(self):
si = create_sales_invoice()
pe_draft = get_payment_entry("Sales Invoice", si.name)
pe_draft.insert()
pe = get_payment_entry("Sales Invoice", si.name)
pe.received_amount = si.total / 2
pe.references[0].allocated_amount = si.total / 2
pe.submit()
self.assertRaises(frappe.ValidationError, pe_draft.submit)
def create_payment_entry(**args):
payment_entry = frappe.new_doc("Payment Entry")
@@ -800,24 +1080,27 @@ def create_payment_terms_template():
).insert()
def create_payment_terms_template_with_discount():
def create_payment_terms_template_with_discount(
name=None, discount_type=None, discount=None, template_name=None
):
create_payment_term(name or "30 Credit Days with 10% Discount")
template_name = template_name or "Test Discount Template"
create_payment_term("30 Credit Days with 10% Discount")
if not frappe.db.exists("Payment Terms Template", "Test Discount Template"):
payment_term_template = frappe.get_doc(
if not frappe.db.exists("Payment Terms Template", template_name):
frappe.get_doc(
{
"doctype": "Payment Terms Template",
"template_name": "Test Discount Template",
"template_name": template_name,
"allocate_payment_based_on_payment_terms": 1,
"terms": [
{
"doctype": "Payment Terms Template Detail",
"payment_term": "30 Credit Days with 10% Discount",
"payment_term": name or "30 Credit Days with 10% Discount",
"invoice_portion": 100,
"credit_days_based_on": "Day(s) after invoice date",
"credit_days": 2,
"discount": 10,
"discount_type": discount_type or "Percentage",
"discount": discount or 10,
"discount_validity_based_on": "Day(s) after invoice date",
"discount_validity": 1,
}

View File

@@ -3,6 +3,7 @@
"creation": "2016-06-15 15:56:30.815503",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"account",
"cost_center",
@@ -17,9 +18,7 @@
"in_list_view": 1,
"label": "Account",
"options": "Account",
"reqd": 1,
"show_days": 1,
"show_seconds": 1
"reqd": 1
},
{
"fieldname": "cost_center",
@@ -28,37 +27,30 @@
"label": "Cost Center",
"options": "Cost Center",
"print_hide": 1,
"reqd": 1,
"show_days": 1,
"show_seconds": 1
"reqd": 1
},
{
"fieldname": "amount",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Amount",
"reqd": 1,
"show_days": 1,
"show_seconds": 1
"label": "Amount (Company Currency)",
"options": "Company:company:default_currency",
"reqd": 1
},
{
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"show_days": 1,
"show_seconds": 1
"fieldtype": "Column Break"
},
{
"fieldname": "description",
"fieldtype": "Small Text",
"label": "Description",
"show_days": 1,
"show_seconds": 1
"label": "Description"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2020-09-12 20:38:08.110674",
"modified": "2023-03-06 07:11:57.739619",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry Deduction",
@@ -66,5 +58,6 @@
"permissions": [],
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC"
"sort_order": "DESC",
"states": []
}

View File

@@ -25,7 +25,8 @@
"in_list_view": 1,
"label": "Type",
"options": "DocType",
"reqd": 1
"reqd": 1,
"search_index": 1
},
{
"columns": 2,
@@ -35,7 +36,8 @@
"in_list_view": 1,
"label": "Name",
"options": "reference_doctype",
"reqd": 1
"reqd": 1,
"search_index": 1
},
{
"fieldname": "due_date",
@@ -104,7 +106,7 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2021-09-26 17:06:55.597389",
"modified": "2022-12-12 12:31:44.919895",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry Reference",
@@ -113,5 +115,6 @@
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -3,12 +3,18 @@
import frappe
from frappe import _, msgprint
from frappe import _, msgprint, qb
from frappe.model.document import Document
from frappe.query_builder import Criterion
from frappe.query_builder.functions import Sum
from frappe.utils import flt, getdate, nowdate, today
import erpnext
from erpnext.accounts.utils import get_outstanding_invoices, reconcile_against_document
from erpnext.accounts.utils import (
get_outstanding_invoices,
reconcile_against_document,
update_reference_in_payment_entry,
)
from erpnext.controllers.accounts_controller import get_advance_payment_entries
@@ -43,6 +49,10 @@ class PaymentReconciliation(Document):
def get_payment_entries(self):
order_doctype = "Sales Order" if self.party_type == "Customer" else "Purchase Order"
condition = self.get_conditions(get_payments=True)
if self.get("cost_center"):
condition += " and cost_center = '{0}' ".format(self.cost_center)
payment_entries = get_advance_payment_entries(
self.party_type,
self.party,
@@ -57,6 +67,10 @@ class PaymentReconciliation(Document):
def get_jv_entries(self):
condition = self.get_conditions()
if self.get("cost_center"):
condition += " and t2.cost_center = '{0}' ".format(self.cost_center)
dr_or_cr = (
"credit_in_account_currency"
if erpnext.get_party_account_type(self.party_type) == "Receivable"
@@ -108,54 +122,79 @@ class PaymentReconciliation(Document):
return list(journal_entries)
def get_dr_or_cr_notes(self):
condition = self.get_conditions(get_return_invoices=True)
gl = qb.DocType("GL Entry")
voucher_type = "Sales Invoice" if self.party_type == "Customer" else "Purchase Invoice"
doc = qb.DocType(voucher_type)
# build conditions
sub_query_conditions = []
conditions = []
sub_query_conditions.append(doc.company == self.company)
if self.get("from_payment_date"):
sub_query_conditions.append(doc.posting_date.gte(self.from_payment_date))
if self.get("to_payment_date"):
sub_query_conditions.append(doc.posting_date.lte(self.to_payment_date))
if self.get("cost_center"):
sub_query_conditions.append(doc.cost_center == self.cost_center)
dr_or_cr = (
"credit_in_account_currency"
gl["credit_in_account_currency"]
if erpnext.get_party_account_type(self.party_type) == "Receivable"
else "debit_in_account_currency"
else gl["debit_in_account_currency"]
)
reconciled_dr_or_cr = (
"debit_in_account_currency"
if dr_or_cr == "credit_in_account_currency"
else "credit_in_account_currency"
gl["debit_in_account_currency"]
if dr_or_cr.name == "credit_in_account_currency"
else gl["credit_in_account_currency"]
)
voucher_type = "Sales Invoice" if self.party_type == "Customer" else "Purchase Invoice"
having_clause = qb.Field("amount") > 0
return frappe.db.sql(
""" SELECT doc.name as reference_name, %(voucher_type)s as reference_type,
(sum(gl.{dr_or_cr}) - sum(gl.{reconciled_dr_or_cr})) as amount, doc.posting_date,
account_currency as currency
FROM `tab{doc}` doc, `tabGL Entry` gl
WHERE
(doc.name = gl.against_voucher or doc.name = gl.voucher_no)
and doc.{party_type_field} = %(party)s
and doc.is_return = 1 and ifnull(doc.return_against, "") = ""
and gl.against_voucher_type = %(voucher_type)s
and doc.docstatus = 1 and gl.party = %(party)s
and gl.party_type = %(party_type)s and gl.account = %(account)s
and gl.is_cancelled = 0 {condition}
GROUP BY doc.name
Having
amount > 0
ORDER BY doc.posting_date
""".format(
doc=voucher_type,
dr_or_cr=dr_or_cr,
reconciled_dr_or_cr=reconciled_dr_or_cr,
party_type_field=frappe.scrub(self.party_type),
condition=condition or "",
),
{
"party": self.party,
"party_type": self.party_type,
"voucher_type": voucher_type,
"account": self.receivable_payable_account,
},
as_dict=1,
if self.minimum_payment_amount:
having_clause = qb.Field("amount") >= self.minimum_payment_amount
if self.maximum_payment_amount:
having_clause = having_clause & qb.Field("amount") <= self.maximum_payment_amount
sub_query = (
qb.from_(doc)
.select(doc.name)
.where(Criterion.all(sub_query_conditions))
.where(
(doc.docstatus == 1)
& (doc.is_return == 1)
& ((doc.return_against == "") | (doc.return_against.isnull()))
)
)
query = (
qb.from_(gl)
.select(
gl.against_voucher_type.as_("reference_type"),
gl.against_voucher.as_("reference_name"),
(Sum(dr_or_cr) - Sum(reconciled_dr_or_cr)).as_("amount"),
gl.posting_date,
gl.account_currency.as_("currency"),
)
.where(
(gl.against_voucher.isin(sub_query))
& (gl.against_voucher_type == voucher_type)
& (gl.is_cancelled == 0)
& (gl.account == self.receivable_payable_account)
& (gl.party_type == self.party_type)
& (gl.party == self.party)
)
.where(Criterion.all(conditions))
.groupby(gl.against_voucher)
.having(having_clause)
)
dr_cr_notes = query.run(as_dict=True)
return dr_cr_notes
def add_payment_entries(self, non_reconciled_payments):
self.set("payments", [])
@@ -168,8 +207,11 @@ class PaymentReconciliation(Document):
condition = self.get_conditions(get_invoices=True)
if self.get("cost_center"):
condition += " and cost_center = '{0}' ".format(self.cost_center)
non_reconciled_invoices = get_outstanding_invoices(
self.party_type, self.party, self.receivable_payable_account, condition=condition
self.party_type, self.party, self.receivable_payable_account, self.company, condition=condition
)
if self.invoice_limit:
@@ -190,6 +232,23 @@ class PaymentReconciliation(Document):
inv.currency = entry.get("currency")
inv.outstanding_amount = flt(entry.get("outstanding_amount"))
def get_difference_amount(self, allocated_entry):
if allocated_entry.get("reference_type") != "Payment Entry":
return
dr_or_cr = (
"credit_in_account_currency"
if erpnext.get_party_account_type(self.party_type) == "Receivable"
else "debit_in_account_currency"
)
row = self.get_payment_details(allocated_entry, dr_or_cr)
doc = frappe.get_doc(allocated_entry.reference_type, allocated_entry.reference_name)
update_reference_in_payment_entry(row, doc, do_not_save=True)
return doc.difference_amount
@frappe.whitelist()
def allocate_entries(self, args):
self.validate_entries()
@@ -205,12 +264,16 @@ class PaymentReconciliation(Document):
res = self.get_allocated_entry(pay, inv, pay["amount"])
inv["outstanding_amount"] = flt(inv.get("outstanding_amount")) - flt(pay.get("amount"))
pay["amount"] = 0
res.difference_amount = self.get_difference_amount(res)
if pay.get("amount") == 0:
entries.append(res)
break
elif inv.get("outstanding_amount") == 0:
entries.append(res)
continue
else:
break
@@ -232,6 +295,7 @@ class PaymentReconciliation(Document):
"amount": pay.get("amount"),
"allocated_amount": allocated_amount,
"difference_amount": pay.get("difference_amount"),
"currency": inv.get("currency"),
}
)
@@ -329,12 +393,9 @@ class PaymentReconciliation(Document):
if not invoices_to_reconcile:
frappe.throw(_("No records found in Allocation table"))
def get_conditions(self, get_invoices=False, get_payments=False, get_return_invoices=False):
def get_conditions(self, get_invoices=False, get_payments=False):
condition = " and company = '{0}' ".format(self.company)
if self.get("cost_center") and (get_invoices or get_payments or get_return_invoices):
condition = " and cost_center = '{0}' ".format(self.cost_center)
if get_invoices:
condition += (
" and posting_date >= {0}".format(frappe.db.escape(self.from_invoice_date))
@@ -360,35 +421,7 @@ class PaymentReconciliation(Document):
condition += " and {dr_or_cr} <= {amount}".format(
dr_or_cr=dr_or_cr, amount=flt(self.maximum_invoice_amount)
)
elif get_return_invoices:
condition = " and doc.company = '{0}' ".format(self.company)
condition += (
" and doc.posting_date >= {0}".format(frappe.db.escape(self.from_payment_date))
if self.from_payment_date
else ""
)
condition += (
" and doc.posting_date <= {0}".format(frappe.db.escape(self.to_payment_date))
if self.to_payment_date
else ""
)
dr_or_cr = (
"debit_in_account_currency"
if erpnext.get_party_account_type(self.party_type) == "Receivable"
else "credit_in_account_currency"
)
if self.minimum_invoice_amount:
condition += " and gl.{dr_or_cr} >= {amount}".format(
dr_or_cr=dr_or_cr, amount=flt(self.minimum_payment_amount)
)
if self.maximum_invoice_amount:
condition += " and gl.{dr_or_cr} <= {amount}".format(
dr_or_cr=dr_or_cr, amount=flt(self.maximum_payment_amount)
)
else:
elif get_payments:
condition += (
" and posting_date >= {0}".format(frappe.db.escape(self.from_payment_date))
if self.from_payment_date

View File

@@ -20,7 +20,8 @@
"section_break_5",
"difference_amount",
"column_break_7",
"difference_account"
"difference_account",
"currency"
],
"fields": [
{
@@ -37,7 +38,7 @@
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Allocated Amount",
"options": "Currency",
"options": "currency",
"reqd": 1
},
{
@@ -112,7 +113,7 @@
"fieldtype": "Currency",
"hidden": 1,
"label": "Unreconciled Amount",
"options": "Currency",
"options": "currency",
"read_only": 1
},
{
@@ -120,7 +121,7 @@
"fieldtype": "Currency",
"hidden": 1,
"label": "Amount",
"options": "Currency",
"options": "currency",
"read_only": 1
},
{
@@ -129,11 +130,18 @@
"hidden": 1,
"label": "Reference Row",
"read_only": 1
},
{
"fieldname": "currency",
"fieldtype": "Link",
"hidden": 1,
"label": "Currency",
"options": "Currency"
}
],
"istable": 1,
"links": [],
"modified": "2021-10-06 11:48:59.616562",
"modified": "2023-11-28 16:30:43.344612",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation Allocation",

View File

@@ -42,7 +42,7 @@ frappe.ui.form.on("Payment Request", "refresh", function(frm) {
});
}
if(!frm.doc.payment_gateway_account && frm.doc.status == "Initiated") {
if((!frm.doc.payment_gateway_account || frm.doc.payment_request_type == "Outward") && frm.doc.status == "Initiated") {
frm.add_custom_button(__('Create Payment Entry'), function(){
frappe.call({
method: "erpnext.accounts.doctype.payment_request.payment_request.make_payment_entry",

View File

@@ -186,8 +186,10 @@
{
"fetch_from": "bank_account.bank",
"fieldname": "bank",
"fieldtype": "Read Only",
"label": "Bank"
"fieldtype": "Link",
"label": "Bank",
"options": "Bank",
"read_only": 1
},
{
"fetch_from": "bank_account.bank_account_no",
@@ -366,10 +368,11 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2020-09-18 12:24:14.178853",
"modified": "2022-09-30 16:19:43.680025",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Request",
"naming_rule": "By \"Naming Series\" field",
"owner": "Administrator",
"permissions": [
{
@@ -401,5 +404,6 @@
}
],
"sort_field": "modified",
"sort_order": "DESC"
"sort_order": "DESC",
"states": []
}

View File

@@ -254,6 +254,7 @@ class PaymentRequest(Document):
payment_entry.update(
{
"mode_of_payment": self.mode_of_payment,
"reference_no": self.name,
"reference_date": nowdate(),
"remarks": "Payment Entry against {0} {1} via Payment Request {2}".format(
@@ -403,25 +404,22 @@ def make_payment_request(**args):
else ""
)
existing_payment_request = None
if args.order_type == "Shopping Cart":
existing_payment_request = frappe.db.get_value(
"Payment Request",
{"reference_doctype": args.dt, "reference_name": args.dn, "docstatus": ("!=", 2)},
)
draft_payment_request = frappe.db.get_value(
"Payment Request",
{"reference_doctype": args.dt, "reference_name": args.dn, "docstatus": 0},
)
if existing_payment_request:
existing_payment_request_amount = get_existing_payment_request_amount(args.dt, args.dn)
if existing_payment_request_amount:
grand_total -= existing_payment_request_amount
if draft_payment_request:
frappe.db.set_value(
"Payment Request", existing_payment_request, "grand_total", grand_total, update_modified=False
"Payment Request", draft_payment_request, "grand_total", grand_total, update_modified=False
)
pr = frappe.get_doc("Payment Request", existing_payment_request)
pr = frappe.get_doc("Payment Request", draft_payment_request)
else:
if args.order_type != "Shopping Cart":
existing_payment_request_amount = get_existing_payment_request_amount(args.dt, args.dn)
if existing_payment_request_amount:
grand_total -= existing_payment_request_amount
pr = frappe.new_doc("Payment Request")
pr.update(
{

View File

@@ -39,6 +39,7 @@
{
"columns": 2,
"fetch_from": "payment_term.description",
"fetch_if_empty": 1,
"fieldname": "description",
"fieldtype": "Small Text",
"in_list_view": 1,
@@ -159,7 +160,7 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2021-04-28 05:41:35.084233",
"modified": "2022-09-16 13:57:06.382859",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Schedule",
@@ -168,5 +169,6 @@
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -10,10 +10,11 @@
"fiscal_year",
"amended_from",
"company",
"cost_center_wise_pnl",
"column_break1",
"closing_account_head",
"remarks"
"remarks",
"gle_processing_status",
"error_message"
],
"fields": [
{
@@ -86,17 +87,26 @@
"reqd": 1
},
{
"default": "0",
"fieldname": "cost_center_wise_pnl",
"fieldtype": "Check",
"label": "Book Cost Center Wise Profit/Loss"
"depends_on": "eval:doc.docstatus!=0",
"fieldname": "gle_processing_status",
"fieldtype": "Select",
"label": "GL Entry Processing Status",
"options": "In Progress\nCompleted\nFailed",
"read_only": 1
},
{
"depends_on": "eval:doc.gle_processing_status=='Failed'",
"fieldname": "error_message",
"fieldtype": "Text",
"label": "Error Message",
"read_only": 1
}
],
"icon": "fa fa-file-text",
"idx": 1,
"is_submittable": 1,
"links": [],
"modified": "2021-05-20 15:27:37.210458",
"modified": "2022-07-20 14:51:04.714154",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Period Closing Voucher",

View File

@@ -8,7 +8,6 @@ from frappe.utils import flt
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
get_accounting_dimensions,
get_dimensions,
)
from erpnext.accounts.utils import get_account_currency
from erpnext.controllers.accounts_controller import AccountsController
@@ -20,13 +19,28 @@ class PeriodClosingVoucher(AccountsController):
self.validate_posting_date()
def on_submit(self):
self.db_set("gle_processing_status", "In Progress")
self.make_gl_entries()
def on_cancel(self):
self.db_set("gle_processing_status", "In Progress")
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry")
from erpnext.accounts.general_ledger import make_reverse_gl_entries
make_reverse_gl_entries(voucher_type="Period Closing Voucher", voucher_no=self.name)
gle_count = frappe.db.count(
"GL Entry",
{"voucher_type": "Period Closing Voucher", "voucher_no": self.name, "is_cancelled": 0},
)
if gle_count > 5000:
frappe.enqueue(
make_reverse_gl_entries,
voucher_type="Period Closing Voucher",
voucher_no=self.name,
queue="long",
)
frappe.msgprint(
_("The GL Entries will be cancelled in the background, it can take a few minutes."), alert=True
)
else:
make_reverse_gl_entries(voucher_type="Period Closing Voucher", voucher_no=self.name)
def validate_account_head(self):
closing_account_type = frappe.db.get_value("Account", self.closing_account_head, "root_type")
@@ -54,8 +68,8 @@ class PeriodClosingVoucher(AccountsController):
pce = frappe.db.sql(
"""select name from `tabPeriod Closing Voucher`
where posting_date > %s and fiscal_year = %s and docstatus = 1""",
(self.posting_date, self.fiscal_year),
where posting_date > %s and fiscal_year = %s and docstatus = 1 and company = %s""",
(self.posting_date, self.fiscal_year, self.company),
)
if pce and pce[0][0]:
frappe.throw(
@@ -67,90 +81,80 @@ class PeriodClosingVoucher(AccountsController):
def make_gl_entries(self):
gl_entries = self.get_gl_entries()
if gl_entries:
from erpnext.accounts.general_ledger import make_gl_entries
make_gl_entries(gl_entries)
if len(gl_entries) > 5000:
frappe.enqueue(process_gl_entries, gl_entries=gl_entries, queue="long")
frappe.msgprint(
_("The GL Entries will be processed in the background, it can take a few minutes."),
alert=True,
)
else:
process_gl_entries(gl_entries)
def get_gl_entries(self):
gl_entries = []
pl_accounts = self.get_pl_balances()
for acc in pl_accounts:
# pl account
for acc in self.get_pl_balances_based_on_dimensions(group_by_account=True):
if flt(acc.bal_in_company_currency):
gl_entries.append(
self.get_gl_dict(
{
"account": acc.account,
"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,
},
item=acc,
)
)
gl_entries.append(self.get_gle_for_pl_account(acc))
if gl_entries:
gle_for_net_pl_bal = self.get_pnl_gl_entry(pl_accounts)
gl_entries += gle_for_net_pl_bal
# closing liability account
for acc in self.get_pl_balances_based_on_dimensions(group_by_account=False):
if flt(acc.bal_in_company_currency):
gl_entries.append(self.get_gle_for_closing_account(acc))
return gl_entries
def get_pnl_gl_entry(self, pl_accounts):
company_cost_center = frappe.db.get_value("Company", self.company, "cost_center")
gl_entries = []
def get_gle_for_pl_account(self, acc):
gl_entry = self.get_gl_dict(
{
"account": acc.account,
"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,
},
item=acc,
)
self.update_default_dimensions(gl_entry, acc)
return gl_entry
for acc in pl_accounts:
if flt(acc.bal_in_company_currency):
cost_center = acc.cost_center if self.cost_center_wise_pnl else company_cost_center
gl_entry = self.get_gl_dict(
{
"account": self.closing_account_head,
"cost_center": 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,
},
item=acc,
)
def get_gle_for_closing_account(self, acc):
gl_entry = self.get_gl_dict(
{
"account": self.closing_account_head,
"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,
},
item=acc,
)
self.update_default_dimensions(gl_entry, acc)
return gl_entry
self.update_default_dimensions(gl_entry)
gl_entries.append(gl_entry)
return gl_entries
def update_default_dimensions(self, gl_entry):
def update_default_dimensions(self, gl_entry, acc):
if not self.accounting_dimensions:
self.accounting_dimensions = get_accounting_dimensions()
_, default_dimensions = get_dimensions()
for dimension in self.accounting_dimensions:
gl_entry.update({dimension: default_dimensions.get(self.company, {}).get(dimension)})
gl_entry.update({dimension: acc.get(dimension)})
def get_pl_balances(self):
def get_pl_balances_based_on_dimensions(self, group_by_account=False):
"""Get balance for dimension-wise pl accounts"""
dimension_fields = ["t1.cost_center", "t1.finance_book"]
@@ -159,20 +163,53 @@ class PeriodClosingVoucher(AccountsController):
for dimension in self.accounting_dimensions:
dimension_fields.append("t1.{0}".format(dimension))
if group_by_account:
dimension_fields.append("t1.account")
return frappe.db.sql(
"""
select
t1.account, t2.account_currency, {dimension_fields},
t1.account_currency,
{dimension_fields},
sum(t1.debit_in_account_currency) - sum(t1.credit_in_account_currency) as bal_in_account_currency,
sum(t1.debit) - sum(t1.credit) as bal_in_company_currency
from `tabGL Entry` t1, `tabAccount` t2
where t1.is_cancelled = 0 and t1.account = t2.name and t2.report_type = 'Profit and Loss'
and t2.docstatus < 2 and t2.company = %s
and t1.posting_date between %s and %s
group by t1.account, {dimension_fields}
from `tabGL Entry` t1
where
t1.is_cancelled = 0
and t1.account in (select name from `tabAccount` where report_type = 'Profit and Loss' and docstatus < 2 and company = %s)
and t1.posting_date between %s and %s
group by {dimension_fields}
""".format(
dimension_fields=", ".join(dimension_fields)
dimension_fields=", ".join(dimension_fields),
),
(self.company, self.get("year_start_date"), self.posting_date),
as_dict=1,
)
def process_gl_entries(gl_entries):
from erpnext.accounts.general_ledger import make_gl_entries
try:
make_gl_entries(gl_entries, merge_entries=False)
frappe.db.set_value(
"Period Closing Voucher", gl_entries[0].get("voucher_no"), "gle_processing_status", "Completed"
)
except Exception as e:
frappe.db.rollback()
frappe.log_error(e)
frappe.db.set_value(
"Period Closing Voucher", gl_entries[0].get("voucher_no"), "gle_processing_status", "Failed"
)
def make_reverse_gl_entries(voucher_type, voucher_no):
from erpnext.accounts.general_ledger import make_reverse_gl_entries
try:
make_reverse_gl_entries(voucher_type=voucher_type, voucher_no=voucher_no)
frappe.db.set_value("Period Closing Voucher", voucher_no, "gle_processing_status", "Completed")
except Exception as e:
frappe.db.rollback()
frappe.log_error(e)
frappe.db.set_value("Period Closing Voucher", voucher_no, "gle_processing_status", "Failed")

View File

@@ -49,7 +49,7 @@ class TestPeriodClosingVoucher(unittest.TestCase):
expected_gle = (
("Cost of Goods Sold - TPC", 0.0, 600.0),
(surplus_account, 600.0, 400.0),
(surplus_account, 200.0, 0.0),
("Sales - TPC", 400.0, 0.0),
)
@@ -59,7 +59,8 @@ class TestPeriodClosingVoucher(unittest.TestCase):
""",
(pcv.name),
)
pcv.reload()
self.assertEqual(pcv.gle_processing_status, "Completed")
self.assertEqual(pcv_gle, expected_gle)
def test_cost_center_wise_posting(self):
@@ -78,7 +79,10 @@ class TestPeriodClosingVoucher(unittest.TestCase):
expense_account="Cost of Goods Sold - TPC",
rate=400,
debit_to="Debtors - TPC",
currency="USD",
customer="_Test Customer USD",
)
create_sales_invoice(
company=company,
cost_center=cost_center2,
@@ -86,10 +90,11 @@ class TestPeriodClosingVoucher(unittest.TestCase):
expense_account="Cost of Goods Sold - TPC",
rate=200,
debit_to="Debtors - TPC",
currency="USD",
customer="_Test Customer USD",
)
pcv = self.make_period_closing_voucher(submit=False)
pcv.cost_center_wise_pnl = 1
pcv.save()
pcv.submit()
surplus_account = pcv.closing_account_head
@@ -112,6 +117,16 @@ class TestPeriodClosingVoucher(unittest.TestCase):
self.assertEqual(pcv_gle, expected_gle)
pcv.reload()
pcv.cancel()
self.assertFalse(
frappe.db.get_value(
"GL Entry",
{"voucher_type": "Period Closing Voucher", "voucher_no": pcv.name, "is_cancelled": 0},
)
)
def test_period_closing_with_finance_book_entries(self):
frappe.db.sql("delete from `tabGL Entry` where company='Test PCV Company'")
@@ -119,14 +134,17 @@ class TestPeriodClosingVoucher(unittest.TestCase):
surplus_account = create_account()
cost_center = create_cost_center("Test Cost Center 1")
create_sales_invoice(
si = create_sales_invoice(
company=company,
income_account="Sales - TPC",
expense_account="Cost of Goods Sold - TPC",
cost_center=cost_center,
rate=400,
debit_to="Debtors - TPC",
currency="USD",
customer="_Test Customer USD",
)
jv = make_journal_entry(
account1="Cash - TPC",
account2="Sales - TPC",

View File

@@ -25,7 +25,7 @@ frappe.ui.form.on('POS Closing Entry', {
frappe.realtime.on('closing_process_complete', async function(data) {
await frm.reload_doc();
if (frm.doc.status == 'Failed' && frm.doc.error_message && data.user == frappe.session.user) {
if (frm.doc.status == 'Failed' && frm.doc.error_message) {
frappe.msgprint({
title: __('POS Closing Failed'),
message: frm.doc.error_message,
@@ -36,6 +36,15 @@ frappe.ui.form.on('POS Closing Entry', {
});
set_html_data(frm);
if (frm.doc.docstatus == 1) {
if (!frm.doc.posting_date) {
frm.set_value("posting_date", frappe.datetime.nowdate());
}
if (!frm.doc.posting_time) {
frm.set_value("posting_time", frappe.datetime.now_time());
}
}
},
refresh: function(frm) {
@@ -64,13 +73,15 @@ frappe.ui.form.on('POS Closing Entry', {
pos_opening_entry(frm) {
if (frm.doc.pos_opening_entry && frm.doc.period_start_date && frm.doc.period_end_date && frm.doc.user) {
reset_values(frm);
frm.trigger("set_opening_amounts");
frm.trigger("get_pos_invoices");
frappe.run_serially([
() => frm.trigger("set_opening_amounts"),
() => frm.trigger("get_pos_invoices")
]);
}
},
set_opening_amounts(frm) {
frappe.db.get_doc("POS Opening Entry", frm.doc.pos_opening_entry)
return frappe.db.get_doc("POS Opening Entry", frm.doc.pos_opening_entry)
.then(({ balance_details }) => {
balance_details.forEach(detail => {
frm.add_child("payment_reconciliation", {
@@ -83,7 +94,7 @@ frappe.ui.form.on('POS Closing Entry', {
},
get_pos_invoices(frm) {
frappe.call({
return frappe.call({
method: 'erpnext.accounts.doctype.pos_closing_entry.pos_closing_entry.get_pos_invoices',
args: {
start: frappe.datetime.get_datetime_as_string(frm.doc.period_start_date),
@@ -100,7 +111,9 @@ frappe.ui.form.on('POS Closing Entry', {
});
},
before_save: function(frm) {
before_save: async function(frm) {
frappe.dom.freeze(__('Processing Sales! Please Wait...'));
frm.set_value("grand_total", 0);
frm.set_value("net_total", 0);
frm.set_value("total_quantity", 0);
@@ -110,17 +123,23 @@ frappe.ui.form.on('POS Closing Entry', {
row.expected_amount = row.opening_amount;
}
for (let row of frm.doc.pos_transactions) {
frappe.db.get_doc("POS Invoice", row.pos_invoice).then(doc => {
frm.doc.grand_total += flt(doc.grand_total);
frm.doc.net_total += flt(doc.net_total);
frm.doc.total_quantity += flt(doc.total_qty);
refresh_payments(doc, frm);
refresh_taxes(doc, frm);
refresh_fields(frm);
set_html_data(frm);
});
const pos_inv_promises = frm.doc.pos_transactions.map(
row => frappe.db.get_doc("POS Invoice", row.pos_invoice)
);
const pos_invoices = await Promise.all(pos_inv_promises);
for (let doc of pos_invoices) {
frm.doc.grand_total += flt(doc.grand_total);
frm.doc.net_total += flt(doc.net_total);
frm.doc.total_quantity += flt(doc.total_qty);
refresh_payments(doc, frm);
refresh_taxes(doc, frm);
refresh_fields(frm);
set_html_data(frm);
}
frappe.dom.unfreeze();
}
});

View File

@@ -11,6 +11,7 @@
"period_end_date",
"column_break_3",
"posting_date",
"posting_time",
"pos_opening_entry",
"status",
"section_break_5",
@@ -51,7 +52,6 @@
"fieldtype": "Datetime",
"in_list_view": 1,
"label": "Period End Date",
"read_only": 1,
"reqd": 1
},
{
@@ -219,6 +219,13 @@
"fieldtype": "Small Text",
"label": "Error",
"read_only": 1
},
{
"fieldname": "posting_time",
"fieldtype": "Time",
"label": "Posting Time",
"no_copy": 1,
"reqd": 1
}
],
"is_submittable": 1,
@@ -228,10 +235,11 @@
"link_fieldname": "pos_closing_entry"
}
],
"modified": "2021-10-20 16:19:25.340565",
"modified": "2022-08-01 11:37:14.991228",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Closing Entry",
"naming_rule": "Expression (old style)",
"owner": "Administrator",
"permissions": [
{
@@ -278,5 +286,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -15,11 +15,30 @@ from erpnext.controllers.status_updater import StatusUpdater
class POSClosingEntry(StatusUpdater):
def validate(self):
self.posting_date = self.posting_date or frappe.utils.nowdate()
self.posting_time = self.posting_time or frappe.utils.nowtime()
if frappe.db.get_value("POS Opening Entry", self.pos_opening_entry, "status") != "Open":
frappe.throw(_("Selected POS Opening Entry should be open."), title=_("Invalid Opening Entry"))
self.validate_duplicate_pos_invoices()
self.validate_pos_invoices()
def validate_duplicate_pos_invoices(self):
pos_occurences = {}
for idx, inv in enumerate(self.pos_transactions, 1):
pos_occurences.setdefault(inv.pos_invoice, []).append(idx)
error_list = []
for key, value in pos_occurences.items():
if len(value) > 1:
error_list.append(
_("{} is added multiple times on rows: {}".format(frappe.bold(key), frappe.bold(value)))
)
if error_list:
frappe.throw(error_list, title=_("Duplicate POS Invoices found"), as_list=True)
def validate_pos_invoices(self):
invalid_rows = []
for d in self.pos_transactions:

View File

@@ -345,7 +345,8 @@
"no_copy": 1,
"options": "POS Invoice",
"print_hide": 1,
"read_only": 1
"read_only": 1,
"search_index": 1
},
{
"default": "0",
@@ -1572,7 +1573,7 @@
"icon": "fa fa-file-text",
"is_submittable": 1,
"links": [],
"modified": "2022-03-22 13:00:24.166684",
"modified": "2022-09-30 03:49:50.455199",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice",

View File

@@ -1,9 +1,10 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
import collections
import frappe
from frappe import _
from frappe.query_builder.functions import IfNull, Sum
from frappe.utils import cint, flt, get_link_to_form, getdate, nowdate
from six import iteritems
@@ -43,6 +44,7 @@ class POSInvoice(SalesInvoice):
self.validate_debit_to_acc()
self.validate_write_off_account()
self.validate_change_amount()
self.validate_duplicate_serial_and_batch_no()
self.validate_change_account()
self.validate_item_cost_centers()
self.validate_warehouse()
@@ -153,6 +155,27 @@ class POSInvoice(SalesInvoice):
title=_("Item Unavailable"),
)
def validate_duplicate_serial_and_batch_no(self):
serial_nos = []
batch_nos = []
for row in self.get("items"):
if row.serial_no:
serial_nos = row.serial_no.split("\n")
if row.batch_no and not row.serial_no:
batch_nos.append(row.batch_no)
if serial_nos:
for key, value in collections.Counter(serial_nos).items():
if value > 1:
frappe.throw(_("Duplicate Serial No {0} found").format("key"))
if batch_nos:
for key, value in collections.Counter(batch_nos).items():
if value > 1:
frappe.throw(_("Duplicate Batch No {0} found").format("key"))
def validate_pos_reserved_batch_qty(self, item):
filters = {"item_code": item.item_code, "warehouse": item.warehouse, "batch_no": item.batch_no}
@@ -161,7 +184,7 @@ class POSInvoice(SalesInvoice):
bold_item_name = frappe.bold(item.item_name)
bold_extra_batch_qty_needed = frappe.bold(
abs(available_batch_qty - reserved_batch_qty - item.qty)
abs(available_batch_qty - reserved_batch_qty - item.stock_qty)
)
bold_invalid_batch_no = frappe.bold(item.batch_no)
@@ -172,7 +195,7 @@ class POSInvoice(SalesInvoice):
).format(item.idx, bold_invalid_batch_no, bold_item_name),
title=_("Item Unavailable"),
)
elif (available_batch_qty - reserved_batch_qty - item.qty) < 0:
elif (available_batch_qty - reserved_batch_qty - item.stock_qty) < 0:
frappe.throw(
_(
"Row #{}: Batch No. {} of item {} has less than required stock available, {} more required"
@@ -222,9 +245,6 @@ class POSInvoice(SalesInvoice):
allow_negative_stock = frappe.db.get_single_value("Stock Settings", "allow_negative_stock")
for d in self.get("items"):
is_service_item = not (frappe.db.get_value("Item", d.get("item_code"), "is_stock_item"))
if is_service_item:
return
if d.serial_no:
self.validate_pos_reserved_serial_nos(d)
self.validate_delivered_serial_nos(d)
@@ -242,14 +262,14 @@ class POSInvoice(SalesInvoice):
frappe.bold(d.warehouse),
frappe.bold(d.qty),
)
if flt(available_stock) <= 0:
if is_stock_item and flt(available_stock) <= 0:
frappe.throw(
_("Row #{}: Item Code: {} is not available under warehouse {}.").format(
d.idx, item_code, warehouse
),
title=_("Item Unavailable"),
)
elif flt(available_stock) < flt(d.qty):
elif is_stock_item and flt(available_stock) < flt(d.stock_qty):
frappe.throw(
_(
"Row #{}: Stock quantity not enough for Item Code: {} under warehouse {}. Available quantity {}."
@@ -637,11 +657,12 @@ def get_stock_availability(item_code, warehouse):
pos_sales_qty = get_pos_reserved_qty(item_code, warehouse)
return bin_qty - pos_sales_qty, is_stock_item
else:
is_stock_item = False
is_stock_item = True
if frappe.db.exists("Product Bundle", item_code):
return get_bundle_availability(item_code, warehouse), is_stock_item
else:
# Is a service item
is_stock_item = False
# Is a service item or non_stock item
return 0, is_stock_item
@@ -654,8 +675,10 @@ def get_bundle_availability(bundle_item_code, warehouse):
item_pos_reserved_qty = get_pos_reserved_qty(item.item_code, warehouse)
available_qty = item_bin_qty - item_pos_reserved_qty
max_available_bundles = available_qty / item.qty
if bundle_bin_qty > max_available_bundles:
max_available_bundles = available_qty / item.stock_qty
if bundle_bin_qty > max_available_bundles and frappe.get_value(
"Item", item.item_code, "is_stock_item"
):
bundle_bin_qty = max_available_bundles
pos_sales_qty = get_pos_reserved_qty(bundle_item_code, warehouse)
@@ -675,18 +698,22 @@ def get_bin_qty(item_code, warehouse):
def get_pos_reserved_qty(item_code, warehouse):
reserved_qty = frappe.db.sql(
"""select sum(p_item.qty) as qty
from `tabPOS Invoice` p, `tabPOS Invoice Item` p_item
where p.name = p_item.parent
and ifnull(p.consolidated_invoice, '') = ''
and p_item.docstatus = 1
and p_item.item_code = %s
and p_item.warehouse = %s
""",
(item_code, warehouse),
as_dict=1,
)
p_inv = frappe.qb.DocType("POS Invoice")
p_item = frappe.qb.DocType("POS Invoice Item")
reserved_qty = (
frappe.qb.from_(p_inv)
.from_(p_item)
.select(Sum(p_item.qty).as_("qty"))
.where(
(p_inv.name == p_item.parent)
& (IfNull(p_inv.consolidated_invoice, "") == "")
& (p_inv.is_return == 0)
& (p_item.docstatus == 1)
& (p_item.item_code == item_code)
& (p_item.warehouse == warehouse)
)
).run(as_dict=True)
return reserved_qty[0].qty or 0 if reserved_qty else 0

View File

@@ -495,6 +495,67 @@ class TestPOSInvoice(unittest.TestCase):
self.assertRaises(frappe.ValidationError, pos.submit)
def test_value_error_on_serial_no_validation(self):
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item
se = make_serialized_item(
company="_Test Company",
target_warehouse="Stores - _TC",
cost_center="Main - _TC",
expense_account="Cost of Goods Sold - _TC",
)
serial_nos = se.get("items")[0].serial_no
# make a pos invoice
pos = create_pos_invoice(
company="_Test Company",
debit_to="Debtors - _TC",
account_for_change_amount="Cash - _TC",
warehouse="Stores - _TC",
income_account="Sales - _TC",
expense_account="Cost of Goods Sold - _TC",
cost_center="Main - _TC",
item=se.get("items")[0].item_code,
rate=1000,
qty=1,
do_not_save=1,
)
pos.get("items")[0].has_serial_no = 1
pos.get("items")[0].serial_no = serial_nos.split("\n")[0]
pos.set("payments", [])
pos.append(
"payments", {"mode_of_payment": "Cash", "account": "Cash - _TC", "amount": 1000, "default": 1}
)
pos = pos.save().submit()
# make a return
pos_return = make_sales_return(pos.name)
pos_return.paid_amount = pos_return.grand_total
pos_return.save()
pos_return.submit()
# set docstatus to 2 for pos to trigger this issue
frappe.db.set_value("POS Invoice", pos.name, "docstatus", 2)
pos2 = create_pos_invoice(
company="_Test Company",
debit_to="Debtors - _TC",
account_for_change_amount="Cash - _TC",
warehouse="Stores - _TC",
income_account="Sales - _TC",
expense_account="Cost of Goods Sold - _TC",
cost_center="Main - _TC",
item=se.get("items")[0].item_code,
rate=1000,
qty=1,
do_not_save=1,
)
pos2.get("items")[0].has_serial_no = 1
pos2.get("items")[0].serial_no = serial_nos.split("\n")[0]
# Value error should not be triggered on validation
pos2.save()
def test_loyalty_points(self):
from erpnext.accounts.doctype.loyalty_program.loyalty_program import (
get_loyalty_program_details_with_points,

View File

@@ -6,6 +6,7 @@
"engine": "InnoDB",
"field_order": [
"posting_date",
"posting_time",
"merge_invoices_based_on",
"column_break_3",
"pos_closing_entry",
@@ -105,12 +106,19 @@
"label": "Customer Group",
"mandatory_depends_on": "eval:doc.merge_invoices_based_on == 'Customer Group'",
"options": "Customer Group"
},
{
"fieldname": "posting_time",
"fieldtype": "Time",
"label": "Posting Time",
"no_copy": 1,
"reqd": 1
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2021-09-14 11:17:19.001142",
"modified": "2022-08-01 11:36:42.456429",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice Merge Log",
@@ -173,5 +181,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -9,7 +9,7 @@ from frappe import _
from frappe.core.page.background_jobs.background_jobs import get_info
from frappe.model.document import Document
from frappe.model.mapper import map_child_doc, map_doc
from frappe.utils import flt, getdate, nowdate
from frappe.utils import cint, flt, get_time, getdate, nowdate, nowtime
from frappe.utils.background_jobs import enqueue
from frappe.utils.scheduler import is_scheduler_inactive
@@ -18,6 +18,22 @@ class POSInvoiceMergeLog(Document):
def validate(self):
self.validate_customer()
self.validate_pos_invoice_status()
self.validate_duplicate_pos_invoices()
def validate_duplicate_pos_invoices(self):
pos_occurences = {}
for idx, inv in enumerate(self.pos_invoices, 1):
pos_occurences.setdefault(inv.pos_invoice, []).append(idx)
error_list = []
for key, value in pos_occurences.items():
if len(value) > 1:
error_list.append(
_("{} is added multiple times on rows: {}".format(frappe.bold(key), frappe.bold(value)))
)
if error_list:
frappe.throw(error_list, title=_("Duplicate POS Invoices found"), as_list=True)
def validate_customer(self):
if self.merge_invoices_based_on == "Customer Group":
@@ -79,6 +95,7 @@ class POSInvoiceMergeLog(Document):
if sales:
sales_invoice = self.process_merging_into_sales_invoice(sales)
self.flags.ignore_validate_update_after_submit = True
self.save() # save consolidated_sales_invoice & consolidated_credit_note ref in merge log
self.update_pos_invoices(pos_invoice_docs, sales_invoice, credit_note)
@@ -99,6 +116,7 @@ class POSInvoiceMergeLog(Document):
sales_invoice.is_consolidated = 1
sales_invoice.set_posting_time = 1
sales_invoice.posting_date = getdate(self.posting_date)
sales_invoice.posting_time = get_time(self.posting_time)
sales_invoice.save()
sales_invoice.submit()
@@ -115,6 +133,7 @@ class POSInvoiceMergeLog(Document):
credit_note.is_consolidated = 1
credit_note.set_posting_time = 1
credit_note.posting_date = getdate(self.posting_date)
credit_note.posting_time = get_time(self.posting_time)
# TODO: return could be against multiple sales invoice which could also have been consolidated?
# credit_note.return_against = self.consolidated_invoice
credit_note.save()
@@ -219,6 +238,9 @@ class POSInvoiceMergeLog(Document):
invoice.taxes_and_charges = None
invoice.ignore_pricing_rule = 1
invoice.customer = self.customer
invoice.disable_rounded_total = cint(
frappe.db.get_value("POS Profile", invoice.pos_profile, "disable_rounded_total")
)
if self.merge_invoices_based_on == "Customer Group":
invoice.flags.ignore_pos_profile = True
@@ -399,6 +421,9 @@ def create_merge_logs(invoice_by_customer, closing_entry=None):
merge_log.posting_date = (
getdate(closing_entry.get("posting_date")) if closing_entry else nowdate()
)
merge_log.posting_time = (
get_time(closing_entry.get("posting_time")) if closing_entry else nowtime()
)
merge_log.customer = customer
merge_log.pos_closing_entry = closing_entry.get("name") if closing_entry else None
@@ -418,12 +443,14 @@ def create_merge_logs(invoice_by_customer, closing_entry=None):
if closing_entry:
closing_entry.set_status(update=True, status="Failed")
if type(error_message) == list:
error_message = frappe.json.dumps(error_message)
closing_entry.db_set("error_message", error_message)
raise
finally:
frappe.db.commit()
frappe.publish_realtime("closing_process_complete", {"user": frappe.session.user})
frappe.publish_realtime("closing_process_complete", user=frappe.session.user)
def cancel_merge_logs(merge_logs, closing_entry=None):
@@ -450,7 +477,7 @@ def cancel_merge_logs(merge_logs, closing_entry=None):
finally:
frappe.db.commit()
frappe.publish_realtime("closing_process_complete", {"user": frappe.session.user})
frappe.publish_realtime("closing_process_complete", user=frappe.session.user)
def enqueue_job(job, **kwargs):

View File

@@ -43,7 +43,9 @@
"currency",
"write_off_account",
"write_off_cost_center",
"write_off_limit",
"account_for_change_amount",
"disable_rounded_total",
"column_break_23",
"income_account",
"expense_account",
@@ -358,6 +360,21 @@
"fieldname": "validate_stock_on_save",
"fieldtype": "Check",
"label": "Validate Stock on Save"
},
{
"default": "1",
"description": "Auto write off precision loss while consolidation",
"fieldname": "write_off_limit",
"fieldtype": "Currency",
"label": "Write Off Limit",
"reqd": 1
},
{
"default": "0",
"description": "If enabled, the consolidated invoices will have rounded total disabled",
"fieldname": "disable_rounded_total",
"fieldtype": "Check",
"label": "Disable Rounded Total"
}
],
"icon": "icon-cog",
@@ -385,7 +402,7 @@
"link_fieldname": "pos_profile"
}
],
"modified": "2022-03-21 13:29:28.480533",
"modified": "2022-08-10 12:57:06.241439",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Profile",

View File

@@ -36,10 +36,15 @@ class PricingRule(Document):
self.margin_rate_or_amount = 0.0
def validate_duplicate_apply_on(self):
field = apply_on_dict.get(self.apply_on)
values = [d.get(frappe.scrub(self.apply_on)) for d in self.get(field) if field]
if len(values) != len(set(values)):
frappe.throw(_("Duplicate {0} found in the table").format(self.apply_on))
if self.apply_on != "Transaction":
apply_on_table = apply_on_dict.get(self.apply_on)
if not apply_on_table:
return
apply_on_field = frappe.scrub(self.apply_on)
values = [d.get(apply_on_field) for d in self.get(apply_on_table) if d.get(apply_on_field)]
if len(values) != len(set(values)):
frappe.throw(_("Duplicate {0} found in the table").format(self.apply_on))
def validate_mandatory(self):
for apply_on, field in apply_on_dict.items():
@@ -264,6 +269,18 @@ def get_serial_no_for_item(args):
return item_details
def update_pricing_rule_uom(pricing_rule, args):
child_doc = {"Item Code": "items", "Item Group": "item_groups", "Brand": "brands"}.get(
pricing_rule.apply_on
)
apply_on_field = frappe.scrub(pricing_rule.apply_on)
for row in pricing_rule.get(child_doc):
if row.get(apply_on_field) == args.get(apply_on_field):
pricing_rule.uom = row.uom
def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=False):
from erpnext.accounts.doctype.pricing_rule.utils import (
get_applied_pricing_rules,
@@ -320,7 +337,8 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa
if isinstance(pricing_rule, string_types):
pricing_rule = frappe.get_cached_doc("Pricing Rule", pricing_rule)
pricing_rule.apply_rule_on_other_items = get_pricing_rule_items(pricing_rule)
update_pricing_rule_uom(pricing_rule, args)
pricing_rule.apply_rule_on_other_items = get_pricing_rule_items(pricing_rule) or []
if pricing_rule.get("suggestion"):
continue
@@ -434,12 +452,15 @@ def apply_price_discount_rule(pricing_rule, item_details, args):
if pricing_rule.currency == args.currency:
pricing_rule_rate = pricing_rule.rate
# TODO https://github.com/frappe/erpnext/pull/23636 solve this in some other way.
if pricing_rule_rate:
is_blank_uom = pricing_rule.get("uom") != args.get("uom")
# Override already set price list rate (from item price)
# if pricing_rule_rate > 0
item_details.update(
{
"price_list_rate": pricing_rule_rate * args.get("conversion_factor", 1),
"price_list_rate": pricing_rule_rate
* (args.get("conversion_factor", 1) if is_blank_uom else 1),
}
)
item_details.update({"discount_percentage": 0.0})

View File

@@ -597,6 +597,255 @@ class TestPricingRule(unittest.TestCase):
frappe.get_doc("Item Price", {"item_code": "Water Flask"}).delete()
item.delete()
def test_item_price_with_blank_uom_pricing_rule(self):
properties = {
"item_code": "Item Blank UOM",
"stock_uom": "Nos",
"sales_uom": "Box",
"uoms": [dict(uom="Box", conversion_factor=10)],
}
item = make_item(properties=properties)
make_item_price("Item Blank UOM", "_Test Price List", 100)
pricing_rule_record = {
"doctype": "Pricing Rule",
"title": "_Test Item Blank UOM Rule",
"apply_on": "Item Code",
"items": [
{
"item_code": "Item Blank UOM",
}
],
"selling": 1,
"currency": "INR",
"rate_or_discount": "Rate",
"rate": 101,
"company": "_Test Company",
}
rule = frappe.get_doc(pricing_rule_record)
rule.insert()
si = create_sales_invoice(
do_not_save=True, item_code="Item Blank UOM", uom="Box", conversion_factor=10
)
si.selling_price_list = "_Test Price List"
si.save()
# If UOM is blank consider it as stock UOM and apply pricing_rule on all UOM.
# rate is 101, Selling UOM is Box that have conversion_factor of 10 so 101 * 10 = 1010
self.assertEqual(si.items[0].price_list_rate, 1010)
self.assertEqual(si.items[0].rate, 1010)
si.delete()
si = create_sales_invoice(do_not_save=True, item_code="Item Blank UOM", uom="Nos")
si.selling_price_list = "_Test Price List"
si.save()
# UOM is blank so consider it as stock UOM and apply pricing_rule on all UOM.
# rate is 101, Selling UOM is Nos that have conversion_factor of 1 so 101 * 1 = 101
self.assertEqual(si.items[0].price_list_rate, 101)
self.assertEqual(si.items[0].rate, 101)
si.delete()
rule.delete()
frappe.get_doc("Item Price", {"item_code": "Item Blank UOM"}).delete()
item.delete()
def test_item_price_with_selling_uom_pricing_rule(self):
properties = {
"item_code": "Item UOM other than Stock",
"stock_uom": "Nos",
"sales_uom": "Box",
"uoms": [dict(uom="Box", conversion_factor=10)],
}
item = make_item(properties=properties)
make_item_price("Item UOM other than Stock", "_Test Price List", 100)
pricing_rule_record = {
"doctype": "Pricing Rule",
"title": "_Test Item UOM other than Stock Rule",
"apply_on": "Item Code",
"items": [
{
"item_code": "Item UOM other than Stock",
"uom": "Box",
}
],
"selling": 1,
"currency": "INR",
"rate_or_discount": "Rate",
"rate": 101,
"company": "_Test Company",
}
rule = frappe.get_doc(pricing_rule_record)
rule.insert()
si = create_sales_invoice(
do_not_save=True, item_code="Item UOM other than Stock", uom="Box", conversion_factor=10
)
si.selling_price_list = "_Test Price List"
si.save()
# UOM is Box so apply pricing_rule only on Box UOM.
# Selling UOM is Box and as both UOM are same no need to multiply by conversion_factor.
self.assertEqual(si.items[0].price_list_rate, 101)
self.assertEqual(si.items[0].rate, 101)
si.delete()
si = create_sales_invoice(do_not_save=True, item_code="Item UOM other than Stock", uom="Nos")
si.selling_price_list = "_Test Price List"
si.save()
# UOM is Box so pricing_rule won't apply as selling_uom is Nos.
# As Pricing Rule is not applied price of 100 will be fetched from Item Price List.
self.assertEqual(si.items[0].price_list_rate, 100)
self.assertEqual(si.items[0].rate, 100)
si.delete()
rule.delete()
frappe.get_doc("Item Price", {"item_code": "Item UOM other than Stock"}).delete()
item.delete()
def test_item_group_price_with_blank_uom_pricing_rule(self):
group = frappe.get_doc(
doctype="Item Group",
item_group_name="_Test Pricing Rule Item Group",
parent_item_group="All Item Groups",
)
group.save()
properties = {
"item_code": "Item with Group Blank UOM",
"item_group": "_Test Pricing Rule Item Group",
"stock_uom": "Nos",
"sales_uom": "Box",
"uoms": [dict(uom="Box", conversion_factor=10)],
}
item = make_item(properties=properties)
make_item_price("Item with Group Blank UOM", "_Test Price List", 100)
pricing_rule_record = {
"doctype": "Pricing Rule",
"title": "_Test Item with Group Blank UOM Rule",
"apply_on": "Item Group",
"item_groups": [
{
"item_group": "_Test Pricing Rule Item Group",
}
],
"selling": 1,
"currency": "INR",
"rate_or_discount": "Rate",
"rate": 101,
"company": "_Test Company",
}
rule = frappe.get_doc(pricing_rule_record)
rule.insert()
si = create_sales_invoice(
do_not_save=True, item_code="Item with Group Blank UOM", uom="Box", conversion_factor=10
)
si.selling_price_list = "_Test Price List"
si.save()
# If UOM is blank consider it as stock UOM and apply pricing_rule on all UOM.
# rate is 101, Selling UOM is Box that have conversion_factor of 10 so 101 * 10 = 1010
self.assertEqual(si.items[0].price_list_rate, 1010)
self.assertEqual(si.items[0].rate, 1010)
si.delete()
si = create_sales_invoice(do_not_save=True, item_code="Item with Group Blank UOM", uom="Nos")
si.selling_price_list = "_Test Price List"
si.save()
# UOM is blank so consider it as stock UOM and apply pricing_rule on all UOM.
# rate is 101, Selling UOM is Nos that have conversion_factor of 1 so 101 * 1 = 101
self.assertEqual(si.items[0].price_list_rate, 101)
self.assertEqual(si.items[0].rate, 101)
si.delete()
rule.delete()
frappe.get_doc("Item Price", {"item_code": "Item with Group Blank UOM"}).delete()
item.delete()
group.delete()
def test_item_group_price_with_selling_uom_pricing_rule(self):
group = frappe.get_doc(
doctype="Item Group",
item_group_name="_Test Pricing Rule Item Group UOM",
parent_item_group="All Item Groups",
)
group.save()
properties = {
"item_code": "Item with Group UOM other than Stock",
"item_group": "_Test Pricing Rule Item Group UOM",
"stock_uom": "Nos",
"sales_uom": "Box",
"uoms": [dict(uom="Box", conversion_factor=10)],
}
item = make_item(properties=properties)
make_item_price("Item with Group UOM other than Stock", "_Test Price List", 100)
pricing_rule_record = {
"doctype": "Pricing Rule",
"title": "_Test Item with Group UOM other than Stock Rule",
"apply_on": "Item Group",
"item_groups": [
{
"item_group": "_Test Pricing Rule Item Group UOM",
"uom": "Box",
}
],
"selling": 1,
"currency": "INR",
"rate_or_discount": "Rate",
"rate": 101,
"company": "_Test Company",
}
rule = frappe.get_doc(pricing_rule_record)
rule.insert()
si = create_sales_invoice(
do_not_save=True,
item_code="Item with Group UOM other than Stock",
uom="Box",
conversion_factor=10,
)
si.selling_price_list = "_Test Price List"
si.save()
# UOM is Box so apply pricing_rule only on Box UOM.
# Selling UOM is Box and as both UOM are same no need to multiply by conversion_factor.
self.assertEqual(si.items[0].price_list_rate, 101)
self.assertEqual(si.items[0].rate, 101)
si.delete()
si = create_sales_invoice(
do_not_save=True, item_code="Item with Group UOM other than Stock", uom="Nos"
)
si.selling_price_list = "_Test Price List"
si.save()
# UOM is Box so pricing_rule won't apply as selling_uom is Nos.
# As Pricing Rule is not applied price of 100 will be fetched from Item Price List.
self.assertEqual(si.items[0].price_list_rate, 100)
self.assertEqual(si.items[0].rate, 100)
si.delete()
rule.delete()
frappe.get_doc("Item Price", {"item_code": "Item with Group UOM other than Stock"}).delete()
item.delete()
group.delete()
def test_pricing_rule_for_different_currency(self):
make_item("Test Sanitizer Item")
@@ -712,7 +961,7 @@ class TestPricingRule(unittest.TestCase):
title="_Test Pricing Rule with Min Qty - 2",
)
si = create_sales_invoice(do_not_submit=True, customer="_Test Customer 1", qty=1, currency="USD")
si = create_sales_invoice(do_not_submit=True, customer="_Test Customer 1", qty=1)
item = si.items[0]
item.stock_qty = 1
si.save()

View File

@@ -111,6 +111,12 @@ def _get_pricing_rules(apply_on, args, values):
)
if apply_on_field == "item_code":
if args.get("uom", None):
item_conditions += (
" and ({child_doc}.uom='{item_uom}' or IFNULL({child_doc}.uom, '')='')".format(
child_doc=child_doc, item_uom=args.get("uom")
)
)
if "variant_of" not in args:
args.variant_of = frappe.get_cached_value("Item", args.item_code, "variant_of")
@@ -121,7 +127,12 @@ def _get_pricing_rules(apply_on, args, values):
values["variant_of"] = args.variant_of
elif apply_on_field == "item_group":
item_conditions = _get_tree_conditions(args, "Item Group", child_doc, False)
if args.get("uom", None):
item_conditions += (
" and ({child_doc}.uom='{item_uom}' or IFNULL({child_doc}.uom, '')='')".format(
child_doc=child_doc, item_uom=args.get("uom")
)
)
conditions += get_other_conditions(conditions, values, args)
warehouse_conditions = _get_tree_conditions(args, "Warehouse", "`tabPricing Rule`")
if warehouse_conditions:

View File

@@ -34,4 +34,4 @@ class ProcessDeferredAccounting(Document):
filters={"against_voucher_type": self.doctype, "against_voucher": self.name},
)
make_gl_entries(gl_entries=gl_entries, cancel=1)
make_gl_entries(gl_map=gl_entries, cancel=1)

View File

@@ -57,3 +57,16 @@ class TestProcessDeferredAccounting(unittest.TestCase):
]
check_gl_entries(self, si.name, expected_gle, "2019-01-10")
def test_pda_submission_and_cancellation(self):
pda = frappe.get_doc(
dict(
doctype="Process Deferred Accounting",
posting_date="2019-01-01",
start_date="2019-01-01",
end_date="2019-01-31",
type="Income",
)
)
pda.submit()
pda.cancel()

View File

@@ -15,7 +15,7 @@
</div>
<h2 class="text-center">{{ _("STATEMENTS OF ACCOUNTS") }}</h2>
<div>
<h5 style="float: left;">{{ _("Customer: ") }} <b>{{filters.party[0] }}</b></h5>
<h5 style="float: left;">{{ _("Customer: ") }} <b>{{filters.party_name[0] }}</b></h5>
<h5 style="float: right;">
{{ _("Date: ") }}
<b>{{ frappe.format(filters.from_date, 'Date')}}
@@ -25,7 +25,7 @@
</div>
<br>
<table class="table table-bordered">
<table class="table table-bordered" style="font-size: 10px">
<thead>
<tr>
<th style="width: 12%">{{ _("Date") }}</th>
@@ -49,7 +49,6 @@
<br>
{% endif %}
{{ _("Against") }}: {{ row.against }}
<br>{{ _("Remarks") }}: {{ row.remarks }}
{% if row.bill_no %}
<br>{{ _("Supplier Invoice No") }}: {{ row.bill_no }}

View File

@@ -8,7 +8,8 @@ frappe.ui.form.on('Process Statement Of Accounts', {
},
refresh: function(frm){
if(!frm.doc.__islocal) {
frm.add_custom_button('Send Emails',function(){
frm.add_custom_button(__('Send Emails'), function(){
if (frm.is_dirty()) frappe.throw(__("Please save before proceeding."))
frappe.call({
method: "erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts.send_emails",
args: {
@@ -24,8 +25,9 @@ frappe.ui.form.on('Process Statement Of Accounts', {
}
});
});
frm.add_custom_button('Download',function(){
var url = frappe.urllib.get_full_url(
frm.add_custom_button(__('Download'), function(){
if (frm.is_dirty()) frappe.throw(__("Please save before proceeding."))
let url = frappe.urllib.get_full_url(
'/api/method/erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts.download_statements?'
+ 'document_name='+encodeURIComponent(frm.doc.name))
$.ajax({

View File

@@ -27,6 +27,7 @@
"customers",
"preferences",
"orientation",
"include_break",
"include_ageing",
"ageing_based_on",
"section_break_14",
@@ -284,10 +285,16 @@
"fieldtype": "Link",
"label": "Terms and Conditions",
"options": "Terms and Conditions"
},
{
"default": "1",
"fieldname": "include_break",
"fieldtype": "Check",
"label": "Page Break After Each SoA"
}
],
"links": [],
"modified": "2021-09-06 21:00:45.732505",
"modified": "2022-10-17 17:47:08.662475",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Statement Of Accounts",
@@ -320,5 +327,6 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -6,6 +6,7 @@ import copy
import frappe
from frappe import _
from frappe.desk.reportview import get_match_cond
from frappe.model.document import Document
from frappe.utils import add_days, add_months, format_date, getdate, today
from frappe.utils.jinja import validate_template
@@ -23,7 +24,7 @@ from erpnext.accounts.report.general_ledger.general_ledger import execute as get
class ProcessStatementOfAccounts(Document):
def validate(self):
if not self.subject:
self.subject = "Statement Of Accounts for {{ customer.name }}"
self.subject = "Statement Of Accounts for {{ customer.customer_name }}"
if not self.body:
self.body = "Hello {{ customer.name }},<br>PFA your Statement Of Accounts from {{ doc.from_date }} to {{ doc.to_date }}."
@@ -86,6 +87,7 @@ def get_report_pdf(doc, consolidated=True):
"account": [doc.account] if doc.account else None,
"party_type": "Customer",
"party": [entry.customer],
"party_name": [entry.customer_name] if entry.customer_name else None,
"presentation_currency": presentation_currency,
"group_by": doc.group_by,
"currency": doc.currency,
@@ -128,7 +130,8 @@ def get_report_pdf(doc, consolidated=True):
if not bool(statement_dict):
return False
elif consolidated:
result = "".join(list(statement_dict.values()))
delimiter = '<div style="page-break-before: always;"></div>' if doc.include_break else ""
result = delimiter.join(list(statement_dict.values()))
return get_pdf(result, {"orientation": doc.orientation})
else:
for customer, statement_html in statement_dict.items():
@@ -153,7 +156,7 @@ def get_customers_based_on_territory_or_customer_group(customer_collection, coll
]
return frappe.get_list(
"Customer",
fields=["name", "email_id"],
fields=["name", "customer_name", "email_id"],
filters=[[fields_dict[customer_collection], "IN", selected]],
)
@@ -176,7 +179,7 @@ def get_customers_based_on_sales_person(sales_person):
if sales_person_records.get("Customer"):
return frappe.get_list(
"Customer",
fields=["name", "email_id"],
fields=["name", "customer_name", "email_id"],
filters=[["name", "in", list(sales_person_records["Customer"])]],
)
else:
@@ -225,7 +228,7 @@ def fetch_customers(customer_collection, collection_name, primary_mandatory):
if customer_collection == "Sales Partner":
customers = frappe.get_list(
"Customer",
fields=["name", "email_id"],
fields=["name", "customer_name", "email_id"],
filters=[["default_sales_partner", "=", collection_name]],
)
else:
@@ -240,11 +243,14 @@ def fetch_customers(customer_collection, collection_name, primary_mandatory):
if int(primary_mandatory):
if primary_email == "":
continue
elif (billing_email == "") and (primary_email == ""):
continue
customer_list.append(
{"name": customer.name, "primary_email": primary_email, "billing_email": billing_email}
{
"name": customer.name,
"customer_name": customer.customer_name,
"primary_email": primary_email,
"billing_email": billing_email,
}
)
return customer_list
@@ -273,8 +279,12 @@ def get_customer_emails(customer_name, primary_mandatory, billing_and_primary=Tr
link.link_doctype='Customer'
and link.link_name=%s
and contact.is_billing_contact=1
{mcond}
ORDER BY
contact.creation desc""",
contact.creation desc
""".format(
mcond=get_match_cond("Contact")
),
customer_name,
)
@@ -313,6 +323,8 @@ def send_emails(document_name, from_scheduler=False):
attachments = [{"fname": customer + ".pdf", "fcontent": report_pdf}]
recipients, cc = get_recipients_and_cc(customer, doc)
if not recipients:
continue
context = get_context(customer, doc)
subject = frappe.render_template(doc.subject, context)
message = frappe.render_template(doc.body, context)

View File

@@ -1,12 +1,12 @@
{
"actions": [],
"allow_workflow": 1,
"creation": "2020-08-03 16:35:21.852178",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"customer",
"customer_name",
"billing_email",
"primary_email"
],
@@ -30,11 +30,18 @@
"fieldtype": "Read Only",
"in_list_view": 1,
"label": "Billing Email"
},
{
"fetch_from": "customer.customer_name",
"fieldname": "customer_name",
"fieldtype": "Data",
"label": "Customer Name",
"read_only": 1
}
],
"istable": 1,
"links": [],
"modified": "2020-08-03 22:55:38.875601",
"modified": "2023-03-13 00:12:34.508086",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Process Statement Of Accounts Customer",
@@ -43,5 +50,6 @@
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -31,7 +31,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
this._super();
// Ignore linked advances
this.frm.ignore_doctypes_on_cancel_all = ['Journal Entry', 'Payment Entry'];
this.frm.ignore_doctypes_on_cancel_all = ['Journal Entry', 'Payment Entry', 'Purchase Invoice'];
if(!this.frm.doc.__islocal) {
// show credit_to in print format
@@ -45,8 +45,6 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
if (this.frm.doc.supplier && this.frm.doc.__islocal) {
this.frm.trigger('supplier');
}
erpnext.accounts.dimensions.setup_dimension_filters(this.frm, this.frm.doctype);
},
refresh: function(doc) {
@@ -83,8 +81,12 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
}
if(doc.docstatus == 1 && doc.outstanding_amount != 0
&& !(doc.is_return && doc.return_against)) {
this.frm.add_custom_button(__('Payment'), this.make_payment_entry, __('Create'));
&& !(doc.is_return && doc.return_against) && !doc.on_hold) {
this.frm.add_custom_button(
__('Payment'),
() => this.make_payment_entry(),
__('Create')
);
cur_frm.page.set_inner_btn_group_as_primary(__('Create'));
}
@@ -301,7 +303,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
apply_tds: function(frm) {
var me = this;
me.frm.set_value("tax_withheld_vouchers", []);
if (!me.frm.doc.apply_tds) {
me.frm.set_value("tax_withholding_category", '');
me.frm.set_df_property("tax_withholding_category", "hidden", 1);
@@ -541,7 +543,7 @@ frappe.ui.form.on("Purchase Invoice", {
},
add_custom_buttons: function(frm) {
if (frm.doc.per_received < 100) {
if (frm.doc.docstatus == 1 && frm.doc.per_received < 100) {
frm.add_custom_button(__('Purchase Receipt'), () => {
frm.events.make_purchase_receipt(frm);
}, __('Create'));
@@ -571,6 +573,10 @@ frappe.ui.form.on("Purchase Invoice", {
erpnext.queries.setup_queries(frm, "Warehouse", function() {
return erpnext.queries.warehouse(frm.doc);
});
if (frm.is_new()) {
frm.clear_table("tax_withheld_vouchers");
}
},
is_subcontracted: function(frm) {

View File

@@ -83,6 +83,8 @@
"section_break_51",
"taxes_and_charges",
"taxes",
"tax_withheld_vouchers_section",
"tax_withheld_vouchers",
"sec_tax_breakup",
"other_charges_calculation",
"totals",
@@ -511,7 +513,6 @@
"fieldname": "ignore_pricing_rule",
"fieldtype": "Check",
"label": "Ignore Pricing Rule",
"no_copy": 1,
"permlevel": 1,
"print_hide": 1
},
@@ -1417,13 +1418,26 @@
"label": "Advance Tax",
"options": "Advance Tax",
"read_only": 1
},
{
"fieldname": "tax_withheld_vouchers_section",
"fieldtype": "Section Break",
"label": "Tax Withheld Vouchers"
},
{
"fieldname": "tax_withheld_vouchers",
"fieldtype": "Table",
"label": "Tax Withheld Vouchers",
"no_copy": 1,
"options": "Tax Withheld Vouchers",
"read_only": 1
}
],
"icon": "fa fa-file-text",
"idx": 204,
"is_submittable": 1,
"links": [],
"modified": "2021-11-25 13:31:02.716727",
"modified": "2022-10-07 14:19:14.214157",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",
@@ -1483,7 +1497,8 @@
"show_name_in_global_search": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"timeline_field": "supplier",
"title_field": "title",
"track_changes": 1
}
}

View File

@@ -67,6 +67,9 @@ class PurchaseInvoice(BuyingController):
supplier_tds = frappe.db.get_value("Supplier", self.supplier, "tax_withholding_category")
self.set_onload("supplier_tds", supplier_tds)
if self.is_new():
self.set("tax_withheld_vouchers", [])
def before_save(self):
if not self.on_hold:
self.release_date = ""
@@ -158,20 +161,10 @@ class PurchaseInvoice(BuyingController):
if tds_category and not for_validate:
self.apply_tds = 1
self.tax_withholding_category = tds_category
self.set_onload("supplier_tds", tds_category)
super(PurchaseInvoice, self).set_missing_values(for_validate)
def check_conversion_rate(self):
default_currency = erpnext.get_company_currency(self.company)
if not default_currency:
throw(_("Please enter default currency in Company Master"))
if (
(self.currency == default_currency and flt(self.conversion_rate) != 1.00)
or not self.conversion_rate
or (self.currency != default_currency and flt(self.conversion_rate) == 1.00)
):
throw(_("Conversion rate cannot be 0 or 1"))
def validate_credit_to_acc(self):
if not self.credit_to:
self.credit_to = get_party_account("Supplier", self.supplier, self.company)
@@ -268,9 +261,7 @@ class PurchaseInvoice(BuyingController):
stock_not_billed_account = self.get_company_default("stock_received_but_not_billed")
stock_items = self.get_stock_items()
asset_items = [d.is_fixed_asset for d in self.items if d.is_fixed_asset]
if len(asset_items) > 0:
asset_received_but_not_billed = self.get_company_default("asset_received_but_not_billed")
asset_received_but_not_billed = None
if self.update_stock:
self.validate_item_code()
@@ -364,6 +355,8 @@ class PurchaseInvoice(BuyingController):
)
item.expense_account = asset_category_account
elif item.is_fixed_asset and item.pr_detail:
if not asset_received_but_not_billed:
asset_received_but_not_billed = self.get_company_default("asset_received_but_not_billed")
item.expense_account = asset_received_but_not_billed
elif not item.expense_account and for_validate:
throw(_("Expense account is mandatory for item {0}").format(item.item_code or item.item_name))
@@ -540,7 +533,16 @@ class PurchaseInvoice(BuyingController):
from_repost=from_repost,
)
elif self.docstatus == 2:
provisional_entries = [a for a in gl_entries if a.voucher_type == "Purchase Receipt"]
make_reverse_gl_entries(voucher_type=self.doctype, voucher_no=self.name)
if provisional_entries:
for entry in provisional_entries:
frappe.db.set_value(
"GL Entry",
{"voucher_type": "Purchase Receipt", "voucher_detail_no": entry.voucher_detail_no},
"is_cancelled",
1,
)
if update_outstanding == "No":
update_outstanding_amt(
@@ -568,7 +570,6 @@ class PurchaseInvoice(BuyingController):
self.make_supplier_gl_entry(gl_entries)
self.make_item_gl_entries(gl_entries)
self.make_discount_gl_entries(gl_entries)
if self.check_asset_cwip_enabled():
self.get_asset_gl_entry(gl_entries)
@@ -597,7 +598,7 @@ class PurchaseInvoice(BuyingController):
def make_supplier_gl_entry(self, gl_entries):
# Checked both rounding_adjustment and rounded_total
# because rounded_total had value even before introcution of posting GLE based on rounded total
# because rounded_total had value even before introduction of posting GLE based on rounded total
grand_total = (
self.rounded_total if (self.rounding_adjustment and self.rounded_total) else self.grand_total
)
@@ -697,6 +698,10 @@ class PurchaseInvoice(BuyingController):
)
)
credit_amount = item.base_net_amount
if self.is_internal_supplier and item.valuation_rate:
credit_amount = flt(item.valuation_rate * item.stock_qty)
# Intentionally passed negative debit amount to avoid incorrect GL Entry validation
gl_entries.append(
self.get_gl_dict(
@@ -706,7 +711,7 @@ class PurchaseInvoice(BuyingController):
"cost_center": item.cost_center,
"project": item.project or self.project,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"debit": -1 * flt(item.base_net_amount, item.precision("base_net_amount")),
"debit": -1 * flt(credit_amount, item.precision("base_net_amount")),
},
warehouse_account[item.from_warehouse]["account_currency"],
item=item,
@@ -794,10 +799,7 @@ class PurchaseInvoice(BuyingController):
else item.deferred_expense_account
)
if not item.is_fixed_asset:
dummy, amount = self.get_amount_and_base_amount(item, self.enable_discount_accounting)
else:
amount = flt(item.base_net_amount + item.item_tax_amount, item.precision("base_net_amount"))
dummy, amount = self.get_amount_and_base_amount(item, None)
if provisional_accounting_for_non_stock_items:
if item.purchase_receipt:
@@ -922,8 +924,9 @@ class PurchaseInvoice(BuyingController):
)
def get_asset_gl_entry(self, gl_entries):
arbnb_account = self.get_company_default("asset_received_but_not_billed")
eiiav_account = self.get_company_default("expenses_included_in_asset_valuation")
arbnb_account = None
eiiav_account = None
asset_eiiav_currency = None
for item in self.get("items"):
if item.is_fixed_asset:
@@ -935,6 +938,8 @@ class PurchaseInvoice(BuyingController):
"Asset Received But Not Billed",
"Fixed Asset",
]:
if not arbnb_account:
arbnb_account = self.get_company_default("asset_received_but_not_billed")
item.expense_account = arbnb_account
if not self.update_stock:
@@ -957,7 +962,10 @@ class PurchaseInvoice(BuyingController):
)
if item.item_tax_amount:
asset_eiiav_currency = get_account_currency(eiiav_account)
if not eiiav_account or not asset_eiiav_currency:
eiiav_account = self.get_company_default("expenses_included_in_asset_valuation")
asset_eiiav_currency = get_account_currency(eiiav_account)
gl_entries.append(
self.get_gl_dict(
{
@@ -1000,7 +1008,10 @@ class PurchaseInvoice(BuyingController):
)
if item.item_tax_amount and not cint(erpnext.is_perpetual_inventory_enabled(self.company)):
asset_eiiav_currency = get_account_currency(eiiav_account)
if not eiiav_account or not asset_eiiav_currency:
eiiav_account = self.get_company_default("expenses_included_in_asset_valuation")
asset_eiiav_currency = get_account_currency(eiiav_account)
gl_entries.append(
self.get_gl_dict(
{
@@ -1020,47 +1031,46 @@ class PurchaseInvoice(BuyingController):
)
)
# When update stock is checked
# Assets are bought through this document then it will be linked to this document
if self.update_stock:
if flt(item.landed_cost_voucher_amount):
gl_entries.append(
self.get_gl_dict(
{
"account": eiiav_account,
"against": cwip_account,
"cost_center": item.cost_center,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"credit": flt(item.landed_cost_voucher_amount),
"project": item.project or self.project,
},
item=item,
)
)
if flt(item.landed_cost_voucher_amount):
if not eiiav_account:
eiiav_account = self.get_company_default("expenses_included_in_asset_valuation")
gl_entries.append(
self.get_gl_dict(
{
"account": cwip_account,
"against": eiiav_account,
"cost_center": item.cost_center,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"debit": flt(item.landed_cost_voucher_amount),
"project": item.project or self.project,
},
item=item,
)
gl_entries.append(
self.get_gl_dict(
{
"account": eiiav_account,
"against": cwip_account,
"cost_center": item.cost_center,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"credit": flt(item.landed_cost_voucher_amount),
"project": item.project or self.project,
},
item=item,
)
# update gross amount of assets bought through this document
assets = frappe.db.get_all(
"Asset", filters={"purchase_invoice": self.name, "item_code": item.item_code}
)
for asset in assets:
frappe.db.set_value("Asset", asset.name, "gross_purchase_amount", flt(item.valuation_rate))
frappe.db.set_value(
"Asset", asset.name, "purchase_receipt_amount", flt(item.valuation_rate)
gl_entries.append(
self.get_gl_dict(
{
"account": cwip_account,
"against": eiiav_account,
"cost_center": item.cost_center,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"debit": flt(item.landed_cost_voucher_amount),
"project": item.project or self.project,
},
item=item,
)
)
# update gross amount of assets bought through this document
assets = frappe.db.get_all(
"Asset", filters={"purchase_invoice": self.name, "item_code": item.item_code}
)
for asset in assets:
frappe.db.set_value("Asset", asset.name, "gross_purchase_amount", flt(item.valuation_rate))
frappe.db.set_value("Asset", asset.name, "purchase_receipt_amount", flt(item.valuation_rate))
return gl_entries
@@ -1078,7 +1088,7 @@ class PurchaseInvoice(BuyingController):
# Stock ledger value is not matching with the warehouse amount
if (
self.update_stock
and voucher_wise_stock_value.get(item.name)
and voucher_wise_stock_value.get((item.name, item.warehouse))
and warehouse_debit_amount
!= flt(voucher_wise_stock_value.get((item.name, item.warehouse)), net_amt_precision)
):
@@ -1111,7 +1121,7 @@ class PurchaseInvoice(BuyingController):
valuation_tax = {}
for tax in self.get("taxes"):
amount, base_amount = self.get_tax_amounts(tax, self.enable_discount_accounting)
amount, base_amount = self.get_tax_amounts(tax, None)
if tax.category in ("Total", "Valuation and Total") and flt(base_amount):
account_currency = get_account_currency(tax.account_head)
@@ -1366,7 +1376,14 @@ class PurchaseInvoice(BuyingController):
frappe.db.set(self, "status", "Cancelled")
unlink_inter_company_doc(self.doctype, self.name, self.inter_company_invoice_reference)
self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry", "Repost Item Valuation")
self.ignore_linked_doctypes = (
"GL Entry",
"Stock Ledger Entry",
"Repost Item Valuation",
"Tax Withheld Vouchers",
)
self.update_advance_tax_references(cancel=1)
def update_project(self):
@@ -1459,7 +1476,7 @@ class PurchaseInvoice(BuyingController):
if not self.tax_withholding_category:
return
tax_withholding_details, advance_taxes = get_party_tax_withholding_details(
tax_withholding_details, advance_taxes, voucher_wise_amount = get_party_tax_withholding_details(
self, self.tax_withholding_category
)
@@ -1488,6 +1505,19 @@ class PurchaseInvoice(BuyingController):
for d in to_remove:
self.remove(d)
## Add pending vouchers on which tax was withheld
self.set("tax_withheld_vouchers", [])
for voucher_no, voucher_details in voucher_wise_amount.items():
self.append(
"tax_withheld_vouchers",
{
"voucher_name": voucher_no,
"voucher_type": voucher_details.get("voucher_type"),
"taxable_amount": voucher_details.get("amount"),
},
)
# calculate totals again after applying TDS
self.calculate_taxes_and_totals()
@@ -1690,4 +1720,6 @@ def make_purchase_receipt(source_name, target_doc=None):
target_doc,
)
doc.set_onload("ignore_price_list", True)
return doc

View File

@@ -26,12 +26,13 @@ from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import (
make_purchase_receipt,
)
from erpnext.stock.doctype.stock_entry.test_stock_entry import get_qty_after_transaction
from erpnext.stock.tests.test_utils import StockTestMixin
test_dependencies = ["Item", "Cost Center", "Payment Term", "Payment Terms Template"]
test_ignore = ["Serial No"]
class TestPurchaseInvoice(unittest.TestCase):
class TestPurchaseInvoice(unittest.TestCase, StockTestMixin):
@classmethod
def setUpClass(self):
unlink_payment_on_cancel_of_invoice()
@@ -303,59 +304,6 @@ class TestPurchaseInvoice(unittest.TestCase):
self.assertEqual(expected_values[gle.account][1], gle.debit)
self.assertEqual(expected_values[gle.account][2], gle.credit)
def test_purchase_invoice_with_discount_accounting_enabled(self):
enable_discount_accounting()
discount_account = create_account(
account_name="Discount Account",
parent_account="Indirect Expenses - _TC",
company="_Test Company",
)
pi = make_purchase_invoice(discount_account=discount_account, rate=45)
expected_gle = [
["_Test Account Cost for Goods Sold - _TC", 250.0, 0.0, nowdate()],
["Creditors - _TC", 0.0, 225.0, nowdate()],
["Discount Account - _TC", 0.0, 25.0, nowdate()],
]
check_gl_entries(self, pi.name, expected_gle, nowdate())
enable_discount_accounting(enable=0)
def test_additional_discount_for_purchase_invoice_with_discount_accounting_enabled(self):
enable_discount_accounting()
additional_discount_account = create_account(
account_name="Discount Account",
parent_account="Indirect Expenses - _TC",
company="_Test Company",
)
pi = make_purchase_invoice(do_not_save=1, parent_cost_center="Main - _TC")
pi.apply_discount_on = "Grand Total"
pi.additional_discount_account = additional_discount_account
pi.additional_discount_percentage = 10
pi.disable_rounded_total = 1
pi.append(
"taxes",
{
"charge_type": "On Net Total",
"account_head": "_Test Account VAT - _TC",
"cost_center": "Main - _TC",
"description": "Test",
"rate": 10,
},
)
pi.submit()
expected_gle = [
["_Test Account Cost for Goods Sold - _TC", 250.0, 0.0, nowdate()],
["_Test Account VAT - _TC", 25.0, 0.0, nowdate()],
["Creditors - _TC", 0.0, 247.5, nowdate()],
["Discount Account - _TC", 0.0, 27.5, nowdate()],
]
check_gl_entries(self, pi.name, expected_gle, nowdate())
def test_purchase_invoice_change_naming_series(self):
pi = frappe.copy_doc(test_records[1])
pi.insert()
@@ -659,6 +607,80 @@ class TestPurchaseInvoice(unittest.TestCase):
self.assertEqual(expected_values[gle.account][0], gle.debit)
self.assertEqual(expected_values[gle.account][1], gle.credit)
def test_standalone_return_using_pi(self):
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry
item = self.make_item().name
company = "_Test Company with perpetual inventory"
warehouse = "Stores - TCP1"
make_stock_entry(item_code=item, target=warehouse, qty=50, rate=120)
return_pi = make_purchase_invoice(
is_return=1,
item=item,
qty=-10,
update_stock=1,
rate=100,
company=company,
warehouse=warehouse,
cost_center="Main - TCP1",
)
# assert that stock consumption is with actual rate
self.assertGLEs(
return_pi,
[{"credit": 1200, "debit": 0}],
gle_filters={"account": "Stock In Hand - TCP1"},
)
# assert loss booked in COGS
self.assertGLEs(
return_pi,
[{"credit": 0, "debit": 200}],
gle_filters={"account": "Cost of Goods Sold - TCP1"},
)
def test_return_with_lcv(self):
from erpnext.controllers.sales_and_purchase_return import make_return_doc
from erpnext.stock.doctype.landed_cost_voucher.test_landed_cost_voucher import (
create_landed_cost_voucher,
)
item = self.make_item().name
company = "_Test Company with perpetual inventory"
warehouse = "Stores - TCP1"
cost_center = "Main - TCP1"
pi = make_purchase_invoice(
item=item,
company=company,
warehouse=warehouse,
cost_center=cost_center,
update_stock=1,
qty=10,
rate=100,
)
# Create landed cost voucher - will increase valuation of received item by 10
create_landed_cost_voucher("Purchase Invoice", pi.name, pi.company, charges=100)
return_pi = make_return_doc(pi.doctype, pi.name)
return_pi.save().submit()
# assert that stock consumption is with actual in rate
self.assertGLEs(
return_pi,
[{"credit": 1100, "debit": 0}],
gle_filters={"account": "Stock In Hand - TCP1"},
)
# assert loss booked in COGS
self.assertGLEs(
return_pi,
[{"credit": 0, "debit": 100}],
gle_filters={"account": "Cost of Goods Sold - TCP1"},
)
def test_multi_currency_gle(self):
pi = make_purchase_invoice(
supplier="_Test Supplier USD",
@@ -1492,9 +1514,142 @@ class TestPurchaseInvoice(unittest.TestCase):
check_gl_entries(self, pr.name, expected_gle_for_purchase_receipt, pr.posting_date)
# Cancel purchase invoice to check reverse provisional entry cancellation
pi.cancel()
expected_gle_for_purchase_receipt_post_pi_cancel = [
["Provision Account - _TC", 0, 250, pi.posting_date],
["_Test Account Cost for Goods Sold - _TC", 250, 0, pi.posting_date],
]
check_gl_entries(
self, pr.name, expected_gle_for_purchase_receipt_post_pi_cancel, pr.posting_date
)
company.enable_provisional_accounting_for_non_stock_items = 0
company.save()
def test_item_less_defaults(self):
pi = frappe.new_doc("Purchase Invoice")
pi.supplier = "_Test Supplier"
pi.company = "_Test Company"
pi.append(
"items",
{
"item_name": "Opening item",
"qty": 1,
"uom": "Tonne",
"stock_uom": "Kg",
"rate": 1000,
"expense_account": "Stock Received But Not Billed - _TC",
},
)
pi.save()
self.assertEqual(pi.items[0].conversion_factor, 1000)
def test_batch_expiry_for_purchase_invoice(self):
from erpnext.controllers.sales_and_purchase_return import make_return_doc
item = self.make_item(
"_Test Batch Item For Return Check",
{
"is_purchase_item": 1,
"is_stock_item": 1,
"has_batch_no": 1,
"create_new_batch": 1,
"batch_number_series": "TBIRC.#####",
},
)
pi = make_purchase_invoice(
qty=1,
item_code=item.name,
update_stock=True,
)
pi.load_from_db()
batch_no = pi.items[0].batch_no
self.assertTrue(batch_no)
frappe.db.set_value("Batch", batch_no, "expiry_date", add_days(nowdate(), -1))
return_pi = make_return_doc(pi.doctype, pi.name)
return_pi.save().submit()
self.assertTrue(return_pi.docstatus == 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",
"allocate_payment_based_on_payment_terms",
0,
)
po = create_purchase_order(do_not_save=1)
po.payment_terms_template = "_Test Payment Term Template"
po.save()
po.submit()
pr = create_pr_against_po(po.name, received_qty=4)
pi = make_pi_from_pr(pr.name)
self.assertEqual(pi.payment_schedule[0].payment_amount, 1000)
frappe.db.set_value(
"Payment Terms Template",
"_Test Payment Term Template",
"allocate_payment_based_on_payment_terms",
1,
)
pi = make_pi_from_pr(pr.name)
self.assertEqual(pi.payment_schedule[0].payment_amount, 2500)
automatically_fetch_payment_terms(enable=0)
frappe.db.set_value(
"Payment Terms Template",
"_Test Payment Term Template",
"allocate_payment_based_on_payment_terms",
0,
)
def test_default_cost_center_for_purchase(self):
from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
for c_center in ["_Test Cost Center Selling", "_Test Cost Center Buying"]:
create_cost_center(cost_center_name=c_center)
item = create_item(
"_Test Cost Center Item For Purchase",
is_stock_item=1,
buying_cost_center="_Test Cost Center Buying - _TC",
selling_cost_center="_Test Cost Center Selling - _TC",
)
pi = make_purchase_invoice(
item=item.name, qty=1, rate=1000, update_stock=True, do_not_submit=True, cost_center=""
)
pi.items[0].cost_center = ""
pi.set_missing_values()
pi.calculate_taxes_and_totals()
pi.save()
self.assertEqual(pi.items[0].cost_center, "_Test Cost Center Buying - _TC")
def check_gl_entries(doc, voucher_no, expected_gle, posting_date):
gl_entries = frappe.db.sql(

View File

@@ -176,6 +176,7 @@
"fieldname": "received_qty",
"fieldtype": "Float",
"label": "Received Qty",
"no_copy": 1,
"read_only": 1
},
{
@@ -706,6 +707,7 @@
"label": "Valuation Rate",
"no_copy": 1,
"options": "Company:company:default_currency",
"precision": "6",
"print_hide": 1,
"read_only": 1
},
@@ -871,7 +873,7 @@
"idx": 1,
"istable": 1,
"links": [],
"modified": "2021-11-15 17:04:07.191013",
"modified": "2023-07-02 18:39:41.495723",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",

View File

@@ -53,7 +53,6 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
me.frm.refresh_fields();
}
erpnext.queries.setup_warehouse_query(this.frm);
erpnext.accounts.dimensions.setup_dimension_filters(this.frm, this.frm.doctype);
},
refresh: function(doc, dt, dn) {
@@ -76,9 +75,12 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
if (doc.docstatus == 1 && doc.outstanding_amount!=0
&& !(cint(doc.is_return) && doc.return_against)) {
cur_frm.add_custom_button(__('Payment'),
this.make_payment_entry, __('Create'));
cur_frm.page.set_inner_btn_group_as_primary(__('Create'));
this.frm.add_custom_button(
__('Payment'),
() => this.make_payment_entry(),
__('Create')
);
this.frm.page.set_inner_btn_group_as_primary(__('Create'));
}
if(doc.docstatus==1 && !doc.is_return) {
@@ -314,6 +316,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
},
make_inter_company_invoice: function() {
let me = this;
frappe.model.open_mapped_doc({
method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_inter_company_purchase_invoice",
frm: me.frm
@@ -475,9 +478,21 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
let row = frappe.get_doc(d.doctype, d.name)
set_timesheet_detail_rate(row.doctype, row.name, me.frm.doc.currency, row.timesheet_detail)
});
frm.trigger("calculate_timesheet_totals");
this.frm.trigger("calculate_timesheet_totals");
}
},
is_cash_or_non_trade_discount() {
this.frm.set_df_property("additional_discount_account", "hidden", 1 - this.frm.doc.is_cash_or_non_trade_discount);
this.frm.set_df_property("additional_discount_account", "reqd", this.frm.doc.is_cash_or_non_trade_discount);
if (!this.frm.doc.is_cash_or_non_trade_discount) {
this.frm.set_value("additional_discount_account", "");
}
this.calculate_taxes_and_totals();
}
});
// for backward compatibility: combine new and previous states
@@ -638,19 +653,6 @@ frappe.ui.form.on('Sales Invoice', {
}
}
// expense account
frm.fields_dict['items'].grid.get_field('expense_account').get_query = function(doc) {
if (erpnext.is_perpetual_inventory_enabled(doc.company)) {
return {
filters: {
'report_type': 'Profit and Loss',
'company': doc.company,
"is_group": 0
}
}
}
}
// discount account
frm.fields_dict['items'].grid.get_field('discount_account').get_query = function(doc) {
return {
@@ -885,27 +887,44 @@ frappe.ui.form.on('Sales Invoice', {
set_timesheet_data: function(frm, timesheets) {
frm.clear_table("timesheets")
timesheets.forEach(timesheet => {
timesheets.forEach(async (timesheet) => {
if (frm.doc.currency != timesheet.currency) {
frappe.call({
method: "erpnext.setup.utils.get_exchange_rate",
args: {
from_currency: timesheet.currency,
to_currency: frm.doc.currency
},
callback: function(r) {
if (r.message) {
exchange_rate = r.message;
frm.events.append_time_log(frm, timesheet, exchange_rate);
}
}
});
const exchange_rate = await frm.events.get_exchange_rate(
frm, timesheet.currency, frm.doc.currency
)
frm.events.append_time_log(frm, timesheet, exchange_rate)
} else {
frm.events.append_time_log(frm, timesheet, 1.0);
}
});
},
async get_exchange_rate(frm, from_currency, to_currency) {
if (
frm.exchange_rates
&& frm.exchange_rates[from_currency]
&& frm.exchange_rates[from_currency][to_currency]
) {
return frm.exchange_rates[from_currency][to_currency];
}
return frappe.call({
method: "erpnext.setup.utils.get_exchange_rate",
args: {
from_currency,
to_currency
},
callback: function(r) {
if (r.message) {
// cache exchange rates
frm.exchange_rates = frm.exchange_rates || {};
frm.exchange_rates[from_currency] = frm.exchange_rates[from_currency] || {};
frm.exchange_rates[from_currency][to_currency] = r.message;
}
}
});
},
append_time_log: function(frm, time_log, exchange_rate) {
const row = frm.add_child("timesheets");
row.activity_type = time_log.activity_type;
@@ -916,7 +935,7 @@ frappe.ui.form.on('Sales Invoice', {
row.billing_hours = time_log.billing_hours;
row.billing_amount = flt(time_log.billing_amount) * flt(exchange_rate);
row.timesheet_detail = time_log.name;
row.project_name = time_log.project_name;
row.project_name = time_log.project_name;
frm.refresh_field("timesheets");
frm.trigger("calculate_timesheet_totals");
@@ -1050,7 +1069,7 @@ var select_loyalty_program = function(frm, loyalty_programs) {
]
});
dialog.set_primary_action(__("Set"), function() {
dialog.set_primary_action(__("Set Loyalty Program"), function() {
dialog.hide();
return frappe.call({
method: "frappe.client.set_value",

View File

@@ -106,6 +106,7 @@
"loyalty_redemption_cost_center",
"section_break_49",
"apply_discount_on",
"is_cash_or_non_trade_discount",
"base_discount_amount",
"additional_discount_account",
"column_break_51",
@@ -413,7 +414,7 @@
},
{
"default": "0",
"depends_on": "eval: doc.is_return && doc.return_against",
"depends_on": "eval: doc.is_return",
"fieldname": "update_billed_amount_in_sales_order",
"fieldtype": "Check",
"hide_days": 1,
@@ -650,7 +651,6 @@
"hide_days": 1,
"hide_seconds": 1,
"label": "Ignore Pricing Rule",
"no_copy": 1,
"print_hide": 1
},
{
@@ -1790,6 +1790,8 @@
"width": "50%"
},
{
"fetch_from": "sales_partner.commission_rate",
"fetch_if_empty": 1,
"fieldname": "commission_rate",
"fieldtype": "Float",
"hide_days": 1,
@@ -1988,7 +1990,7 @@
{
"fieldname": "additional_discount_account",
"fieldtype": "Link",
"label": "Additional Discount Account",
"label": "Discount Account",
"options": "Account"
},
{
@@ -2026,6 +2028,13 @@
"fieldtype": "Currency",
"label": "Amount Eligible for Commission",
"read_only": 1
},
{
"default": "0",
"depends_on": "eval: doc.apply_discount_on == \"Grand Total\"",
"fieldname": "is_cash_or_non_trade_discount",
"fieldtype": "Check",
"label": "Is Cash or Non Trade Discount"
}
],
"icon": "fa fa-file-text",
@@ -2038,7 +2047,7 @@
"link_fieldname": "consolidated_invoice"
}
],
"modified": "2022-03-08 16:08:53.517903",
"modified": "2023-01-28 19:45:47.538163",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
@@ -2094,4 +2103,4 @@
"title_field": "title",
"track_changes": 1,
"track_seen": 1
}
}

View File

@@ -7,17 +7,7 @@ from frappe import _, msgprint, throw
from frappe.contacts.doctype.address.address import get_address_display
from frappe.model.mapper import get_mapped_doc
from frappe.model.utils import get_fetch_values
from frappe.utils import (
add_days,
add_months,
cint,
cstr,
flt,
formatdate,
get_link_to_form,
getdate,
nowdate,
)
from frappe.utils import add_days, cint, cstr, flt, formatdate, get_link_to_form, getdate, nowdate
from six import iteritems
import erpnext
@@ -33,10 +23,12 @@ from erpnext.accounts.general_ledger import get_round_off_account_and_cost_cente
from erpnext.accounts.party import get_due_date, get_party_account, get_party_details
from erpnext.accounts.utils import get_account_currency
from erpnext.assets.doctype.asset.depreciation import (
depreciate_asset,
get_disposal_account_and_cost_center,
get_gl_entries_on_asset_disposal,
get_gl_entries_on_asset_regain,
make_depreciation_entry,
reset_depreciation_schedule,
reverse_depreciation_entry_made_after_disposal,
)
from erpnext.controllers.accounts_controller import validate_account_head
from erpnext.controllers.selling_controller import SellingController
@@ -116,6 +108,7 @@ class SalesInvoice(SellingController):
self.set_income_account_for_fixed_assets()
self.validate_item_cost_centers()
self.validate_income_account()
self.check_conversion_rate()
validate_inter_company_party(
self.doctype, self.customer, self.company, self.inter_company_invoice_reference
@@ -1039,7 +1032,7 @@ class SalesInvoice(SellingController):
)
if grand_total and not self.is_internal_transfer():
# Didnot use base_grand_total to book rounding loss gle
# Did not use base_grand_total to book rounding loss gle
gl_entries.append(
self.get_gl_dict(
{
@@ -1114,23 +1107,25 @@ class SalesInvoice(SellingController):
if self.is_return:
fixed_asset_gl_entries = get_gl_entries_on_asset_regain(
asset, item.base_net_amount, item.finance_book
asset, item.base_net_amount, item.finance_book, self.posting_date
)
asset.db_set("disposal_date", None)
if asset.calculate_depreciation:
self.reverse_depreciation_entry_made_after_sale(asset)
self.reset_depreciation_schedule(asset)
posting_date = frappe.db.get_value("Sales Invoice", self.return_against, "posting_date")
reverse_depreciation_entry_made_after_disposal(asset, posting_date)
reset_depreciation_schedule(asset, self.posting_date)
else:
if asset.calculate_depreciation:
depreciate_asset(asset, self.posting_date)
asset.reload()
fixed_asset_gl_entries = get_gl_entries_on_asset_disposal(
asset, item.base_net_amount, item.finance_book
asset, item.base_net_amount, item.finance_book, self.posting_date
)
asset.db_set("disposal_date", self.posting_date)
if asset.calculate_depreciation:
self.depreciate_asset(asset)
for gle in fixed_asset_gl_entries:
gle["against"] = self.customer
gl_entries.append(self.get_gl_dict(gle, item=item))
@@ -1192,93 +1187,6 @@ class SalesInvoice(SellingController):
_("Select finance book for the item {0} at row {1}").format(item.item_code, item.idx)
)
def depreciate_asset(self, asset):
asset.flags.ignore_validate_update_after_submit = True
asset.prepare_depreciation_data(date_of_sale=self.posting_date)
asset.save()
make_depreciation_entry(asset.name, self.posting_date)
def reset_depreciation_schedule(self, asset):
asset.flags.ignore_validate_update_after_submit = True
# recreate original depreciation schedule of the asset
asset.prepare_depreciation_data(date_of_return=self.posting_date)
self.modify_depreciation_schedule_for_asset_repairs(asset)
asset.save()
def modify_depreciation_schedule_for_asset_repairs(self, asset):
asset_repairs = frappe.get_all(
"Asset Repair", filters={"asset": asset.name}, fields=["name", "increase_in_asset_life"]
)
for repair in asset_repairs:
if repair.increase_in_asset_life:
asset_repair = frappe.get_doc("Asset Repair", repair.name)
asset_repair.modify_depreciation_schedule()
asset.prepare_depreciation_data()
def reverse_depreciation_entry_made_after_sale(self, asset):
from erpnext.accounts.doctype.journal_entry.journal_entry import make_reverse_journal_entry
posting_date_of_original_invoice = self.get_posting_date_of_sales_invoice()
row = -1
finance_book = asset.get("schedules")[0].get("finance_book")
for schedule in asset.get("schedules"):
if schedule.finance_book != finance_book:
row = 0
finance_book = schedule.finance_book
else:
row += 1
if schedule.schedule_date == posting_date_of_original_invoice:
if not self.sale_was_made_on_original_schedule_date(
asset, schedule, row, posting_date_of_original_invoice
) or self.sale_happens_in_the_future(posting_date_of_original_invoice):
reverse_journal_entry = make_reverse_journal_entry(schedule.journal_entry)
reverse_journal_entry.posting_date = nowdate()
frappe.flags.is_reverse_depr_entry = True
reverse_journal_entry.submit()
frappe.flags.is_reverse_depr_entry = False
asset.flags.ignore_validate_update_after_submit = True
schedule.journal_entry = None
depreciation_amount = self.get_depreciation_amount_in_je(reverse_journal_entry)
asset.finance_books[0].value_after_depreciation += depreciation_amount
asset.save()
def get_posting_date_of_sales_invoice(self):
return frappe.db.get_value("Sales Invoice", self.return_against, "posting_date")
# if the invoice had been posted on the date the depreciation was initially supposed to happen, the depreciation shouldn't be undone
def sale_was_made_on_original_schedule_date(
self, asset, schedule, row, posting_date_of_original_invoice
):
for finance_book in asset.get("finance_books"):
if schedule.finance_book == finance_book.finance_book:
orginal_schedule_date = add_months(
finance_book.depreciation_start_date, row * cint(finance_book.frequency_of_depreciation)
)
if orginal_schedule_date == posting_date_of_original_invoice:
return True
return False
def sale_happens_in_the_future(self, posting_date_of_original_invoice):
if posting_date_of_original_invoice > getdate():
return True
return False
def get_depreciation_amount_in_je(self, journal_entry):
if journal_entry.accounts[0].debit_in_account_currency:
return journal_entry.accounts[0].debit_in_account_currency
else:
return journal_entry.accounts[0].credit_in_account_currency
@property
def enable_discount_accounting(self):
if not hasattr(self, "_enable_discount_accounting"):
@@ -1672,15 +1580,13 @@ class SalesInvoice(SellingController):
frappe.db.set_value("Customer", self.customer, "loyalty_program_tier", lp_details.tier_name)
def get_returned_amount(self):
from frappe.query_builder.functions import Coalesce, Sum
from frappe.query_builder.functions import Sum
doc = frappe.qb.DocType(self.doctype)
returned_amount = (
frappe.qb.from_(doc)
.select(Sum(doc.grand_total))
.where(
(doc.docstatus == 1) & (doc.is_return == 1) & (Coalesce(doc.return_against, "") == self.name)
)
.where((doc.docstatus == 1) & (doc.is_return == 1) & (doc.return_against == self.name))
).run()
return abs(returned_amount[0][0]) if returned_amount[0][0] else 0
@@ -2154,11 +2060,13 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
target_detail_field = "sales_invoice_item" if doctype == "Sales Invoice" else "sales_order_item"
source_document_warehouse_field = "target_warehouse"
target_document_warehouse_field = "from_warehouse"
received_items = get_received_items(source_name, target_doctype, target_detail_field)
else:
source_doc = frappe.get_doc(doctype, source_name)
target_doctype = "Sales Invoice" if doctype == "Purchase Invoice" else "Sales Order"
source_document_warehouse_field = "from_warehouse"
target_document_warehouse_field = "target_warehouse"
received_items = {}
validate_inter_company_transaction(source_doc, doctype)
details = get_inter_company_details(source_doc, doctype)
@@ -2182,6 +2090,9 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
update_address(
target_doc, "shipping_address", "shipping_address_display", source_doc.customer_address
)
update_address(
target_doc, "billing_address", "billing_address_display", source_doc.customer_address
)
if currency:
target_doc.currency = currency
@@ -2224,12 +2135,17 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
shipping_address_name=target_doc.shipping_address_name,
)
def update_item(source, target, source_parent):
target.qty = flt(source.qty) - received_items.get(source.name, 0.0)
item_field_map = {
"doctype": target_doctype + " Item",
"field_no_map": ["income_account", "expense_account", "cost_center", "warehouse"],
"field_map": {
"rate": "rate",
},
"postprocess": update_item,
"condition": lambda doc: doc.qty > 0,
}
if doctype in ["Sales Invoice", "Sales Order"]:
@@ -2267,6 +2183,28 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
return doclist
def get_received_items(reference_name, doctype, reference_fieldname):
target_doctypes = frappe.get_all(
doctype,
filters={"inter_company_invoice_reference": reference_name, "docstatus": 1},
as_list=True,
)
if target_doctypes:
target_doctypes = list(target_doctypes[0])
received_items_map = frappe._dict(
frappe.get_all(
doctype + " Item",
filters={"parent": ("in", target_doctypes)},
fields=[reference_fieldname, "qty"],
as_list=1,
)
)
return received_items_map
def set_purchase_references(doc):
# add internal PO or PR links if any
if doc.is_internal_transfer():

View File

@@ -11,6 +11,7 @@ def get_data():
"Payment Request": "reference_name",
"Sales Invoice": "return_against",
"Auto Repeat": "reference_document",
"Purchase Invoice": "inter_company_invoice_reference",
},
"internal_links": {
"Sales Order": ["items", "sales_order"],
@@ -30,5 +31,6 @@ def get_data():
{"label": _("Reference"), "items": ["Timesheet", "Delivery Note", "Sales Order"]},
{"label": _("Returns"), "items": ["Sales Invoice"]},
{"label": _("Subscription"), "items": ["Auto Repeat"]},
{"label": _("Internal Transfers"), "items": ["Purchase Invoice"]},
],
}

View File

@@ -7,7 +7,7 @@ import unittest
import frappe
from frappe.model.dynamic_links import get_dynamic_link_map
from frappe.model.naming import make_autoname
from frappe.utils import add_days, flt, getdate, nowdate
from frappe.utils import add_days, flt, getdate, nowdate, today
from six import iteritems
from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account
@@ -31,10 +31,20 @@ from erpnext.stock.doctype.stock_entry.test_stock_entry import (
get_qty_after_transaction,
make_stock_entry,
)
from erpnext.stock.utils import get_incoming_rate
from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import (
create_stock_reconciliation,
)
from erpnext.stock.utils import get_incoming_rate, get_stock_balance
class TestSalesInvoice(unittest.TestCase):
def setUp(self):
from erpnext.stock.doctype.stock_ledger_entry.test_stock_ledger_entry import create_items
create_items(["_Test Internal Transfer Item"], uoms=[{"uom": "Box", "conversion_factor": 10}])
create_internal_parties()
setup_accounts()
def make(self):
w = frappe.copy_doc(test_records[0])
w.is_pos = 0
@@ -906,7 +916,8 @@ class TestSalesInvoice(unittest.TestCase):
pos_return.insert()
pos_return.submit()
self.assertEqual(pos_return.get("payments")[0].amount, -1000)
self.assertEqual(pos_return.get("payments")[0].amount, -500)
self.assertEqual(pos_return.get("payments")[1].amount, -500)
def test_pos_change_amount(self):
make_pos_profile(
@@ -1106,6 +1117,46 @@ class TestSalesInvoice(unittest.TestCase):
frappe.db.sql("delete from `tabPOS Profile`")
def test_bin_details_of_packed_item(self):
from erpnext.selling.doctype.product_bundle.test_product_bundle import make_product_bundle
from erpnext.stock.doctype.item.test_item import make_item
# test Update Items with product bundle
if not frappe.db.exists("Item", "_Test Product Bundle Item New"):
bundle_item = make_item("_Test Product Bundle Item New", {"is_stock_item": 0})
bundle_item.append(
"item_defaults", {"company": "_Test Company", "default_warehouse": "_Test Warehouse - _TC"}
)
bundle_item.save(ignore_permissions=True)
make_item("_Packed Item New 1", {"is_stock_item": 1})
make_product_bundle("_Test Product Bundle Item New", ["_Packed Item New 1"], 2)
si = create_sales_invoice(
item_code="_Test Product Bundle Item New",
update_stock=1,
warehouse="_Test Warehouse - _TC",
transaction_date=add_days(nowdate(), -1),
do_not_submit=1,
)
make_stock_entry(item="_Packed Item New 1", target="_Test Warehouse - _TC", qty=120, rate=100)
bin_details = frappe.db.get_value(
"Bin",
{"item_code": "_Packed Item New 1", "warehouse": "_Test Warehouse - _TC"},
["actual_qty", "projected_qty", "ordered_qty"],
as_dict=1,
)
si.transaction_date = nowdate()
si.save()
packed_item = si.packed_items[0]
self.assertEqual(flt(bin_details.actual_qty), flt(packed_item.actual_qty))
self.assertEqual(flt(bin_details.projected_qty), flt(packed_item.projected_qty))
self.assertEqual(flt(bin_details.ordered_qty), flt(packed_item.ordered_qty))
def test_pos_si_without_payment(self):
make_pos_profile()
@@ -1612,6 +1663,17 @@ class TestSalesInvoice(unittest.TestCase):
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
@@ -1676,7 +1738,7 @@ class TestSalesInvoice(unittest.TestCase):
si.save()
self.assertEqual(si.get("items")[0].rate, flt((price_list_rate * 25) / 100 + price_list_rate))
def test_outstanding_amount_after_advance_jv_cancelation(self):
def test_outstanding_amount_after_advance_jv_cancellation(self):
from erpnext.accounts.doctype.journal_entry.test_journal_entry import (
test_records as jv_test_records,
)
@@ -1720,7 +1782,11 @@ class TestSalesInvoice(unittest.TestCase):
flt(si.rounded_total + si.total_advance, si.precision("outstanding_amount")),
)
def test_outstanding_amount_after_advance_payment_entry_cancelation(self):
def test_outstanding_amount_after_advance_payment_entry_cancellation(self):
"""Test impact of advance PE submission/cancellation on SI and SO."""
from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
sales_order = make_sales_order(item_code="138-CMS Shoe", qty=1, price_list_rate=500)
pe = frappe.get_doc(
{
"doctype": "Payment Entry",
@@ -1740,10 +1806,25 @@ class TestSalesInvoice(unittest.TestCase):
"paid_to": "_Test Cash - _TC",
}
)
pe.append(
"references",
{
"reference_doctype": "Sales Order",
"reference_name": sales_order.name,
"total_amount": sales_order.grand_total,
"outstanding_amount": sales_order.grand_total,
"allocated_amount": 300,
},
)
pe.insert()
pe.submit()
sales_order.reload()
self.assertEqual(sales_order.advance_paid, 300)
si = frappe.copy_doc(test_records[0])
si.items[0].sales_order = sales_order.name
si.items[0].so_detail = sales_order.get("items")[0].name
si.is_pos = 0
si.append(
"advances",
@@ -1751,6 +1832,7 @@ class TestSalesInvoice(unittest.TestCase):
"doctype": "Sales Invoice Advance",
"reference_type": "Payment Entry",
"reference_name": pe.name,
"reference_row": pe.references[0].name,
"advance_amount": 300,
"allocated_amount": 300,
"remarks": pe.remarks,
@@ -1759,7 +1841,13 @@ class TestSalesInvoice(unittest.TestCase):
si.insert()
si.submit()
si.load_from_db()
si.reload()
pe.reload()
sales_order.reload()
# Check if SO is unlinked/replaced by SI in PE & if SO advance paid is 0
self.assertEqual(pe.references[0].reference_name, si.name)
self.assertEqual(sales_order.advance_paid, 0.0)
# check outstanding after advance allocation
self.assertEqual(
@@ -1767,11 +1855,9 @@ class TestSalesInvoice(unittest.TestCase):
flt(si.rounded_total - si.total_advance, si.precision("outstanding_amount")),
)
# added to avoid Document has been modified exception
pe = frappe.get_doc("Payment Entry", pe.name)
pe.cancel()
si.reload()
si.load_from_db()
# check outstanding after advance cancellation
self.assertEqual(
flt(si.outstanding_amount),
@@ -2358,29 +2444,6 @@ class TestSalesInvoice(unittest.TestCase):
acc_settings.save()
def test_inter_company_transaction(self):
from erpnext.selling.doctype.customer.test_customer import create_internal_customer
create_internal_customer(
customer_name="_Test Internal Customer",
represents_company="_Test Company 1",
allowed_to_interact_with="Wind Power LLC",
)
if not frappe.db.exists("Supplier", "_Test Internal Supplier"):
supplier = frappe.get_doc(
{
"supplier_group": "_Test Supplier Group",
"supplier_name": "_Test Internal Supplier",
"doctype": "Supplier",
"is_internal_supplier": 1,
"represents_company": "Wind Power LLC",
}
)
supplier.append("companies", {"company": "_Test Company 1"})
supplier.insert()
si = create_sales_invoice(
company="Wind Power LLC",
customer="_Test Internal Customer",
@@ -2409,65 +2472,10 @@ class TestSalesInvoice(unittest.TestCase):
self.assertEqual(target_doc.company, "_Test Company 1")
self.assertEqual(target_doc.supplier, "_Test Internal Supplier")
def test_sle_for_target_warehouse(self):
se = make_stock_entry(
item_code="138-CMS Shoe",
target="Finished Goods - _TC",
company="_Test Company",
qty=1,
basic_rate=500,
)
si = frappe.copy_doc(test_records[0])
si.update_stock = 1
si.set_warehouse = "Finished Goods - _TC"
si.set_target_warehouse = "Stores - _TC"
si.get("items")[0].warehouse = "Finished Goods - _TC"
si.get("items")[0].target_warehouse = "Stores - _TC"
si.insert()
si.submit()
sles = frappe.get_all(
"Stock Ledger Entry", filters={"voucher_no": si.name}, fields=["name", "actual_qty"]
)
# check if both SLEs are created
self.assertEqual(len(sles), 2)
self.assertEqual(sum(d.actual_qty for d in sles), 0.0)
# tear down
si.cancel()
se.cancel()
def test_internal_transfer_gl_entry(self):
## Create internal transfer account
from erpnext.selling.doctype.customer.test_customer import create_internal_customer
account = create_account(
account_name="Unrealized Profit",
parent_account="Current Liabilities - TCP1",
company="_Test Company with perpetual inventory",
)
frappe.db.set_value(
"Company", "_Test Company with perpetual inventory", "unrealized_profit_loss_account", account
)
customer = create_internal_customer(
"_Test Internal Customer 2",
"_Test Company with perpetual inventory",
"_Test Company with perpetual inventory",
)
create_internal_supplier(
"_Test Internal Supplier 2",
"_Test Company with perpetual inventory",
"_Test Company with perpetual inventory",
)
si = create_sales_invoice(
company="_Test Company with perpetual inventory",
customer=customer,
customer="_Test Internal Customer 2",
debit_to="Debtors - TCP1",
warehouse="Stores - TCP1",
income_account="Sales - TCP1",
@@ -2481,7 +2489,7 @@ class TestSalesInvoice(unittest.TestCase):
si.update_stock = 1
si.items[0].target_warehouse = "Work In Progress - TCP1"
# Add stock to stores for succesful stock transfer
# Add stock to stores for successful stock transfer
make_stock_entry(
target="Stores - TCP1", company="_Test Company with perpetual inventory", qty=1, basic_rate=100
)
@@ -2609,6 +2617,287 @@ class TestSalesInvoice(unittest.TestCase):
einvoice = make_einvoice(si)
validate_totals(einvoice)
def test_einvoice_discounts(self):
from erpnext.regional.india.e_invoice.utils import make_einvoice, validate_totals
frappe.db.set_single_value("E Invoice Settings", "dont_show_discounts_in_e_invoice", False)
# Normal Itemized Discount
si = get_sales_invoice_for_e_invoice()
si.apply_discount_on = ""
si.items[0].price_list_rate = 12
si.items[0].discount_percentage = 16.6666666667
si.items[0].rate = 10
si.items[1].price_list_rate = 15
si.items[1].discount_amount = 5
si.items[1].rate = 10
si.save()
einvoice = make_einvoice(si)
validate_totals(einvoice)
self.assertEqual(einvoice["ItemList"][0]["Discount"], 4000)
self.assertEqual(einvoice["ItemList"][1]["Discount"], 2100)
self.assertEqual(einvoice["ItemList"][2]["Discount"], 222)
self.assertEqual(einvoice["ItemList"][3]["Discount"], 5555)
self.assertEqual(einvoice["ValDtls"]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][0]["UnitPrice"], 12)
self.assertEqual(einvoice["ItemList"][1]["UnitPrice"], 15)
self.assertEqual(einvoice["ItemList"][2]["UnitPrice"], 20)
self.assertEqual(einvoice["ItemList"][3]["UnitPrice"], 10)
# Invoice Discount on net total
si = get_sales_invoice_for_e_invoice()
si.apply_discount_on = "Net Total"
si.discount_amount = 400
si.save()
einvoice = make_einvoice(si)
validate_totals(einvoice)
self.assertEqual(einvoice["ItemList"][0]["Discount"], 253.61)
self.assertEqual(einvoice["ItemList"][1]["Discount"], 66.57)
self.assertEqual(einvoice["ItemList"][2]["Discount"], 243.11)
self.assertEqual(einvoice["ItemList"][3]["Discount"], 5613.71)
self.assertEqual(einvoice["ValDtls"]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][0]["UnitPrice"], 12)
self.assertEqual(einvoice["ItemList"][1]["UnitPrice"], 15)
self.assertEqual(einvoice["ItemList"][2]["UnitPrice"], 20)
self.assertEqual(einvoice["ItemList"][3]["UnitPrice"], 10)
# Invoice Discount on grand total (Itemized Discount)
si = get_sales_invoice_for_e_invoice()
si.apply_discount_on = "Grand Total"
si.discount_amount = 400
si.save()
einvoice = make_einvoice(si)
validate_totals(einvoice)
self.assertEqual(einvoice["ItemList"][0]["Discount"], 214.93)
self.assertEqual(einvoice["ItemList"][1]["Discount"], 56.42)
self.assertEqual(einvoice["ItemList"][2]["Discount"], 239.89)
self.assertEqual(einvoice["ItemList"][3]["Discount"], 5604.75)
self.assertEqual(einvoice["ValDtls"]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][0]["UnitPrice"], 12)
self.assertEqual(einvoice["ItemList"][1]["UnitPrice"], 15)
self.assertEqual(einvoice["ItemList"][2]["UnitPrice"], 20)
self.assertEqual(einvoice["ItemList"][3]["UnitPrice"], 10)
# Invoice Discount on grand total (Cash/Non-Trade Discount)
si = get_sales_invoice_for_e_invoice()
si.apply_discount_on = "Grand Total"
si.is_cash_or_non_trade_discount = 1
si.discount_amount = 400
si.save()
einvoice = make_einvoice(si)
validate_totals(einvoice)
self.assertEqual(einvoice["ItemList"][0]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][1]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][2]["Discount"], 222.0)
self.assertEqual(einvoice["ItemList"][3]["Discount"], 5555.0)
self.assertEqual(einvoice["ValDtls"]["Discount"], 400)
self.assertEqual(einvoice["ItemList"][0]["UnitPrice"], 12)
self.assertEqual(einvoice["ItemList"][1]["UnitPrice"], 15)
self.assertEqual(einvoice["ItemList"][2]["UnitPrice"], 20)
self.assertEqual(einvoice["ItemList"][3]["UnitPrice"], 10)
si = get_sales_invoice_for_e_invoice()
si.apply_discount_on = ""
si.items[1].price_list_rate = 15
si.items[1].discount_amount = -5
si.items[1].rate = 20
si.save()
einvoice = make_einvoice(si)
validate_totals(einvoice)
self.assertEqual(einvoice["ItemList"][1]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][1]["UnitPrice"], 20)
def test_einvoice_without_discounts(self):
from erpnext.regional.india.e_invoice.utils import make_einvoice, validate_totals
frappe.db.set_single_value("E Invoice Settings", "dont_show_discounts_in_e_invoice", True)
# Normal Itemized Discount
si = get_sales_invoice_for_e_invoice()
si.apply_discount_on = ""
si.items[0].price_list_rate = 12
si.items[0].discount_percentage = 16.6666666667
si.items[0].rate = 10
si.items[1].price_list_rate = 15
si.items[1].discount_amount = 5
si.items[1].rate = 10
si.save()
einvoice = make_einvoice(si)
validate_totals(einvoice)
self.assertEqual(einvoice["ItemList"][0]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][1]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][2]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][3]["Discount"], 0)
self.assertEqual(einvoice["ValDtls"]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][0]["UnitPrice"], 10)
self.assertEqual(einvoice["ItemList"][1]["UnitPrice"], 10)
self.assertEqual(einvoice["ItemList"][2]["UnitPrice"], 18)
self.assertEqual(einvoice["ItemList"][3]["UnitPrice"], 5)
# Invoice Discount on net total
si = get_sales_invoice_for_e_invoice()
si.apply_discount_on = "Net Total"
si.discount_amount = 400
si.save()
einvoice = make_einvoice(si)
validate_totals(einvoice)
self.assertEqual(einvoice["ItemList"][0]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][1]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][2]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][3]["Discount"], 0)
self.assertEqual(einvoice["ValDtls"]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][0]["UnitPrice"], 11.87)
self.assertEqual(einvoice["ItemList"][1]["UnitPrice"], 14.84)
self.assertEqual(einvoice["ItemList"][2]["UnitPrice"], 17.81)
self.assertEqual(einvoice["ItemList"][3]["UnitPrice"], 4.95)
# Invoice Discount on grand total (Itemized Discount)
si = get_sales_invoice_for_e_invoice()
si.apply_discount_on = "Grand Total"
si.discount_amount = 400
si.save()
einvoice = make_einvoice(si)
validate_totals(einvoice)
self.assertEqual(einvoice["ItemList"][0]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][1]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][2]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][3]["Discount"], 0)
self.assertEqual(einvoice["ValDtls"]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][0]["UnitPrice"], 11.89)
self.assertEqual(einvoice["ItemList"][1]["UnitPrice"], 14.87)
self.assertEqual(einvoice["ItemList"][2]["UnitPrice"], 17.84)
self.assertEqual(einvoice["ItemList"][3]["UnitPrice"], 4.96)
# Invoice Discount on grand total (Cash/Non-Trade Discount)
si = get_sales_invoice_for_e_invoice()
si.apply_discount_on = "Grand Total"
si.is_cash_or_non_trade_discount = 1
si.discount_amount = 400
si.save()
einvoice = make_einvoice(si)
validate_totals(einvoice)
self.assertEqual(einvoice["ItemList"][0]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][1]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][2]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][3]["Discount"], 0)
self.assertEqual(einvoice["ValDtls"]["Discount"], 400)
self.assertEqual(einvoice["ItemList"][0]["UnitPrice"], 12)
self.assertEqual(einvoice["ItemList"][1]["UnitPrice"], 15)
self.assertEqual(einvoice["ItemList"][2]["UnitPrice"], 18)
self.assertEqual(einvoice["ItemList"][3]["UnitPrice"], 5)
si = get_sales_invoice_for_e_invoice()
si.apply_discount_on = ""
si.items[1].price_list_rate = 15
si.items[1].discount_amount = -5
si.items[1].rate = 20
si.save()
einvoice = make_einvoice(si)
validate_totals(einvoice)
self.assertEqual(einvoice["ItemList"][1]["Discount"], 0)
self.assertEqual(einvoice["ItemList"][1]["UnitPrice"], 20)
def test_internal_transfer_gl_precision_issues(self):
# Make a stock queue of an item with two valuations
# Remove all existing stock for this
if get_stock_balance("_Test Internal Transfer Item", "Stores - TCP1", "2022-04-10"):
create_stock_reconciliation(
item_code="_Test Internal Transfer Item",
warehouse="Stores - TCP1",
qty=0,
rate=0,
company="_Test Company with perpetual inventory",
expense_account="Stock Adjustment - TCP1"
if frappe.get_all("Stock Ledger Entry")
else "Temporary Opening - TCP1",
posting_date="2020-04-10",
posting_time="14:00",
)
make_stock_entry(
item_code="_Test Internal Transfer Item",
target="Stores - TCP1",
qty=9000000,
basic_rate=52.0,
posting_date="2020-04-10",
posting_time="14:00",
)
make_stock_entry(
item_code="_Test Internal Transfer Item",
target="Stores - TCP1",
qty=60000000,
basic_rate=52.349777,
posting_date="2020-04-10",
posting_time="14:00",
)
# Make an internal transfer Sales Invoice Stock in non stock uom to check
# for rounding errors while converting to stock uom
si = create_sales_invoice(
company="_Test Company with perpetual inventory",
customer="_Test Internal Customer 2",
item_code="_Test Internal Transfer Item",
qty=5000000,
uom="Box",
debit_to="Debtors - TCP1",
warehouse="Stores - TCP1",
income_account="Sales - TCP1",
expense_account="Cost of Goods Sold - TCP1",
cost_center="Main - TCP1",
currency="INR",
do_not_save=1,
)
# Check GL Entries with precision
si.update_stock = 1
si.items[0].target_warehouse = "Work In Progress - TCP1"
si.items[0].conversion_factor = 10
si.save()
si.submit()
# Check if adjustment entry is created
self.assertTrue(
frappe.db.exists(
"GL Entry",
{
"voucher_type": "Sales Invoice",
"voucher_no": si.name,
"remarks": "Rounding gain/loss Entry for Stock Transfer",
},
)
)
def test_item_tax_net_range(self):
item = create_item("T Shirt")
@@ -3057,7 +3346,7 @@ class TestSalesInvoice(unittest.TestCase):
[deferred_account, 2022.47, 0.0, "2019-03-15"],
]
gl_entries = gl_entries = frappe.db.sql(
gl_entries = frappe.db.sql(
"""select account, debit, credit, posting_date
from `tabGL Entry`
where voucher_type='Journal Entry' and voucher_detail_no=%s and posting_date <= %s
@@ -3086,6 +3375,39 @@ class TestSalesInvoice(unittest.TestCase):
si.reload()
self.assertTrue(si.items[0].serial_no)
def test_sales_invoice_with_disabled_account(self):
try:
account = frappe.get_doc("Account", "VAT 5% - _TC")
account.disabled = 1
account.save()
si = create_sales_invoice(do_not_save=True)
si.posting_date = add_days(getdate(), 1)
si.taxes = []
si.append(
"taxes",
{
"charge_type": "On Net Total",
"account_head": "VAT 5% - _TC",
"cost_center": "Main - _TC",
"description": "VAT @ 5.0",
"rate": 9,
},
)
si.save()
with self.assertRaises(frappe.ValidationError) as err:
si.submit()
self.assertTrue(
"Cannot create accounting entries against disabled accounts" in str(err.exception)
)
finally:
account.disabled = 0
account.save()
def test_gain_loss_with_advance_entry(self):
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
@@ -3142,6 +3464,109 @@ class TestSalesInvoice(unittest.TestCase):
"Accounts Settings", "Accounts Settings", "unlink_payment_on_cancel_of_invoice", unlink_enabled
)
def test_gain_loss_on_advance_cancellation(self):
unlink_enabled = frappe.db.get_single_value(
"Accounts Settings", "unlink_payment_on_cancellation_of_invoice"
)
frappe.db.set_single_value("Accounts Settings", "unlink_payment_on_cancellation_of_invoice", 1)
pe = frappe.get_doc(
{
"doctype": "Payment Entry",
"payment_type": "Receive",
"party_type": "Customer",
"party": "_Test Customer USD",
"company": "_Test Company",
"paid_from_account_currency": "USD",
"paid_to_account_currency": "INR",
"source_exchange_rate": 70,
"target_exchange_rate": 1,
"reference_no": "1",
"reference_date": nowdate(),
"received_amount": 70,
"paid_amount": 1,
"paid_from": "_Test Receivable USD - _TC",
"paid_to": "_Test Cash - _TC",
}
)
pe.insert()
pe.submit()
si = create_sales_invoice(
customer="_Test Customer USD",
debit_to="_Test Receivable USD - _TC",
currency="USD",
conversion_rate=75,
do_not_save=1,
rate=1,
)
si = si.save()
si.append(
"advances",
{
"reference_type": "Payment Entry",
"reference_name": pe.name,
"advance_amount": 1,
"allocated_amount": 1,
"ref_exchange_rate": 70,
},
)
si.save()
si.submit()
expected_gle = [
["_Test Receivable USD - _TC", 75.0, 5.0],
["Exchange Gain/Loss - _TC", 5.0, 0.0],
["Sales - _TC", 0.0, 75.0],
]
check_gl_entries(self, si.name, expected_gle, nowdate())
# cancel advance payment
pe.reload()
pe.cancel()
expected_gle_after = [
["_Test Receivable USD - _TC", 75.0, 0.0],
["Sales - _TC", 0.0, 75.0],
]
check_gl_entries(self, si.name, expected_gle_after, nowdate())
frappe.db.set_single_value(
"Accounts Settings", "unlink_payment_on_cancellation_of_invoice", unlink_enabled
)
def test_batch_expiry_for_sales_invoice_return(self):
from erpnext.controllers.sales_and_purchase_return import make_return_doc
from erpnext.stock.doctype.item.test_item import make_item
item = make_item(
"_Test Batch Item For Return Check",
{
"is_purchase_item": 1,
"is_stock_item": 1,
"has_batch_no": 1,
"create_new_batch": 1,
"batch_number_series": "TBIRC.#####",
},
)
pr = make_purchase_receipt(qty=1, item_code=item.name)
batch_no = pr.items[0].batch_no
si = create_sales_invoice(qty=1, item_code=item.name, update_stock=1, batch_no=batch_no)
si.load_from_db()
batch_no = si.items[0].batch_no
self.assertTrue(batch_no)
frappe.db.set_value("Batch", batch_no, "expiry_date", add_days(today(), -1))
return_si = make_return_doc(si.doctype, si.name)
return_si.save().submit()
self.assertTrue(return_si.docstatus == 1)
def get_sales_invoice_for_e_invoice():
si = make_sales_invoice_for_ewaybill()
@@ -3175,6 +3600,36 @@ def get_sales_invoice_for_e_invoice():
},
)
si.append(
"items",
{
"item_code": "_Test Item",
"uom": "Nos",
"warehouse": "_Test Warehouse - _TC",
"qty": 111,
"price_list_rate": 20,
"discount_percentage": 10,
"income_account": "Sales - _TC",
"expense_account": "Cost of Goods Sold - _TC",
"cost_center": "_Test Cost Center - _TC",
},
)
si.append(
"items",
{
"item_code": "_Test Item 2",
"uom": "Nos",
"warehouse": "_Test Warehouse - _TC",
"qty": 1111,
"price_list_rate": 10,
"rate": 5,
"income_account": "Sales - _TC",
"expense_account": "Cost of Goods Sold - _TC",
"cost_center": "_Test Cost Center - _TC",
},
)
return si
@@ -3368,6 +3823,7 @@ def create_sales_invoice(**args):
"description": args.description or "_Test Item",
"gst_hsn_code": "999800",
"warehouse": args.warehouse or "_Test Warehouse - _TC",
"target_warehouse": args.target_warehouse,
"qty": args.qty or 1,
"uom": args.uom or "Nos",
"stock_uom": args.uom or "Nos",
@@ -3380,8 +3836,9 @@ def create_sales_invoice(**args):
"discount_amount": args.discount_amount or 0,
"cost_center": args.cost_center or "_Test Cost Center - _TC",
"serial_no": args.serial_no,
"conversion_factor": 1,
"conversion_factor": args.get("conversion_factor", 1),
"incoming_rate": args.incoming_rate or 0,
"batch_no": args.batch_no or None,
},
)
@@ -3493,6 +3950,34 @@ def get_taxes_and_charges():
]
def create_internal_parties():
from erpnext.selling.doctype.customer.test_customer import create_internal_customer
create_internal_customer(
customer_name="_Test Internal Customer",
represents_company="_Test Company 1",
allowed_to_interact_with="Wind Power LLC",
)
create_internal_customer(
customer_name="_Test Internal Customer 2",
represents_company="_Test Company with perpetual inventory",
allowed_to_interact_with="_Test Company with perpetual inventory",
)
create_internal_supplier(
supplier_name="_Test Internal Supplier",
represents_company="Wind Power LLC",
allowed_to_interact_with="_Test Company 1",
)
create_internal_supplier(
supplier_name="_Test Internal Supplier 2",
represents_company="_Test Company with perpetual inventory",
allowed_to_interact_with="_Test Company with perpetual inventory",
)
def create_internal_supplier(supplier_name, represents_company, allowed_to_interact_with):
if not frappe.db.exists("Supplier", supplier_name):
supplier = frappe.get_doc(
@@ -3515,6 +4000,19 @@ def create_internal_supplier(supplier_name, represents_company, allowed_to_inter
return supplier_name
def setup_accounts():
## Create internal transfer account
account = create_account(
account_name="Unrealized Profit",
parent_account="Current Liabilities - TCP1",
company="_Test Company with perpetual inventory",
)
frappe.db.set_value(
"Company", "_Test Company with perpetual inventory", "unrealized_profit_loss_account", account
)
def add_taxes(doc):
doc.append(
"taxes",

View File

@@ -279,7 +279,6 @@
"label": "Discount (%) on Price List Rate with Margin",
"oldfieldname": "adj_rate",
"oldfieldtype": "Float",
"precision": "2",
"print_hide": 1
},
{
@@ -813,6 +812,8 @@
"fieldtype": "Currency",
"label": "Incoming Rate (Costing)",
"no_copy": 1,
"options": "Company:company:default_currency",
"precision": "6",
"print_hide": 1
},
{
@@ -842,7 +843,7 @@
"idx": 1,
"istable": 1,
"links": [],
"modified": "2022-02-24 14:41:36.392560",
"modified": "2022-12-28 16:17:33.484531",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",

View File

@@ -694,3 +694,23 @@ class TestSubscription(unittest.TestCase):
# Check the currency of the created invoice
currency = frappe.db.get_value("Sales Invoice", subscription.invoices[0].invoice, "currency")
self.assertEqual(currency, "USD")
def test_plan_rate_for_midmonth_start_date(self):
subscription = frappe.new_doc("Subscription")
subscription.party_type = "Supplier"
subscription.party = "_Test Supplier"
subscription.generate_invoice_at_period_start = 1
subscription.follow_calendar_months = 1
subscription.generate_new_invoices_past_due_date = 1
subscription.start_date = "2023-04-08"
subscription.end_date = "2024-02-27"
subscription.append("plans", {"plan": "_Test Plan Name 4", "qty": 1})
subscription.save()
subscription.process()
self.assertEqual(len(subscription.invoices), 1)
pi = frappe.get_doc("Purchase Invoice", subscription.invoices[0].invoice)
self.assertEqual(pi.total, 55333.33)
subscription.delete()

View File

@@ -56,18 +56,17 @@ def get_plan_rate(
prorate = frappe.db.get_single_value("Subscription Settings", "prorate")
if prorate:
prorate_factor = flt(
date_diff(start_date, get_first_day(start_date))
/ date_diff(get_last_day(start_date), get_first_day(start_date)),
1,
)
prorate_factor += flt(
date_diff(get_last_day(end_date), end_date)
/ date_diff(get_last_day(end_date), get_first_day(end_date)),
1,
)
cost -= plan.cost * prorate_factor
cost -= plan.cost * get_prorate_factor(start_date, end_date)
return cost
def get_prorate_factor(start_date, end_date):
total_days_to_skip = date_diff(start_date, get_first_day(start_date))
total_days_in_month = int(get_last_day(start_date).strftime("%d"))
prorate_factor = flt(total_days_to_skip / total_days_in_month)
total_days_to_skip = date_diff(get_last_day(end_date), end_date)
total_days_in_month = int(get_last_day(end_date).strftime("%d"))
prorate_factor += flt(total_days_to_skip / total_days_in_month)
return prorate_factor

View File

@@ -0,0 +1,49 @@
{
"actions": [],
"autoname": "autoincrement",
"creation": "2022-09-13 16:18:59.404842",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"voucher_type",
"voucher_name",
"taxable_amount"
],
"fields": [
{
"fieldname": "voucher_type",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Voucher Type",
"options": "DocType"
},
{
"fieldname": "voucher_name",
"fieldtype": "Dynamic Link",
"in_list_view": 1,
"label": "Voucher Name",
"options": "voucher_type"
},
{
"fieldname": "taxable_amount",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Taxable Amount",
"options": "Company:company:default_currency"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2022-12-28 23:40:41.479208",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Tax Withheld Vouchers",
"naming_rule": "Random",
"owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}

View File

@@ -0,0 +1,9 @@
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class TaxWithheldVouchers(Document):
pass

View File

@@ -5,7 +5,7 @@
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import cint, getdate
from frappe.utils import cint, flt, getdate
class TaxWithholdingCategory(Document):
@@ -100,7 +100,7 @@ def get_party_tax_withholding_details(inv, tax_withholding_category=None):
).format(tax_withholding_category, inv.company, party)
)
tax_amount, tax_deducted, tax_deducted_on_advances = get_tax_amount(
tax_amount, tax_deducted, tax_deducted_on_advances, voucher_wise_amount = get_tax_amount(
party_type, parties, inv, tax_details, posting_date, pan_no
)
@@ -110,7 +110,7 @@ def get_party_tax_withholding_details(inv, tax_withholding_category=None):
tax_row = get_tax_row_for_tcs(inv, tax_details, tax_amount, tax_deducted)
if inv.doctype == "Purchase Invoice":
return tax_row, tax_deducted_on_advances
return tax_row, tax_deducted_on_advances, voucher_wise_amount
else:
return tax_row
@@ -208,7 +208,9 @@ def get_lower_deduction_certificate(tax_details, pan_no):
def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=None):
vouchers = get_invoice_vouchers(parties, tax_details, inv.company, party_type=party_type)
vouchers, voucher_wise_amount = get_invoice_vouchers(
parties, tax_details, inv.company, party_type=party_type
)
advance_vouchers = get_advance_vouchers(
parties,
company=inv.company,
@@ -227,6 +229,7 @@ def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=N
tax_deducted = get_deducted_tax(taxable_vouchers, tax_details)
tax_amount = 0
if party_type == "Supplier":
ldc = get_lower_deduction_certificate(tax_details, pan_no)
if tax_deducted:
@@ -237,6 +240,9 @@ def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=N
)
else:
tax_amount = net_total * tax_details.rate / 100 if net_total > 0 else 0
# 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, tax_deducted, vouchers)
@@ -250,14 +256,15 @@ def get_tax_amount(party_type, parties, inv, tax_details, posting_date, pan_no=N
tax_amount = get_tcs_amount(parties, inv, tax_details, vouchers, advance_vouchers)
if cint(tax_details.round_off_tax_amount):
tax_amount = round(tax_amount)
tax_amount = normal_round(tax_amount)
return tax_amount, tax_deducted, tax_deducted_on_advances
return tax_amount, tax_deducted, tax_deducted_on_advances, voucher_wise_amount
def get_invoice_vouchers(parties, tax_details, company, party_type="Supplier"):
dr_or_cr = "credit" if party_type == "Supplier" else "debit"
doctype = "Purchase Invoice" if party_type == "Supplier" else "Sales Invoice"
voucher_wise_amount = {}
vouchers = []
filters = {
"company": company,
@@ -267,34 +274,45 @@ def get_invoice_vouchers(parties, tax_details, company, party_type="Supplier"):
"docstatus": 1,
}
if not tax_details.get("consider_party_ledger_amount") and doctype != "Sales Invoice":
if doctype != "Sales Invoice":
filters.update(
{"apply_tds": 1, "tax_withholding_category": tax_details.get("tax_withholding_category")}
)
invoices = frappe.get_all(doctype, filters=filters, pluck="name") or [""]
invoices_details = frappe.get_all(doctype, filters=filters, fields=["name", "base_net_total"])
journal_entries = frappe.db.sql(
for d in invoices_details:
vouchers.append(d.name)
voucher_wise_amount.update({d.name: {"amount": d.base_net_total, "voucher_type": doctype}})
journal_entries_details = frappe.db.sql(
"""
SELECT j.name
SELECT j.name, ja.credit - ja.debit AS amount
FROM `tabJournal Entry` j, `tabJournal Entry Account` ja
WHERE
j.docstatus = 1
j.name = ja.parent
AND j.docstatus = 1
AND j.is_opening = 'No'
AND j.posting_date between %s and %s
AND ja.{dr_or_cr} > 0
AND ja.party in %s
""".format(
dr_or_cr=dr_or_cr
AND j.apply_tds = 1
AND j.tax_withholding_category = %s
""",
(
tax_details.from_date,
tax_details.to_date,
tuple(parties),
tax_details.get("tax_withholding_category"),
),
(tax_details.from_date, tax_details.to_date, tuple(parties)),
as_list=1,
as_dict=1,
)
if journal_entries:
journal_entries = journal_entries[0]
if journal_entries_details:
for d in journal_entries_details:
vouchers.append(d.name)
voucher_wise_amount.update({d.name: {"amount": d.amount, "voucher_type": "Journal Entry"}})
return invoices + journal_entries
return vouchers, voucher_wise_amount
def get_advance_vouchers(
@@ -309,9 +327,11 @@ def get_advance_vouchers(
"is_cancelled": 0,
"party_type": party_type,
"party": ["in", parties],
"against_voucher": ["is", "not set"],
}
if party_type == "Customer":
filters.update({"against_voucher": ["is", "not set"]})
if company:
filters["company"] = company
if from_date and to_date:
@@ -321,23 +341,25 @@ def get_advance_vouchers(
def get_taxes_deducted_on_advances_allocated(inv, tax_details):
advances = [d.reference_name for d in inv.get("advances")]
tax_info = []
if advances:
pe = frappe.qb.DocType("Payment Entry").as_("pe")
at = frappe.qb.DocType("Advance Taxes and Charges").as_("at")
if inv.get("advances"):
advances = [d.reference_name for d in inv.get("advances")]
tax_info = (
frappe.qb.from_(at)
.inner_join(pe)
.on(pe.name == at.parent)
.select(at.parent, at.name, at.tax_amount, at.allocated_amount)
.where(pe.tax_withholding_category == tax_details.get("tax_withholding_category"))
.where(at.parent.isin(advances))
.where(at.account_head == tax_details.account_head)
.run(as_dict=True)
)
if advances:
pe = frappe.qb.DocType("Payment Entry").as_("pe")
at = frappe.qb.DocType("Advance Taxes and Charges").as_("at")
tax_info = (
frappe.qb.from_(at)
.inner_join(pe)
.on(pe.name == at.parent)
.select(at.parent, at.name, at.tax_amount, at.allocated_amount)
.where(pe.tax_withholding_category == tax_details.get("tax_withholding_category"))
.where(at.parent.isin(advances))
.where(at.account_head == tax_details.account_head)
.run(as_dict=True)
)
return tax_info
@@ -359,6 +381,9 @@ def get_deducted_tax(taxable_vouchers, tax_details):
def get_tds_amount(ldc, parties, inv, tax_details, tax_deducted, vouchers):
tds_amount = 0
supp_credit_amt = 0.0
supp_jv_credit_amt = 0.0
invoice_filters = {"name": ("in", vouchers), "docstatus": 1, "apply_tds": 1}
field = "sum(net_total)"
@@ -367,30 +392,25 @@ def get_tds_amount(ldc, parties, inv, tax_details, tax_deducted, vouchers):
invoice_filters.pop("apply_tds", None)
field = "sum(grand_total)"
supp_credit_amt = frappe.db.get_value("Purchase Invoice", invoice_filters, field) or 0.0
if vouchers:
supp_credit_amt = frappe.db.get_value("Purchase Invoice", invoice_filters, field) or 0.0
supp_jv_credit_amt = (
frappe.db.get_value(
"Journal Entry Account",
{
"parent": ("in", vouchers),
"docstatus": 1,
"party": ("in", parties),
"reference_type": ("!=", "Purchase Invoice"),
},
"sum(credit_in_account_currency)",
)
or 0.0
)
supp_jv_credit_amt = (
frappe.db.get_value(
"Journal Entry Account",
{
"parent": ("in", vouchers),
"docstatus": 1,
"party": ("in", parties),
"reference_type": ("!=", "Purchase Invoice"),
},
"sum(credit_in_account_currency)",
)
) or 0.0
supp_credit_amt += supp_jv_credit_amt
supp_credit_amt += inv.net_total
debit_note_amount = get_debit_note_amount(
parties, tax_details.from_date, tax_details.to_date, inv.company
)
supp_credit_amt -= debit_note_amount
threshold = tax_details.get("threshold", 0)
cumulative_threshold = tax_details.get("cumulative_threshold", 0)
@@ -402,7 +422,10 @@ def get_tds_amount(ldc, parties, inv, tax_details, tax_deducted, vouchers):
):
# Get net total again as TDS is calculated on net total
# Grand is used to just check for threshold breach
net_total = frappe.db.get_value("Purchase Invoice", invoice_filters, "sum(net_total)") or 0.0
net_total = 0
if vouchers:
net_total = frappe.db.get_value("Purchase Invoice", invoice_filters, "sum(net_total)")
net_total += inv.net_total
supp_credit_amt = net_total - cumulative_threshold
@@ -423,36 +446,40 @@ def get_tds_amount(ldc, parties, inv, tax_details, tax_deducted, vouchers):
def get_tcs_amount(parties, inv, tax_details, vouchers, adv_vouchers):
tcs_amount = 0
invoiced_amt = 0
advance_amt = 0
# sum of debit entries made from sales invoices
invoiced_amt = (
frappe.db.get_value(
"GL Entry",
{
"is_cancelled": 0,
"party": ["in", parties],
"company": inv.company,
"voucher_no": ["in", vouchers],
},
"sum(debit)",
if vouchers:
invoiced_amt = (
frappe.db.get_value(
"GL Entry",
{
"is_cancelled": 0,
"party": ["in", parties],
"company": inv.company,
"voucher_no": ["in", vouchers],
},
"sum(debit)",
)
or 0.0
)
or 0.0
)
# sum of credit entries made from PE / JV with unset 'against voucher'
advance_amt = (
frappe.db.get_value(
"GL Entry",
{
"is_cancelled": 0,
"party": ["in", parties],
"company": inv.company,
"voucher_no": ["in", adv_vouchers],
},
"sum(credit)",
if advance_amt:
advance_amt = (
frappe.db.get_value(
"GL Entry",
{
"is_cancelled": 0,
"party": ["in", parties],
"company": inv.company,
"voucher_no": ["in", adv_vouchers],
},
"sum(credit)",
)
or 0.0
)
or 0.0
)
# sum of credit entries made from sales invoice
credit_note_amt = sum(
@@ -491,10 +518,19 @@ def get_invoice_total_without_tcs(inv, tax_details):
def get_tds_amount_from_ldc(ldc, parties, pan_no, tax_details, posting_date, net_total):
tds_amount = 0
limit_consumed = frappe.db.get_value(
"Purchase Invoice",
{"supplier": ("in", parties), "apply_tds": 1, "docstatus": 1},
"sum(net_total)",
limit_consumed = flt(
frappe.db.get_all(
"Purchase Invoice",
filters={
"supplier": ("in", parties),
"apply_tds": 1,
"docstatus": 1,
"tax_withholding_category": ldc.tax_withholding_category,
"posting_date": ("between", (ldc.valid_from, ldc.valid_upto)),
},
fields=["sum(base_net_total) as limit_consumed"],
)[0].get("limit_consumed")
)
if is_valid_certificate(
@@ -507,27 +543,11 @@ def get_tds_amount_from_ldc(ldc, parties, pan_no, tax_details, posting_date, net
return tds_amount
def get_debit_note_amount(suppliers, from_date, to_date, company=None):
filters = {
"supplier": ["in", suppliers],
"is_return": 1,
"docstatus": 1,
"posting_date": ["between", (from_date, to_date)],
}
fields = ["abs(sum(net_total)) as net_total"]
if company:
filters["company"] = company
return frappe.get_all("Purchase Invoice", filters, fields)[0].get("net_total") or 0.0
def get_ltds_amount(current_amount, deducted_amount, certificate_limit, rate, tax_details):
if current_amount < (certificate_limit - deducted_amount):
if certificate_limit - flt(deducted_amount) - flt(current_amount) >= 0:
return current_amount * rate / 100
else:
ltds_amount = certificate_limit - deducted_amount
ltds_amount = certificate_limit - flt(deducted_amount)
tds_amount = current_amount - ltds_amount
return ltds_amount * rate / 100 + tds_amount * tax_details.rate / 100
@@ -538,9 +558,26 @@ def is_valid_certificate(
):
valid = False
if (
getdate(valid_from) <= getdate(posting_date) <= getdate(valid_upto)
) and certificate_limit > deducted_amount:
available_amount = flt(certificate_limit) - flt(deducted_amount)
if (getdate(valid_from) <= getdate(posting_date) <= getdate(valid_upto)) and available_amount > 0:
valid = True
return valid
def normal_round(number):
"""
Rounds a number to the nearest integer.
:param number: The number to round.
"""
decimal_part = number - int(number)
if decimal_part >= 0.5:
decimal_part = 1
else:
decimal_part = 0
number = int(number) + decimal_part
return number

View File

@@ -52,7 +52,7 @@ class TestTaxWithholdingCategory(unittest.TestCase):
invoices.append(pi)
# delete invoices to avoid clashing
for d in invoices:
for d in reversed(invoices):
d.cancel()
def test_single_threshold_tds(self):
@@ -88,7 +88,7 @@ class TestTaxWithholdingCategory(unittest.TestCase):
self.assertEqual(pi.taxes_and_charges_deducted, 1000)
# delete invoices to avoid clashing
for d in invoices:
for d in reversed(invoices):
d.cancel()
def test_tax_withholding_category_checks(self):
@@ -110,11 +110,11 @@ class TestTaxWithholdingCategory(unittest.TestCase):
invoices.append(pi1)
# Cumulative threshold is 30000
# Threshold calculation should be on both the invoices
# TDS should be applied only on 1000
self.assertEqual(pi1.taxes[0].tax_amount, 1000)
# Threshold calculation should be only on the Second invoice
# Second didn't breach, no TDS should be applied
self.assertEqual(pi1.taxes, [])
for d in invoices:
for d in reversed(invoices):
d.cancel()
def test_cumulative_threshold_tcs(self):
@@ -148,8 +148,8 @@ class TestTaxWithholdingCategory(unittest.TestCase):
self.assertEqual(tcs_charged, 500)
invoices.append(si)
# delete invoices to avoid clashing
for d in invoices:
# cancel invoices to avoid clashing
for d in reversed(invoices):
d.cancel()
def test_tds_calculation_on_net_total(self):
@@ -182,10 +182,46 @@ class TestTaxWithholdingCategory(unittest.TestCase):
self.assertEqual(pi1.taxes[0].tax_amount, 4000)
# delete invoices to avoid clashing
for d in invoices:
# cancel invoices to avoid clashing
for d in reversed(invoices):
d.cancel()
def test_tds_deduction_for_po_via_payment_entry(self):
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
frappe.db.set_value(
"Supplier", "Test TDS Supplier8", "tax_withholding_category", "Cumulative Threshold TDS"
)
order = create_purchase_order(supplier="Test TDS Supplier8", rate=40000, do_not_save=True)
# Add some tax on the order
order.append(
"taxes",
{
"category": "Total",
"charge_type": "Actual",
"account_head": "_Test Account VAT - _TC",
"cost_center": "Main - _TC",
"tax_amount": 8000,
"description": "Test",
"add_deduct_tax": "Add",
},
)
order.save()
order.apply_tds = 1
order.tax_withholding_category = "Cumulative Threshold TDS"
order.submit()
self.assertEqual(order.taxes[0].tax_amount, 4000)
payment = get_payment_entry(order.doctype, order.name)
payment.apply_tax_withholding_amount = 1
payment.tax_withholding_category = "Cumulative Threshold TDS"
payment.submit()
self.assertEqual(payment.taxes[0].tax_amount, 4000)
def test_multi_category_single_supplier(self):
frappe.db.set_value(
"Supplier", "Test TDS Supplier5", "tax_withholding_category", "Test Service Category"
@@ -207,8 +243,50 @@ class TestTaxWithholdingCategory(unittest.TestCase):
self.assertEqual(pi1.taxes[0].tax_amount, 250)
# delete invoices to avoid clashing
for d in invoices:
# cancel invoices to avoid clashing
for d in reversed(invoices):
d.cancel()
def test_tax_withholding_category_voucher_display(self):
frappe.db.set_value(
"Supplier", "Test TDS Supplier6", "tax_withholding_category", "Test Multi Invoice Category"
)
invoices = []
pi = create_purchase_invoice(supplier="Test TDS Supplier6", rate=4000, do_not_save=True)
pi.apply_tds = 1
pi.tax_withholding_category = "Test Multi Invoice Category"
pi.save()
pi.submit()
invoices.append(pi)
pi1 = create_purchase_invoice(supplier="Test TDS Supplier6", rate=2000, do_not_save=True)
pi1.apply_tds = 1
pi1.is_return = 1
pi1.items[0].qty = -1
pi1.tax_withholding_category = "Test Multi Invoice Category"
pi1.save()
pi1.submit()
invoices.append(pi1)
pi2 = create_purchase_invoice(supplier="Test TDS Supplier6", rate=9000, do_not_save=True)
pi2.apply_tds = 1
pi2.tax_withholding_category = "Test Multi Invoice Category"
pi2.save()
pi2.submit()
invoices.append(pi2)
pi2.load_from_db()
self.assertTrue(pi2.taxes[0].tax_amount, 1100)
self.assertTrue(pi2.tax_withheld_vouchers[0].voucher_name == pi1.name)
self.assertTrue(pi2.tax_withheld_vouchers[0].taxable_amount == pi1.net_total)
self.assertTrue(pi2.tax_withheld_vouchers[1].voucher_name == pi.name)
self.assertTrue(pi2.tax_withheld_vouchers[1].taxable_amount == pi.net_total)
# cancel invoices to avoid clashing
for d in reversed(invoices):
d.cancel()
@@ -233,6 +311,37 @@ def cancel_invoices():
frappe.get_doc("Sales Invoice", d).cancel()
def create_purchase_order(**args):
# return purchase order doc object
item = frappe.db.get_value("Item", {"item_name": "TDS Item"}, "name")
args = frappe._dict(args)
po = frappe.get_doc(
{
"doctype": "Purchase Order",
"transaction_date": today(),
"schedule_date": today(),
"apply_tds": 0 if args.do_not_apply_tds else 1,
"supplier": args.supplier,
"company": "_Test Company",
"taxes_and_charges": "",
"currency": "INR",
"taxes": [],
"items": [
{
"doctype": "Purchase Order Item",
"item_code": item,
"qty": args.qty or 1,
"rate": args.rate or 10000,
"cost_center": "Main - _TC",
"expense_account": "Stock Received But Not Billed - _TC",
}
],
}
)
po.save()
return po
def create_purchase_invoice(**args):
# return sales invoice doc object
item = frappe.db.get_value("Item", {"item_name": "TDS Item"}, "name")
@@ -308,6 +417,9 @@ def create_records():
"Test TDS Supplier3",
"Test TDS Supplier4",
"Test TDS Supplier5",
"Test TDS Supplier6",
"Test TDS Supplier7",
"Test TDS Supplier8",
]:
if frappe.db.exists("Supplier", name):
continue
@@ -498,3 +610,22 @@ def create_tax_with_holding_category():
"accounts": [{"company": "_Test Company", "account": "TDS - _TC"}],
}
).insert()
if not frappe.db.exists("Tax Withholding Category", "Test Multi Invoice Category"):
frappe.get_doc(
{
"doctype": "Tax Withholding Category",
"name": "Test Multi Invoice Category",
"category_name": "Test Multi Invoice Category",
"rates": [
{
"from_date": fiscal_year[1],
"to_date": fiscal_year[2],
"tax_withholding_rate": 10,
"single_threshold": 5000,
"cumulative_threshold": 10000,
}
],
"accounts": [{"company": "_Test Company", "account": "TDS - _TC"}],
}
).insert()

View File

@@ -29,6 +29,7 @@ def make_gl_entries(
if gl_map:
if not cancel:
validate_accounting_period(gl_map)
validate_disabled_accounts(gl_map)
gl_map = process_gl_map(gl_map, merge_entries)
if gl_map and len(gl_map) > 1:
save_entries(gl_map, adv_adj, update_outstanding, from_repost)
@@ -43,6 +44,26 @@ def make_gl_entries(
make_reverse_gl_entries(gl_map, adv_adj=adv_adj, update_outstanding=update_outstanding)
def validate_disabled_accounts(gl_map):
accounts = [d.account for d in gl_map if d.account]
Account = frappe.qb.DocType("Account")
disabled_accounts = (
frappe.qb.from_(Account)
.where(Account.name.isin(accounts) & Account.disabled == 1)
.select(Account.name, Account.disabled)
).run(as_dict=True)
if disabled_accounts:
account_list = "<br>"
account_list += ", ".join([frappe.bold(d.name) for d in disabled_accounts])
frappe.throw(
_("Cannot create accounting entries against disabled accounts: {0}").format(account_list),
title=_("Disabled Account Selected"),
)
def validate_accounting_period(gl_map):
accounting_periods = frappe.db.sql(
""" SELECT
@@ -127,6 +148,7 @@ def update_net_values(entry):
def merge_similar_entries(gl_map, precision=None):
merged_gl_map = []
accounting_dimensions = get_accounting_dimensions()
for entry in gl_map:
# if there is already an entry in this account then just add it
# to that entry
@@ -208,9 +230,10 @@ def make_entry(args, adv_adj, update_outstanding, from_repost=False):
gle.flags.from_repost = from_repost
gle.flags.adv_adj = adv_adj
gle.flags.update_outstanding = update_outstanding or "Yes"
gle.flags.notify_update = False
gle.submit()
if not from_repost:
if not from_repost and gle.voucher_type != "Period Closing Voucher":
validate_expense_against_budget(args)
@@ -275,20 +298,22 @@ def make_round_off_gle(gl_map, debit_credit_diff, precision):
round_off_account, round_off_cost_center = get_round_off_account_and_cost_center(
gl_map[0].company, gl_map[0].voucher_type, gl_map[0].voucher_no
)
round_off_account_exists = False
round_off_gle = frappe._dict()
for d in gl_map:
if d.account == round_off_account:
round_off_gle = d
if d.debit:
debit_credit_diff -= flt(d.debit)
else:
debit_credit_diff += flt(d.credit)
round_off_account_exists = True
round_off_account_exists = False
if round_off_account_exists and abs(debit_credit_diff) < (1.0 / (10**precision)):
gl_map.remove(round_off_gle)
return
if gl_map[0].voucher_type != "Period Closing Voucher":
for d in gl_map:
if d.account == round_off_account:
round_off_gle = d
if d.debit:
debit_credit_diff -= flt(d.debit) - flt(d.credit)
else:
debit_credit_diff += flt(d.credit)
round_off_account_exists = True
if round_off_account_exists and abs(debit_credit_diff) < (1.0 / (10**precision)):
gl_map.remove(round_off_gle)
return
if not round_off_gle:
for k in ["voucher_type", "voucher_no", "company", "posting_date", "remarks"]:
@@ -311,7 +336,6 @@ def make_round_off_gle(gl_map, debit_credit_diff, precision):
)
update_accounting_dimensions(round_off_gle)
if not round_off_account_exists:
gl_map.append(round_off_gle)

View File

@@ -4,12 +4,7 @@
import frappe
from frappe import _, msgprint, scrub
from frappe.contacts.doctype.address.address import (
get_address_display,
get_company_address,
get_default_address,
)
from frappe.contacts.doctype.contact.contact import get_contact_details
from frappe.contacts.doctype.address.address import get_company_address, get_default_address
from frappe.core.doctype.user_permission.user_permission import get_permitted_documents
from frappe.model.utils import get_fetch_values
from frappe.utils import (
@@ -120,6 +115,7 @@ def _get_party_details(
party_address,
company_address,
shipping_address,
ignore_permissions=ignore_permissions,
)
set_contact_details(party_details, party, party_type)
set_other_values(party_details, party, party_type)
@@ -183,6 +179,8 @@ def set_address_details(
party_address=None,
company_address=None,
shipping_address=None,
*,
ignore_permissions=False
):
billing_address_field = (
"customer_address" if party_type == "Lead" else party_type.lower() + "_address"
@@ -195,24 +193,28 @@ def set_address_details(
get_fetch_values(doctype, billing_address_field, party_details[billing_address_field])
)
# address display
party_details.address_display = get_address_display(party_details[billing_address_field])
party_details.address_display = render_address(
party_details[billing_address_field], check_permissions=not ignore_permissions
)
# shipping address
if party_type in ["Customer", "Lead"]:
party_details.shipping_address_name = shipping_address or get_party_shipping_address(
party_type, party.name
)
party_details.shipping_address = get_address_display(party_details["shipping_address_name"])
party_details.shipping_address = render_address(
party_details["shipping_address_name"], check_permissions=not ignore_permissions
)
if doctype:
party_details.update(
get_fetch_values(doctype, "shipping_address_name", party_details.shipping_address_name)
)
if company_address:
party_details.update({"company_address": company_address})
party_details.company_address = company_address
else:
party_details.update(get_company_address(company))
if doctype and doctype in ["Delivery Note", "Sales Invoice", "Sales Order"]:
if doctype and doctype in ["Delivery Note", "Sales Invoice", "Sales Order", "Quotation"]:
if party_details.company_address:
party_details.update(
get_fetch_values(doctype, "company_address", party_details.company_address)
@@ -220,12 +222,40 @@ def set_address_details(
get_regional_address_details(party_details, doctype, company)
elif doctype and doctype in ["Purchase Invoice", "Purchase Order", "Purchase Receipt"]:
if party_details.company_address:
party_details["shipping_address"] = shipping_address or party_details["company_address"]
party_details.shipping_address_display = get_address_display(party_details["shipping_address"])
if shipping_address:
party_details.update(
get_fetch_values(doctype, "shipping_address", party_details.shipping_address)
{
"shipping_address": shipping_address,
"shipping_address_display": render_address(
shipping_address, check_permissions=not ignore_permissions
),
**get_fetch_values(doctype, "shipping_address", shipping_address),
}
)
if party_details.company_address:
# billing address
party_details.update(
{
"billing_address": party_details.company_address,
"billing_address_display": (
party_details.company_address_display
or render_address(party_details.company_address, check_permissions=True)
),
**get_fetch_values(doctype, "billing_address", party_details.company_address),
}
)
# shipping address - if not already set
if not party_details.shipping_address:
party_details.update(
{
"shipping_address": party_details.billing_address,
"shipping_address_display": party_details.billing_address_display,
**get_fetch_values(doctype, "shipping_address", party_details.billing_address),
}
)
get_regional_address_details(party_details, doctype, company)
return party_details.get(billing_address_field), party_details.shipping_address_name
@@ -252,7 +282,34 @@ def set_contact_details(party_details, party, party_type):
}
)
else:
party_details.update(get_contact_details(party_details.contact_person))
fields = [
"name as contact_person",
"salutation",
"first_name",
"last_name",
"email_id as contact_email",
"mobile_no as contact_mobile",
"phone as contact_phone",
"designation as contact_designation",
"department as contact_department",
]
contact_details = frappe.db.get_value(
"Contact", party_details.contact_person, fields, as_dict=True
)
contact_details.contact_display = " ".join(
filter(
None,
[
contact_details.get("salutation"),
contact_details.get("first_name"),
contact_details.get("last_name"),
],
)
)
party_details.update(contact_details)
def set_other_values(party_details, party, party_type):
@@ -898,3 +955,28 @@ def get_default_contact(doctype, name):
return None
else:
return None
def add_party_account(party_type, party, company, account):
doc = frappe.get_doc(party_type, party)
account_exists = False
for d in doc.get("accounts"):
if d.account == account:
account_exists = True
if not account_exists:
accounts = {"company": company, "account": account}
doc.append("accounts", accounts)
doc.save()
def render_address(address, check_permissions=True):
try:
from frappe.contacts.doctype.address.address import render_address as _render
except ImportError:
# Older frappe versions where this function is not available
from frappe.contacts.doctype.address.address import get_address_display as _render
return frappe.call(_render, address, check_permissions=check_permissions)

View File

@@ -50,6 +50,10 @@
<div class="col-xs-4"><label>Document No</label></div>
<div class="col-xs-8 value">{{ einvoice.DocDtls.No }}</div>
</div>
<div class="row data-field">
<div class="col-xs-4"><label>Document Date</label></div>
<div class="col-xs-8 value">{{ einvoice.DocDtls.Dt }}</div>
</div>
</div>
<div class="col-xs-4 column-break">
<img src="{{ doc.qrcode_image }}" width="175px" style="float: right;">

View File

@@ -42,7 +42,7 @@
{% if(filters.show_future_payments) { %}
{% var balance_row = data.slice(-1).pop();
var start = filters.based_on_payment_terms ? 13 : 11;
var start = report.columns.findIndex((elem) => (elem.fieldname == 'age'));
var range1 = report.columns[start].label;
var range2 = report.columns[start+1].label;
var range3 = report.columns[start+2].label;

View File

@@ -5,7 +5,7 @@
from collections import OrderedDict
import frappe
from frappe import _, scrub
from frappe import _, qb, scrub
from frappe.utils import cint, cstr, flt, getdate, nowdate
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
@@ -95,6 +95,9 @@ class ReceivablePayableReport(object):
# Get return entries
self.get_return_entries()
# Get Exchange Rate Revaluations
self.get_exchange_rate_revaluations()
self.data = []
for gle in self.gl_entries:
self.update_voucher_balance(gle)
@@ -258,7 +261,8 @@ class ReceivablePayableReport(object):
row.invoice_grand_total = row.invoiced
if (abs(row.outstanding) > 1.0 / 10**self.currency_precision) and (
abs(row.outstanding_in_account_currency) > 1.0 / 10**self.currency_precision
(abs(row.outstanding_in_account_currency) > 1.0 / 10**self.currency_precision)
or (row.voucher_no in self.err_journals)
):
# non-zero oustanding, we must consider this row
@@ -685,10 +689,10 @@ class ReceivablePayableReport(object):
if self.filters.get(scrub(self.party_type)):
select_fields = "debit_in_account_currency as debit, credit_in_account_currency as credit"
doc_currency_fields = "debit as debit_in_account_currency, credit as credit_in_account_currency"
else:
select_fields = "debit, credit"
doc_currency_fields = "debit_in_account_currency, credit_in_account_currency"
doc_currency_fields = "debit_in_account_currency, credit_in_account_currency"
remarks = ", remarks" if self.filters.get("show_remarks") else ""
@@ -1033,3 +1037,17 @@ class ReceivablePayableReport(object):
"data": {"labels": self.ageing_column_labels, "datasets": rows},
"type": "percentage",
}
def get_exchange_rate_revaluations(self):
je = qb.DocType("Journal Entry")
results = (
qb.from_(je)
.select(je.name)
.where(
(je.company == self.filters.company)
& (je.posting_date.lte(self.filters.report_date))
& (je.voucher_type == "Exchange Rate Revaluation")
)
.run()
)
self.err_journals = [x[0] for x in results] if results else []

View File

@@ -1,18 +1,51 @@
import unittest
import frappe
from frappe.utils import add_days, getdate, today
from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import add_days, flt, getdate, today
from erpnext import get_default_cost_center
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.accounts.report.accounts_receivable.accounts_receivable import execute
class TestAccountsReceivable(unittest.TestCase):
def test_accounts_receivable(self):
def setUp(self):
frappe.db.sql("delete from `tabSales Invoice` where company='_Test Company 2'")
frappe.db.sql("delete from `tabGL Entry` where company='_Test Company 2'")
frappe.db.sql("delete from `tabJournal Entry` where company='_Test Company 2'")
frappe.db.sql("delete from `tabExchange Rate Revaluation` where company='_Test Company 2'")
self.create_usd_account()
def tearDown(self):
frappe.db.rollback()
def create_usd_account(self):
name = "Debtors USD"
exists = frappe.db.get_list(
"Account", filters={"company": "_Test Company 2", "account_name": "Debtors USD"}
)
if exists:
self.debtors_usd = exists[0].name
else:
debtors = frappe.get_doc(
"Account",
frappe.db.get_list(
"Account", filters={"company": "_Test Company 2", "account_name": "Debtors"}
)[0].name,
)
debtors_usd = frappe.new_doc("Account")
debtors_usd.company = debtors.company
debtors_usd.account_name = "Debtors USD"
debtors_usd.account_currency = "USD"
debtors_usd.parent_account = debtors.parent_account
debtors_usd.account_type = debtors.account_type
self.debtors_usd = debtors_usd.save().name
def test_accounts_receivable(self):
filters = {
"company": "_Test Company 2",
"based_on_payment_terms": 1,
@@ -24,7 +57,7 @@ class TestAccountsReceivable(unittest.TestCase):
}
# check invoice grand total and invoiced column's value for 3 payment terms
name = make_sales_invoice()
name = make_sales_invoice().name
report = execute(filters)
expected_data = [[100, 30], [100, 50], [100, 20]]
@@ -65,8 +98,74 @@ class TestAccountsReceivable(unittest.TestCase):
],
)
@change_settings(
"Accounts Settings", {"allow_multi_currency_invoices_against_single_party_account": 1}
)
def test_exchange_revaluation_for_party(self):
"""
Exchange Revaluation for party on Receivable/Payable shoule be included
"""
def make_sales_invoice():
company = "_Test Company 2"
customer = "_Test Customer 2"
# Using Exchange Gain/Loss account for unrealized as well.
company_doc = frappe.get_doc("Company", company)
company_doc.unrealized_exchange_gain_loss_account = company_doc.exchange_gain_loss_account
company_doc.save()
si = make_sales_invoice(no_payment_schedule=True, do_not_submit=True)
si.currency = "USD"
si.conversion_rate = 0.90
si.debit_to = self.debtors_usd
si = si.save().submit()
# Exchange Revaluation
err = frappe.new_doc("Exchange Rate Revaluation")
err.company = company
err.posting_date = today()
accounts = err.get_accounts_data()
err.extend("accounts", accounts)
err.accounts[0].new_exchange_rate = 0.95
row = err.accounts[0]
row.new_balance_in_base_currency = flt(
row.new_exchange_rate * flt(row.balance_in_account_currency)
)
row.gain_loss = row.new_balance_in_base_currency - flt(row.balance_in_base_currency)
err.set_total_gain_loss()
err = err.save().submit()
# Submit JV for ERR
jv = frappe.get_doc(err.make_jv_entry())
jv = jv.save()
for x in jv.accounts:
x.cost_center = get_default_cost_center(jv.company)
jv.submit()
filters = {
"company": company,
"report_date": today(),
"range1": 30,
"range2": 60,
"range3": 90,
"range4": 120,
}
report = execute(filters)
expected_data_for_err = [0, -5, 0, 5]
row = [x for x in report[1] if x.voucher_type == jv.doctype and x.voucher_no == jv.name][0]
self.assertEqual(
expected_data_for_err,
[
row.invoiced,
row.paid,
row.credit_note,
row.outstanding,
],
)
def make_sales_invoice(no_payment_schedule=False, do_not_submit=False):
frappe.set_user("Administrator")
si = create_sales_invoice(
@@ -81,22 +180,26 @@ def make_sales_invoice():
do_not_save=1,
)
si.append(
"payment_schedule",
dict(due_date=getdate(add_days(today(), 30)), invoice_portion=30.00, payment_amount=30),
)
si.append(
"payment_schedule",
dict(due_date=getdate(add_days(today(), 60)), invoice_portion=50.00, payment_amount=50),
)
si.append(
"payment_schedule",
dict(due_date=getdate(add_days(today(), 90)), invoice_portion=20.00, payment_amount=20),
)
if not no_payment_schedule:
si.append(
"payment_schedule",
dict(due_date=getdate(add_days(today(), 30)), invoice_portion=30.00, payment_amount=30),
)
si.append(
"payment_schedule",
dict(due_date=getdate(add_days(today(), 60)), invoice_portion=50.00, payment_amount=50),
)
si.append(
"payment_schedule",
dict(due_date=getdate(add_days(today(), 90)), invoice_portion=20.00, payment_amount=20),
)
si.submit()
si = si.save()
return si.name
if not do_not_submit:
si = si.submit()
return si
def make_payment(docname):

View File

@@ -1,20 +1,23 @@
{
"add_total_row": 0,
"apply_user_permissions": 1,
"creation": "2016-04-08 14:49:58.133098",
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"idx": 2,
"is_standard": "Yes",
"modified": "2017-02-24 20:08:26.084484",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Asset Depreciation Ledger",
"owner": "Administrator",
"ref_doctype": "Asset",
"report_name": "Asset Depreciation Ledger",
"report_type": "Script Report",
"add_total_row": 1,
"columns": [],
"creation": "2016-04-08 14:49:58.133098",
"disable_prepared_report": 0,
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 2,
"is_standard": "Yes",
"modified": "2023-06-06 09:00:07.435151",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Asset Depreciation Ledger",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "Asset",
"report_name": "Asset Depreciation Ledger",
"report_type": "Script Report",
"roles": [
{
"role": "Accounts User"

View File

@@ -25,6 +25,7 @@ def get_data(filters):
["posting_date", "<=", filters.get("to_date")],
["against_voucher_type", "=", "Asset"],
["account", "in", depreciation_accounts],
["is_cancelled", "=", 0],
]
if filters.get("asset"):

View File

@@ -1,20 +1,23 @@
{
"add_total_row": 0,
"apply_user_permissions": 1,
"creation": "2016-04-08 14:56:37.235981",
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"idx": 2,
"is_standard": "Yes",
"modified": "2017-02-24 20:08:18.660476",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Asset Depreciations and Balances",
"owner": "Administrator",
"ref_doctype": "Asset",
"report_name": "Asset Depreciations and Balances",
"report_type": "Script Report",
"add_total_row": 1,
"columns": [],
"creation": "2016-04-08 14:56:37.235981",
"disable_prepared_report": 0,
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 2,
"is_standard": "Yes",
"modified": "2023-06-06 11:33:29.611277",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Asset Depreciations and Balances",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "Asset",
"report_name": "Asset Depreciations and Balances",
"report_type": "Script Report",
"roles": [
{
"role": "Accounts User"

View File

@@ -114,25 +114,31 @@ def get_assets(filters):
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,
ifnull(sum(case when ds.schedule_date < %(from_date)s and (ifnull(a.disposal_date, 0) = 0 or a.disposal_date >= %(from_date)s) then
ds.depreciation_amount
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 ifnull(a.disposal_date, 0) != 0 and a.disposal_date >= %(from_date)s
and a.disposal_date <= %(to_date)s and ds.schedule_date <= a.disposal_date then
ds.depreciation_amount
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 ds.schedule_date >= %(from_date)s and ds.schedule_date <= %(to_date)s
and (ifnull(a.disposal_date, 0) = 0 or ds.schedule_date <= a.disposal_date) then
ds.depreciation_amount
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 `tabAsset` a, `tabDepreciation Schedule` ds
where a.docstatus=1 and a.company=%(company)s and a.purchase_date <= %(to_date)s and a.name = ds.parent and ifnull(ds.journal_entry, '') != ''
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.debit != 0 and gle.is_cancelled = 0 and gle.account = ifnull(aca.depreciation_expense_account, company.depreciation_expense_account)
group by a.asset_category
union
SELECT a.asset_category,

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