Compare commits

..

723 Commits

Author SHA1 Message Date
rohitwaghchaure
4a748f45c9 fix: linter issue 2024-03-12 15:28:33 +05:30
rohitwaghchaure
581c8b1a22 Merge branch 'version-15' into version-15-hotfix 2024-03-12 15:18:55 +05:30
mergify[bot]
478b988290 fix: negative stock error for the batch (backport #40389) (#40391)
fix: negative stock error for the batch (#40389)

(cherry picked from commit a419812864)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-03-12 14:55:34 +05:30
Gursheen Kaur Anand
c0b60413b6 Merge pull request #40393 from frappe/mergify/bp/version-15-hotfix/pr-40388
feat: add recursion qty field in promotional scheme (backport #40388)
2024-03-12 14:51:09 +05:30
Gursheen Anand
11f30e90ab test: pricing rule for product discounts
(cherry picked from commit 0ffc5cf012)
2024-03-12 08:59:40 +00:00
Gursheen Anand
5f4b23d4af feat: add recursion qty field in promotional scheme
(cherry picked from commit 7075c50b85)
2024-03-12 08:59:39 +00:00
mergify[bot]
9ce68deff5 fix: barcode field on line item not working (backport #40381) (#40384)
fix: barcode field on line item not working (#40381)

(cherry picked from commit 0da19a40a7)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-03-12 13:48:48 +05:30
mergify[bot]
32660abdc8 fix: Use serial/batch fields for delivery note return (backport #40374) (#40376)
fix: Use serial/batch fields for delivery note return (#40374)

fix: User serial/batch fields for delivery note return
(cherry picked from commit b9a8dd468b)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-03-11 17:27:02 +05:30
ruthra kumar
76fc420b21 Merge pull request #40375 from frappe/mergify/bp/version-15-hotfix/pr-40299
refactor: run qb directly instead of converting to sql (backport #40299)
2024-03-11 17:02:50 +05:30
ruthra kumar
c111ce9bf4 chore: replace parameter with qb conditions
(cherry picked from commit 0344ff2aac)
2024-03-11 11:15:43 +00:00
ruthra kumar
03bde07966 refactor: run qb directly instead of converting to sql
(cherry picked from commit 711b72b26c)
2024-03-11 11:15:43 +00:00
mergify[bot]
a195dd3c1f fix: MR Default Supplier search query (backport #40273) (#40351)
fix: MR Default Supplier search query

(cherry picked from commit c0a1f298a1)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-03-11 11:07:40 +05:30
mergify[bot]
7d3d2eb928 ci: add prettier to pre-commit (backport #40206) (#40362)
* ci: add prettier to pre-commit

(cherry picked from commit 2c16036ef3)

* style: format js files

---------

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2024-03-11 10:47:18 +05:30
Deepesh Garg
5f789d9abe Merge pull request #40364 from frappe/mergify/bp/version-15-hotfix/pr-40344
fix: get_user_default_as_list args order (#40344)
2024-03-10 22:32:45 +05:30
Devin Slauenwhite
44ff607dcd fix: get_user_default_as_list args order
(cherry picked from commit ac1961b687)
2024-03-10 15:45:35 +00:00
Deepesh Garg
54fd9ec21e Merge pull request #40358 from frappe/mergify/bp/version-15-hotfix/pr-40323
fix: Filter for projects in Sales Cycle (#40323)
2024-03-10 21:11:55 +05:30
Deepesh Garg
399c5629f4 Merge pull request #40360 from frappe/mergify/bp/version-15-hotfix/pr-40325
fix: Sender email in process statements of accounts (#40325)
2024-03-10 19:57:06 +05:30
Deepesh Garg
953f64091a fix: Sender email in process statements of accounts
(cherry picked from commit 65a2f3d12c)
2024-03-10 13:58:04 +00:00
Deepesh Garg
173b3b85f6 fix: Filter for projects in Sales Cycle
(cherry picked from commit d0e0b66b2f)
2024-03-10 13:57:13 +00:00
Deepesh Garg
8b5afbbaca Merge pull request #40356 from frappe/mergify/bp/version-15-hotfix/pr-40355
fix: Blanket order rate getting changed on converting to order (#40355)
2024-03-10 19:26:24 +05:30
Deepesh Garg
df1a51e291 Merge pull request #40337 from frappe/mergify/bp/version-15-hotfix/pr-40334
fix: load ignored doctype and include Mode of Payment Account (#40334)
2024-03-10 19:25:09 +05:30
Deepesh Garg
d8c6eb0bf2 fix: Blanket order rate getting changed on converting to order
(cherry picked from commit 9702a65a0f)
2024-03-10 13:14:59 +00:00
ruthra kumar
b6e90c4973 Merge pull request #40354 from frappe/mergify/bp/version-15-hotfix/pr-39681
fix: incorrect advance paid in Sales/Purchase Order (backport #39681)
2024-03-10 17:15:15 +05:30
ruthra kumar
b8582db124 chore: resolve conflicts 2024-03-10 16:52:02 +05:30
ruthra kumar
d6a3b179ec refactor(test): make sure party has USD account
1. Don't reset 'party_account_currency' of SO/PO  upon Payment Entry
cancellation. This happens when there are no payments against a SO/PO

(cherry picked from commit e52c4c8f22)
2024-03-10 11:09:54 +00:00
ruthra kumar
6a5a941a5a fix: advance paid amount and ledger entries against SO/PO
(cherry picked from commit d9a0494fc3)

# Conflicts:
#	erpnext/accounts/utils.py
2024-03-10 11:09:53 +00:00
ruthra kumar
9317adfa33 refactor(test): use get_party_account for reference details section
(cherry picked from commit cb2529cec8)
2024-03-10 11:09:53 +00:00
ruthra kumar
d3039be5bc refactor(test): reference details will have account
(cherry picked from commit 158112896e)
2024-03-10 11:09:52 +00:00
ruthra kumar
6832908e92 fix: incorrect advance paid in Sales/Purchase Order
(cherry picked from commit 9d9b83362a)
2024-03-10 11:09:52 +00:00
Nihantra C. Patel
5fac50036a fix: load ignored doctype and include Mode of Payment Account (#40334)
(cherry picked from commit 68baa3612a)
2024-03-07 12:14:18 +00:00
Frappe PR Bot
3035dcab07 chore(release): Bumped to Version 15.16.2
## [15.16.2](https://github.com/frappe/erpnext/compare/v15.16.1...v15.16.2) (2024-03-07)

### Bug Fixes

* use serial/batch field for rejected items (backport [#40327](https://github.com/frappe/erpnext/issues/40327)) (backport [#40329](https://github.com/frappe/erpnext/issues/40329)) ([#40332](https://github.com/frappe/erpnext/issues/40332)) ([5af335d](5af335dc33))
2024-03-07 09:25:12 +00:00
mergify[bot]
5af335dc33 fix: use serial/batch field for rejected items (backport #40327) (backport #40329) (#40332)
fix: use serial/batch field for rejected items (backport #40327) (#40329)

fix: use serial/batch field for rejected items (#40327)

(cherry picked from commit 01856a6e9d)

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-03-07 14:53:29 +05:30
mergify[bot]
7ca72423b9 fix: use serial/batch field for rejected items (backport #40327) (#40329)
fix: use serial/batch field for rejected items (#40327)

(cherry picked from commit 01856a6e9d)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-03-07 14:36:59 +05:30
Raffael Meyer
9b4a1b0a69 Merge pull request #40321 from frappe/mergify/bp/version-15-hotfix/pr-40317
fix(Shipment Parcel): make length, width and height non-mandatory (backport #40317)
2024-03-06 19:49:56 +01:00
barredterra
1476196966 fix(Shipment Parcel): make length, width and height non-mandatory
It's tedious to enter all these values and some shipping providers only need to know the weigth and quantity. Companies can alwas cutomize the values to be mandatory, but the reverse is not possible. I'll make sure that the erpnext-shipping app does not break because of this (or fix any problems).

(cherry picked from commit 898c6e30eb)
2024-03-06 18:26:18 +00:00
Frappe PR Bot
643189a0ce chore(release): Bumped to Version 15.16.1
## [15.16.1](https://github.com/frappe/erpnext/compare/v15.16.0...v15.16.1) (2024-03-06)

### Bug Fixes

* batch no not copied while making Material Consumption entry (backport [#40290](https://github.com/frappe/erpnext/issues/40290)) (backport [#40300](https://github.com/frappe/erpnext/issues/40300)) ([#40303](https://github.com/frappe/erpnext/issues/40303)) ([f21918d](f21918d06c))
* not able to cancel purchase receipt for old subcontracting flow (backport [#40298](https://github.com/frappe/erpnext/issues/40298)) (backport [#40302](https://github.com/frappe/erpnext/issues/40302)) ([#40305](https://github.com/frappe/erpnext/issues/40305)) ([3814c5a](3814c5a54a))
* stock ledger balance qty for the batch (backport [#40274](https://github.com/frappe/erpnext/issues/40274)) (backport [#40301](https://github.com/frappe/erpnext/issues/40301)) ([#40304](https://github.com/frappe/erpnext/issues/40304)) ([539eb79](539eb794c0))
* use serial batch fields for subcontracting receipt (backport [#40311](https://github.com/frappe/erpnext/issues/40311)) (backport [#40315](https://github.com/frappe/erpnext/issues/40315)) ([#40316](https://github.com/frappe/erpnext/issues/40316)) ([e357497](e357497bcb))
2024-03-06 14:48:42 +00:00
mergify[bot]
e357497bcb fix: use serial batch fields for subcontracting receipt (backport #40311) (backport #40315) (#40316)
fix: use serial batch fields for subcontracting receipt (backport #40311) (#40315)

fix: use serial batch fields for subcontracting receipt (#40311)

(cherry picked from commit cef6291311)

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-03-06 20:17:30 +05:30
mergify[bot]
f21918d06c fix: batch no not copied while making Material Consumption entry (backport #40290) (backport #40300) (#40303)
fix: batch no not copied while making Material Consumption entry (backport #40290) (#40300)

fix: batch no not copied while making Material Consumption entry (#40290)

(cherry picked from commit 1eaa386657)

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-03-06 20:17:20 +05:30
mergify[bot]
539eb794c0 fix: stock ledger balance qty for the batch (backport #40274) (backport #40301) (#40304)
fix: stock ledger balance qty for the batch (backport #40274) (#40301)

fix: stock ledger balance qty for the batch (#40274)

(cherry picked from commit e178ffc3c1)

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-03-06 20:17:09 +05:30
mergify[bot]
3814c5a54a fix: not able to cancel purchase receipt for old subcontracting flow (backport #40298) (backport #40302) (#40305)
fix: not able to cancel purchase receipt for old subcontracting flow (backport #40298) (#40302)

fix: not able to cancel purchase receipt for old subcontracting flow (#40298)

(cherry picked from commit 48da952fd7)

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-03-06 20:17:01 +05:30
mergify[bot]
4b15c00b11 fix: use serial batch fields for subcontracting receipt (backport #40311) (#40315)
fix: use serial batch fields for subcontracting receipt (#40311)

(cherry picked from commit cef6291311)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-03-06 19:59:21 +05:30
mergify[bot]
7001e0a820 fix(accounts): Allow setting Number of new Cost Center (backport #40212) (#40314)
fix(accounts): Allow setting Number of new Cost Center (#40212)

(cherry picked from commit a93d14b3f7)

Co-authored-by: Corentin Flr <10946971+cogk@users.noreply.github.com>
2024-03-06 19:49:42 +05:30
mergify[bot]
e0e80f7eed fix: not able to cancel purchase receipt for old subcontracting flow (backport #40298) (#40302)
fix: not able to cancel purchase receipt for old subcontracting flow (#40298)

(cherry picked from commit 48da952fd7)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-03-06 13:16:57 +05:30
mergify[bot]
62aefcef04 fix: stock ledger balance qty for the batch (backport #40274) (#40301)
fix: stock ledger balance qty for the batch (#40274)

(cherry picked from commit e178ffc3c1)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-03-06 13:06:19 +05:30
mergify[bot]
6d1c144a66 fix: batch no not copied while making Material Consumption entry (backport #40290) (#40300)
fix: batch no not copied while making Material Consumption entry (#40290)

(cherry picked from commit 1eaa386657)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-03-06 13:06:12 +05:30
Frappe PR Bot
eb9b2e896e chore(release): Bumped to Version 15.16.0
# [15.16.0](https://github.com/frappe/erpnext/compare/v15.15.0...v15.16.0) (2024-03-06)

### Bug Fixes

* allow editable accounting dimensions for repostable doctypes ([cd24a2a](cd24a2a05d))
* allow gain/loss for Journals against Journals ([d8cf6ba](d8cf6ba38d))
* check child rows before update ([e20c1ac](e20c1acb6e))
* disable editable account heads ([c55c0f7](c55c0f7173))
* do not allow to cancel incomplete reposting (backport [#40224](https://github.com/frappe/erpnext/issues/40224)) ([#40230](https://github.com/frappe/erpnext/issues/40230)) ([63209f4](63209f4eac))
* don't override reference exchange rate ([4513d83](4513d83f22))
* handle partial invoice against provisional entry ([87596e6](87596e6e29))
* ignore self on GL account validation for Bank Account ([1947a67](1947a67f3d))
* include Debit To/Credit To account while fetching advance ([23d7a1f](23d7a1fc76))
* incorrect exchange rate if JE has multi parties ([b785901](b785901efa))
* incorrect TCS on customer and suppliers with same name ([d74647d](d74647d5a5))
* make use of 'flt' to prevent really low precision exc gain/loss ([9057bff](9057bff786))
* make warning for previously existing SO an alert ([4f9b194](4f9b194fe9))
* over billing qty along with rate ([00d410c](00d410cc1d))
* **Project:** filter department by company ([13e3343](13e334398e))
* provisional reverse entry amount ([0182b95](0182b95230))
* rate change on changing of the qty (backport [#40241](https://github.com/frappe/erpnext/issues/40241)) ([#40243](https://github.com/frappe/erpnext/issues/40243)) ([1d42171](1d421713be))
* remove free item row only if pricing rule matches ([6352bfe](6352bfe34e))
* report path from the Item and Putaway Rule list (backport [#40190](https://github.com/frappe/erpnext/issues/40190)) ([#40266](https://github.com/frappe/erpnext/issues/40266)) ([c7b96df](c7b96df69c))
* serial no valuation rate (backport [#40221](https://github.com/frappe/erpnext/issues/40221)) ([#40223](https://github.com/frappe/erpnext/issues/40223)) ([85ae9ee](85ae9eee25))
* **setup:** avoid duplicate entry for Analytics role (backport [#40183](https://github.com/frappe/erpnext/issues/40183)) ([#40185](https://github.com/frappe/erpnext/issues/40185)) ([9cb8d33](9cb8d33923))
* test for repost accounting in JVs ([1634955](16349553c7))
* test for reposting pi ([6230bbc](6230bbc77d))
* uom wise price in sales or purchase transaction (backport [#40216](https://github.com/frappe/erpnext/issues/40216)) ([#40225](https://github.com/frappe/erpnext/issues/40225)) ([b398cc6](b398cc6579))

### Features

* add company filter to child table field ([0ede99b](0ede99b3cb))
* add patch for making repostable dimension fields editable ([4b57126](4b5712688a))
* allow on submit for selected fields ([6c3b5bb](6c3b5bb402))
* repost ledger button in JV ([e5eeb21](e5eeb216e8))
* update after submit in JV ([cdab3fa](cdab3fa970))
* validate before allowing repost ([8585cfc](8585cfc533))

### Performance Improvements

* serial and batch bundle valuation (reposting) (backport [#40255](https://github.com/frappe/erpnext/issues/40255)) ([#40262](https://github.com/frappe/erpnext/issues/40262)) ([93f3af7](93f3af7dba))
2024-03-06 03:31:25 +00:00
Deepesh Garg
5e89676d05 Merge pull request #40280 from frappe/version-15-hotfix
chore: release v15
2024-03-06 09:00:14 +05:30
ruthra kumar
50e49bef85 Merge pull request #40284 from frappe/mergify/bp/version-15-hotfix/pr-40278
fix: incorrect TCS on customer and suppliers with same name (backport #40278)
2024-03-05 15:48:25 +05:30
ruthra kumar
d74647d5a5 fix: incorrect TCS on customer and suppliers with same name
(cherry picked from commit 9904a9868c)
2024-03-05 09:54:46 +00:00
mergify[bot]
ee119f30fb chore: fixed fetch from (backport #40270) (#40275)
chore: fixed fetch from (#40270)

(cherry picked from commit 34051bc04f)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-03-05 14:32:36 +05:30
mergify[bot]
c7b96df69c fix: report path from the Item and Putaway Rule list (backport #40190) (#40266)
fix: report path from the Item and Putaway Rule list (#40190)

(cherry picked from commit 8e2f9787c1)

Co-authored-by: Nihantra C. Patel <141945075+Nihantra-Patel@users.noreply.github.com>
2024-03-04 20:03:42 +05:30
mergify[bot]
63209f4eac fix: do not allow to cancel incomplete reposting (backport #40224) (#40230)
* fix: do not allow to cancel incomplete reposting (#40224)

(cherry picked from commit 72ac56b6c4)

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

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-03-04 13:14:21 +05:30
mergify[bot]
93f3af7dba perf: serial and batch bundle valuation (reposting) (backport #40255) (#40262)
* perf: serial and batch bundle valuation (reposting) (#40255)

perf: serial and batch bundle valuation
(cherry picked from commit 6379238893)

* chore: fix styles

* chore: fix linters

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-03-04 13:13:49 +05:30
Gursheen Kaur Anand
0b1417e891 Merge pull request #40256 from GursheenK/editable-journals-v15
feat: editable journals v15
2024-03-04 11:15:41 +05:30
Gursheen Anand
16349553c7 fix: test for repost accounting in JVs 2024-03-04 00:25:57 +05:30
Gursheen Anand
4b5712688a feat: add patch for making repostable dimension fields editable 2024-03-04 00:25:54 +05:30
Gursheen Anand
cd24a2a05d fix: allow editable accounting dimensions for repostable doctypes 2024-03-04 00:24:32 +05:30
Gursheen Anand
c55c0f7173 fix: disable editable account heads 2024-03-04 00:24:26 +05:30
Gursheen Anand
6230bbc77d fix: test for reposting pi 2024-03-04 00:18:09 +05:30
Gursheen Anand
e20c1acb6e fix: check child rows before update 2024-03-04 00:18:09 +05:30
Gursheen Anand
6173654093 chore: correct typo 2024-03-04 00:18:09 +05:30
Gursheen Anand
b0be08f05d test: reposting entries for JV 2024-03-04 00:18:09 +05:30
Gursheen Anand
7aeb53a806 refactor: use qb for JV tests 2024-03-04 00:18:09 +05:30
Gursheen Anand
e5eeb216e8 feat: repost ledger button in JV 2024-03-04 00:18:09 +05:30
Gursheen Anand
8585cfc533 feat: validate before allowing repost 2024-03-04 00:18:04 +05:30
Gursheen Anand
a512ec7af5 refactor: better abstraction for controller code 2024-03-04 00:16:39 +05:30
Gursheen Anand
cdab3fa970 feat: update after submit in JV 2024-03-04 00:16:32 +05:30
Gursheen Anand
6c3b5bb402 feat: allow on submit for selected fields 2024-03-04 00:14:28 +05:30
Gursheen Anand
db7348a1de refactor: remove controller logic for setting balances 2024-03-04 00:13:32 +05:30
Gursheen Anand
84672e2275 refactor: exclude balances while setting currency 2024-03-04 00:13:32 +05:30
Gursheen Anand
c68939a0e0 refactor: exclude balance while setting acc details 2024-03-04 00:13:32 +05:30
Gursheen Anand
0c234e5c1a refactor: remove balance formatter 2024-03-04 00:13:32 +05:30
Gursheen Anand
689f277d13 refactor: remove balance fields from jv account 2024-03-04 00:11:23 +05:30
Gursheen Kaur Anand
328728e3a4 Merge pull request #40252 from frappe/mergify/bp/version-15-hotfix/pr-40250
fix(minor): company filter in cost center allocation (backport #40250)
2024-03-03 18:24:27 +05:30
Gursheen Anand
0ede99b3cb feat: add company filter to child table field
(cherry picked from commit 51909077bd)
2024-03-03 12:45:39 +00:00
Gursheen Kaur Anand
d130aadcf3 Merge pull request #40205 from frappe/mergify/bp/version-15-hotfix/pr-39584
fix: use receipt amount for reverse provisional entry (backport #39584)
2024-03-03 17:55:31 +05:30
mergify[bot]
1d421713be fix: rate change on changing of the qty (backport #40241) (#40243)
fix: rate change on changing of the qty (#40241)

(cherry picked from commit e7d707797a)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-03-02 16:50:01 +05:30
ruthra kumar
0b091aaf14 Merge pull request #40239 from frappe/mergify/bp/version-15-hotfix/pr-40220
refactor: Gain/Loss Journal creation for Journals against Journals (backport #40220)
2024-03-02 15:57:18 +05:30
ruthra kumar
e5fdca7b05 test: gain/loss on Journals against Journals
(cherry picked from commit 8a5078b826)
2024-03-02 10:08:19 +00:00
ruthra kumar
d8cf6ba38d fix: allow gain/loss for Journals against Journals
(cherry picked from commit 5b67631d40)
2024-03-02 10:08:19 +00:00
ruthra kumar
9057bff786 fix: make use of 'flt' to prevent really low precision exc gain/loss
(cherry picked from commit 0aa72f841d)
2024-03-02 10:08:18 +00:00
ruthra kumar
014d21a050 Merge pull request #40233 from frappe/mergify/bp/version-15-hotfix/pr-40149
fix: incorrect exchange rate if JE has multi parties (backport #40149)
2024-03-02 14:35:25 +05:30
ruthra kumar
05e4d1c240 test: exchange rate fetch on JE with multiple forex parties
(cherry picked from commit ed95d41a51)
2024-03-02 08:22:47 +00:00
ruthra kumar
4513d83f22 fix: don't override reference exchange rate
(cherry picked from commit eaac02655b)
2024-03-02 08:22:47 +00:00
ruthra kumar
b785901efa fix: incorrect exchange rate if JE has multi parties
(cherry picked from commit 694c17487d)
2024-03-02 08:22:45 +00:00
mergify[bot]
b398cc6579 fix: uom wise price in sales or purchase transaction (backport #40216) (#40225)
fix: uom wise price in sales or purchase transaction (#40216)

fix: uom wise price
(cherry picked from commit 13b05aa7fb)

Co-authored-by: Nihantra C. Patel <141945075+Nihantra-Patel@users.noreply.github.com>
2024-03-02 13:00:52 +05:30
mergify[bot]
85ae9eee25 fix: serial no valuation rate (backport #40221) (#40223)
fix: serial no valuation rate (#40221)

(cherry picked from commit a5232d9c10)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-03-01 22:48:15 +05:30
ruthra kumar
70ab25a611 Merge pull request #40201 from frappe/mergify/bp/version-15-hotfix/pr-40197
fix: ignore self on GL account validation for Bank Account (backport #40197)
2024-03-01 09:45:39 +05:30
Raffael Meyer
0d8358bdd1 Merge pull request #40210 from frappe/mergify/bp/version-15-hotfix/pr-40203
fix(Project): filter department by company (backport #40203)
2024-02-29 23:34:38 +01:00
barredterra
13e334398e fix(Project): filter department by company
(cherry picked from commit 5e736f0d06)
2024-02-29 17:30:05 +00:00
Gursheen Anand
823abfd6e0 test: partial billing for provisional accounting
(cherry picked from commit c5770f2ecc)
2024-02-29 15:48:36 +00:00
Gursheen Anand
e55dc2a7c0 test: overbilling for provisional accounting
(cherry picked from commit ff3ca50a4b)
2024-02-29 15:48:36 +00:00
Gursheen Anand
00d410cc1d fix: over billing qty along with rate
(cherry picked from commit cc96d2b50c)
2024-02-29 15:48:36 +00:00
Gursheen Anand
87596e6e29 fix: handle partial invoice against provisional entry
(cherry picked from commit 2a46799188)
2024-02-29 15:48:36 +00:00
Gursheen Anand
0182b95230 fix: provisional reverse entry amount
(cherry picked from commit 3e59c66806)
2024-02-29 15:48:36 +00:00
ruthra kumar
1947a67f3d fix: ignore self on GL account validation for Bank Account
(cherry picked from commit 3c19186654)
2024-02-29 14:25:48 +00:00
ruthra kumar
8720115f01 Merge pull request #40199 from frappe/mergify/bp/version-15-hotfix/pr-40196
fix: include debit_to or credit_to account while fetching advance on Sales/Purchase Invoice (backport #40196)
2024-02-29 19:54:45 +05:30
ruthra kumar
a5b3c1e7cb test: advance pulling logic on Sales/Purchase Invoice
(cherry picked from commit 646e9ca0dd)
2024-02-29 12:22:48 +00:00
ruthra kumar
23d7a1fc76 fix: include Debit To/Credit To account while fetching advance
(cherry picked from commit 3327599c9d)
2024-02-29 12:22:48 +00:00
Gursheen Kaur Anand
c7ca929ddb Merge pull request #40189 from frappe/mergify/bp/version-15-hotfix/pr-40176
fix(minor): make warning for previously existing SO an alert (backport #40176)
2024-02-29 11:59:36 +05:30
Gursheen Anand
4f9b194fe9 fix: make warning for previously existing SO an alert
(cherry picked from commit 24dcd64c16)
2024-02-29 06:04:16 +00:00
Gursheen Kaur Anand
cda1c5ca10 Merge pull request #40182 from frappe/mergify/bp/version-15-hotfix/pr-40174
fix: promotional scheme remove free item if pricing rule matches (backport #40174)
2024-02-29 11:34:00 +05:30
mergify[bot]
9cb8d33923 fix(setup): avoid duplicate entry for Analytics role (backport #40183) (#40185)
fix(setup): avoid duplicate entry for Analytics role (#40183)

(cherry picked from commit 29f91a7919)

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2024-02-29 11:09:24 +05:30
Gursheen Anand
6352bfe34e fix: remove free item row only if pricing rule matches
(cherry picked from commit fea20db262)
2024-02-29 04:49:35 +00:00
Frappe PR Bot
23011df86b chore(release): Bumped to Version 15.15.0
# [15.15.0](https://github.com/frappe/erpnext/compare/v15.14.7...v15.15.0) (2024-02-28)

### Bug Fixes

* add flags for repost to ensure correct accounting from India Compliance App ([7d14ecf](7d14ecfcb8))
* amount label according to party type ([d541ba3](d541ba3e61))
* Cannot read properties of undefined (backport [#40081](https://github.com/frappe/erpnext/issues/40081)) ([#40083](https://github.com/frappe/erpnext/issues/40083)) ([53d943e](53d943ec70))
* capacity planning issue in the job card (backport [#40092](https://github.com/frappe/erpnext/issues/40092)) ([#40101](https://github.com/frappe/erpnext/issues/40101)) ([27703b5](27703b54bd))
* change label name ([824df72](824df72eeb))
* check for pricing rules on item ([32d9642](32d9642379))
* check_credit_limit on_update_after_submit of Sales Order ([83d7111](83d7111649))
* communication_date in party dashboards (backport [#40005](https://github.com/frappe/erpnext/issues/40005)) ([#40021](https://github.com/frappe/erpnext/issues/40021)) ([4269ef8](4269ef8c98))
* Completed Work Orders report not working ([ca03e9c](ca03e9cfd3))
* Cr/Dr notes with POS Payments ([2e07b03](2e07b03307))
* currency symbol in landed cost voucher and material request (backport [#40138](https://github.com/frappe/erpnext/issues/40138)) ([#40141](https://github.com/frappe/erpnext/issues/40141)) ([57bb031](57bb031602))
* Data too long for column 'serial_no' at row 1 (backport [#40098](https://github.com/frappe/erpnext/issues/40098)) ([#40139](https://github.com/frappe/erpnext/issues/40139)) ([9d19ec4](9d19ec43c8))
* default taxable value for item not found in item list ([7e43f6b](7e43f6b7e0))
* delete PLE containing invoice in against ([190bd45](190bd45bd7))
* do not make MR against raw materials of available sub assemblies (backport [#40085](https://github.com/frappe/erpnext/issues/40085)) ([#40087](https://github.com/frappe/erpnext/issues/40087)) ([cf5fa21](cf5fa210bb))
* Fiscal Year exception on demo data setup ([56ee843](56ee843233))
* incorrect item name in MR (backport [#40018](https://github.com/frappe/erpnext/issues/40018)) ([#40024](https://github.com/frappe/erpnext/issues/40024)) ([9f8f3db](9f8f3db953))
* Issues regarding asset cancellation and deletion ([8eb2f67](8eb2f67910))
* negative stock error while making stock reconciliation (backport [#40016](https://github.com/frappe/erpnext/issues/40016)) ([#40026](https://github.com/frappe/erpnext/issues/40026)) ([c964c45](c964c45f4e))
* on unreconciliation, update advance paid ([4d1f56c](4d1f56c4bd))
* only check for delinked PLEs ([a75a69a](a75a69a01e))
* only consider contributed qty towards achieved targets ([194f46b](194f46be57))
* parent warehouse checks in the production plan for sub-assemblies (backport [#40150](https://github.com/frappe/erpnext/issues/40150)) ([#40157](https://github.com/frappe/erpnext/issues/40157)) ([4784117](4784117a8f))
* remove cancelled payment entry from Payment Period Based On Invoice Date ([72da308](72da3083e6))
* remove cancelled payment entry from PPBOID report ([0be5203](0be520331c))
* remove config for default bank account in test ([36b442a](36b442a951))
* remove microsecond from posting datetime (backport [#40017](https://github.com/frappe/erpnext/issues/40017)) ([#40022](https://github.com/frappe/erpnext/issues/40022)) ([eaa3849](eaa3849df4))
* removed unwanted patch ([ee2d108](ee2d108bef))
* resolved conflict ([6928674](692867427c))
* resolved conflict ([a0c0ab7](a0c0ab7709))
* skip max discount validation for rate adjustment ([3b96aae](3b96aaeead))
* skip SO & DN validation for debit note ([cd42089](cd42089e20))
* Supplier users not able to see RFQ on the Portal (backport [#40161](https://github.com/frappe/erpnext/issues/40161)) ([#40165](https://github.com/frappe/erpnext/issues/40165)) ([6a63a6c](6a63a6c98a))
* timesheet per billed state edge case (backport [#40010](https://github.com/frappe/erpnext/issues/40010)) ([#40029](https://github.com/frappe/erpnext/issues/40029)) ([a543bf4](a543bf47ef))
* translatable columns in Sales Pipeline Analytics report ([1c5a7e2](1c5a7e29f2))
* type error for missing frm obj ([6b5e1cf](6b5e1cfeb7))
* unique gl account for plaid bank accounts ([65853da](65853da505))
* use correct variable name on hotfix branches ([0694fd1](0694fd19fd))
* use frm instead of cur_frm ([341f903](341f9030f5))
* use serial batch fields for packed items (backport [#40140](https://github.com/frappe/erpnext/issues/40140)) ([#40142](https://github.com/frappe/erpnext/issues/40142)) ([1860399](1860399ccb))

### Features

* show contributed qty in transaction summary ([38abfdb](38abfdb8ae))
* update billed amount in PO and PR ([e7e8149](e7e8149fbe))

### Performance Improvements

* new column Posting Datetime in SLE to optimize stock ledger related queries (backport [#39800](https://github.com/frappe/erpnext/issues/39800)) ([#40004](https://github.com/frappe/erpnext/issues/40004)) ([b9181e8](b9181e85dc))
2024-02-28 05:13:40 +00:00
Deepesh Garg
4291b9fa8d Merge pull request #40148 from frappe/version-15-hotfix
chore: release v15
2024-02-28 10:42:31 +05:30
Deepesh Garg
930df21a5f Merge pull request #40170 from frappe/mergify/bp/version-15-hotfix/pr-40137
fix: default taxable value for item not found in item list (#40137)
2024-02-28 08:24:15 +05:30
mergify[bot]
6a63a6c98a fix: Supplier users not able to see RFQ on the Portal (backport #40161) (#40165)
* fix: Supplier users not able to see RFQ on the Portal (#40161)

(cherry picked from commit f8ba560394)

* chore: fix travis

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-27 22:30:26 +05:30
ljain112
7e43f6b7e0 fix: default taxable value for item not found in item list
(cherry picked from commit 5885978fc2)
2024-02-27 16:40:19 +00:00
Deepesh Garg
84a359c760 Merge pull request #40163 from vorasmit/ic-deps-v15
fix: add flags for repost to ensure correct accounting from India Compliance App (#40162)
2024-02-27 22:08:45 +05:30
Smit Vora
7d14ecfcb8 fix: add flags for repost to ensure correct accounting from India Compliance App 2024-02-27 20:30:28 +05:30
Gursheen Kaur Anand
07fd93a6f6 Merge pull request #40152 from frappe/mergify/bp/version-15-hotfix/pr-40095
fix: unique GL account for plaid bank accounts (backport #40095)
2024-02-27 17:08:37 +05:30
mergify[bot]
4784117a8f fix: parent warehouse checks in the production plan for sub-assemblies (backport #40150) (#40157)
fix: parent warehouse checks in the production plan for sub-assemblies (#40150)

(cherry picked from commit 6f5815e44f)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-27 17:03:21 +05:30
Gursheen Kaur Anand
7a9beb4d47 Merge pull request #40154 from frappe/mergify/bp/version-15-hotfix/pr-40102
feat: toggle updation of billed amount in previous purchase docs (backport #40102)
2024-02-27 16:40:14 +05:30
Gursheen Kaur Anand
87f36ce425 chore: fix typo 2024-02-27 16:24:14 +05:30
Gursheen Kaur Anand
48992cd205 chore: resolve conflicts 2024-02-27 16:18:27 +05:30
Gursheen Kaur Anand
99d1f1d67b chore: resolve conflicts 2024-02-27 16:15:49 +05:30
Gursheen Kaur Anand
eadea0207c chore: resolve conflicts 2024-02-27 16:13:49 +05:30
Gursheen Anand
e67d579ac4 test: pr billed amount against debit note
(cherry picked from commit 6d40844894)
2024-02-27 10:24:01 +00:00
Gursheen Anand
bac2f66344 test: po billed amount against debit note
(cherry picked from commit 81dbfe189e)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/test_purchase_order.py
2024-02-27 10:24:01 +00:00
Gursheen Anand
e7e8149fbe feat: update billed amount in PO and PR
(cherry picked from commit 9f6535472d)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
2024-02-27 10:24:00 +00:00
Gursheen Anand
36b442a951 fix: remove config for default bank account in test
(cherry picked from commit c42444ab3b)
2024-02-27 10:10:20 +00:00
Gursheen Anand
65853da505 fix: unique gl account for plaid bank accounts
(cherry picked from commit bf6e32a960)
2024-02-27 10:10:20 +00:00
Gursheen Kaur Anand
df7afc3154 Merge pull request #40145 from frappe/mergify/bp/version-15-hotfix/pr-40143
fix(minor): type error for missing form object in hide_company util (backport #40143)
2024-02-27 13:33:13 +05:30
Gursheen Anand
341f9030f5 fix: use frm instead of cur_frm
(cherry picked from commit ceeb8fc9e5)
2024-02-27 07:45:36 +00:00
Gursheen Anand
6b5e1cfeb7 fix: type error for missing frm obj
(cherry picked from commit 20fa3da950)
2024-02-27 07:45:36 +00:00
ruthra kumar
9f8a27833a Merge pull request #40135 from frappe/mergify/bp/version-15-hotfix/pr-40133
fix: reset advance amount on unreconciliation of Sales/Purchase Orders (backport #40133)
2024-02-27 10:33:07 +05:30
mergify[bot]
1860399ccb fix: use serial batch fields for packed items (backport #40140) (#40142)
fix: use serial batch fields for packed items (#40140)

(cherry picked from commit bc9c480246)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-27 07:57:37 +05:30
mergify[bot]
57bb031602 fix: currency symbol in landed cost voucher and material request (backport #40138) (#40141)
fix: currency symbol in landed cost voucher and material request (#40138)

(cherry picked from commit 8aa2b7c183)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-26 23:16:49 +05:30
mergify[bot]
9d19ec43c8 fix: Data too long for column 'serial_no' at row 1 (backport #40098) (#40139)
* fix: Data too long for column 'serial_no' at row 1 (#40098)

(cherry picked from commit 08caa7cfa1)

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

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-26 23:00:01 +05:30
ruthra kumar
0694fd19fd fix: use correct variable name on hotfix branches 2024-02-26 20:35:22 +05:30
ruthra kumar
94bb6241ef test: advance paid update on sales/purchase order unreconciliation
(cherry picked from commit 1f01ff3487)
2024-02-26 12:22:55 +00:00
ruthra kumar
4d1f56c4bd fix: on unreconciliation, update advance paid
(cherry picked from commit c9e2f03a3a)
2024-02-26 12:22:55 +00:00
ruthra kumar
ad53633c66 Merge pull request #40118 from frappe/mergify/bp/version-15-hotfix/pr-40113
refactor: patch to setup dimensions in Reconciliation tool (backport #40113)
2024-02-26 14:21:40 +05:30
ruthra kumar
2bf6125b71 refactor: patch to setup dimensions in Reconciliation tool
(cherry picked from commit 461fb183fc)
2024-02-26 13:08:47 +05:30
Frappe PR Bot
792de1be03 chore(release): Bumped to Version 15.14.7
## [15.14.7](https://github.com/frappe/erpnext/compare/v15.14.6...v15.14.7) (2024-02-26)

### Bug Fixes

* Issues regarding asset cancellation and deletion ([6fc4dac](6fc4dac4db))
* removed unwanted patch ([3c98368](3c98368e45))
* resolved conflict ([fc565ec](fc565ecd99))
* resolved conflict ([d196aa5](d196aa5a36))
2024-02-26 07:33:28 +00:00
Nabin Hait
66156fcfa7 Merge pull request #40031 from frappe/mergify/bp/version-15/pr-39983
fix: Issues regarding asset cancellation and deletion (backport #39983)
2024-02-26 13:02:20 +05:30
Nabin Hait
fc565ecd99 fix: resolved conflict 2024-02-26 12:21:57 +05:30
Nabin Hait
d196aa5a36 fix: resolved conflict 2024-02-26 12:21:25 +05:30
Gursheen Kaur Anand
e68d2d1c7a Merge pull request #40109 from frappe/mergify/bp/version-15-hotfix/pr-40105
fix(minor): tax amount label according to party type (backport #40105)
2024-02-26 11:10:08 +05:30
Gursheen Kaur Anand
93f64396ac Merge pull request #40111 from frappe/mergify/bp/version-15-hotfix/pr-40062
fix: sales person / partner achieved targets in report (backport #40062)
2024-02-26 11:08:15 +05:30
Gursheen Anand
91c21d13e5 test: sales person target variance
(cherry picked from commit 7566c1ee78)
2024-02-26 05:09:45 +00:00
Gursheen Anand
38abfdb8ae feat: show contributed qty in transaction summary
(cherry picked from commit a823f16dff)
2024-02-26 05:09:45 +00:00
Gursheen Anand
194f46be57 fix: only consider contributed qty towards achieved targets
(cherry picked from commit 339698d172)
2024-02-26 05:09:45 +00:00
Gursheen Anand
d541ba3e61 fix: amount label according to party type
(cherry picked from commit 9c8d103d8a)
2024-02-26 05:05:27 +00:00
mergify[bot]
27703b54bd fix: capacity planning issue in the job card (backport #40092) (#40101)
fix: capacity planning issue in the job card (#40092)

* fix: capacity planning issue in the job card

* test: test case to test capacity planning for workstation

(cherry picked from commit 75f8464724)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-25 19:22:51 +05:30
ruthra kumar
9ffbf5623a Merge pull request #40097 from frappe/mergify/bp/version-15-hotfix/pr-40096
fix: Fiscal Year exception on demo data setup (backport #40096)
2024-02-25 16:09:51 +05:30
ruthra kumar
56ee843233 fix: Fiscal Year exception on demo data setup
(cherry picked from commit 3c3c57c674)
2024-02-25 10:13:09 +00:00
ruthra kumar
383dfdd4ab Merge pull request #40091 from frappe/mergify/bp/version-15-hotfix/pr-40073
refactor: update payments section on item removal (backport #40073)
2024-02-25 09:34:42 +05:30
ruthra kumar
5c269a9947 refactor: update payments section on item removal
(cherry picked from commit 406793a6ff)
2024-02-25 03:58:19 +00:00
mergify[bot]
cf5fa210bb fix: do not make MR against raw materials of available sub assemblies (backport #40085) (#40087)
fix: do not make MR against raw materials of available sub assemblies (#40085)

(cherry picked from commit 4c9048fb39)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-24 21:02:17 +05:30
mergify[bot]
53d943ec70 fix: Cannot read properties of undefined (backport #40081) (#40083)
fix: Cannot read properties of undefined

(cherry picked from commit 44ed52c5cf)

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
2024-02-24 17:04:36 +05:30
rohitwaghchaure
d755b9d38c Merge pull request #40080 from frappe/mergify/bp/version-15-hotfix/pr-40079
chore: change label name (backport #40079)
2024-02-24 13:29:04 +05:30
Rohit Waghchaure
824df72eeb fix: change label name
(cherry picked from commit 635174f1ce)
2024-02-24 07:40:56 +00:00
Gursheen Kaur Anand
e4baacd79e Merge pull request #40066 from frappe/mergify/bp/version-15-hotfix/pr-40040
fix: skip max discount validation for rate adjustment (backport #40040)
2024-02-23 15:10:38 +05:30
Gursheen Kaur Anand
38b384dfa2 Merge pull request #40064 from frappe/mergify/bp/version-15-hotfix/pr-40035
fix: delete PLE containing invoice in against (backport #40035)
2024-02-23 15:07:48 +05:30
ruthra kumar
10fe201bc8 Merge pull request #40068 from frappe/mergify/bp/version-15-hotfix/pr-39830
fix: check_credit_limit on_update_after_submit of Sales Order (backport #39830)
2024-02-23 14:48:08 +05:30
ruthra kumar
bcb280c5e8 test: credit limit on update after submit
(cherry picked from commit 467c0898e9)
2024-02-23 08:51:39 +00:00
Nihantra C. Patel
83d7111649 fix: check_credit_limit on_update_after_submit of Sales Order
(cherry picked from commit 17452b7693)
2024-02-23 08:51:38 +00:00
Gursheen Anand
cd42089e20 fix: skip SO & DN validation for debit note
(cherry picked from commit e2d16955dd)
2024-02-23 07:28:38 +00:00
Gursheen Anand
3b96aaeead fix: skip max discount validation for rate adjustment
(cherry picked from commit 5a3b133d65)
2024-02-23 07:28:37 +00:00
Ankush Menat
83b4cc5091 build: specify frappe dependency (#40061)
build: specify frappe dependency 

Added 15.10 as dependency because stock balance depends on https://github.com/frappe/frappe/pull/24346
2024-02-23 12:43:01 +05:30
Gursheen Anand
a75a69a01e fix: only check for delinked PLEs
(cherry picked from commit 146c5b3e16)
2024-02-23 07:10:08 +00:00
Gursheen Anand
190bd45bd7 fix: delete PLE containing invoice in against
(cherry picked from commit c1e1fd8829)
2024-02-23 07:10:08 +00:00
ruthra kumar
c752bec2d9 Merge pull request #40058 from frappe/mergify/bp/version-15-hotfix/pr-40011
fix: Ledger entries for Cr/Dr notes with POS Payments (backport #40011)
2024-02-23 06:20:30 +05:30
ruthra kumar
8fef484f0f Merge pull request #40056 from frappe/mergify/bp/version-15-hotfix/pr-39831
fix: remove cancelled payment entry from Payment Period Based On Invoice Date (backport #39831)
2024-02-23 06:20:14 +05:30
ruthra kumar
b40baf5e63 refactor: skip popup for POS invoices
(cherry picked from commit 3634c4c284)
2024-02-23 00:33:08 +00:00
ruthra kumar
2c8ba892ac test: ledger entries of Cr Note of POS Invoice
(cherry picked from commit 4288713abe)
2024-02-23 00:33:07 +00:00
ruthra kumar
2e07b03307 fix: Cr/Dr notes with POS Payments
(cherry picked from commit 68a23730f3)
2024-02-23 00:33:07 +00:00
Nihantra C. Patel
0be520331c fix: remove cancelled payment entry from PPBOID report
(cherry picked from commit 186cc3d748)
2024-02-23 00:30:50 +00:00
Nihantra C. Patel
72da3083e6 fix: remove cancelled payment entry from Payment Period Based On Invoice Date
(cherry picked from commit a2a8a8f2e0)
2024-02-23 00:30:50 +00:00
ruthra kumar
a3ddd326d6 Merge pull request #40049 from frappe/mergify/bp/version-15-hotfix/pr-39828
fix: translate Sales Pipeline Analytics report (backport #39828)
2024-02-22 20:46:55 +05:30
Nihantra C. Patel
1c5a7e29f2 fix: translatable columns in Sales Pipeline Analytics report
(cherry picked from commit c5050c935b)
2024-02-22 14:54:53 +00:00
Frappe PR Bot
f723d7b561 chore(release): Bumped to Version 15.14.6
## [15.14.6](https://github.com/frappe/erpnext/compare/v15.14.5...v15.14.6) (2024-02-22)

### Bug Fixes

* communication_date in party dashboards (backport [#40005](https://github.com/frappe/erpnext/issues/40005)) ([#40043](https://github.com/frappe/erpnext/issues/40043)) ([6662c32](6662c321a5))
2024-02-22 11:14:07 +00:00
mergify[bot]
6662c321a5 fix: communication_date in party dashboards (backport #40005) (#40043)
fix: accommodate for changed orderby statement

(cherry picked from commit 87df7ff717)

Co-authored-by: Gursheen Anand <gursheen@frappe.io>
2024-02-22 16:40:46 +05:30
mergify[bot]
4269ef8c98 fix: communication_date in party dashboards (backport #40005) (#40021)
fix: accommodate for changed orderby statement

(cherry picked from commit 87df7ff717)

Co-authored-by: Gursheen Anand <gursheen@frappe.io>
2024-02-22 16:20:02 +05:30
mergify[bot]
a543bf47ef fix: timesheet per billed state edge case (backport #40010) (#40029)
fix: timesheet per billed state edge case (#40010)

If value is 100.0000x then it won't set status correctly but will set it the next time it's loaded from db.

(cherry picked from commit 38e88db2c9)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2024-02-22 12:29:53 +05:30
mergify[bot]
c964c45f4e fix: negative stock error while making stock reconciliation (backport #40016) (#40026)
* fix: negative stock error while making stock reconciliation (#40016)

fix: negative stock error while making stock reco
(cherry picked from commit da184d709b)

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

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-22 11:38:49 +05:30
Nabin Hait
3c98368e45 fix: removed unwanted patch
(cherry picked from commit 85471533e9)
2024-02-22 05:40:58 +00:00
Nabin Hait
6fc4dac4db fix: Issues regarding asset cancellation and deletion
(cherry picked from commit 17f85de6fb)

# Conflicts:
#	erpnext/assets/doctype/asset/depreciation.py
#	erpnext/assets/doctype/asset_capitalization/asset_capitalization.py
2024-02-22 05:40:57 +00:00
Frappe PR Bot
afc87a4486 chore(release): Bumped to Version 15.14.5
## [15.14.5](https://github.com/frappe/erpnext/compare/v15.14.4...v15.14.5) (2024-02-22)

### Bug Fixes

* check for pricing rules on item ([5084b9b](5084b9bd4b))
2024-02-22 05:38:47 +00:00
Deepesh Garg
5137966fe5 Merge pull request #40030 from frappe/mergify/bp/version-15/pr-40019
fix: TypeError for item pricing rules (#39999)
2024-02-22 11:07:32 +05:30
Nabin Hait
6f364df48c Merge pull request #39990 from frappe/mergify/bp/version-15-hotfix/pr-39983
fix: Issues regarding asset cancellation and deletion (backport #39983)
2024-02-22 11:07:01 +05:30
Gursheen Anand
5084b9bd4b fix: check for pricing rules on item
(cherry picked from commit ecd83b12ab)
(cherry picked from commit 32d9642379)
2024-02-22 05:36:43 +00:00
mergify[bot]
eaa3849df4 fix: remove microsecond from posting datetime (backport #40017) (#40022)
fix: remove microsecond from posting datetime (#40017)

(cherry picked from commit 0b04d04da3)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-22 09:51:07 +05:30
mergify[bot]
9f8f3db953 fix: incorrect item name in MR (backport #40018) (#40024)
fix: incorrect item name in MR (#40018)

(cherry picked from commit 864d7ae04c)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-22 09:50:45 +05:30
Gursheen Kaur Anand
43c218c673 Merge pull request #40019 from frappe/mergify/bp/version-15-hotfix/pr-39999
fix: TypeError for item pricing rules (backport #39999)
2024-02-22 09:10:17 +05:30
Gursheen Anand
32d9642379 fix: check for pricing rules on item
(cherry picked from commit ecd83b12ab)
2024-02-22 03:37:17 +00:00
mergify[bot]
b9181e85dc perf: new column Posting Datetime in SLE to optimize stock ledger related queries (backport #39800) (#40004)
* perf: new column posting datetime in SLE to optimize stock ledger related queries

(cherry picked from commit d80ca523a4)

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

* test: test cases to test clash timestamp entries

(cherry picked from commit f04676aaed)

* chore: remove microsecond from posting_datetime

(cherry picked from commit a73ba2c0d2)

* chore: fix conflicts

---------

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
2024-02-21 21:14:28 +05:30
rohitwaghchaure
66a05087b8 Merge pull request #40001 from frappe/mergify/bp/version-15-hotfix/pr-39998
fix: Completed Work Orders report not working (backport #39998)
2024-02-21 17:44:44 +05:30
Rohit Waghchaure
ca03e9cfd3 fix: Completed Work Orders report not working
(cherry picked from commit 11f4cb914a)
2024-02-21 11:21:04 +00:00
Nabin Hait
692867427c fix: resolved conflict 2024-02-21 11:38:21 +05:30
Nabin Hait
a0c0ab7709 fix: resolved conflict 2024-02-21 11:37:47 +05:30
Nabin Hait
ee2d108bef fix: removed unwanted patch
(cherry picked from commit 85471533e9)
2024-02-21 05:45:27 +00:00
Nabin Hait
8eb2f67910 fix: Issues regarding asset cancellation and deletion
(cherry picked from commit 17f85de6fb)

# Conflicts:
#	erpnext/assets/doctype/asset/depreciation.py
#	erpnext/assets/doctype/asset_capitalization/asset_capitalization.py
2024-02-21 05:45:27 +00:00
Frappe PR Bot
3d7e87185c chore(release): Bumped to Version 15.14.4
## [15.14.4](https://github.com/frappe/erpnext/compare/v15.14.3...v15.14.4) (2024-02-21)

### Bug Fixes

* 'NoneType' object is not iterable (backport [#39977](https://github.com/frappe/erpnext/issues/39977)) ([#39981](https://github.com/frappe/erpnext/issues/39981)) ([0f87ec1](0f87ec15ad))
* **Bank Transaction:** precision for `(un)allocated_amount` ([bf5d2f5](bf5d2f5fe4))
* batch filter not working in stock ledger report (backport [#39934](https://github.com/frappe/erpnext/issues/39934)) ([#39935](https://github.com/frappe/erpnext/issues/39935)) ([1513595](15135952fc))
* do not empty serial batch fields (backport [#39948](https://github.com/frappe/erpnext/issues/39948)) ([#39956](https://github.com/frappe/erpnext/issues/39956)) ([acd2e93](acd2e93f8c))
* fetch company terms ([14fe0af](14fe0af887))
* float division by zero ([b954bdf](b954bdfdf9))
* group node in warehouse filter in Item-wise Sales Register ([74819b8](74819b8e70))
* **Issue:** create communication ([f5d7fbd](f5d7fbdaf8))
* no need call for company method in sales invoice js ([bef38f7](bef38f74fe))
* not able to make purchase receipt ([3732946](37329469c3))
* party item code in Blanket Order ([518b22b](518b22bffc))
* reposting failed status not updated (backport [#39970](https://github.com/frappe/erpnext/issues/39970)) ([#39972](https://github.com/frappe/erpnext/issues/39972)) ([46f7569](46f7569a54))
* set batch created from bundle to batch field in stock transaction (backport [#39966](https://github.com/frappe/erpnext/issues/39966)) ([#39987](https://github.com/frappe/erpnext/issues/39987)) ([2ee51d3](2ee51d36ff))
* show active bom in the dropdown while making stock entry and MR (backport [#39974](https://github.com/frappe/erpnext/issues/39974)) ([#39976](https://github.com/frappe/erpnext/issues/39976)) ([7201448](720144898f))
* update_dimension is required and not need party account method ([a56d5b8](a56d5b805c))
* use serial batch fields not enabled for new stock entry ([40d4e32](40d4e3261e))
2024-02-21 05:29:45 +00:00
rohitwaghchaure
177110349d Merge pull request #39979 from frappe/version-15-hotfix
chore: release v15
2024-02-21 10:58:33 +05:30
rohitwaghchaure
ed553b89a4 Merge branch 'version-15' into version-15-hotfix 2024-02-21 09:34:20 +05:30
mergify[bot]
2ee51d36ff fix: set batch created from bundle to batch field in stock transaction (backport #39966) (#39987)
fix: set batch created from bundle to batch field in stock transaction (#39966)

* fix: set batch created from bundle to batch field in stock transaction

* fix: validation for serial and batch no

(cherry picked from commit 4b24fcd221)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-21 00:04:01 +05:30
mergify[bot]
0f87ec15ad fix: 'NoneType' object is not iterable (backport #39977) (#39981)
fix: 'NoneType' object is not iterable (#39977)

(cherry picked from commit 8e7d47b3a7)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-20 15:53:12 +05:30
mergify[bot]
720144898f fix: show active bom in the dropdown while making stock entry and MR (backport #39974) (#39976)
fix: show active bom in the dropdown while making stock entry and MR (#39974)

(cherry picked from commit 133f8bd92a)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-20 13:13:00 +05:30
mergify[bot]
46f7569a54 fix: reposting failed status not updated (backport #39970) (#39972)
fix: reposting failed status not updated (#39970)

(cherry picked from commit d4264f7ba1)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-20 12:35:46 +05:30
rohitwaghchaure
a102172982 Merge pull request #39968 from frappe/mergify/bp/version-15-hotfix/pr-39967
fix: float division by zero (backport #39967)
2024-02-20 12:07:38 +05:30
Rohit Waghchaure
b954bdfdf9 fix: float division by zero
(cherry picked from commit e8ae4ed61d)
2024-02-20 01:02:35 +00:00
Frappe PR Bot
9c01a5f7ed chore(release): Bumped to Version 15.14.3
## [15.14.3](https://github.com/frappe/erpnext/compare/v15.14.2...v15.14.3) (2024-02-19)

### Bug Fixes

* do not empty serial batch fields (backport [#39948](https://github.com/frappe/erpnext/issues/39948)) ([#39956](https://github.com/frappe/erpnext/issues/39956)) ([2db79cd](2db79cdf3b))
2024-02-19 05:33:59 +00:00
rohitwaghchaure
0c9d7434f9 Merge pull request #39957 from frappe/mergify/bp/version-15/pr-39956
fix: do not empty serial batch fields (backport #39948) (backport #39956)
2024-02-19 11:02:11 +05:30
mergify[bot]
2db79cdf3b fix: do not empty serial batch fields (backport #39948) (#39956)
fix: do not empty serial batch fields (#39948)

(cherry picked from commit a4cbfabe0e)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
(cherry picked from commit acd2e93f8c)
2024-02-19 05:16:58 +00:00
mergify[bot]
acd2e93f8c fix: do not empty serial batch fields (backport #39948) (#39956)
fix: do not empty serial batch fields (#39948)

(cherry picked from commit a4cbfabe0e)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-19 10:45:28 +05:30
ruthra kumar
c81a15eac3 Merge pull request #39955 from frappe/mergify/bp/version-15-hotfix/pr-39914
refactor: add total row if only one party is being filtered (backport #39914)
2024-02-19 09:16:34 +05:30
ruthra kumar
18fcbb6f97 Merge pull request #39953 from frappe/mergify/bp/version-15-hotfix/pr-39942
fix: group node in warehouse filter in Item-wise Sales Register (backport #39942)
2024-02-19 09:15:09 +05:30
ruthra kumar
baa83ece21 refactor: add total row if only one party is being filtered
(cherry picked from commit b1dfa2537b)
2024-02-19 02:57:35 +00:00
ruthra kumar
74819b8e70 fix: group node in warehouse filter in Item-wise Sales Register
(cherry picked from commit 44538bd02a)
2024-02-19 02:56:17 +00:00
ruthra kumar
a2a5b34099 Merge pull request #39950 from frappe/mergify/bp/version-15-hotfix/pr-39943
refactor: use popup to inform on additional reconciliation step for Cr/Dr Notes (backport #39943)
2024-02-19 07:48:27 +05:30
ruthra kumar
ce11180793 refactor: use popup to inform on additional reconciliation step
(cherry picked from commit 0d260faa00)
2024-02-19 07:31:33 +05:30
Raffael Meyer
0b7a95351a Merge pull request #39907 from frappe/mergify/bp/version-15-hotfix/pr-39857
fix: fetch company terms (backport #39857)
2024-02-17 01:11:09 +01:00
Raffael Meyer
d225508ab1 Merge pull request #39928 from frappe/mergify/bp/version-15-hotfix/pr-39926
fix(Bank Transaction): precision for `(un)allocated_amount` (backport #39926)
2024-02-17 00:33:24 +01:00
Raffael Meyer
d213db90af Merge pull request #39940 from frappe/mergify/bp/version-15-hotfix/pr-39938
fix(Issue): create communication (backport #39938)
2024-02-16 20:47:30 +01:00
barredterra
f5d7fbdaf8 fix(Issue): create communication
Ignore permisions and mandatory. Required, for example, when Issue is created by Customer via portal.

(cherry picked from commit 3f1d008741)
2024-02-16 19:15:39 +00:00
Frappe PR Bot
fd76847cfa chore(release): Bumped to Version 15.14.2
## [15.14.2](https://github.com/frappe/erpnext/compare/v15.14.1...v15.14.2) (2024-02-16)

### Bug Fixes

* batch filter not working in stock ledger report (backport [#39934](https://github.com/frappe/erpnext/issues/39934)) ([#39935](https://github.com/frappe/erpnext/issues/39935)) ([3cd3159](3cd315973c))
2024-02-16 16:20:27 +00:00
rohitwaghchaure
709faaac69 Merge pull request #39937 from frappe/mergify/bp/version-15/pr-39935
fix: batch filter not working in stock ledger report (backport #39934) (backport #39935)
2024-02-16 21:48:52 +05:30
mergify[bot]
3cd315973c fix: batch filter not working in stock ledger report (backport #39934) (#39935)
fix: batch filter not working in stock ledger report

(cherry picked from commit a995e87567)

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
(cherry picked from commit 15135952fc)
2024-02-16 15:19:21 +00:00
mergify[bot]
15135952fc fix: batch filter not working in stock ledger report (backport #39934) (#39935)
fix: batch filter not working in stock ledger report

(cherry picked from commit a995e87567)

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
2024-02-16 20:47:20 +05:30
Frappe PR Bot
6d6a3a10fb chore(release): Bumped to Version 15.14.1
## [15.14.1](https://github.com/frappe/erpnext/compare/v15.14.0...v15.14.1) (2024-02-16)

### Bug Fixes

* use serial batch fields not enabled for new stock entry ([72ff56b](72ff56be13))
2024-02-16 10:29:29 +00:00
rohitwaghchaure
7af62fb6c8 Merge pull request #39932 from frappe/mergify/bp/version-15/pr-39931
fix: use serial batch fields not enabled for new stock entry (backport #39930) (backport #39931)
2024-02-16 15:58:17 +05:30
Rohit Waghchaure
72ff56be13 fix: use serial batch fields not enabled for new stock entry
(cherry picked from commit dc9115a586)
(cherry picked from commit 40d4e3261e)
2024-02-16 10:25:03 +00:00
rohitwaghchaure
b91f65d4cf Merge pull request #39931 from frappe/mergify/bp/version-15-hotfix/pr-39930
fix: use serial batch fields not enabled for new stock entry (backport #39930)
2024-02-16 15:53:44 +05:30
Rohit Waghchaure
40d4e3261e fix: use serial batch fields not enabled for new stock entry
(cherry picked from commit dc9115a586)
2024-02-16 10:20:35 +00:00
barredterra
bf5d2f5fe4 fix(Bank Transaction): precision for (un)allocated_amount
(cherry picked from commit 8a702a6338)
2024-02-15 19:05:21 +00:00
rohitwaghchaure
bb77f85d89 Merge pull request #39922 from frappe/mergify/bp/version-15-hotfix/pr-39916
fix: not able to make purchase receipt (backport #39916)
2024-02-15 17:55:41 +05:30
Rohit Waghchaure
37329469c3 fix: not able to make purchase receipt
(cherry picked from commit 2fb0499923)
2024-02-15 12:04:49 +00:00
rohitwaghchaure
ab03ab388c Merge pull request #39918 from frappe/mergify/bp/version-15-hotfix/pr-39905
fix: party item code in Blanket Order (backport #39905)
2024-02-15 17:31:50 +05:30
rohitwaghchaure
c50639334f chore: fix linter issue
(cherry picked from commit 230a7d8d53)
2024-02-15 09:33:40 +00:00
Rohit Waghchaure
518b22bffc fix: party item code in Blanket Order
(cherry picked from commit 1a8f7f9403)
2024-02-15 09:33:39 +00:00
kunhi
a56d5b805c fix: update_dimension is required and not need party account method
(cherry picked from commit e6949d71f6)
2024-02-14 14:54:55 +00:00
kunhi
bef38f74fe fix: no need call for company method in sales invoice js
(cherry picked from commit e3bd8d10b0)
2024-02-14 14:54:54 +00:00
kunhi
14fe0af887 fix: fetch company terms
(cherry picked from commit d97b6d38ef)
2024-02-14 14:54:54 +00:00
Frappe PR Bot
c78d085e24 chore(release): Bumped to Version 15.14.0
# [15.14.0](https://github.com/frappe/erpnext/compare/v15.13.0...v15.14.0) (2024-02-14)

### Bug Fixes

*  production plan issue with sales order (backport [#39901](https://github.com/frappe/erpnext/issues/39901)) ([#39904](https://github.com/frappe/erpnext/issues/39904)) ([88a7248](88a7248888))
* add permissions to SRE (backport [#39780](https://github.com/frappe/erpnext/issues/39780)) ([#39786](https://github.com/frappe/erpnext/issues/39786)) ([ba05648](ba05648741))
* Brazilian COA for demo data creation ([#39839](https://github.com/frappe/erpnext/issues/39839)) ([4daee6d](4daee6d9c7))
* calculate `stock_value_diff` ([5a66c85](5a66c8585c))
* create SBB for `transfer_qty` in SE (backport [#39835](https://github.com/frappe/erpnext/issues/39835)) ([#39863](https://github.com/frappe/erpnext/issues/39863)) ([92e6017](92e6017a29))
* do not consider rejected warehouses in pick list (backport [#39539](https://github.com/frappe/erpnext/issues/39539)) (backport [#39804](https://github.com/frappe/erpnext/issues/39804)) ([#39811](https://github.com/frappe/erpnext/issues/39811)) ([30dacce](30daccecc7))
* incorrect planned qty in PP (backport [#39785](https://github.com/frappe/erpnext/issues/39785)) ([#39793](https://github.com/frappe/erpnext/issues/39793)) ([60e04ab](60e04ab661))
* landed cost voucher not submitting because of incorrect reference (backport [#39898](https://github.com/frappe/erpnext/issues/39898)) ([#39900](https://github.com/frappe/erpnext/issues/39900)) ([a548f12](a548f12941))
* remove duplicates from tax category map ([3c6114a](3c6114ab72))
* set rate for PO created against BO (backport [#39765](https://github.com/frappe/erpnext/issues/39765)) ([#39767](https://github.com/frappe/erpnext/issues/39767)) ([2213886](22138867f5))
* stock entry for use serial batch fields (backport [#39843](https://github.com/frappe/erpnext/issues/39843)) ([#39844](https://github.com/frappe/erpnext/issues/39844)) ([43fce29](43fce29a04))
* use correct field name in accounts controller (backport [#39884](https://github.com/frappe/erpnext/issues/39884)) ([#39897](https://github.com/frappe/erpnext/issues/39897)) ([f08b424](f08b424972))
* **ux:** set rate as price list rate on uom change in MR (backport [#39816](https://github.com/frappe/erpnext/issues/39816)) ([#39818](https://github.com/frappe/erpnext/issues/39818)) ([63b4d20](63b4d20bdf))
* validate duplicate SBB (backport [#39862](https://github.com/frappe/erpnext/issues/39862)) ([#39866](https://github.com/frappe/erpnext/issues/39866)) ([a2f1a96](a2f1a964f1))
* warehouse issue in pick list (backport [#39826](https://github.com/frappe/erpnext/issues/39826)) ([#39827](https://github.com/frappe/erpnext/issues/39827)) ([b625b05](b625b05ddc))

### Features

* get RM costs from consumption entry in manufacture SE (backport [#39822](https://github.com/frappe/erpnext/issues/39822)) ([#39847](https://github.com/frappe/erpnext/issues/39847)) ([2d5f186](2d5f186812))

### Performance Improvements

* cached get_last_purchase_details to fix performance issue (backport [#39854](https://github.com/frappe/erpnext/issues/39854)) ([#39856](https://github.com/frappe/erpnext/issues/39856)) ([c643e70](c643e70e2f))
* production plan submission (backport [#39846](https://github.com/frappe/erpnext/issues/39846)) ([#39860](https://github.com/frappe/erpnext/issues/39860)) ([10f17df](10f17dfcc8))
2024-02-14 12:06:08 +00:00
rohitwaghchaure
8c12b3dbe0 Merge pull request #39880 from frappe/version-15-hotfix
chore: release v15
2024-02-14 17:34:57 +05:30
mergify[bot]
88a7248888 fix: production plan issue with sales order (backport #39901) (#39904)
fix:  production plan issue with sales order (#39901)

(cherry picked from commit d0df5df4a6)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-14 16:58:28 +05:30
mergify[bot]
a548f12941 fix: landed cost voucher not submitting because of incorrect reference (backport #39898) (#39900)
fix: landed cost voucher not submitting because of incorrect reference (#39898)

(cherry picked from commit 6239fd704b)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-14 15:57:40 +05:30
mergify[bot]
f08b424972 fix: use correct field name in accounts controller (backport #39884) (#39897)
fix: use correct field name in accounts controller (#39884)

Changes to get advance payments in SI or PI from JV's

(cherry picked from commit b124081065)

Co-authored-by: Rohit Gunjegaonkar <135806454+rohitg-pbspl@users.noreply.github.com>
2024-02-14 13:21:55 +05:30
Raffael Meyer
375859a25f Merge pull request #39894 from frappe/mergify/bp/version-15-hotfix/pr-39868
fix(Purchase Receipt): calculate `stock_value_diff` (backport #39868)
2024-02-14 01:21:38 +01:00
barredterra
5a66c8585c fix: calculate stock_value_diff
`d.item_tax_amount` is already in base currency.

(cherry picked from commit 5df5851798)
2024-02-13 23:52:33 +00:00
mergify[bot]
a2f1a964f1 fix: validate duplicate SBB (backport #39862) (#39866)
* fix: validate duplicate SBB

(cherry picked from commit 094ecc1f62)

* test: duplicate SBB

(cherry picked from commit 55e66db315)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-02-13 09:09:03 +05:30
mergify[bot]
92e6017a29 fix: create SBB for transfer_qty in SE (backport #39835) (#39863)
fix: create SBB for `transfer_qty` in SE

(cherry picked from commit d59caf08e6)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-02-12 19:59:07 +05:30
mergify[bot]
10f17dfcc8 perf: production plan submission (backport #39846) (#39860)
perf: production plan submission

(cherry picked from commit aa1c69dd7a)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-02-12 18:17:36 +05:30
mergify[bot]
c643e70e2f perf: cached get_last_purchase_details to fix performance issue (backport #39854) (#39856)
perf: cached get_last_purchase_details to fix performance issue (#39854)

(cherry picked from commit b966c06a4f)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-12 15:53:50 +05:30
mergify[bot]
4daee6d9c7 fix: Brazilian COA for demo data creation (#39839)
fix: Brazilian COA for demo data creation (#39839)

fix: Brazilian COA
(cherry picked from commit 4b1c851da1)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2024-02-11 18:12:18 +05:30
Frappe PR Bot
a29468f6fe chore(release): Bumped to Version 15.13.0
# [15.13.0](https://github.com/frappe/erpnext/compare/v15.12.2...v15.13.0) (2024-02-11)

### Features

* get RM costs from consumption entry in manufacture SE (backport [#39822](https://github.com/frappe/erpnext/issues/39822)) (backport [#39847](https://github.com/frappe/erpnext/issues/39847)) ([#39849](https://github.com/frappe/erpnext/issues/39849)) ([beb4137](beb4137dac))
2024-02-11 12:20:07 +00:00
mergify[bot]
beb4137dac feat: get RM costs from consumption entry in manufacture SE (backport #39822) (backport #39847) (#39849)
feat: get RM costs from consumption entry in manufacture SE (backport #39822) (#39847)

feat: get RM costs from consumption entry in manufacture SE (#39822)

(cherry picked from commit 39067c7614)

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-02-11 17:48:47 +05:30
mergify[bot]
2d5f186812 feat: get RM costs from consumption entry in manufacture SE (backport #39822) (#39847)
feat: get RM costs from consumption entry in manufacture SE (#39822)

(cherry picked from commit 39067c7614)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-02-11 17:29:21 +05:30
mergify[bot]
43fce29a04 fix: stock entry for use serial batch fields (backport #39843) (#39844)
fix: stock entry for use serial batch fields (#39843)

(cherry picked from commit e5824fc3f1)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-11 11:28:48 +05:30
mergify[bot]
63b4d20bdf fix(ux): set rate as price list rate on uom change in MR (backport #39816) (#39818)
* fix: add price list rate field in MR Item

(cherry picked from commit 61a29eb5fb)

* fix: set rate as price list rate on uom change

(cherry picked from commit 5cf0759b0c)

* chore: linter

(cherry picked from commit 1745371cd6)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-02-10 15:58:33 +05:30
mergify[bot]
b625b05ddc fix: warehouse issue in pick list (backport #39826) (#39827)
fix: warehouse issue in pick list (#39826)

(cherry picked from commit 159a123dc7)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-09 11:32:51 +05:30
mergify[bot]
30daccecc7 fix: do not consider rejected warehouses in pick list (backport #39539) (backport #39804) (#39811)
* fix: do not consider rejected warehouses in pick list (backport #39539) (#39804)

* fix: do not consider rejected warehouses in pick list (#39539)

* fix: do not picked rejected materials

* test: test case for pick list without rejected materials

(cherry picked from commit f6725e4342)

# Conflicts:
#	erpnext/selling/doctype/sales_order/test_sales_order.py
#	erpnext/stock/doctype/pick_list/pick_list.json
#	erpnext/stock/doctype/pick_list/pick_list.py

* chore: fix conflicts

* chore: fix conflicts

* chore: fix conflicts

* chore: fixed test case

---------

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

# Conflicts:
#	erpnext/selling/doctype/sales_order/test_sales_order.py

* chore: fix conflicts

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-02-08 14:41:58 +05:30
ruthra kumar
db4efd3332 Merge pull request #39803 from frappe/mergify/bp/version-15/pr-39783
fix: cancelling cr/dr notes should update the linked Invoice status (backport #39783)
2024-02-08 10:23:53 +05:30
ruthra kumar
7556457e3e refactor(test): Forex Credit Note cancellation against Invoice
(cherry picked from commit 2f676ced5c)
2024-02-08 04:36:15 +00:00
ruthra kumar
5590b04c89 refactor(test): assert Invoice status as well
(cherry picked from commit 33efe0d12d)
2024-02-08 04:36:14 +00:00
ruthra kumar
490cbc53d8 test: Invoice status on Cr/Dr note cancellation
(cherry picked from commit 31a8c3bdc4)
2024-02-08 04:36:14 +00:00
ruthra kumar
592b3ff7b7 refactor: cancel Cr/Dr JE's on Sales/Purchase return cancel
(cherry picked from commit 0549535603)
2024-02-08 04:36:14 +00:00
ruthra kumar
0bde22fe46 Merge pull request #39799 from frappe/mergify/bp/version-15-hotfix/pr-39783
fix: cancelling cr/dr notes should update the linked Invoice status (backport #39783)
2024-02-08 10:00:34 +05:30
mergify[bot]
60e04ab661 fix: incorrect planned qty in PP (backport #39785) (#39793)
fix: incorrect planned qty in PP

(cherry picked from commit a8ebc94a36)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-02-08 09:13:38 +05:30
ruthra kumar
83bf2c17e0 refactor(test): Forex Credit Note cancellation against Invoice
(cherry picked from commit 2f676ced5c)
2024-02-07 15:00:48 +00:00
ruthra kumar
a805796c0a refactor(test): assert Invoice status as well
(cherry picked from commit 33efe0d12d)
2024-02-07 15:00:47 +00:00
ruthra kumar
0bff065f0b test: Invoice status on Cr/Dr note cancellation
(cherry picked from commit 31a8c3bdc4)
2024-02-07 15:00:46 +00:00
ruthra kumar
5fd4ca56f5 refactor: cancel Cr/Dr JE's on Sales/Purchase return cancel
(cherry picked from commit 0549535603)
2024-02-07 15:00:45 +00:00
Frappe PR Bot
bc9a63497a chore(release): Bumped to Version 15.12.2
## [15.12.2](https://github.com/frappe/erpnext/compare/v15.12.1...v15.12.2) (2024-02-07)

### Bug Fixes

* remove duplicates from tax category map ([1f21607](1f21607e4f))
2024-02-07 14:22:43 +00:00
Gursheen Kaur Anand
b9dc0f3896 Merge pull request #39794 from frappe/mergify/bp/version-15/pr-39787
fix: remove duplicates from tax category map (backport #39787)
2024-02-07 19:51:02 +05:30
Gursheen Anand
1f21607e4f fix: remove duplicates from tax category map
(cherry picked from commit 3c6114ab72)
2024-02-07 13:54:03 +00:00
Gursheen Kaur Anand
a5ad318a37 Merge pull request #39787 from GursheenK/duplicates-in-tax-category-bpv15
fix: remove duplicates from tax category map
2024-02-07 19:22:27 +05:30
mergify[bot]
ba05648741 fix: add permissions to SRE (backport #39780) (#39786)
fix: add permissions to SRE

(cherry picked from commit 50f54d983d)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-02-07 19:03:25 +05:30
Gursheen Anand
3c6114ab72 fix: remove duplicates from tax category map 2024-02-07 18:27:08 +05:30
Frappe PR Bot
488e693ed8 chore(release): Bumped to Version 15.12.1
## [15.12.1](https://github.com/frappe/erpnext/compare/v15.12.0...v15.12.1) (2024-02-07)

### Bug Fixes

* set rate for PO created against BO (backport [#39765](https://github.com/frappe/erpnext/issues/39765)) (backport [#39767](https://github.com/frappe/erpnext/issues/39767)) ([#39775](https://github.com/frappe/erpnext/issues/39775)) ([ae2a8db](ae2a8db0d7))
2024-02-07 06:07:15 +00:00
mergify[bot]
ae2a8db0d7 fix: set rate for PO created against BO (backport #39765) (backport #39767) (#39775)
fix: set rate for PO created against BO (backport #39765) (#39767)

* fix: set rate for PO created against BO

(cherry picked from commit 0e5b4e5f07)

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

* chore: `conflicts`

---------

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-02-07 11:35:55 +05:30
mergify[bot]
22138867f5 fix: set rate for PO created against BO (backport #39765) (#39767)
* fix: set rate for PO created against BO

(cherry picked from commit 0e5b4e5f07)

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

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-02-07 10:48:58 +05:30
Frappe PR Bot
2ba283d138 chore(release): Bumped to Version 15.12.0
# [15.12.0](https://github.com/frappe/erpnext/compare/v15.11.1...v15.12.0) (2024-02-06)

### Bug Fixes

* Blanket Order Ordered Quantity (backport [#39725](https://github.com/frappe/erpnext/issues/39725)) ([#39739](https://github.com/frappe/erpnext/issues/39739)) ([b126720](b126720826))
* conditionally display show btn setting ([e931432](e9314325cc))
* correctly calculate diff amount for included taxes ([#39655](https://github.com/frappe/erpnext/issues/39655)) ([7f4cd3c](7f4cd3cd15))
* do not throw validation for cancelled sle ([02f56ee](02f56ee20e))
* don't overwrite existing terms in transaction ([dcdd3e8](dcdd3e8cc4))
* Exchange rate on MR to PO creation for muticurrency POs ([#39646](https://github.com/frappe/erpnext/issues/39646)) ([29eb090](29eb090528))
* fetch/change tax template on basis of base_net_rate instead of net_rate ([#39448](https://github.com/frappe/erpnext/issues/39448)) ([d7c7748](d7c7748c03))
* incorrect landed cost voucher amount ([a40864d](a40864dede))
* out of range for valuation_rate column in SE (backport [#39687](https://github.com/frappe/erpnext/issues/39687)) ([#39691](https://github.com/frappe/erpnext/issues/39691)) ([41e4632](41e46326c0))
* Percentage handling in queries ([#39692](https://github.com/frappe/erpnext/issues/39692)) ([e76f598](e76f59803c))
* **portal:** show PO pay button if payments installed ([cea4ed6](cea4ed6f88))
* Pricing rule application/removal on qty change ([#39084](https://github.com/frappe/erpnext/issues/39084)) ([f310707](f31070741a))
* production plan date filters for orders (backport [#39702](https://github.com/frappe/erpnext/issues/39702)) ([#39720](https://github.com/frappe/erpnext/issues/39720)) ([3eac436](3eac436e7b))
* remove applied pricing rule on qty change (backport [#39688](https://github.com/frappe/erpnext/issues/39688)) ([#39737](https://github.com/frappe/erpnext/issues/39737)) ([f246684](f246684694))
* remove file from the disk after the completion of reposting ([b582e9c](b582e9c42c))
* show warehouse title field in sales docs (backport [#39746](https://github.com/frappe/erpnext/issues/39746)) ([#39755](https://github.com/frappe/erpnext/issues/39755)) ([53992de](53992deb10))
* update company in serial no doc (backport [#39733](https://github.com/frappe/erpnext/issues/39733)) ([#39747](https://github.com/frappe/erpnext/issues/39747)) ([00e86bf](00e86bf318))
* use old serial / batch fields to make serial batch bundle ([282c19e](282c19e7e1))
* **work order:** resolve type error during job card creation (backport [#39713](https://github.com/frappe/erpnext/issues/39713)) ([#39714](https://github.com/frappe/erpnext/issues/39714)) ([5fe40ac](5fe40ac085))

### Features

* copy emails from lead to customer ([#38647](https://github.com/frappe/erpnext/issues/38647)) ([986273b](986273b6d3))
* make material request for job card from workstation dashboard ([3bef12c](3bef12cb55))
* Period-wise closing entries for TB ([#39712](https://github.com/frappe/erpnext/issues/39712)) ([1822325](1822325f34))
* reference for POS SI payments ([#39523](https://github.com/frappe/erpnext/issues/39523)) ([4ee8cf3](4ee8cf3907))
* visual plant floor ([75bd1e6](75bd1e6b65))

### Performance Improvements

* memory consumption for the stock balance report ([#39626](https://github.com/frappe/erpnext/issues/39626)) ([5e29aab](5e29aab83b))
* Move dimension validation out of GL Entry doctype ([#39730](https://github.com/frappe/erpnext/issues/39730)) ([451c288](451c288011))
* timeout for auto material request through reorder level ([1b2831b](1b2831bdfe))
* timeout while submitting the purchase receipt entry ([55a8326](55a8326d06))
2024-02-06 18:44:29 +00:00
rohitwaghchaure
af8af2b36e Merge pull request #39758 from frappe/version-15-hotfix
chore: release v15
2024-02-07 00:13:18 +05:30
rohitwaghchaure
789aee4544 Merge pull request #39770 from frappe/mergify/bp/version-15-hotfix/pr-39769
fix: do not throw validation for canceled SLE (backport #39769)
2024-02-06 23:46:00 +05:30
Rohit Waghchaure
02f56ee20e fix: do not throw validation for cancelled sle
(cherry picked from commit 32ccf3524a)
2024-02-06 17:43:17 +00:00
rohitwaghchaure
c78d4c15d3 Merge pull request #39768 from frappe/mergify/bp/version-15-hotfix/pr-39764
fix: remove file from the disk after the completion of reposting (backport #39764)
2024-02-06 22:22:46 +05:30
Rohit Waghchaure
7833138c57 test: test case to check removed attached file
(cherry picked from commit 76b57a4338)
2024-02-06 15:58:17 +00:00
Rohit Waghchaure
b582e9c42c fix: remove file from the disk after the completion of reposting
(cherry picked from commit fb330d1b5a)
2024-02-06 15:58:16 +00:00
rohitwaghchaure
faf79f4d2a Merge pull request #39761 from frappe/mergify/bp/version-15-hotfix/pr-39718
fix: use old serial / batch fields to make serial batch bundle (backport #39718)
2024-02-06 16:26:33 +05:30
ruthra kumar
47c2bd7335 Merge pull request #39751 from frappe/mergify/bp/version-15-hotfix/pr-39694
refactor: enforce unique GL Account for each 'Bank Account' (backport #39694)
2024-02-06 15:48:31 +05:30
Rohit Waghchaure
73618f0605 test: test case to check use serial / batch fields feature
(cherry picked from commit 01650120d4)
2024-02-06 10:18:06 +00:00
Rohit Waghchaure
a08b97e886 test: fixed test cases
(cherry picked from commit c1e869f040)
2024-02-06 10:18:05 +00:00
Rohit Waghchaure
282c19e7e1 fix: use old serial / batch fields to make serial batch bundle
(cherry picked from commit 9fafc83632)
2024-02-06 10:18:05 +00:00
mergify[bot]
53992deb10 fix: show warehouse title field in sales docs (backport #39746) (#39755)
fix: show warehouse title field in sales docs

(cherry picked from commit ee14faaa39)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-02-06 12:45:37 +05:30
ruthra kumar
4235e08668 refactor(test): make use of test fixtures in Payment Order
(cherry picked from commit 322cdbaccf)
2024-02-06 04:00:23 +00:00
ruthra kumar
949f4c3790 refactor(test): generate uniq GL acc and Bank acc for each test case
(cherry picked from commit a9a2ec81de)
2024-02-06 04:00:23 +00:00
ruthra kumar
11d4382e19 refactor: ensure unique accounts for each Bank Account's
(cherry picked from commit 2caa2d677c)
2024-02-06 04:00:23 +00:00
mergify[bot]
00e86bf318 fix: update company in serial no doc (backport #39733) (#39747)
fix: update company in serial no doc

(cherry picked from commit 7a04f0f7ba)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-02-05 21:55:56 +05:30
rohitwaghchaure
d3c4bd7f5f Merge pull request #39745 from frappe/mergify/bp/version-15-hotfix/pr-39742
perf: timeout while submitting the purchase receipt entry (backport #39742)
2024-02-05 21:17:59 +05:30
rohitwaghchaure
cb15ff1d74 Merge pull request #39743 from frappe/mergify/bp/version-15-hotfix/pr-39730
perf: Move dimension validation out of GL Entry doctype (backport #39730)
2024-02-05 21:17:43 +05:30
Rohit Waghchaure
55a8326d06 perf: timeout while submitting the purchase receipt entry
(cherry picked from commit 1fa6233377)
2024-02-05 15:33:04 +00:00
Deepesh Garg
451c288011 perf: Move dimension validation out of GL Entry doctype (#39730)
(cherry picked from commit b834ed10d6)
2024-02-05 15:31:36 +00:00
rohitwaghchaure
7923bd7964 Merge pull request #39741 from frappe/mergify/bp/version-15-hotfix/pr-38362
feat: visual plant floor (backport #38362)
2024-02-05 19:42:20 +05:30
Rohit Waghchaure
3bef12cb55 feat: make material request for job card from workstation dashboard
(cherry picked from commit 6fea9d6dfe)
2024-02-05 13:50:45 +00:00
Rohit Waghchaure
75bd1e6b65 feat: visual plant floor
(cherry picked from commit 68c997aa06)
2024-02-05 13:50:44 +00:00
mergify[bot]
b126720826 fix: Blanket Order Ordered Quantity (backport #39725) (#39739)
* fix: disable no-copy for blanket order in PO

(cherry picked from commit 5ce5c352e4)

* fix: update BO Ordered Quantity on PO Close/Open

(cherry picked from commit 61ded697a7)

* test: BO on PO Close/Open

(cherry picked from commit 27d6c8b6d5)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-02-05 16:31:20 +05:30
mergify[bot]
f246684694 fix: remove applied pricing rule on qty change (backport #39688) (#39737)
fix: remove pricing rule

(cherry picked from commit 7c6a5a0f23)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-02-05 16:09:00 +05:30
mergify[bot]
1822325f34 feat: Period-wise closing entries for TB (#39712)
feat: Period-wise closing entries for TB (#39712)

(cherry picked from commit 6e6c818084)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2024-02-05 14:34:33 +05:30
mergify[bot]
986273b6d3 feat: copy emails from lead to customer (#38647)
feat: copy emails from lead to customer

(cherry picked from commit 906ac093e3)

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
2024-02-05 14:05:44 +05:30
rohitwaghchaure
f4ac00595d Merge pull request #39729 from frappe/mergify/bp/version-15-hotfix/pr-39659
perf: timeout for auto material request through reorder level (backport #39659)
2024-02-05 13:20:22 +05:30
rohitwaghchaure
66661d0649 Merge pull request #39732 from frappe/mergify/bp/version-15-hotfix/pr-39626
perf: memory consumption for the stock balance report (backport #39626)
2024-02-05 13:17:41 +05:30
rohitwaghchaure
326751c8bd Merge pull request #39727 from frappe/mergify/bp/version-15-hotfix/pr-39684
fix: incorrect landed cost voucher amount (backport #39684)
2024-02-05 13:17:11 +05:30
rohitwaghchaure
5e29aab83b perf: memory consumption for the stock balance report (#39626)
(cherry picked from commit b70f3de16b)
2024-02-05 06:18:52 +00:00
Rohit Waghchaure
1b2831bdfe perf: timeout for auto material request through reorder level
(cherry picked from commit 951023f434)
2024-02-05 06:10:56 +00:00
Rohit Waghchaure
a40864dede fix: incorrect landed cost voucher amount
(cherry picked from commit d78a1e7814)
2024-02-05 06:09:51 +00:00
mergify[bot]
3eac436e7b fix: production plan date filters for orders (backport #39702) (#39720)
fix: production plan date filters for orders (#39702)

(cherry picked from commit 407045a1de)

Co-authored-by: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com>
2024-02-05 10:14:42 +05:30
mergify[bot]
5fe40ac085 fix(work order): resolve type error during job card creation (backport #39713) (#39714)
fix(work order): resolve type error during job card creation (#39713)

fix: type error
(cherry picked from commit c81d597ca5)

Co-authored-by: Vishnu  VS <Vishnuviswambaran2002@gmail.com>
2024-02-04 22:59:17 +05:30
mergify[bot]
4ee8cf3907 feat: reference for POS SI payments (#39523)
feat: reference for POS SI payments (#39523)

* feat: reference field in SI payment

* fix: document link for pos si

* refactor: pos invoice queries

(cherry picked from commit d9a72c1e61)

Co-authored-by: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com>
2024-02-04 17:54:56 +05:30
mergify[bot]
d7c7748c03 fix: fetch/change tax template on basis of base_net_rate instead of net_rate (#39448)
fix: fetch/change tax template on basis of base_net_rate instead of net_rate (#39448)

fix: change tax template on basis of base_net_rate instead of net_rate

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit e9fe10c6f1)

Co-authored-by: Divyam Mistry <73271406+divyam-mistry@users.noreply.github.com>
2024-02-03 09:09:59 +05:30
mergify[bot]
f31070741a fix: Pricing rule application/removal on qty change (#39084)
fix: Pricing rule application/removal on qty change

(cherry picked from commit f52d7c7665)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2024-02-03 08:49:50 +05:30
Frappe PR Bot
317a74b58c chore(release): Bumped to Version 15.11.1
## [15.11.1](https://github.com/frappe/erpnext/compare/v15.11.0...v15.11.1) (2024-02-02)

### Bug Fixes

* Percentage handling in queries ([#39692](https://github.com/frappe/erpnext/issues/39692)) ([0405a2b](0405a2b817))
2024-02-02 15:24:10 +00:00
mergify[bot]
0405a2b817 fix: Percentage handling in queries (#39692)
fix: Percentage handling in queries (#39692)

fix: Percentage handling in queries (#39692)

* fix: Percentage handling in queries

* test: Account with percent sign

* chore: add test records

(cherry picked from commit 6d87cfeb8d)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit e76f59803c)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-02-02 20:53:03 +05:30
mergify[bot]
e76f59803c fix: Percentage handling in queries (#39692)
fix: Percentage handling in queries (#39692)

* fix: Percentage handling in queries

* test: Account with percent sign

* chore: add test records

(cherry picked from commit 6d87cfeb8d)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2024-02-02 20:27:36 +05:30
mergify[bot]
41e46326c0 fix: out of range for valuation_rate column in SE (backport #39687) (#39691)
fix: out of range for valuation_rate column in SE

(cherry picked from commit 1e15a3cc15)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-02-02 15:24:45 +05:30
Gursheen Kaur Anand
8574941cb6 Merge pull request #39648 from frappe/mergify/bp/version-15-hotfix/pr-39519
fix: don't overwrite existing terms in transaction (backport #39519)
2024-02-01 23:48:18 +05:30
ruthra kumar
4f994cf26c Merge pull request #39666 from frappe/mergify/bp/version-15-hotfix/pr-39655
fix: correctly calculate diff amount for included taxes (backport #39655)
2024-02-01 19:44:57 +05:30
ruthra kumar
bb3591deec Merge pull request #39680 from frappe/mergify/bp/version-15-hotfix/pr-39674
refactor: use pop up to inform of possible data issue (backport #39674)
2024-02-01 17:31:18 +05:30
ruthra kumar
e2d041f51c refactor: use pop up to inform of possible data issue
and leave a comment in communcation trail as well

(cherry picked from commit 78483e2ee6)
2024-02-01 11:43:19 +00:00
ruthra kumar
63f306f1b4 Merge pull request #39676 from frappe/mergify/bp/version-15-hotfix/pr-39671
refactor: move ignore ERR filter from SOA to General Ledger (backport #39671)
2024-02-01 16:38:33 +05:30
ruthra kumar
72c95d31d1 refactor(test): use party with USD billing currency
(cherry picked from commit beff566c82)
2024-02-01 10:41:39 +00:00
ruthra kumar
1ee15f65a8 test: ignore_err filter out in General Ledger
(cherry picked from commit affca3a519)
2024-02-01 10:41:39 +00:00
ruthra kumar
0a235584ad refactor: move ignore ERR filters from SOA to General Ledger
(cherry picked from commit c077eda64e)
2024-02-01 10:41:39 +00:00
Gursheen Kaur Anand
7f4cd3cd15 fix: correctly calculate diff amount for included taxes (#39655)
(cherry picked from commit 772f540bef)
2024-02-01 04:44:40 +00:00
barredterra
ba55d0ede7 chore: resolve conflicts 2024-01-31 13:19:19 +01:00
rohitwaghchaure
c74482a27c Merge pull request #39658 from frappe/mergify/bp/version-15-hotfix/pr-39643
fix(portal): show PO pay button if payments installed (backport #39643)
2024-01-31 17:30:48 +05:30
rohitwaghchaure
510ab769f1 chore: fix conflicts 2024-01-31 15:23:14 +05:30
Gursheen Anand
e9314325cc fix: conditionally display show btn setting
(cherry picked from commit 0c9572bb48)

# Conflicts:
#	erpnext/buying/doctype/buying_settings/buying_settings.json
2024-01-31 09:16:12 +00:00
Gursheen Anand
cea4ed6f88 fix(portal): show PO pay button if payments installed
(cherry picked from commit ae7be84d87)
2024-01-31 09:16:11 +00:00
mergify[bot]
29eb090528 fix: Exchange rate on MR to PO creation for muticurrency POs (#39646)
fix: Exchange rate on MR to PO creation for muticurrency POs (#39646)

(cherry picked from commit cfd1666181)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2024-01-31 12:49:48 +05:30
mergify[bot]
aebb0c7979 chore: cleanup doctype descriptions (backport #39637) (#39652)
* chore: cleanup doctype descriptions (#39637)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 6b8f046fb4)

# Conflicts:
#	erpnext/accounts/doctype/accounts_settings/accounts_settings.json
#	erpnext/accounts/doctype/fiscal_year/fiscal_year.json
#	erpnext/stock/doctype/item_price/item_price.json
#	erpnext/stock/doctype/stock_settings/stock_settings.json

* chore: fix conflicts

---------

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2024-01-31 12:38:37 +05:30
barredterra
dcdd3e8cc4 fix: don't overwrite existing terms in transaction
(cherry picked from commit 77b044f1a6)

# Conflicts:
#	erpnext/public/js/controllers/transaction.js
2024-01-31 00:14:44 +00:00
Frappe PR Bot
f84f82c7d7 chore(release): Bumped to Version 15.11.0
# [15.11.0](https://github.com/frappe/erpnext/compare/v15.10.8...v15.11.0) (2024-01-30)

### Bug Fixes

* AttributeError in company transaction deletion ([222005c](222005ca44))
* **Batch:** reload doc after splitting ([a97b8fd](a97b8fd876))
* check page obj before adding menu ([0aa73e3](0aa73e31ce))
* default enable closing stock balance (backport [#39551](https://github.com/frappe/erpnext/issues/39551)) ([#39554](https://github.com/frappe/erpnext/issues/39554)) ([4853ab1](4853ab1fec))
* do not auto-populate item delivery date ([5cdc22a](5cdc22adf3))
* email list for auto reorder material request ([98c5653](98c56535d8))
* enqueue JV submission when more than 100 accounts ([07bcc24](07bcc24e35))
* fetch correct quantity and amount for grouped asset ([3bdd1e9](3bdd1e9514))
* honour currency precision while fetching balance ([e0a3820](e0a38207f6))
* incorrect active serial nos (backport [#39389](https://github.com/frappe/erpnext/issues/39389)) ([#39589](https://github.com/frappe/erpnext/issues/39589)) ([7def475](7def475eb1))
* incorrect amount in the material request item (backport [#39567](https://github.com/frappe/erpnext/issues/39567)) ([#39569](https://github.com/frappe/erpnext/issues/39569)) ([e0c35d6](e0c35d60b4))
* Item Tax template is not working for e-commerce ([2905db1](2905db19e5))
* make SO item code reqd ([171586d](171586db9b))
* not able to edit address through portal ([1f5dbeb](1f5dbebe68))
* not able to save BOM (duplicate key error) (backport [#39620](https://github.com/frappe/erpnext/issues/39620)) ([#39623](https://github.com/frappe/erpnext/issues/39623)) ([53c7055](53c705506b))
* not able to save subcontracting purchase receipt (old flow) (backport [#39590](https://github.com/frappe/erpnext/issues/39590)) ([#39592](https://github.com/frappe/erpnext/issues/39592)) ([63eef68](63eef680d0))
* not able to submit subcontracting pr (old flow) (backport [#39622](https://github.com/frappe/erpnext/issues/39622)) ([#39625](https://github.com/frappe/erpnext/issues/39625)) ([960443d](960443d268))
* Payment Terms Status for Sales Order report should show all payment terms from order not only this comming from template ([b2e0d24](b2e0d24954))
* perf issue while submitting stock entry (backport [#39634](https://github.com/frappe/erpnext/issues/39634)) ([#39642](https://github.com/frappe/erpnext/issues/39642)) ([d785c6c](d785c6ce3e))
* prevent extra transfer against inter transfer transaction (backport [#39213](https://github.com/frappe/erpnext/issues/39213)) ([#39596](https://github.com/frappe/erpnext/issues/39596)) ([6d4ca6a](6d4ca6a1ee))
* qtn tests using delivery date ([6b20a7e](6b20a7eed1))
* return doc obj after submit ([da33079](da33079f12))
* Serial No Ledger permission issue ([f9d1995](f9d1995954))
* skip liability account for internal transfer ([e2d85c5](e2d85c513c))
* type error on company doc ([a7d1368](a7d13686c7))

### Features

* In words in payment entry ([5df2f5d](5df2f5d523))
* New financial views - Growth and margin views for P&L and balance sheet ([#39588](https://github.com/frappe/erpnext/issues/39588)) ([a83f310](a83f3106f3))
* Partly billed status in Purchase Receipt ([#39543](https://github.com/frappe/erpnext/issues/39543)) ([e4230cf](e4230cf6d9))
2024-01-30 14:14:58 +00:00
rohitwaghchaure
32f77eae5d Merge pull request #39639 from frappe/version-15-hotfix
chore: release v15
2024-01-30 19:42:27 +05:30
mergify[bot]
d785c6ce3e fix: perf issue while submitting stock entry (backport #39634) (#39642)
fix: perf issue while submitting stock entry (#39634)

(cherry picked from commit b14886b227)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-01-30 15:43:50 +05:30
ruthra kumar
bc8ab51f9d Merge pull request #39633 from frappe/mergify/bp/version-15-hotfix/pr-39559
fix: prevent Return Invoices(Credit/Debit Note) from using a different account  (backport #39559)
2024-01-30 11:20:25 +05:30
ruthra kumar
5c9c3bee70 test: debit note account mismatch
(cherry picked from commit bdca718103)
2024-01-30 05:31:53 +00:00
ruthra kumar
c9ea83591f test: account mismatch validation
(cherry picked from commit 8bdc760733)
2024-01-30 05:31:53 +00:00
ruthra kumar
10fcf5af5f refactor: prevent '{debit/credit}_to' account mismatch
(cherry picked from commit 6f2fae1b61)
2024-01-30 05:31:52 +00:00
mergify[bot]
e4230cf6d9 feat: Partly billed status in Purchase Receipt (#39543)
feat: Partly billed status in Purchase Receipt (#39543)

(cherry picked from commit a673220feb)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2024-01-29 22:41:09 +05:30
mergify[bot]
53c705506b fix: not able to save BOM (duplicate key error) (backport #39620) (#39623)
fix: not able to save BOM (duplicate key error) (#39620)

(cherry picked from commit 4e182b89ce)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-01-29 21:22:34 +05:30
mergify[bot]
960443d268 fix: not able to submit subcontracting pr (old flow) (backport #39622) (#39625)
fix: not able to submit subcontracting pr (old flow) (#39622)

(cherry picked from commit 5cf47ae5f9)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-01-29 21:22:21 +05:30
Gursheen Kaur Anand
f71af209c0 Merge pull request #39618 from frappe/mergify/bp/version-15-hotfix/pr-39616
fix(minor): do not auto-populate item delivery date from qtn (backport #39616)
2024-01-29 16:53:39 +05:30
Gursheen Anand
6b20a7eed1 fix: qtn tests using delivery date
(cherry picked from commit 079cd30b9c)
2024-01-29 10:22:01 +00:00
Gursheen Anand
5cdc22adf3 fix: do not auto-populate item delivery date
(cherry picked from commit 49cb11c1f3)
2024-01-29 10:22:00 +00:00
mergify[bot]
9e36ab7de7 fix amount not updated when change rate in material request (backport #39606) (#39615)
fix amount not updated when change rate in material request (#39606)

* fix amount not updated when change rate in material request

* make code consistent

(cherry picked from commit efade9b9ae)

Co-authored-by: Jeffry Suryadharma <41689493+jeffrysurya@users.noreply.github.com>
2024-01-29 13:36:27 +05:30
Gursheen Kaur Anand
daafe45dd4 Merge pull request #39612 from frappe/mergify/bp/version-15-hotfix/pr-39562
fix: enqueue JV submission when > 100 accounts (backport #39562)
2024-01-29 11:55:58 +05:30
Gursheen Kaur Anand
706d1111ad Merge pull request #39610 from frappe/mergify/bp/version-15-hotfix/pr-39598
fix(minor): type error in financial statements for dashboard (backport #39598)
2024-01-29 11:42:17 +05:30
Gursheen Anand
da33079f12 fix: return doc obj after submit
(cherry picked from commit fc677811b7)
2024-01-29 06:10:03 +00:00
Gursheen Anand
07bcc24e35 fix: enqueue JV submission when more than 100 accounts
(cherry picked from commit 53b44ccf29)
2024-01-29 06:10:02 +00:00
Nabin Hait
0f0a5b73f6 Merge pull request #39566 from frappe/mergify/bp/version-15-hotfix/pr-39489
fix: fetch correct quantity and amount for grouped asset (backport #39489)
2024-01-29 11:38:33 +05:30
Gursheen Anand
0aa73e31ce fix: check page obj before adding menu
(cherry picked from commit 2486b646a1)
2024-01-29 06:07:13 +00:00
Frappe PR Bot
a3d4f63ba1 chore(release): Bumped to Version 15.10.8
## [15.10.8](https://github.com/frappe/erpnext/compare/v15.10.7...v15.10.8) (2024-01-29)

### Bug Fixes

* not able to save subcontracting purchase receipt (old flow) (backport [#39590](https://github.com/frappe/erpnext/issues/39590)) (backport [#39592](https://github.com/frappe/erpnext/issues/39592)) ([#39608](https://github.com/frappe/erpnext/issues/39608)) ([ff166e8](ff166e8104))
2024-01-29 04:39:51 +00:00
mergify[bot]
ff166e8104 fix: not able to save subcontracting purchase receipt (old flow) (backport #39590) (backport #39592) (#39608)
fix: not able to save subcontracting purchase receipt (old flow) (backport #39590) (#39592)

fix: not able to save subcontracting purchase receipt (old flow) (#39590)

(cherry picked from commit 67d828dab3)

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-01-29 10:08:40 +05:30
mergify[bot]
a118417645 refactor: provision to filter on dimensions in reconciliation tool (#39054)
* refactor: dimensions section in allocation table in reconciliation

(cherry picked from commit 1cde804c77)

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

* refactor: update dimension doctypes in hooks

(cherry picked from commit cfb3d87267)

* refactor: dimensions filter section in payment reconciliation

(cherry picked from commit 20e0acc20a)

* refactor: column break in dimension section

(cherry picked from commit 20576e0f47)

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

* refactor: handle dimension filters

(cherry picked from commit c1fe4bcc64)

* refactor: pass dimension filters to query

(cherry picked from commit ff60ec85b8)

* refactor: set query filters for dimensions

(cherry picked from commit ad8475cb8b)

* refactor: pass dimension details to query

(cherry picked from commit 5dc22e1811)

* refactor: replace sql with query builder for Jourals query

(cherry picked from commit 9c5a79209e)

* refactor: partial change on outstanding invoice popup

(cherry picked from commit 2154502955)

* fix: typo's and parameter changes

(cherry picked from commit 0ec17590ae)

* refactor: Credit Note and its Exc gain/loss JE inherits dimensions

(cherry picked from commit ab939cc6e8)

* refactor: apply dimension filters on cr/dr notes

(cherry picked from commit 188ff8cde7)

* chore: test dimension filter output

(cherry picked from commit e3c44231ab)

* test: dimension inheritance for cr note reconciliation

(cherry picked from commit ba5a7c8cd8)

* refactor: pass dimension values to Gain/Loss journal

(cherry picked from commit c44eb432a5)

# Conflicts:
#	erpnext/accounts/utils.py

* test: dimension inheritance in PE reconciliation

(cherry picked from commit 6148fb024b)

* refactor: pass dimensions on advance allocation

(cherry picked from commit cbd443a78a)

* test: dimension inheritance on adv allocation

(cherry picked from commit fcf4687c52)

* refactor: dynamic dimension filters in pop up

(cherry picked from commit f8bbb0619c)

* refactor: update dimensions, only if provided

(cherry picked from commit ec0f17ca8b)

* refactor: handle dynamic dimension in order query

(cherry picked from commit 7c2cb70387)

* chore: resolve conflicts

---------

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2024-01-28 13:50:08 +05:30
mergify[bot]
a83f3106f3 feat: New financial views - Growth and margin views for P&L and balance sheet (#39588)
feat: New financial views - Growth and margin views for P&L and balance sheet (#39588)
2024-01-28 13:48:55 +05:30
mergify[bot]
6d4ca6a1ee fix: prevent extra transfer against inter transfer transaction (backport #39213) (#39596)
fix: prevent extra transfer against inter transfer transaction (#39213)

* fix: prevent extra transfer against inter transfer transaction

* fix: internal transfer dashboard

(cherry picked from commit 8fdc244e16)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-01-27 23:25:13 +05:30
ruthra kumar
ebec463166 Merge pull request #39594 from frappe/mergify/bp/version-15-hotfix/pr-39591
refactor: Do proper currency conversion on Future Payments column in AR/AP report (backport #39591)
2024-01-27 13:19:27 +05:30
ruthra kumar
10488520e7 test: future payment with foreign currency
(cherry picked from commit 7b37389115)
2024-01-27 07:23:17 +00:00
ruthra kumar
9e15a3c981 refactor: do currency conversion on future amount columns
(cherry picked from commit 0de4197c88)
2024-01-27 07:23:16 +00:00
mergify[bot]
63eef680d0 fix: not able to save subcontracting purchase receipt (old flow) (backport #39590) (#39592)
fix: not able to save subcontracting purchase receipt (old flow) (#39590)

(cherry picked from commit 67d828dab3)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-01-27 12:15:11 +05:30
mergify[bot]
7def475eb1 fix: incorrect active serial nos (backport #39389) (#39589)
fix: incorrect active serial nos

(cherry picked from commit 64cb1153de)

Co-authored-by: Rohit Waghchaure <rohitw1991@gmail.com>
2024-01-27 11:57:58 +05:30
Frappe PR Bot
0e2f57ba89 chore(release): Bumped to Version 15.10.7
## [15.10.7](https://github.com/frappe/erpnext/compare/v15.10.6...v15.10.7) (2024-01-27)

### Bug Fixes

* incorrect amount in the material request item (backport [#39567](https://github.com/frappe/erpnext/issues/39567)) (backport [#39569](https://github.com/frappe/erpnext/issues/39569)) ([#39587](https://github.com/frappe/erpnext/issues/39587)) ([30bdba4](30bdba4801))
2024-01-27 04:43:59 +00:00
mergify[bot]
30bdba4801 fix: incorrect amount in the material request item (backport #39567) (backport #39569) (#39587)
fix: incorrect amount in the material request item (backport #39567) (#39569)

fix: incorrect amount in the material request item (#39567)

fix: incoorect amount in the material request
(cherry picked from commit 2bdfdeeb9a)

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-01-27 10:12:45 +05:30
mergify[bot]
ed06f0cd1b refactor: BOM creator item selector with short description (backport #39433) (#39435)
refactor: BOM creator item selector with short description

(cherry picked from commit 0f881bc90a)

Co-authored-by: Florian HENRY <florian.henry@open-concept.pro>
2024-01-27 09:51:14 +05:30
Gursheen Kaur Anand
9abc07e34b Merge pull request #39585 from frappe/mergify/bp/version-15-hotfix/pr-39532
fix: type error in transaction.js (backport #39532)
2024-01-26 23:46:57 +05:30
Gursheen Anand
a7d13686c7 fix: type error on company doc
(cherry picked from commit 030d35628d)
2024-01-26 17:31:07 +00:00
Deepesh Garg
ab99414242 Merge pull request #39577 from frappe/mergify/bp/version-15-hotfix/pr-39511
refactor(Sales Invoice): set account and sum for payments (#39511)
2024-01-26 10:04:23 +05:30
Deepesh Garg
fa8fb7a49e Merge pull request #39575 from frappe/mergify/bp/version-15-hotfix/pr-39108
feat: In words in payment entry (#39108)
2024-01-26 09:46:01 +05:30
barredterra
4fc3a264f9 refactor(Sales Invoice): set account for mode of payment
(cherry picked from commit 3815f07c33)
2024-01-26 04:15:14 +00:00
Deepesh Garg
5df2f5d523 feat: In words in payment entry
(cherry picked from commit b21da472f6)
2024-01-26 04:01:45 +00:00
mergify[bot]
e0c35d60b4 fix: incorrect amount in the material request item (backport #39567) (#39569)
fix: incorrect amount in the material request item (#39567)

fix: incoorect amount in the material request
(cherry picked from commit 2bdfdeeb9a)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-01-25 17:22:31 +05:30
Gursheen Kaur Anand
14aa9d3d0f Merge pull request #39564 from frappe/mergify/bp/version-15-hotfix/pr-39557
fix: make SO item code mandatory (backport #39557)
2024-01-25 16:39:39 +05:30
Nabin Hait
3bdd1e9514 fix: fetch correct quantity and amount for grouped asset
(cherry picked from commit 06f48c678b)
2024-01-25 10:51:53 +00:00
Gursheen Anand
171586db9b fix: make SO item code reqd
(cherry picked from commit 7f8303a493)
2024-01-25 10:50:38 +00:00
ruthra kumar
c3557a87ef Merge pull request #39552 from frappe/mergify/bp/version-15-hotfix/pr-38218
fix: honour currency precision while fetching balance (backport #38218)
2024-01-25 13:25:15 +05:30
mergify[bot]
4853ab1fec fix: default enable closing stock balance (backport #39551) (#39554)
fix: default enable closing stock balance (#39551)

(cherry picked from commit d1fb90edff)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-01-25 12:51:55 +05:30
Dany Robert
ed032b3224 chore: avoid explicit escaping for precision
Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
(cherry picked from commit a8949174c8)
2024-01-25 07:00:45 +00:00
Dany Robert
8b7900e6a7 chore: change f-string to sql params
(cherry picked from commit 383a4b132e)
2024-01-25 07:00:45 +00:00
Dany Robert
e0a38207f6 fix: honour currency precision while fetching balance
(cherry picked from commit bfaa93b0ca)
2024-01-25 07:00:45 +00:00
Frappe PR Bot
53b844f173 chore(release): Bumped to Version 15.10.6
## [15.10.6](https://github.com/frappe/erpnext/compare/v15.10.5...v15.10.6) (2024-01-25)

### Bug Fixes

* Item Tax template is not working for e-commerce ([83c1208](83c120849f))
2024-01-25 06:48:53 +00:00
rohitwaghchaure
34e581715a Merge pull request #39550 from frappe/mergify/bp/version-15/pr-39549
fix: Item Tax template is not working for e-commerce (backport #39547) (backport #39549)
2024-01-25 12:17:43 +05:30
Rohit Waghchaure
83c120849f fix: Item Tax template is not working for e-commerce
(cherry picked from commit 7d3240ae3a)
(cherry picked from commit 2905db19e5)
2024-01-25 06:24:19 +00:00
rohitwaghchaure
e08c7bad63 Merge pull request #39549 from frappe/mergify/bp/version-15-hotfix/pr-39547
fix: Item Tax template is not working for e-commerce (backport #39547)
2024-01-25 11:53:30 +05:30
Rohit Waghchaure
2905db19e5 fix: Item Tax template is not working for e-commerce
(cherry picked from commit 7d3240ae3a)
2024-01-25 06:07:23 +00:00
ruthra kumar
bd7e8ed230 Merge pull request #39538 from frappe/mergify/bp/version-15-hotfix/pr-39331
fix: Payment Terms Status for Sales Order report show all payment terms from orders (not only when there is a payment terms template) (backport #39331)
2024-01-24 16:27:29 +05:30
Florian HENRY
b2e0d24954 fix: Payment Terms Status for Sales Order report should show all payment terms from order not only this comming from template
(cherry picked from commit 6c8f52b26f)
2024-01-24 10:43:08 +00:00
rohitwaghchaure
84a94cec6b Merge pull request #39531 from frappe/mergify/bp/version-15-hotfix/pr-39525
fix: email list for auto reorder material request (backport #39525)
2024-01-24 14:49:28 +05:30
Frappe PR Bot
cc195777f4 chore(release): Bumped to Version 15.10.5
## [15.10.5](https://github.com/frappe/erpnext/compare/v15.10.4...v15.10.5) (2024-01-24)

### Bug Fixes

* AttributeError in company transaction deletion ([3549cd3](3549cd39f1))
2024-01-24 07:59:52 +00:00
ruthra kumar
60c10f4457 Merge pull request #39534 from frappe/mergify/bp/version-15/pr-39529
fix: AttributeError in company transaction deletion (backport #39529)
2024-01-24 13:28:34 +05:30
ruthra kumar
871dc6b0da Merge pull request #39533 from frappe/mergify/bp/version-15-hotfix/pr-39529
fix: AttributeError in company transaction deletion (backport #39529)
2024-01-24 13:28:22 +05:30
ruthra kumar
3549cd39f1 fix: AttributeError in company transaction deletion
(cherry picked from commit b127aa308e)
2024-01-24 07:43:02 +00:00
ruthra kumar
222005ca44 fix: AttributeError in company transaction deletion
(cherry picked from commit b127aa308e)
2024-01-24 07:40:59 +00:00
Rohit Waghchaure
98c56535d8 fix: email list for auto reorder material request
(cherry picked from commit 764f3422a0)
2024-01-24 07:07:16 +00:00
rohitwaghchaure
f6a779e1aa Merge pull request #39527 from frappe/mergify/bp/version-15-hotfix/pr-39521
fix: not able to edit address through portal (backport #39521)
2024-01-24 12:17:05 +05:30
Rohit Waghchaure
1f5dbebe68 fix: not able to edit address through portal
(cherry picked from commit b046d980ad)
2024-01-24 06:20:31 +00:00
Gursheen Kaur Anand
4073dfb90b Merge pull request #39522 from frappe/mergify/bp/version-15-hotfix/pr-39493
fix: skip setting liability account for internal transfer (backport #39493)
2024-01-24 11:08:53 +05:30
Gursheen Anand
e2d85c513c fix: skip liability account for internal transfer
(cherry picked from commit 236b73565e)
2024-01-24 05:04:45 +00:00
rohitwaghchaure
880f648846 Merge pull request #39513 from frappe/mergify/bp/version-15-hotfix/pr-39503
fix: Serial No Ledger permission issue (backport #39503)
2024-01-24 10:27:23 +05:30
Raffael Meyer
84d2a80f30 Merge pull request #39516 from frappe/mergify/bp/version-15-hotfix/pr-39512 2024-01-23 19:00:53 +01:00
barredterra
fe41e2a341 refactor(Batch): use const instead of var
(cherry picked from commit 7a7a213285)
2024-01-23 16:55:27 +00:00
barredterra
a97b8fd876 fix(Batch): reload doc after splitting
to show updated qty

(cherry picked from commit 34ec2f8a2b)
2024-01-23 16:55:27 +00:00
barredterra
6ed42e939b refactor: split batch
(cherry picked from commit 3c7e7a76f0)
2024-01-23 16:55:26 +00:00
Rohit Waghchaure
f9d1995954 fix: Serial No Ledger permission issue
(cherry picked from commit 1a670ff266)
2024-01-23 13:37:35 +00:00
Frappe PR Bot
028ae5b34f chore(release): Bumped to Version 15.10.4
## [15.10.4](https://github.com/frappe/erpnext/compare/v15.10.3...v15.10.4) (2024-01-23)

### Bug Fixes

* added button to make serial / batch from Purchase Invoice ([96e1db8](96e1db80ac))
* auto create serial no on scan ([ca93f67](ca93f671df))
* duplicate name error while making variant ([b649c50](b649c50ecc))
* key error during reposting ([b4981f8](b4981f8816))
* linting issue ([86f3f62](86f3f62e00))
* party field in pdf html ([9a08349](9a0834987c))
* set unallocated amount after base tax ([74613c7](74613c7fe8))
* UOM needs to be whole number not being checked in quotations ([c7d5857](c7d5857014))
* use most reliable section reference per report line ([b388adc](b388adcb2e))
* UX improvements for Serial and Batch Bundle ([c761459](c76145985d))
2024-01-23 11:59:22 +00:00
ruthra kumar
2a7f7df3e5 Merge pull request #39505 from frappe/version-15-hotfix
chore: release v15
2024-01-23 17:28:01 +05:30
rohitwaghchaure
1331fb75a3 Merge pull request #39496 from frappe/mergify/bp/version-15-hotfix/pr-39478
fix: UX improvements for Serial and Batch Bundle (backport #39478)
2024-01-23 13:18:16 +05:30
Rohit Waghchaure
ca93f671df fix: auto create serial no on scan
(cherry picked from commit fc0d2aeeff)
2024-01-23 06:27:59 +00:00
Rohit Waghchaure
c76145985d fix: UX improvements for Serial and Batch Bundle
(cherry picked from commit 5d94f0bde5)
2024-01-23 06:27:59 +00:00
rohitwaghchaure
a6b4d5b101 Merge pull request #39492 from frappe/mergify/bp/version-15-hotfix/pr-39488
fix: UOM needs to be whole number not being checked in quotations (backport #39488)
2024-01-23 11:54:54 +05:30
Rohit Waghchaure
c7d5857014 fix: UOM needs to be whole number not being checked in quotations
(cherry picked from commit aaf83da3e9)
2024-01-22 11:55:29 +00:00
Gursheen Kaur Anand
b53e072082 Merge pull request #39483 from frappe/mergify/bp/version-15-hotfix/pr-39462
fix: party field in PDF for AP / AR reports (backport #39462)
2024-01-22 17:05:48 +05:30
ruthra kumar
dc88614f89 Merge pull request #39486 from frappe/mergify/bp/version-15-hotfix/pr-39484
refactor: move 'project' set_query to sales_common.js (backport #39484)
2024-01-22 16:48:52 +05:30
ruthra kumar
0acbbefa8b refactor: move 'project' set_query to sales_common.js
(cherry picked from commit 52814724eb)
2024-01-22 10:21:28 +00:00
Gursheen Anand
9a0834987c fix: party field in pdf html
(cherry picked from commit b2d9380596)
2024-01-22 09:51:29 +00:00
ruthra kumar
3e9449d511 Merge pull request #39480 from frappe/mergify/bp/version-15-hotfix/pr-39457
refactor: delete transactions in background (backport #39457)
2024-01-22 10:44:04 +05:30
ruthra kumar
80e3597338 refactor: delete transactions in background
(cherry picked from commit a50808a077)
2024-01-22 04:28:27 +00:00
rohitwaghchaure
3c84d5ec02 Merge pull request #39479 from frappe/mergify/bp/version-15-hotfix/pr-39476
fix: added button to make serial / batch from Purchase Invoice (backport #39476)
2024-01-22 07:36:55 +05:30
Rohit Waghchaure
b0e872aad4 test: fixed test
(cherry picked from commit 63ffce58cc)
2024-01-21 16:53:46 +00:00
Rohit Waghchaure
96e1db80ac fix: added button to make serial / batch from Purchase Invoice
(cherry picked from commit b4393bc03d)
2024-01-21 16:53:46 +00:00
rohitwaghchaure
35d3edfca4 Merge pull request #39477 from frappe/mergify/bp/version-15-hotfix/pr-39475
fix: key error during reposting (backport #39475)
2024-01-21 22:23:26 +05:30
Rohit Waghchaure
b4981f8816 fix: key error during reposting
(cherry picked from commit ebc8230d45)
2024-01-21 14:22:36 +00:00
Gursheen Kaur Anand
7c666435a2 Merge pull request #39474 from frappe/mergify/bp/version-15-hotfix/pr-39229
fix: use most reliable section reference per report line (backport #39229)
2024-01-21 14:23:12 +05:30
David Arnold
b388adcb2e fix: use most reliable section reference per report line
(cherry picked from commit b5be17c6df)
2024-01-21 08:14:55 +00:00
Gursheen Kaur Anand
3ba413a150 Merge pull request #39471 from frappe/mergify/bp/version-15-hotfix/pr-39424
Revert "fix(minor): financial statements period end date" (backport #39424)
2024-01-20 18:51:34 +05:30
Gursheen Kaur Anand
ddb84d9036 Revert "fix(minor): financial statements period end date"
(cherry picked from commit 73625a2622)
2024-01-20 12:29:27 +00:00
mergify[bot]
00a3ee313b refactor(UX): Accounts workspace cleanup (backport #39232) (#39456)
* refactor(UX): Accounts workspace cleanup (#39232)

* refactor(UX): Accounts workspace cleanup

* chore: move asset workspace outside accounting

* fix: remove redundant links from parent workspace

* chore: change icons for payable & receivable workspaces

* chore: remove redundant links from subworkspaces

(cherry picked from commit 35067282cf)

* chore: fix conflicts

---------

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2024-01-19 12:40:25 +05:30
Gursheen Kaur Anand
f8d7ca515c Merge pull request #39451 from frappe/mergify/bp/version-15-hotfix/pr-39449
fix: unallocated amount after taxes and charges (backport #39449)
2024-01-19 10:57:35 +05:30
Frappe PR Bot
550213b4f4 chore(release): Bumped to Version 15.10.3
## [15.10.3](https://github.com/frappe/erpnext/compare/v15.10.2...v15.10.3) (2024-01-19)

### Bug Fixes

* duplicate name error while making variant ([0c222aa](0c222aa504))
2024-01-19 00:44:51 +00:00
rohitwaghchaure
a962657c7b Merge pull request #39444 from frappe/mergify/bp/version-15/pr-39443
fix: duplicate name error while making variant (backport #39436) (backport #39443)
2024-01-19 06:13:35 +05:30
Gursheen Anand
86f3f62e00 fix: linting issue
(cherry picked from commit 99b94af49f)
2024-01-18 10:45:49 +00:00
Gursheen Anand
74613c7fe8 fix: set unallocated amount after base tax
(cherry picked from commit e9bc63aacf)
2024-01-18 10:45:49 +00:00
Rohit Waghchaure
0c222aa504 fix: duplicate name error while making variant
(cherry picked from commit d7e6b83e64)
(cherry picked from commit b649c50ecc)
2024-01-18 01:24:00 +00:00
rohitwaghchaure
3244ef3a68 Merge pull request #39443 from frappe/mergify/bp/version-15-hotfix/pr-39436
fix: duplicate name error while making variant (backport #39436)
2024-01-18 06:52:17 +05:30
Rohit Waghchaure
b649c50ecc fix: duplicate name error while making variant
(cherry picked from commit d7e6b83e64)
2024-01-18 01:21:52 +00:00
Frappe PR Bot
d5c26efb8c chore(release): Bumped to Version 15.10.2
## [15.10.2](https://github.com/frappe/erpnext/compare/v15.10.1...v15.10.2) (2024-01-17)

### Bug Fixes

* added indexing to improve performance ([50fe419](50fe4191d3))
* added item group in stock reco ([eec6c25](eec6c25f9e))
* Asset module tests ([9e33216](9e33216c24))
* asset WDV depreciation calc according to IT act ([2448ba6](2448ba6bc4))
* batches not coming correctly in the batch selector ([1394a1c](1394a1c5e9))
* broken dimension filters in Sales/Purchase register ([04037b7](04037b7e38))
* Cancel asset capitalisation record on cancellation of asset and vice-versa ([011c5a6](011c5a69f0))
* circular dependency error while deleting QC ([7ca8e49](7ca8e49b38))
* composite asset capitalization using asset components ([8bc8bc1](8bc8bc1822))
* consider all years in holiday list ([21eed78](21eed78fa1))
* consistency in display reserved_stock checkbox on Sales Order Item according global settings and item.is_stock_item (backport [#38322](https://github.com/frappe/erpnext/issues/38322)) ([#39417](https://github.com/frappe/erpnext/issues/39417)) ([53f61f1](53f61f1ad1))
* date in master document for dictionary condition ([9aae439](9aae439b1f))
* fetch name for fy ([53208df](53208dfb3e))
* Ignore default payment terms template for opening invoices ([5dc2e80](5dc2e80987))
* incorrect percentage received in purchase invoice ([758b9b8](758b9b8a81))
* incorrect sql error if account name has '%' ([b43f703](b43f70325c))
* modified date ([cd870ee](cd870ee30c))
* modified date ([f048017](f0480173fb))
* modified date was not set ([2dc8686](2dc8686a81))
* modified date was not updated ([61595c7](61595c7ede))
* performance issue related to stock entry (backport [#39301](https://github.com/frappe/erpnext/issues/39301)) ([#39303](https://github.com/frappe/erpnext/issues/39303)) ([d882305](d882305c72))
* permission issue for the BIN ([8816b27](8816b2740a))
* possible typerror in utils.js ([80956b7](80956b7956))
* project filters on Delivery Note and Sales Order ([a51f956](a51f956f3e))
* project query controller logic ([07e2901](07e2901e4b))
* reset default after test ([e6f3a14](e6f3a14289))
* SBB Total Qty validation for SE ([ca18853](ca18853785))
* test for asset depreciation ([ff1647a](ff1647a1d2))
* **test:** test case for project query ([1b8f572](1b8f572e80))
* unreconcile Bank Transaction on cancel of payment voucher ([16860c2](16860c228d))
* Update subscription period ([e219042](e219042304))
* use child table values instead of global min max ([04c96dd](04c96ddc6c))
* WDV as per IT Act: calculate yearly amount first and then split it based on months ([e3cd35b](e3cd35b959))
2024-01-17 17:06:29 +00:00
Deepesh Garg
e00533ff4e Merge pull request #39405 from frappe/version-15-hotfix
chore: release v15
2024-01-17 22:34:57 +05:30
Nabin Hait
6509548474 Merge pull request #39438 from frappe/mergify/bp/version-15-hotfix/pr-39429
fix: composite asset capitalization using asset components (backport #39429)
2024-01-17 22:13:50 +05:30
mergify[bot]
c8b3478fe1 Merge branch 'version-15-hotfix' into mergify/bp/version-15-hotfix/pr-39429 2024-01-17 16:26:04 +00:00
Nabin Hait
f453aaeab0 Merge pull request #39439 from nabinhait/test-case-fix-asset-depr
fix: test for asset depreciation
2024-01-17 21:54:55 +05:30
Nabin Hait
ff1647a1d2 fix: test for asset depreciation 2024-01-17 21:53:00 +05:30
Nabin Hait
8bc8bc1822 fix: composite asset capitalization using asset components
(cherry picked from commit 5df40661d2)
2024-01-17 15:36:04 +00:00
Nabin Hait
9f86b92eb7 Merge pull request #39431 from frappe/mergify/bp/version-15-hotfix/pr-39427
fix: Asset module tests (backport #39427)
2024-01-17 17:38:46 +05:30
Nabin Hait
04c8e9b355 Merge pull request #39422 from frappe/mergify/bp/version-15-hotfix/pr-39386
fix: Cancel asset capitalisation record on cancellation of asset and vice-versa (backport #39386)
2024-01-17 17:33:21 +05:30
Nabin Hait
fbfd0a6db0 Merge pull request #39420 from frappe/mergify/bp/version-15-hotfix/pr-39385
fix: WDV as per IT Act: calculate yearly amount first and then split it based on months (backport #39385)
2024-01-17 17:29:12 +05:30
Nabin Hait
9e33216c24 fix: Asset module tests
(cherry picked from commit 97f69986ff)
2024-01-17 11:56:41 +00:00
Deepesh Garg
62f7d984be Merge pull request #39425 from frappe/mergify/bp/version-15-hotfix/pr-39423
fix: Update subscription period (#39423)
2024-01-17 15:03:51 +05:30
Deepesh Garg
e219042304 fix: Update subscription period
(cherry picked from commit 7eefedfb11)
2024-01-17 07:28:57 +00:00
Nabin Hait
011c5a69f0 fix: Cancel asset capitalisation record on cancellation of asset and vice-versa
(cherry picked from commit efe9f6656f)
2024-01-17 06:45:39 +00:00
Nabin Hait
e3cd35b959 fix: WDV as per IT Act: calculate yearly amount first and then split it based on months
(cherry picked from commit 22bd6a54b2)
2024-01-17 06:44:26 +00:00
mergify[bot]
53f61f1ad1 fix: consistency in display reserved_stock checkbox on Sales Order Item according global settings and item.is_stock_item (backport #38322) (#39417)
fix: consistency in display reserved_stock checkbox on Sales Order Item according global settings and item.is_stock_item (#38322)

* fix: consistency in display reserved_stock checkbox on Sales Order Item according global settings and item.is_stock_item

* fix: evaluate depends_on for fdata visibility in grid

* fix: evaluate depends_on for fdata visibility in grid

* chore: change after review

* chore: change for review

(cherry picked from commit af80d253db)

Co-authored-by: HENRY Florian <florian.henry@open-concept.pro>
2024-01-17 10:45:57 +05:30
rohitwaghchaure
c939aa5cf8 Merge pull request #39409 from frappe/mergify/bp/version-15-hotfix/pr-39406
fix: permission issue for the Bin (backport #39406)
2024-01-16 16:55:50 +05:30
ruthra kumar
93a861fac5 Merge pull request #39412 from frappe/mergify/bp/version-15-hotfix/pr-39402
fix: project query controller logic (backport #39402)
2024-01-16 16:49:56 +05:30
ruthra kumar
5a65a10dba refactor: better ordering of query result
(cherry picked from commit bfe42fdccb)
2024-01-16 10:55:36 +00:00
ruthra kumar
1b8f572e80 fix(test): test case for project query
(cherry picked from commit 3349dde5e2)
2024-01-16 10:55:36 +00:00
ruthra kumar
07e2901e4b fix: project query controller logic
(cherry picked from commit 4eefb445a7)
2024-01-16 10:55:35 +00:00
Rohit Waghchaure
8816b2740a fix: permission issue for the BIN
(cherry picked from commit 6e4d4a55cd)
2024-01-16 10:22:22 +00:00
ruthra kumar
bcf8053fd9 Merge pull request #39383 from frappe/mergify/bp/version-15-hotfix/pr-39332
refactor: prevent foreign currency subscription for a party (backport #39332)
2024-01-16 11:19:37 +05:30
ruthra kumar
cd1820f680 refactor(test): set default currency for party 2024-01-16 10:47:51 +05:30
ruthra kumar
235e3893a0 Merge pull request #39393 from frappe/mergify/bp/version-15-hotfix/pr-39391
fix: possible typerror in utils.js (backport #39391)
2024-01-15 20:49:48 +05:30
ruthra kumar
80956b7956 fix: possible typerror in utils.js
and remove unwanted debugging statements

(cherry picked from commit 60b26ad8b2)
2024-01-15 15:16:51 +00:00
Nabin Hait
9897c26ae6 Merge pull request #39285 from frappe/mergify/bp/version-15-hotfix/pr-39052
fix: asset WDV depreciation calc according to IT act [dev] (backport #39052)
2024-01-15 16:58:45 +05:30
ruthra kumar
32afe7de31 refactor(test): supply default currency for subscription plans
(cherry picked from commit 1387b0ba7f)
2024-01-15 09:36:50 +00:00
ruthra kumar
c288db0356 refactor: making currency mandatory for subcscription plans
(cherry picked from commit 19975dcb7b)
2024-01-15 09:36:50 +00:00
ruthra kumar
61f073f8b1 refactor: prevent foreign currency subscription for a party
(cherry picked from commit 6b5fa2c673)
2024-01-15 09:36:49 +00:00
Frappe PR Bot
8a356cbe51 chore(release): Bumped to Version 15.10.1
## [15.10.1](https://github.com/frappe/erpnext/compare/v15.10.0...v15.10.1) (2024-01-15)

### Bug Fixes

* SBB Total Qty validation for SE (backport [#39335](https://github.com/frappe/erpnext/issues/39335)) (backport [#39348](https://github.com/frappe/erpnext/issues/39348)) ([#39353](https://github.com/frappe/erpnext/issues/39353)) ([b8f4c31](b8f4c3193a))
2024-01-15 06:47:45 +00:00
mergify[bot]
1503ba92e3 ci: bump node in release workflow (backport #39377) (backport #39378) (#39380)
ci: bump node in release workflow (backport #39377) (#39378)

* ci: bump node in release workflow

(cherry picked from commit aef87cced7)

# Conflicts:
#	.github/workflows/release.yml

* chore: `conflicts`

---------

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-01-15 12:12:35 +05:30
mergify[bot]
e282ba78c1 ci: bump node in release workflow (backport #39377) (#39378)
* ci: bump node in release workflow

(cherry picked from commit aef87cced7)

# Conflicts:
#	.github/workflows/release.yml

* chore: `conflicts`

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-01-15 12:08:44 +05:30
ruthra kumar
1b8b92b8d7 Merge pull request #39376 from frappe/mergify/bp/version-15-hotfix/pr-39336
refactor: disallow bank transactions on different currencies (backport #39336)
2024-01-15 10:41:26 +05:30
ruthra kumar
f2e19ca6fd Merge pull request #39375 from frappe/mergify/bp/version-15-hotfix/pr-39371
fix: incorrect sql error if account name has '%' (backport #39371)
2024-01-15 10:40:54 +05:30
ruthra kumar
32c6111728 refactor(test): supply default currency to Bank Transaction
(cherry picked from commit a27a4db3de)
2024-01-15 04:32:46 +00:00
ruthra kumar
f609b8ae5d refactor: better error message
(cherry picked from commit b4354cbc8d)
2024-01-15 04:32:46 +00:00
ruthra kumar
dbbba046ab refactor: disallow bank transactions on different currencies
(cherry picked from commit cdd0acc672)
2024-01-15 04:32:45 +00:00
ruthra kumar
b43f70325c fix: incorrect sql error if account name has '%'
(cherry picked from commit 641c3de0ca)
2024-01-15 04:10:40 +00:00
rohitwaghchaure
3f5b1bcd05 Merge pull request #39373 from frappe/mergify/bp/version-15-hotfix/pr-39372
fix: batches not coming correctly in the batch selector (backport #39372)
2024-01-15 06:34:11 +05:30
Rohit Waghchaure
1394a1c5e9 fix: batches not coming correctly in the batch selector
(cherry picked from commit 114f2b4326)
2024-01-14 18:19:30 +00:00
Deepesh Garg
7ca9ffbaa7 Merge pull request #39329 from frappe/mergify/bp/version-15-hotfix/pr-38974
fix: unreconciled Bank Transaction on cancel of payment voucher (#38974)
2024-01-14 17:55:32 +05:30
rohitwaghchaure
137ce76a35 Merge pull request #39369 from frappe/mergify/bp/version-15-hotfix/pr-39224
Update purchase_taxes_and_charges.json label Rate to Tax Rate (backport #39224)
2024-01-14 11:59:41 +05:30
rohitwaghchaure
cd870ee30c fix: modified date
(cherry picked from commit 6827edb2c5)
2024-01-14 05:57:45 +00:00
rohitwaghchaure
2dc8686a81 fix: modified date was not set
(cherry picked from commit 566876ae7a)
2024-01-14 05:57:44 +00:00
mahsem
6bdf944ecf Update purchase_taxes_and_charges.json label Rate to Tax Rate
Change Rate label to existing Tax Rate label so it can be correctly translated in other languages

(cherry picked from commit bd464197c4)
2024-01-14 05:57:44 +00:00
rohitwaghchaure
9842fb5b64 Merge pull request #39361 from frappe/mergify/bp/version-15-hotfix/pr-39225
Update sales_taxes_and_charges.json (backport #39225)
2024-01-14 11:24:20 +05:30
rohitwaghchaure
c548c57207 Merge pull request #39365 from frappe/mergify/bp/version-15-hotfix/pr-39359
fix: added item group in stock reco (backport #39359)
2024-01-14 11:24:00 +05:30
rohitwaghchaure
cb326ac0db Merge pull request #39362 from rohitwaghchaure/fixed-closing-stock-balance-field-issue
chore: removed extra field
2024-01-14 10:44:47 +05:30
rohitwaghchaure
f0480173fb fix: modified date 2024-01-14 10:43:34 +05:30
Rohit Waghchaure
eec6c25f9e fix: added item group in stock reco
(cherry picked from commit 116ff8241c)
2024-01-14 04:58:42 +00:00
Rohit Waghchaure
bf4e514cde chore: removed extra field 2024-01-14 10:21:38 +05:30
rohitwaghchaure
61595c7ede fix: modified date was not updated
(cherry picked from commit f567af49a6)
2024-01-14 04:46:29 +00:00
mahsem
d510b46f13 Update sales_taxes_and_charges.json
Change Rate label to existing Tax Rate label so it can be correctly translated in other languages

(cherry picked from commit 2b93be1139)
2024-01-14 04:46:29 +00:00
rohitwaghchaure
15e116375b Merge pull request #39325 from frappe/mergify/bp/version-15-hotfix/pr-39305
fix: naming series variable parsing for FY (backport #39305)
2024-01-14 09:39:06 +05:30
mergify[bot]
b8f4c3193a fix: SBB Total Qty validation for SE (backport #39335) (backport #39348) (#39353)
fix: SBB Total Qty validation for SE

(cherry picked from commit c20241fcb5)
(cherry picked from commit ca18853785)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-01-13 10:25:53 +05:30
rohitwaghchaure
832aa5f5ab Merge pull request #39348 from frappe/mergify/bp/version-15-hotfix/pr-39335
fix: SBB Total Qty validation for SE (backport #39335)
2024-01-12 21:19:26 +05:30
s-aga-r
ca18853785 fix: SBB Total Qty validation for SE
(cherry picked from commit c20241fcb5)
2024-01-12 15:30:36 +00:00
rohitwaghchaure
049864e7a2 Merge pull request #39342 from frappe/mergify/bp/version-15-hotfix/pr-38970
fix: use local attribute range in multiple item variant dialog (backport #38970)
2024-01-12 20:57:14 +05:30
rohitwaghchaure
62db0d77ca Merge pull request #39345 from frappe/mergify/bp/version-15-hotfix/pr-39333
fix: added indexing to improve performance (backport #39333)
2024-01-12 20:55:57 +05:30
Rohit Waghchaure
50fe4191d3 fix: added indexing to improve performance
(cherry picked from commit ac81323fec)
2024-01-12 13:10:47 +00:00
Gursheen Anand
04c96ddc6c fix: use child table values instead of global min max
(cherry picked from commit 43fed29514)
2024-01-12 13:08:31 +00:00
mergify[bot]
d7840559a0 chore: remove share, print and email permissions from Buying Settings (backport #39337) (#39339)
chore: remove share, print and email permissions from Buying Settings

(cherry picked from commit 3c46abca6c)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-01-12 16:49:00 +05:30
Raffael Meyer
6f06313023 Merge pull request #39327 from frappe/mergify/bp/version-15-hotfix/pr-39117
fix: consider all years in holiday list (backport #39117)
2024-01-11 15:04:29 +01:00
barredterra
6b2e3503d9 chore: resolve merge confilcts 2024-01-11 14:56:20 +01:00
barredterra
b2fc5e4988 test: cancel voucher linked to Bank Transaction
(cherry picked from commit 517bedeb7e)
2024-01-11 13:37:48 +00:00
barredterra
16860c228d fix: unreconcile Bank Transaction on cancel of payment voucher
(cherry picked from commit 0a95b38166)

# Conflicts:
#	erpnext/accounts/doctype/bank_transaction/bank_transaction.py
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.js
2024-01-11 13:37:48 +00:00
barredterra
8a84f8a465 test: improve test for local holidays
(cherry picked from commit 60329ade9e)
2024-01-11 13:29:01 +00:00
barredterra
21eed78fa1 fix: consider all years in holiday list
(cherry picked from commit 300aaa39fe)
2024-01-11 13:29:00 +00:00
Gursheen Anand
e6f3a14289 fix: reset default after test
(cherry picked from commit 813b7a96fb)
2024-01-11 13:27:13 +00:00
Gursheen Anand
2beb3f8718 test: naming series variable parsing
(cherry picked from commit bbdf98a8f0)
2024-01-11 13:27:06 +00:00
Gursheen Anand
9aae439b1f fix: date in master document for dictionary condition
(cherry picked from commit d96a777edd)
2024-01-11 13:27:02 +00:00
Nabin Hait
b748095589 Merge pull request #39220 from frappe/mergify/bp/version-15-hotfix/pr-39202
fix: parse naming series with FY name (backport #39202)
2024-01-11 18:24:34 +05:30
ruthra kumar
7bd2acdef1 Merge pull request #39323 from frappe/mergify/bp/version-15-hotfix/pr-39212
fix: project filters on Delivery Note and Sales Order (backport #39212)
2024-01-11 18:07:12 +05:30
ruthra kumar
a51f956f3e fix: project filters on Delivery Note and Sales Order
(cherry picked from commit 9ba6ff67d5)
2024-01-11 12:34:43 +00:00
ruthra kumar
494c26e48a Merge pull request #39319 from frappe/mergify/bp/version-15-hotfix/pr-39317
fix: broken dimension filters in Sales/Purchase register (backport #39317)
2024-01-11 17:12:35 +05:30
Deepesh Garg
da7b2febe0 Merge pull request #39295 from frappe/mergify/bp/version-15-hotfix/pr-39256
fix: Ignore default payment terms template for opening invoices (#39256)
2024-01-11 17:06:53 +05:30
ruthra kumar
04037b7e38 fix: broken dimension filters in Sales/Purchase register
(cherry picked from commit 7b3f9386d7)
2024-01-11 11:20:43 +00:00
rohitwaghchaure
484db65797 Merge pull request #39315 from frappe/mergify/bp/version-15-hotfix/pr-39215
fix: incorrect percentage received in purchase invoice (backport #39215)
2024-01-11 15:14:44 +05:30
rohitwaghchaure
3f4cf15def Merge pull request #39312 from frappe/mergify/bp/version-15-hotfix/pr-39299
fix: circular dependency error on deletion of QC and Stock Entry (backport #39299)
2024-01-11 15:14:34 +05:30
Rohit Waghchaure
758b9b8a81 fix: incorrect percentage received in purchase invoice
(cherry picked from commit 8d2c78867e)
2024-01-11 09:21:41 +00:00
Rohit Waghchaure
7ca8e49b38 fix: circular dependency error while deleting QC
(cherry picked from commit 7cc324e31e)
2024-01-11 09:20:42 +00:00
mergify[bot]
d882305c72 fix: performance issue related to stock entry (backport #39301) (#39303)
fix: performance issue related to stock entry (#39301)

(cherry picked from commit c67b0a3a64)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-01-10 22:18:16 +05:30
Deepesh Garg
5dc2e80987 fix: Ignore default payment terms template for opening invoices
(cherry picked from commit 53bf44d2b8)
2024-01-10 10:37:45 +00:00
Frappe PR Bot
1dc85fcaf8 chore(release): Bumped to Version 15.10.0
# [15.10.0](https://github.com/frappe/erpnext/compare/v15.9.1...v15.10.0) (2024-01-10)

### Bug Fixes

* add expected_start_date in sort by ([b064944](b064944753))
* Add name to Hungary - Chart of Accounts for Microenterprises json ([0784488](0784488eec))
* add read permission to Buying Settings ([e62dd0d](e62dd0d7cb))
* bank transction status upon reconciliation ([277aa7b](277aa7bc2b))
* BOM replace tool does not update exploded items of root (backport [#39244](https://github.com/frappe/erpnext/issues/39244)) ([#39250](https://github.com/frappe/erpnext/issues/39250)) ([0898ea5](0898ea5d92))
* Creating Asset Activity while Importing Asset ([#39113](https://github.com/frappe/erpnext/issues/39113)) ([5e46937](5e4693763a))
* don't set rate for non-stock item in Internal Transfer (backport [#39140](https://github.com/frappe/erpnext/issues/39140)) ([#39169](https://github.com/frappe/erpnext/issues/39169)) ([f3882a8](f3882a854f))
* Duplicate Closing Stock Balance (backport [#39262](https://github.com/frappe/erpnext/issues/39262)) ([#39264](https://github.com/frappe/erpnext/issues/39264)) ([78c65f2](78c65f27b0))
* duplicate entry for serial / batch creation (backport [#39188](https://github.com/frappe/erpnext/issues/39188)) ([#39192](https://github.com/frappe/erpnext/issues/39192)) ([672e6d6](672e6d6d06))
* **Employee:** treeview ([#39126](https://github.com/frappe/erpnext/issues/39126)) ([6020c8e](6020c8e8f7))
* FG Item incorrect qty in the work order (backport [#39200](https://github.com/frappe/erpnext/issues/39200)) ([#39211](https://github.com/frappe/erpnext/issues/39211)) ([abc99f8](abc99f84e9))
* flaky demo test case (backport [#39135](https://github.com/frappe/erpnext/issues/39135)) ([#39198](https://github.com/frappe/erpnext/issues/39198)) ([3caf462](3caf462c6b))
* Ignore asset qty and status validation while cancelling LCV ([87d1b0f](87d1b0f476))
* ignore cancelled payments in Sales/Purchase Register ([9e1b443](9e1b443857))
* Ignore UP on "allowed to transact with" ([#39103](https://github.com/frappe/erpnext/issues/39103)) ([aad39cf](aad39cf686))
* improved validation message ([e89dce7](e89dce726b))
* incorrect indicator title for portal sales order (backport [#39247](https://github.com/frappe/erpnext/issues/39247)) ([#39255](https://github.com/frappe/erpnext/issues/39255)) ([9f793b9](9f793b9b28))
* incorrect outstanding amt validation on advance as liability ([51d8a7a](51d8a7a0c1))
* Introduced company field to show amounts in company currency ([1d2e831](1d2e831846))
* inventory dimension negative stock validation (backport [#39149](https://github.com/frappe/erpnext/issues/39149)) ([#39151](https://github.com/frappe/erpnext/issues/39151)) ([82b96d3](82b96d3688))
* possible key error on Financial ratios report ([16269b0](16269b0730))
* possible typeerror on transaction.js ([fec892c](fec892c211))
* projects website list visible for guests and all logged in customers (backport [#39164](https://github.com/frappe/erpnext/issues/39164)) ([#39273](https://github.com/frappe/erpnext/issues/39273)) ([5d6bc96](5d6bc96375)), closes [#39009](https://github.com/frappe/erpnext/issues/39009)
* Purchase date and amount is not mandatory for composite asset creation ([d6d54ed](d6d54ed220))
* Resolved conflict ([afefae0](afefae08af))
* serial / batch barcode scanner (backport [#39114](https://github.com/frappe/erpnext/issues/39114)) ([#39143](https://github.com/frappe/erpnext/issues/39143)) ([2db1e1a](2db1e1a737))
* Set asset purchase amount based on qty and valuation_rate ([f0070b4](f0070b4046))
* set parent doctype on chart (backport [#39286](https://github.com/frappe/erpnext/issues/39286)) ([#39288](https://github.com/frappe/erpnext/issues/39288)) ([fe973a4](fe973a4b53))
* Show maintain-stock and is-fixed-asset checkbox in item quick entry dialog ([50300b9](50300b9be6))
* Show timesheet table after fetching data from timesheet (backport [#39275](https://github.com/frappe/erpnext/issues/39275)) ([#39281](https://github.com/frappe/erpnext/issues/39281)) ([2598f8e](2598f8e7ec))
* skip rate validation for return `DN Items` with `Moving Average` valuation (backport [#39242](https://github.com/frappe/erpnext/issues/39242)) ([#39266](https://github.com/frappe/erpnext/issues/39266)) ([f00a6f6](f00a6f6c59))
* Subscription update patch ([7640fea](7640feaaa7))
* total allocated percentage for sales team issue ([756c062](756c062733))
* TypeError is pricing rules (backport [#39252](https://github.com/frappe/erpnext/issues/39252)) ([#39260](https://github.com/frappe/erpnext/issues/39260)) ([bb6025c](bb6025ca26))
* typerror on multi select dialog ([54a0df5](54a0df5164))
* update Maintenance Schedule status on Maintenance Visit submit (backport [#39167](https://github.com/frappe/erpnext/issues/39167)) ([#39186](https://github.com/frappe/erpnext/issues/39186)) ([926850d](926850d1f6))
* update status on manual allocation ([a147e29](a147e2954f))
* **UX:** dont override framework's permission check messages (backport [#39118](https://github.com/frappe/erpnext/issues/39118)) ([#39120](https://github.com/frappe/erpnext/issues/39120)) ([40ec5ff](40ec5ff90f))

### Features

* provision to close SCO (backport [#39127](https://github.com/frappe/erpnext/issues/39127)) ([#39144](https://github.com/frappe/erpnext/issues/39144)) ([b192ddd](b192ddd13b))
2024-01-10 10:36:08 +00:00
Deepesh Garg
e4e3313a0e Merge pull request #39245 from frappe/version-15-hotfix
chore: release v15
2024-01-10 16:04:56 +05:30
mergify[bot]
2598f8e7ec fix: Show timesheet table after fetching data from timesheet (backport #39275) (#39281)
fix: Show timesheet table after fetching data from timesheet

(cherry picked from commit e1ba5878a3)

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2024-01-10 12:33:24 +05:30
mergify[bot]
fe973a4b53 fix: set parent doctype on chart (backport #39286) (#39288)
fix: set parent doctype on chart (#39286)

(cherry picked from commit 38c5ecf007)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2024-01-10 12:27:16 +05:30
anandbaburajan
2448ba6bc4 fix: asset WDV depreciation calc according to IT act
(cherry picked from commit 026824880d)
2024-01-10 06:48:06 +00:00
Nabin Hait
f82125144a Merge pull request #39190 from frappe/mergify/bp/version-15-hotfix/pr-39163
fix: Purchase information is not required for creating a composite asset (backport #39163)
2024-01-10 12:15:02 +05:30
Nabin Hait
38c1350018 Merge pull request #39279 from frappe/mergify/bp/version-15-hotfix/pr-39191
fix: Ignore asset qty and status validation while cancelling LCV (backport #39191)
2024-01-10 12:14:45 +05:30
Nabin Hait
24cfcf36e4 Merge pull request #39276 from frappe/mergify/bp/version-15-hotfix/pr-39238
fix: Set asset purchase amount based on qty and valuation_rate (backport #39238)
2024-01-10 12:14:10 +05:30
Nabin Hait
0c0be03e90 Merge pull request #39218 from frappe/mergify/bp/version-15-hotfix/pr-39214
fix: Show maintain-stock and is-fixed-asset checkbox in item quick entry dialog (backport #39214)
2024-01-10 12:12:32 +05:30
ruthra kumar
cd57bbc3d0 Merge pull request #39284 from frappe/mergify/bp/version-15-hotfix/pr-39282
fix: possible typeerror on transaction.js (backport #39282)
2024-01-10 12:00:43 +05:30
Nabin Hait
afefae08af fix: Resolved conflict 2024-01-10 11:59:54 +05:30
ruthra kumar
fec892c211 fix: possible typeerror on transaction.js
(cherry picked from commit 9f27ac142b)
2024-01-10 06:24:46 +00:00
Nabin Hait
87d1b0f476 fix: Ignore asset qty and status validation while cancelling LCV
(cherry picked from commit e9d36242ce)
2024-01-10 06:04:19 +00:00
Nabin Hait
f0070b4046 fix: Set asset purchase amount based on qty and valuation_rate
(cherry picked from commit 135e19d0aa)
2024-01-10 06:03:01 +00:00
mergify[bot]
5d6bc96375 fix: projects website list visible for guests and all logged in customers (backport #39164) (#39273)
fix: projects website list visible for guests and all logged in customers (#39164)

* fix: projects website list visible for guests

fix: projects website list visible for guests and all logged in customers

see the issue for details

fixes issue #39009

* fix: remove user = frappe.session.user

(cherry picked from commit eabf706f37)

Co-authored-by: 0xD0M1M0 <76812428+0xD0M1M0@users.noreply.github.com>
2024-01-10 10:45:45 +05:30
Raffael Meyer
4fa978ef1f test: fix wrong fieldname (#39270) 2024-01-10 10:32:01 +05:30
mergify[bot]
f00a6f6c59 fix: skip rate validation for return DN Items with Moving Average valuation (backport #39242) (#39266)
fix: skip rate validation for return `DN Items` with `Moving Average` valuation

(cherry picked from commit e0ad52b500)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-01-09 22:02:20 +05:30
mergify[bot]
78c65f27b0 fix: Duplicate Closing Stock Balance (backport #39262) (#39264)
fix: Duplicate Closing Stock Balance

(cherry picked from commit b15795392b)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-01-09 20:37:38 +05:30
Raffael Meyer
a326876cc5 Merge pull request #39258 from frappe/mergify/bp/version-15-hotfix/pr-39158
fix: add read permission to Buying Settings (backport #39158)
2024-01-09 13:34:56 +01:00
mergify[bot]
9f793b9b28 fix: incorrect indicator title for portal sales order (backport #39247) (#39255)
fix: incorrect indicator title for portal sales order (#39247)

(cherry picked from commit 2d2ff7cf52)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-01-09 17:42:27 +05:30
mergify[bot]
bb6025ca26 fix: TypeError is pricing rules (backport #39252) (#39260)
fix: TypeError is pricing rules (#39252)

(cherry picked from commit 274c65c451)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-01-09 17:41:53 +05:30
ruthra kumar
4ad61fc3a5 Merge pull request #39253 from frappe/mergify/bp/version-15-hotfix/pr-39251
fix: update status on manual allocation (backport #39251)
2024-01-09 16:36:35 +05:30
s-aga-r
e62dd0d7cb fix: add read permission to Buying Settings
(cherry picked from commit e05bf9d32a)
2024-01-09 10:44:21 +00:00
ruthra kumar
a147e2954f fix: update status on manual allocation
(cherry picked from commit d32a407e08)
2024-01-09 10:29:36 +00:00
mergify[bot]
0898ea5d92 fix: BOM replace tool does not update exploded items of root (backport #39244) (#39250)
fix: BOM replace tool does not update exploded items of root (#39244)

(cherry picked from commit 5e0d017497)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-01-09 15:59:12 +05:30
ruthra kumar
d0688e7a55 Merge pull request #39241 from frappe/mergify/bp/version-15-hotfix/pr-39237
fix: sales team commission overallocation on fetching items from multiple quotations to Sales Order (backport #39237)
2024-01-09 14:40:24 +05:30
ruthra kumar
756c062733 fix: total allocated percentage for sales team issue
(cherry picked from commit b498094a97)
2024-01-09 07:39:28 +00:00
ruthra kumar
ec7a60bd02 Merge pull request #39234 from frappe/mergify/bp/version-15-hotfix/pr-39196
fix: bank transaction status upon reconciliation (backport #39196)
2024-01-09 11:57:50 +05:30
ruthra kumar
53eb6129ea refactor: remove 'Bank Trasaction' logic from status_update
(cherry picked from commit cf988434e9)
2024-01-09 05:51:38 +00:00
ruthra kumar
277aa7bc2b fix: bank transction status upon reconciliation
(cherry picked from commit 6de8c18f98)
2024-01-09 05:51:37 +00:00
Nabin Hait
97a51487c1 Merge pull request #39219 from frappe/mergify/bp/version-15-hotfix/pr-39209
fix: Introduced company field to show amounts in company currency (backport #39209)
2024-01-08 21:53:16 +05:30
Gursheen Anand
53208dfb3e fix: fetch name for fy
(cherry picked from commit d0ea598cdf)
2024-01-08 16:22:58 +00:00
Nabin Hait
1d2e831846 fix: Introduced company field to show amounts in company currency
(cherry picked from commit eab22eb282)
2024-01-08 16:09:42 +00:00
Nabin Hait
50300b9be6 fix: Show maintain-stock and is-fixed-asset checkbox in item quick entry dialog
(cherry picked from commit c14986f9e6)
2024-01-08 16:07:23 +00:00
mergify[bot]
abc99f84e9 fix: FG Item incorrect qty in the work order (backport #39200) (#39211)
fix: FG Item incorrect qty in the work order (#39200)

(cherry picked from commit 466625213b)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-01-08 18:18:32 +05:30
mergify[bot]
3caf462c6b fix: flaky demo test case (backport #39135) (#39198)
fix: flaky demo test case

(cherry picked from commit 5b1571879c)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2024-01-08 17:44:24 +05:30
Shariq Ansari
58357f8891 Merge pull request #39206 from frappe/mergify/bp/version-15-hotfix/pr-39204
fix: add expected_start_date in sort by (backport #39204)
2024-01-08 16:37:37 +05:30
Shariq Ansari
8cc9ddaebd chore: linter fix 2024-01-08 16:30:26 +05:30
Shariq Ansari
1f64b8fcd8 chore: linter fix 2024-01-08 16:30:03 +05:30
Shariq Ansari
80a2b79bba chore: linter fix 2024-01-08 16:29:13 +05:30
Shariq Ansari
b064944753 fix: add expected_start_date in sort by
(cherry picked from commit 3d54fd8389)
2024-01-08 10:40:20 +00:00
mergify[bot]
672e6d6d06 fix: duplicate entry for serial / batch creation (backport #39188) (#39192)
fix: duplicate entry for serial / batch creation (#39188)

(cherry picked from commit b96c063c93)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-01-08 14:21:04 +05:30
mergify[bot]
926850d1f6 fix: update Maintenance Schedule status on Maintenance Visit submit (backport #39167) (#39186)
* fix: make `Sales Person` non-mandatory

(cherry picked from commit 4d56f725fe)

* fix: update Maintenance Schedule status on Maintenance Visit submit

(cherry picked from commit cd293a5173)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-01-08 13:23:12 +05:30
Nabin Hait
d6d54ed220 fix: Purchase date and amount is not mandatory for composite asset creation
(cherry picked from commit c34f09c503)

# Conflicts:
#	erpnext/assets/doctype/asset/asset.py
2024-01-08 06:53:11 +00:00
Nabin Hait
e89dce726b fix: improved validation message
(cherry picked from commit fe43dab4d7)
2024-01-08 06:53:10 +00:00
ruthra kumar
83288fedf1 Merge pull request #39187 from ruthra-kumar/backport_37613
fix: possible key error in Financial Ratio's report
2024-01-08 12:08:13 +05:30
ruthra kumar
16269b0730 fix: possible key error on Financial ratios report 2024-01-08 11:50:13 +05:30
ruthra kumar
f1d25700a8 Merge pull request #39183 from frappe/mergify/bp/version-15-hotfix/pr-39161
refactor: allow sales invoice in Bank Reconciliation tool (backport #39161)
2024-01-08 11:09:42 +05:30
ruthra kumar
00d36d14fb refactor: allow sales invoice in Bank Reconciliation tool
(cherry picked from commit b69cdeb4a6)
2024-01-08 05:02:30 +00:00
ruthra kumar
c912e4c99d Merge pull request #39182 from frappe/mergify/bp/version-15-hotfix/pr-39165
fix: incorrect outstanding amt validation on advance as liability (backport #39165)
2024-01-08 10:31:17 +05:30
ruthra kumar
1eee52c59c Merge pull request #39181 from frappe/mergify/bp/version-15-hotfix/pr-39159
refactor: prevent permission error by always processing bulk transaction in background (backport #39159)
2024-01-08 10:30:48 +05:30
ruthra kumar
51d8a7a0c1 fix: incorrect outstanding amt validation on advance as liability
(cherry picked from commit 4cc3c1b765)
2024-01-08 04:45:03 +00:00
ruthra kumar
f0bc0aa676 refactor: prevent permissions by always processing in background
(cherry picked from commit 15dc5c7e99)
2024-01-08 04:43:11 +00:00
mergify[bot]
f3882a854f fix: don't set rate for non-stock item in Internal Transfer (backport #39140) (#39169)
* fix: don't set rate for non-stock item in Internal Transfer

(cherry picked from commit e1b0fffd0c)

* test: internal transfer for non-stock item

(cherry picked from commit 57b6a98703)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-01-06 11:03:24 +05:30
Aulia Bismar
5e4693763a fix: Creating Asset Activity while Importing Asset (#39113)
* fix: import asset not working on activity

* chore: fix linting issue in asset_activity.py

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2024-01-05 10:46:31 +05:30
mergify[bot]
82b96d3688 fix: inventory dimension negative stock validation (backport #39149) (#39151)
fix: inventory dimension negative stock validation (#39149)

(cherry picked from commit bae7c64964)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-01-05 05:04:28 +05:30
Raffael Meyer
0454dede92 Merge pull request #39148 from frappe/mergify/bp/version-15-hotfix/pr-39126
fix(Employee): treeview (backport #39126)
2024-01-04 15:24:43 +01:00
Raffael Meyer
6020c8e8f7 fix(Employee): treeview (#39126)
(cherry picked from commit e912e9597d)
2024-01-04 12:34:52 +00:00
mergify[bot]
b192ddd13b feat: provision to close SCO (backport #39127) (#39144)
* feat: provision to close SCO

(cherry picked from commit 5e2669f4b6)

* fix: don't allow to submit/cancel SCR against a closed SCO

(cherry picked from commit 9e973476b2)

* fix: don't allow to submit/cancel SE against a closed SCO

(cherry picked from commit 5bc2035bd0)

* fix(ux): filter closed SCO in `Get Items From` dialog

(cherry picked from commit bb839b2924)

* fix: don't close PO on SCO close

(cherry picked from commit 0d01bd8a5a)

* fix: update qty on SCO status change

(cherry picked from commit 245effcccd)

* fix: don't allow to reopen SCO if PO is closed

(cherry picked from commit 784b6dcfea)

* fix: auto close and reopen SCO based on PO status

(cherry picked from commit 0819675fce)

* fix(text): test_update_status

(cherry picked from commit cdd5441435)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2024-01-04 17:22:58 +05:30
mergify[bot]
2db1e1a737 fix: serial / batch barcode scanner (backport #39114) (#39143)
fix: serial / batch barcode scanner (#39114)

(cherry picked from commit f09e2130a1)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-01-04 16:02:29 +05:30
Deepesh Garg
7a5a4be02f Merge pull request #39137 from frappe/mergify/bp/version-15-hotfix/pr-39125
fix: ignore cancelled payments in Sales/Purchase Register (#39125)
2024-01-04 11:25:39 +05:30
Deepesh Garg
b834abbd4f Merge pull request #39139 from frappe/mergify/bp/version-15-hotfix/pr-39138
fix: Subscription update patch (#39138)
2024-01-04 11:25:21 +05:30
Deepesh Garg
7640feaaa7 fix: Subscription update patch
(cherry picked from commit 277dade9f9)
2024-01-04 05:54:51 +00:00
ruthra kumar
9e1b443857 fix: ignore cancelled payments in Sales/Purchase Register
(cherry picked from commit 0f1be03faf)
2024-01-04 05:45:52 +00:00
Deepesh Garg
18575e137c Merge pull request #39129 from monolithonadmin/version-15-hotfix
fix: Add name to Hungary - Chart of Accounts for Microenterprises json
2024-01-04 08:42:03 +05:30
Monolithonadmin
0784488eec fix: Add name to Hungary - Chart of Accounts for Microenterprises json 2024-01-03 20:52:30 +01:00
Frappe PR Bot
290397172e chore(release): Bumped to Version 15.9.1
## [15.9.1](https://github.com/frappe/erpnext/compare/v15.9.0...v15.9.1) (2024-01-03)

### Bug Fixes

* typerror on multi select dialog ([5ee6cc4](5ee6cc4bac))
2024-01-03 15:37:59 +00:00
ruthra kumar
e3c473482b Merge pull request #39124 from frappe/mergify/bp/version-15/pr-39116
fix: typerror on multi select dialog (backport #39116)
2024-01-03 21:06:50 +05:30
ruthra kumar
bc529b51dc Merge pull request #39122 from frappe/mergify/bp/version-15-hotfix/pr-39116
fix: typerror on multi select dialog (backport #39116)
2024-01-03 21:06:06 +05:30
ruthra kumar
5ee6cc4bac fix: typerror on multi select dialog
(cherry picked from commit 7da9ffa3bd)
2024-01-03 15:26:21 +00:00
ruthra kumar
54a0df5164 fix: typerror on multi select dialog
(cherry picked from commit 7da9ffa3bd)
2024-01-03 15:25:24 +00:00
mergify[bot]
40ec5ff90f fix(UX): dont override framework's permission check messages (backport #39118) (#39120)
fix(UX): dont override framework's permission check messages (#39118)

(cherry picked from commit e84c9f7c51)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2024-01-03 20:32:52 +05:30
Ankush Menat
aad39cf686 fix: Ignore UP on "allowed to transact with" (#39103)
If a customer is allowed to transact with some company it usually
doesn't imply that customer is somehow "linked with" that company.
2024-01-03 13:13:24 +05:30
Frappe PR Bot
3eac0e907e chore(release): Bumped to Version 15.9.0
# [15.9.0](https://github.com/frappe/erpnext/compare/v15.8.3...v15.9.0) (2024-01-03)

### Bug Fixes

* auto fetch not working if bundle exists (backport [#39002](https://github.com/frappe/erpnext/issues/39002)) ([#39004](https://github.com/frappe/erpnext/issues/39004)) ([2e91934](2e919344df))
* **DX:** capture tracebacks with context (backport [#39060](https://github.com/frappe/erpnext/issues/39060)) ([#39063](https://github.com/frappe/erpnext/issues/39063)) ([8ad7faf](8ad7fafe2a))
* enqueue demo data setup on setup complete (backport [#39043](https://github.com/frappe/erpnext/issues/39043)) ([#39044](https://github.com/frappe/erpnext/issues/39044)) ([d8cf994](d8cf994e94))
* incorrect total when Accumulating values ([7c7c3c9](7c7c3c932f))
* Multiple subscription fixes ([#39005](https://github.com/frappe/erpnext/issues/39005)) ([5158884](5158884dc9))
* non stock uom validation for serial and batch (backport [#39018](https://github.com/frappe/erpnext/issues/39018)) ([#39026](https://github.com/frappe/erpnext/issues/39026)) ([89d1069](89d1069472))
* not able to cancel sales invoice (backport [#38979](https://github.com/frappe/erpnext/issues/38979)) ([#38980](https://github.com/frappe/erpnext/issues/38980)) ([f8625f3](f8625f3eb7))
* on cancellation of document cancel the serial and batch bundle (backport [#39076](https://github.com/frappe/erpnext/issues/39076)) ([#39082](https://github.com/frappe/erpnext/issues/39082)) ([2e0abbd](2e0abbd274))
* Opening balance in bank reconciliation tool ([#38977](https://github.com/frappe/erpnext/issues/38977)) ([e0755f9](e0755f9a9a))
* purchase return without item code not working (backport [#39014](https://github.com/frappe/erpnext/issues/39014)) ([#39015](https://github.com/frappe/erpnext/issues/39015)) ([2a390ac](2a390ac2de))
* remove bad defaults (backport [#38986](https://github.com/frappe/erpnext/issues/38986)) ([#38988](https://github.com/frappe/erpnext/issues/38988)) ([46035ed](46035ed9ca))
* select options should dynamically load dimensions ([21f9001](21f90011bc))
* serial and batch bundle company mandatory error (backport [#38994](https://github.com/frappe/erpnext/issues/38994)) ([#38999](https://github.com/frappe/erpnext/issues/38999)) ([d2580be](d2580be4fd))
* take quantity into account when setting asset's gross purchase amt (backport [#39056](https://github.com/frappe/erpnext/issues/39056)) ([#39058](https://github.com/frappe/erpnext/issues/39058)) ([2e93275](2e932754e0))
* Unable to save Sales Invoice ([#39059](https://github.com/frappe/erpnext/issues/39059)) ([73c0f37](73c0f3703c))
* undefined error in Budget Variance and Profitability report ([9fdf5c8](9fdf5c8091))
* undefined error in consolidated financial report ([49f93f9](49f93f9fa1))
* use `Stock Qty` while getting `POS Reserved Qty` (backport [#38962](https://github.com/frappe/erpnext/issues/38962)) ([#38965](https://github.com/frappe/erpnext/issues/38965)) ([76c6b50](76c6b501f9))
* Validate account in Sales/Purchase Taxes and Charges Template ([#39013](https://github.com/frappe/erpnext/issues/39013)) ([f3254c2](f3254c2010))
* work order with multi level, fetch operting cost from sub-assembly (backport [#38992](https://github.com/frappe/erpnext/issues/38992)) ([#39028](https://github.com/frappe/erpnext/issues/39028)) ([3a7506e](3a7506ecbc))

### Features

* Against voucher filter in General Ledger ([#39102](https://github.com/frappe/erpnext/issues/39102)) ([458064f](458064f8a1))
* group by Asset in Asset Depreciations and Balances report (backport [#38923](https://github.com/frappe/erpnext/issues/38923)) ([#39066](https://github.com/frappe/erpnext/issues/39066)) ([d85dad7](d85dad7198))
* Merge taxes from mapped docs ([#38346](https://github.com/frappe/erpnext/issues/38346)) ([4e23048](4e2304818b))
* voucher subtype for general ledger ([#38822](https://github.com/frappe/erpnext/issues/38822)) ([e5d73c7](e5d73c780b))

### Performance Improvements

* index item_code in bom explosion item (backport [#39085](https://github.com/frappe/erpnext/issues/39085)) ([#39088](https://github.com/frappe/erpnext/issues/39088)) ([57bcf9f](57bcf9f568))
2024-01-03 06:01:15 +00:00
Deepesh Garg
d2fdce007e Merge pull request #39090 from frappe/version-15-hotfix
chore: release v15
2024-01-03 11:29:39 +05:30
Deepesh Garg
458064f8a1 feat: Against voucher filter in General Ledger (#39102) 2024-01-03 10:51:34 +05:30
rohitwaghchaure
56d510b878 Merge branch 'version-15' into version-15-hotfix 2024-01-02 17:34:56 +05:30
mergify[bot]
57bcf9f568 perf: index item_code in bom explosion item (backport #39085) (#39088)
perf: index item_code in bom explosion item (#39085)

(cherry picked from commit 739434b727)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2024-01-02 14:43:10 +05:30
mergify[bot]
2e0abbd274 fix: on cancellation of document cancel the serial and batch bundle (backport #39076) (#39082)
fix: on cancellation of document cancel the serial and batch bundle (#39076)

(cherry picked from commit 6e5484ea03)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2024-01-02 13:28:43 +05:30
mergify[bot]
73c0f3703c fix: Unable to save Sales Invoice (#39059)
fix: Unable to save Sales Invoice (#39059)

(cherry picked from commit bacf2b7431)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2024-01-01 19:28:29 +05:30
ruthra kumar
f3088e08bb Merge pull request #39072 from frappe/mergify/bp/version-15-hotfix/pr-39067
fix: undefined error in Budget Variance and Profitability report (backport #39067)
2024-01-01 17:42:45 +05:30
ruthra kumar
21f90011bc fix: select options should dynamically load dimensions
(cherry picked from commit 1a9e091d12)
2024-01-01 12:08:10 +00:00
ruthra kumar
9fdf5c8091 fix: undefined error in Budget Variance and Profitability report
'Budget' and 'Budget Account' doesn't have support for dynamic
dimension. It only supports hard-coded ones -  Project and Cost Center

(cherry picked from commit 92bc962f60)
2024-01-01 12:08:10 +00:00
ruthra kumar
7539623fb9 Merge pull request #39069 from frappe/mergify/bp/version-15-hotfix/pr-39023
refactor(perf): replace account subquery with 'in' condition (backport #39023)
2024-01-01 16:29:25 +05:30
ruthra kumar
cbaa617d20 refactor(perf): replace account subquery with 'in' condition
(cherry picked from commit a517125d64)
2024-01-01 10:13:51 +00:00
mergify[bot]
d85dad7198 feat: group by Asset in Asset Depreciations and Balances report (backport #38923) (#39066)
feat: group by Asset in Asset Depreciations and Balances report (#38923)

feat: group by asset in asset depreciations and balances report
(cherry picked from commit a9576f0cf6)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2024-01-01 15:05:04 +05:30
mergify[bot]
e5d73c780b feat: voucher subtype for general ledger (#38822)
* feat: voucher subtype for general ledger (#38822)

* feat: add voucher subtype column to gle

* feat: add logic to set voucher subtypes

* feat: fetch voucher subtype in ledger report

* fix: order of conditions

(cherry picked from commit 47f7b65058)

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

* chore: resolve conflicts

---------

Co-authored-by: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com>
Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2024-01-01 13:30:29 +05:30
mergify[bot]
8ad7fafe2a fix(DX): capture tracebacks with context (backport #39060) (#39063)
fix(DX): capture tracebacks with context (#39060)

(cherry picked from commit 510fdf7bf6)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2024-01-01 13:12:07 +05:30
mergify[bot]
2e932754e0 fix: take quantity into account when setting asset's gross purchase amt (backport #39056) (#39058)
fix: take quantity into account when setting asset's gross purchase amt (#39056)

fix: take quantity into account when setting asset's gross purchase amount
(cherry picked from commit 0346f47c1d)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2024-01-01 11:27:55 +05:30
mergify[bot]
d8cf994e94 fix: enqueue demo data setup on setup complete (backport #39043) (#39044)
fix: enqueue demo data setup on setup complete (#39043)

(cherry picked from commit 877cc7255d)

Co-authored-by: Smit Vora <smitvora203@gmail.com>
2023-12-31 18:25:15 +05:30
mergify[bot]
89d1069472 fix: non stock uom validation for serial and batch (backport #39018) (#39026)
fix: non stock uom validation for serial and batch (#39018)

* fix: non stock uom validation for serial and batch

* test: delivery note for batch with non stock uom

(cherry picked from commit 0c6de4ecb2)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-29 20:54:49 +05:30
mergify[bot]
3a7506ecbc fix: work order with multi level, fetch operting cost from sub-assembly (backport #38992) (#39028)
fix: work order with multi level, fetch operting cost from sub-assembly (#38992)

(cherry picked from commit 70abedc57a)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-29 20:54:26 +05:30
mergify[bot]
f3254c2010 fix: Validate account in Sales/Purchase Taxes and Charges Template (#39013)
fix: Validate account in Sales/Purchase Taxes and Charges Template (#39013)

(cherry picked from commit cd37fd790b)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-12-29 16:16:02 +05:30
mergify[bot]
2a390ac2de fix: purchase return without item code not working (backport #39014) (#39015)
fix: purchase return without item code not working (#39014)

(cherry picked from commit f983e09f92)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-29 13:07:38 +05:30
mergify[bot]
5158884dc9 fix: Multiple subscription fixes (#39005)
fix: Multiple subscription fixes (#39005)

(cherry picked from commit 3b4b2275de)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-12-29 12:52:41 +05:30
Frappe PR Bot
ec436c18a3 chore(release): Bumped to Version 15.8.3
## [15.8.3](https://github.com/frappe/erpnext/compare/v15.8.2...v15.8.3) (2023-12-28)

### Bug Fixes

* auto fetch not working if bundle exists (backport [#39002](https://github.com/frappe/erpnext/issues/39002)) (backport [#39004](https://github.com/frappe/erpnext/issues/39004)) ([#39006](https://github.com/frappe/erpnext/issues/39006)) ([17bae5a](17bae5a5a1))
* serial and batch bundle company mandatory error (backport [#38994](https://github.com/frappe/erpnext/issues/38994)) (backport [#38999](https://github.com/frappe/erpnext/issues/38999)) ([#39003](https://github.com/frappe/erpnext/issues/39003)) ([027a75b](027a75bcb0))
2023-12-28 13:31:04 +00:00
mergify[bot]
17bae5a5a1 fix: auto fetch not working if bundle exists (backport #39002) (backport #39004) (#39006)
fix: auto fetch not working if bundle exists (backport #39002) (#39004)

fix: auto fetch not working if bundle exists (#39002)

(cherry picked from commit b5340c5ec0)

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-12-28 18:59:38 +05:30
mergify[bot]
027a75bcb0 fix: serial and batch bundle company mandatory error (backport #38994) (backport #38999) (#39003)
fix: serial and batch bundle company mandatory error (backport #38994) (#38999)

fix: serial and batch bundle company mandatory error (#38994)

(cherry picked from commit 10074e9980)

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-12-28 18:59:20 +05:30
mergify[bot]
2e919344df fix: auto fetch not working if bundle exists (backport #39002) (#39004)
fix: auto fetch not working if bundle exists (#39002)

(cherry picked from commit b5340c5ec0)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-28 18:54:38 +05:30
mergify[bot]
d2580be4fd fix: serial and batch bundle company mandatory error (backport #38994) (#38999)
fix: serial and batch bundle company mandatory error (#38994)

(cherry picked from commit 10074e9980)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-28 18:22:14 +05:30
mergify[bot]
e0755f9a9a fix: Opening balance in bank reconciliation tool (#38977)
fix: Opening balance in bank reconciliation tool (#38977)

(cherry picked from commit bbee9b5637)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-12-28 17:53:44 +05:30
Frappe PR Bot
c4794c95df chore(release): Bumped to Version 15.8.2
## [15.8.2](https://github.com/frappe/erpnext/compare/v15.8.1...v15.8.2) (2023-12-28)

### Bug Fixes

* undefined error in consolidated financial report ([0a3e378](0a3e378f5e))
2023-12-28 12:16:55 +00:00
ruthra kumar
12c5f0b6b5 Merge pull request #38996 from frappe/mergify/bp/version-15/pr-38995
fix: undefined error in consolidated financial report (backport #38995)
2023-12-28 17:45:35 +05:30
ruthra kumar
0a3e378f5e fix: undefined error in consolidated financial report
(cherry picked from commit 49f93f9fa1)
2023-12-28 12:13:20 +00:00
ruthra kumar
1b399e83be Merge pull request #38995 from ruthra-kumar/undefined_error_in_consolidated_report
fix: undefined error in consolidated financial report
2023-12-28 17:42:18 +05:30
ruthra kumar
49f93f9fa1 fix: undefined error in consolidated financial report 2023-12-28 17:36:00 +05:30
ruthra kumar
d2fe221bc7 Merge pull request #38990 from frappe/mergify/bp/version-15-hotfix/pr-38969
fix: incorrect net profit in Profit and Loss Statement (backport #38969)
2023-12-28 17:09:43 +05:30
ruthra kumar
a3cecb892a test: profit and loss report output
(cherry picked from commit 8555617295)
2023-12-28 10:54:27 +00:00
ruthra kumar
7c7c3c932f fix: incorrect total when Accumulating values
(cherry picked from commit d54f8318fb)
2023-12-28 10:54:27 +00:00
mergify[bot]
46035ed9ca fix: remove bad defaults (backport #38986) (#38988)
fix: remove bad defaults (#38986)

Child tables can't have a default.

(cherry picked from commit b71b0d5997)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-12-28 14:22:18 +05:30
Frappe PR Bot
7e7eb95934 chore(release): Bumped to Version 15.8.1
## [15.8.1](https://github.com/frappe/erpnext/compare/v15.8.0...v15.8.1) (2023-12-28)

### Bug Fixes

* not able to cancel sales invoice (backport [#38979](https://github.com/frappe/erpnext/issues/38979)) (backport [#38980](https://github.com/frappe/erpnext/issues/38980)) ([#38981](https://github.com/frappe/erpnext/issues/38981)) ([83e62bb](83e62bbaad))
2023-12-28 05:55:23 +00:00
mergify[bot]
83e62bbaad fix: not able to cancel sales invoice (backport #38979) (backport #38980) (#38981)
fix: not able to cancel sales invoice (backport #38979) (#38980)

fix: not able to cancel sales invoice (#38979)

(cherry picked from commit a117ef3cb8)

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-12-28 11:24:16 +05:30
mergify[bot]
f8625f3eb7 fix: not able to cancel sales invoice (backport #38979) (#38980)
fix: not able to cancel sales invoice (#38979)

(cherry picked from commit a117ef3cb8)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-28 11:21:51 +05:30
mergify[bot]
4e2304818b feat: Merge taxes from mapped docs (#38346)
feat: Merge taxes from mapped docs (#38346)

* feat: Merge taxes from mapped docs

* chore: ci failures

(cherry picked from commit 9b1c22250f)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
2023-12-28 08:28:02 +05:30
mergify[bot]
3caabf23a5 fix : correct logic for overlap error (backport #38967) (#38968)
fix : correct logic for overlap error (#38967)

fixing overlap error logic with taking care of sequential time job cards in overlap job card list

(cherry picked from commit fe77b9d633)

Co-authored-by: VihangT <151990347+VihangT@users.noreply.github.com>
2023-12-27 20:40:03 +05:30
mergify[bot]
76c6b501f9 fix: use Stock Qty while getting POS Reserved Qty (backport #38962) (#38965)
fix: use `Stock Qty` while getting `POS Reserved Qty`

(cherry picked from commit 7223106417)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-27 15:31:58 +05:30
Frappe PR Bot
f3ab5a33c7 chore(release): Bumped to Version 15.8.0
# [15.8.0](https://github.com/frappe/erpnext/compare/v15.7.0...v15.8.0) (2023-12-27)

### Bug Fixes

* `Reserved Stock` report (backport [#38922](https://github.com/frappe/erpnext/issues/38922)) ([#38924](https://github.com/frappe/erpnext/issues/38924)) ([8f643f0](8f643f0df8))
* allow to set rate manually for service item in BOM (backport [#38880](https://github.com/frappe/erpnext/issues/38880)) (backport [#38882](https://github.com/frappe/erpnext/issues/38882)) ([#38885](https://github.com/frappe/erpnext/issues/38885)) ([74606dc](74606dc927))
* do not make serial batch bundle for zero qty (backport [#38949](https://github.com/frappe/erpnext/issues/38949)) ([#38954](https://github.com/frappe/erpnext/issues/38954)) ([a41cf62](a41cf62437))
* do not reset the basic rate for the material receipt stock entry (backport [#38896](https://github.com/frappe/erpnext/issues/38896)) ([#38899](https://github.com/frappe/erpnext/issues/38899)) ([f6eb2b5](f6eb2b521d))
* incorrect price list in customer-wise item price report ([e0dbb57](e0dbb573b1))
* incorrect qty in serial batch bundle against pick list (backport [#38964](https://github.com/frappe/erpnext/issues/38964)) ([#38966](https://github.com/frappe/erpnext/issues/38966)) ([5874be0](5874be0f79))
* local reference error in BOM (backport [#38850](https://github.com/frappe/erpnext/issues/38850)) ([#38877](https://github.com/frappe/erpnext/issues/38877)) ([e3be9c1](e3be9c1da4))
* min order qty optional in production plan (backport [#38956](https://github.com/frappe/erpnext/issues/38956)) ([#38958](https://github.com/frappe/erpnext/issues/38958)) ([ab9fce3](ab9fce333d))
* not able to import serial batch bundle using csv (backport [#38950](https://github.com/frappe/erpnext/issues/38950)) ([#38955](https://github.com/frappe/erpnext/issues/38955)) ([0e48ef7](0e48ef7ace))
* reposting not fixing valuation rate for sales return using movin… (backport [#38895](https://github.com/frappe/erpnext/issues/38895)) (backport [#38897](https://github.com/frappe/erpnext/issues/38897)) ([#38901](https://github.com/frappe/erpnext/issues/38901)) ([eabb956](eabb956aca))
* reset the incoming rate on changing of the warehouse (backport [#38925](https://github.com/frappe/erpnext/issues/38925)) ([#38926](https://github.com/frappe/erpnext/issues/38926)) ([82960e3](82960e3312))
* **test:** expect account currency when party account is specified. ([2d9a0a8](2d9a0a8e2e))
* typeerror on pos order summary to new order screen ([bf98a8f](bf98a8f855))
* typerror on tree doctypes - Item Group, Customer Group, Supplier Group and Territory (backport [#38870](https://github.com/frappe/erpnext/issues/38870)) ([#38871](https://github.com/frappe/erpnext/issues/38871)) ([d75ac13](d75ac136d7))
* use party account currency when party account is specified ([32d3d4e](32d3d4e571))
* **ux:** make PR and PI Item rate field readonly based on `Maintain Same Rate` (backport [#38942](https://github.com/frappe/erpnext/issues/38942)) ([#38944](https://github.com/frappe/erpnext/issues/38944)) ([f704ccb](f704ccbb59))

### Features

* in_party_currency option for AR/AP reports ([a65bc77](a65bc77b02))
* provision to add items in Stock Reservation dialog (backport [#38558](https://github.com/frappe/erpnext/issues/38558)) ([#38920](https://github.com/frappe/erpnext/issues/38920)) ([8c2c90f](8c2c90f77a))
* total_asset_cost field (backport [#38879](https://github.com/frappe/erpnext/issues/38879)) ([#38887](https://github.com/frappe/erpnext/issues/38887)) ([58f1df5](58f1df5004))

### Performance Improvements

* Drop unused/duplicate/sub-optimal indexes (backport [#38884](https://github.com/frappe/erpnext/issues/38884)) ([#38913](https://github.com/frappe/erpnext/issues/38913)) ([308c6ff](308c6ffb4f))
* use estimated rows instead of actual rows (backport [#38830](https://github.com/frappe/erpnext/issues/38830)) ([#38876](https://github.com/frappe/erpnext/issues/38876)) ([648f275](648f275797))
2023-12-27 08:41:36 +00:00
rohitwaghchaure
e2bf03bdb2 Merge pull request #38952 from frappe/version-15-hotfix
chore: release v15
2023-12-27 14:10:09 +05:30
mergify[bot]
5874be0f79 fix: incorrect qty in serial batch bundle against pick list (backport #38964) (#38966)
fix: incorrect qty in serial batch bundle against pick list (#38964)

(cherry picked from commit 47ee801d37)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-27 14:06:55 +05:30
mergify[bot]
ab9fce333d fix: min order qty optional in production plan (backport #38956) (#38958)
fix: min order qty optional in production plan (#38956)

* fix: min order qty optional in production plan

* fix: test cases

(cherry picked from commit b09c9354fb)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-26 21:55:23 +05:30
mergify[bot]
0e48ef7ace fix: not able to import serial batch bundle using csv (backport #38950) (#38955)
* fix: not able to import serial batch bundle using csv (#38950)

(cherry picked from commit d00f6672a8)

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

* chore: fixed conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-26 16:29:34 +05:30
mergify[bot]
a41cf62437 fix: do not make serial batch bundle for zero qty (backport #38949) (#38954)
fix: do not make serial batch bundle for zero qty (#38949)

(cherry picked from commit 06d6220a2a)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-26 15:39:00 +05:30
mergify[bot]
f704ccbb59 fix(ux): make PR and PI Item rate field readonly based on Maintain Same Rate (backport #38942) (#38944)
* fix(ux): make PI Item rate field editable

(cherry picked from commit eb5bb9f9a9)

* fix(ux): make PI Item rate field readonly based on `Maintain Same Rate`

(cherry picked from commit cb9114442b)

* fix(ux): make PR Item rate field readonly based on `Maintain Same Rate`

(cherry picked from commit b1ba210332)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-26 14:45:05 +05:30
ruthra kumar
1ea8574be9 Merge pull request #38946 from frappe/mergify/bp/version-15-hotfix/pr-38891
fix: incorrect price list in customer-wise item price report (backport #38891)
2023-12-26 12:16:55 +05:30
ruthra kumar
e0dbb573b1 fix: incorrect price list in customer-wise item price report
(cherry picked from commit 9a00edb031)
2023-12-26 06:17:54 +00:00
mergify[bot]
82960e3312 fix: reset the incoming rate on changing of the warehouse (backport #38925) (#38926)
fix: reset the incoming rate on changing of the warehouse (#38925)

(cherry picked from commit 161ae1edd1)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-22 17:55:58 +05:30
mergify[bot]
8f643f0df8 fix: Reserved Stock report (backport #38922) (#38924)
* chore: improve `Allowed Qty` error msg

(cherry picked from commit 1a1629196d)

* fix: `Reserved Stock` report

(cherry picked from commit a5d5223c0e)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-22 16:45:40 +05:30
mergify[bot]
8c2c90f77a feat: provision to add items in Stock Reservation dialog (backport #38558) (#38920)
* feat: provision to update items in Stock Reservation dialog

(cherry picked from commit 9471d8fff9)

* fix(ux): show row index and field label while selecting the Sales Order Item

(cherry picked from commit 00261094c8)

* feat: provision to add items in Stock Reservation dialog

(cherry picked from commit 8d5045ef4c)

---------

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-22 15:50:07 +05:30
mergify[bot]
a8f3f2343d chore: fixup broken JSON files (backport #38915) (#38917)
chore: fixup broken JSON files (#38915)

(cherry picked from commit 2dc49c834a)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-12-22 07:41:00 +05:30
mergify[bot]
308c6ffb4f perf: Drop unused/duplicate/sub-optimal indexes (backport #38884) (#38913)
perf: Drop unused/duplicate/sub-optimal indexes (#38884)

* ci: enable more checks

* perf: Drop unused/duplicate indexes

(cherry picked from commit 787333896c)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-12-21 21:39:20 +05:30
mergify[bot]
a99470e017 chore: additional_asset_cost field (backport #38904) (#38906)
chore: additional_asset_cost field (#38904)

(cherry picked from commit 283763dfb2)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-12-21 16:55:41 +05:30
mergify[bot]
eabb956aca fix: reposting not fixing valuation rate for sales return using movin… (backport #38895) (backport #38897) (#38901)
fix: reposting not fixing valuation rate for sales return using movin… (backport #38895) (#38897)

* fix: reposting not fixing valuation rate for sales return using movin… (#38895)

fix: reposting not fixing valuation rate for sales return using moving average method
(cherry picked from commit 3a668bbe96)

# Conflicts:
#	erpnext/stock/stock_ledger.py

* chore: fix conflicts

---------

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-12-21 15:44:50 +05:30
mergify[bot]
f6eb2b521d fix: do not reset the basic rate for the material receipt stock entry (backport #38896) (#38899)
fix: do not reset the basic rate for the material receipt stock entry (#38896)

(cherry picked from commit 98bfcc4c75)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-21 14:22:53 +05:30
ruthra kumar
135aced98e Merge pull request #38894 from frappe/mergify/bp/version-15-hotfix/pr-38893
fix: typeerror on pos order summary to new order screen (backport #38893)
2023-12-21 12:26:04 +05:30
ruthra kumar
bf98a8f855 fix: typeerror on pos order summary to new order screen
(cherry picked from commit 6a0a08b59c)
2023-12-21 06:53:22 +00:00
mergify[bot]
74606dc927 fix: allow to set rate manually for service item in BOM (backport #38880) (backport #38882) (#38885)
fix: allow to set rate manually for service item in BOM (backport #38880) (#38882)

fix: allow to set rate manually for service item in BOM (#38880)

(cherry picked from commit c2f692a4e4)

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-12-21 10:44:20 +05:30
mergify[bot]
58f1df5004 feat: total_asset_cost field (backport #38879) (#38887)
* feat: total_asset_cost field (#38879)

(cherry picked from commit d370c60a6c)

# Conflicts:
#	erpnext/patches.txt

* chore: resolve conflicts

* chore: remove unnecessary patch

---------

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-12-20 22:47:48 +05:30
mergify[bot]
e3be9c1da4 fix: local reference error in BOM (backport #38850) (#38877)
fix: local reference error in BOM (#38850)

fix: local reference error
(cherry picked from commit ae353398d9)

Co-authored-by: NIYAZ RAZAK <76736615+niyazrazak@users.noreply.github.com>
2023-12-20 16:34:27 +05:30
mergify[bot]
648f275797 perf: use estimated rows instead of actual rows (backport #38830) (#38876)
perf: use estimated rows instead of actual rows (#38830)

(cherry picked from commit 9983283f95)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-12-20 13:58:38 +05:30
ruthra kumar
4626ab5e19 Merge pull request #38873 from frappe/mergify/bp/version-15-hotfix/pr-38838
fix: use party account currency when party account is specified (backport #38838)
2023-12-20 13:09:15 +05:30
Devin Slauenwhite
2d9a0a8e2e fix(test): expect account currency when party account is specified.
(cherry picked from commit a09241e3c7)
2023-12-20 07:05:32 +00:00
Devin Slauenwhite
32d3d4e571 fix: use party account currency when party account is specified
(cherry picked from commit c7b961ffa2)
2023-12-20 07:05:32 +00:00
mergify[bot]
d75ac136d7 fix: typerror on tree doctypes - Item Group, Customer Group, Supplier Group and Territory (backport #38870) (#38871)
fix: typerror on tree doctypes - Item Group, Customer Group, Supplier Group and Territory (#38870)

* refactor: typerror on set_root_readonly

* refactor: remove 'cur_frm' usage in supplier_group

* refactor: remove 'cur_frm' usage in territory.js

* refactor: remove 'cur_frm' from sales_person.js

(cherry picked from commit 6d5bdc6c68)

Co-authored-by: ruthra kumar <ruthra@erpnext.com>
2023-12-20 12:32:35 +05:30
ruthra kumar
88b3811c5d Merge pull request #38839 from pps190/backport/version-15/37746
feat: in_party_currency option for AR/AP reports (backport  #37746)
2023-12-20 12:25:11 +05:30
Frappe PR Bot
2a5164d170 chore(release): Bumped to Version 15.7.0
# [15.7.0](https://github.com/frappe/erpnext/compare/v15.6.1...v15.7.0) (2023-12-20)

### Bug Fixes

* asset patch failure due to missing shift_based column (backport [#38776](https://github.com/frappe/erpnext/issues/38776)) ([#38777](https://github.com/frappe/erpnext/issues/38777)) ([6e92c78](6e92c78cbd))
* barcode scanning for the stock entry (backport [#38716](https://github.com/frappe/erpnext/issues/38716)) ([#38718](https://github.com/frappe/erpnext/issues/38718)) ([1dcb065](1dcb065c64))
* **demo:** Demo setup for canadian COA ([7d84441](7d844411fb))
* fetch exc rate of multi currency journals ([f55b561](f55b561ff9))
* fetch item_tax_template values if fields with fetch_from exisit ([fba28d6](fba28d6941))
* groups for current accounts in German CoAs ([58de991](58de9913b9))
* homepage not working (backport [#38755](https://github.com/frappe/erpnext/issues/38755)) ([#38756](https://github.com/frappe/erpnext/issues/38756)) ([ad3a5b5](ad3a5b58e4))
* if not budget then don't validate (backport [#38861](https://github.com/frappe/erpnext/issues/38861)) ([#38865](https://github.com/frappe/erpnext/issues/38865)) ([5ec75fb](5ec75fb6df))
* incoming rate for sales return with Moving Average valuation method (backport [#38849](https://github.com/frappe/erpnext/issues/38849)) (backport [#38863](https://github.com/frappe/erpnext/issues/38863)) ([#38866](https://github.com/frappe/erpnext/issues/38866)) ([d65be69](d65be69c4c))
* incorrect available qty for backdated stock reco with batch (backport [#37858](https://github.com/frappe/erpnext/issues/37858)) ([#38811](https://github.com/frappe/erpnext/issues/38811)) ([18bd330](18bd330a59))
* Init internal child table values ([7802f6c](7802f6c528))
* item variant with manufacturer (backport [#38845](https://github.com/frappe/erpnext/issues/38845)) (backport [#38847](https://github.com/frappe/erpnext/issues/38847)) ([#38851](https://github.com/frappe/erpnext/issues/38851)) ([7320440](7320440b61))
* not able to cancel SCR with Batch (backport [#38817](https://github.com/frappe/erpnext/issues/38817)) (backport [#38821](https://github.com/frappe/erpnext/issues/38821)) ([#38829](https://github.com/frappe/erpnext/issues/38829)) ([4bd1a5f](4bd1a5f955))
* not able to make inter-company po from so (backport [#38826](https://github.com/frappe/erpnext/issues/38826)) (backport [#38828](https://github.com/frappe/erpnext/issues/38828)) ([#38833](https://github.com/frappe/erpnext/issues/38833)) ([02ceee6](02ceee6669))
* on closed unreserved the production plan qty (backport [#38848](https://github.com/frappe/erpnext/issues/38848)) (backport [#38859](https://github.com/frappe/erpnext/issues/38859)) ([#38862](https://github.com/frappe/erpnext/issues/38862)) ([cbbc6af](cbbc6af128))
* **pe:** show split alert only on splitting ([77dba48](77dba4834c))
* Reset SLA on issue doesn't work (backport [#38789](https://github.com/frappe/erpnext/issues/38789)) ([#38791](https://github.com/frappe/erpnext/issues/38791)) ([2045306](2045306283))
* serial and batch bundle return not working (backport [#38754](https://github.com/frappe/erpnext/issues/38754)) ([#38806](https://github.com/frappe/erpnext/issues/38806)) ([8990c48](8990c48e7b))
* set `fg-itm-qty` based on `qty` instead of the other way round in Subcontracting POs (backport [#38842](https://github.com/frappe/erpnext/issues/38842)) ([#38855](https://github.com/frappe/erpnext/issues/38855)) ([4e27174](4e27174c85))
* show bill_date and bill_no in Purchase Register ([4ed86db](4ed86dbff2))
* skip jvs against bank accounts ([bf8a2d0](bf8a2d0e3a))
* supplier removed on selection of item (backport [#38712](https://github.com/frappe/erpnext/issues/38712)) ([#38713](https://github.com/frappe/erpnext/issues/38713)) ([feb452b](feb452b740))
* timezone aware SLA banner (backport [#38745](https://github.com/frappe/erpnext/issues/38745)) ([#38747](https://github.com/frappe/erpnext/issues/38747)) ([a551660](a551660d2a))
* **ux:** don't override Item Name and Description in MR (backport [#38720](https://github.com/frappe/erpnext/issues/38720)) ([#38763](https://github.com/frappe/erpnext/issues/38763)) ([703be50](703be50bc7))
* validation error on reconciling PE to Journals as Invoice ([aa5e16e](aa5e16e681))
* wrong currency in Stock Balance report (backport [#38778](https://github.com/frappe/erpnext/issues/38778)) ([#38780](https://github.com/frappe/erpnext/issues/38780)) ([7fc8150](7fc8150617))
* wrong paid and cn amount on pos invoice ([cff9e47](cff9e47162))

### Features

* RFQ print preview ([f30bede](f30bede2e0))
* set lead name from email ([f770621](f7706211ea))

### Performance Improvements

* index `return_against` on delivery note (backport [#38827](https://github.com/frappe/erpnext/issues/38827)) ([#38832](https://github.com/frappe/erpnext/issues/38832)) ([6ad75e7](6ad75e72e6))
2023-12-20 04:47:03 +00:00
Deepesh Garg
028228ee12 Merge pull request #38853 from frappe/version-15-hotfix
chore: release v15
2023-12-20 10:15:54 +05:30
mergify[bot]
4e27174c85 fix: set fg-itm-qty based on qty instead of the other way round in Subcontracting POs (backport #38842) (#38855)
fix: set `fg-itm-qty` based on `qty` instead of the other way round

(cherry picked from commit a99d0a65b0)

Co-authored-by: Gughan Ravikumar <gughanrk@gmail.com>
2023-12-20 09:12:20 +05:30
mergify[bot]
d65be69c4c fix: incoming rate for sales return with Moving Average valuation method (backport #38849) (backport #38863) (#38866)
fix: incoming rate for sales return with Moving Average valuation method (backport #38849) (#38863)

* fix: incoming rate for sales return with Moving Average valuation method (#38849)

(cherry picked from commit 7fdac62393)

# Conflicts:
#	erpnext/stock/doctype/delivery_note/test_delivery_note.py

* chore: fix conflicts

---------

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-12-19 19:13:08 +05:30
mergify[bot]
5ec75fb6df fix: if not budget then don't validate (backport #38861) (#38865)
fix: if not budget then don't validate (#38861)

(cherry picked from commit d375164100)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-19 18:30:36 +05:30
mergify[bot]
cbbc6af128 fix: on closed unreserved the production plan qty (backport #38848) (backport #38859) (#38862)
fix: on closed unreserved the production plan qty (backport #38848) (#38859)

fix: on closed unreserved the production plan qty (#38848)

(cherry picked from commit 2184e8ef58)

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-12-19 18:18:40 +05:30
mergify[bot]
7320440b61 fix: item variant with manufacturer (backport #38845) (backport #38847) (#38851)
fix: item variant with manufacturer (backport #38845) (#38847)

* fix: item variant with manufacturer (#38845)

(cherry picked from commit e0c8ff10da)

* chore: fix test case

---------

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-12-19 15:17:54 +05:30
ruthra kumar
637343f751 Merge pull request #38844 from frappe/mergify/bp/version-15-hotfix/pr-38797
fix: wrong paid and cn amount on pos invoice (backport #38797)
2023-12-19 11:33:23 +05:30
Dany Robert
ffb6d65910 test: partial payment for pos invoice
(cherry picked from commit 8772628912)
2023-12-19 05:33:15 +00:00
Dany Robert
cff9e47162 fix: wrong paid and cn amount on pos invoice
(cherry picked from commit 5cb5e09dbb)
2023-12-19 05:33:15 +00:00
Richard Case
dc9b4de976 chore: update tests 2023-12-18 18:13:27 +00:00
Richard Case
a65bc77b02 feat: in_party_currency option for AR/AP reports 2023-12-18 18:13:15 +00:00
mergify[bot]
02ceee6669 fix: not able to make inter-company po from so (backport #38826) (backport #38828) (#38833)
fix: not able to make inter-company po from so (backport #38826) (#38828)

fix: not able to make inter-company po from so (#38826)

(cherry picked from commit 23042dfc3c)

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-12-18 18:31:28 +05:30
mergify[bot]
4bd1a5f955 fix: not able to cancel SCR with Batch (backport #38817) (backport #38821) (#38829)
fix: not able to cancel SCR with Batch (backport #38817) (#38821)

* fix: not able to cancel SCR with Batch (#38817)

(cherry picked from commit fb5090fd3f)

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

* chore: fix test case

* chore: fix test case

* chore: fix test case

* chore: fix test case

---------

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

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-12-18 18:13:15 +05:30
mergify[bot]
6ad75e72e6 perf: index return_against on delivery note (backport #38827) (#38832)
perf: index `return_against` on delivery note (#38827)

There's a multi-column index but that's useful IFF all parts of column
are part of query.

return against on it's own is VERY unique because it's a primary key, we
don't need a multi-column index here.

(cherry picked from commit 8d79365e0d)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-12-18 18:09:42 +05:30
ruthra kumar
c696370cff Merge pull request #38823 from frappe/mergify/bp/version-15-hotfix/pr-38820
refactor: ignore ERR journals in Statment of Accounts (backport #38820)
2023-12-18 16:24:48 +05:30
ruthra kumar
5a807af505 refactor: ignore ERR journals in Statment of Accounts
(cherry picked from commit 39ef75e2d0)
2023-12-18 10:26:30 +00:00
Raffael Meyer
4fe7988249 Merge pull request #38814 from frappe/mergify/bp/version-15-hotfix/pr-38803
fix: groups for current accounts in German CoAs (backport #38803)
2023-12-17 19:52:24 +01:00
barredterra
58de9913b9 fix: groups for current accounts in German CoAs
(cherry picked from commit 259f313af7)
2023-12-17 18:24:07 +00:00
Deepesh Garg
b52ceceeb7 Merge pull request #38808 from vorasmit/fetch-item-taxes-v15
fix: fetch item_tax_template values if fields with fetch_from exisit (#38284)
2023-12-17 18:51:05 +05:30
mergify[bot]
8990c48e7b fix: serial and batch bundle return not working (backport #38754) (#38806)
fix: serial and batch bundle return not working (#38754)

* fix: serial and batch bundle return not working

* test: added test case for delivery note return against denormalized serial no

(cherry picked from commit 0743289925)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-17 18:02:31 +05:30
mergify[bot]
18bd330a59 fix: incorrect available qty for backdated stock reco with batch (backport #37858) (#38811)
fix: incorrect available qty for backdated stock reco with batch (#37858)

* fix: incorrect available qty for backdated stock reco with batch

* test: added test case

(cherry picked from commit d4c0dbfacc)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-17 17:41:51 +05:30
Deepesh Garg
b02604396d Merge pull request #38810 from frappe/mergify/bp/version-15-hotfix/pr-38807
fix(demo): Demo setup for Canadian COA (#38807)
2023-12-17 17:13:54 +05:30
Deepesh Garg
7d844411fb fix(demo): Demo setup for canadian COA
(cherry picked from commit c9fd182268)
2023-12-17 08:35:53 +00:00
Smit Vora
fba28d6941 fix: fetch item_tax_template values if fields with fetch_from exisit 2023-12-17 13:59:22 +05:30
Deepesh Garg
57f7933a4b Merge pull request #38771 from frappe/mergify/bp/version-15-hotfix/pr-38767
fix: skip JVs against bank accounts in tax report (#38767)
2023-12-16 22:28:55 +05:30
mergify[bot]
2045306283 fix: Reset SLA on issue doesn't work (backport #38789) (#38791)
fix: Reset SLA on issue doesn't work (#38789)

This was broken since last refactor where it was spun off to work with
all types of doctypes but client side code was never adapted.

(cherry picked from commit fa1c7b663c)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-12-15 22:02:33 +05:30
Raffael Meyer
4fb479e2f5 Merge pull request #38788 from barredterra/bp-38440
fix(pe): show split alert only on splitting (backport #38440)
2023-12-15 16:26:33 +01:00
Dany Robert
77dba4834c fix(pe): show split alert only on splitting 2023-12-15 16:08:48 +01:00
Raffael Meyer
a70be4299e Merge pull request #38787 from frappe/mergify/bp/version-15-hotfix/pr-38742
fix(Purchase Register): show bill_date and bill_no (backport #38742)
2023-12-15 15:39:45 +01:00
ljain112
4ed86dbff2 fix: show bill_date and bill_no in Purchase Register
(cherry picked from commit f53ba178a8)
2023-12-15 14:25:03 +00:00
Deepesh Garg
63f6970b45 Merge pull request #38783 from frappe/mergify/bp/version-15-hotfix/pr-38691
fix: Init internal child table values (#38691)
2023-12-15 18:48:24 +05:30
Deepesh Garg
7802f6c528 fix: Init internal child table values
(cherry picked from commit 2588970d55)
2023-12-15 12:45:56 +00:00
mergify[bot]
7fc8150617 fix: wrong currency in Stock Balance report (backport #38778) (#38780)
fix: wrong currency in Stock Balance report

(cherry picked from commit 5a83a16e60)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-15 15:32:59 +05:30
mergify[bot]
6e92c78cbd fix: asset patch failure due to missing shift_based column (backport #38776) (#38777)
fix: asset patch failure due to missing shift_based column (#38776)

* fix: add missing daily_prorata_based in get_asset_finance_books_map

* fix: reload Asset Finance Book doctype

(cherry picked from commit 1704180f38)

Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
2023-12-15 14:47:24 +05:30
ruthra kumar
5beea361fe Merge pull request #38775 from frappe/mergify/bp/version-15-hotfix/pr-38766
fix: validation error on reconciling PE to Journals as Invoice (backport #38766)
2023-12-15 14:41:55 +05:30
ruthra kumar
aa5e16e681 fix: validation error on reconciling PE to Journals as Invoice
With the same exchange rate on Journal Entry and Payment Entry,
reconcilition should not post exc gain/loss journal and should not
throw validation error

(cherry picked from commit 5eeb650dfd)
2023-12-15 07:44:08 +00:00
ruthra kumar
27f454d07e Merge pull request #38768 from frappe/mergify/bp/version-15/pr-37625
refactor: set exchange rate on foreign currency JE from Bank Reconciliation (backport #37625)
2023-12-15 13:08:50 +05:30
Gursheen Anand
bf8a2d0e3a fix: skip jvs against bank accounts
(cherry picked from commit f7b2380ec1)
2023-12-15 07:29:30 +00:00
ruthra kumar
d890391531 refactor: handle bank transaction in foreign currency
(cherry picked from commit 74a0d6408a)
2023-12-15 07:06:48 +00:00
ruthra kumar
6e1d9a3dbc refactor: exc rate on foreign currency JE from Bank Reconciliation
(cherry picked from commit 89f484282a)
2023-12-15 07:06:48 +00:00
mergify[bot]
703be50bc7 fix(ux): don't override Item Name and Description in MR (backport #38720) (#38763)
fix(ux): don't override Item Name and Description in MR

(cherry picked from commit 726ac6bda1)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-15 11:58:20 +05:30
ruthra kumar
013d0ff99c Merge pull request #38764 from frappe/mergify/bp/version-15-hotfix/pr-37625
refactor: set exchange rate on foreign currency JE from Bank Reconciliation (backport #37625)
2023-12-15 11:41:04 +05:30
ruthra kumar
b1b157aa19 refactor: handle bank transaction in foreign currency
(cherry picked from commit 74a0d6408a)
2023-12-15 05:51:44 +00:00
ruthra kumar
e7e5727015 refactor: exc rate on foreign currency JE from Bank Reconciliation
(cherry picked from commit 89f484282a)
2023-12-15 05:51:43 +00:00
mergify[bot]
ad3a5b58e4 fix: homepage not working (backport #38755) (#38756)
fix: homepage not working (#38755)

(cherry picked from commit d6201ce5c7)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-14 23:02:25 +05:30
Raffael Meyer
f501c8b336 Merge pull request #38752 from frappe/mergify/bp/version-15-hotfix/pr-38505 2023-12-14 16:38:29 +01:00
barredterra
f7706211ea feat: set lead name from email
(cherry picked from commit ceeb724acc)
2023-12-14 12:49:41 +00:00
mergify[bot]
a551660d2a fix: timezone aware SLA banner (backport #38745) (#38747)
fix: timezone aware SLA banner (#38745)

(cherry picked from commit eaf86a6461)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-12-14 15:59:21 +05:30
ruthra kumar
5cbe170117 Merge pull request #38737 from frappe/mergify/bp/version-15-hotfix/pr-38717
fix: fetch exc rate of multi currency journals on reconciliation (backport #38717)
2023-12-14 09:59:47 +05:30
ruthra kumar
f55b561ff9 fix: fetch exc rate of multi currency journals
(cherry picked from commit 1b3ba25220)
2023-12-14 04:06:48 +00:00
mergify[bot]
753c1aa406 Revert "fix(ux): don't update qty blindly" (backport #38728) (backport #38730) (#38734)
Revert "fix(ux): don't update qty blindly" (backport #38728) (#38730)

Revert "fix(ux): don't update qty blindly" (#38728)

(cherry picked from commit 6851c5042f)

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit 3fabca1051)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-12-14 00:30:18 +05:30
mergify[bot]
3fabca1051 Revert "fix(ux): don't update qty blindly" (backport #38728) (#38730)
Revert "fix(ux): don't update qty blindly" (#38728)

(cherry picked from commit 6851c5042f)

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-12-13 23:16:15 +05:30
Raffael Meyer
32ec73dd96 Merge pull request #38727 from frappe/mergify/bp/version-15-hotfix/pr-38725 2023-12-13 17:48:11 +01:00
barredterra
f30bede2e0 feat: RFQ print preview
(cherry picked from commit 27f05145ae)
2023-12-13 16:32:30 +00:00
mergify[bot]
1dcb065c64 fix: barcode scanning for the stock entry (backport #38716) (#38718)
fix: barcode scanning for the stock entry (#38716)

(cherry picked from commit 13cba5068b)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-13 18:32:48 +05:30
mergify[bot]
feb452b740 fix: supplier removed on selection of item (backport #38712) (#38713)
fix: supplier removed on selection of item (#38712)

(cherry picked from commit db24e24882)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2023-12-13 14:39:00 +05:30
906 changed files with 38618 additions and 25788 deletions

View File

@@ -9,6 +9,13 @@ trim_trailing_whitespace = true
charset = utf-8
# python, js indentation settings
[{*.py,*.js}]
[{*.py,*.js,*.vue,*.css,*.scss,*.html}]
indent_style = tab
indent_size = 4
max_line_length = 110
# JSON files - mostly doctype schema files
[{*.json}]
insert_final_newline = false
indent_style = space
indent_size = 2

View File

@@ -124,6 +124,7 @@
"beforeEach": true,
"onScan": true,
"extend_cscript": true,
"localforage": true
"localforage": true,
"Plaid": true
}
}

View File

@@ -17,7 +17,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 18
node-version: 20
- name: Setup dependencies
run: |

View File

@@ -5,7 +5,7 @@ fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.3.0
hooks:
- id: trailing-whitespace
files: "erpnext.*"
@@ -15,6 +15,27 @@ repos:
args: ['--branch', 'develop']
- id: check-merge-conflict
- id: check-ast
- id: check-json
- id: check-toml
- id: check-yaml
- id: debug-statements
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
types_or: [javascript, vue, scss]
# Ignore any files that might contain jinja / bundles
exclude: |
(?x)^(
erpnext/public/dist/.*|
cypress/.*|
.*node_modules.*|
.*boilerplate.*|
erpnext/public/js/controllers/.*|
erpnext/templates/pages/order.js|
erpnext/templates/includes/.*
)$
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.44.0

View File

@@ -1,25 +1,13 @@
module.exports = {
parserPreset: 'conventional-changelog-conventionalcommits',
parserPreset: "conventional-changelog-conventionalcommits",
rules: {
'subject-empty': [2, 'never'],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never'],
'type-enum': [
"subject-empty": [2, "never"],
"type-case": [2, "always", "lower-case"],
"type-empty": [2, "never"],
"type-enum": [
2,
'always',
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test',
],
"always",
["build", "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test"],
],
},
};

View File

@@ -3,7 +3,7 @@ import inspect
import frappe
__version__ = "15.6.1"
__version__ = "15.16.2"
def get_default_company(user=None):
@@ -13,7 +13,7 @@ def get_default_company(user=None):
if not user:
user = frappe.session.user
companies = get_user_default_as_list(user, "company")
companies = get_user_default_as_list("company", user)
if companies:
default_company = companies[0]
else:

View File

@@ -1,4 +1,4 @@
frappe.provide('frappe.dashboards.chart_sources');
frappe.provide("frappe.dashboards.chart_sources");
frappe.dashboards.chart_sources["Account Balance Timeline"] = {
method: "erpnext.accounts.dashboard_chart_source.account_balance_timeline.account_balance_timeline.get",
@@ -9,14 +9,14 @@ frappe.dashboards.chart_sources["Account Balance Timeline"] = {
fieldtype: "Link",
options: "Company",
default: frappe.defaults.get_user_default("Company"),
reqd: 1
reqd: 1,
},
{
fieldname: "account",
label: __("Account"),
fieldtype: "Link",
options: "Account",
reqd: 1
reqd: 1,
},
]
],
};

View File

@@ -26,19 +26,14 @@ frappe.ui.form.on("Account", {
frm.toggle_enable(["is_group", "company"], false);
if (cint(frm.doc.is_group) == 0) {
frm.toggle_display(
"freeze_account",
frm.doc.__onload && frm.doc.__onload.can_freeze_account
);
frm.toggle_display("freeze_account", frm.doc.__onload && frm.doc.__onload.can_freeze_account);
}
// read-only for root accounts
if (!frm.is_new()) {
if (!frm.doc.parent_account) {
frm.set_read_only();
frm.set_intro(
__("This is a root account and cannot be edited.")
);
frm.set_intro(__("This is a root account and cannot be edited."));
} else {
// credit days and type if customer or supplier
frm.set_intro(null);
@@ -80,27 +75,33 @@ frappe.ui.form.on("Account", {
);
if (frm.doc.is_group == 1) {
frm.add_custom_button(__('Convert to Non-Group'), function () {
return frappe.call({
doc: frm.doc,
method: 'convert_group_to_ledger',
callback: function() {
frm.refresh();
}
});
}, __('Actions'));
} else if (cint(frm.doc.is_group) == 0
&& frappe.boot.user.can_read.indexOf("GL Entry") !== -1) {
frm.add_custom_button(__('General Ledger'), function () {
frappe.route_options = {
"account": frm.doc.name,
"from_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
"to_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
"company": frm.doc.company
};
frappe.set_route("query-report", "General Ledger");
}, __('View'));
frm.add_custom_button(
__("Convert to Non-Group"),
function () {
return frappe.call({
doc: frm.doc,
method: "convert_group_to_ledger",
callback: function () {
frm.refresh();
},
});
},
__("Actions")
);
} else if (cint(frm.doc.is_group) == 0 && frappe.boot.user.can_read.indexOf("GL Entry") !== -1) {
frm.add_custom_button(
__("General Ledger"),
function () {
frappe.route_options = {
account: frm.doc.name,
from_date: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
to_date: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
company: frm.doc.company,
};
frappe.set_route("query-report", "General Ledger");
},
__("View")
);
frm.add_custom_button(
__("Convert to Group"),
@@ -193,14 +194,8 @@ frappe.ui.form.on("Account", {
if (r.message) {
frappe.set_route("Form", "Account", r.message);
} else {
frm.set_value(
"account_number",
data.account_number
);
frm.set_value(
"account_name",
data.account_name
);
frm.set_value("account_number", data.account_number);
frm.set_value("account_name", data.account_name);
}
d.hide();
}

View File

@@ -118,6 +118,7 @@ class Account(NestedSet):
self.validate_balance_must_be_debit_or_credit()
self.validate_account_currency()
self.validate_root_company_and_sync_account_to_children()
self.validate_receivable_payable_account_type()
def validate_parent_child_account_type(self):
if self.parent_account:
@@ -188,6 +189,24 @@ class Account(NestedSet):
"Balance Sheet" if self.root_type in ("Asset", "Liability", "Equity") else "Profit and Loss"
)
def validate_receivable_payable_account_type(self):
doc_before_save = self.get_doc_before_save()
receivable_payable_types = ["Receivable", "Payable"]
if (
doc_before_save
and doc_before_save.account_type in receivable_payable_types
and doc_before_save.account_type != self.account_type
):
# check for ledger entries
if frappe.db.get_all("GL Entry", filters={"account": self.name, "is_cancelled": 0}, limit=1):
msg = _(
"There are ledger entries against this account. Changing {0} to non-{1} in live system will cause incorrect output in 'Accounts {2}' report"
).format(
frappe.bold("Account Type"), doc_before_save.account_type, doc_before_save.account_type
)
frappe.msgprint(msg)
self.add_comment("Comment", msg)
def validate_root_details(self):
doc_before_save = self.get_doc_before_save()

View File

@@ -1,4 +1,4 @@
frappe.provide("frappe.treeview_settings")
frappe.provide("frappe.treeview_settings");
frappe.treeview_settings["Account"] = {
breadcrumb: "Accounts",
@@ -7,12 +7,12 @@ frappe.treeview_settings["Account"] = {
filters: [
{
fieldname: "company",
fieldtype:"Select",
fieldtype: "Select",
options: erpnext.utils.get_tree_options("company"),
label: __("Company"),
default: erpnext.utils.get_tree_default("company"),
on_change: function() {
var me = frappe.treeview_settings['Account'].treeview;
on_change: function () {
var me = frappe.treeview_settings["Account"].treeview;
var company = me.page.fields_dict.company.get_value();
if (!company) {
frappe.throw(__("Please set a Company"));
@@ -22,30 +22,36 @@ frappe.treeview_settings["Account"] = {
args: {
company: company,
},
callback: function(r) {
if(r.message) {
callback: function (r) {
if (r.message) {
let root_company = r.message.length ? r.message[0] : "";
me.page.fields_dict.root_company.set_value(root_company);
frappe.db.get_value("Company", {"name": company}, "allow_account_creation_against_child_company", (r) => {
frappe.flags.ignore_root_company_validation = r.allow_account_creation_against_child_company;
});
frappe.db.get_value(
"Company",
{ name: company },
"allow_account_creation_against_child_company",
(r) => {
frappe.flags.ignore_root_company_validation =
r.allow_account_creation_against_child_company;
}
);
}
}
},
});
}
},
},
{
fieldname: "root_company",
fieldtype:"Data",
fieldtype: "Data",
label: __("Root Company"),
hidden: true,
disable_onchange: true
}
disable_onchange: true,
},
],
root_label: "Accounts",
get_tree_nodes: 'erpnext.accounts.utils.get_children',
on_get_node: function(nodes, deep=false) {
get_tree_nodes: "erpnext.accounts.utils.get_children",
on_get_node: function (nodes, deep = false) {
if (frappe.boot.user.can_read.indexOf("GL Entry") == -1) return;
let accounts = [];
@@ -57,151 +63,231 @@ frappe.treeview_settings["Account"] = {
}
frappe.db.get_single_value("Accounts Settings", "show_balance_in_coa").then((value) => {
if(value) {
if (value) {
const get_balances = frappe.call({
method: 'erpnext.accounts.utils.get_account_balances',
method: "erpnext.accounts.utils.get_account_balances",
args: {
accounts: accounts,
company: cur_tree.args.company
company: cur_tree.args.company,
},
});
get_balances.then(r => {
get_balances.then((r) => {
if (!r.message || r.message.length == 0) return;
for (let account of r.message) {
const node = cur_tree.nodes && cur_tree.nodes[account.value];
if (!node || node.is_root) continue;
// show Dr if positive since balance is calculated as debit - credit else show Cr
const balance = account.balance_in_account_currency || account.balance;
const dr_or_cr = balance > 0 ? "Dr": "Cr";
const dr_or_cr = balance > 0 ? "Dr" : "Cr";
const format = (value, currency) => format_currency(Math.abs(value), currency);
if (account.balance!==undefined) {
node.parent && node.parent.find('.balance-area').remove();
$('<span class="balance-area pull-right">'
+ (account.balance_in_account_currency ?
(format(account.balance_in_account_currency, account.account_currency) + " / ") : "")
+ format(account.balance, account.company_currency)
+ " " + dr_or_cr
+ '</span>').insertBefore(node.$ul);
if (account.balance !== undefined) {
node.parent && node.parent.find(".balance-area").remove();
$(
'<span class="balance-area pull-right">' +
(account.balance_in_account_currency
? format(
account.balance_in_account_currency,
account.account_currency
) + " / "
: "") +
format(account.balance, account.company_currency) +
" " +
dr_or_cr +
"</span>"
).insertBefore(node.$ul);
}
}
});
}
});
},
add_tree_node: 'erpnext.accounts.utils.add_ac',
menu_items:[
add_tree_node: "erpnext.accounts.utils.add_ac",
menu_items: [
{
label: __('New Company'),
action: function() { frappe.new_doc("Company", true) },
condition: 'frappe.boot.user.can_create.indexOf("Company") !== -1'
}
label: __("New Company"),
action: function () {
frappe.new_doc("Company", true);
},
condition: 'frappe.boot.user.can_create.indexOf("Company") !== -1',
},
],
fields: [
{fieldtype:'Data', fieldname:'account_name', label:__('New Account Name'), reqd:true,
description: __("Name of new Account. Note: Please don't create accounts for Customers and Suppliers")},
{fieldtype:'Data', fieldname:'account_number', label:__('Account Number'),
description: __("Number of new Account, it will be included in the account name as a prefix")},
{fieldtype:'Check', fieldname:'is_group', label:__('Is Group'),
description: __('Further accounts can be made under Groups, but entries can be made against non-Groups')},
{fieldtype:'Select', fieldname:'root_type', label:__('Root Type'),
options: ['Asset', 'Liability', 'Equity', 'Income', 'Expense'].join('\n'),
depends_on: 'eval:doc.is_group && !doc.parent_account'},
{fieldtype:'Select', fieldname:'account_type', label:__('Account Type'),
options: frappe.get_meta("Account").fields.filter(d => d.fieldname=='account_type')[0].options,
description: __("Optional. This setting will be used to filter in various transactions.")
{
fieldtype: "Data",
fieldname: "account_name",
label: __("New Account Name"),
reqd: true,
description: __(
"Name of new Account. Note: Please don't create accounts for Customers and Suppliers"
),
},
{
fieldtype: "Data",
fieldname: "account_number",
label: __("Account Number"),
description: __("Number of new Account, it will be included in the account name as a prefix"),
},
{
fieldtype: "Check",
fieldname: "is_group",
label: __("Is Group"),
description: __(
"Further accounts can be made under Groups, but entries can be made against non-Groups"
),
},
{
fieldtype: "Select",
fieldname: "root_type",
label: __("Root Type"),
options: ["Asset", "Liability", "Equity", "Income", "Expense"].join("\n"),
depends_on: "eval:doc.is_group && !doc.parent_account",
},
{
fieldtype: "Select",
fieldname: "account_type",
label: __("Account Type"),
options: frappe.get_meta("Account").fields.filter((d) => d.fieldname == "account_type")[0]
.options,
description: __("Optional. This setting will be used to filter in various transactions."),
},
{
fieldtype: "Float",
fieldname: "tax_rate",
label: __("Tax Rate"),
depends_on: 'eval:doc.is_group==0&&doc.account_type=="Tax"',
},
{
fieldtype: "Link",
fieldname: "account_currency",
label: __("Currency"),
options: "Currency",
description: __("Optional. Sets company's default currency, if not specified."),
},
{fieldtype:'Float', fieldname:'tax_rate', label:__('Tax Rate'),
depends_on: 'eval:doc.is_group==0&&doc.account_type=="Tax"'},
{fieldtype:'Link', fieldname:'account_currency', label:__('Currency'), options:"Currency",
description: __("Optional. Sets company's default currency, if not specified.")}
],
ignore_fields:["parent_account"],
onload: function(treeview) {
frappe.treeview_settings['Account'].treeview = {};
$.extend(frappe.treeview_settings['Account'].treeview, treeview);
ignore_fields: ["parent_account"],
onload: function (treeview) {
frappe.treeview_settings["Account"].treeview = {};
$.extend(frappe.treeview_settings["Account"].treeview, treeview);
function get_company() {
return treeview.page.fields_dict.company.get_value();
}
// tools
treeview.page.add_inner_button(__("Chart of Cost Centers"), function() {
frappe.set_route('Tree', 'Cost Center', {company: get_company()});
}, __('View'));
treeview.page.add_inner_button(
__("Chart of Cost Centers"),
function () {
frappe.set_route("Tree", "Cost Center", { company: get_company() });
},
__("View")
);
treeview.page.add_inner_button(__("Opening Invoice Creation Tool"), function() {
frappe.set_route('Form', 'Opening Invoice Creation Tool', {company: get_company()});
}, __('View'));
treeview.page.add_inner_button(
__("Opening Invoice Creation Tool"),
function () {
frappe.set_route("Form", "Opening Invoice Creation Tool", { company: get_company() });
},
__("View")
);
treeview.page.add_inner_button(__("Period Closing Voucher"), function() {
frappe.set_route('List', 'Period Closing Voucher', {company: get_company()});
}, __('View'));
treeview.page.add_inner_button(
__("Period Closing Voucher"),
function () {
frappe.set_route("List", "Period Closing Voucher", { company: get_company() });
},
__("View")
);
treeview.page.add_inner_button(__("Journal Entry"), function() {
frappe.new_doc('Journal Entry', {company: get_company()});
}, __('Create'));
treeview.page.add_inner_button(__("Company"), function() {
frappe.new_doc('Company');
}, __('Create'));
treeview.page.add_inner_button(
__("Journal Entry"),
function () {
frappe.new_doc("Journal Entry", { company: get_company() });
},
__("Create")
);
treeview.page.add_inner_button(
__("Company"),
function () {
frappe.new_doc("Company");
},
__("Create")
);
// financial statements
for (let report of ['Trial Balance', 'General Ledger', 'Balance Sheet',
'Profit and Loss Statement', 'Cash Flow Statement', 'Accounts Payable', 'Accounts Receivable']) {
treeview.page.add_inner_button(__(report), function() {
frappe.set_route('query-report', report, {company: get_company()});
}, __('Financial Statements'));
for (let report of [
"Trial Balance",
"General Ledger",
"Balance Sheet",
"Profit and Loss Statement",
"Cash Flow Statement",
"Accounts Payable",
"Accounts Receivable",
]) {
treeview.page.add_inner_button(
__(report),
function () {
frappe.set_route("query-report", report, { company: get_company() });
},
__("Financial Statements")
);
}
},
post_render: function(treeview) {
frappe.treeview_settings['Account'].treeview["tree"] = treeview.tree;
treeview.page.set_primary_action(__("New"), function() {
let root_company = treeview.page.fields_dict.root_company.get_value();
post_render: function (treeview) {
frappe.treeview_settings["Account"].treeview["tree"] = treeview.tree;
treeview.page.set_primary_action(
__("New"),
function () {
let root_company = treeview.page.fields_dict.root_company.get_value();
if(root_company) {
frappe.throw(__("Please add the account to root level Company - {0}"), [root_company]);
} else {
treeview.new_node();
}
}, "add");
if (root_company) {
frappe.throw(__("Please add the account to root level Company - {0}"), [root_company]);
} else {
treeview.new_node();
}
},
"add"
);
},
toolbar: [
{
label:__("Add Child"),
condition: function(node) {
return frappe.boot.user.can_create.indexOf("Account") !== -1
&& (!frappe.treeview_settings['Account'].treeview.page.fields_dict.root_company.get_value()
|| frappe.flags.ignore_root_company_validation)
&& node.expandable && !node.hide_add;
label: __("Add Child"),
condition: function (node) {
return (
frappe.boot.user.can_create.indexOf("Account") !== -1 &&
(!frappe.treeview_settings[
"Account"
].treeview.page.fields_dict.root_company.get_value() ||
frappe.flags.ignore_root_company_validation) &&
node.expandable &&
!node.hide_add
);
},
click: function() {
var me = frappe.views.trees['Account'];
click: function () {
var me = frappe.views.trees["Account"];
me.new_node();
},
btnClass: "hidden-xs"
btnClass: "hidden-xs",
},
{
condition: function(node) {
return !node.root && frappe.boot.user.can_read.indexOf("GL Entry") !== -1
condition: function (node) {
return !node.root && frappe.boot.user.can_read.indexOf("GL Entry") !== -1;
},
label: __("View Ledger"),
click: function(node, btn) {
click: function (node, btn) {
frappe.route_options = {
"account": node.label,
"from_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
"to_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
"company": frappe.treeview_settings['Account'].treeview.page.fields_dict.company.get_value()
account: node.label,
from_date: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1],
to_date: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2],
company:
frappe.treeview_settings["Account"].treeview.page.fields_dict.company.get_value(),
};
frappe.set_route("query-report", "General Ledger");
},
btnClass: "hidden-xs"
}
btnClass: "hidden-xs",
},
],
extend_toolbar: true
}
extend_toolbar: true,
};

View File

@@ -26,7 +26,7 @@
"0360 Bauliche Investitionen in fremden (gepachteten) Betriebs- und Geschäftsgebäuden": {"account_type": "Fixed Asset"},
"0370 Bauliche Investitionen in fremden (gepachteten) Wohn- und Sozialgebäuden": {"account_type": "Fixed Asset"},
"0390 Kumulierte Abschreibungen zu Grundstücken ": {"account_type": "Fixed Asset"},
"0400 Maschinen und Geräte ": {"account_type": "Fixed Asset"},
"0400 Maschinen und Geräte ": {"account_type": "Fixed Asset"},
"0500 Maschinenwerkzeuge ": {"account_type": "Fixed Asset"},
"0510 Allgemeine Werkzeuge und Handwerkzeuge ": {"account_type": "Fixed Asset"},
"0520 Prototypen, Formen, Modelle ": {"account_type": "Fixed Asset"},
@@ -65,42 +65,41 @@
"0980 Geleistete Anzahlungen auf Finanzanlagen ": {"account_type": "Fixed Asset"},
"0990 Kumulierte Abschreibungen zu Finanzanlagen ": {"account_type": "Fixed Asset"},
"root_type": "Asset"
},
},
"Klasse 1 Aktiva: Vorr\u00e4te": {
"1000 Bezugsverrechnung": {"account_type": "Stock"},
"1100 Rohstoffe": {"account_type": "Stock"},
"1200 Bezogene Teile": {"account_type": "Stock"},
"1300 Hilfsstoffe": {"account_type": "Stock"},
"1350 Betriebsstoffe": {"account_type": "Stock"},
"1360 Vorrat Energietraeger": {"account_type": "Stock"},
"1360 Vorrat Energietraeger": {"account_type": "Stock"},
"1400 Unfertige Erzeugnisse": {"account_type": "Stock"},
"1500 Fertige Erzeugnisse": {"account_type": "Stock"},
"1600 Handelswarenvorrat": {"account_type": "Stock Received But Not Billed"},
"1700 Noch nicht abrechenbare Leistungen": {"account_type": "Stock"},
"1900 Wertberichtigungen": {"account_type": "Stock"},
"1800 Geleistete Anzahlungen": {"account_type": "Stock"},
"1900 Wertberichtigungen": {"account_type": "Stock"},
"root_type": "Asset"
},
},
"Klasse 3 Passiva: Verbindlichkeiten": {
"3000 Allgemeine Verbindlichkeiten (Schuld)": {"account_type": "Payable"},
"3010 R\u00fcckstellungen f\u00fcr Pensionen": {"account_type": "Payable"},
"3020 Steuerr\u00fcckstellungen": {"account_type": "Tax"},
"3041 Sonstige R\u00fcckstellungen": {"account_type": "Payable"},
"3041 Sonstige R\u00fcckstellungen": {"account_type": "Payable"},
"3110 Verbindlichkeiten gegen\u00fcber Bank": {"account_type": "Payable"},
"3150 Verbindlichkeiten Darlehen": {"account_type": "Payable"},
"3185 Verbindlichkeiten Kreditkarte": {"account_type": "Payable"},
"3185 Verbindlichkeiten Kreditkarte": {"account_type": "Payable"},
"3380 Verbindlichkeiten aus der Annahme gezogener Wechsel u. d. Ausstellungen eigener Wechsel": {
"account_type": "Payable"
},
"3400 Verbindlichkeiten gegen\u00fc. verb. Untern., Verbindl. gegen\u00fc. Untern., mit denen eine Beteiligungsverh\u00e4lnis besteht": {},
"3460 Verbindlichkeiten gegenueber Gesellschaftern": {"account_type": "Payable"},
"3470 Einlagen stiller Gesellschafter": {"account_type": "Payable"},
"3585 Verbindlichkeiten Lohnsteuer": {"account_type": "Tax"},
"3590 Verbindlichkeiten Kommunalabgaben": {"account_type": "Tax"},
"3595 Verbindlichkeiten Dienstgeberbeitrag": {"account_type": "Tax"},
"3585 Verbindlichkeiten Lohnsteuer": {"account_type": "Tax"},
"3590 Verbindlichkeiten Kommunalabgaben": {"account_type": "Tax"},
"3595 Verbindlichkeiten Dienstgeberbeitrag": {"account_type": "Tax"},
"3600 Verbindlichkeiten Sozialversicherung": {"account_type": "Payable"},
"3640 Verbindlichkeiten Loehne und Gehaelter": {"account_type": "Payable"},
"3640 Verbindlichkeiten Loehne und Gehaelter": {"account_type": "Payable"},
"3700 Sonstige Verbindlichkeiten": {"account_type": "Payable"},
"3900 Passive Rechnungsabgrenzungsposten": {"account_type": "Payable"},
"3100 Anleihen (einschlie\u00dflich konvertibler)": {"account_type": "Payable"},
@@ -119,13 +118,13 @@
},
"3515 Umsatzsteuer Inland 10%": {
"account_type": "Tax"
},
},
"3520 Umsatzsteuer aus i.g. Erwerb 20%": {
"account_type": "Tax"
},
"3525 Umsatzsteuer aus i.g. Erwerb 10%": {
"account_type": "Tax"
},
},
"3560 Umsatzsteuer-Evidenzkonto f\u00fcr erhaltene Anzahlungen auf Bestellungen": {},
"3360 Verbindlichkeiten aus Lieferungen u. Leistungen EU": {
"account_type": "Payable"
@@ -141,7 +140,7 @@
"account_type": "Tax"
},
"root_type": "Liability"
},
},
"Klasse 2 Aktiva: Umlaufverm\u00f6gen, Rechnungsabgrenzungen": {
"2030 Forderungen aus Lieferungen und Leistungen Inland (0% USt, umsatzsteuerfrei)": {
"account_type": "Receivable"
@@ -154,7 +153,7 @@
},
"2040 Forderungen aus Lieferungen und Leistungen Inland (sonstiger USt-Satz)": {
"account_type": "Receivable"
},
},
"2100 Forderungen aus Lieferungen und Leistungen EU": {
"account_type": "Receivable"
},
@@ -192,7 +191,7 @@
"account_type": "Receivable"
},
"2570 Einfuhrumsatzsteuer (bezahlt)": {"account_type": "Tax"},
"2460 Eingeforderte aber noch nicht eingezahlte Einlagen": {
"account_type": "Receivable"
},
@@ -243,10 +242,10 @@
},
"2800 Guthaben bei Bank": {
"account_type": "Bank"
},
},
"2801 Guthaben bei Bank - Sparkonto": {
"account_type": "Bank"
},
},
"2810 Guthaben bei Paypal": {
"account_type": "Bank"
},
@@ -264,19 +263,19 @@
},
"2895 Schwebende Geldbewegugen": {
"account_type": "Bank"
},
},
"2513 Vorsteuer Inland 5%": {
"account_type": "Tax"
},
"2515 Vorsteuer Inland 20%": {
"account_type": "Tax"
},
},
"2520 Vorsteuer aus innergemeinschaftlichem Erwerb 10%": {
"account_type": "Tax"
},
"2525 Vorsteuer aus innergemeinschaftlichem Erwerb 20%": {
"account_type": "Tax"
},
},
"2530 Vorsteuer \u00a719/Art 19 ( reverse charge ) ": {
"account_type": "Tax"
},
@@ -286,16 +285,16 @@
"root_type": "Asset"
},
"Klasse 4: Betriebliche Erträge": {
"4000 Erlöse 20 %": {"account_type": "Income Account"},
"4020 Erl\u00f6se 0 % steuerbefreit": {"account_type": "Income Account"},
"4000 Erlöse 20 %": {"account_type": "Income Account"},
"4020 Erl\u00f6se 0 % steuerbefreit": {"account_type": "Income Account"},
"4010 Erl\u00f6se 10 %": {"account_type": "Income Account"},
"4030 Erl\u00f6se 13 %": {"account_type": "Income Account"},
"4040 Erl\u00f6se 0 % innergemeinschaftliche Lieferungen": {"account_type": "Income Account"},
"4400 Erl\u00f6sreduktion 0 % steuerbefreit": {"account_type": "Expense Account"},
"4030 Erl\u00f6se 13 %": {"account_type": "Income Account"},
"4040 Erl\u00f6se 0 % innergemeinschaftliche Lieferungen": {"account_type": "Income Account"},
"4400 Erl\u00f6sreduktion 0 % steuerbefreit": {"account_type": "Expense Account"},
"4410 Erl\u00f6sreduktion 10 %": {"account_type": "Expense Account"},
"4420 Erl\u00f6sreduktion 20 %": {"account_type": "Expense Account"},
"4430 Erl\u00f6sreduktion 13 %": {"account_type": "Expense Account"},
"4440 Erl\u00f6sreduktion 0 % innergemeinschaftliche Lieferungen": {"account_type": "Expense Account"},
"4430 Erl\u00f6sreduktion 13 %": {"account_type": "Expense Account"},
"4440 Erl\u00f6sreduktion 0 % innergemeinschaftliche Lieferungen": {"account_type": "Expense Account"},
"4500 Ver\u00e4nderungen des Bestandes an fertigen und unfertigen Erzeugn. sowie an noch nicht abrechenbaren Leistungen": {"account_type": "Income Account"},
"4580 Aktivierte Eigenleistungen": {"account_type": "Income Account"},
"4600 Erl\u00f6se aus dem Abgang vom Anlageverm\u00f6gen, ausgen. Finanzanlagen": {"account_type": "Income Account"},
@@ -304,15 +303,15 @@
"4700 Ertr\u00e4ge aus der Aufl\u00f6sung von R\u00fcckstellungen": {"account_type": "Income Account"},
"4800 \u00dcbrige betriebliche Ertr\u00e4ge": {"account_type": "Income Account"},
"root_type": "Income"
},
},
"Klasse 5: Aufwand f\u00fcr Material und Leistungen": {
"5000 Einkauf Partnerleistungen": {"account_type": "Cost of Goods Sold"},
"5000 Einkauf Partnerleistungen": {"account_type": "Cost of Goods Sold"},
"5100 Verbrauch an Rohstoffen": {"account_type": "Cost of Goods Sold"},
"5200 Verbrauch von bezogenen Fertig- und Einzelteilen": {"account_type": "Cost of Goods Sold"},
"5300 Verbrauch von Hilfsstoffen": {"account_type": "Cost of Goods Sold"},
"5340 Verbrauch Verpackungsmaterial": {"account_type": "Cost of Goods Sold"},
"5470 Verbrauch von Kleinmaterial": {"account_type": "Cost of Goods Sold"},
"5450 Verbrauch von Reinigungsmaterial": {"account_type": "Cost of Goods Sold"},
"5450 Verbrauch von Reinigungsmaterial": {"account_type": "Cost of Goods Sold"},
"5400 Verbrauch von Betriebsstoffen": {"account_type": "Cost of Goods Sold"},
"5500 Verbrauch von Werkzeugen und anderen Erzeugungshilfsmittel": {"account_type": "Cost of Goods Sold"},
"5600 Verbrauch von Brenn- und Treibstoffen, Energie und Wasser": {"account_type": "Cost of Goods Sold"},
@@ -340,7 +339,7 @@
"6700 Sonstige Sozialaufwendungen": {"account_type": "Payable"},
"6900 Aufwandsstellenrechnung Personal": {"account_type": "Payable"},
"root_type": "Expense"
},
},
"Klasse 7: Abschreibungen und sonstige betriebliche Aufwendungen": {
"7010 Abschreibungen auf das Anlageverm\u00f6gen (ausgenommen Finanzanlagen)": {"account_type": "Depreciation"},
"7100 Sonstige Steuern und Geb\u00fchren": {"account_type": "Tax"},
@@ -349,7 +348,7 @@
"7310 Fahrrad - Aufwand": {"account_type": "Expense Account"},
"7320 Kfz - Aufwand": {"account_type": "Expense Account"},
"7330 LKW - Aufwand": {"account_type": "Expense Account"},
"7340 Lastenrad - Aufwand": {"account_type": "Expense Account"},
"7340 Lastenrad - Aufwand": {"account_type": "Expense Account"},
"7350 Reise- und Fahraufwand": {"account_type": "Expense Account"},
"7360 Tag- und N\u00e4chtigungsgelder": {"account_type": "Expense Account"},
"7380 Nachrichtenaufwand": {"account_type": "Expense Account"},
@@ -409,7 +408,7 @@
"8990 Gewinnabfuhr bzw. Verlust\u00fcberrechnung aus Ergebnisabf\u00fchrungsvertr\u00e4gen": {"account_type": "Expense Account"},
"8350 nicht ausgenutzte Lieferantenskonti": {"account_type": "Expense Account"},
"root_type": "Income"
},
},
"Klasse 9 Passiva: Eigenkapital, R\u00fccklagen, stille Einlagen, Abschlusskonten": {
"9000 Gezeichnetes bzw. gewidmetes Kapital": {
"account_type": "Equity"
@@ -435,5 +434,5 @@
},
"root_type": "Equity"
}
}
}
}

View File

@@ -56,7 +56,9 @@
"Constru\u00e7\u00f5es em Andamento de Im\u00f3veis Destinados \u00e0 Venda": {},
"Estoques Destinados \u00e0 Doa\u00e7\u00e3o": {},
"Im\u00f3veis Destinados \u00e0 Venda": {},
"Insumos (materiais diretos)": {},
"Insumos (materiais diretos)": {
"account_type": "Stock"
},
"Insumos Agropecu\u00e1rios": {},
"Mercadorias para Revenda": {},
"Outras 11": {},
@@ -146,6 +148,65 @@
"root_type": "Asset"
},
"CUSTOS DE PRODU\u00c7\u00c3O": {
"CUSTO DOS PRODUTOS E SERVI\u00c7OS VENDIDOS": {
"CUSTO DOS PRODUTOS VENDIDOS": {
"CUSTO DOS PRODUTOS VENDIDOS PARA AS DEMAIS ATIVIDADES": {
"Custos dos Produtos Vendidos em Geral": {
"account_type": "Cost of Goods Sold"
},
"Outros Custos 4": {},
"account_type": "Cost of Goods Sold"
},
"CUSTO DOS PRODUTOS VENDIDOS PARA ASSIST\u00caNCIA SOCIAL": {
"Custos dos Produtos para Assist\u00eancia Social - Gratuidades": {},
"Custos dos Produtos para Assist\u00eancia Social - Vendidos": {},
"Outras": {}
},
"CUSTO DOS PRODUTOS VENDIDOS PARA EDUCA\u00c7\u00c3O": {
"Custos dos Produtos para Educa\u00e7\u00e3o - Gratuidades": {},
"Custos dos Produtos para Educa\u00e7\u00e3o - Vendidos": {},
"Outros Custos 6": {}
},
"CUSTO DOS PRODUTOS VENDIDOS PARA SA\u00daDE": {
"Custos dos Produtos para Sa\u00fade - Gratuidades": {},
"Custos dos Produtos para Sa\u00fade \u2013 Vendidos": {},
"Outros Custos 5": {}
},
"account_type": "Cost of Goods Sold"
},
"CUSTO DOS SERVI\u00c7OS PRESTADOS": {
"CUSTO DOS SERVI\u00c7OS PRESTADOS PARA AS DEMAIS ATIVIDADES": {
"Custo dos Servi\u00e7os Prestados em Geral": {},
"Outros Custos": {}
},
"CUSTO DOS SERVI\u00c7OS PRESTADOS PARA ASSIST\u00caNCIA SOCIAL": {
"Custo dos Servi\u00e7os Prestados a Conv\u00eanios/Contratos/Parcerias": {},
"Custo dos Servi\u00e7os Prestados a Doa\u00e7\u00f5es 1": {},
"Custo dos Servi\u00e7os Prestados a Doa\u00e7\u00f5es/Subven\u00e7\u00f5es Vinculadas 1": {},
"Custo dos Servi\u00e7os Prestados a Gratuidade 1": {},
"Custo dos Servi\u00e7os Prestados a Pacientes Particulares": {},
"Outros Custos 2": {}
},
"CUSTO DOS SERVI\u00c7OS PRESTADOS PARA EDUCA\u00c7\u00c3O": {
"Custo dos Servi\u00e7os Prestados a Alunos N\u00e3o Bolsistas": {},
"Custo dos Servi\u00e7os Prestados a Conv\u00eanios/Contratos/Parcerias (Exceto PROUNI)": {},
"Custo dos Servi\u00e7os Prestados a Doa\u00e7\u00f5es": {},
"Custo dos Servi\u00e7os Prestados a Doa\u00e7\u00f5es/Subven\u00e7\u00f5es Vinculadas": {},
"Custo dos Servi\u00e7os Prestados a Gratuidade": {},
"Custo dos Servi\u00e7os Prestados ao PROUNI": {},
"Outros Custos 1": {}
},
"CUSTO DOS SERVI\u00c7OS PRESTADOS PARA SA\u00daDE": {
"Custo dos Servi\u00e7os Prestados a Conv\u00eanios SUS": {},
"Custo dos Servi\u00e7os Prestados a Conv\u00eanios/Contratos/Parcerias 1": {},
"Custo dos Servi\u00e7os Prestados a Doa\u00e7\u00f5es 2": {},
"Custo dos Servi\u00e7os Prestados a Doa\u00e7\u00f5es/Subven\u00e7\u00f5es Vinculadas 2": {},
"Custo dos Servi\u00e7os Prestados a Gratuidade 2": {},
"Custo dos Servi\u00e7os Prestados a Pacientes Particulares 1": {},
"Outros Custos 3": {}
}
}
},
"CUSTO DOS BENS E SERVI\u00c7OS PRODUZIDOS": {
"CUSTO DOS PRODUTOS DE FABRICA\u00c7\u00c3O PR\u00d3PRIA PRODUZIDOS": {
"Alimenta\u00e7\u00e3o do Trabalhador": {},
@@ -621,7 +682,9 @@
"Receita das Unidades Imobili\u00e1rias Vendidas": {},
"Receita de Exporta\u00e7\u00e3o Direta de Mercadorias e Produtos": {},
"Receita de Exporta\u00e7\u00e3o de Servi\u00e7os": {},
"Receita de Loca\u00e7\u00e3o de Bens M\u00f3veis e Im\u00f3veis": {},
"Receita de Loca\u00e7\u00e3o de Bens M\u00f3veis e Im\u00f3veis": {
"account_type": "Income Account"
},
"Receita de Vendas de Mercadorias e Produtos a Comercial Exportadora com Fim Espec\u00edfico de Exporta\u00e7\u00e3o": {}
}
}
@@ -645,65 +708,6 @@
}
},
"RESULTADO OPERACIONAL": {
"CUSTO DOS PRODUTOS E SERVI\u00c7OS VENDIDOS": {
"CUSTO DOS PRODUTOS VENDIDOS": {
"CUSTO DOS PRODUTOS VENDIDOS PARA AS DEMAIS ATIVIDADES": {
"Custos dos Produtos Vendidos em Geral": {
"account_type": "Cost of Goods Sold"
},
"Outros Custos 4": {},
"account_type": "Cost of Goods Sold"
},
"CUSTO DOS PRODUTOS VENDIDOS PARA ASSIST\u00caNCIA SOCIAL": {
"Custos dos Produtos para Assist\u00eancia Social - Gratuidades": {},
"Custos dos Produtos para Assist\u00eancia Social - Vendidos": {},
"Outras": {}
},
"CUSTO DOS PRODUTOS VENDIDOS PARA EDUCA\u00c7\u00c3O": {
"Custos dos Produtos para Educa\u00e7\u00e3o - Gratuidades": {},
"Custos dos Produtos para Educa\u00e7\u00e3o - Vendidos": {},
"Outros Custos 6": {}
},
"CUSTO DOS PRODUTOS VENDIDOS PARA SA\u00daDE": {
"Custos dos Produtos para Sa\u00fade - Gratuidades": {},
"Custos dos Produtos para Sa\u00fade \u2013 Vendidos": {},
"Outros Custos 5": {}
},
"account_type": "Cost of Goods Sold"
},
"CUSTO DOS SERVI\u00c7OS PRESTADOS": {
"CUSTO DOS SERVI\u00c7OS PRESTADOS PARA AS DEMAIS ATIVIDADES": {
"Custo dos Servi\u00e7os Prestados em Geral": {},
"Outros Custos": {}
},
"CUSTO DOS SERVI\u00c7OS PRESTADOS PARA ASSIST\u00caNCIA SOCIAL": {
"Custo dos Servi\u00e7os Prestados a Conv\u00eanios/Contratos/Parcerias": {},
"Custo dos Servi\u00e7os Prestados a Doa\u00e7\u00f5es 1": {},
"Custo dos Servi\u00e7os Prestados a Doa\u00e7\u00f5es/Subven\u00e7\u00f5es Vinculadas 1": {},
"Custo dos Servi\u00e7os Prestados a Gratuidade 1": {},
"Custo dos Servi\u00e7os Prestados a Pacientes Particulares": {},
"Outros Custos 2": {}
},
"CUSTO DOS SERVI\u00c7OS PRESTADOS PARA EDUCA\u00c7\u00c3O": {
"Custo dos Servi\u00e7os Prestados a Alunos N\u00e3o Bolsistas": {},
"Custo dos Servi\u00e7os Prestados a Conv\u00eanios/Contratos/Parcerias (Exceto PROUNI)": {},
"Custo dos Servi\u00e7os Prestados a Doa\u00e7\u00f5es": {},
"Custo dos Servi\u00e7os Prestados a Doa\u00e7\u00f5es/Subven\u00e7\u00f5es Vinculadas": {},
"Custo dos Servi\u00e7os Prestados a Gratuidade": {},
"Custo dos Servi\u00e7os Prestados ao PROUNI": {},
"Outros Custos 1": {}
},
"CUSTO DOS SERVI\u00c7OS PRESTADOS PARA SA\u00daDE": {
"Custo dos Servi\u00e7os Prestados a Conv\u00eanios SUS": {},
"Custo dos Servi\u00e7os Prestados a Conv\u00eanios/Contratos/Parcerias 1": {},
"Custo dos Servi\u00e7os Prestados a Doa\u00e7\u00f5es 2": {},
"Custo dos Servi\u00e7os Prestados a Doa\u00e7\u00f5es/Subven\u00e7\u00f5es Vinculadas 2": {},
"Custo dos Servi\u00e7os Prestados a Gratuidade 2": {},
"Custo dos Servi\u00e7os Prestados a Pacientes Particulares 1": {},
"Outros Custos 3": {}
}
}
},
"DESPESAS OPERACIONAIS": {
"DESPESAS OPERACIONAIS 1": {
"DESPESAS OPERACIONAIS 2": {

View File

@@ -33,7 +33,9 @@
},
"Stocks": {
"Mati\u00e8res premi\u00e8res": {},
"Stock de produits fini": {},
"Stock de produits fini": {
"account_type": "Stock"
},
"Stock exp\u00e9di\u00e9 non-factur\u00e9": {},
"Travaux en cours": {},
"account_type": "Stock"
@@ -395,9 +397,11 @@
},
"Produits": {
"Revenus de ventes": {
" Escomptes de volume sur ventes": {},
"Escomptes de volume sur ventes": {},
"Autres produits d'exploitation": {},
"Ventes": {},
"Ventes": {
"account_type": "Income Account"
},
"Ventes avec des provinces harmonis\u00e9es": {},
"Ventes avec des provinces non-harmonis\u00e9es": {},
"Ventes \u00e0 l'\u00e9tranger": {}

View File

@@ -53,8 +53,13 @@
},
"II. Forderungen und sonstige Vermögensgegenstände": {
"is_group": 1,
"Ford. a. Lieferungen und Leistungen": {
"Forderungen aus Lieferungen und Leistungen mit Kontokorrent": {
"account_number": "1400",
"account_type": "Receivable",
"is_group": 1
},
"Forderungen aus Lieferungen und Leistungen ohne Kontokorrent": {
"account_number": "1410",
"account_type": "Receivable"
},
"Durchlaufende Posten": {
@@ -180,8 +185,13 @@
},
"IV. Verbindlichkeiten aus Lieferungen und Leistungen": {
"is_group": 1,
"Verbindlichkeiten aus Lieferungen u. Leistungen": {
"Verbindlichkeiten aus Lieferungen und Leistungen mit Kontokorrent": {
"account_number": "1600",
"account_type": "Payable",
"is_group": 1
},
"Verbindlichkeiten aus Lieferungen und Leistungen ohne Kontokorrent": {
"account_number": "1610",
"account_type": "Payable"
}
},

View File

@@ -407,13 +407,10 @@
"Bewertungskorrektur zu Forderungen aus Lieferungen und Leistungen": {
"account_number": "9960"
},
"Debitoren": {
"is_group": 1,
"account_number": "10000"
},
"Forderungen aus Lieferungen und Leistungen": {
"Forderungen aus Lieferungen und Leistungen mit Kontokorrent": {
"account_number": "1200",
"account_type": "Receivable"
"account_type": "Receivable",
"is_group": 1
},
"Forderungen aus Lieferungen und Leistungen ohne Kontokorrent": {
"account_number": "1210"
@@ -1138,18 +1135,15 @@
"Bewertungskorrektur zu Verb. aus Lieferungen und Leistungen": {
"account_number": "9964"
},
"Kreditoren": {
"account_number": "70000",
"Verb. aus Lieferungen und Leistungen mit Kontokorrent": {
"account_number": "3300",
"account_type": "Payable",
"is_group": 1,
"Wareneingangs-­Verrechnungskonto" : {
"Wareneingangs-Verrechnungskonto" : {
"account_number": "70001",
"account_type": "Stock Received But Not Billed"
}
},
"Verb. aus Lieferungen und Leistungen": {
"account_number": "3300",
"account_type": "Payable"
},
"Verb. aus Lieferungen und Leistungen ohne Kontokorrent": {
"account_number": "3310"
},

View File

@@ -1,4 +1,6 @@
{
"country_code": "hu",
"name": "Hungary - Chart of Accounts for Microenterprises",
"tree": {
"SZ\u00c1MLAOSZT\u00c1LY BEFEKTETETT ESZK\u00d6Z\u00d6K": {
"account_number": 1,

View File

@@ -6,6 +6,7 @@ import unittest
import frappe
from frappe.test_runner import make_test_records
from frappe.utils import nowdate
from erpnext.accounts.doctype.account.account import (
InvalidAccountMergeError,
@@ -324,6 +325,19 @@ class TestAccount(unittest.TestCase):
acc.account_currency = "USD"
self.assertRaises(frappe.ValidationError, acc.save)
def test_account_balance(self):
from erpnext.accounts.utils import get_balance_on
if not frappe.db.exists("Account", "Test Percent Account %5 - _TC"):
acc = frappe.new_doc("Account")
acc.account_name = "Test Percent Account %5"
acc.parent_account = "Tax Assets - _TC"
acc.company = "_Test Company"
acc.insert()
balance = get_balance_on(account="Test Percent Account %5 - _TC", date=nowdate())
self.assertEqual(balance, 0)
def _make_test_records(verbose=None):
from frappe.test_runner import make_test_objects

View File

@@ -1,74 +1,86 @@
// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Accounting Dimension', {
refresh: function(frm) {
frm.set_query('document_type', () => {
frappe.ui.form.on("Accounting Dimension", {
refresh: function (frm) {
frm.set_query("document_type", () => {
let invalid_doctypes = frappe.model.core_doctypes_list;
invalid_doctypes.push('Accounting Dimension', 'Project',
'Cost Center', 'Accounting Dimension Detail', 'Company');
invalid_doctypes.push(
"Accounting Dimension",
"Project",
"Cost Center",
"Accounting Dimension Detail",
"Company"
);
return {
filters: {
name: ['not in', invalid_doctypes]
}
name: ["not in", invalid_doctypes],
},
};
});
frm.set_query("offsetting_account", "dimension_defaults", function(doc, cdt, cdn) {
frm.set_query("offsetting_account", "dimension_defaults", function (doc, cdt, cdn) {
let d = locals[cdt][cdn];
return {
filters: {
company: d.company,
root_type: ["in", ["Asset", "Liability"]],
is_group: 0
}
}
is_group: 0,
},
};
});
if (!frm.is_new()) {
frm.add_custom_button(__('Show {0}', [frm.doc.document_type]), function () {
frm.add_custom_button(__("Show {0}", [frm.doc.document_type]), function () {
frappe.set_route("List", frm.doc.document_type);
});
let button = frm.doc.disabled ? "Enable" : "Disable";
frm.add_custom_button(__(button), function() {
frm.set_value('disabled', 1 - frm.doc.disabled);
frm.add_custom_button(__(button), function () {
frm.set_value("disabled", 1 - frm.doc.disabled);
frappe.call({
method: "erpnext.accounts.doctype.accounting_dimension.accounting_dimension.disable_dimension",
args: {
doc: frm.doc
doc: frm.doc,
},
freeze: true,
callback: function(r) {
callback: function (r) {
let message = frm.doc.disabled ? "Dimension Disabled" : "Dimension Enabled";
frm.save();
frappe.show_alert({message:__(message), indicator:'green'});
}
frappe.show_alert({ message: __(message), indicator: "green" });
},
});
});
}
},
document_type: function(frm) {
document_type: function (frm) {
frm.set_value("label", frm.doc.document_type);
frm.set_value("fieldname", frappe.model.scrub(frm.doc.document_type));
frm.set_value('label', frm.doc.document_type);
frm.set_value('fieldname', frappe.model.scrub(frm.doc.document_type));
frappe.db.get_value('Accounting Dimension', {'document_type': frm.doc.document_type}, 'document_type', (r) => {
if (r && r.document_type) {
frm.set_df_property('document_type', 'description', "Document type is already set as dimension");
frappe.db.get_value(
"Accounting Dimension",
{ document_type: frm.doc.document_type },
"document_type",
(r) => {
if (r && r.document_type) {
frm.set_df_property(
"document_type",
"description",
"Document type is already set as dimension"
);
}
}
});
);
},
});
frappe.ui.form.on('Accounting Dimension Detail', {
dimension_defaults_add: function(frm, cdt, cdn) {
frappe.ui.form.on("Accounting Dimension Detail", {
dimension_defaults_add: function (frm, cdt, cdn) {
let row = locals[cdt][cdn];
row.reference_document = frm.doc.document_type;
}
},
});

View File

@@ -11,6 +11,10 @@ from frappe.model import core_doctypes_list
from frappe.model.document import Document
from frappe.utils import cstr
from erpnext.accounts.doctype.repost_accounting_ledger.repost_accounting_ledger import (
get_allowed_types_from_settings,
)
class AccountingDimension(Document):
# begin: auto-generated types
@@ -106,6 +110,7 @@ def make_dimension_in_accounting_doctypes(doc, doclist=None):
doc_count = len(get_accounting_dimensions())
count = 0
repostable_doctypes = get_allowed_types_from_settings()
for doctype in doclist:
@@ -121,6 +126,7 @@ def make_dimension_in_accounting_doctypes(doc, doclist=None):
"options": doc.document_type,
"insert_after": insert_after_field,
"owner": "Administrator",
"allow_on_submit": 1 if doctype in repostable_doctypes else 0,
}
meta = frappe.get_meta(doctype, cached=False)

View File

@@ -1,10 +1,9 @@
// Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Accounting Dimension Filter', {
refresh: function(frm, cdt, cdn) {
let help_content =
`<table class="table table-bordered" style="background-color: var(--scrollbar-track-color);">
frappe.ui.form.on("Accounting Dimension Filter", {
refresh: function (frm, cdt, cdn) {
let help_content = `<table class="table table-bordered" style="background-color: var(--scrollbar-track-color);">
<tr><td>
<p>
<i class="fa fa-hand-right"></i>
@@ -13,77 +12,80 @@ frappe.ui.form.on('Accounting Dimension Filter', {
</td></tr>
</table>`;
frm.set_df_property('dimension_filter_help', 'options', help_content);
frm.set_df_property("dimension_filter_help", "options", help_content);
},
onload: function(frm) {
frm.set_query('applicable_on_account', 'accounts', function() {
onload: function (frm) {
frm.set_query("applicable_on_account", "accounts", function () {
return {
filters: {
'company': frm.doc.company
}
company: frm.doc.company,
},
};
});
frappe.db.get_list('Accounting Dimension',
{fields: ['document_type']}).then((res) => {
let options = ['Cost Center', 'Project'];
frappe.db.get_list("Accounting Dimension", { fields: ["document_type"] }).then((res) => {
let options = ["Cost Center", "Project"];
res.forEach((dimension) => {
options.push(dimension.document_type);
});
frm.set_df_property('accounting_dimension', 'options', options);
frm.set_df_property("accounting_dimension", "options", options);
});
frm.trigger('setup_filters');
frm.trigger("setup_filters");
},
setup_filters: function(frm) {
setup_filters: function (frm) {
let filters = {};
if (frm.doc.accounting_dimension) {
frappe.model.with_doctype(frm.doc.accounting_dimension, function() {
frappe.model.with_doctype(frm.doc.accounting_dimension, function () {
if (frappe.model.is_tree(frm.doc.accounting_dimension)) {
filters['is_group'] = 0;
filters["is_group"] = 0;
}
if (frappe.meta.has_field(frm.doc.accounting_dimension, 'company')) {
filters['company'] = frm.doc.company;
if (frappe.meta.has_field(frm.doc.accounting_dimension, "company")) {
filters["company"] = frm.doc.company;
}
frm.set_query('dimension_value', 'dimensions', function() {
frm.set_query("dimension_value", "dimensions", function () {
return {
filters: filters
filters: filters,
};
});
});
}
},
accounting_dimension: function(frm) {
accounting_dimension: function (frm) {
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.fields_dict["dimensions"].grid.update_docfield_property(
"dimension_value",
"label",
frm.doc.accounting_dimension
);
frm.refresh_field("dimensions");
frm.trigger('setup_filters');
frm.trigger("setup_filters");
},
apply_restriction_on_values: function(frm) {
apply_restriction_on_values: function (frm) {
/** If restriction on values is not applied, we should set "allow_or_restrict" to "Restrict" with an empty allowed dimension table.
* Hence it's not "restricted" on any value.
*/
*/
if (!frm.doc.apply_restriction_on_values) {
frm.set_value("allow_or_restrict", "Restrict");
frm.clear_table("dimensions");
frm.refresh_field("dimensions");
}
}
},
});
frappe.ui.form.on('Allowed Dimension', {
dimensions_add: function(frm, cdt, cdn) {
frappe.ui.form.on("Allowed Dimension", {
dimensions_add: function (frm, cdt, cdn) {
let row = locals[cdt][cdn];
row.accounting_dimension = frm.doc.accounting_dimension;
frm.refresh_field("dimensions");
}
},
});

View File

@@ -1,30 +1,33 @@
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Accounting Period', {
onload: function(frm) {
if(frm.doc.closed_documents.length === 0 || (frm.doc.closed_documents.length === 1 && frm.doc.closed_documents[0].document_type == undefined)) {
frappe.ui.form.on("Accounting Period", {
onload: function (frm) {
if (
frm.doc.closed_documents.length === 0 ||
(frm.doc.closed_documents.length === 1 && frm.doc.closed_documents[0].document_type == undefined)
) {
frappe.call({
method: "get_doctypes_for_closing",
doc:frm.doc,
callback: function(r) {
if(r.message) {
doc: frm.doc,
callback: function (r) {
if (r.message) {
cur_frm.clear_table("closed_documents");
r.message.forEach(function(element) {
r.message.forEach(function (element) {
var c = frm.add_child("closed_documents");
c.document_type = element.document_type;
c.closed = element.closed;
});
refresh_field("closed_documents");
}
}
},
});
}
frm.set_query("document_type", "closed_documents", () => {
return {
query: "erpnext.controllers.queries.get_doctypes_for_closing",
}
};
});
}
},
});

View File

@@ -1,8 +1,6 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Accounts Settings', {
refresh: function(frm) {
}
frappe.ui.form.on("Accounts Settings", {
refresh: function (frm) {},
});

View File

@@ -1,7 +1,6 @@
{
"actions": [],
"creation": "2013-06-24 15:49:57",
"description": "Settings for Accounts",
"doctype": "DocType",
"document_type": "Other",
"editable_grid": 1,
@@ -462,7 +461,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2023-11-20 09:37:47.650347",
"modified": "2024-01-30 14:04:26.553554",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",

View File

@@ -1,8 +1,11 @@
frappe.ui.form.on('Accounts Settings', {
refresh: function(frm) {
frappe.ui.form.on("Accounts Settings", {
refresh: function (frm) {
frm.set_df_property("acc_frozen_upto", "label", "Books Closed Through");
frm.set_df_property("frozen_accounts_modifier", "label", "Role Allowed to Close Books & Make Changes to Closed Periods");
frm.set_df_property(
"frozen_accounts_modifier",
"label",
"Role Allowed to Close Books & Make Changes to Closed Periods"
);
frm.set_df_property("credit_controller", "label", "Credit Manager");
}
},
});

View File

@@ -11,6 +11,7 @@
{
"fieldname": "company",
"fieldtype": "Link",
"ignore_user_permissions": 1,
"in_list_view": 1,
"label": "Company",
"options": "Company",
@@ -19,7 +20,7 @@
],
"istable": 1,
"links": [],
"modified": "2020-05-01 12:32:34.044911",
"modified": "2024-01-03 11:13:02.669632",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Allowed To Transact With",
@@ -28,5 +29,6 @@
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1
}

View File

@@ -1,38 +1,36 @@
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.provide('erpnext.integrations');
frappe.provide("erpnext.integrations");
frappe.ui.form.on('Bank', {
onload: function(frm) {
frappe.ui.form.on("Bank", {
onload: function (frm) {
add_fields_to_mapping_table(frm);
},
refresh: function(frm) {
refresh: function (frm) {
add_fields_to_mapping_table(frm);
frm.toggle_display(['address_html','contact_html'], !frm.doc.__islocal);
frm.toggle_display(["address_html", "contact_html"], !frm.doc.__islocal);
if (frm.doc.__islocal) {
frm.set_df_property('address_and_contact', 'hidden', 1);
frm.set_df_property("address_and_contact", "hidden", 1);
frappe.contacts.clear_address_and_contact(frm);
}
else {
frm.set_df_property('address_and_contact', 'hidden', 0);
} else {
frm.set_df_property("address_and_contact", "hidden", 0);
frappe.contacts.render_address_and_contact(frm);
}
if (frm.doc.plaid_access_token) {
frm.add_custom_button(__('Refresh Plaid Link'), () => {
frm.add_custom_button(__("Refresh Plaid Link"), () => {
new erpnext.integrations.refreshPlaidLink(frm.doc.plaid_access_token);
});
}
}
},
});
let add_fields_to_mapping_table = function (frm) {
let options = [];
frappe.model.with_doctype("Bank Transaction", function() {
frappe.model.with_doctype("Bank Transaction", function () {
let meta = frappe.get_meta("Bank Transaction");
meta.fields.forEach(value => {
meta.fields.forEach((value) => {
if (!["Section Break", "Column Break"].includes(value.fieldtype)) {
options.push(value.fieldname);
}
@@ -40,30 +38,32 @@ let add_fields_to_mapping_table = function (frm) {
});
frm.fields_dict.bank_transaction_mapping.grid.update_docfield_property(
'bank_transaction_field', 'options', options
"bank_transaction_field",
"options",
options
);
};
erpnext.integrations.refreshPlaidLink = class refreshPlaidLink {
constructor(access_token) {
this.access_token = access_token;
this.plaidUrl = 'https://cdn.plaid.com/link/v2/stable/link-initialize.js';
this.plaidUrl = "https://cdn.plaid.com/link/v2/stable/link-initialize.js";
this.init_config();
}
async init_config() {
this.plaid_env = await frappe.db.get_single_value('Plaid Settings', 'plaid_env');
this.plaid_env = await frappe.db.get_single_value("Plaid Settings", "plaid_env");
this.token = await this.get_link_token_for_update();
this.init_plaid();
}
async get_link_token_for_update() {
const token = frappe.xcall(
'erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.get_link_token_for_update',
"erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.get_link_token_for_update",
{ access_token: this.access_token }
)
);
if (!token) {
frappe.throw(__('Cannot retrieve link token for update. Check Error Log for more information'));
frappe.throw(__("Cannot retrieve link token for update. Check Error Log for more information"));
}
return token;
}
@@ -90,35 +90,45 @@ erpnext.integrations.refreshPlaidLink = class refreshPlaidLink {
resolve();
return;
}
const el = document.createElement('script');
el.type = 'text/javascript';
const el = document.createElement("script");
el.type = "text/javascript";
el.async = true;
el.src = src;
el.addEventListener('load', resolve);
el.addEventListener('error', reject);
el.addEventListener('abort', reject);
el.addEventListener("load", resolve);
el.addEventListener("error", reject);
el.addEventListener("abort", reject);
document.head.appendChild(el);
});
}
onScriptLoaded(me) {
me.linkHandler = Plaid.create({ // eslint-disable-line no-undef
me.linkHandler = Plaid.create({
// eslint-disable-line no-undef
env: me.plaid_env,
token: me.token,
onSuccess: me.plaid_success
onSuccess: me.plaid_success,
});
}
onScriptError(error) {
frappe.msgprint(__("There was an issue connecting to Plaid's authentication server. Check browser console for more information"));
frappe.msgprint(
__(
"There was an issue connecting to Plaid's authentication server. Check browser console for more information"
)
);
console.log(error);
}
plaid_success(token, response) {
frappe.xcall('erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.update_bank_account_ids', {
response: response,
}).then(() => {
frappe.show_alert({ message: __('Plaid Link Updated'), indicator: 'green' });
});
frappe
.xcall(
"erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.update_bank_account_ids",
{
response: response,
}
)
.then(() => {
frappe.show_alert({ message: __("Plaid Link Updated"), indicator: "green" });
});
}
};

View File

@@ -1,45 +1,49 @@
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Bank Account', {
setup: function(frm) {
frm.set_query("account", function() {
frappe.ui.form.on("Bank Account", {
setup: function (frm) {
frm.set_query("account", function () {
return {
filters: {
'account_type': 'Bank',
'company': frm.doc.company,
'is_group': 0
}
account_type: "Bank",
company: frm.doc.company,
is_group: 0,
},
};
});
frm.set_query("party_type", function() {
frm.set_query("party_type", function () {
return {
query: "erpnext.setup.doctype.party_type.party_type.get_party_type",
};
});
},
refresh: function(frm) {
frappe.dynamic_link = { doc: frm.doc, fieldname: 'name', doctype: 'Bank Account' }
refresh: function (frm) {
frappe.dynamic_link = { doc: frm.doc, fieldname: "name", doctype: "Bank Account" };
frm.toggle_display(['address_html','contact_html'], !frm.doc.__islocal);
frm.toggle_display(["address_html", "contact_html"], !frm.doc.__islocal);
if (frm.doc.__islocal) {
frappe.contacts.clear_address_and_contact(frm);
}
else {
} else {
frappe.contacts.render_address_and_contact(frm);
}
if (frm.doc.integration_id) {
frm.add_custom_button(__("Unlink external integrations"), function() {
frappe.confirm(__("This action will unlink this account from any external service integrating ERPNext with your bank accounts. It cannot be undone. Are you certain ?"), function() {
frm.set_value("integration_id", "");
});
frm.add_custom_button(__("Unlink external integrations"), function () {
frappe.confirm(
__(
"This action will unlink this account from any external service integrating ERPNext with your bank accounts. It cannot be undone. Are you certain ?"
),
function () {
frm.set_value("integration_id", "");
}
);
});
}
},
is_company_account: function(frm) {
frm.set_df_property('account', 'reqd', frm.doc.is_company_account);
}
is_company_account: function (frm) {
frm.set_df_property("account", "reqd", frm.doc.is_company_account);
},
});

View File

@@ -9,6 +9,7 @@ from frappe.contacts.address_and_contact import (
load_address_and_contact,
)
from frappe.model.document import Document
from frappe.utils import comma_and, get_link_to_form
class BankAccount(Document):
@@ -52,6 +53,19 @@ class BankAccount(Document):
def validate(self):
self.validate_company()
self.validate_iban()
self.validate_account()
def validate_account(self):
if self.account:
if accounts := frappe.db.get_all(
"Bank Account", filters={"account": self.account, "name": ["!=", self.name]}, as_list=1
):
frappe.throw(
_("'{0}' account is already used by {1}. Use another account.").format(
frappe.bold(self.account),
frappe.bold(comma_and([get_link_to_form(self.doctype, x[0]) for x in accounts])),
)
)
def validate_company(self):
if self.is_company_account and not self.company:

View File

@@ -1,8 +1,6 @@
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Bank Account Subtype', {
refresh: function() {
}
frappe.ui.form.on("Bank Account Subtype", {
refresh: function () {},
});

View File

@@ -1,8 +1,7 @@
// Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Bank Account Type', {
frappe.ui.form.on("Bank Account Type", {
// refresh: function(frm) {
// }
});

View File

@@ -2,80 +2,76 @@
// License: GNU General Public License v3. See license.txt
frappe.ui.form.on("Bank Clearance", {
setup: function(frm) {
setup: function (frm) {
frm.add_fetch("account", "account_currency", "account_currency");
frm.set_query("account", function() {
frm.set_query("account", function () {
return {
"filters": {
"account_type": ["in",["Bank","Cash"]],
"is_group": 0,
}
filters: {
account_type: ["in", ["Bank", "Cash"]],
is_group: 0,
},
};
});
frm.set_query("bank_account", function () {
return {
filters: {
'is_company_account': 1
is_company_account: 1,
},
};
});
},
onload: function(frm) {
let default_bank_account = frappe.defaults.get_user_default("Company")?
locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]: "";
onload: function (frm) {
let default_bank_account = frappe.defaults.get_user_default("Company")
? locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]
: "";
frm.set_value("account", default_bank_account);
frm.set_value("from_date", frappe.datetime.month_start());
frm.set_value("to_date", frappe.datetime.month_end());
},
refresh: function(frm) {
refresh: function (frm) {
frm.disable_save();
frm.add_custom_button(__('Get Payment Entries'), () =>
frm.trigger("get_payment_entries")
);
frm.add_custom_button(__("Get Payment Entries"), () => frm.trigger("get_payment_entries"));
frm.change_custom_button_type(__('Get Payment Entries'), null, 'primary');
frm.change_custom_button_type(__("Get Payment Entries"), null, "primary");
},
update_clearance_date: function(frm) {
update_clearance_date: function (frm) {
return frappe.call({
method: "update_clearance_date",
doc: frm.doc,
callback: function(r, rt) {
callback: function (r, rt) {
frm.refresh_field("payment_entries");
frm.refresh_fields();
if (!frm.doc.payment_entries.length) {
frm.change_custom_button_type(__('Get Payment Entries'), null, 'primary');
frm.change_custom_button_type(__('Update Clearance Date'), null, 'default');
frm.change_custom_button_type(__("Get Payment Entries"), null, "primary");
frm.change_custom_button_type(__("Update Clearance Date"), null, "default");
}
}
},
});
},
get_payment_entries: function(frm) {
get_payment_entries: function (frm) {
return frappe.call({
method: "get_payment_entries",
doc: frm.doc,
callback: function(r, rt) {
callback: function (r, rt) {
frm.refresh_field("payment_entries");
if (frm.doc.payment_entries.length) {
frm.add_custom_button(__('Update Clearance Date'), () =>
frm.add_custom_button(__("Update Clearance Date"), () =>
frm.trigger("update_clearance_date")
);
frm.change_custom_button_type(__('Get Payment Entries'), null, 'default');
frm.change_custom_button_type(__('Update Clearance Date'), null, 'primary');
frm.change_custom_button_type(__("Get Payment Entries"), null, "default");
frm.change_custom_button_type(__("Update Clearance Date"), null, "primary");
}
}
},
});
}
},
});

View File

@@ -5,7 +5,9 @@
import frappe
from frappe import _, msgprint
from frappe.model.document import Document
from frappe.query_builder.custom import ConstantColumn
from frappe.utils import flt, fmt_money, getdate
from pypika import Order
import erpnext
@@ -179,39 +181,62 @@ def get_payment_entries_for_bank_clearance(
pos_sales_invoices, pos_purchase_invoices = [], []
if include_pos_transactions:
pos_sales_invoices = frappe.db.sql(
"""
select
"Sales Invoice Payment" as payment_document, sip.name as payment_entry, sip.amount as debit,
si.posting_date, si.customer as against_account, sip.clearance_date,
account.account_currency, 0 as credit
from `tabSales Invoice Payment` sip, `tabSales Invoice` si, `tabAccount` account
where
sip.account=%(account)s and si.docstatus=1 and sip.parent = si.name
and account.name = sip.account and si.posting_date >= %(from)s and si.posting_date <= %(to)s
order by
si.posting_date ASC, si.name DESC
""",
{"account": account, "from": from_date, "to": to_date},
as_dict=1,
)
si_payment = frappe.qb.DocType("Sales Invoice Payment")
si = frappe.qb.DocType("Sales Invoice")
acc = frappe.qb.DocType("Account")
pos_purchase_invoices = frappe.db.sql(
"""
select
"Purchase Invoice" as payment_document, pi.name as payment_entry, pi.paid_amount as credit,
pi.posting_date, pi.supplier as against_account, pi.clearance_date,
account.account_currency, 0 as debit
from `tabPurchase Invoice` pi, `tabAccount` account
where
pi.cash_bank_account=%(account)s and pi.docstatus=1 and account.name = pi.cash_bank_account
and pi.posting_date >= %(from)s and pi.posting_date <= %(to)s
order by
pi.posting_date ASC, pi.name DESC
""",
{"account": account, "from": from_date, "to": to_date},
as_dict=1,
)
pos_sales_invoices = (
frappe.qb.from_(si_payment)
.inner_join(si)
.on(si_payment.parent == si.name)
.inner_join(acc)
.on(si_payment.account == acc.name)
.select(
ConstantColumn("Sales Invoice").as_("payment_document"),
si.name.as_("payment_entry"),
si_payment.reference_no.as_("cheque_number"),
si_payment.amount.as_("debit"),
si.posting_date,
si.customer.as_("against_account"),
si_payment.clearance_date,
acc.account_currency,
ConstantColumn(0).as_("credit"),
)
.where(
(si.docstatus == 1)
& (si_payment.account == account)
& (si.posting_date >= from_date)
& (si.posting_date <= to_date)
)
.orderby(si.posting_date)
.orderby(si.name, order=Order.desc)
).run(as_dict=True)
pi = frappe.qb.DocType("Purchase Invoice")
pos_purchase_invoices = (
frappe.qb.from_(pi)
.inner_join(acc)
.on(pi.cash_bank_account == acc.name)
.select(
ConstantColumn("Purchase Invoice").as_("payment_document"),
pi.name.as_("payment_entry"),
pi.paid_amount.as_("credit"),
pi.posting_date,
pi.supplier.as_("against_account"),
pi.clearance_date,
acc.account_currency,
ConstantColumn(0).as_("debit"),
)
.where(
(pi.docstatus == 1)
& (pi.cash_bank_account == account)
& (pi.posting_date >= from_date)
& (pi.posting_date <= to_date)
)
.orderby(pi.posting_date)
.orderby(pi.name, order=Order.desc)
).run(as_dict=True)
entries = (
list(payment_entries)

View File

@@ -1,39 +1,39 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
cur_frm.add_fetch('bank_account','account','account');
cur_frm.add_fetch('bank_account','bank_account_no','bank_account_no');
cur_frm.add_fetch('bank_account','iban','iban');
cur_frm.add_fetch('bank_account','branch_code','branch_code');
cur_frm.add_fetch('bank','swift_number','swift_number');
cur_frm.add_fetch("bank_account", "account", "account");
cur_frm.add_fetch("bank_account", "bank_account_no", "bank_account_no");
cur_frm.add_fetch("bank_account", "iban", "iban");
cur_frm.add_fetch("bank_account", "branch_code", "branch_code");
cur_frm.add_fetch("bank", "swift_number", "swift_number");
frappe.ui.form.on('Bank Guarantee', {
setup: function(frm) {
frm.set_query("bank", function() {
return {
filters: {
company: frm.doc.company
}
};
});
frm.set_query("bank_account", function() {
frappe.ui.form.on("Bank Guarantee", {
setup: function (frm) {
frm.set_query("bank", function () {
return {
filters: {
company: frm.doc.company,
bank: frm.doc.bank
}
}
},
};
});
frm.set_query("project", function() {
frm.set_query("bank_account", function () {
return {
filters: {
customer: frm.doc.customer
}
company: frm.doc.company,
bank: frm.doc.bank,
},
};
});
frm.set_query("project", function () {
return {
filters: {
customer: frm.doc.customer,
},
};
});
},
bg_type: function(frm) {
bg_type: function (frm) {
if (frm.doc.bg_type == "Receiving") {
frm.set_value("reference_doctype", "Sales Order");
} else if (frm.doc.bg_type == "Providing") {
@@ -41,34 +41,33 @@ frappe.ui.form.on('Bank Guarantee', {
}
},
reference_docname: function(frm) {
reference_docname: function (frm) {
if (frm.doc.reference_docname && frm.doc.reference_doctype) {
let party_field = frm.doc.reference_doctype == "Sales Order" ? "customer" : "supplier";
frappe.call({
method: "erpnext.accounts.doctype.bank_guarantee.bank_guarantee.get_voucher_details",
args: {
"bank_guarantee_type": frm.doc.bg_type,
"reference_name": frm.doc.reference_docname
bank_guarantee_type: frm.doc.bg_type,
reference_name: frm.doc.reference_docname,
},
callback: function(r) {
callback: function (r) {
if (r.message) {
if (r.message[party_field]) frm.set_value(party_field, r.message[party_field]);
if (r.message.project) frm.set_value("project", r.message.project);
if (r.message.grand_total) frm.set_value("amount", r.message.grand_total);
}
}
},
});
}
},
start_date: function(frm) {
start_date: function (frm) {
var end_date = frappe.datetime.add_days(cur_frm.doc.start_date, cur_frm.doc.validity - 1);
cur_frm.set_value("end_date", end_date);
},
validity: function(frm) {
validity: function (frm) {
var end_date = frappe.datetime.add_days(cur_frm.doc.start_date, cur_frm.doc.validity - 1);
cur_frm.set_value("end_date", end_date);
}
},
});

View File

@@ -8,21 +8,22 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
return {
filters: {
company: frm.doc.company,
'is_company_account': 1
is_company_account: 1,
},
};
});
let no_bank_transactions_text =
`<div class="text-muted text-center">${__("No Matching Bank Transactions Found")}</div>`
let no_bank_transactions_text = `<div class="text-muted text-center">${__(
"No Matching Bank Transactions Found"
)}</div>`;
set_field_options("no_bank_transactions", no_bank_transactions_text);
},
onload: function (frm) {
// Set default filter dates
let today = frappe.datetime.get_today()
let today = frappe.datetime.get_today();
frm.doc.bank_statement_from_date = frappe.datetime.add_months(today, -1);
frm.doc.bank_statement_to_date = today;
frm.trigger('bank_account');
frm.trigger("bank_account");
},
filter_by_reference_date: function (frm) {
@@ -37,34 +38,27 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
refresh: function (frm) {
frm.disable_save();
frappe.require("bank-reconciliation-tool.bundle.js", () =>
frm.trigger("make_reconciliation_tool")
);
frappe.require("bank-reconciliation-tool.bundle.js", () => frm.trigger("make_reconciliation_tool"));
frm.add_custom_button(__("Upload Bank Statement"), () =>
frappe.call({
method:
"erpnext.accounts.doctype.bank_statement_import.bank_statement_import.upload_bank_statement",
args: {
dt: frm.doc.doctype,
dn: frm.doc.name,
company: frm.doc.company,
bank_account: frm.doc.bank_account,
},
callback: function (r) {
if (!r.exc) {
var doc = frappe.model.sync(r.message);
frappe.set_route(
"Form",
doc[0].doctype,
doc[0].name
);
}
},
})
frappe.call({
method: "erpnext.accounts.doctype.bank_statement_import.bank_statement_import.upload_bank_statement",
args: {
dt: frm.doc.doctype,
dn: frm.doc.name,
company: frm.doc.company,
bank_account: frm.doc.bank_account,
},
callback: function (r) {
if (!r.exc) {
var doc = frappe.model.sync(r.message);
frappe.set_route("Form", doc[0].doctype, doc[0].name);
}
},
})
);
frm.add_custom_button(__('Auto Reconcile'), function() {
frm.add_custom_button(__("Auto Reconcile"), function () {
frappe.call({
method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.auto_reconcile_vouchers",
args: {
@@ -75,33 +69,22 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
from_reference_date: frm.doc.from_reference_date,
to_reference_date: frm.doc.to_reference_date,
},
})
});
});
frm.add_custom_button(__('Get Unreconciled Entries'), function() {
frm.add_custom_button(__("Get Unreconciled Entries"), function () {
frm.trigger("make_reconciliation_tool");
});
frm.change_custom_button_type(__('Get Unreconciled Entries'), null, 'primary');
frm.change_custom_button_type(__("Get Unreconciled Entries"), null, "primary");
},
bank_account: function (frm) {
frappe.db.get_value(
"Bank Account",
frm.doc.bank_account,
"account",
(r) => {
frappe.db.get_value(
"Account",
r.account,
"account_currency",
(r) => {
frm.doc.account_currency = r.account_currency;
frm.trigger("render_chart");
}
);
}
);
frappe.db.get_value("Bank Account", frm.doc.bank_account, "account", (r) => {
frappe.db.get_value("Account", r.account, "account_currency", (r) => {
frm.doc.account_currency = r.account_currency;
frm.trigger("render_chart");
});
});
frm.trigger("get_account_opening_balance");
},
@@ -120,11 +103,7 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
) {
frm.trigger("render_chart");
frm.trigger("render");
frappe.utils.scroll_to(
frm.get_field("reconciliation_tool_cards").$wrapper,
true,
30
);
frappe.utils.scroll_to(frm.get_field("reconciliation_tool_cards").$wrapper, true, 30);
}
});
}
@@ -133,11 +112,10 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
get_account_opening_balance(frm) {
if (frm.doc.bank_account && frm.doc.bank_statement_from_date) {
frappe.call({
method:
"erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_account_balance",
method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_account_balance",
args: {
bank_account: frm.doc.bank_account,
till_date: frm.doc.bank_statement_from_date,
till_date: frappe.datetime.add_days(frm.doc.bank_statement_from_date, -1),
},
callback: (response) => {
frm.set_value("account_opening_balance", response.message);
@@ -149,8 +127,7 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
get_cleared_balance(frm) {
if (frm.doc.bank_account && frm.doc.bank_statement_to_date) {
return frappe.call({
method:
"erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_account_balance",
method: "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_account_balance",
args: {
bank_account: frm.doc.bank_account,
till_date: frm.doc.bank_statement_to_date,
@@ -163,41 +140,30 @@ frappe.ui.form.on("Bank Reconciliation Tool", {
},
render_chart(frm) {
frm.cards_manager = new erpnext.accounts.bank_reconciliation.NumberCardManager(
{
$reconciliation_tool_cards: frm.get_field(
"reconciliation_tool_cards"
).$wrapper,
bank_statement_closing_balance:
frm.doc.bank_statement_closing_balance,
cleared_balance: frm.cleared_balance,
currency: frm.doc.account_currency,
}
);
frm.cards_manager = new erpnext.accounts.bank_reconciliation.NumberCardManager({
$reconciliation_tool_cards: frm.get_field("reconciliation_tool_cards").$wrapper,
bank_statement_closing_balance: frm.doc.bank_statement_closing_balance,
cleared_balance: frm.cleared_balance,
currency: frm.doc.account_currency,
});
},
render(frm) {
if (frm.doc.bank_account) {
frm.bank_reconciliation_data_table_manager = new erpnext.accounts.bank_reconciliation.DataTableManager(
{
frm.bank_reconciliation_data_table_manager =
new erpnext.accounts.bank_reconciliation.DataTableManager({
company: frm.doc.company,
bank_account: frm.doc.bank_account,
$reconciliation_tool_dt: frm.get_field(
"reconciliation_tool_dt"
).$wrapper,
$no_bank_transactions: frm.get_field(
"no_bank_transactions"
).$wrapper,
$reconciliation_tool_dt: frm.get_field("reconciliation_tool_dt").$wrapper,
$no_bank_transactions: frm.get_field("no_bank_transactions").$wrapper,
bank_statement_from_date: frm.doc.bank_statement_from_date,
bank_statement_to_date: frm.doc.bank_statement_to_date,
filter_by_reference_date: frm.doc.filter_by_reference_date,
from_reference_date: frm.doc.from_reference_date,
to_reference_date: frm.doc.to_reference_date,
bank_statement_closing_balance:
frm.doc.bank_statement_closing_balance,
bank_statement_closing_balance: frm.doc.bank_statement_closing_balance,
cards_manager: frm.cards_manager,
}
);
});
}
},
});

View File

@@ -9,7 +9,6 @@ from frappe import _
from frappe.model.document import Document
from frappe.query_builder.custom import ConstantColumn
from frappe.utils import cint, flt
from pypika.terms import Parameter
from erpnext import get_default_cost_center
from erpnext.accounts.doctype.bank_transaction.bank_transaction import get_total_allocated_amount
@@ -18,6 +17,7 @@ from erpnext.accounts.report.bank_reconciliation_statement.bank_reconciliation_s
get_entries,
)
from erpnext.accounts.utils import get_account_currency, get_balance_on
from erpnext.setup.utils import get_exchange_rate
class BankReconciliationTool(Document):
@@ -150,7 +150,7 @@ def create_journal_entry_bts(
bank_transaction = frappe.db.get_values(
"Bank Transaction",
bank_transaction_name,
fieldname=["name", "deposit", "withdrawal", "bank_account"],
fieldname=["name", "deposit", "withdrawal", "bank_account", "currency"],
as_dict=True,
)[0]
company_account = frappe.get_value("Bank Account", bank_transaction.bank_account, "account")
@@ -164,29 +164,94 @@ def create_journal_entry_bts(
)
company = frappe.get_value("Account", company_account, "company")
company_default_currency = frappe.get_cached_value("Company", company, "default_currency")
company_account_currency = frappe.get_cached_value("Account", company_account, "account_currency")
second_account_currency = frappe.get_cached_value("Account", second_account, "account_currency")
# determine if multi-currency Journal or not
is_multi_currency = (
True
if company_default_currency != company_account_currency
or company_default_currency != second_account_currency
or company_default_currency != bank_transaction.currency
else False
)
accounts = []
# Multi Currency?
accounts.append(
{
"account": second_account,
"credit_in_account_currency": bank_transaction.deposit,
"debit_in_account_currency": bank_transaction.withdrawal,
"party_type": party_type,
"party": party,
"cost_center": get_default_cost_center(company),
}
)
second_account_dict = {
"account": second_account,
"account_currency": second_account_currency,
"credit_in_account_currency": bank_transaction.deposit,
"debit_in_account_currency": bank_transaction.withdrawal,
"party_type": party_type,
"party": party,
"cost_center": get_default_cost_center(company),
}
accounts.append(
{
"account": company_account,
"bank_account": bank_transaction.bank_account,
"credit_in_account_currency": bank_transaction.withdrawal,
"debit_in_account_currency": bank_transaction.deposit,
"cost_center": get_default_cost_center(company),
}
)
company_account_dict = {
"account": company_account,
"account_currency": company_account_currency,
"bank_account": bank_transaction.bank_account,
"credit_in_account_currency": bank_transaction.withdrawal,
"debit_in_account_currency": bank_transaction.deposit,
"cost_center": get_default_cost_center(company),
}
# convert transaction amount to company currency
if is_multi_currency:
exc_rate = get_exchange_rate(bank_transaction.currency, company_default_currency, posting_date)
withdrawal_in_company_currency = flt(exc_rate * abs(bank_transaction.withdrawal))
deposit_in_company_currency = flt(exc_rate * abs(bank_transaction.deposit))
else:
withdrawal_in_company_currency = bank_transaction.withdrawal
deposit_in_company_currency = bank_transaction.deposit
# if second account is of foreign currency, convert and set debit and credit fields.
if second_account_currency != company_default_currency:
exc_rate = get_exchange_rate(second_account_currency, company_default_currency, posting_date)
second_account_dict.update(
{
"exchange_rate": exc_rate,
"credit": deposit_in_company_currency,
"debit": withdrawal_in_company_currency,
"credit_in_account_currency": flt(deposit_in_company_currency / exc_rate) or 0,
"debit_in_account_currency": flt(withdrawal_in_company_currency / exc_rate) or 0,
}
)
else:
second_account_dict.update(
{
"exchange_rate": 1,
"credit": deposit_in_company_currency,
"debit": withdrawal_in_company_currency,
"credit_in_account_currency": deposit_in_company_currency,
"debit_in_account_currency": withdrawal_in_company_currency,
}
)
# if company account is of foreign currency, convert and set debit and credit fields.
if company_account_currency != company_default_currency:
exc_rate = get_exchange_rate(company_account_currency, company_default_currency, posting_date)
company_account_dict.update(
{
"exchange_rate": exc_rate,
"credit": withdrawal_in_company_currency,
"debit": deposit_in_company_currency,
}
)
else:
company_account_dict.update(
{
"exchange_rate": 1,
"credit": withdrawal_in_company_currency,
"debit": deposit_in_company_currency,
"credit_in_account_currency": withdrawal_in_company_currency,
"debit_in_account_currency": deposit_in_company_currency,
}
)
accounts.append(second_account_dict)
accounts.append(company_account_dict)
journal_entry_dict = {
"voucher_type": entry_type,
@@ -196,6 +261,9 @@ def create_journal_entry_bts(
"cheque_no": reference_number,
"mode_of_payment": mode_of_payment,
}
if is_multi_currency:
journal_entry_dict.update({"multi_currency": True})
journal_entry = frappe.new_doc("Journal Entry")
journal_entry.update(journal_entry_dict)
journal_entry.set("accounts", accounts)
@@ -375,6 +443,10 @@ def reconcile_vouchers(bank_transaction_name, vouchers):
vouchers = json.loads(vouchers)
transaction = frappe.get_doc("Bank Transaction", bank_transaction_name)
transaction.add_payment_entries(vouchers)
transaction.validate_duplicate_references()
transaction.allocate_payment_entries()
transaction.update_allocated_amount()
transaction.set_status()
transaction.save()
return transaction
@@ -436,6 +508,18 @@ def check_matching(
to_reference_date,
):
exact_match = True if "exact_match" in document_types else False
common_filters = frappe._dict(
{
"amount": transaction.unallocated_amount,
"payment_type": "Receive" if transaction.deposit > 0.0 else "Pay",
"reference_no": transaction.reference_number,
"party_type": transaction.party_type,
"party": transaction.party,
"bank_account": bank_account,
}
)
queries = get_queries(
bank_account,
company,
@@ -447,20 +531,12 @@ def check_matching(
from_reference_date,
to_reference_date,
exact_match,
common_filters,
)
filters = {
"amount": transaction.unallocated_amount,
"payment_type": "Receive" if transaction.deposit > 0.0 else "Pay",
"reference_no": transaction.reference_number,
"party_type": transaction.party_type,
"party": transaction.party,
"bank_account": bank_account,
}
matching_vouchers = []
for query in queries:
matching_vouchers.extend(frappe.db.sql(query, filters, as_dict=True))
matching_vouchers.extend(query.run(as_dict=True))
return (
sorted(matching_vouchers, key=lambda x: x["rank"], reverse=True) if matching_vouchers else []
@@ -478,6 +554,7 @@ def get_queries(
from_reference_date,
to_reference_date,
exact_match,
common_filters,
):
# get queries to get matching vouchers
account_from_to = "paid_to" if transaction.deposit > 0.0 else "paid_from"
@@ -498,6 +575,7 @@ def get_queries(
filter_by_reference_date,
from_reference_date,
to_reference_date,
common_filters,
)
or []
)
@@ -517,6 +595,7 @@ def get_matching_queries(
filter_by_reference_date,
from_reference_date,
to_reference_date,
common_filters,
):
queries = []
currency = get_account_currency(bank_account)
@@ -531,6 +610,7 @@ def get_matching_queries(
filter_by_reference_date,
from_reference_date,
to_reference_date,
common_filters,
)
queries.append(query)
@@ -543,16 +623,17 @@ def get_matching_queries(
filter_by_reference_date,
from_reference_date,
to_reference_date,
common_filters,
)
queries.append(query)
if transaction.deposit > 0.0 and "sales_invoice" in document_types:
query = get_si_matching_query(exact_match, currency)
query = get_si_matching_query(exact_match, currency, common_filters)
queries.append(query)
if transaction.withdrawal > 0.0:
if "purchase_invoice" in document_types:
query = get_pi_matching_query(exact_match, currency)
query = get_pi_matching_query(exact_match, currency, common_filters)
queries.append(query)
if "bank_transaction" in document_types:
@@ -607,7 +688,7 @@ def get_bt_matching_query(exact_match, transaction):
.where(amount_condition)
.where(bt.docstatus == 1)
)
return str(query)
return query
def get_pe_matching_query(
@@ -619,6 +700,7 @@ def get_pe_matching_query(
filter_by_reference_date,
from_reference_date,
to_reference_date,
common_filters,
):
# get matching payment entries query
to_from = "to" if transaction.deposit > 0.0 else "from"
@@ -661,7 +743,7 @@ def get_pe_matching_query(
.where(pe.docstatus == 1)
.where(pe.payment_type.isin([payment_type, "Internal Transfer"]))
.where(pe.clearance_date.isnull())
.where(getattr(pe, account_from_to) == Parameter("%(bank_account)s"))
.where(getattr(pe, account_from_to) == common_filters.bank_account)
.where(amount_condition)
.where(filter_by_date)
.orderby(pe.reference_date if cint(filter_by_reference_date) else pe.posting_date)
@@ -670,7 +752,7 @@ def get_pe_matching_query(
if frappe.flags.auto_reconcile_vouchers == True:
query = query.where(ref_condition)
return str(query)
return query
def get_je_matching_query(
@@ -681,6 +763,7 @@ def get_je_matching_query(
filter_by_reference_date,
from_reference_date,
to_reference_date,
common_filters,
):
# get matching journal entry query
# We have mapping at the bank level
@@ -720,7 +803,7 @@ def get_je_matching_query(
.where(je.docstatus == 1)
.where(je.voucher_type != "Opening Entry")
.where(je.clearance_date.isnull())
.where(jea.account == Parameter("%(bank_account)s"))
.where(jea.account == common_filters.bank_account)
.where(amount_equality if exact_match else getattr(jea, amount_field) > 0.0)
.where(je.docstatus == 1)
.where(filter_by_date)
@@ -730,19 +813,19 @@ def get_je_matching_query(
if frappe.flags.auto_reconcile_vouchers == True:
query = query.where(ref_condition)
return str(query)
return query
def get_si_matching_query(exact_match, currency):
def get_si_matching_query(exact_match, currency, common_filters):
# get matching sales invoice query
si = frappe.qb.DocType("Sales Invoice")
sip = frappe.qb.DocType("Sales Invoice Payment")
amount_equality = sip.amount == Parameter("%(amount)s")
amount_equality = sip.amount == common_filters.amount
amount_rank = frappe.qb.terms.Case().when(amount_equality, 1).else_(0)
amount_condition = amount_equality if exact_match else sip.amount > 0.0
party_condition = si.customer == Parameter("%(party)s")
party_condition = si.customer == common_filters.party
party_rank = frappe.qb.terms.Case().when(party_condition, 1).else_(0)
query = (
@@ -763,23 +846,23 @@ def get_si_matching_query(exact_match, currency):
)
.where(si.docstatus == 1)
.where(sip.clearance_date.isnull())
.where(sip.account == Parameter("%(bank_account)s"))
.where(sip.account == common_filters.bank_account)
.where(amount_condition)
.where(si.currency == currency)
)
return str(query)
return query
def get_pi_matching_query(exact_match, currency):
def get_pi_matching_query(exact_match, currency, common_filters):
# get matching purchase invoice query when they are also used as payment entries (is_paid)
purchase_invoice = frappe.qb.DocType("Purchase Invoice")
amount_equality = purchase_invoice.paid_amount == Parameter("%(amount)s")
amount_equality = purchase_invoice.paid_amount == common_filters.amount
amount_rank = frappe.qb.terms.Case().when(amount_equality, 1).else_(0)
amount_condition = amount_equality if exact_match else purchase_invoice.paid_amount > 0.0
party_condition = purchase_invoice.supplier == Parameter("%(party)s")
party_condition = purchase_invoice.supplier == common_filters.party
party_rank = frappe.qb.terms.Case().when(party_condition, 1).else_(0)
query = (
@@ -799,9 +882,9 @@ def get_pi_matching_query(exact_match, currency):
.where(purchase_invoice.docstatus == 1)
.where(purchase_invoice.is_paid == 1)
.where(purchase_invoice.clearance_date.isnull())
.where(purchase_invoice.cash_bank_account == Parameter("%(bank_account)s"))
.where(purchase_invoice.cash_bank_account == common_filters.bank_account)
.where(amount_condition)
.where(purchase_invoice.currency == currency)
)
return str(query)
return query

View File

@@ -76,6 +76,7 @@ class TestBankReconciliationTool(AccountsTestMixin, FrappeTestCase):
"deposit": 100,
"bank_account": self.bank_account,
"reference_number": "123",
"currency": "INR",
}
)
.save()

View File

@@ -7,11 +7,9 @@ frappe.ui.form.on("Bank Statement Import", {
frm.import_in_progress = false;
if (data_import !== frm.doc.name) return;
frappe.model.clear_doc("Bank Statement Import", frm.doc.name);
frappe.model
.with_doc("Bank Statement Import", frm.doc.name)
.then(() => {
frm.refresh();
});
frappe.model.with_doc("Bank Statement Import", frm.doc.name).then(() => {
frm.refresh();
});
});
frappe.realtime.on("data_import_progress", (data) => {
frm.import_in_progress = true;
@@ -38,20 +36,9 @@ frappe.ui.form.on("Bank Statement Import", {
: __("Updating {0} of {1}, {2}", message_args);
}
if (data.skipping) {
message = __(
"Skipping {0} of {1}, {2}",
[
data.current,
data.total,
eta_message,
]
);
message = __("Skipping {0} of {1}, {2}", [data.current, data.total, eta_message]);
}
frm.dashboard.show_progress(
__("Import Progress"),
percent,
message
);
frm.dashboard.show_progress(__("Import Progress"), percent, message);
frm.page.set_indicator(__("In Progress"), "orange");
// hide progress when complete
@@ -93,15 +80,12 @@ frappe.ui.form.on("Bank Statement Import", {
frm.trigger("show_report_error_button");
if (frm.doc.status === "Partial Success") {
frm.add_custom_button(__("Export Errored Rows"), () =>
frm.trigger("export_errored_rows")
);
frm.add_custom_button(__("Export Errored Rows"), () => frm.trigger("export_errored_rows"));
}
if (frm.doc.status.includes("Success")) {
frm.add_custom_button(
__("Go to {0} List", [__(frm.doc.reference_doctype)]),
() => frappe.set_route("List", frm.doc.reference_doctype)
frm.add_custom_button(__("Go to {0} List", [__(frm.doc.reference_doctype)]), () =>
frappe.set_route("List", frm.doc.reference_doctype)
);
}
},
@@ -118,13 +102,8 @@ frappe.ui.form.on("Bank Statement Import", {
frm.disable_save();
if (frm.doc.status !== "Success") {
if (!frm.is_new() && frm.has_import_file()) {
let label =
frm.doc.status === "Pending"
? __("Start Import")
: __("Retry");
frm.page.set_primary_action(label, () =>
frm.events.start_import(frm)
);
let label = frm.doc.status === "Pending" ? __("Start Import") : __("Retry");
frm.page.set_primary_action(label, () => frm.events.start_import(frm));
} else {
frm.page.set_primary_action(__("Save"), () => frm.save());
}
@@ -166,24 +145,24 @@ frappe.ui.form.on("Bank Statement Import", {
message =
successful_records.length > 1
? __(
"Successfully imported {0} records out of {1}. Click on Export Errored Rows, fix the errors and import again.",
message_args
)
"Successfully imported {0} records out of {1}. Click on Export Errored Rows, fix the errors and import again.",
message_args
)
: __(
"Successfully imported {0} record out of {1}. Click on Export Errored Rows, fix the errors and import again.",
message_args
);
"Successfully imported {0} record out of {1}. Click on Export Errored Rows, fix the errors and import again.",
message_args
);
} else {
message =
successful_records.length > 1
? __(
"Successfully updated {0} records out of {1}. Click on Export Errored Rows, fix the errors and import again.",
message_args
)
"Successfully updated {0} records out of {1}. Click on Export Errored Rows, fix the errors and import again.",
message_args
)
: __(
"Successfully updated {0} record out of {1}. Click on Export Errored Rows, fix the errors and import again.",
message_args
);
"Successfully updated {0} record out of {1}. Click on Export Errored Rows, fix the errors and import again.",
message_args
);
}
}
frm.dashboard.set_headline(message);
@@ -226,8 +205,7 @@ frappe.ui.form.on("Bank Statement Import", {
},
download_template() {
let method =
"/api/method/frappe.core.doctype.data_import.data_import.download_template";
let method = "/api/method/frappe.core.doctype.data_import.data_import.download_template";
open_url_post(method, {
doctype: "Bank Transaction",
@@ -240,7 +218,7 @@ frappe.ui.form.on("Bank Statement Import", {
"description",
"reference_number",
"bank_account",
"currency"
"currency",
],
},
});
@@ -311,10 +289,7 @@ frappe.ui.form.on("Bank Statement Import", {
show_import_preview(frm, preview_data) {
let import_log = JSON.parse(frm.doc.statement_import_log || "[]");
if (
frm.import_preview &&
frm.import_preview.doctype === frm.doc.reference_doctype
) {
if (frm.import_preview && frm.import_preview.doctype === frm.doc.reference_doctype) {
frm.import_preview.preview_data = preview_data;
frm.import_preview.import_log = import_log;
frm.import_preview.refresh();
@@ -330,19 +305,10 @@ frappe.ui.form.on("Bank Statement Import", {
frm,
events: {
remap_column(changed_map) {
let template_options = JSON.parse(
frm.doc.template_options || "{}"
);
template_options.column_to_field_map =
template_options.column_to_field_map || {};
Object.assign(
template_options.column_to_field_map,
changed_map
);
frm.set_value(
"template_options",
JSON.stringify(template_options)
);
let template_options = JSON.parse(frm.doc.template_options || "{}");
template_options.column_to_field_map = template_options.column_to_field_map || {};
Object.assign(template_options.column_to_field_map, changed_map);
frm.set_value("template_options", JSON.stringify(template_options));
frm.save().then(() => frm.trigger("import_file"));
},
},
@@ -376,8 +342,7 @@ frappe.ui.form.on("Bank Statement Import", {
let other_warnings = [];
for (let warning of warnings) {
if (warning.row) {
warnings_by_row[warning.row] =
warnings_by_row[warning.row] || [];
warnings_by_row[warning.row] = warnings_by_row[warning.row] || [];
warnings_by_row[warning.row].push(warning);
} else {
other_warnings.push(warning);
@@ -392,9 +357,7 @@ frappe.ui.form.on("Bank Statement Import", {
if (w.field) {
let label =
w.field.label +
(w.field.parent !== frm.doc.reference_doctype
? ` (${w.field.parent})`
: "");
(w.field.parent !== frm.doc.reference_doctype ? ` (${w.field.parent})` : "");
return `<li>${label}: ${w.message}</li>`;
}
return `<li>${w.message}</li>`;
@@ -413,10 +376,9 @@ frappe.ui.form.on("Bank Statement Import", {
.map((warning) => {
let header = "";
if (warning.col) {
let column_number = `<span class="text-uppercase">${__(
"Column {0}",
[warning.col]
)}</span>`;
let column_number = `<span class="text-uppercase">${__("Column {0}", [
warning.col,
])}</span>`;
let column_header = columns[warning.col].header_title;
header = `${column_number} (${column_header})`;
}
@@ -455,36 +417,28 @@ frappe.ui.form.on("Bank Statement Import", {
let html = "";
if (log.success) {
if (frm.doc.import_type === "Insert New Records") {
html = __(
"Successfully imported {0}", [
`<span class="underline">${frappe.utils.get_form_link(
frm.doc.reference_doctype,
log.docname,
true
)}<span>`,
]
);
html = __("Successfully imported {0}", [
`<span class="underline">${frappe.utils.get_form_link(
frm.doc.reference_doctype,
log.docname,
true
)}<span>`,
]);
} else {
html = __(
"Successfully updated {0}", [
`<span class="underline">${frappe.utils.get_form_link(
frm.doc.reference_doctype,
log.docname,
true
)}<span>`,
]
);
html = __("Successfully updated {0}", [
`<span class="underline">${frappe.utils.get_form_link(
frm.doc.reference_doctype,
log.docname,
true
)}<span>`,
]);
}
} else {
let messages = log.messages
.map(JSON.parse)
.map((m) => {
let title = m.title
? `<strong>${m.title}</strong>`
: "";
let message = m.message
? `<div>${m.message}</div>`
: "";
let title = m.title ? `<strong>${m.title}</strong>` : "";
let message = m.message ? `<div>${m.message}</div>` : "";
return title + message;
})
.join("");

View File

@@ -1,36 +1,34 @@
let imports_in_progress = [];
frappe.listview_settings['Bank Statement Import'] = {
frappe.listview_settings["Bank Statement Import"] = {
onload(listview) {
frappe.realtime.on('data_import_progress', data => {
frappe.realtime.on("data_import_progress", (data) => {
if (!imports_in_progress.includes(data.data_import)) {
imports_in_progress.push(data.data_import);
}
});
frappe.realtime.on('data_import_refresh', data => {
imports_in_progress = imports_in_progress.filter(
d => d !== data.data_import
);
frappe.realtime.on("data_import_refresh", (data) => {
imports_in_progress = imports_in_progress.filter((d) => d !== data.data_import);
listview.refresh();
});
},
get_indicator: function(doc) {
get_indicator: function (doc) {
var colors = {
'Pending': 'orange',
'Not Started': 'orange',
'Partial Success': 'orange',
'Success': 'green',
'In Progress': 'orange',
'Error': 'red'
Pending: "orange",
"Not Started": "orange",
"Partial Success": "orange",
Success: "green",
"In Progress": "orange",
Error: "red",
};
let status = doc.status;
if (imports_in_progress.includes(doc.name)) {
status = 'In Progress';
status = "In Progress";
}
if (status == 'Pending') {
status = 'Not Started';
if (status == "Pending") {
status = "Not Started";
}
return [__(status), colors[status], 'status,=,' + doc.status];
return [__(status), colors[status], "status,=," + doc.status];
},
hide_name_column: true
hide_name_column: true,
};

View File

@@ -3,7 +3,7 @@
frappe.ui.form.on("Bank Transaction", {
onload(frm) {
frm.set_query("payment_document", "payment_entries", function() {
frm.set_query("payment_document", "payment_entries", function () {
const payment_doctypes = frm.events.get_payment_doctypes(frm);
return {
filters: {
@@ -23,7 +23,7 @@ frappe.ui.form.on("Bank Transaction", {
set_bank_statement_filter(frm);
},
setup: function(frm) {
setup: function (frm) {
frm.set_query("party_type", function () {
return {
filters: {
@@ -33,16 +33,10 @@ frappe.ui.form.on("Bank Transaction", {
});
},
get_payment_doctypes: function() {
get_payment_doctypes: function () {
// get payment doctypes from all the apps
return [
"Payment Entry",
"Journal Entry",
"Sales Invoice",
"Purchase Invoice",
"Bank Transaction",
];
}
return ["Payment Entry", "Journal Entry", "Sales Invoice", "Purchase Invoice", "Bank Transaction"];
},
});
frappe.ui.form.on("Bank Transaction Payments", {
@@ -54,10 +48,11 @@ frappe.ui.form.on("Bank Transaction Payments", {
const update_clearance_date = (frm, cdt, cdn) => {
if (frm.doc.docstatus === 1) {
frappe
.xcall(
"erpnext.accounts.doctype.bank_transaction.bank_transaction.unclear_reference_payment",
{ doctype: cdt, docname: cdn, bt_name: frm.doc.name }
)
.xcall("erpnext.accounts.doctype.bank_transaction.bank_transaction.unclear_reference_payment", {
doctype: cdt,
docname: cdn,
bt_name: frm.doc.name,
})
.then((e) => {
if (e == "success") {
frappe.show_alert({

View File

@@ -3,12 +3,12 @@
import frappe
from frappe import _
from frappe.model.docstatus import DocStatus
from frappe.model.document import Document
from frappe.utils import flt
from erpnext.controllers.status_updater import StatusUpdater
class BankTransaction(StatusUpdater):
class BankTransaction(Document):
# begin: auto-generated types
# This code is auto-generated. Do not modify anything in this block.
@@ -49,6 +49,33 @@ class BankTransaction(StatusUpdater):
def validate(self):
self.validate_duplicate_references()
self.validate_currency()
def validate_currency(self):
"""
Bank Transaction should be on the same currency as the Bank Account.
"""
if self.currency and self.bank_account:
account = frappe.get_cached_value("Bank Account", self.bank_account, "account")
account_currency = frappe.get_cached_value("Account", account, "account_currency")
if self.currency != account_currency:
frappe.throw(
_(
"Transaction currency: {0} cannot be different from Bank Account({1}) currency: {2}"
).format(
frappe.bold(self.currency), frappe.bold(self.bank_account), frappe.bold(account_currency)
)
)
def set_status(self):
if self.docstatus == 2:
self.db_set("status", "Cancelled")
elif self.docstatus == 1:
if self.unallocated_amount > 0:
self.db_set("status", "Unreconciled")
elif self.unallocated_amount <= 0:
self.db_set("status", "Reconciled")
def validate_duplicate_references(self):
"""Make sure the same voucher is not allocated twice within the same Bank Transaction"""
@@ -67,10 +94,13 @@ class BankTransaction(StatusUpdater):
pe.append(reference)
def update_allocated_amount(self):
self.allocated_amount = (
allocated_amount = (
sum(p.allocated_amount for p in self.payment_entries) if self.payment_entries else 0.0
)
self.unallocated_amount = abs(flt(self.withdrawal) - flt(self.deposit)) - self.allocated_amount
unallocated_amount = abs(flt(self.withdrawal) - flt(self.deposit)) - allocated_amount
self.allocated_amount = flt(allocated_amount, self.precision("allocated_amount"))
self.unallocated_amount = flt(unallocated_amount, self.precision("unallocated_amount"))
def before_submit(self):
self.allocate_payment_entries()
@@ -83,12 +113,13 @@ class BankTransaction(StatusUpdater):
self.validate_duplicate_references()
self.allocate_payment_entries()
self.update_allocated_amount()
self.set_status()
def on_cancel(self):
for payment_entry in self.payment_entries:
self.clear_linked_payment_entry(payment_entry, for_cancel=True)
self.set_status(update=True)
self.set_status()
def add_payment_entries(self, vouchers):
"Add the vouchers with zero allocation. Save() will perform the allocations and clearance"
@@ -366,15 +397,17 @@ def set_voucher_clearance(doctype, docname, clearance_date, self):
and len(get_reconciled_bank_transactions(doctype, docname)) < 2
):
return
frappe.db.set_value(doctype, docname, "clearance_date", clearance_date)
elif doctype == "Sales Invoice":
frappe.db.set_value(
"Sales Invoice Payment",
dict(parenttype=doctype, parent=docname),
"clearance_date",
clearance_date,
)
if doctype == "Sales Invoice":
frappe.db.set_value(
"Sales Invoice Payment",
dict(parenttype=doctype, parent=docname),
"clearance_date",
clearance_date,
)
return
frappe.db.set_value(doctype, docname, "clearance_date", clearance_date)
elif doctype == "Bank Transaction":
# For when a second bank transaction has fixed another, e.g. refund
@@ -404,3 +437,21 @@ def unclear_reference_payment(doctype, docname, bt_name):
bt = frappe.get_doc("Bank Transaction", bt_name)
set_voucher_clearance(doctype, docname, None, bt)
return docname
def remove_from_bank_transaction(doctype, docname):
"""Remove a (cancelled) voucher from all Bank Transactions."""
for bt_name in get_reconciled_bank_transactions(doctype, docname):
bt = frappe.get_doc("Bank Transaction", bt_name)
if bt.docstatus == DocStatus.cancelled():
continue
modified = False
for pe in bt.payment_entries:
if pe.payment_document == doctype and pe.payment_entry == docname:
bt.remove(pe)
modified = True
if modified:
bt.save()

View File

@@ -1,15 +1,15 @@
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.listview_settings['Bank Transaction'] = {
frappe.listview_settings["Bank Transaction"] = {
add_fields: ["unallocated_amount"],
get_indicator: function(doc) {
if(doc.docstatus == 2) {
get_indicator: function (doc) {
if (doc.docstatus == 2) {
return [__("Cancelled"), "red", "docstatus,=,2"];
} else if(flt(doc.unallocated_amount)<=0) {
} else if (flt(doc.unallocated_amount) <= 0) {
return [__("Reconciled"), "green", "unallocated_amount,=,0"];
} else if(flt(doc.unallocated_amount)>0) {
} else if (flt(doc.unallocated_amount) > 0) {
return [__("Unreconciled"), "orange", "unallocated_amount,>,0"];
}
}
},
};

View File

@@ -2,10 +2,10 @@
# See license.txt
import json
import unittest
import frappe
from frappe import utils
from frappe.model.docstatus import DocStatus
from frappe.tests.utils import FrappeTestCase
from erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool import (
@@ -32,8 +32,16 @@ class TestBankTransaction(FrappeTestCase):
frappe.db.delete(dt)
clear_loan_transactions()
make_pos_profile()
add_transactions()
add_vouchers()
# generate and use a uniq hash identifier for 'Bank Account' and it's linked GL 'Account' to avoid validation error
uniq_identifier = frappe.generate_hash(length=10)
gl_account = create_gl_account("_Test Bank " + uniq_identifier)
bank_account = create_bank_account(
gl_account=gl_account, bank_account_name="Checking Account " + uniq_identifier
)
add_transactions(bank_account=bank_account)
add_vouchers(gl_account=gl_account)
# This test checks if ERPNext is able to provide a linked payment for a bank transaction based on the amount of the bank transaction.
def test_linked_payments(self):
@@ -81,6 +89,29 @@ class TestBankTransaction(FrappeTestCase):
clearance_date = frappe.db.get_value("Payment Entry", payment.name, "clearance_date")
self.assertFalse(clearance_date)
def test_cancel_voucher(self):
bank_transaction = frappe.get_doc(
"Bank Transaction",
dict(description="1512567 BG/000003025 OPSKATTUZWXXX AT776000000098709849 Herr G"),
)
payment = frappe.get_doc("Payment Entry", dict(party="Mr G", paid_amount=1700))
vouchers = json.dumps(
[
{
"payment_doctype": "Payment Entry",
"payment_name": payment.name,
"amount": bank_transaction.unallocated_amount,
}
]
)
reconcile_vouchers(bank_transaction.name, vouchers)
payment.reload()
payment.cancel()
bank_transaction.reload()
self.assertEqual(bank_transaction.docstatus, DocStatus.submitted())
self.assertEqual(bank_transaction.unallocated_amount, 1700)
self.assertEqual(bank_transaction.payment_entries, [])
# Check if ERPNext can correctly filter a linked payments based on the debit/credit amount
def test_debit_credit_output(self):
bank_transaction = frappe.get_doc(
@@ -196,7 +227,9 @@ def clear_loan_transactions():
frappe.db.delete("Loan Repayment")
def create_bank_account(bank_name="Citi Bank", account_name="_Test Bank - _TC"):
def create_bank_account(
bank_name="Citi Bank", gl_account="_Test Bank - _TC", bank_account_name="Checking Account"
):
try:
frappe.get_doc(
{
@@ -208,21 +241,35 @@ def create_bank_account(bank_name="Citi Bank", account_name="_Test Bank - _TC"):
pass
try:
frappe.get_doc(
bank_account = frappe.get_doc(
{
"doctype": "Bank Account",
"account_name": "Checking Account",
"account_name": bank_account_name,
"bank": bank_name,
"account": account_name,
"account": gl_account,
}
).insert(ignore_if_duplicate=True)
except frappe.DuplicateEntryError:
pass
return bank_account.name
def add_transactions():
create_bank_account()
def create_gl_account(gl_account_name="_Test Bank - _TC"):
gl_account = frappe.get_doc(
{
"doctype": "Account",
"company": "_Test Company",
"parent_account": "Current Assets - _TC",
"account_type": "Bank",
"is_group": 0,
"account_name": gl_account_name,
}
).insert()
return gl_account.name
def add_transactions(bank_account="_Test Bank - _TC"):
doc = frappe.get_doc(
{
"doctype": "Bank Transaction",
@@ -230,7 +277,7 @@ def add_transactions():
"date": "2018-10-23",
"deposit": 1200,
"currency": "INR",
"bank_account": "Checking Account - Citi Bank",
"bank_account": bank_account,
}
).insert()
doc.submit()
@@ -242,7 +289,7 @@ def add_transactions():
"date": "2018-10-23",
"deposit": 1700,
"currency": "INR",
"bank_account": "Checking Account - Citi Bank",
"bank_account": bank_account,
}
).insert()
doc.submit()
@@ -254,7 +301,7 @@ def add_transactions():
"date": "2018-10-26",
"withdrawal": 690,
"currency": "INR",
"bank_account": "Checking Account - Citi Bank",
"bank_account": bank_account,
}
).insert()
doc.submit()
@@ -266,7 +313,7 @@ def add_transactions():
"date": "2018-10-27",
"deposit": 3900,
"currency": "INR",
"bank_account": "Checking Account - Citi Bank",
"bank_account": bank_account,
}
).insert()
doc.submit()
@@ -278,13 +325,13 @@ def add_transactions():
"date": "2018-10-27",
"withdrawal": 109080,
"currency": "INR",
"bank_account": "Checking Account - Citi Bank",
"bank_account": bank_account,
}
).insert()
doc.submit()
def add_vouchers():
def add_vouchers(gl_account="_Test Bank - _TC"):
try:
frappe.get_doc(
{
@@ -300,7 +347,7 @@ def add_vouchers():
pi = make_purchase_invoice(supplier="Conrad Electronic", qty=1, rate=690)
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Bank - _TC")
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account=gl_account)
pe.reference_no = "Conrad Oct 18"
pe.reference_date = "2018-10-24"
pe.insert()
@@ -319,14 +366,14 @@ def add_vouchers():
pass
pi = make_purchase_invoice(supplier="Mr G", qty=1, rate=1200)
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Bank - _TC")
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account=gl_account)
pe.reference_no = "Herr G Oct 18"
pe.reference_date = "2018-10-24"
pe.insert()
pe.submit()
pi = make_purchase_invoice(supplier="Mr G", qty=1, rate=1700)
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Bank - _TC")
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account=gl_account)
pe.reference_no = "Herr G Nov 18"
pe.reference_date = "2018-11-01"
pe.insert()
@@ -357,10 +404,10 @@ def add_vouchers():
pass
pi = make_purchase_invoice(supplier="Poore Simon's", qty=1, rate=3900, is_paid=1, do_not_save=1)
pi.cash_bank_account = "_Test Bank - _TC"
pi.cash_bank_account = gl_account
pi.insert()
pi.submit()
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Bank - _TC")
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account=gl_account)
pe.reference_no = "Poore Simon's Oct 18"
pe.reference_date = "2018-10-28"
pe.paid_amount = 690
@@ -369,7 +416,7 @@ def add_vouchers():
pe.submit()
si = create_sales_invoice(customer="Poore Simon's", qty=1, rate=3900)
pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Bank - _TC")
pe = get_payment_entry("Sales Invoice", si.name, bank_account=gl_account)
pe.reference_no = "Poore Simon's Oct 18"
pe.reference_date = "2018-10-28"
pe.insert()
@@ -392,16 +439,12 @@ def add_vouchers():
if not frappe.db.get_value(
"Mode of Payment Account", {"company": "_Test Company", "parent": "Cash"}
):
mode_of_payment.append(
"accounts", {"company": "_Test Company", "default_account": "_Test Bank - _TC"}
)
mode_of_payment.append("accounts", {"company": "_Test Company", "default_account": gl_account})
mode_of_payment.save()
si = create_sales_invoice(customer="Fayva", qty=1, rate=109080, do_not_save=1)
si.is_pos = 1
si.append(
"payments", {"mode_of_payment": "Cash", "account": "_Test Bank - _TC", "amount": 109080}
)
si.append("payments", {"mode_of_payment": "Cash", "account": gl_account, "amount": 109080})
si.insert()
si.submit()

View File

@@ -2,48 +2,48 @@
// For license information, please see license.txt
frappe.provide("erpnext.accounts.dimensions");
frappe.ui.form.on('Budget', {
onload: function(frm) {
frm.set_query("account", "accounts", function() {
frappe.ui.form.on("Budget", {
onload: function (frm) {
frm.set_query("account", "accounts", function () {
return {
filters: {
company: frm.doc.company,
report_type: "Profit and Loss",
is_group: 0
}
is_group: 0,
},
};
});
frm.set_query("monthly_distribution", function() {
frm.set_query("monthly_distribution", function () {
return {
filters: {
fiscal_year: frm.doc.fiscal_year
}
fiscal_year: frm.doc.fiscal_year,
},
};
});
erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
},
refresh: function(frm) {
frm.trigger("toggle_reqd_fields")
refresh: function (frm) {
frm.trigger("toggle_reqd_fields");
},
budget_against: function(frm) {
frm.trigger("set_null_value")
frm.trigger("toggle_reqd_fields")
budget_against: function (frm) {
frm.trigger("set_null_value");
frm.trigger("toggle_reqd_fields");
},
set_null_value: function(frm) {
if(frm.doc.budget_against == 'Cost Center') {
frm.set_value('project', null)
set_null_value: function (frm) {
if (frm.doc.budget_against == "Cost Center") {
frm.set_value("project", null);
} else {
frm.set_value('cost_center', null)
frm.set_value("cost_center", null);
}
},
toggle_reqd_fields: function(frm) {
frm.toggle_reqd("cost_center", frm.doc.budget_against=="Cost Center");
frm.toggle_reqd("project", frm.doc.budget_against=="Project");
}
toggle_reqd_fields: function (frm) {
frm.toggle_reqd("cost_center", frm.doc.budget_against == "Cost Center");
frm.toggle_reqd("project", frm.doc.budget_against == "Project");
},
});

View File

@@ -1,11 +1,10 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.ui.form.on('Cashier Closing', {
setup: function(frm){
frappe.ui.form.on("Cashier Closing", {
setup: function (frm) {
if (frm.doc.user == "" || frm.doc.user == null) {
frm.doc.user = frappe.session.user;
}
}
},
});

View File

@@ -1,457 +1,152 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"actions": [],
"autoname": "naming_series:",
"beta": 0,
"creation": "2018-06-18 16:51:49.994750",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"naming_series",
"user",
"date",
"from_time",
"time",
"expense",
"custody",
"returns",
"outstanding_amount",
"payments",
"net_amount",
"amended_from"
],
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "POS-CLO-",
"fieldname": "naming_series",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_global_search": 1,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Series",
"length": 0,
"no_copy": 0,
"options": "POS-CLO-",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "user",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "User",
"length": 0,
"no_copy": 0,
"options": "User",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Today",
"fieldname": "date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "from_time",
"fieldtype": "Time",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "From Time",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "",
"fieldname": "time",
"fieldtype": "Time",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 1,
"label": "To Time",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"reqd": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "0.00",
"fieldname": "expense",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Expense",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"label": "Expense"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "0.00",
"fieldname": "custody",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Custody",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"label": "Custody"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "0.00",
"fieldname": "returns",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Returns",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "2",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
"precision": "2"
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "0.00",
"fieldname": "outstanding_amount",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Outstanding Amount",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "0.0",
"fieldname": "payments",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Payments",
"length": 0,
"no_copy": 0,
"options": "Cashier Closing Payments",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"options": "Cashier Closing Payments"
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "net_amount",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Net Amount",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"read_only": 1
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "amended_from",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Amended From",
"length": 0,
"no_copy": 1,
"options": "Cashier Closing",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
"read_only": 1
}
],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2019-02-19 08:35:24.157327",
"links": [],
"modified": "2023-12-28 13:15:46.858427",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Cashier Closing",
"name_case": "",
"naming_rule": "By \"Naming Series\" field",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"write": 1
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0,
"track_views": 0
}
"states": [],
"track_changes": 1
}

View File

@@ -1,4 +1,4 @@
frappe.ui.form.on('Chart of Accounts Importer', {
frappe.ui.form.on("Chart of Accounts Importer", {
onload: function (frm) {
frm.set_value("company", "");
frm.set_value("import_file", "");
@@ -8,31 +8,34 @@ frappe.ui.form.on('Chart of Accounts Importer', {
frm.disable_save();
// make company mandatory
frm.set_df_property('company', 'reqd', frm.doc.company ? 0 : 1);
frm.set_df_property('import_file_section', 'hidden', frm.doc.company ? 0 : 1);
frm.set_df_property("company", "reqd", frm.doc.company ? 0 : 1);
frm.set_df_property("import_file_section", "hidden", frm.doc.company ? 0 : 1);
if (frm.doc.import_file) {
frappe.run_serially([
() => generate_tree_preview(frm),
() => create_import_button(frm),
() => frm.set_df_property('chart_preview', 'hidden', 0)
() => frm.set_df_property("chart_preview", "hidden", 0),
]);
}
frm.set_df_property('chart_preview', 'hidden',
$(frm.fields_dict['chart_tree'].wrapper).html()!="" ? 0 : 1);
frm.set_df_property(
"chart_preview",
"hidden",
$(frm.fields_dict["chart_tree"].wrapper).html() != "" ? 0 : 1
);
},
download_template: function(frm) {
download_template: function (frm) {
var d = new frappe.ui.Dialog({
title: __("Download Template"),
fields: [
{
label : "File Type",
label: "File Type",
fieldname: "file_type",
fieldtype: "Select",
reqd: 1,
options: ["Excel", "CSV"]
options: ["Excel", "CSV"],
},
{
label: "Template Type",
@@ -41,21 +44,27 @@ frappe.ui.form.on('Chart of Accounts Importer', {
reqd: 1,
options: ["Sample Template", "Blank Template"],
change: () => {
let template_type = d.get_value('template_type');
let template_type = d.get_value("template_type");
if (template_type === "Sample Template") {
d.set_df_property('template_type', 'description',
d.set_df_property(
"template_type",
"description",
`The Sample Template contains all the required accounts pre filled in the template.
You can add more accounts or change existing accounts in the template as per your choice.`);
You can add more accounts or change existing accounts in the template as per your choice.`
);
} else {
d.set_df_property('template_type', 'description',
d.set_df_property(
"template_type",
"description",
`The Blank Template contains just the account type and root type required to build the Chart
of Accounts. Please enter the account names and add more rows as per your requirement.`);
of Accounts. Please enter the account names and add more rows as per your requirement.`
);
}
}
},
},
{
label : "Company",
label: "Company",
fieldname: "company",
fieldtype: "Link",
reqd: 1,
@@ -63,25 +72,25 @@ frappe.ui.form.on('Chart of Accounts Importer', {
default: frm.doc.company,
},
],
primary_action: function() {
primary_action: function () {
let data = d.get_values();
if (!data.template_type) {
frappe.throw(__('Please select <b>Template Type</b> to download template'));
frappe.throw(__("Please select <b>Template Type</b> to download template"));
}
open_url_post(
'/api/method/erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.download_template',
"/api/method/erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.download_template",
{
file_type: data.file_type,
template_type: data.template_type,
company: data.company
company: data.company,
}
);
d.hide();
},
primary_action_label: __('Download')
primary_action_label: __("Download"),
});
d.show();
},
@@ -89,7 +98,7 @@ frappe.ui.form.on('Chart of Accounts Importer', {
import_file: function (frm) {
if (!frm.doc.import_file) {
frm.page.set_indicator("");
$(frm.fields_dict['chart_tree'].wrapper).empty(); // empty wrapper on removing file
$(frm.fields_dict["chart_tree"].wrapper).empty(); // empty wrapper on removing file
}
},
@@ -99,89 +108,97 @@ frappe.ui.form.on('Chart of Accounts Importer', {
frappe.call({
method: "erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.validate_company",
args: {
company: frm.doc.company
company: frm.doc.company,
},
callback: function(r) {
if(r.message===false) {
callback: function (r) {
if (r.message === false) {
frm.set_value("company", "");
frappe.throw(__("Transactions against the Company already exist! Chart of Accounts can only be imported for a Company with no transactions."));
frappe.throw(
__(
"Transactions against the Company already exist! Chart of Accounts can only be imported for a Company with no transactions."
)
);
} else {
frm.trigger("refresh");
}
}
},
});
}
}
},
});
var create_import_button = function(frm) {
frm.page.set_primary_action(__("Import"), function () {
var create_import_button = function (frm) {
frm.page
.set_primary_action(__("Import"), function () {
return frappe.call({
method: "erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.import_coa",
args: {
file_name: frm.doc.import_file,
company: frm.doc.company,
},
freeze: true,
freeze_message: __("Creating Accounts..."),
callback: function (r) {
if (!r.exc) {
clearInterval(frm.page["interval"]);
frm.page.set_indicator(__("Import Successful"), "blue");
create_reset_button(frm);
}
},
});
})
.addClass("btn btn-primary");
};
var create_reset_button = function (frm) {
frm.page
.set_primary_action(__("Reset"), function () {
frm.page.clear_primary_action();
delete frm.page["show_import_button"];
frm.reload_doc();
})
.addClass("btn btn-primary");
};
var validate_coa = function (frm) {
if (frm.doc.import_file) {
let parent = __("All Accounts");
return frappe.call({
method: "erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.import_coa",
method: "erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.get_coa",
args: {
file_name: frm.doc.import_file,
company: frm.doc.company
},
freeze: true,
freeze_message: __("Creating Accounts..."),
callback: function(r) {
if (!r.exc) {
clearInterval(frm.page["interval"]);
frm.page.set_indicator(__('Import Successful'), 'blue');
create_reset_button(frm);
}
}
});
}).addClass('btn btn-primary');
};
var create_reset_button = function(frm) {
frm.page.set_primary_action(__("Reset"), function () {
frm.page.clear_primary_action();
delete frm.page["show_import_button"];
frm.reload_doc();
}).addClass('btn btn-primary');
};
var validate_coa = function(frm) {
if (frm.doc.import_file) {
let parent = __('All Accounts');
return frappe.call({
'method': 'erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.get_coa',
'args': {
file_name: frm.doc.import_file,
parent: parent,
doctype: 'Chart of Accounts Importer',
doctype: "Chart of Accounts Importer",
file_type: frm.doc.file_type,
for_validate: 1
for_validate: 1,
},
callback: function(r) {
if (r.message['show_import_button']) {
frm.page['show_import_button'] = Boolean(r.message['show_import_button']);
callback: function (r) {
if (r.message["show_import_button"]) {
frm.page["show_import_button"] = Boolean(r.message["show_import_button"]);
}
}
},
});
}
};
var generate_tree_preview = function(frm) {
let parent = __('All Accounts');
$(frm.fields_dict['chart_tree'].wrapper).empty(); // empty wrapper to load new data
var generate_tree_preview = function (frm) {
let parent = __("All Accounts");
$(frm.fields_dict["chart_tree"].wrapper).empty(); // empty wrapper to load new data
// generate tree structure based on the csv data
return new frappe.ui.Tree({
parent: $(frm.fields_dict['chart_tree'].wrapper),
parent: $(frm.fields_dict["chart_tree"].wrapper),
label: parent,
expandable: true,
method: 'erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.get_coa',
method: "erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.get_coa",
args: {
file_name: frm.doc.import_file,
parent: parent,
doctype: 'Chart of Accounts Importer',
file_type: frm.doc.file_type
doctype: "Chart of Accounts Importer",
file_type: frm.doc.file_type,
},
onclick: function(node) {
onclick: function (node) {
parent = node.value;
}
},
});
};

View File

@@ -3,18 +3,20 @@
frappe.provide("erpnext.cheque_print");
frappe.ui.form.on('Cheque Print Template', {
refresh: function(frm) {
if(!frm.doc.__islocal) {
frm.add_custom_button(frm.doc.has_print_format?__("Update Print Format"):__("Create Print Format"),
function() {
frappe.ui.form.on("Cheque Print Template", {
refresh: function (frm) {
if (!frm.doc.__islocal) {
frm.add_custom_button(
frm.doc.has_print_format ? __("Update Print Format") : __("Create Print Format"),
function () {
erpnext.cheque_print.view_cheque_print(frm);
}).addClass("btn-primary");
}
).addClass("btn-primary");
$(frm.fields_dict.cheque_print_preview.wrapper).empty()
$(frm.fields_dict.cheque_print_preview.wrapper).empty();
var template = '<div style="position: relative; overflow-x: scroll;">\
var template =
'<div style="position: relative; overflow-x: scroll;">\
<div id="cheque_preview" style="width: {{ cheque_width }}cm; \
height: {{ cheque_height }}cm;\
background-repeat: no-repeat;\
@@ -48,30 +50,30 @@ frappe.ui.form.on('Cheque Print Template', {
</div>\
</div>';
$(frappe.render(template, frm.doc)).appendTo(frm.fields_dict.cheque_print_preview.wrapper)
$(frappe.render(template, frm.doc)).appendTo(frm.fields_dict.cheque_print_preview.wrapper);
if (frm.doc.scanned_cheque) {
$(frm.fields_dict.cheque_print_preview.wrapper).find("#cheque_preview").css('background-image', 'url(' + frm.doc.scanned_cheque + ')');
$(frm.fields_dict.cheque_print_preview.wrapper)
.find("#cheque_preview")
.css("background-image", "url(" + frm.doc.scanned_cheque + ")");
}
}
}
},
});
erpnext.cheque_print.view_cheque_print = function(frm) {
erpnext.cheque_print.view_cheque_print = function (frm) {
frappe.call({
method: "erpnext.accounts.doctype.cheque_print_template.cheque_print_template.create_or_update_cheque_print_format",
args:{
"template_name": frm.doc.name
args: {
template_name: frm.doc.name,
},
callback: function(r) {
callback: function (r) {
if (!r.exe && !frm.doc.has_print_format) {
var doc = frappe.model.sync(r.message);
frappe.set_route("Form", r.message.doctype, r.message.name);
} else {
frappe.msgprint(__("Print settings updated in respective print format"));
}
else {
frappe.msgprint(__("Print settings updated in respective print format"))
}
}
})
}
},
});
};

View File

@@ -3,75 +3,80 @@
frappe.provide("erpnext.accounts");
frappe.ui.form.on('Cost Center', {
onload: function(frm) {
frm.set_query("parent_cost_center", function() {
frappe.ui.form.on("Cost Center", {
onload: function (frm) {
frm.set_query("parent_cost_center", function () {
return {
filters: {
company: frm.doc.company,
is_group: 1
}
}
is_group: 1,
},
};
});
},
refresh: function(frm) {
refresh: function (frm) {
if (!frm.is_new()) {
frm.add_custom_button(__('Update Cost Center Name / Number'), function () {
frm.add_custom_button(__("Update Cost Center Name / Number"), function () {
frm.trigger("update_cost_center_number");
});
}
let intro_txt = '';
let intro_txt = "";
let doc = frm.doc;
frm.toggle_display('cost_center_name', doc.__islocal);
frm.toggle_enable(['is_group', 'company'], doc.__islocal);
frm.toggle_display("cost_center_name", doc.__islocal);
frm.toggle_enable(["is_group", "company"], doc.__islocal);
if(!doc.__islocal && doc.is_group==1) {
intro_txt += __('Note: This Cost Center is a Group. Cannot make accounting entries against groups.');
if (!doc.__islocal && doc.is_group == 1) {
intro_txt += __(
"Note: This Cost Center is a Group. Cannot make accounting entries against groups."
);
}
frm.events.hide_unhide_group_ledger(frm);
frm.toggle_display('sb1', doc.is_group==0);
frm.toggle_display("sb1", doc.is_group == 0);
frm.set_intro(intro_txt);
if(!frm.doc.__islocal) {
frm.add_custom_button(__('Chart of Cost Centers'),
function() { frappe.set_route("Tree", "Cost Center"); });
if (!frm.doc.__islocal) {
frm.add_custom_button(__("Chart of Cost Centers"), function () {
frappe.set_route("Tree", "Cost Center");
});
frm.add_custom_button(__('Budget'),
function() { frappe.set_route("List", "Budget", {'cost_center': frm.doc.name}); });
frm.add_custom_button(__("Budget"), function () {
frappe.set_route("List", "Budget", { cost_center: frm.doc.name });
});
}
},
update_cost_center_number: function(frm) {
update_cost_center_number: function (frm) {
var d = new frappe.ui.Dialog({
title: __('Update Cost Center Name / Number'),
title: __("Update Cost Center Name / Number"),
fields: [
{
"label": "Cost Center Name",
"fieldname": "cost_center_name",
"fieldtype": "Data",
"reqd": 1,
"default": frm.doc.cost_center_name
label: "Cost Center Name",
fieldname: "cost_center_name",
fieldtype: "Data",
reqd: 1,
default: frm.doc.cost_center_name,
},
{
"label": "Cost Center Number",
"fieldname": "cost_center_number",
"fieldtype": "Data",
"default": frm.doc.cost_center_number
label: "Cost Center Number",
fieldname: "cost_center_number",
fieldtype: "Data",
default: frm.doc.cost_center_number,
},
{
"label": __("Merge with existing"),
"fieldname": "merge",
"fieldtype": "Check",
"default": 0
}
label: __("Merge with existing"),
fieldname: "merge",
fieldtype: "Check",
default: 0,
},
],
primary_action: function() {
primary_action: function () {
let data = d.get_values();
if(data.cost_center_name === frm.doc.cost_center_name && data.cost_center_number === frm.doc.cost_center_number) {
if (
data.cost_center_name === frm.doc.cost_center_name &&
data.cost_center_number === frm.doc.cost_center_number
) {
d.hide();
return;
}
@@ -83,12 +88,12 @@ frappe.ui.form.on('Cost Center', {
cost_center_name: data.cost_center_name,
cost_center_number: cstr(data.cost_center_number),
company: frm.doc.company,
merge: data.merge
merge: data.merge,
},
callback: function(r) {
callback: function (r) {
frappe.dom.unfreeze();
if(!r.exc) {
if(r.message) {
if (!r.exc) {
if (r.message) {
frappe.set_route("Form", "Cost Center", r.message);
} else {
frm.set_value("cost_center_name", data.cost_center_name);
@@ -96,44 +101,42 @@ frappe.ui.form.on('Cost Center', {
}
d.hide();
}
}
},
});
},
primary_action_label: __('Update')
primary_action_label: __("Update"),
});
d.show();
},
parent_cost_center(frm) {
if(!frm.doc.company) {
frappe.msgprint(__('Please enter company name first'));
if (!frm.doc.company) {
frappe.msgprint(__("Please enter company name first"));
}
},
hide_unhide_group_ledger(frm) {
let doc = frm.doc;
if (doc.is_group == 1) {
frm.add_custom_button(__('Convert to Non-Group'),
() => frm.events.convert_to_ledger(frm));
frm.add_custom_button(__("Convert to Non-Group"), () => frm.events.convert_to_ledger(frm));
} else if (doc.is_group == 0) {
frm.add_custom_button(__('Convert to Group'),
() => frm.events.convert_to_group(frm));
frm.add_custom_button(__("Convert to Group"), () => frm.events.convert_to_group(frm));
}
},
convert_to_group(frm) {
frm.call('convert_ledger_to_group').then(r => {
if(r.message === 1) {
frm.call("convert_ledger_to_group").then((r) => {
if (r.message === 1) {
frm.refresh();
}
});
},
convert_to_ledger(frm) {
frm.call('convert_group_to_ledger').then(r => {
if(r.message === 1) {
frm.call("convert_group_to_ledger").then((r) => {
if (r.message === 1) {
frm.refresh();
}
});
}
},
});

View File

@@ -41,7 +41,7 @@
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Cost Center Number",
"read_only": 1
"read_only_depends_on": "eval:!doc.__islocal"
},
{
"fieldname": "parent_cost_center",
@@ -170,4 +170,4 @@
"sort_field": "modified",
"sort_order": "ASC",
"states": []
}
}

View File

@@ -1,54 +1,84 @@
frappe.treeview_settings["Cost Center"] = {
breadcrumb: "Accounts",
get_tree_root: false,
filters: [{
fieldname: "company",
fieldtype:"Select",
options: erpnext.utils.get_tree_options("company"),
label: __("Company"),
default: erpnext.utils.get_tree_default("company")
}],
root_label: "Cost Centers",
get_tree_nodes: 'erpnext.accounts.utils.get_children',
add_tree_node: 'erpnext.accounts.utils.add_cc',
menu_items:[
filters: [
{
label: __('New Company'),
action: function() { frappe.new_doc("Company", true) },
condition: 'frappe.boot.user.can_create.indexOf("Company") !== -1'
}
fieldname: "company",
fieldtype: "Select",
options: erpnext.utils.get_tree_options("company"),
label: __("Company"),
default: erpnext.utils.get_tree_default("company"),
},
],
fields:[
{fieldtype:'Data', fieldname:'cost_center_name', label:__('New Cost Center Name'), reqd:true},
{fieldtype:'Check', fieldname:'is_group', label:__('Is Group'),
description:__('Further cost centers can be made under Groups but entries can be made against non-Groups')},
{fieldtype:'Data', fieldname:'cost_center_number', label:__('Cost Center Number'),
description: __("Number of new Cost Center, it will be included in the cost center name as a prefix")}
root_label: "Cost Centers",
get_tree_nodes: "erpnext.accounts.utils.get_children",
add_tree_node: "erpnext.accounts.utils.add_cc",
menu_items: [
{
label: __("New Company"),
action: function () {
frappe.new_doc("Company", true);
},
condition: 'frappe.boot.user.can_create.indexOf("Company") !== -1',
},
],
ignore_fields:["parent_cost_center"],
onload: function(treeview) {
fields: [
{ fieldtype: "Data", fieldname: "cost_center_name", label: __("New Cost Center Name"), reqd: true },
{
fieldtype: "Check",
fieldname: "is_group",
label: __("Is Group"),
description: __(
"Further cost centers can be made under Groups but entries can be made against non-Groups"
),
},
{
fieldtype: "Data",
fieldname: "cost_center_number",
label: __("Cost Center Number"),
description: __(
"Number of new Cost Center, it will be included in the cost center name as a prefix"
),
},
],
ignore_fields: ["parent_cost_center"],
onload: function (treeview) {
function get_company() {
return treeview.page.fields_dict.company.get_value();
}
// tools
treeview.page.add_inner_button(__("Chart of Accounts"), function() {
frappe.set_route('Tree', 'Account', {company: get_company()});
}, __('View'));
treeview.page.add_inner_button(
__("Chart of Accounts"),
function () {
frappe.set_route("Tree", "Account", { company: get_company() });
},
__("View")
);
// make
treeview.page.add_inner_button(__("Budget List"), function() {
frappe.set_route('List', 'Budget', {company: get_company()});
}, __('Budget'));
treeview.page.add_inner_button(
__("Budget List"),
function () {
frappe.set_route("List", "Budget", { company: get_company() });
},
__("Budget")
);
treeview.page.add_inner_button(__("Monthly Distribution"), function() {
frappe.set_route('List', 'Monthly Distribution', {company: get_company()});
}, __('Budget'));
treeview.page.add_inner_button(
__("Monthly Distribution"),
function () {
frappe.set_route("List", "Monthly Distribution", { company: get_company() });
},
__("Budget")
);
treeview.page.add_inner_button(__("Budget Variance Report"), function() {
frappe.set_route('query-report', 'Budget Variance Report', {company: get_company()});
}, __('Budget'));
}
}
treeview.page.add_inner_button(
__("Budget Variance Report"),
function () {
frappe.set_route("query-report", "Budget Variance Report", { company: get_company() });
},
__("Budget")
);
},
};

View File

@@ -1,19 +1,24 @@
// Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Cost Center Allocation', {
setup: function(frm) {
let filters = {"is_group": 0};
if (frm.doc.company) {
$.extend(filters, {
"company": frm.doc.company
});
}
frm.set_query('main_cost_center', function() {
frappe.ui.form.on("Cost Center Allocation", {
setup: function (frm) {
frm.set_query("main_cost_center", function () {
return {
filters: filters
filters: {
company: frm.doc.company,
is_group: 0,
},
};
});
}
frm.set_query("cost_center", "allocation_percentages", function () {
return {
filters: {
company: frm.doc.company,
is_group: 0,
},
};
});
},
});

View File

@@ -1,44 +1,41 @@
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Coupon Code', {
setup: function(frm) {
frm.set_query("pricing_rule", function() {
frappe.ui.form.on("Coupon Code", {
setup: function (frm) {
frm.set_query("pricing_rule", function () {
return {
filters: [
["Pricing Rule","coupon_code_based", "=", "1"]
]
filters: [["Pricing Rule", "coupon_code_based", "=", "1"]],
};
});
},
coupon_name:function(frm){
if (frm.doc.__islocal===1) {
coupon_name: function (frm) {
if (frm.doc.__islocal === 1) {
frm.trigger("make_coupon_code");
}
},
coupon_type:function(frm){
if (frm.doc.__islocal===1) {
coupon_type: function (frm) {
if (frm.doc.__islocal === 1) {
frm.trigger("make_coupon_code");
}
},
make_coupon_code: function(frm) {
var coupon_name=frm.doc.coupon_name;
make_coupon_code: function (frm) {
var coupon_name = frm.doc.coupon_name;
var coupon_code;
if (frm.doc.coupon_type=='Gift Card') {
coupon_code=Math.random().toString(12).substring(2, 12).toUpperCase();
if (frm.doc.coupon_type == "Gift Card") {
coupon_code = Math.random().toString(12).substring(2, 12).toUpperCase();
} else if (frm.doc.coupon_type == "Promotional") {
coupon_name = coupon_name.replace(/\s/g, "");
coupon_code = coupon_name.toUpperCase().slice(0, 8);
}
else if(frm.doc.coupon_type=='Promotional'){
coupon_name=coupon_name.replace(/\s/g,'');
coupon_code=coupon_name.toUpperCase().slice(0,8);
}
frm.doc.coupon_code=coupon_code;
frm.refresh_field('coupon_code');
frm.doc.coupon_code = coupon_code;
frm.refresh_field("coupon_code");
},
refresh: function(frm) {
refresh: function (frm) {
if (frm.doc.pricing_rule) {
frm.add_custom_button(__("Add/Edit Coupon Conditions"), function(){
frm.add_custom_button(__("Add/Edit Coupon Conditions"), function () {
frappe.set_route("Form", "Pricing Rule", frm.doc.pricing_rule);
});
}
}
},
});

View File

@@ -1,28 +1,27 @@
// Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Currency Exchange Settings', {
service_provider: function(frm) {
frappe.ui.form.on("Currency Exchange Settings", {
service_provider: function (frm) {
if (frm.doc.service_provider == "exchangerate.host") {
let result = ['result'];
let result = ["result"];
let params = {
date: '{transaction_date}',
from: '{from_currency}',
to: '{to_currency}'
date: "{transaction_date}",
from: "{from_currency}",
to: "{to_currency}",
};
add_param(frm, "https://api.exchangerate.host/convert", params, result);
} else if (frm.doc.service_provider == "frankfurter.app") {
let result = ['rates', '{to_currency}'];
let result = ["rates", "{to_currency}"];
let params = {
base: '{from_currency}',
symbols: '{to_currency}'
base: "{from_currency}",
symbols: "{to_currency}",
};
add_param(frm, "https://frankfurter.app/{transaction_date}", params, result);
}
}
},
});
function add_param(frm, api, params, result) {
var row;
frm.clear_table("req_params");
@@ -30,13 +29,13 @@ function add_param(frm, api, params, result) {
frm.doc.api_endpoint = api;
$.each(params, function(key, value) {
$.each(params, function (key, value) {
row = frm.add_child("req_params");
row.key = key;
row.value = value;
});
$.each(result, function(key, value) {
$.each(result, function (key, value) {
row = frm.add_child("result_key");
row.key = value;
});

View File

@@ -10,7 +10,7 @@ frappe.ui.form.on("Dunning", {
company: frm.doc.company,
customer: frm.doc.customer,
outstanding_amount: [">", 0],
status: "Overdue"
status: "Overdue",
},
};
});
@@ -19,16 +19,16 @@ frappe.ui.form.on("Dunning", {
filters: {
company: frm.doc.company,
root_type: "Income",
is_group: 0
}
is_group: 0,
},
};
});
frm.set_query("cost_center", () => {
return {
filters: {
company: frm.doc.company,
is_group: 0
}
is_group: 0,
},
};
});
@@ -51,7 +51,8 @@ frappe.ui.form.on("Dunning", {
__("Payment"),
function () {
frm.events.make_payment_entry(frm);
}, __("Create")
},
__("Create")
);
frm.page.set_inner_btn_group_as_primary(__("Create"));
}
@@ -69,7 +70,7 @@ frappe.ui.form.on("Dunning", {
get_query_filters: {
docstatus: 1,
status: "Overdue",
company: frm.doc.company
company: frm.doc.company,
},
allow_child_item_selection: true,
child_fieldname: "payment_schedule",
@@ -78,9 +79,12 @@ frappe.ui.form.on("Dunning", {
});
}
frappe.dynamic_link = { doc: frm.doc, fieldname: 'customer', doctype: 'Customer' };
frappe.dynamic_link = { doc: frm.doc, fieldname: "customer", doctype: "Customer" };
frm.toggle_display("customer_name", (frm.doc.customer_name && frm.doc.customer_name !== frm.doc.customer));
frm.toggle_display(
"customer_name",
frm.doc.customer_name && frm.doc.customer_name !== frm.doc.customer
);
},
// When multiple companies are set up. in case company name is changed set default company address
company: function (frm) {
@@ -90,8 +94,8 @@ frappe.ui.form.on("Dunning", {
args: { name: frm.doc.company, existing_address: frm.doc.company_address || "" },
debounce: 2000,
callback: function (r) {
frm.set_value("company_address", r && r.message || "");
}
frm.set_value("company_address", (r && r.message) || "");
},
});
if (frm.fields_dict.currency) {
@@ -125,16 +129,16 @@ frappe.ui.form.on("Dunning", {
transaction_date: frm.doc.posting_date,
from_currency: frm.doc.currency,
to_currency: company_currency,
args: "for_selling"
args: "for_selling",
},
freeze: true,
freeze_message: __("Fetching exchange rates ..."),
callback: function(r) {
callback: function (r) {
const exchange_rate = flt(r.message);
if (exchange_rate != frm.doc.conversion_rate) {
frm.set_value("conversion_rate", exchange_rate);
}
}
},
});
} else {
frm.trigger("conversion_rate");
@@ -166,8 +170,7 @@ frappe.ui.form.on("Dunning", {
get_dunning_letter_text: function (frm) {
if (frm.doc.dunning_type) {
frappe.call({
method:
"erpnext.accounts.doctype.dunning.dunning.get_dunning_letter_text",
method: "erpnext.accounts.doctype.dunning.dunning.get_dunning_letter_text",
args: {
dunning_type: frm.doc.dunning_type,
language: frm.doc.language,
@@ -204,10 +207,7 @@ frappe.ui.form.on("Dunning", {
calculate_overdue_days: function (frm) {
frm.doc.overdue_payments.forEach((row) => {
if (frm.doc.posting_date && row.due_date) {
const overdue_days = moment(frm.doc.posting_date).diff(
row.due_date,
"days"
);
const overdue_days = moment(frm.doc.posting_date).diff(row.due_date, "days");
frappe.model.set_value(row.doctype, row.name, "overdue_days", overdue_days);
}
});
@@ -215,15 +215,16 @@ frappe.ui.form.on("Dunning", {
calculate_interest: function (frm) {
frm.doc.overdue_payments.forEach((row) => {
const interest_per_day = frm.doc.rate_of_interest / 100 / 365;
const interest = flt((interest_per_day * row.overdue_days * row.outstanding), precision("interest", row));
const interest = flt(
interest_per_day * row.overdue_days * row.outstanding,
precision("interest", row)
);
frappe.model.set_value(row.doctype, row.name, "interest", interest);
});
},
calculate_totals: function (frm) {
const total_interest = frm.doc.overdue_payments
.reduce((prev, cur) => prev + cur.interest, 0);
const total_outstanding = frm.doc.overdue_payments
.reduce((prev, cur) => prev + cur.outstanding, 0);
const total_interest = frm.doc.overdue_payments.reduce((prev, cur) => prev + cur.interest, 0);
const total_outstanding = frm.doc.overdue_payments.reduce((prev, cur) => prev + cur.outstanding, 0);
const dunning_amount = total_interest + frm.doc.dunning_fee;
const base_dunning_amount = dunning_amount * frm.doc.conversion_rate;
const grand_total = total_outstanding + dunning_amount;
@@ -240,8 +241,7 @@ frappe.ui.form.on("Dunning", {
},
make_payment_entry: function (frm) {
return frappe.call({
method:
"erpnext.accounts.doctype.payment_entry.payment_entry.get_payment_entry",
method: "erpnext.accounts.doctype.payment_entry.payment_entry.get_payment_entry",
args: {
dt: frm.doc.doctype,
dn: frm.doc.name,
@@ -257,5 +257,5 @@ frappe.ui.form.on("Dunning", {
frappe.ui.form.on("Overdue Payment", {
interest: function (frm) {
frm.trigger("calculate_totals");
}
});
},
});

View File

@@ -1,75 +1,79 @@
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Exchange Rate Revaluation', {
setup: function(frm) {
frm.set_query("party_type", "accounts", function() {
frappe.ui.form.on("Exchange Rate Revaluation", {
setup: function (frm) {
frm.set_query("party_type", "accounts", function () {
return {
"filters": {
"name": ["in", Object.keys(frappe.boot.party_account_types)],
}
filters: {
name: ["in", Object.keys(frappe.boot.party_account_types)],
},
};
});
frm.set_query("account", "accounts", function(doc) {
frm.set_query("account", "accounts", function (doc) {
return {
"filters": {
"company": doc.company
}
filters: {
company: doc.company,
},
};
});
},
refresh: function(frm) {
if(frm.doc.docstatus==1) {
refresh: function (frm) {
if (frm.doc.docstatus == 1) {
frappe.call({
method: 'check_journal_entry_condition',
method: "check_journal_entry_condition",
doc: frm.doc,
callback: function(r) {
callback: function (r) {
if (r.message) {
frm.add_custom_button(__('Journal Entries'), function() {
return frm.events.make_jv(frm);
}, __('Create'));
frm.add_custom_button(
__("Journal Entries"),
function () {
return frm.events.make_jv(frm);
},
__("Create")
);
}
}
},
});
}
},
validate_rounding_loss: function(frm) {
validate_rounding_loss: function (frm) {
let allowance = frm.doc.rounding_loss_allowance;
if (!(allowance >= 0 && allowance < 1)) {
frappe.throw(__("Rounding Loss Allowance should be between 0 and 1"));
}
},
rounding_loss_allowance: function(frm) {
rounding_loss_allowance: function (frm) {
frm.events.validate_rounding_loss(frm);
},
validate: function(frm) {
validate: function (frm) {
frm.events.validate_rounding_loss(frm);
},
get_entries: function(frm, account) {
get_entries: function (frm, account) {
frappe.call({
method: "get_accounts_data",
doc: cur_frm.doc,
account: account,
callback: function(r){
callback: function (r) {
frappe.model.clear_table(frm.doc, "accounts");
if(r.message) {
if (r.message) {
r.message.forEach((d) => {
cur_frm.add_child("accounts",d);
cur_frm.add_child("accounts", d);
});
frm.events.get_total_gain_loss(frm);
refresh_field("accounts");
}
}
},
});
},
get_total_gain_loss: function(frm) {
if(!(frm.doc.accounts && frm.doc.accounts.length)) return;
get_total_gain_loss: function (frm) {
if (!(frm.doc.accounts && frm.doc.accounts.length)) return;
let total_gain_loss = 0;
frm.doc.accounts.forEach((d) => {
@@ -80,7 +84,7 @@ frappe.ui.form.on('Exchange Rate Revaluation', {
frm.refresh_fields();
},
make_jv : function(frm) {
make_jv: function (frm) {
let revaluation_journal = null;
let zero_balance_journal = null;
frappe.call({
@@ -88,66 +92,68 @@ frappe.ui.form.on('Exchange Rate Revaluation', {
doc: frm.doc,
freeze: true,
freeze_message: "Making Journal Entries...",
callback: function(r){
callback: function (r) {
if (r.message) {
let response = r.message;
if(response['revaluation_jv'] || response['zero_balance_jv']) {
if (response["revaluation_jv"] || response["zero_balance_jv"]) {
frappe.msgprint(__("Journals have been created"));
}
}
}
},
});
}
},
});
frappe.ui.form.on("Exchange Rate Revaluation Account", {
new_exchange_rate: function(frm, cdt, cdn) {
new_exchange_rate: function (frm, cdt, cdn) {
var row = frappe.get_doc(cdt, cdn);
row.new_balance_in_base_currency = flt(row.new_exchange_rate * flt(row.balance_in_account_currency),
precision("new_balance_in_base_currency", row));
row.new_balance_in_base_currency = flt(
row.new_exchange_rate * flt(row.balance_in_account_currency),
precision("new_balance_in_base_currency", row)
);
row.gain_loss = row.new_balance_in_base_currency - flt(row.balance_in_base_currency);
refresh_field("accounts");
frm.events.get_total_gain_loss(frm);
},
account: function(frm, cdt, cdn) {
account: function (frm, cdt, cdn) {
var row = locals[cdt][cdn];
if (row.account) {
get_account_details(frm, cdt, cdn);
}
},
party: function(frm, cdt, cdn) {
party: function (frm, cdt, cdn) {
var row = locals[cdt][cdn];
if (row.party && row.account) {
get_account_details(frm, cdt, cdn);
}
},
accounts_remove: function(frm) {
accounts_remove: function (frm) {
frm.events.get_total_gain_loss(frm);
}
},
});
var get_account_details = function(frm, cdt, cdn) {
var get_account_details = function (frm, cdt, cdn) {
var row = frappe.get_doc(cdt, cdn);
if(!frm.doc.company || !frm.doc.posting_date) {
if (!frm.doc.company || !frm.doc.posting_date) {
frappe.throw(__("Please select Company and Posting Date to getting entries"));
}
frappe.call({
method: "erpnext.accounts.doctype.exchange_rate_revaluation.exchange_rate_revaluation.get_account_details",
args:{
args: {
account: row.account,
company: frm.doc.company,
posting_date: frm.doc.posting_date,
party_type: row.party_type,
party: row.party,
rounding_loss_allowance: frm.doc.rounding_loss_allowance
rounding_loss_allowance: frm.doc.rounding_loss_allowance,
},
callback: function(r){
callback: function (r) {
$.extend(row, r.message);
refresh_field("accounts");
frm.events.get_total_gain_loss(frm);
}
},
});
};

View File

@@ -1,8 +1,6 @@
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Finance Book', {
refresh: function(frm) {
}
frappe.ui.form.on("Finance Book", {
refresh: function (frm) {},
});

View File

@@ -1,17 +1,21 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.ui.form.on('Fiscal Year', {
onload: function(frm) {
if(frm.doc.__islocal) {
frm.set_value("year_start_date",
frappe.datetime.add_days(frappe.defaults.get_default("year_end_date"), 1));
frappe.ui.form.on("Fiscal Year", {
onload: function (frm) {
if (frm.doc.__islocal) {
frm.set_value(
"year_start_date",
frappe.datetime.add_days(frappe.defaults.get_default("year_end_date"), 1)
);
}
},
year_start_date: function(frm) {
year_start_date: function (frm) {
if (!frm.doc.is_short_year) {
let year_end_date =
frappe.datetime.add_days(frappe.datetime.add_months(frm.doc.year_start_date, 12), -1);
let year_end_date = frappe.datetime.add_days(
frappe.datetime.add_months(frm.doc.year_start_date, 12),
-1
);
frm.set_value("year_end_date", year_end_date);
}
},

View File

@@ -3,7 +3,7 @@
"allow_import": 1,
"autoname": "field:year",
"creation": "2013-01-22 16:50:25",
"description": "**Fiscal Year** represents a Financial Year. All accounting entries and other major transactions are tracked against **Fiscal Year**.",
"description": "Represents a Financial Year. All accounting entries and other major transactions are tracked against the Fiscal Year.",
"doctype": "DocType",
"document_type": "Setup",
"engine": "InnoDB",
@@ -82,10 +82,11 @@
"icon": "fa fa-calendar",
"idx": 1,
"links": [],
"modified": "2020-11-05 12:16:53.081573",
"modified": "2024-01-30 12:35:38.645968",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Fiscal Year",
"naming_rule": "By fieldname",
"owner": "Administrator",
"permissions": [
{
@@ -122,5 +123,6 @@
],
"show_name_in_global_search": 1,
"sort_field": "name",
"sort_order": "DESC"
"sort_order": "DESC",
"states": []
}

View File

@@ -39,7 +39,7 @@ def test_record_generator():
]
start = 2012
end = now_datetime().year + 5
end = now_datetime().year + 25
for year in range(start, end):
test_records.append(
{

View File

@@ -1,8 +1,8 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('GL Entry', {
refresh: function(frm) {
frm.page.btn_secondary.hide()
}
frappe.ui.form.on("GL Entry", {
refresh: function (frm) {
frm.page.btn_secondary.hide();
},
});

View File

@@ -21,6 +21,7 @@
"against_voucher_type",
"against_voucher",
"voucher_type",
"voucher_subtype",
"voucher_no",
"voucher_detail_no",
"project",
@@ -142,8 +143,7 @@
"label": "Against Voucher Type",
"oldfieldname": "against_voucher_type",
"oldfieldtype": "Data",
"options": "DocType",
"search_index": 1
"options": "DocType"
},
{
"fieldname": "against_voucher",
@@ -162,8 +162,7 @@
"label": "Voucher Type",
"oldfieldname": "voucher_type",
"oldfieldtype": "Select",
"options": "DocType",
"search_index": 1
"options": "DocType"
},
{
"fieldname": "voucher_no",
@@ -280,13 +279,18 @@
"fieldtype": "Currency",
"label": "Credit Amount in Transaction Currency",
"options": "transaction_currency"
},
{
"fieldname": "voucher_subtype",
"fieldtype": "Small Text",
"label": "Voucher Subtype"
}
],
"icon": "fa fa-list",
"idx": 1,
"in_create": 1,
"links": [],
"modified": "2023-08-16 21:38:44.072267",
"modified": "2023-12-18 15:38:14.006208",
"modified_by": "Administrator",
"module": "Accounts",
"name": "GL Entry",
@@ -321,4 +325,4 @@
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
}

View File

@@ -13,16 +13,9 @@ import erpnext
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
get_checks_for_pl_and_bs_accounts,
)
from erpnext.accounts.doctype.accounting_dimension_filter.accounting_dimension_filter import (
get_dimension_filter_map,
)
from erpnext.accounts.party import validate_party_frozen_disabled, validate_party_gle_currency
from erpnext.accounts.utils import get_account_currency, get_fiscal_year
from erpnext.exceptions import (
InvalidAccountCurrency,
InvalidAccountDimensionError,
MandatoryAccountDimensionError,
)
from erpnext.exceptions import InvalidAccountCurrency
exclude_from_linked_with = True
@@ -39,6 +32,8 @@ class GLEntry(Document):
account: DF.Link | None
account_currency: DF.Link | None
against: DF.Text | None
against_link: DF.DynamicLink | None
against_type: DF.Link | None
against_voucher: DF.DynamicLink | None
against_voucher_type: DF.Link | None
company: DF.Link | None
@@ -66,6 +61,7 @@ class GLEntry(Document):
transaction_exchange_rate: DF.Float
voucher_detail_no: DF.Data | None
voucher_no: DF.DynamicLink | None
voucher_subtype: DF.SmallText | None
voucher_type: DF.Link | None
# end: auto-generated types
@@ -95,7 +91,6 @@ class GLEntry(Document):
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()
validate_balance_type(self.account, adv_adj)
validate_frozen_account(self.account, adv_adj)
@@ -205,42 +200,6 @@ class GLEntry(Document):
)
)
def validate_allowed_dimensions(self):
dimension_filter_map = get_dimension_filter_map()
for key, value in dimension_filter_map.items():
dimension = key[0]
account = key[1]
if self.account == account:
if value["is_mandatory"] and not self.get(dimension):
frappe.throw(
_("{0} is mandatory for account {1}").format(
frappe.bold(frappe.unscrub(dimension)), frappe.bold(self.account)
),
MandatoryAccountDimensionError,
)
if value["allow_or_restrict"] == "Allow":
if self.get(dimension) and self.get(dimension) not in value["allowed_dimensions"]:
frappe.throw(
_("Invalid value {0} for {1} against account {2}").format(
frappe.bold(self.get(dimension)),
frappe.bold(frappe.unscrub(dimension)),
frappe.bold(self.account),
),
InvalidAccountDimensionError,
)
else:
if self.get(dimension) and self.get(dimension) in value["allowed_dimensions"]:
frappe.throw(
_("Invalid value {0} for {1} against account {2}").format(
frappe.bold(self.get(dimension)),
frappe.bold(frappe.unscrub(dimension)),
frappe.bold(self.account),
),
InvalidAccountDimensionError,
)
def check_pl_account(self):
if (
self.is_opening == "Yes"

View File

@@ -1,47 +1,49 @@
// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Invoice Discounting', {
frappe.ui.form.on("Invoice Discounting", {
setup: (frm) => {
frm.set_query("sales_invoice", "invoices", (doc) => {
return {
"filters": {
"docstatus": 1,
"company": doc.company,
"outstanding_amount": [">", 0]
filters: {
docstatus: 1,
company: doc.company,
outstanding_amount: [">", 0],
},
};
});
frm.events.filter_accounts("bank_account", frm, [["account_type", "=", "Bank"]]);
frm.events.filter_accounts("bank_charges_account", frm, [["root_type", "=", "Expense"]]);
frm.events.filter_accounts("short_term_loan", frm, [["root_type", "=", "Liability"]]);
frm.events.filter_accounts("accounts_receivable_discounted", frm, [["account_type", "=", "Receivable"]]);
frm.events.filter_accounts("accounts_receivable_discounted", frm, [
["account_type", "=", "Receivable"],
]);
frm.events.filter_accounts("accounts_receivable_credit", frm, [["account_type", "=", "Receivable"]]);
frm.events.filter_accounts("accounts_receivable_unpaid", frm, [["account_type", "=", "Receivable"]]);
},
filter_accounts: (fieldname, frm, addl_filters) => {
let filters = [
["company", "=", frm.doc.company],
["is_group", "=", 0]
["is_group", "=", 0],
];
if(addl_filters){
filters = $.merge(filters , addl_filters);
if (addl_filters) {
filters = $.merge(filters, addl_filters);
}
frm.set_query(fieldname, () => { return { "filters": filters }; });
frm.set_query(fieldname, () => {
return { filters: filters };
});
},
refresh_filters: (frm) =>{
let invoice_accounts = Object.keys(frm.doc.invoices).map(function(key) {
refresh_filters: (frm) => {
let invoice_accounts = Object.keys(frm.doc.invoices).map(function (key) {
return frm.doc.invoices[key].debit_to;
});
let filters = [
["account_type", "=", "Receivable"],
["name", "not in", invoice_accounts]
["name", "not in", invoice_accounts],
];
frm.events.filter_accounts("accounts_receivable_credit", frm, filters);
frm.events.filter_accounts("accounts_receivable_discounted", frm, filters);
@@ -52,19 +54,19 @@ frappe.ui.form.on('Invoice Discounting', {
frm.events.show_general_ledger(frm);
if (frm.doc.docstatus === 0) {
frm.add_custom_button(__('Get Invoices'), function() {
frm.add_custom_button(__("Get Invoices"), function () {
frm.events.get_invoices(frm);
});
}
if (frm.doc.docstatus === 1 && frm.doc.status !== "Settled") {
if (frm.doc.status == "Sanctioned") {
frm.add_custom_button(__('Disburse Loan'), function() {
frm.add_custom_button(__("Disburse Loan"), function () {
frm.events.create_disbursement_entry(frm);
}).addClass("btn-primary");
}
if (frm.doc.status == "Disbursed") {
frm.add_custom_button(__('Close Loan'), function() {
frm.add_custom_button(__("Close Loan"), function () {
frm.events.close_loan(frm);
}).addClass("btn-primary");
}
@@ -92,119 +94,121 @@ frappe.ui.form.on('Invoice Discounting', {
calculate_total_amount: (frm) => {
let total_amount = 0.0;
for (let row of (frm.doc.invoices || [])) {
for (let row of frm.doc.invoices || []) {
total_amount += flt(row.outstanding_amount);
}
frm.set_value("total_amount", total_amount);
},
get_invoices: (frm) => {
var d = new frappe.ui.Dialog({
title: __('Get Invoices based on Filters'),
title: __("Get Invoices based on Filters"),
fields: [
{
"label": "Customer",
"fieldname": "customer",
"fieldtype": "Link",
"options": "Customer"
label: "Customer",
fieldname: "customer",
fieldtype: "Link",
options: "Customer",
},
{
"label": "From Date",
"fieldname": "from_date",
"fieldtype": "Date"
label: "From Date",
fieldname: "from_date",
fieldtype: "Date",
},
{
"label": "To Date",
"fieldname": "to_date",
"fieldtype": "Date"
label: "To Date",
fieldname: "to_date",
fieldtype: "Date",
},
{
"fieldname": "col_break",
"fieldtype": "Column Break",
fieldname: "col_break",
fieldtype: "Column Break",
},
{
"label": "Min Amount",
"fieldname": "min_amount",
"fieldtype": "Currency"
label: "Min Amount",
fieldname: "min_amount",
fieldtype: "Currency",
},
{
"label": "Max Amount",
"fieldname": "max_amount",
"fieldtype": "Currency"
}
label: "Max Amount",
fieldname: "max_amount",
fieldtype: "Currency",
},
],
primary_action: function() {
primary_action: function () {
var data = d.get_values();
frappe.call({
method: "erpnext.accounts.doctype.invoice_discounting.invoice_discounting.get_invoices",
args: {
filters: data
filters: data,
},
callback: function(r) {
if(!r.exc) {
callback: function (r) {
if (!r.exc) {
d.hide();
$.each(r.message, function(i, v) {
frm.doc.invoices = frm.doc.invoices.filter(row => row.sales_invoice);
$.each(r.message, function (i, v) {
frm.doc.invoices = frm.doc.invoices.filter((row) => row.sales_invoice);
let row = frm.add_child("invoices");
$.extend(row, v);
frm.events.refresh_filters(frm);
});
refresh_field("invoices");
}
}
},
});
},
primary_action_label: __('Get Invocies')
primary_action_label: __("Get Invocies"),
});
d.show();
},
create_disbursement_entry: (frm) => {
frappe.call({
method:"create_disbursement_entry",
method: "create_disbursement_entry",
doc: frm.doc,
callback: function(r) {
if(!r.exc){
callback: function (r) {
if (!r.exc) {
var doclist = frappe.model.sync(r.message);
frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
}
}
},
});
},
close_loan: (frm) => {
frappe.call({
method:"close_loan",
method: "close_loan",
doc: frm.doc,
callback: function(r) {
if(!r.exc){
callback: function (r) {
if (!r.exc) {
var doclist = frappe.model.sync(r.message);
frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
}
}
},
});
},
show_general_ledger: (frm) => {
if(frm.doc.docstatus > 0) {
cur_frm.add_custom_button(__('Accounting Ledger'), function() {
frappe.route_options = {
voucher_no: frm.doc.name,
from_date: frm.doc.posting_date,
to_date: moment(frm.doc.modified).format('YYYY-MM-DD'),
company: frm.doc.company,
group_by: "Group by Voucher (Consolidated)",
show_cancelled_entries: frm.doc.docstatus === 2
};
frappe.set_route("query-report", "General Ledger");
}, __("View"));
if (frm.doc.docstatus > 0) {
cur_frm.add_custom_button(
__("Accounting Ledger"),
function () {
frappe.route_options = {
voucher_no: frm.doc.name,
from_date: frm.doc.posting_date,
to_date: moment(frm.doc.modified).format("YYYY-MM-DD"),
company: frm.doc.company,
group_by: "Group by Voucher (Consolidated)",
show_cancelled_entries: frm.doc.docstatus === 2,
};
frappe.set_route("query-report", "General Ledger");
},
__("View")
);
}
}
},
});
frappe.ui.form.on('Discounted Invoice', {
frappe.ui.form.on("Discounted Invoice", {
sales_invoice: (frm) => {
frm.events.calculate_total_amount(frm);
frm.events.refresh_filters(frm);
@@ -212,5 +216,5 @@ frappe.ui.form.on('Discounted Invoice', {
invoices_remove: (frm) => {
frm.events.calculate_total_amount(frm);
frm.events.refresh_filters(frm);
}
},
});

View File

@@ -1,21 +1,16 @@
frappe.listview_settings['Invoice Discounting'] = {
frappe.listview_settings["Invoice Discounting"] = {
add_fields: ["status"],
get_indicator: function(doc)
{
if(doc.status == "Draft") {
get_indicator: function (doc) {
if (doc.status == "Draft") {
return [__("Draft"), "red", "status,=,Draft"];
}
else if(doc.status == "Sanctioned") {
} else if (doc.status == "Sanctioned") {
return [__("Sanctioned"), "green", "status,=,Sanctioned"];
}
else if(doc.status == "Disbursed") {
} else if (doc.status == "Disbursed") {
return [__("Disbursed"), "blue", "status,=,Disbursed"];
}
else if(doc.status == "Settled") {
} else if (doc.status == "Settled") {
return [__("Settled"), "orange", "status,=,Settled"];
}
else if(doc.status == "Canceled") {
} else if (doc.status == "Canceled") {
return [__("Canceled"), "red", "status,=,Canceled"];
}
}
},
};

View File

@@ -1,27 +1,49 @@
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Item Tax Template', {
setup: function(frm) {
frm.set_query("tax_type", "taxes", function(doc) {
frappe.ui.form.on("Item Tax Template", {
setup: function (frm) {
frm.set_query("tax_type", "taxes", function (doc) {
return {
filters: [
['Account', 'company', '=', frm.doc.company],
['Account', 'is_group', '=', 0],
['Account', 'account_type', 'in', ['Tax', 'Chargeable', 'Income Account', 'Expense Account', 'Expenses Included In Valuation']]
]
}
["Account", "company", "=", frm.doc.company],
["Account", "is_group", "=", 0],
[
"Account",
"account_type",
"in",
[
"Tax",
"Chargeable",
"Income Account",
"Expense Account",
"Expenses Included In Valuation",
],
],
],
};
});
},
company: function (frm) {
frm.set_query("tax_type", "taxes", function(doc) {
frm.set_query("tax_type", "taxes", function (doc) {
return {
filters: [
['Account', 'company', '=', frm.doc.company],
['Account', 'is_group', '=', 0],
['Account', 'account_type', 'in', ['Tax', 'Chargeable', 'Income Account', 'Expense Account', 'Expenses Included In Valuation']]
]
}
["Account", "company", "=", frm.doc.company],
["Account", "is_group", "=", 0],
[
"Account",
"account_type",
"in",
[
"Tax",
"Chargeable",
"Income Account",
"Expense Account",
"Expenses Included In Valuation",
],
],
],
};
});
}
},
});

View File

@@ -4,39 +4,82 @@
frappe.provide("erpnext.accounts");
frappe.provide("erpnext.journal_entry");
frappe.ui.form.on("Journal Entry", {
setup: function(frm) {
setup: function (frm) {
frm.add_fetch("bank_account", "account", "account");
frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice', 'Journal Entry', "Repost Payment Ledger", 'Asset', 'Asset Movement', 'Asset Depreciation Schedule', "Repost Accounting Ledger", "Unreconcile Payment", "Unreconcile Payment Entries"];
frm.ignore_doctypes_on_cancel_all = [
"Sales Invoice",
"Purchase Invoice",
"Journal Entry",
"Repost Payment Ledger",
"Asset",
"Asset Movement",
"Asset Depreciation Schedule",
"Repost Accounting Ledger",
"Unreconcile Payment",
"Unreconcile Payment Entries",
"Bank Transaction",
];
},
refresh: function(frm) {
refresh: function (frm) {
erpnext.toggle_naming_series();
if(frm.doc.docstatus > 0) {
frm.add_custom_button(__('Ledger'), function() {
frappe.route_options = {
"voucher_no": frm.doc.name,
"from_date": frm.doc.posting_date,
"to_date": moment(frm.doc.modified).format('YYYY-MM-DD'),
"company": frm.doc.company,
"finance_book": frm.doc.finance_book,
"group_by": '',
"show_cancelled_entries": frm.doc.docstatus === 2
};
frappe.set_route("query-report", "General Ledger");
}, __('View'));
if (frm.doc.repost_required && frm.doc.docstatus === 1) {
frm.set_intro(
__(
"Accounting entries for this Journal Entry need to be reposted. Please click on 'Repost' button to update."
)
);
frm.add_custom_button(__("Repost Accounting Entries"), () => {
frm.call({
doc: frm.doc,
method: "repost_accounting_entries",
freeze: true,
freeze_message: __("Reposting..."),
callback: (r) => {
if (!r.exc) {
frappe.msgprint(__("Accounting Entries are reposted."));
frm.refresh();
}
},
});
})
.removeClass("btn-default")
.addClass("btn-warning");
}
if(frm.doc.docstatus==1) {
frm.add_custom_button(__('Reverse Journal Entry'), function() {
return erpnext.journal_entry.reverse_journal_entry(frm);
}, __('Actions'));
if (frm.doc.docstatus > 0) {
frm.add_custom_button(
__("Ledger"),
function () {
frappe.route_options = {
voucher_no: frm.doc.name,
from_date: frm.doc.posting_date,
to_date: moment(frm.doc.modified).format("YYYY-MM-DD"),
company: frm.doc.company,
finance_book: frm.doc.finance_book,
group_by: "",
show_cancelled_entries: frm.doc.docstatus === 2,
};
frappe.set_route("query-report", "General Ledger");
},
__("View")
);
}
if (frm.doc.docstatus == 1) {
frm.add_custom_button(
__("Reverse Journal Entry"),
function () {
return erpnext.journal_entry.reverse_journal_entry(frm);
},
__("Actions")
);
}
if (frm.doc.__islocal) {
frm.add_custom_button(__('Quick Entry'), function() {
frm.add_custom_button(__("Quick Entry"), function () {
return erpnext.journal_entry.quick_entry(frm);
});
}
@@ -44,52 +87,63 @@ frappe.ui.form.on("Journal Entry", {
// hide /unhide fields based on currency
erpnext.journal_entry.toggle_fields_based_on_currency(frm);
if ((frm.doc.voucher_type == "Inter Company Journal Entry") && (frm.doc.docstatus == 1) && (!frm.doc.inter_company_journal_entry_reference)) {
frm.add_custom_button(__("Create Inter Company Journal Entry"),
function() {
if (
frm.doc.voucher_type == "Inter Company Journal Entry" &&
frm.doc.docstatus == 1 &&
!frm.doc.inter_company_journal_entry_reference
) {
frm.add_custom_button(
__("Create Inter Company Journal Entry"),
function () {
frm.trigger("make_inter_company_journal_entry");
}, __('Make'));
},
__("Make")
);
}
erpnext.accounts.unreconcile_payment.add_unreconcile_btn(frm);
},
before_save: function(frm) {
if ((frm.doc.docstatus == 0) && (!frm.doc.is_system_generated)) {
let payment_entry_references = frm.doc.accounts.filter(elem => (elem.reference_type == "Payment Entry"));
before_save: function (frm) {
if (frm.doc.docstatus == 0 && !frm.doc.is_system_generated) {
let payment_entry_references = frm.doc.accounts.filter(
(elem) => elem.reference_type == "Payment Entry"
);
if (payment_entry_references.length > 0) {
let rows = payment_entry_references.map(x => "#"+x.idx);
frappe.throw(__("Rows: {0} have 'Payment Entry' as reference_type. This should not be set manually.", [frappe.utils.comma_and(rows)]));
let rows = payment_entry_references.map((x) => "#" + x.idx);
frappe.throw(
__("Rows: {0} have 'Payment Entry' as reference_type. This should not be set manually.", [
frappe.utils.comma_and(rows),
])
);
}
}
},
make_inter_company_journal_entry: function(frm) {
make_inter_company_journal_entry: function (frm) {
var d = new frappe.ui.Dialog({
title: __("Select Company"),
fields: [
{
'fieldname': 'company',
'fieldtype': 'Link',
'label': __('Company'),
'options': 'Company',
"get_query": function () {
fieldname: "company",
fieldtype: "Link",
label: __("Company"),
options: "Company",
get_query: function () {
return {
filters: [
["Company", "name", "!=", frm.doc.company]
]
filters: [["Company", "name", "!=", frm.doc.company]],
};
},
'reqd': 1
}
reqd: 1,
},
],
});
d.set_primary_action(__('Create'), function() {
d.set_primary_action(__("Create"), function () {
d.hide();
var args = d.get_values();
frappe.call({
args: {
"name": frm.doc.name,
"voucher_type": frm.doc.voucher_type,
"company": args.company
name: frm.doc.name,
voucher_type: frm.doc.voucher_type,
company: args.company,
},
method: "erpnext.accounts.doctype.journal_entry.journal_entry.make_inter_company_journal_entry",
callback: function (r) {
@@ -97,103 +151,106 @@ frappe.ui.form.on("Journal Entry", {
var doc = frappe.model.sync(r.message)[0];
frappe.set_route("Form", doc.doctype, doc.name);
}
}
},
});
});
d.show();
},
multi_currency: function(frm) {
multi_currency: function (frm) {
erpnext.journal_entry.toggle_fields_based_on_currency(frm);
},
posting_date: function(frm) {
if(!frm.doc.multi_currency || !frm.doc.posting_date) return;
posting_date: function (frm) {
if (!frm.doc.multi_currency || !frm.doc.posting_date) return;
$.each(frm.doc.accounts || [], function(i, row) {
$.each(frm.doc.accounts || [], function (i, row) {
erpnext.journal_entry.set_exchange_rate(frm, row.doctype, row.name);
})
});
},
company: function(frm) {
company: function (frm) {
frappe.call({
method: "frappe.client.get_value",
args: {
doctype: "Company",
filters: {"name": frm.doc.company},
fieldname: "cost_center"
filters: { name: frm.doc.company },
fieldname: "cost_center",
},
callback: function(r){
if(r.message){
$.each(frm.doc.accounts || [], function(i, jvd) {
callback: function (r) {
if (r.message) {
$.each(frm.doc.accounts || [], function (i, jvd) {
frappe.model.set_value(jvd.doctype, jvd.name, "cost_center", r.message.cost_center);
});
}
}
},
});
erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
},
voucher_type: function(frm){
voucher_type: function (frm) {
if (!frm.doc.company) return null;
if(!frm.doc.company) return null;
if((!(frm.doc.accounts || []).length) || ((frm.doc.accounts || []).length === 1 && !frm.doc.accounts[0].account)) {
if(in_list(["Bank Entry", "Cash Entry"], frm.doc.voucher_type)) {
if (
!(frm.doc.accounts || []).length ||
((frm.doc.accounts || []).length === 1 && !frm.doc.accounts[0].account)
) {
if (in_list(["Bank Entry", "Cash Entry"], frm.doc.voucher_type)) {
return frappe.call({
type: "GET",
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_default_bank_cash_account",
args: {
"account_type": (frm.doc.voucher_type=="Bank Entry" ?
"Bank" : (frm.doc.voucher_type=="Cash Entry" ? "Cash" : null)),
"company": frm.doc.company
account_type:
frm.doc.voucher_type == "Bank Entry"
? "Bank"
: frm.doc.voucher_type == "Cash Entry"
? "Cash"
: null,
company: frm.doc.company,
},
callback: function(r) {
if(r.message) {
callback: function (r) {
if (r.message) {
// If default company bank account not set
if(!$.isEmptyObject(r.message)){
if (!$.isEmptyObject(r.message)) {
update_jv_details(frm.doc, [r.message]);
}
}
}
},
});
}
}
},
from_template: function(frm){
if (frm.doc.from_template){
frappe.db.get_doc("Journal Entry Template", frm.doc.from_template)
.then((doc) => {
frappe.model.clear_table(frm.doc, "accounts");
frm.set_value({
"company": doc.company,
"voucher_type": doc.voucher_type,
"naming_series": doc.naming_series,
"is_opening": doc.is_opening,
"multi_currency": doc.multi_currency
})
update_jv_details(frm.doc, doc.accounts);
from_template: function (frm) {
if (frm.doc.from_template) {
frappe.db.get_doc("Journal Entry Template", frm.doc.from_template).then((doc) => {
frappe.model.clear_table(frm.doc, "accounts");
frm.set_value({
company: doc.company,
voucher_type: doc.voucher_type,
naming_series: doc.naming_series,
is_opening: doc.is_opening,
multi_currency: doc.multi_currency,
});
update_jv_details(frm.doc, doc.accounts);
});
}
}
},
});
var update_jv_details = function(doc, r) {
$.each(r, function(i, d) {
var update_jv_details = function (doc, r) {
$.each(r, function (i, d) {
var row = frappe.model.add_child(doc, "Journal Entry Account", "accounts");
frappe.model.set_value(row.doctype, row.name, "account", d.account)
frappe.model.set_value(row.doctype, row.name, "balance", d.balance)
frappe.model.set_value(row.doctype, row.name, "account", d.account);
});
refresh_field("accounts");
}
};
erpnext.accounts.JournalEntry = class JournalEntry extends frappe.ui.form.Controller {
onload() {
this.load_defaults();
this.setup_queries();
this.setup_balance_formatter();
erpnext.accounts.dimensions.setup_dimension_filters(this.frm, this.frm.doctype);
}
@@ -203,69 +260,67 @@ erpnext.accounts.JournalEntry = class JournalEntry extends frappe.ui.form.Contro
load_defaults() {
//this.frm.show_print_first = true;
if(this.frm.doc.__islocal && this.frm.doc.company) {
if (this.frm.doc.__islocal && this.frm.doc.company) {
frappe.model.set_default_values(this.frm.doc);
$.each(this.frm.doc.accounts || [], function(i, jvd) {
$.each(this.frm.doc.accounts || [], function (i, jvd) {
frappe.model.set_default_values(jvd);
});
var posting_date = this.frm.doc.posting_date;
if(!this.frm.doc.amended_from) this.frm.set_value('posting_date', posting_date || frappe.datetime.get_today());
if (!this.frm.doc.amended_from)
this.frm.set_value("posting_date", posting_date || frappe.datetime.get_today());
}
}
setup_queries() {
var me = this;
me.frm.set_query("account", "accounts", function(doc, cdt, cdn) {
me.frm.set_query("account", "accounts", function (doc, cdt, cdn) {
return erpnext.journal_entry.account_query(me.frm);
});
me.frm.set_query("party_type", "accounts", function(doc, cdt, cdn) {
me.frm.set_query("party_type", "accounts", function (doc, cdt, cdn) {
const row = locals[cdt][cdn];
return {
query: "erpnext.setup.doctype.party_type.party_type.get_party_type",
filters: {
'account': row.account
}
}
account: row.account,
},
};
});
me.frm.set_query("reference_name", "accounts", function(doc, cdt, cdn) {
me.frm.set_query("reference_name", "accounts", function (doc, cdt, cdn) {
var jvd = frappe.get_doc(cdt, cdn);
// journal entry
if(jvd.reference_type==="Journal Entry") {
if (jvd.reference_type === "Journal Entry") {
frappe.model.validate_missing(jvd, "account");
return {
query: "erpnext.accounts.doctype.journal_entry.journal_entry.get_against_jv",
filters: {
account: jvd.account,
party: jvd.party
}
party: jvd.party,
},
};
}
var out = {
filters: [
[jvd.reference_type, "docstatus", "=", 1]
]
filters: [[jvd.reference_type, "docstatus", "=", 1]],
};
if(in_list(["Sales Invoice", "Purchase Invoice"], jvd.reference_type)) {
if (in_list(["Sales Invoice", "Purchase Invoice"], jvd.reference_type)) {
out.filters.push([jvd.reference_type, "outstanding_amount", "!=", 0]);
// Filter by cost center
if(jvd.cost_center) {
if (jvd.cost_center) {
out.filters.push([jvd.reference_type, "cost_center", "in", ["", jvd.cost_center]]);
}
// account filter
frappe.model.validate_missing(jvd, "account");
var party_account_field = jvd.reference_type==="Sales Invoice" ? "debit_to": "credit_to";
var party_account_field = jvd.reference_type === "Sales Invoice" ? "debit_to" : "credit_to";
out.filters.push([jvd.reference_type, party_account_field, "=", jvd.account]);
}
if(in_list(["Sales Order", "Purchase Order"], jvd.reference_type)) {
if (in_list(["Sales Order", "Purchase Order"], jvd.reference_type)) {
// party_type and party mandatory
frappe.model.validate_missing(jvd, "party_type");
frappe.model.validate_missing(jvd, "party");
@@ -273,11 +328,11 @@ erpnext.accounts.JournalEntry = class JournalEntry extends frappe.ui.form.Contro
out.filters.push([jvd.reference_type, "per_billed", "<", 100]);
}
if(jvd.party_type && jvd.party) {
if (jvd.party_type && jvd.party) {
let party_field = "";
if(jvd.reference_type.indexOf("Sales")===0) {
if (jvd.reference_type.indexOf("Sales") === 0) {
party_field = "customer";
} else if (jvd.reference_type.indexOf("Purchase")===0) {
} else if (jvd.reference_type.indexOf("Purchase") === 0) {
party_field = "supplier";
}
@@ -288,64 +343,49 @@ erpnext.accounts.JournalEntry = class JournalEntry extends frappe.ui.form.Contro
return out;
});
}
setup_balance_formatter() {
const formatter = function(value, df, options, doc) {
var currency = frappe.meta.get_field_currency(df, doc);
var dr_or_cr = value ? ('<label>' + (value > 0.0 ? __("Dr") : __("Cr")) + '</label>') : "";
return "<div style='text-align: right'>"
+ ((value==null || value==="") ? "" : format_currency(Math.abs(value), currency))
+ " " + dr_or_cr
+ "</div>";
};
this.frm.fields_dict.accounts.grid.update_docfield_property('balance', 'formatter', formatter);
this.frm.fields_dict.accounts.grid.update_docfield_property('party_balance', 'formatter', formatter);
}
reference_name(doc, cdt, cdn) {
var d = frappe.get_doc(cdt, cdn);
if(d.reference_name) {
if (d.reference_type==="Purchase Invoice" && !flt(d.debit)) {
this.get_outstanding('Purchase Invoice', d.reference_name, doc.company, d);
} else if (d.reference_type==="Sales Invoice" && !flt(d.credit)) {
this.get_outstanding('Sales Invoice', d.reference_name, doc.company, d);
} else if (d.reference_type==="Journal Entry" && !flt(d.credit) && !flt(d.debit)) {
this.get_outstanding('Journal Entry', d.reference_name, doc.company, d);
if (d.reference_name) {
if (d.reference_type === "Purchase Invoice" && !flt(d.debit)) {
this.get_outstanding("Purchase Invoice", d.reference_name, doc.company, d);
} else if (d.reference_type === "Sales Invoice" && !flt(d.credit)) {
this.get_outstanding("Sales Invoice", d.reference_name, doc.company, d);
} else if (d.reference_type === "Journal Entry" && !flt(d.credit) && !flt(d.debit)) {
this.get_outstanding("Journal Entry", d.reference_name, doc.company, d);
}
}
}
get_outstanding(doctype, docname, company, child) {
var args = {
"doctype": doctype,
"docname": docname,
"party": child.party,
"account": child.account,
"account_currency": child.account_currency,
"company": company
}
doctype: doctype,
docname: docname,
party: child.party,
account: child.account,
account_currency: child.account_currency,
company: company,
};
return frappe.call({
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_outstanding",
args: { args: args},
callback: function(r) {
if(r.message) {
$.each(r.message, function(field, value) {
args: { args: args },
callback: function (r) {
if (r.message) {
$.each(r.message, function (field, value) {
frappe.model.set_value(child.doctype, child.name, field, value);
})
});
}
}
},
});
}
accounts_add(doc, cdt, cdn) {
var row = frappe.get_doc(cdt, cdn);
$.each(doc.accounts, function(i, d) {
if(d.account && d.party && d.party_type) {
$.each(doc.accounts, function (i, d) {
if (d.account && d.party && d.party_type) {
row.account = d.account;
row.party = d.party;
row.party_type = d.party_type;
@@ -353,8 +393,8 @@ erpnext.accounts.JournalEntry = class JournalEntry extends frappe.ui.form.Contro
});
// set difference
if(doc.difference) {
if(doc.difference > 0) {
if (doc.difference) {
if (doc.difference > 0) {
row.credit_in_account_currency = doc.difference;
row.credit = doc.difference;
} else {
@@ -364,132 +404,141 @@ erpnext.accounts.JournalEntry = class JournalEntry extends frappe.ui.form.Contro
}
cur_frm.cscript.update_totals(doc);
erpnext.accounts.dimensions.copy_dimension_from_first_row(this.frm, cdt, cdn, 'accounts');
erpnext.accounts.dimensions.copy_dimension_from_first_row(this.frm, cdt, cdn, "accounts");
}
};
cur_frm.script_manager.make(erpnext.accounts.JournalEntry);
cur_frm.cscript.update_totals = function(doc) {
var td=0.0; var tc =0.0;
cur_frm.cscript.update_totals = function (doc) {
var td = 0.0;
var tc = 0.0;
var accounts = doc.accounts || [];
for(var i in accounts) {
for (var i in accounts) {
td += flt(accounts[i].debit, precision("debit", accounts[i]));
tc += flt(accounts[i].credit, precision("credit", accounts[i]));
}
doc = locals[doc.doctype][doc.name];
doc.total_debit = td;
doc.total_credit = tc;
doc.difference = flt((td - tc), precision("difference"));
refresh_many(['total_debit','total_credit','difference']);
}
doc.difference = flt(td - tc, precision("difference"));
refresh_many(["total_debit", "total_credit", "difference"]);
};
cur_frm.cscript.get_balance = function(doc,dt,dn) {
cur_frm.cscript.get_balance = function (doc, dt, dn) {
cur_frm.cscript.update_totals(doc);
cur_frm.call('get_balance', null, () => { cur_frm.refresh(); });
}
cur_frm.call("get_balance", null, () => {
cur_frm.refresh();
});
};
cur_frm.cscript.validate = function(doc,cdt,cdn) {
cur_frm.cscript.validate = function (doc, cdt, cdn) {
cur_frm.cscript.update_totals(doc);
}
};
frappe.ui.form.on("Journal Entry Account", {
party: function(frm, cdt, cdn) {
party: function (frm, cdt, cdn) {
var d = frappe.get_doc(cdt, cdn);
if(!d.account && d.party_type && d.party) {
if(!frm.doc.company) frappe.throw(__("Please select Company"));
if (!d.account && d.party_type && d.party) {
if (!frm.doc.company) frappe.throw(__("Please select Company"));
return frm.call({
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_party_account_and_balance",
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_party_account_and_currency",
child: d,
args: {
company: frm.doc.company,
party_type: d.party_type,
party: d.party,
cost_center: d.cost_center
}
},
});
}
},
cost_center: function(frm, dt, dn) {
erpnext.journal_entry.set_account_balance(frm, dt, dn);
cost_center: function (frm, dt, dn) {
erpnext.journal_entry.set_account_details(frm, dt, dn);
},
account: function(frm, dt, dn) {
erpnext.journal_entry.set_account_balance(frm, dt, dn);
account: function (frm, dt, dn) {
erpnext.journal_entry.set_account_details(frm, dt, dn);
},
debit_in_account_currency: function(frm, cdt, cdn) {
debit_in_account_currency: function (frm, cdt, cdn) {
erpnext.journal_entry.set_exchange_rate(frm, cdt, cdn);
},
credit_in_account_currency: function(frm, cdt, cdn) {
credit_in_account_currency: function (frm, cdt, cdn) {
erpnext.journal_entry.set_exchange_rate(frm, cdt, cdn);
},
debit: function(frm, dt, dn) {
debit: function (frm, dt, dn) {
cur_frm.cscript.update_totals(frm.doc);
},
credit: function(frm, dt, dn) {
credit: function (frm, dt, dn) {
cur_frm.cscript.update_totals(frm.doc);
},
exchange_rate: function(frm, cdt, cdn) {
exchange_rate: function (frm, cdt, cdn) {
var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
var row = locals[cdt][cdn];
if(row.account_currency == company_currency || !frm.doc.multi_currency) {
if (row.account_currency == company_currency || !frm.doc.multi_currency) {
frappe.model.set_value(cdt, cdn, "exchange_rate", 1);
}
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
}
})
},
});
frappe.ui.form.on("Journal Entry Account", "accounts_remove", function(frm) {
frappe.ui.form.on("Journal Entry Account", "accounts_remove", function (frm) {
cur_frm.cscript.update_totals(frm.doc);
});
$.extend(erpnext.journal_entry, {
toggle_fields_based_on_currency: function(frm) {
toggle_fields_based_on_currency: function (frm) {
var fields = ["currency_section", "account_currency", "exchange_rate", "debit", "credit"];
var grid = frm.get_field("accounts").grid;
if(grid) grid.set_column_disp(fields, frm.doc.multi_currency);
if (grid) grid.set_column_disp(fields, frm.doc.multi_currency);
// dynamic label
var field_label_map = {
"debit_in_account_currency": "Debit",
"credit_in_account_currency": "Credit"
debit_in_account_currency: "Debit",
credit_in_account_currency: "Credit",
};
$.each(field_label_map, function (fieldname, label) {
frm.fields_dict.accounts.grid.update_docfield_property(
fieldname,
'label',
frm.doc.multi_currency ? (label + " in Account Currency") : label
"label",
frm.doc.multi_currency ? label + " in Account Currency" : label
);
})
});
},
set_debit_credit_in_company_currency: function(frm, cdt, cdn) {
set_debit_credit_in_company_currency: function (frm, cdt, cdn) {
var row = locals[cdt][cdn];
frappe.model.set_value(cdt, cdn, "debit",
flt(flt(row.debit_in_account_currency)*row.exchange_rate, precision("debit", row)));
frappe.model.set_value(
cdt,
cdn,
"debit",
flt(flt(row.debit_in_account_currency) * row.exchange_rate, precision("debit", row))
);
frappe.model.set_value(cdt, cdn, "credit",
flt(flt(row.credit_in_account_currency)*row.exchange_rate, precision("credit", row)));
frappe.model.set_value(
cdt,
cdn,
"credit",
flt(flt(row.credit_in_account_currency) * row.exchange_rate, precision("credit", row))
);
cur_frm.cscript.update_totals(frm.doc);
},
set_exchange_rate: function(frm, cdt, cdn) {
set_exchange_rate: function (frm, cdt, cdn) {
var company_currency = frappe.get_doc(":Company", frm.doc.company).default_currency;
var row = locals[cdt][cdn];
if(row.account_currency == company_currency || !frm.doc.multi_currency) {
if (row.account_currency == company_currency || !frm.doc.multi_currency) {
row.exchange_rate = 1;
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
} else if (!row.exchange_rate || row.exchange_rate == 1 || row.account_type == "Bank") {
@@ -504,50 +553,70 @@ $.extend(erpnext.journal_entry, {
reference_name: cstr(row.reference_name),
debit: flt(row.debit_in_account_currency),
credit: flt(row.credit_in_account_currency),
exchange_rate: row.exchange_rate
exchange_rate: row.exchange_rate,
},
callback: function(r) {
if(r.message) {
callback: function (r) {
if (r.message) {
row.exchange_rate = r.message;
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
}
}
})
},
});
} else {
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn);
}
refresh_field("exchange_rate", cdn, "accounts");
},
quick_entry: function(frm) {
quick_entry: function (frm) {
var naming_series_options = frm.fields_dict.naming_series.df.options;
var naming_series_default = frm.fields_dict.naming_series.df.default || naming_series_options.split("\n")[0];
var naming_series_default =
frm.fields_dict.naming_series.df.default || naming_series_options.split("\n")[0];
var dialog = new frappe.ui.Dialog({
title: __("Quick Journal Entry"),
fields: [
{fieldtype: "Currency", fieldname: "debit", label: __("Amount"), reqd: 1},
{fieldtype: "Link", fieldname: "debit_account", label: __("Debit Account"), reqd: 1,
{ fieldtype: "Currency", fieldname: "debit", label: __("Amount"), reqd: 1 },
{
fieldtype: "Link",
fieldname: "debit_account",
label: __("Debit Account"),
reqd: 1,
options: "Account",
get_query: function() {
get_query: function () {
return erpnext.journal_entry.account_query(frm);
}
},
},
{fieldtype: "Link", fieldname: "credit_account", label: __("Credit Account"), reqd: 1,
{
fieldtype: "Link",
fieldname: "credit_account",
label: __("Credit Account"),
reqd: 1,
options: "Account",
get_query: function() {
get_query: function () {
return erpnext.journal_entry.account_query(frm);
}
},
},
{fieldtype: "Date", fieldname: "posting_date", label: __("Date"), reqd: 1,
default: frm.doc.posting_date},
{fieldtype: "Small Text", fieldname: "user_remark", label: __("User Remark")},
{fieldtype: "Select", fieldname: "naming_series", label: __("Series"), reqd: 1,
options: naming_series_options, default: naming_series_default},
]
{
fieldtype: "Date",
fieldname: "posting_date",
label: __("Date"),
reqd: 1,
default: frm.doc.posting_date,
},
{ fieldtype: "Small Text", fieldname: "user_remark", label: __("User Remark") },
{
fieldtype: "Select",
fieldname: "naming_series",
label: __("Series"),
reqd: 1,
options: naming_series_options,
default: naming_series_default,
},
],
});
dialog.set_primary_action(__("Save"), function() {
dialog.set_primary_action(__("Save"), function () {
var btn = this;
var values = dialog.get_values();
@@ -564,11 +633,21 @@ $.extend(erpnext.journal_entry, {
var debit_row = frm.fields_dict.accounts.grid.add_new_row();
frappe.model.set_value(debit_row.doctype, debit_row.name, "account", values.debit_account);
frappe.model.set_value(debit_row.doctype, debit_row.name, "debit_in_account_currency", values.debit);
frappe.model.set_value(
debit_row.doctype,
debit_row.name,
"debit_in_account_currency",
values.debit
);
var credit_row = frm.fields_dict.accounts.grid.add_new_row();
frappe.model.set_value(credit_row.doctype, credit_row.name, "account", values.credit_account);
frappe.model.set_value(credit_row.doctype, credit_row.name, "credit_in_account_currency", values.debit);
frappe.model.set_value(
credit_row.doctype,
credit_row.name,
"credit_in_account_currency",
values.debit
);
frm.save();
@@ -578,36 +657,39 @@ $.extend(erpnext.journal_entry, {
dialog.show();
},
account_query: function(frm) {
account_query: function (frm) {
var filters = {
company: frm.doc.company,
is_group: 0
is_group: 0,
};
if(!frm.doc.multi_currency) {
if (!frm.doc.multi_currency) {
$.extend(filters, {
account_currency: ['in', [frappe.get_doc(":Company", frm.doc.company).default_currency, null]]
account_currency: [
"in",
[frappe.get_doc(":Company", frm.doc.company).default_currency, null],
],
});
}
return { filters: filters };
},
reverse_journal_entry: function() {
reverse_journal_entry: function () {
frappe.model.open_mapped_doc({
method: "erpnext.accounts.doctype.journal_entry.journal_entry.make_reverse_journal_entry",
frm: cur_frm
})
frm: cur_frm,
});
},
});
$.extend(erpnext.journal_entry, {
set_account_balance: function(frm, dt, dn) {
set_account_details: function (frm, dt, dn) {
var d = locals[dt][dn];
if(d.account) {
if(!frm.doc.company) frappe.throw(__("Please select Company first"));
if(!frm.doc.posting_date) frappe.throw(__("Please select Posting Date first"));
if (d.account) {
if (!frm.doc.company) frappe.throw(__("Please select Company first"));
if (!frm.doc.posting_date) frappe.throw(__("Please select Posting Date first"));
return frappe.call({
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_account_balance_and_party_type",
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_account_details_and_party_type",
args: {
account: d.account,
date: frm.doc.posting_date,
@@ -615,15 +697,14 @@ $.extend(erpnext.journal_entry, {
debit: flt(d.debit_in_account_currency),
credit: flt(d.credit_in_account_currency),
exchange_rate: d.exchange_rate,
cost_center: d.cost_center
},
callback: function(r) {
if(r.message) {
callback: function (r) {
if (r.message) {
$.extend(d, r.message);
erpnext.journal_entry.set_debit_credit_in_company_currency(frm, dt, dn);
refresh_field('accounts');
refresh_field("accounts");
}
}
},
});
}
},

View File

@@ -64,7 +64,8 @@
"stock_entry",
"subscription_section",
"auto_repeat",
"amended_from"
"amended_from",
"repost_required"
],
"fields": [
{
@@ -543,6 +544,15 @@
"label": "Is System Generated",
"no_copy": 1,
"read_only": 1
},
{
"default": "0",
"fieldname": "repost_required",
"fieldtype": "Check",
"hidden": 1,
"label": "Repost Required",
"print_hide": 1,
"read_only": 1
}
],
"icon": "fa fa-file-text",

View File

@@ -13,6 +13,10 @@ from erpnext.accounts.deferred_revenue import get_deferred_booking_accounts
from erpnext.accounts.doctype.invoice_discounting.invoice_discounting import (
get_party_account_based_on_invoice_discounting,
)
from erpnext.accounts.doctype.repost_accounting_ledger.repost_accounting_ledger import (
validate_docs_for_deferred_accounting,
validate_docs_for_voucher_types,
)
from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category import (
get_party_tax_withholding_details,
)
@@ -140,7 +144,6 @@ class JournalEntry(AccountsController):
self.set_print_format_fields()
self.validate_credit_debit_note()
self.validate_empty_accounts_table()
self.set_account_and_party_balance()
self.validate_inter_company_accounts()
self.validate_depr_entry_voucher_type()
@@ -150,6 +153,24 @@ class JournalEntry(AccountsController):
if not self.title:
self.title = self.get_title()
def validate_for_repost(self):
validate_docs_for_voucher_types(["Journal Entry"])
validate_docs_for_deferred_accounting([self.name], [])
def submit(self):
if len(self.accounts) > 100:
msgprint(_("The task has been enqueued as a background job."), alert=True)
self.queue_action("submit", timeout=4600)
else:
return self._submit()
def cancel(self):
if len(self.accounts) > 100:
msgprint(_("The task has been enqueued as a background job."), alert=True)
self.queue_action("cancel", timeout=4600)
else:
return self._cancel()
def on_submit(self):
self.validate_cheque_info()
self.check_credit_limit()
@@ -159,6 +180,15 @@ class JournalEntry(AccountsController):
self.update_inter_company_jv()
self.update_invoice_discounting()
def on_update_after_submit(self):
if hasattr(self, "repost_required"):
self.needs_repost = self.check_if_fields_updated(
fields_to_check=[], child_tables={"accounts": []}
)
if self.needs_repost:
self.validate_for_repost()
self.db_set("repost_required", self.needs_repost)
def on_cancel(self):
# References for this Journal are removed on the `on_cancel` event in accounts_controller
super(JournalEntry, self).on_cancel()
@@ -545,17 +575,28 @@ class JournalEntry(AccountsController):
elif d.party_type == "Supplier" and flt(d.credit) > 0:
frappe.throw(_("Row {0}: Advance against Supplier must be debit").format(d.idx))
def system_generated_gain_loss(self):
return (
self.voucher_type == "Exchange Gain Or Loss"
and self.multi_currency
and self.is_system_generated
)
def validate_against_jv(self):
for d in self.get("accounts"):
if d.reference_type == "Journal Entry":
account_root_type = frappe.get_cached_value("Account", d.account, "root_type")
if account_root_type == "Asset" and flt(d.debit) > 0:
if account_root_type == "Asset" and flt(d.debit) > 0 and not self.system_generated_gain_loss():
frappe.throw(
_(
"Row #{0}: For {1}, you can select reference document only if account gets credited"
).format(d.idx, d.account)
)
elif account_root_type == "Liability" and flt(d.credit) > 0:
elif (
account_root_type == "Liability"
and flt(d.credit) > 0
and not self.system_generated_gain_loss()
):
frappe.throw(
_(
"Row #{0}: For {1}, you can select reference document only if account gets debited"
@@ -587,7 +628,7 @@ class JournalEntry(AccountsController):
for jvd in against_entries:
if flt(jvd[dr_or_cr]) > 0:
valid = True
if not valid:
if not valid and not self.system_generated_gain_loss():
frappe.throw(
_("Against Journal Entry {0} does not have any unmatched {1} entry").format(
d.reference_name, dr_or_cr
@@ -1135,21 +1176,6 @@ class JournalEntry(AccountsController):
if not self.get("accounts"):
frappe.throw(_("Accounts table cannot be blank."))
def set_account_and_party_balance(self):
account_balance = {}
party_balance = {}
for d in self.get("accounts"):
if d.account not in account_balance:
account_balance[d.account] = get_balance_on(account=d.account, date=self.posting_date)
if (d.party_type, d.party) not in party_balance:
party_balance[(d.party_type, d.party)] = get_balance_on(
party_type=d.party_type, party=d.party, date=self.posting_date, company=self.company
)
d.account_balance = account_balance[d.account]
d.party_balance = party_balance[(d.party_type, d.party)]
@frappe.whitelist()
def get_default_bank_cash_account(company, account_type=None, mode_of_payment=None, account=None):
@@ -1315,8 +1341,6 @@ def get_payment_entry(ref_doc, args):
"account_type": frappe.get_cached_value("Account", args.get("party_account"), "account_type"),
"account_currency": args.get("party_account_currency")
or get_account_currency(args.get("party_account")),
"balance": get_balance_on(args.get("party_account")),
"party_balance": get_balance_on(party=args.get("party"), party_type=args.get("party_type")),
"exchange_rate": exchange_rate,
args.get("amount_field_party"): args.get("amount"),
"is_advance": args.get("is_advance"),
@@ -1464,30 +1488,23 @@ def get_outstanding(args):
@frappe.whitelist()
def get_party_account_and_balance(company, party_type, party, cost_center=None):
def get_party_account_and_currency(company, party_type, party):
if not frappe.has_permission("Account"):
frappe.msgprint(_("No Permission"), raise_exception=1)
account = get_party_account(party_type, party, company)
account_balance = get_balance_on(account=account, cost_center=cost_center)
party_balance = get_balance_on(
party_type=party_type, party=party, company=company, cost_center=cost_center
)
return {
"account": account,
"balance": account_balance,
"party_balance": party_balance,
"account_currency": frappe.get_cached_value("Account", account, "account_currency"),
}
@frappe.whitelist()
def get_account_balance_and_party_type(
account, date, company, debit=None, credit=None, exchange_rate=None, cost_center=None
def get_account_details_and_party_type(
account, date, company, debit=None, credit=None, exchange_rate=None
):
"""Returns dict of account balance and party type to be set in Journal Entry on selection of account."""
"""Returns dict of account details and party type to be set in Journal Entry on selection of account."""
if not frappe.has_permission("Account"):
frappe.msgprint(_("No Permission"), raise_exception=1)
@@ -1507,7 +1524,6 @@ def get_account_balance_and_party_type(
party_type = ""
grid_values = {
"balance": get_balance_on(account, date, cost_center=cost_center),
"party_type": party_type,
"account_type": account_details.account_type,
"account_currency": account_details.account_currency or company_currency,

View File

@@ -1,12 +1,12 @@
frappe.listview_settings['Journal Entry'] = {
frappe.listview_settings["Journal Entry"] = {
add_fields: ["voucher_type", "posting_date", "total_debit", "company", "user_remark"],
get_indicator: function(doc) {
if(doc.docstatus==0) {
return [__("Draft", "red", "docstatus,=,0")]
} else if(doc.docstatus==2) {
return [__("Cancelled", "grey", "docstatus,=,2")]
get_indicator: function (doc) {
if (doc.docstatus == 0) {
return [__("Draft", "red", "docstatus,=,0")];
} else if (doc.docstatus == 2) {
return [__("Cancelled", "grey", "docstatus,=,2")];
} else {
return [__(doc.voucher_type), "blue", "voucher_type,=," + doc.voucher_type]
return [__(doc.voucher_type), "blue", "voucher_type,=," + doc.voucher_type];
}
}
},
};

View File

@@ -166,43 +166,37 @@ class TestJournalEntry(unittest.TestCase):
jv.get("accounts")[1].credit_in_account_currency = 5000
jv.submit()
gl_entries = frappe.db.sql(
"""select account, account_currency, debit, credit,
debit_in_account_currency, credit_in_account_currency
from `tabGL Entry` where voucher_type='Journal Entry' and voucher_no=%s
order by account asc""",
jv.name,
as_dict=1,
)
self.voucher_no = jv.name
self.assertTrue(gl_entries)
self.fields = [
"account",
"account_currency",
"debit",
"debit_in_account_currency",
"credit",
"credit_in_account_currency",
]
expected_values = {
"_Test Bank USD - _TC": {
"account_currency": "USD",
"debit": 5000,
"debit_in_account_currency": 100,
"credit": 0,
"credit_in_account_currency": 0,
},
"_Test Bank - _TC": {
self.expected_gle = [
{
"account": "_Test Bank - _TC",
"account_currency": "INR",
"debit": 0,
"debit_in_account_currency": 0,
"credit": 5000,
"credit_in_account_currency": 5000,
},
}
{
"account": "_Test Bank USD - _TC",
"account_currency": "USD",
"debit": 5000,
"debit_in_account_currency": 100,
"credit": 0,
"credit_in_account_currency": 0,
},
]
for field in (
"account_currency",
"debit",
"debit_in_account_currency",
"credit",
"credit_in_account_currency",
):
for i, gle in enumerate(gl_entries):
self.assertEqual(expected_values[gle.account][field], gle[field])
self.check_gl_entries()
# cancel
jv.cancel()
@@ -228,43 +222,37 @@ class TestJournalEntry(unittest.TestCase):
rjv.posting_date = nowdate()
rjv.submit()
gl_entries = frappe.db.sql(
"""select account, account_currency, debit, credit,
debit_in_account_currency, credit_in_account_currency
from `tabGL Entry` where voucher_type='Journal Entry' and voucher_no=%s
order by account asc""",
rjv.name,
as_dict=1,
)
self.voucher_no = rjv.name
self.assertTrue(gl_entries)
self.fields = [
"account",
"account_currency",
"debit",
"credit",
"debit_in_account_currency",
"credit_in_account_currency",
]
expected_values = {
"_Test Bank USD - _TC": {
self.expected_gle = [
{
"account": "_Test Bank USD - _TC",
"account_currency": "USD",
"debit": 0,
"debit_in_account_currency": 0,
"credit": 5000,
"credit_in_account_currency": 100,
},
"Sales - _TC": {
{
"account": "Sales - _TC",
"account_currency": "INR",
"debit": 5000,
"debit_in_account_currency": 5000,
"credit": 0,
"credit_in_account_currency": 0,
},
}
]
for field in (
"account_currency",
"debit",
"debit_in_account_currency",
"credit",
"credit_in_account_currency",
):
for i, gle in enumerate(gl_entries):
self.assertEqual(expected_values[gle.account][field], gle[field])
self.check_gl_entries()
def test_disallow_change_in_account_currency_for_a_party(self):
# create jv in USD
@@ -344,23 +332,25 @@ class TestJournalEntry(unittest.TestCase):
jv.insert()
jv.submit()
expected_values = {
"_Test Cash - _TC": {"cost_center": cost_center},
"_Test Bank - _TC": {"cost_center": cost_center},
}
self.voucher_no = jv.name
gl_entries = frappe.db.sql(
"""select account, cost_center, debit, credit
from `tabGL Entry` where voucher_type='Journal Entry' and voucher_no=%s
order by account asc""",
jv.name,
as_dict=1,
)
self.fields = [
"account",
"cost_center",
]
self.assertTrue(gl_entries)
self.expected_gle = [
{
"account": "_Test Bank - _TC",
"cost_center": cost_center,
},
{
"account": "_Test Cash - _TC",
"cost_center": cost_center,
},
]
for gle in gl_entries:
self.assertEqual(expected_values[gle.account]["cost_center"], gle.cost_center)
self.check_gl_entries()
def test_jv_with_project(self):
from erpnext.projects.doctype.project.test_project import make_project
@@ -387,23 +377,22 @@ class TestJournalEntry(unittest.TestCase):
jv.insert()
jv.submit()
expected_values = {
"_Test Cash - _TC": {"project": project_name},
"_Test Bank - _TC": {"project": project_name},
}
self.voucher_no = jv.name
gl_entries = frappe.db.sql(
"""select account, project, debit, credit
from `tabGL Entry` where voucher_type='Journal Entry' and voucher_no=%s
order by account asc""",
jv.name,
as_dict=1,
)
self.fields = ["account", "project"]
self.assertTrue(gl_entries)
self.expected_gle = [
{
"account": "_Test Bank - _TC",
"project": project_name,
},
{
"account": "_Test Cash - _TC",
"project": project_name,
},
]
for gle in gl_entries:
self.assertEqual(expected_values[gle.account]["project"], gle.project)
self.check_gl_entries()
def test_jv_account_and_party_balance_with_cost_centre(self):
from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
@@ -426,6 +415,79 @@ class TestJournalEntry(unittest.TestCase):
account_balance = get_balance_on(account="_Test Bank - _TC", cost_center=cost_center)
self.assertEqual(expected_account_balance, account_balance)
def test_repost_accounting_entries(self):
from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
# Configure Repost Accounting Ledger for JVs
settings = frappe.get_doc("Repost Accounting Ledger Settings")
if not [x for x in settings.allowed_types if x.document_type == "Journal Entry"]:
settings.append("allowed_types", {"document_type": "Journal Entry", "allowed": True})
settings.save()
# Create JV with defaut cost center - _Test Cost Center
jv = make_journal_entry("_Test Cash - _TC", "_Test Bank - _TC", 100, save=False)
jv.multi_currency = 0
jv.submit()
# Check GL entries before reposting
self.voucher_no = jv.name
self.fields = [
"account",
"debit_in_account_currency",
"credit_in_account_currency",
"cost_center",
]
self.expected_gle = [
{
"account": "_Test Bank - _TC",
"debit_in_account_currency": 0,
"credit_in_account_currency": 100,
"cost_center": "_Test Cost Center - _TC",
},
{
"account": "_Test Cash - _TC",
"debit_in_account_currency": 100,
"credit_in_account_currency": 0,
"cost_center": "_Test Cost Center - _TC",
},
]
self.check_gl_entries()
# Change cost center for bank account - _Test Cost Center for BS Account
create_cost_center(cost_center_name="_Test Cost Center for BS Account", company="_Test Company")
jv.accounts[1].cost_center = "_Test Cost Center for BS Account - _TC"
jv.save()
# Check if repost flag gets set on update after submit
self.assertTrue(jv.repost_required)
jv.repost_accounting_entries()
# Check GL entries after reposting
jv.load_from_db()
self.expected_gle[0]["cost_center"] = "_Test Cost Center for BS Account - _TC"
self.check_gl_entries()
def check_gl_entries(self):
gl = frappe.qb.DocType("GL Entry")
query = frappe.qb.from_(gl)
for field in self.fields:
query = query.select(gl[field])
query = query.where(
(gl.voucher_type == "Journal Entry")
& (gl.voucher_no == self.voucher_no)
& (gl.is_cancelled == 0)
).orderby(gl.account)
gl_entries = query.run(as_dict=True)
for i in range(len(self.expected_gle)):
for field in self.fields:
self.assertEqual(self.expected_gle[i][field], gl_entries[i][field])
def make_journal_entry(
account1,

View File

@@ -1,97 +1,94 @@
[
{
"cheque_date": "2013-03-14",
"cheque_no": "33",
"company": "_Test Company",
"doctype": "Journal Entry",
"accounts": [
{
"account": "Debtors - _TC",
"party_type": "Customer",
"party": "_Test Customer",
"credit_in_account_currency": 400.0,
"debit_in_account_currency": 0.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts",
"cost_center": "_Test Cost Center - _TC"
},
{
"account": "_Test Bank - _TC",
"credit_in_account_currency": 0.0,
"debit_in_account_currency": 400.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts",
"cost_center": "_Test Cost Center - _TC"
}
],
"naming_series": "_T-Journal Entry-",
"posting_date": "2013-02-14",
"user_remark": "test",
"voucher_type": "Bank Entry"
},
{
"cheque_date": "2013-02-14",
"cheque_no": "33",
"company": "_Test Company",
"doctype": "Journal Entry",
"accounts": [
{
"account": "_Test Payable - _TC",
"party_type": "Supplier",
"party": "_Test Supplier",
"credit_in_account_currency": 0.0,
"debit_in_account_currency": 400.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts",
"cost_center": "_Test Cost Center - _TC"
},
{
"account": "_Test Bank - _TC",
"credit_in_account_currency": 400.0,
"debit_in_account_currency": 0.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts",
"cost_center": "_Test Cost Center - _TC"
}
],
"naming_series": "_T-Journal Entry-",
"posting_date": "2013-02-14",
"user_remark": "test",
"voucher_type": "Bank Entry"
},
{
"cheque_date": "2013-02-14",
"cheque_no": "33",
"company": "_Test Company",
"doctype": "Journal Entry",
"accounts": [
{
"account": "Debtors - _TC",
"party_type": "Customer",
"party": "_Test Customer",
"credit_in_account_currency": 0.0,
"debit_in_account_currency": 400.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts",
"cost_center": "_Test Cost Center - _TC"
},
{
"account": "Sales - _TC",
"cost_center": "_Test Cost Center - _TC",
"credit_in_account_currency": 400.0,
"debit_in_account_currency": 0.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts",
"cost_center": "_Test Cost Center - _TC"
}
],
"naming_series": "_T-Journal Entry-",
"posting_date": "2013-02-14",
"user_remark": "test",
"voucher_type": "Bank Entry"
}
{
"cheque_date": "2013-03-14",
"cheque_no": "33",
"company": "_Test Company",
"doctype": "Journal Entry",
"accounts": [
{
"account": "Debtors - _TC",
"party_type": "Customer",
"party": "_Test Customer",
"credit_in_account_currency": 400.0,
"debit_in_account_currency": 0.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts",
"cost_center": "_Test Cost Center - _TC"
},
{
"account": "_Test Bank - _TC",
"credit_in_account_currency": 0.0,
"debit_in_account_currency": 400.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts",
"cost_center": "_Test Cost Center - _TC"
}
],
"naming_series": "_T-Journal Entry-",
"posting_date": "2013-02-14",
"user_remark": "test",
"voucher_type": "Bank Entry"
},
{
"cheque_date": "2013-02-14",
"cheque_no": "33",
"company": "_Test Company",
"doctype": "Journal Entry",
"accounts": [
{
"account": "_Test Payable - _TC",
"party_type": "Supplier",
"party": "_Test Supplier",
"credit_in_account_currency": 0.0,
"debit_in_account_currency": 400.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts",
"cost_center": "_Test Cost Center - _TC"
},
{
"account": "_Test Bank - _TC",
"credit_in_account_currency": 400.0,
"debit_in_account_currency": 0.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts",
"cost_center": "_Test Cost Center - _TC"
}
],
"naming_series": "_T-Journal Entry-",
"posting_date": "2013-02-14",
"user_remark": "test",
"voucher_type": "Bank Entry"
},
{
"cheque_date": "2013-02-14",
"cheque_no": "33",
"company": "_Test Company",
"doctype": "Journal Entry",
"accounts": [
{
"account": "Debtors - _TC",
"party_type": "Customer",
"party": "_Test Customer",
"credit_in_account_currency": 0.0,
"debit_in_account_currency": 400.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts",
"cost_center": "_Test Cost Center - _TC"
},
{
"account": "Sales - _TC",
"credit_in_account_currency": 400.0,
"debit_in_account_currency": 0.0,
"doctype": "Journal Entry Account",
"parentfield": "accounts",
"cost_center": "_Test Cost Center - _TC"
}
],
"naming_series": "_T-Journal Entry-",
"posting_date": "2013-02-14",
"user_remark": "test",
"voucher_type": "Bank Entry"
}
]

View File

@@ -9,12 +9,10 @@
"field_order": [
"account",
"account_type",
"balance",
"col_break1",
"bank_account",
"party_type",
"party",
"party_balance",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
@@ -64,17 +62,7 @@
"print_hide": 1
},
{
"fieldname": "balance",
"fieldtype": "Currency",
"label": "Account Balance",
"no_copy": 1,
"oldfieldname": "balance",
"oldfieldtype": "Data",
"options": "account_currency",
"print_hide": 1,
"read_only": 1
},
{
"allow_on_submit": 1,
"default": ":Company",
"description": "If Income or Expense",
"fieldname": "cost_center",
@@ -107,14 +95,6 @@
"label": "Party",
"options": "party_type"
},
{
"fieldname": "party_balance",
"fieldtype": "Currency",
"label": "Party Balance",
"options": "account_currency",
"print_hide": 1,
"read_only": 1
},
{
"fieldname": "currency_section",
"fieldtype": "Section Break",
@@ -223,6 +203,7 @@
"no_copy": 1
},
{
"allow_on_submit": 1,
"fieldname": "project",
"fieldtype": "Link",
"label": "Project",
@@ -287,7 +268,7 @@
"idx": 1,
"istable": 1,
"links": [],
"modified": "2023-11-23 11:44:25.841187",
"modified": "2024-02-05 01:10:50.224840",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry Account",

View File

@@ -2,78 +2,85 @@
// For license information, please see license.txt
frappe.ui.form.on("Journal Entry Template", {
onload: function(frm) {
if(frm.is_new()) {
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) {
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) {
refresh: function (frm) {
frappe.model.set_default_values(frm.doc);
frm.set_query("account" ,"accounts", function(){
frm.set_query("account", "accounts", function () {
var filters = {
company: frm.doc.company,
is_group: 0
is_group: 0,
};
if(!frm.doc.multi_currency) {
if (!frm.doc.multi_currency) {
$.extend(filters, {
account_currency: ['in', [frappe.get_doc(":Company", frm.doc.company).default_currency, null]]
account_currency: [
"in",
[frappe.get_doc(":Company", frm.doc.company).default_currency, null],
],
});
}
return { filters: filters };
});
},
voucher_type: function(frm) {
var add_accounts = function(doc, r) {
$.each(r, function(i, d) {
voucher_type: function (frm) {
var add_accounts = function (doc, r) {
$.each(r, function (i, d) {
var row = frappe.model.add_child(doc, "Journal Entry Template Account", "accounts");
row.account = d.account;
});
refresh_field("accounts");
};
if(!frm.doc.company) return;
if (!frm.doc.company) return;
frm.trigger("clear_child");
switch(frm.doc.voucher_type){
switch (frm.doc.voucher_type) {
case "Bank Entry":
case "Cash Entry":
frappe.call({
type: "GET",
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_default_bank_cash_account",
args: {
"account_type": (frm.doc.voucher_type=="Bank Entry" ?
"Bank" : (frm.doc.voucher_type=="Cash Entry" ? "Cash" : null)),
"company": frm.doc.company
account_type:
frm.doc.voucher_type == "Bank Entry"
? "Bank"
: frm.doc.voucher_type == "Cash Entry"
? "Cash"
: null,
company: frm.doc.company,
},
callback: function(r) {
if(r.message) {
callback: function (r) {
if (r.message) {
// If default company bank account not set
if(!$.isEmptyObject(r.message)){
if (!$.isEmptyObject(r.message)) {
add_accounts(frm.doc, [r.message]);
}
}
}
},
});
break;
default:
frm.trigger("clear_child");
}
},
clear_child: function(frm){
clear_child: function (frm) {
frappe.model.clear_table(frm.doc, "accounts");
frm.refresh_field("accounts");
}
},
});

View File

@@ -1,9 +1,9 @@
// Copyright (c) 2021, Wahni Green Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Ledger Merge', {
setup: function(frm) {
frappe.realtime.on('ledger_merge_refresh', ({ ledger_merge }) => {
frappe.ui.form.on("Ledger Merge", {
setup: function (frm) {
frappe.realtime.on("ledger_merge_refresh", ({ ledger_merge }) => {
if (ledger_merge !== frm.doc.name) return;
frappe.model.clear_doc(frm.doc.doctype, frm.doc.name);
frappe.model.with_doc(frm.doc.doctype, frm.doc.name).then(() => {
@@ -11,29 +11,29 @@ frappe.ui.form.on('Ledger Merge', {
});
});
frappe.realtime.on('ledger_merge_progress', data => {
frappe.realtime.on("ledger_merge_progress", (data) => {
if (data.ledger_merge !== frm.doc.name) return;
let message = __('Merging {0} of {1}', [data.current, data.total]);
let message = __("Merging {0} of {1}", [data.current, data.total]);
let percent = Math.floor((data.current * 100) / data.total);
frm.dashboard.show_progress(__('Merge Progress'), percent, message);
frm.page.set_indicator(__('In Progress'), 'orange');
frm.dashboard.show_progress(__("Merge Progress"), percent, message);
frm.page.set_indicator(__("In Progress"), "orange");
});
frm.set_query("account", function(doc) {
if (!doc.company) frappe.throw(__('Please set Company'));
if (!doc.root_type) frappe.throw(__('Please set Root Type'));
frm.set_query("account", function (doc) {
if (!doc.company) frappe.throw(__("Please set Company"));
if (!doc.root_type) frappe.throw(__("Please set Root Type"));
return {
filters: {
root_type: doc.root_type,
company: doc.company
}
company: doc.company,
},
};
});
frm.set_query('account', 'merge_accounts', function(doc) {
if (!doc.company) frappe.throw(__('Please set Company'));
if (!doc.root_type) frappe.throw(__('Please set Root Type'));
if (!doc.account) frappe.throw(__('Please set Account'));
frm.set_query("account", "merge_accounts", function (doc) {
if (!doc.company) frappe.throw(__("Please set Company"));
if (!doc.root_type) frappe.throw(__("Please set Root Type"));
if (!doc.account) frappe.throw(__("Please set Account"));
let acc = [doc.account];
frm.doc.merge_accounts.forEach((row) => {
acc.push(row.account);
@@ -43,86 +43,86 @@ frappe.ui.form.on('Ledger Merge', {
is_group: doc.is_group,
root_type: doc.root_type,
name: ["not in", acc],
company: doc.company
}
company: doc.company,
},
};
});
},
refresh: function(frm) {
refresh: function (frm) {
frm.page.hide_icon_group();
frm.trigger('set_merge_status');
frm.trigger('update_primary_action');
frm.trigger("set_merge_status");
frm.trigger("update_primary_action");
},
after_save: function(frm) {
after_save: function (frm) {
setTimeout(() => {
frm.trigger('update_primary_action');
frm.trigger("update_primary_action");
}, 500);
},
update_primary_action: function(frm) {
update_primary_action: function (frm) {
if (frm.is_dirty()) {
frm.enable_save();
return;
}
frm.disable_save();
if (frm.doc.status !== 'Success') {
if (frm.doc.status !== "Success") {
if (!frm.is_new()) {
let label = frm.doc.status === 'Pending' ? __('Start Merge') : __('Retry');
let label = frm.doc.status === "Pending" ? __("Start Merge") : __("Retry");
frm.page.set_primary_action(label, () => frm.events.start_merge(frm));
} else {
frm.page.set_primary_action(__('Save'), () => frm.save());
frm.page.set_primary_action(__("Save"), () => frm.save());
}
}
},
start_merge: function(frm) {
start_merge: function (frm) {
frm.call({
method: 'form_start_merge',
method: "form_start_merge",
args: { docname: frm.doc.name },
btn: frm.page.btn_primary
}).then(r => {
btn: frm.page.btn_primary,
}).then((r) => {
if (r.message === true) {
frm.disable_save();
}
});
},
set_merge_status: function(frm) {
set_merge_status: function (frm) {
if (frm.doc.status == "Pending") return;
let successful_records = 0;
frm.doc.merge_accounts.forEach((row) => {
if (row.merged) successful_records += 1;
});
let message_args = [successful_records, frm.doc.merge_accounts.length];
frm.dashboard.set_headline(__('Successfully merged {0} out of {1}.', message_args));
frm.dashboard.set_headline(__("Successfully merged {0} out of {1}.", message_args));
},
root_type: function(frm) {
frm.set_value('account', '');
frm.set_value('merge_accounts', []);
root_type: function (frm) {
frm.set_value("account", "");
frm.set_value("merge_accounts", []);
},
company: function(frm) {
frm.set_value('account', '');
frm.set_value('merge_accounts', []);
}
company: function (frm) {
frm.set_value("account", "");
frm.set_value("merge_accounts", []);
},
});
frappe.ui.form.on('Ledger Merge Accounts', {
merge_accounts_add: function(frm) {
frm.trigger('update_primary_action');
frappe.ui.form.on("Ledger Merge Accounts", {
merge_accounts_add: function (frm) {
frm.trigger("update_primary_action");
},
merge_accounts_remove: function(frm) {
frm.trigger('update_primary_action');
merge_accounts_remove: function (frm) {
frm.trigger("update_primary_action");
},
account: function(frm, cdt, cdn) {
account: function (frm, cdt, cdn) {
let row = frappe.get_doc(cdt, cdn);
row.account_name = row.account;
frm.refresh_field('merge_accounts');
frm.trigger('update_primary_action');
}
frm.refresh_field("merge_accounts");
frm.trigger("update_primary_action");
},
});

View File

@@ -1,8 +1,6 @@
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Loyalty Point Entry', {
refresh: function(frm) {
}
frappe.ui.form.on("Loyalty Point Entry", {
refresh: function (frm) {},
});

View File

@@ -3,30 +3,37 @@
frappe.provide("erpnext.accounts.dimensions");
frappe.ui.form.on('Loyalty Program', {
setup: function(frm) {
var help_content =
`<table class="table table-bordered" style="background-color: var(--scrollbar-track-color);">
frappe.ui.form.on("Loyalty Program", {
setup: function (frm) {
var help_content = `<table class="table table-bordered" style="background-color: var(--scrollbar-track-color);">
<tr><td>
<h4>
<i class="fa fa-hand-right"></i>
${__('Notes')}
${__("Notes")}
</h4>
<ul>
<li>
${__("Loyalty Points will be calculated from the spent done (via the Sales Invoice), based on collection factor mentioned.")}
${__(
"Loyalty Points will be calculated from the spent done (via the Sales Invoice), based on collection factor mentioned."
)}
</li>
<li>
${__("There can be multiple tiered collection factor based on the total spent. But the conversion factor for redemption will always be same for all the tier.")}
${__(
"There can be multiple tiered collection factor based on the total spent. But the conversion factor for redemption will always be same for all the tier."
)}
</li>
<li>
${__("In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent")}
${__(
"In the case of multi-tier program, Customers will be auto assigned to the concerned tier as per their spent"
)}
</li>
<li>
${__("If unlimited expiry for the Loyalty Points, keep the Expiry Duration empty or 0.")}
</li>
<li>
${__("If Auto Opt In is checked, then the customers will be automatically linked with the concerned Loyalty Program (on save)")}
${__(
"If Auto Opt In is checked, then the customers will be automatically linked with the concerned Loyalty Program (on save)"
)}
</li>
<li>
${__("One customer can be part of only single Loyalty Program.")}
@@ -37,14 +44,14 @@ frappe.ui.form.on('Loyalty Program', {
set_field_options("loyalty_program_help", help_content);
},
onload: function(frm) {
frm.set_query("expense_account", function(doc) {
onload: function (frm) {
frm.set_query("expense_account", function (doc) {
return {
filters: {
"root_type": "Expense",
'is_group': 0,
'company': doc.company
}
root_type: "Expense",
is_group: 0,
company: doc.company,
},
};
});
@@ -52,13 +59,15 @@ frappe.ui.form.on('Loyalty Program', {
erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
},
refresh: function(frm) {
refresh: function (frm) {
if (frm.doc.loyalty_program_type === "Single Tier Program" && frm.doc.collection_rules.length > 1) {
frappe.throw(__("Please select the Multiple Tier Program type for more than one collection rules."));
frappe.throw(
__("Please select the Multiple Tier Program type for more than one collection rules.")
);
}
},
company: function(frm) {
company: function (frm) {
erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
}
},
});

View File

@@ -1,16 +1,16 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.ui.form.on('Mode of Payment', {
setup: function(frm) {
frm.set_query("default_account", "accounts", function(doc, cdt, cdn) {
frappe.ui.form.on("Mode of Payment", {
setup: function (frm) {
frm.set_query("default_account", "accounts", function (doc, cdt, cdn) {
let d = locals[cdt][cdn];
return {
filters: [
['Account', 'account_type', 'in', 'Bank, Cash, Receivable'],
['Account', 'is_group', '=', 0],
['Account', 'company', '=', d.company]
]
["Account", "account_type", "in", "Bank, Cash, Receivable"],
["Account", "is_group", "=", 0],
["Account", "company", "=", d.company],
],
};
});
},

View File

@@ -1,16 +1,16 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.ui.form.on('Monthly Distribution', {
frappe.ui.form.on("Monthly Distribution", {
onload(frm) {
if(frm.doc.__islocal) {
return frm.call('get_months').then(() => {
frm.refresh_field('percentages');
if (frm.doc.__islocal) {
return frm.call("get_months").then(() => {
frm.refresh_field("percentages");
});
}
},
refresh(frm) {
frm.toggle_display('distribution_id', frm.doc.__islocal);
}
frm.toggle_display("distribution_id", frm.doc.__islocal);
},
});

View File

@@ -1,173 +1,77 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "field:distribution_id",
"beta": 0,
"creation": "2013-01-10 16:34:05",
"custom": 0,
"description": "**Monthly Distribution** helps you distribute the Budget/Target across months if you have seasonality in your business.",
"docstatus": 0,
"doctype": "DocType",
"editable_grid": 0,
"engine": "InnoDB",
"actions": [],
"autoname": "field:distribution_id",
"creation": "2013-01-10 16:34:05",
"description": "Helps you distribute the Budget/Target across months if you have seasonality in your business.",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"distribution_id",
"fiscal_year",
"percentages"
],
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Name of the Monthly Distribution",
"fieldname": "distribution_id",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Distribution Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "distribution_id",
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
"description": "Name of the Monthly Distribution",
"fieldname": "distribution_id",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Distribution Name",
"oldfieldname": "distribution_id",
"oldfieldtype": "Data",
"reqd": 1,
"unique": 1
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "fiscal_year",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Fiscal Year",
"length": 0,
"no_copy": 0,
"oldfieldname": "fiscal_year",
"oldfieldtype": "Select",
"options": "Fiscal Year",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
"unique": 0
},
"fieldname": "fiscal_year",
"fieldtype": "Link",
"in_filter": 1,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Fiscal Year",
"oldfieldname": "fiscal_year",
"oldfieldtype": "Select",
"options": "Fiscal Year",
"search_index": 1
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "percentages",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Monthly Distribution Percentages",
"length": 0,
"no_copy": 0,
"oldfieldname": "budget_distribution_details",
"oldfieldtype": "Table",
"options": "Monthly Distribution Percentage",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
"fieldname": "percentages",
"fieldtype": "Table",
"label": "Monthly Distribution Percentages",
"oldfieldname": "budget_distribution_details",
"oldfieldtype": "Table",
"options": "Monthly Distribution Percentage"
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "fa fa-bar-chart",
"idx": 1,
"image_view": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-11-21 14:54:35.998761",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Monthly Distribution",
"name_case": "Title Case",
"owner": "Administrator",
],
"icon": "fa fa-bar-chart",
"idx": 1,
"links": [],
"modified": "2024-01-30 13:57:55.802744",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Monthly Distribution",
"naming_rule": "By fieldname",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"create": 1,
"delete": 1,
"email": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"share": 1,
"write": 1
},
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 2,
"print": 0,
"read": 1,
"report": 1,
"role": "Accounts Manager",
"set_user_permissions": 0,
"share": 0,
"submit": 0,
"write": 0
"permlevel": 2,
"read": 1,
"report": 1,
"role": "Accounts Manager"
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_seen": 0
],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}

View File

@@ -1,48 +1,52 @@
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Opening Invoice Creation Tool', {
setup: function(frm) {
frm.set_query('party_type', 'invoices', function(doc, cdt, cdn) {
frappe.ui.form.on("Opening Invoice Creation Tool", {
setup: function (frm) {
frm.set_query("party_type", "invoices", function (doc, cdt, cdn) {
return {
filters: {
'name': ['in', 'Customer, Supplier']
}
name: ["in", "Customer, Supplier"],
},
};
});
if (frm.doc.company) {
frm.trigger('setup_company_filters');
frm.trigger("setup_company_filters");
}
frappe.realtime.on('opening_invoice_creation_progress', data => {
frappe.realtime.on("opening_invoice_creation_progress", (data) => {
if (!frm.doc.import_in_progress) {
frm.dashboard.reset();
frm.doc.import_in_progress = true;
}
if (data.count == data.total) {
setTimeout(() => {
frm.doc.import_in_progress = false;
frm.clear_table("invoices");
frm.refresh_fields();
frm.page.clear_indicator();
frm.dashboard.hide_progress();
frappe.msgprint(__("Opening {0} Invoices created", [frm.doc.invoice_type]));
}, 1500, data.title);
setTimeout(
() => {
frm.doc.import_in_progress = false;
frm.clear_table("invoices");
frm.refresh_fields();
frm.page.clear_indicator();
frm.dashboard.hide_progress();
frappe.msgprint(__("Opening {0} Invoices created", [frm.doc.invoice_type]));
},
1500,
data.title
);
return;
}
frm.dashboard.show_progress(data.title, (data.count / data.total) * 100, data.message);
frm.page.set_indicator(__('In Progress'), 'orange');
frm.page.set_indicator(__("In Progress"), "orange");
});
erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
},
refresh: function(frm) {
refresh: function (frm) {
frm.disable_save();
!frm.doc.import_in_progress && frm.trigger("make_dashboard");
frm.page.set_primary_action(__('Create Invoices'), () => {
frm.page.set_primary_action(__("Create Invoices"), () => {
let btn_primary = frm.page.btn_primary.get(0);
return frm.call({
doc: frm.doc,
@@ -58,100 +62,98 @@ frappe.ui.form.on('Opening Invoice Creation Tool', {
}
},
setup_company_filters: function(frm) {
frm.set_query('cost_center', 'invoices', function(doc, cdt, cdn) {
setup_company_filters: function (frm) {
frm.set_query("cost_center", "invoices", function (doc, cdt, cdn) {
return {
filters: {
'company': doc.company
}
company: doc.company,
},
};
});
frm.set_query('cost_center', function(doc) {
frm.set_query("cost_center", function (doc) {
return {
filters: {
'company': doc.company
}
company: doc.company,
},
};
});
frm.set_query('temporary_opening_account', 'invoices', function(doc, cdt, cdn) {
frm.set_query("temporary_opening_account", "invoices", function (doc, cdt, cdn) {
return {
filters: {
'company': doc.company
}
}
company: doc.company,
},
};
});
},
company: function(frm) {
company: function (frm) {
if (frm.doc.company) {
frm.trigger('setup_company_filters');
frm.trigger("setup_company_filters");
frappe.call({
method: 'erpnext.accounts.doctype.opening_invoice_creation_tool.opening_invoice_creation_tool.get_temporary_opening_account',
method: "erpnext.accounts.doctype.opening_invoice_creation_tool.opening_invoice_creation_tool.get_temporary_opening_account",
args: {
company: frm.doc.company
company: frm.doc.company,
},
callback: (r) => {
if (r.message) {
frm.doc.__onload.temporary_opening_account = r.message;
frm.trigger('update_invoice_table');
frm.trigger("update_invoice_table");
}
}
})
},
});
}
erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
},
invoice_type: function(frm) {
invoice_type: function (frm) {
$.each(frm.doc.invoices, (idx, row) => {
row.party_type = frm.doc.invoice_type == "Sales"? "Customer": "Supplier";
row.party_type = frm.doc.invoice_type == "Sales" ? "Customer" : "Supplier";
row.party = "";
});
frm.refresh_fields();
},
make_dashboard: function(frm) {
make_dashboard: function (frm) {
let max_count = frm.doc.__onload.max_count;
let opening_invoices_summary = frm.doc.__onload.opening_invoices_summary;
if(!$.isEmptyObject(opening_invoices_summary)) {
if (!$.isEmptyObject(opening_invoices_summary)) {
let section = frm.dashboard.add_section(
frappe.render_template('opening_invoice_creation_tool_dashboard', {
frappe.render_template("opening_invoice_creation_tool_dashboard", {
data: opening_invoices_summary,
max_count: max_count
max_count: max_count,
}),
__("Opening Invoices Summary")
);
section.on('click', '.invoice-link', function() {
let doctype = $(this).attr('data-type');
let company = $(this).attr('data-company');
frappe.set_route('List', doctype,
{'is_opening': 'Yes', 'company': company, 'docstatus': 1});
section.on("click", ".invoice-link", function () {
let doctype = $(this).attr("data-type");
let company = $(this).attr("data-company");
frappe.set_route("List", doctype, { is_opening: "Yes", company: company, docstatus: 1 });
});
frm.dashboard.show();
}
},
update_invoice_table: function(frm) {
update_invoice_table: function (frm) {
$.each(frm.doc.invoices, (idx, row) => {
if (!row.temporary_opening_account) {
row.temporary_opening_account = frm.doc.__onload.temporary_opening_account;
}
if(!row.cost_center) {
if (!row.cost_center) {
row.cost_center = frm.doc.cost_center;
}
row.party_type = frm.doc.invoice_type == "Sales"? "Customer": "Supplier";
row.party_type = frm.doc.invoice_type == "Sales" ? "Customer" : "Supplier";
});
}
},
});
frappe.ui.form.on('Opening Invoice Creation Tool Item', {
frappe.ui.form.on("Opening Invoice Creation Tool Item", {
invoices_add: (frm) => {
frm.trigger('update_invoice_table');
}
frm.trigger("update_invoice_table");
},
});

View File

@@ -1,33 +1,34 @@
// Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Party Link', {
refresh: function(frm) {
frm.set_query('primary_role', () => {
frappe.ui.form.on("Party Link", {
refresh: function (frm) {
frm.set_query("primary_role", () => {
return {
filters: {
name: ['in', ['Customer', 'Supplier']]
}
name: ["in", ["Customer", "Supplier"]],
},
};
});
frm.set_query('secondary_role', () => {
let party_types = Object.keys(frappe.boot.party_account_types)
.filter(p => p != frm.doc.primary_role);
frm.set_query("secondary_role", () => {
let party_types = Object.keys(frappe.boot.party_account_types).filter(
(p) => p != frm.doc.primary_role
);
return {
filters: {
name: ['in', party_types]
}
name: ["in", party_types],
},
};
});
},
primary_role(frm) {
frm.set_value('primary_party', '');
frm.set_value('secondary_role', '');
frm.set_value("primary_party", "");
frm.set_value("secondary_role", "");
},
secondary_role(frm) {
frm.set_value('secondary_party', '');
}
frm.set_value("secondary_party", "");
},
});

File diff suppressed because it is too large Load Diff

View File

@@ -87,12 +87,14 @@
"status",
"custom_remarks",
"remarks",
"base_in_words",
"column_break_16",
"letter_head",
"print_heading",
"bank",
"bank_account_no",
"payment_order",
"in_words",
"subscription_section",
"auto_repeat",
"amended_from",
@@ -746,6 +748,20 @@
"hidden": 1,
"label": "Book Advance Payments in Separate Party Account",
"read_only": 1
},
{
"fieldname": "base_in_words",
"fieldtype": "Small Text",
"label": "In Words (Company Currency)",
"print_hide": 1,
"read_only": 1
},
{
"fieldname": "in_words",
"fieldtype": "Small Text",
"label": "In Words",
"print_hide": 1,
"read_only": 1
}
],
"index_web_pages_for_search": 1,
@@ -759,7 +775,7 @@
"table_fieldname": "payment_entries"
}
],
"modified": "2023-11-23 12:07:20.887885",
"modified": "2024-01-03 12:46:41.759121",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry",

View File

@@ -13,6 +13,7 @@ from pypika import Case
from pypika.functions import Coalesce, Sum
import erpnext
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_dimensions
from erpnext.accounts.doctype.bank_account.bank_account import (
get_bank_account_details,
get_party_bank_account,
@@ -95,6 +96,7 @@ class PaymentEntry(AccountsController):
self.validate_paid_invoices()
self.ensure_supplier_is_not_blocked()
self.set_status()
self.set_total_in_words()
def on_submit(self):
if self.difference_amount:
@@ -107,7 +109,7 @@ class PaymentEntry(AccountsController):
def set_liability_account(self):
# Auto setting liability account should only be done during 'draft' status
if self.docstatus > 0:
if self.docstatus > 0 or self.payment_type == "Internal Transfer":
return
if not frappe.db.get_value(
@@ -256,6 +258,7 @@ class PaymentEntry(AccountsController):
"get_outstanding_invoices": True,
"get_orders_to_be_billed": True,
"vouchers": vouchers,
"book_advance_payments_in_separate_party_account": self.book_advance_payments_in_separate_party_account,
},
validate=True,
)
@@ -386,7 +389,10 @@ class PaymentEntry(AccountsController):
)
def set_missing_ref_details(
self, force: bool = False, update_ref_details_only_for: list | None = None
self,
force: bool = False,
update_ref_details_only_for: list | None = None,
ref_exchange_rate: float | None = None,
) -> None:
for d in self.get("references"):
if d.allocated_amount:
@@ -398,6 +404,8 @@ class PaymentEntry(AccountsController):
ref_details = get_reference_details(
d.reference_doctype, d.reference_name, self.party_account_currency
)
if ref_exchange_rate:
ref_details.update({"exchange_rate": ref_exchange_rate})
for field, value in ref_details.items():
if d.exchange_gain_loss:
@@ -701,6 +709,21 @@ class PaymentEntry(AccountsController):
self.db_set("status", self.status, update_modified=True)
def set_total_in_words(self):
from frappe.utils import money_in_words
if self.payment_type in ("Pay", "Internal Transfer"):
base_amount = abs(self.base_paid_amount)
amount = abs(self.paid_amount)
currency = self.paid_from_account_currency
elif self.payment_type == "Receive":
base_amount = abs(self.base_received_amount)
amount = abs(self.received_amount)
currency = self.paid_to_account_currency
self.base_in_words = money_in_words(base_amount, self.company_currency)
self.in_words = money_in_words(amount, currency)
def set_tax_withholding(self):
if not self.party_type == "Supplier":
return
@@ -928,19 +951,19 @@ class PaymentEntry(AccountsController):
)
base_party_amount = flt(self.base_total_allocated_amount) + flt(base_unallocated_amount)
if self.payment_type == "Receive":
self.difference_amount = base_party_amount - self.base_received_amount
elif self.payment_type == "Pay":
self.difference_amount = self.base_paid_amount - base_party_amount
else:
self.difference_amount = self.base_paid_amount - flt(self.base_received_amount)
total_deductions = sum(flt(d.amount) for d in self.get("deductions"))
included_taxes = self.get_included_taxes()
if self.payment_type == "Receive":
self.difference_amount = base_party_amount - self.base_received_amount + included_taxes
elif self.payment_type == "Pay":
self.difference_amount = self.base_paid_amount - base_party_amount - included_taxes
else:
self.difference_amount = self.base_paid_amount - flt(self.base_received_amount) - included_taxes
total_deductions = sum(flt(d.amount) for d in self.get("deductions"))
self.difference_amount = flt(
self.difference_amount - total_deductions - included_taxes, self.precision("difference_amount")
self.difference_amount - total_deductions, self.precision("difference_amount")
)
def get_included_taxes(self):
@@ -1162,7 +1185,13 @@ class PaymentEntry(AccountsController):
references = [x for x in self.get("references") if x.name == entry.name]
for ref in references:
if ref.reference_doctype in ("Sales Invoice", "Purchase Invoice", "Journal Entry"):
if ref.reference_doctype in (
"Sales Invoice",
"Purchase Invoice",
"Journal Entry",
"Sales Order",
"Purchase Order",
):
self.add_advance_gl_for_reference(gl_entries, ref)
def add_advance_gl_for_reference(self, gl_entries, invoice):
@@ -1176,14 +1205,15 @@ class PaymentEntry(AccountsController):
"voucher_detail_no": invoice.name,
}
posting_date = frappe.db.get_value(
invoice.reference_doctype, invoice.reference_name, "posting_date"
)
date_field = "posting_date"
if invoice.reference_doctype in ["Sales Order", "Purchase Order"]:
date_field = "transaction_date"
posting_date = frappe.db.get_value(invoice.reference_doctype, invoice.reference_name, date_field)
if getdate(posting_date) < getdate(self.posting_date):
posting_date = self.posting_date
dr_or_cr = "credit" if invoice.reference_doctype == "Sales Invoice" else "debit"
dr_or_cr = "credit" if invoice.reference_doctype in ["Sales Invoice", "Sales Order"] else "debit"
args_dict["account"] = invoice.account
args_dict[dr_or_cr] = invoice.allocated_amount
args_dict[dr_or_cr + "_in_account_currency"] = invoice.allocated_amount
@@ -1587,6 +1617,13 @@ def get_outstanding_reference_documents(args, validate=False):
condition += " and cost_center='%s'" % args.get("cost_center")
accounting_dimensions_filter.append(ple.cost_center == args.get("cost_center"))
# dynamic dimension filters
active_dimensions = get_dimensions()[0]
for dim in active_dimensions:
if args.get(dim.fieldname):
condition += " and {0}='{1}'".format(dim.fieldname, args.get(dim.fieldname))
accounting_dimensions_filter.append(ple[dim.fieldname] == args.get(dim.fieldname))
date_fields_dict = {
"posting_date": ["from_posting_date", "to_posting_date"],
"due_date": ["from_due_date", "to_due_date"],
@@ -1614,11 +1651,16 @@ def get_outstanding_reference_documents(args, validate=False):
outstanding_invoices = []
negative_outstanding_invoices = []
if args.get("book_advance_payments_in_separate_party_account"):
party_account = get_party_account(args.get("party_type"), args.get("party"), args.get("company"))
else:
party_account = args.get("party_account")
if args.get("get_outstanding_invoices"):
outstanding_invoices = get_outstanding_invoices(
args.get("party_type"),
args.get("party"),
get_party_account(args.get("party_type"), args.get("party"), args.get("company")),
party_account,
common_filter=common_filter,
posting_date=posting_and_due_date,
min_outstanding=args.get("outstanding_amt_greater_than"),
@@ -1703,12 +1745,13 @@ def split_invoices_based_on_payment_terms(outstanding_invoices, company) -> list
if not split_rows:
continue
frappe.msgprint(
_("Splitting {0} {1} into {2} rows as per Payment Terms").format(
_(entry.voucher_type), frappe.bold(entry.voucher_no), len(split_rows)
),
alert=True,
)
if len(split_rows) > 1:
frappe.msgprint(
_("Splitting {0} {1} into {2} rows as per Payment Terms").format(
_(entry.voucher_type), frappe.bold(entry.voucher_no), len(split_rows)
),
alert=True,
)
outstanding_invoices_after_split += split_rows
continue
@@ -1814,6 +1857,12 @@ def get_orders_to_be_billed(
if doc and hasattr(doc, "cost_center") and doc.cost_center:
condition = " and cost_center='%s'" % cost_center
# dynamic dimension filters
active_dimensions = get_dimensions()[0]
for dim in active_dimensions:
if filters.get(dim.fieldname):
condition += " and {0}='{1}'".format(dim.fieldname, filters.get(dim.fieldname))
if party_account_currency == company_currency:
grand_total_field = "base_grand_total"
rounded_total_field = "base_rounded_total"
@@ -2066,6 +2115,11 @@ def get_reference_details(reference_doctype, reference_name, party_account_curre
else:
outstanding_amount = flt(total_amount) - flt(ref_doc.get("advance_paid"))
if reference_doctype in ["Sales Order", "Purchase Order"]:
party_type = "Customer" if reference_doctype == "Sales Order" else "Supplier"
party_field = "customer" if reference_doctype == "Sales Order" else "supplier"
party = ref_doc.get(party_field)
account = get_party_account(party_type, party, ref_doc.company)
else:
# Get the exchange rate based on the posting date of the ref doc.
exchange_rate = get_exchange_rate(party_account_currency, company_currency, ref_doc.posting_date)

View File

@@ -1,14 +1,13 @@
frappe.listview_settings['Payment Entry'] = {
onload: function(listview) {
frappe.listview_settings["Payment Entry"] = {
onload: function (listview) {
if (listview.page.fields_dict.party_type) {
listview.page.fields_dict.party_type.get_query = function() {
listview.page.fields_dict.party_type.get_query = function () {
return {
"filters": {
"name": ["in", Object.keys(frappe.boot.party_account_types)],
}
filters: {
name: ["in", Object.keys(frappe.boot.party_account_types)],
},
};
};
}
}
},
};

View File

@@ -1070,6 +1070,8 @@ class TestPaymentEntry(FrappeTestCase):
self.assertRaises(frappe.ValidationError, pe_draft.submit)
def test_details_update_on_reference_table(self):
from erpnext.accounts.party import get_party_account
so = make_sales_order(
customer="_Test Customer USD", currency="USD", qty=1, rate=100, do_not_submit=True
)
@@ -1084,6 +1086,7 @@ class TestPaymentEntry(FrappeTestCase):
ref_details = get_reference_details(so.doctype, so.name, pe.paid_from_account_currency)
expected_response = {
"account": get_party_account("Customer", so.customer, so.company),
"total_amount": 5000.0,
"outstanding_amount": 5000.0,
"exchange_rate": 1.0,

View File

@@ -1,11 +1,11 @@
// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.ui.form.on('Payment Gateway Account', {
frappe.ui.form.on("Payment Gateway Account", {
refresh(frm) {
erpnext.utils.check_payments_app();
if(!frm.doc.__islocal) {
frm.set_df_property('payment_gateway', 'read_only', 1);
if (!frm.doc.__islocal) {
frm.set_df_property("payment_gateway", "read_only", 1);
}
}
},
});

View File

@@ -1,8 +1,7 @@
// Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Payment Ledger Entry', {
frappe.ui.form.on("Payment Ledger Entry", {
// refresh: function(frm) {
// }
});

View File

@@ -1,61 +1,69 @@
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Payment Order', {
setup: function(frm) {
frm.set_query("company_bank_account", function() {
frappe.ui.form.on("Payment Order", {
setup: function (frm) {
frm.set_query("company_bank_account", function () {
return {
filters: {
"is_company_account":1
}
}
is_company_account: 1,
},
};
});
frm.set_df_property('references', 'cannot_add_rows', true);
frm.set_df_property("references", "cannot_add_rows", true);
},
refresh: function(frm) {
refresh: function (frm) {
if (frm.doc.docstatus == 0) {
frm.add_custom_button(__('Payment Request'), function() {
frm.trigger("get_from_payment_request");
}, __("Get Payments from"));
frm.add_custom_button(
__("Payment Request"),
function () {
frm.trigger("get_from_payment_request");
},
__("Get Payments from")
);
frm.add_custom_button(__('Payment Entry'), function() {
frm.trigger("get_from_payment_entry");
}, __("Get Payments from"));
frm.add_custom_button(
__("Payment Entry"),
function () {
frm.trigger("get_from_payment_entry");
},
__("Get Payments from")
);
frm.trigger('remove_button');
frm.trigger("remove_button");
}
// payment Entry
if (frm.doc.docstatus===1 && frm.doc.payment_order_type==='Payment Request') {
frm.add_custom_button(__('Create Payment Entries'), function() {
if (frm.doc.docstatus === 1 && frm.doc.payment_order_type === "Payment Request") {
frm.add_custom_button(__("Create Payment Entries"), function () {
frm.trigger("make_payment_records");
});
}
},
remove_row_if_empty: function(frm) {
remove_row_if_empty: function (frm) {
// remove if first row is empty
if (frm.doc.references.length > 0 && !frm.doc.references[0].reference_name) {
frm.doc.references = [];
}
},
remove_button: function(frm) {
remove_button: function (frm) {
// remove custom button of order type that is not imported
let label = ["Payment Request", "Payment Entry"];
if (frm.doc.references.length > 0 && frm.doc.payment_order_type) {
label = label.reduce(x => {
x!= frm.doc.payment_order_type;
label = label.reduce((x) => {
x != frm.doc.payment_order_type;
return x;
});
frm.remove_custom_button(label, "Get from");
}
},
get_from_payment_entry: function(frm) {
get_from_payment_entry: function (frm) {
frm.trigger("remove_row_if_empty");
erpnext.utils.map_current_doc({
method: "erpnext.accounts.doctype.payment_entry.payment_entry.make_payment_order",
@@ -63,7 +71,7 @@ frappe.ui.form.on('Payment Order', {
target: frm,
date_field: "posting_date",
setters: {
party: frm.doc.supplier || ""
party: frm.doc.supplier || "",
},
get_query_filters: {
bank: frm.doc.bank,
@@ -71,70 +79,79 @@ frappe.ui.form.on('Payment Order', {
payment_type: ["!=", "Receive"],
bank_account: frm.doc.company_bank_account,
paid_from: frm.doc.account,
payment_order_status: ["=", "Initiated"]
}
payment_order_status: ["=", "Initiated"],
},
});
},
get_from_payment_request: function(frm) {
get_from_payment_request: function (frm) {
frm.trigger("remove_row_if_empty");
erpnext.utils.map_current_doc({
method: "erpnext.accounts.doctype.payment_request.payment_request.make_payment_order",
source_doctype: "Payment Request",
target: frm,
setters: {
party: frm.doc.supplier || ""
party: frm.doc.supplier || "",
},
get_query_filters: {
bank: frm.doc.bank,
docstatus: 1,
status: ["=", "Initiated"],
}
},
});
},
make_payment_records: function(frm){
make_payment_records: function (frm) {
var dialog = new frappe.ui.Dialog({
title: __("For Supplier"),
fields: [
{"fieldtype": "Link", "label": __("Supplier"), "fieldname": "supplier", "options":"Supplier",
"get_query": function () {
{
fieldtype: "Link",
label: __("Supplier"),
fieldname: "supplier",
options: "Supplier",
get_query: function () {
return {
query:"erpnext.accounts.doctype.payment_order.payment_order.get_supplier_query",
filters: {'parent': frm.doc.name}
}
}, "reqd": 1
query: "erpnext.accounts.doctype.payment_order.payment_order.get_supplier_query",
filters: { parent: frm.doc.name },
};
},
reqd: 1,
},
{"fieldtype": "Link", "label": __("Mode of Payment"), "fieldname": "mode_of_payment", "options":"Mode of Payment",
"get_query": function () {
{
fieldtype: "Link",
label: __("Mode of Payment"),
fieldname: "mode_of_payment",
options: "Mode of Payment",
get_query: function () {
return {
query:"erpnext.accounts.doctype.payment_order.payment_order.get_mop_query",
filters: {'parent': frm.doc.name}
}
}
}
]
query: "erpnext.accounts.doctype.payment_order.payment_order.get_mop_query",
filters: { parent: frm.doc.name },
};
},
},
],
});
dialog.set_primary_action(__("Submit"), function() {
dialog.set_primary_action(__("Submit"), function () {
var args = dialog.get_values();
if(!args) return;
if (!args) return;
return frappe.call({
method: "erpnext.accounts.doctype.payment_order.payment_order.make_payment_records",
args: {
"name": frm.doc.name,
"supplier": args.supplier,
"mode_of_payment": args.mode_of_payment
name: frm.doc.name,
supplier: args.supplier,
mode_of_payment: args.mode_of_payment,
},
freeze: true,
callback: function(r) {
callback: function (r) {
dialog.hide();
frm.refresh();
}
})
})
},
});
});
dialog.show();
},

View File

@@ -4,9 +4,13 @@
import unittest
import frappe
from frappe.tests.utils import FrappeTestCase
from frappe.utils import getdate
from erpnext.accounts.doctype.bank_transaction.test_bank_transaction import create_bank_account
from erpnext.accounts.doctype.bank_transaction.test_bank_transaction import (
create_bank_account,
create_gl_account,
)
from erpnext.accounts.doctype.payment_entry.payment_entry import (
get_payment_entry,
make_payment_order,
@@ -14,28 +18,32 @@ from erpnext.accounts.doctype.payment_entry.payment_entry import (
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice
class TestPaymentOrder(unittest.TestCase):
class TestPaymentOrder(FrappeTestCase):
def setUp(self):
create_bank_account()
# generate and use a uniq hash identifier for 'Bank Account' and it's linked GL 'Account' to avoid validation error
uniq_identifier = frappe.generate_hash(length=10)
self.gl_account = create_gl_account("_Test Bank " + uniq_identifier)
self.bank_account = create_bank_account(
gl_account=self.gl_account, bank_account_name="Checking Account " + uniq_identifier
)
def tearDown(self):
for bt in frappe.get_all("Payment Order"):
doc = frappe.get_doc("Payment Order", bt.name)
doc.cancel()
doc.delete()
frappe.db.rollback()
def test_payment_order_creation_against_payment_entry(self):
purchase_invoice = make_purchase_invoice()
payment_entry = get_payment_entry(
"Purchase Invoice", purchase_invoice.name, bank_account="_Test Bank - _TC"
"Purchase Invoice", purchase_invoice.name, bank_account=self.gl_account
)
payment_entry.reference_no = "_Test_Payment_Order"
payment_entry.reference_date = getdate()
payment_entry.party_bank_account = "Checking Account - Citi Bank"
payment_entry.party_bank_account = self.bank_account
payment_entry.insert()
payment_entry.submit()
doc = create_payment_order_against_payment_entry(payment_entry, "Payment Entry")
doc = create_payment_order_against_payment_entry(
payment_entry, "Payment Entry", self.bank_account
)
reference_doc = doc.get("references")[0]
self.assertEqual(reference_doc.reference_name, payment_entry.name)
self.assertEqual(reference_doc.reference_doctype, "Payment Entry")
@@ -43,13 +51,13 @@ class TestPaymentOrder(unittest.TestCase):
self.assertEqual(reference_doc.amount, 250)
def create_payment_order_against_payment_entry(ref_doc, order_type):
def create_payment_order_against_payment_entry(ref_doc, order_type, bank_account):
payment_order = frappe.get_doc(
dict(
doctype="Payment Order",
company="_Test Company",
payment_order_type=order_type,
company_bank_account="Checking Account - Citi Bank",
company_bank_account=bank_account,
)
)
doc = make_payment_order(ref_doc.name, payment_order)

View File

@@ -2,141 +2,167 @@
// For license information, please see license.txt
frappe.provide("erpnext.accounts");
erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationController extends frappe.ui.form.Controller {
erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationController extends (
frappe.ui.form.Controller
) {
onload() {
const default_company = frappe.defaults.get_default('company');
this.frm.set_value('company', default_company);
const default_company = frappe.defaults.get_default("company");
this.frm.set_value("company", default_company);
this.frm.set_value('party_type', '');
this.frm.set_value('party', '');
this.frm.set_value('receivable_payable_account', '');
this.frm.set_value("party_type", "");
this.frm.set_value("party", "");
this.frm.set_value("receivable_payable_account", "");
this.frm.set_query("party_type", () => {
return {
"filters": {
"name": ["in", Object.keys(frappe.boot.party_account_types)],
}
}
});
this.frm.set_query('receivable_payable_account', () => {
return {
filters: {
"company": this.frm.doc.company,
"is_group": 0,
"account_type": frappe.boot.party_account_types[this.frm.doc.party_type],
"root_type": this.frm.doc.party_type == 'Customer' ? "Asset" : "Liability"
}
name: ["in", Object.keys(frappe.boot.party_account_types)],
},
};
});
this.frm.set_query('default_advance_account', () => {
this.frm.set_query("receivable_payable_account", () => {
return {
filters: {
"company": this.frm.doc.company,
"is_group": 0,
"account_type": this.frm.doc.party_type == 'Customer' ? "Receivable": "Payable",
"root_type": this.frm.doc.party_type == 'Customer' ? "Liability": "Asset"
}
company: this.frm.doc.company,
is_group: 0,
account_type: frappe.boot.party_account_types[this.frm.doc.party_type],
root_type: this.frm.doc.party_type == "Customer" ? "Asset" : "Liability",
},
};
});
this.frm.set_query('bank_cash_account', () => {
this.frm.set_query("default_advance_account", () => {
return {
filters:[
['Account', 'company', '=', this.frm.doc.company],
['Account', 'is_group', '=', 0],
['Account', 'account_type', 'in', ['Bank', 'Cash']]
]
filters: {
company: this.frm.doc.company,
is_group: 0,
account_type: this.frm.doc.party_type == "Customer" ? "Receivable" : "Payable",
root_type: this.frm.doc.party_type == "Customer" ? "Liability" : "Asset",
},
};
});
this.frm.set_query("bank_cash_account", () => {
return {
filters: [
["Account", "company", "=", this.frm.doc.company],
["Account", "is_group", "=", 0],
["Account", "account_type", "in", ["Bank", "Cash"]],
],
};
});
this.frm.set_query("cost_center", () => {
return {
"filters": {
"company": this.frm.doc.company,
"is_group": 0
}
}
filters: {
company: this.frm.doc.company,
is_group: 0,
},
};
});
}
refresh() {
this.frm.disable_save();
this.frm.set_df_property('invoices', 'cannot_delete_rows', true);
this.frm.set_df_property('payments', 'cannot_delete_rows', true);
this.frm.set_df_property('allocation', 'cannot_delete_rows', true);
this.frm.set_df_property('invoices', 'cannot_add_rows', true);
this.frm.set_df_property('payments', 'cannot_add_rows', true);
this.frm.set_df_property('allocation', 'cannot_add_rows', true);
this.frm.set_df_property("invoices", "cannot_delete_rows", true);
this.frm.set_df_property("payments", "cannot_delete_rows", true);
this.frm.set_df_property("allocation", "cannot_delete_rows", true);
this.frm.set_df_property("invoices", "cannot_add_rows", true);
this.frm.set_df_property("payments", "cannot_add_rows", true);
this.frm.set_df_property("allocation", "cannot_add_rows", true);
if (this.frm.doc.receivable_payable_account) {
this.frm.add_custom_button(__('Get Unreconciled Entries'), () =>
this.frm.add_custom_button(__("Get Unreconciled Entries"), () =>
this.frm.trigger("get_unreconciled_entries")
);
this.frm.change_custom_button_type(__('Get Unreconciled Entries'), null, 'primary');
this.frm.change_custom_button_type(__("Get Unreconciled Entries"), null, "primary");
}
if (this.frm.doc.invoices.length && this.frm.doc.payments.length) {
this.frm.add_custom_button(__('Allocate'), () =>
this.frm.trigger("allocate")
);
this.frm.change_custom_button_type(__('Allocate'), null, 'primary');
this.frm.change_custom_button_type(__('Get Unreconciled Entries'), null, 'default');
this.frm.add_custom_button(__("Allocate"), () => this.frm.trigger("allocate"));
this.frm.change_custom_button_type(__("Allocate"), null, "primary");
this.frm.change_custom_button_type(__("Get Unreconciled Entries"), null, "default");
}
if (this.frm.doc.allocation.length) {
this.frm.add_custom_button(__('Reconcile'), () =>
this.frm.trigger("reconcile")
);
this.frm.change_custom_button_type(__('Reconcile'), null, 'primary');
this.frm.change_custom_button_type(__('Get Unreconciled Entries'), null, 'default');
this.frm.change_custom_button_type(__('Allocate'), null, 'default');
this.frm.add_custom_button(__("Reconcile"), () => this.frm.trigger("reconcile"));
this.frm.change_custom_button_type(__("Reconcile"), null, "primary");
this.frm.change_custom_button_type(__("Get Unreconciled Entries"), null, "default");
this.frm.change_custom_button_type(__("Allocate"), null, "default");
}
this.frm.trigger("set_query_for_dimension_filters");
// check for any running reconciliation jobs
if (this.frm.doc.receivable_payable_account) {
this.frm.call({
doc: this.frm.doc,
method: 'is_auto_process_enabled',
method: "is_auto_process_enabled",
callback: (r) => {
if (r.message) {
this.frm.call({
'method': "erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.is_any_doc_running",
"args": {
for_filter: {
company: this.frm.doc.company,
party_type: this.frm.doc.party_type,
party: this.frm.doc.party,
receivable_payable_account: this.frm.doc.receivable_payable_account
this.frm
.call({
method: "erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.is_any_doc_running",
args: {
for_filter: {
company: this.frm.doc.company,
party_type: this.frm.doc.party_type,
party: this.frm.doc.party,
receivable_payable_account: this.frm.doc.receivable_payable_account,
},
},
})
.then((r) => {
if (r.message) {
let doc_link = frappe.utils.get_form_link(
"Process Payment Reconciliation",
r.message,
true
);
let msg = __(
"Payment Reconciliation Job: {0} is running for this party. Can't reconcile now.",
[doc_link]
);
this.frm.dashboard.add_comment(msg, "yellow");
}
}
}).then(r => {
if (r.message) {
let doc_link = frappe.utils.get_form_link("Process Payment Reconciliation", r.message, true);
let msg = __("Payment Reconciliation Job: {0} is running for this party. Can't reconcile now.", [doc_link]);
this.frm.dashboard.add_comment(msg, "yellow");
}
});
});
}
}
},
});
}
}
set_query_for_dimension_filters() {
frappe.call({
method: "erpnext.accounts.doctype.payment_reconciliation.payment_reconciliation.get_queries_for_dimension_filters",
args: {
company: this.frm.doc.company,
},
callback: (r) => {
if (!r.exc && r.message) {
r.message.forEach((x) => {
this.frm.set_query(x.fieldname, () => {
return {
filters: x.filters,
};
});
});
}
},
});
}
company() {
this.frm.set_value('party', '');
this.frm.set_value('receivable_payable_account', '');
this.frm.set_value("party", "");
this.frm.set_value("receivable_payable_account", "");
}
party_type() {
this.frm.set_value('party', '');
this.frm.set_value("party", "");
}
party() {
this.frm.set_value('receivable_payable_account', '');
this.frm.set_value("receivable_payable_account", "");
this.frm.trigger("clear_child_tables");
if (!this.frm.doc.receivable_payable_account && this.frm.doc.party_type && this.frm.doc.party) {
@@ -146,7 +172,7 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
company: this.frm.doc.company,
party_type: this.frm.doc.party_type,
party: this.frm.doc.party,
include_advance: 1
include_advance: 1,
},
callback: (r) => {
if (!r.exc && r.message) {
@@ -154,7 +180,7 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
this.frm.set_value("default_advance_account", r.message[1]);
}
this.frm.refresh();
}
},
});
}
}
@@ -172,7 +198,6 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
this.frm.trigger("get_unreconciled_entries");
}
clear_child_tables() {
this.frm.clear_table("invoices");
this.frm.clear_table("payments");
@@ -184,48 +209,48 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
this.frm.clear_table("allocation");
return this.frm.call({
doc: this.frm.doc,
method: 'get_unreconciled_entries',
method: "get_unreconciled_entries",
callback: () => {
if (!(this.frm.doc.payments.length || this.frm.doc.invoices.length)) {
frappe.throw({message: __("No Unreconciled Invoices and Payments found for this party and account")});
} else if (!(this.frm.doc.invoices.length)) {
frappe.throw({message: __("No Outstanding Invoices found for this party")});
} else if (!(this.frm.doc.payments.length)) {
frappe.throw({message: __("No Unreconciled Payments found for this party")});
frappe.throw({
message: __("No Unreconciled Invoices and Payments found for this party and account"),
});
} else if (!this.frm.doc.invoices.length) {
frappe.throw({ message: __("No Outstanding Invoices found for this party") });
} else if (!this.frm.doc.payments.length) {
frappe.throw({ message: __("No Unreconciled Payments found for this party") });
}
this.frm.refresh();
}
},
});
}
allocate() {
let payments = this.frm.fields_dict.payments.grid.get_selected_children();
if (!(payments.length)) {
if (!payments.length) {
payments = this.frm.doc.payments;
}
let invoices = this.frm.fields_dict.invoices.grid.get_selected_children();
if (!(invoices.length)) {
if (!invoices.length) {
invoices = this.frm.doc.invoices;
}
return this.frm.call({
doc: this.frm.doc,
method: 'allocate_entries',
method: "allocate_entries",
args: {
payments: payments,
invoices: invoices
invoices: invoices,
},
callback: () => {
this.frm.refresh();
}
},
});
}
reconcile() {
var show_dialog = this.frm.doc.allocation.filter(d => d.difference_amount);
var show_dialog = this.frm.doc.allocation.filter((d) => d.difference_amount);
if (show_dialog && show_dialog.length) {
this.data = [];
const dialog = new frappe.ui.Dialog({
title: __("Select Difference Account"),
@@ -240,66 +265,75 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
get_data: () => {
return this.data;
},
fields: [{
fieldtype:'Data',
fieldname:"docname",
in_list_view: 1,
hidden: 1
}, {
fieldtype:'Data',
fieldname:"reference_name",
label: __("Voucher No"),
in_list_view: 1,
read_only: 1
}, {
fieldtype:'Link',
options: 'Account',
in_list_view: 1,
label: __("Difference Account"),
fieldname: 'difference_account',
reqd: 1,
get_query: () => {
return {
filters: {
company: this.frm.doc.company,
is_group: 0
}
}
}
}, {
fieldtype:'Currency',
in_list_view: 1,
label: __("Difference Amount"),
fieldname: 'difference_amount',
read_only: 1
}]
fields: [
{
fieldtype: "Data",
fieldname: "docname",
in_list_view: 1,
hidden: 1,
},
{
fieldtype: "Data",
fieldname: "reference_name",
label: __("Voucher No"),
in_list_view: 1,
read_only: 1,
},
{
fieldtype: "Link",
options: "Account",
in_list_view: 1,
label: __("Difference Account"),
fieldname: "difference_account",
reqd: 1,
get_query: () => {
return {
filters: {
company: this.frm.doc.company,
is_group: 0,
},
};
},
},
{
fieldtype: "Currency",
in_list_view: 1,
label: __("Difference Amount"),
fieldname: "difference_amount",
read_only: 1,
},
],
},
{
fieldtype: 'HTML',
options: "<b> New Journal Entry will be posted for the difference amount </b>"
}
fieldtype: "HTML",
options: "<b> New Journal Entry will be posted for the difference amount </b>",
},
],
primary_action: () => {
const args = dialog.get_values()["allocation"];
args.forEach(d => {
frappe.model.set_value("Payment Reconciliation Allocation", d.docname,
"difference_account", d.difference_account);
args.forEach((d) => {
frappe.model.set_value(
"Payment Reconciliation Allocation",
d.docname,
"difference_account",
d.difference_account
);
});
this.reconcile_payment_entries();
dialog.hide();
},
primary_action_label: __('Reconcile Entries')
primary_action_label: __("Reconcile Entries"),
});
this.frm.doc.allocation.forEach(d => {
this.frm.doc.allocation.forEach((d) => {
if (d.difference_amount) {
dialog.fields_dict.allocation.df.data.push({
'docname': d.name,
'reference_name': d.reference_name,
'difference_amount': d.difference_amount,
'difference_account': d.difference_account,
docname: d.name,
reference_name: d.reference_name,
difference_amount: d.difference_amount,
difference_account: d.difference_account,
});
}
});
@@ -315,41 +349,39 @@ erpnext.accounts.PaymentReconciliationController = class PaymentReconciliationCo
reconcile_payment_entries() {
return this.frm.call({
doc: this.frm.doc,
method: 'reconcile',
method: "reconcile",
callback: () => {
this.frm.clear_table("allocation");
this.frm.refresh();
}
},
});
}
};
frappe.ui.form.on('Payment Reconciliation Allocation', {
allocated_amount: function(frm, cdt, cdn) {
frappe.ui.form.on("Payment Reconciliation Allocation", {
allocated_amount: function (frm, cdt, cdn) {
let row = locals[cdt][cdn];
// filter invoice
let invoice = frm.doc.invoices.filter((x) => (x.invoice_number == row.invoice_number));
let invoice = frm.doc.invoices.filter((x) => x.invoice_number == row.invoice_number);
// filter payment
let payment = frm.doc.payments.filter((x) => (x.reference_name == row.reference_name));
let payment = frm.doc.payments.filter((x) => x.reference_name == row.reference_name);
frm.call({
doc: frm.doc,
method: 'calculate_difference_on_allocation_change',
method: "calculate_difference_on_allocation_change",
args: {
payment_entry: payment,
invoice: invoice,
allocated_amount: row.allocated_amount
allocated_amount: row.allocated_amount,
},
callback: (r) => {
if (r.message) {
row.difference_amount = r.message;
frm.refresh();
}
}
},
});
}
},
});
extend_cscript(cur_frm.cscript, new erpnext.accounts.PaymentReconciliationController({frm: cur_frm}));
extend_cscript(cur_frm.cscript, new erpnext.accounts.PaymentReconciliationController({ frm: cur_frm }));

View File

@@ -25,7 +25,9 @@
"invoice_limit",
"payment_limit",
"bank_cash_account",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"sec_break1",
"invoice_name",
"invoices",
@@ -208,6 +210,18 @@
"fieldname": "payment_name",
"fieldtype": "Data",
"label": "Filter on Payment"
},
{
"collapsible": 1,
"collapsible_depends_on": "eval: doc.invoices.length == 0",
"depends_on": "eval:doc.receivable_payable_account",
"fieldname": "accounting_dimensions_section",
"fieldtype": "Section Break",
"label": "Accounting Dimensions Filter"
},
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
}
],
"hide_toolbar": 1,
@@ -215,7 +229,7 @@
"is_virtual": 1,
"issingle": 1,
"links": [],
"modified": "2023-11-17 17:33:55.701726",
"modified": "2023-12-14 13:38:16.264013",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation",

View File

@@ -10,6 +10,7 @@ from frappe.query_builder.custom import ConstantColumn
from frappe.utils import flt, fmt_money, get_link_to_form, getdate, nowdate, today
import erpnext
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_dimensions
from erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation import (
is_any_doc_running,
)
@@ -70,6 +71,7 @@ class PaymentReconciliation(Document):
self.common_filter_conditions = []
self.accounting_dimension_filter_conditions = []
self.ple_posting_date_filter = []
self.dimensions = get_dimensions()[0]
def load_from_db(self):
# 'modified' attribute is required for `run_doc_method` to work properly.
@@ -172,6 +174,14 @@ class PaymentReconciliation(Document):
if self.payment_name:
condition.update({"name": self.payment_name})
# pass dynamic dimension filter values to query builder
dimensions = {}
for x in self.dimensions:
dimension = x.fieldname
if self.get(dimension):
dimensions.update({dimension: self.get(dimension)})
condition.update({"accounting_dimensions": dimensions})
payment_entries = get_advance_payment_entries_for_regional(
self.party_type,
self.party,
@@ -185,66 +195,67 @@ class PaymentReconciliation(Document):
return payment_entries
def get_jv_entries(self):
condition = self.get_conditions()
je = qb.DocType("Journal Entry")
jea = qb.DocType("Journal Entry Account")
conditions = self.get_journal_filter_conditions()
# Dimension filters
for x in self.dimensions:
dimension = x.fieldname
if self.get(dimension):
conditions.append(jea[dimension] == self.get(dimension))
if self.payment_name:
condition += f" and t1.name like '%%{self.payment_name}%%'"
conditions.append(je.name.like(f"%%{self.payment_name}%%"))
if self.get("cost_center"):
condition += f" and t2.cost_center = '{self.cost_center}' "
conditions.append(jea.cost_center == self.cost_center)
dr_or_cr = (
"credit_in_account_currency"
if erpnext.get_party_account_type(self.party_type) == "Receivable"
else "debit_in_account_currency"
)
conditions.append(jea[dr_or_cr].gt(0))
bank_account_condition = (
"t2.against_account like %(bank_cash_account)s" if self.bank_cash_account else "1=1"
if self.bank_cash_account:
conditions.append(jea.against_account.like(f"%%{self.bank_cash_account}%%"))
journal_query = (
qb.from_(je)
.inner_join(jea)
.on(jea.parent == je.name)
.select(
ConstantColumn("Journal Entry").as_("reference_type"),
je.name.as_("reference_name"),
je.posting_date,
je.remark.as_("remarks"),
jea.name.as_("reference_row"),
jea[dr_or_cr].as_("amount"),
jea.is_advance,
jea.exchange_rate,
jea.account_currency.as_("currency"),
jea.cost_center.as_("cost_center"),
)
.where(
(je.docstatus == 1)
& (jea.party_type == self.party_type)
& (jea.party == self.party)
& (jea.account == self.receivable_payable_account)
& (
(jea.reference_type == "")
| (jea.reference_type.isnull())
| (jea.reference_type.isin(("Sales Order", "Purchase Order")))
)
)
.where(Criterion.all(conditions))
.orderby(je.posting_date)
)
limit = f"limit {self.payment_limit}" if self.payment_limit else " "
if self.payment_limit:
journal_query = journal_query.limit(self.payment_limit)
# nosemgrep
journal_entries = frappe.db.sql(
"""
select
"Journal Entry" as reference_type, t1.name as reference_name,
t1.posting_date, t1.remark as remarks, t2.name as reference_row,
{dr_or_cr} as amount, t2.is_advance, t2.exchange_rate,
t2.account_currency as currency, t2.cost_center as cost_center
from
`tabJournal Entry` t1, `tabJournal Entry Account` t2
where
t1.name = t2.parent and t1.docstatus = 1 and t2.docstatus = 1
and t2.party_type = %(party_type)s and t2.party = %(party)s
and t2.account = %(account)s and {dr_or_cr} > 0 {condition}
and (t2.reference_type is null or t2.reference_type = '' or
(t2.reference_type in ('Sales Order', 'Purchase Order')
and t2.reference_name is not null and t2.reference_name != ''))
and (CASE
WHEN t1.voucher_type in ('Debit Note', 'Credit Note')
THEN 1=1
ELSE {bank_account_condition}
END)
order by t1.posting_date
{limit}
""".format(
**{
"dr_or_cr": dr_or_cr,
"bank_account_condition": bank_account_condition,
"condition": condition,
"limit": limit,
}
),
{
"party_type": self.party_type,
"party": self.party,
"account": self.receivable_payable_account,
"bank_cash_account": "%%%s%%" % self.bank_cash_account,
},
as_dict=1,
)
journal_entries = journal_query.run(as_dict=True)
return list(journal_entries)
@@ -298,6 +309,7 @@ class PaymentReconciliation(Document):
min_outstanding=-(self.minimum_payment_amount) if self.minimum_payment_amount else None,
max_outstanding=-(self.maximum_payment_amount) if self.maximum_payment_amount else None,
get_payments=True,
accounting_dimensions=self.accounting_dimension_filter_conditions,
)
for inv in return_outstanding:
@@ -446,8 +458,15 @@ class PaymentReconciliation(Document):
row = self.append("allocation", {})
row.update(entry)
def update_dimension_values_in_allocated_entries(self, res):
for x in self.dimensions:
dimension = x.fieldname
if self.get(dimension):
res[dimension] = self.get(dimension)
return res
def get_allocated_entry(self, pay, inv, allocated_amount):
return frappe._dict(
res = frappe._dict(
{
"reference_type": pay.get("reference_type"),
"reference_name": pay.get("reference_name"),
@@ -463,6 +482,9 @@ class PaymentReconciliation(Document):
}
)
res = self.update_dimension_values_in_allocated_entries(res)
return res
def reconcile_allocations(self, skip_ref_details_update_for_pe=False):
adjust_allocations_for_taxes(self)
dr_or_cr = (
@@ -485,10 +507,10 @@ class PaymentReconciliation(Document):
reconciled_entry.append(payment_details)
if entry_list:
reconcile_against_document(entry_list, skip_ref_details_update_for_pe)
reconcile_against_document(entry_list, skip_ref_details_update_for_pe, self.dimensions)
if dr_or_cr_notes:
reconcile_dr_cr_note(dr_or_cr_notes, self.company)
reconcile_dr_cr_note(dr_or_cr_notes, self.company, self.dimensions)
@frappe.whitelist()
def reconcile(self):
@@ -517,7 +539,7 @@ class PaymentReconciliation(Document):
self.get_unreconciled_entries()
def get_payment_details(self, row, dr_or_cr):
return frappe._dict(
payment_details = frappe._dict(
{
"voucher_type": row.get("reference_type"),
"voucher_no": row.get("reference_name"),
@@ -539,6 +561,12 @@ class PaymentReconciliation(Document):
}
)
for x in self.dimensions:
if row.get(x.fieldname):
payment_details[x.fieldname] = row.get(x.fieldname)
return payment_details
def check_mandatory_to_fetch(self):
for fieldname in ["company", "party_type", "party", "receivable_payable_account"]:
if not self.get(fieldname):
@@ -592,6 +620,32 @@ class PaymentReconciliation(Document):
invoice_exchange_map.update(purchase_invoice_map)
journals = [
d.get("invoice_number") for d in invoices if d.get("invoice_type") == "Journal Entry"
]
journals.extend(
[d.get("reference_name") for d in payments if d.get("reference_type") == "Journal Entry"]
)
if journals:
journals = list(set(journals))
journals_map = frappe._dict(
frappe.db.get_all(
"Journal Entry Account",
filters={
"parent": ("in", journals),
"account": ("in", [self.receivable_payable_account]),
"party_type": self.party_type,
"party": self.party,
},
fields=[
"parent as `name`",
"exchange_rate",
],
as_list=1,
)
)
invoice_exchange_map.update(journals_map)
return invoice_exchange_map
def validate_allocation(self):
@@ -625,6 +679,13 @@ class PaymentReconciliation(Document):
if not invoices_to_reconcile:
frappe.throw(_("No records found in Allocation table"))
def build_dimensions_filter_conditions(self):
ple = qb.DocType("Payment Ledger Entry")
for x in self.dimensions:
dimension = x.fieldname
if self.get(dimension):
self.accounting_dimension_filter_conditions.append(ple[dimension] == self.get(dimension))
def build_qb_filter_conditions(self, get_invoices=False, get_return_invoices=False):
self.common_filter_conditions.clear()
self.accounting_dimension_filter_conditions.clear()
@@ -648,40 +709,30 @@ class PaymentReconciliation(Document):
if self.to_payment_date:
self.ple_posting_date_filter.append(ple.posting_date.lte(self.to_payment_date))
def get_conditions(self, get_payments=False):
condition = " and company = '{0}' ".format(self.company)
self.build_dimensions_filter_conditions()
if self.get("cost_center") and get_payments:
condition = " and cost_center = '{0}' ".format(self.cost_center)
def get_journal_filter_conditions(self):
conditions = []
je = qb.DocType("Journal Entry")
jea = qb.DocType("Journal Entry Account")
conditions.append(je.company == self.company)
condition += (
" and posting_date >= {0}".format(frappe.db.escape(self.from_payment_date))
if self.from_payment_date
else ""
)
condition += (
" and posting_date <= {0}".format(frappe.db.escape(self.to_payment_date))
if self.to_payment_date
else ""
)
if self.from_payment_date:
conditions.append(je.posting_date.gte(self.from_payment_date))
if self.to_payment_date:
conditions.append(je.posting_date.lte(self.to_payment_date))
if self.minimum_payment_amount:
condition += (
" and unallocated_amount >= {0}".format(flt(self.minimum_payment_amount))
if get_payments
else " and total_debit >= {0}".format(flt(self.minimum_payment_amount))
)
conditions.append(je.total_debit.gte(self.minimum_payment_amount))
if self.maximum_payment_amount:
condition += (
" and unallocated_amount <= {0}".format(flt(self.maximum_payment_amount))
if get_payments
else " and total_debit <= {0}".format(flt(self.maximum_payment_amount))
)
conditions.append(je.total_debit.lte(self.maximum_payment_amount))
return condition
return conditions
def reconcile_dr_cr_note(dr_cr_notes, company):
def reconcile_dr_cr_note(dr_cr_notes, company, active_dimensions=None):
for inv in dr_cr_notes:
voucher_type = "Credit Note" if inv.voucher_type == "Sales Invoice" else "Debit Note"
@@ -731,6 +782,15 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
}
)
# Credit Note(JE) will inherit the same dimension values as payment
dimensions_dict = frappe._dict()
if active_dimensions:
for dim in active_dimensions:
dimensions_dict[dim.fieldname] = inv.get(dim.fieldname)
jv.accounts[0].update(dimensions_dict)
jv.accounts[1].update(dimensions_dict)
jv.flags.ignore_mandatory = True
jv.flags.ignore_exchange_rate = True
jv.remark = None
@@ -764,9 +824,27 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
inv.against_voucher,
None,
inv.cost_center,
dimensions_dict,
)
@erpnext.allow_regional
def adjust_allocations_for_taxes(doc):
pass
@frappe.whitelist()
def get_queries_for_dimension_filters(company: str = None):
dimensions_with_filters = []
for d in get_dimensions()[0]:
filters = {}
meta = frappe.get_meta(d.document_type)
if meta.has_field("company") and company:
filters.update({"company": company})
if meta.is_tree:
filters.update({"is_group": 0})
dimensions_with_filters.append({"fieldname": d.fieldname, "filters": filters})
return dimensions_with_filters

View File

@@ -56,6 +56,7 @@ class TestPaymentReconciliation(FrappeTestCase):
self.expense_account = "Cost of Goods Sold - _PR"
self.debit_to = "Debtors - _PR"
self.creditors = "Creditors - _PR"
self.cash = "Cash - _PR"
# create bank account
if frappe.db.exists("Account", "HDFC - _PR"):
@@ -486,6 +487,91 @@ class TestPaymentReconciliation(FrappeTestCase):
self.assertEqual(len(pr.get("invoices")), 0)
self.assertEqual(len(pr.get("payments")), 0)
def test_payment_against_foreign_currency_journal(self):
transaction_date = nowdate()
self.supplier = "_Test Supplier USD"
self.supplier2 = make_supplier("_Test Supplier2 USD", "USD")
amount = 100
exc_rate1 = 80
exc_rate2 = 83
je = frappe.new_doc("Journal Entry")
je.posting_date = transaction_date
je.company = self.company
je.user_remark = "test"
je.multi_currency = 1
je.set(
"accounts",
[
{
"account": self.creditors_usd,
"party_type": "Supplier",
"party": self.supplier,
"exchange_rate": exc_rate1,
"cost_center": self.cost_center,
"credit": amount * exc_rate1,
"credit_in_account_currency": amount,
},
{
"account": self.creditors_usd,
"party_type": "Supplier",
"party": self.supplier2,
"exchange_rate": exc_rate2,
"cost_center": self.cost_center,
"credit": amount * exc_rate2,
"credit_in_account_currency": amount,
},
{
"account": self.expense_account,
"cost_center": self.cost_center,
"debit": (amount * exc_rate1) + (amount * exc_rate2),
"debit_in_account_currency": (amount * exc_rate1) + (amount * exc_rate2),
},
],
)
je.save().submit()
pe = self.create_payment_entry(amount=amount, posting_date=transaction_date)
pe.payment_type = "Pay"
pe.party_type = "Supplier"
pe.party = self.supplier
pe.paid_to = self.creditors_usd
pe.paid_from = self.cash
pe.paid_amount = 8000
pe.received_amount = 100
pe.target_exchange_rate = exc_rate1
pe.paid_to_account_currency = "USD"
pe.save().submit()
pr = self.create_payment_reconciliation(party_is_customer=False)
pr.receivable_payable_account = self.creditors_usd
pr.minimum_invoice_amount = pr.maximum_invoice_amount = amount
pr.from_invoice_date = pr.to_invoice_date = transaction_date
pr.from_payment_date = pr.to_payment_date = transaction_date
pr.get_unreconciled_entries()
invoices = [x.as_dict() for x in pr.get("invoices")]
payments = [x.as_dict() for x in pr.get("payments")]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
# There should no difference_amount as the Journal and Payment have same exchange rate - 'exc_rate1'
for row in pr.allocation:
self.assertEqual(flt(row.get("difference_amount")), 0.0)
pr.reconcile()
# check PR tool output
self.assertEqual(len(pr.get("invoices")), 0)
self.assertEqual(len(pr.get("payments")), 0)
journals = frappe.db.get_all(
"Journal Entry Account",
filters={"reference_type": je.doctype, "reference_name": je.name, "docstatus": 1},
fields=["parent"],
)
self.assertEqual([], journals)
def test_journal_against_invoice(self):
transaction_date = nowdate()
amount = 100
@@ -591,6 +677,70 @@ class TestPaymentReconciliation(FrappeTestCase):
self.assertEqual(si.status, "Paid")
self.assertEqual(si.outstanding_amount, 0)
def test_invoice_status_after_cr_note_cancellation(self):
# This test case is made after the 'always standalone Credit/Debit notes' feature is introduced
transaction_date = nowdate()
amount = 100
si = self.create_sales_invoice(qty=1, rate=amount, posting_date=transaction_date)
cr_note = self.create_sales_invoice(
qty=-1, rate=amount, posting_date=transaction_date, do_not_save=True, do_not_submit=True
)
cr_note.is_return = 1
cr_note.return_against = si.name
cr_note = cr_note.save().submit()
pr = self.create_payment_reconciliation()
pr.get_unreconciled_entries()
invoices = [x.as_dict() for x in pr.get("invoices")]
payments = [x.as_dict() for x in pr.get("payments")]
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
pr.reconcile()
pr.get_unreconciled_entries()
self.assertEqual(pr.get("invoices"), [])
self.assertEqual(pr.get("payments"), [])
journals = frappe.db.get_all(
"Journal Entry",
filters={
"is_system_generated": 1,
"docstatus": 1,
"voucher_type": "Credit Note",
"reference_type": si.doctype,
"reference_name": si.name,
},
pluck="name",
)
self.assertEqual(len(journals), 1)
# assert status and outstanding
si.reload()
self.assertEqual(si.status, "Credit Note Issued")
self.assertEqual(si.outstanding_amount, 0)
cr_note.reload()
cr_note.cancel()
# 'Credit Note' Journal should be auto cancelled
journals = frappe.db.get_all(
"Journal Entry",
filters={
"is_system_generated": 1,
"docstatus": 1,
"voucher_type": "Credit Note",
"reference_type": si.doctype,
"reference_name": si.name,
},
pluck="name",
)
self.assertEqual(len(journals), 0)
# assert status and outstanding
si.reload()
self.assertEqual(si.status, "Unpaid")
self.assertEqual(si.outstanding_amount, 100)
def test_cr_note_partial_against_invoice(self):
transaction_date = nowdate()
amount = 100
@@ -1184,3 +1334,17 @@ def make_customer(customer_name, currency=None):
return customer.name
else:
return customer_name
def make_supplier(supplier_name, currency=None):
if not frappe.db.exists("Supplier", supplier_name):
supplier = frappe.new_doc("Supplier")
supplier.supplier_name = supplier_name
supplier.type = "Individual"
if currency:
supplier.default_currency = currency
supplier.save()
return supplier.name
else:
return supplier_name

View File

@@ -23,7 +23,9 @@
"difference_account",
"exchange_rate",
"currency",
"cost_center"
"accounting_dimensions_section",
"cost_center",
"dimension_col_break"
],
"fields": [
{
@@ -151,12 +153,26 @@
"fieldtype": "Link",
"label": "Cost Center",
"options": "Cost Center"
},
{
"fieldname": "gain_loss_posting_date",
"fieldtype": "Date",
"label": "Difference Posting Date"
},
{
"fieldname": "accounting_dimensions_section",
"fieldtype": "Section Break",
"label": "Accounting Dimensions"
},
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
}
],
"is_virtual": 1,
"istable": 1,
"links": [],
"modified": "2023-11-17 17:33:38.612615",
"modified": "2023-12-14 13:38:26.104150",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation Allocation",

View File

@@ -1,83 +1,95 @@
cur_frm.add_fetch("payment_gateway_account", "payment_account", "payment_account")
cur_frm.add_fetch("payment_gateway_account", "payment_gateway", "payment_gateway")
cur_frm.add_fetch("payment_gateway_account", "message", "message")
cur_frm.add_fetch("payment_gateway_account", "payment_account", "payment_account");
cur_frm.add_fetch("payment_gateway_account", "payment_gateway", "payment_gateway");
cur_frm.add_fetch("payment_gateway_account", "message", "message");
frappe.ui.form.on("Payment Request", {
setup: function(frm) {
frm.set_query("party_type", function() {
setup: function (frm) {
frm.set_query("party_type", function () {
return {
query: "erpnext.setup.doctype.party_type.party_type.get_party_type",
};
});
}
})
},
});
frappe.ui.form.on("Payment Request", "onload", function(frm, dt, dn){
frappe.ui.form.on("Payment Request", "onload", function (frm, dt, dn) {
if (frm.doc.reference_doctype) {
frappe.call({
method:"erpnext.accounts.doctype.payment_request.payment_request.get_print_format_list",
args: {"ref_doctype": frm.doc.reference_doctype},
callback:function(r){
set_field_options("print_format", r.message["print_format"])
}
})
method: "erpnext.accounts.doctype.payment_request.payment_request.get_print_format_list",
args: { ref_doctype: frm.doc.reference_doctype },
callback: function (r) {
set_field_options("print_format", r.message["print_format"]);
},
});
}
})
});
frappe.ui.form.on("Payment Request", "refresh", function(frm) {
if(frm.doc.payment_request_type == 'Inward' && frm.doc.payment_channel !== "Phone" &&
!in_list(["Initiated", "Paid"], frm.doc.status) && !frm.doc.__islocal && frm.doc.docstatus==1){
frm.add_custom_button(__('Resend Payment Email'), function(){
frappe.ui.form.on("Payment Request", "refresh", function (frm) {
if (
frm.doc.payment_request_type == "Inward" &&
frm.doc.payment_channel !== "Phone" &&
!in_list(["Initiated", "Paid"], frm.doc.status) &&
!frm.doc.__islocal &&
frm.doc.docstatus == 1
) {
frm.add_custom_button(__("Resend Payment Email"), function () {
frappe.call({
method: "erpnext.accounts.doctype.payment_request.payment_request.resend_payment_email",
args: {"docname": frm.doc.name},
args: { docname: frm.doc.name },
freeze: true,
freeze_message: __("Sending"),
callback: function(r){
if(!r.exc) {
callback: function (r) {
if (!r.exc) {
frappe.msgprint(__("Message Sent"));
}
}
},
});
});
}
if((!frm.doc.payment_gateway_account || frm.doc.payment_request_type == "Outward") && frm.doc.status == "Initiated") {
frm.add_custom_button(__('Create Payment Entry'), function(){
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",
args: {"docname": frm.doc.name},
args: { docname: frm.doc.name },
freeze: true,
callback: function(r){
if(!r.exc) {
callback: function (r) {
if (!r.exc) {
var doc = frappe.model.sync(r.message);
frappe.set_route("Form", r.message.doctype, r.message.name);
}
}
},
});
}).addClass("btn-primary");
}
});
frappe.ui.form.on("Payment Request", "is_a_subscription", function(frm) {
frappe.ui.form.on("Payment Request", "is_a_subscription", function (frm) {
frm.toggle_reqd("payment_gateway_account", frm.doc.is_a_subscription);
frm.toggle_reqd("subscription_plans", frm.doc.is_a_subscription);
if (frm.doc.is_a_subscription && frm.doc.reference_doctype && frm.doc.reference_name) {
frappe.call({
method: "erpnext.accounts.doctype.payment_request.payment_request.get_subscription_details",
args: {"reference_doctype": frm.doc.reference_doctype, "reference_name": frm.doc.reference_name},
args: { reference_doctype: frm.doc.reference_doctype, reference_name: frm.doc.reference_name },
freeze: true,
callback: function(data){
if(!data.exc) {
$.each(data.message || [], function(i, v){
var d = frappe.model.add_child(frm.doc, "Subscription Plan Detail", "subscription_plans");
callback: function (data) {
if (!data.exc) {
$.each(data.message || [], function (i, v) {
var d = frappe.model.add_child(
frm.doc,
"Subscription Plan Detail",
"subscription_plans"
);
d.qty = v.qty;
d.plan = v.plan;
});
frm.refresh_field("subscription_plans");
}
}
},
});
}
});

View File

@@ -1,23 +1,19 @@
frappe.listview_settings['Payment Request'] = {
frappe.listview_settings["Payment Request"] = {
add_fields: ["status"],
get_indicator: function(doc) {
if(doc.status == "Draft") {
get_indicator: function (doc) {
if (doc.status == "Draft") {
return [__("Draft"), "gray", "status,=,Draft"];
}
if(doc.status == "Requested") {
if (doc.status == "Requested") {
return [__("Requested"), "green", "status,=,Requested"];
}
else if(doc.status == "Initiated") {
} else if (doc.status == "Initiated") {
return [__("Initiated"), "green", "status,=,Initiated"];
}
else if(doc.status == "Partially Paid") {
} else if (doc.status == "Partially Paid") {
return [__("Partially Paid"), "orange", "status,=,Partially Paid"];
}
else if(doc.status == "Paid") {
} else if (doc.status == "Paid") {
return [__("Paid"), "blue", "status,=,Paid"];
}
else if(doc.status == "Cancelled") {
} else if (doc.status == "Cancelled") {
return [__("Cancelled"), "red", "status,=,Cancelled"];
}
}
}
},
};

View File

@@ -1,22 +1,24 @@
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Payment Term', {
frappe.ui.form.on("Payment Term", {
onload(frm) {
frm.trigger('set_dynamic_description');
frm.trigger("set_dynamic_description");
},
discount(frm) {
frm.trigger('set_dynamic_description');
frm.trigger("set_dynamic_description");
},
discount_type(frm) {
frm.trigger('set_dynamic_description');
frm.trigger("set_dynamic_description");
},
set_dynamic_description(frm) {
if (frm.doc.discount) {
let description = __("{0}% of total invoice value will be given as discount.", [frm.doc.discount]);
if (frm.doc.discount_type == 'Amount') {
let description = __("{0}% of total invoice value will be given as discount.", [
frm.doc.discount,
]);
if (frm.doc.discount_type == "Amount") {
description = __("{0} will be given as discount.", [frm.doc.discount]);
}
frm.set_df_property("discount", "description", description);
}
}
},
});

View File

@@ -1,12 +1,18 @@
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Payment Terms Template', {
refresh: function(frm) {
frm.fields_dict.terms.grid.toggle_reqd("payment_term", frm.doc.allocate_payment_based_on_payment_terms);
frappe.ui.form.on("Payment Terms Template", {
refresh: function (frm) {
frm.fields_dict.terms.grid.toggle_reqd(
"payment_term",
frm.doc.allocate_payment_based_on_payment_terms
);
},
allocate_payment_based_on_payment_terms: function(frm) {
frm.fields_dict.terms.grid.toggle_reqd("payment_term", frm.doc.allocate_payment_based_on_payment_terms);
}
allocate_payment_based_on_payment_terms: function (frm) {
frm.fields_dict.terms.grid.toggle_reqd(
"payment_term",
frm.doc.allocate_payment_based_on_payment_terms
);
},
});

View File

@@ -1,38 +1,41 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.ui.form.on('Period Closing Voucher', {
onload: function(frm) {
frappe.ui.form.on("Period Closing Voucher", {
onload: function (frm) {
if (!frm.doc.transaction_date) frm.doc.transaction_date = frappe.datetime.obj_to_str(new Date());
},
setup: function(frm) {
frm.set_query("closing_account_head", function() {
setup: function (frm) {
frm.set_query("closing_account_head", function () {
return {
filters: [
['Account', 'company', '=', frm.doc.company],
['Account', 'is_group', '=', '0'],
['Account', 'freeze_account', '=', 'No'],
['Account', 'root_type', 'in', 'Liability, Equity']
]
}
["Account", "company", "=", frm.doc.company],
["Account", "is_group", "=", "0"],
["Account", "freeze_account", "=", "No"],
["Account", "root_type", "in", "Liability, Equity"],
],
};
});
},
refresh: function(frm) {
if(frm.doc.docstatus > 0) {
frm.add_custom_button(__('Ledger'), function() {
frappe.route_options = {
"voucher_no": frm.doc.name,
"from_date": frm.doc.posting_date,
"to_date": moment(frm.doc.modified).format('YYYY-MM-DD'),
"company": frm.doc.company,
"group_by": "",
"show_cancelled_entries": frm.doc.docstatus === 2
};
frappe.set_route("query-report", "General Ledger");
}, "fa fa-table");
refresh: function (frm) {
if (frm.doc.docstatus > 0) {
frm.add_custom_button(
__("Ledger"),
function () {
frappe.route_options = {
voucher_no: frm.doc.name,
from_date: frm.doc.posting_date,
to_date: moment(frm.doc.modified).format("YYYY-MM-DD"),
company: frm.doc.company,
group_by: "",
show_cancelled_entries: frm.doc.docstatus === 2,
};
frappe.set_route("query-report", "General Ledger");
},
"fa fa-table"
);
}
}
})
},
});

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