From 0dd16fc97d43d85d04be58a0e5451bdf9ac15264 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Wed, 7 Jun 2023 06:18:29 +0000 Subject: [PATCH 01/16] chore(release): Bumped to Version 14.27.0 # [14.27.0](https://github.com/frappe/erpnext/compare/v14.26.0...v14.27.0) (2023-06-07) ### Bug Fixes * add validation for existing Serial No Manufactured/Received again ([#35534](https://github.com/frappe/erpnext/issues/35534)) ([4ed701b](https://github.com/frappe/erpnext/commit/4ed701b477ed79113899c5f96af4ad640f7943b6)) * get party details ([c7391c8](https://github.com/frappe/erpnext/commit/c7391c8a0fd6f2dfd39f832e2497cc5cbee0351d)) * higher precision makes ERR to misjudge zero bal acc as non-zero ([456c336](https://github.com/frappe/erpnext/commit/456c33689938609479d121ae6fe85417a5762369)) * ignore `Non-Stock Item` mapping in Pick List ([200166b](https://github.com/frappe/erpnext/commit/200166bc24fb14ab9fa62f16f07eb7bf744ab764)) * ignore `Non-Stock Item` while calculating `% Picked` in Sales Order ([c0d8271](https://github.com/frappe/erpnext/commit/c0d82710b72fc039ef0d367ff1c656513b2e3ac6)) * Interest Accrual on Loan Topup ([#35555](https://github.com/frappe/erpnext/issues/35555)) ([6140f13](https://github.com/frappe/erpnext/commit/6140f13f3ab885549b73d6d8d620eceb6158a4f0)) * missing bom details in the stock entry ([2ee0229](https://github.com/frappe/erpnext/commit/2ee0229751771f6ba5eaf5ccf41f0a70c2d6807c)) * **regional:** allow regional override for updating gl_dict ([#35550](https://github.com/frappe/erpnext/issues/35550)) ([57b502b](https://github.com/frappe/erpnext/commit/57b502b9de2e087beecb896bdfa0fddfab4c305f)) * Task gantt popup style ([20e2242](https://github.com/frappe/erpnext/commit/20e224224b0d988979e2689784fc25ec4ee4b1b6)) * update `Stock Reconciliation` document while reposting ([cc95ced](https://github.com/frappe/erpnext/commit/cc95cedfee3c09037a97574ca1a04b2d98c72965)) * **ux:** throw if no row selected to create repost entries (backport [#35503](https://github.com/frappe/erpnext/issues/35503)) ([#35504](https://github.com/frappe/erpnext/issues/35504)) ([5ba5fb1](https://github.com/frappe/erpnext/commit/5ba5fb1b1c7efc04a85296d0b6e9f0062b535076)) ### Features * ability to create quotation against a prospect ([d82d159](https://github.com/frappe/erpnext/commit/d82d1597ac4ea03008443106553760c3560f8848)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index c6931dcdc4a..0d94fc1cd23 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import inspect import frappe -__version__ = "14.26.0" +__version__ = "14.27.0" def get_default_company(user=None): From a630db1b2163ed4ca1a94c8387733deef9dc4e87 Mon Sep 17 00:00:00 2001 From: Anand Baburajan Date: Thu, 8 Jun 2023 23:16:28 +0530 Subject: [PATCH 02/16] fix: calculate wdv depr schedule properly for existing assets [v14] (#35613) * fix: calculate wdv depr schedule properly for existing assets * fix: calculate wdv depr schedule properly for existing assets properly (cherry picked from commit feb5d0089b48ed48748c8383a7c4f324ef822bb9) --- erpnext/assets/doctype/asset/asset.py | 27 +++++++++++++++----- erpnext/assets/doctype/asset/depreciation.py | 17 +++++++++++- erpnext/assets/doctype/asset/test_asset.py | 4 +-- 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/erpnext/assets/doctype/asset/asset.py b/erpnext/assets/doctype/asset/asset.py index ae77b9b94ce..02260c6da3a 100644 --- a/erpnext/assets/doctype/asset/asset.py +++ b/erpnext/assets/doctype/asset/asset.py @@ -26,6 +26,7 @@ from erpnext.accounts.general_ledger import make_reverse_gl_entries from erpnext.assets.doctype.asset.depreciation import ( get_depreciation_accounts, get_disposal_account_and_cost_center, + is_first_day_of_the_month, is_last_day_of_the_month, ) from erpnext.assets.doctype.asset_category.asset_category import get_asset_category_account @@ -359,8 +360,14 @@ class Asset(AccountsController): break # For first row - if n == 0 and has_pro_rata and not self.opening_accumulated_depreciation: - from_date = add_days(self.available_for_use_date, -1) + if ( + n == 0 + and (has_pro_rata or has_wdv_or_dd_non_yearly_pro_rata) + and not self.opening_accumulated_depreciation + ): + from_date = add_days( + self.available_for_use_date, -1 + ) # needed to calc depr amount for available_for_use_date too depreciation_amount, days, months = self.get_pro_rata_amt( finance_book, depreciation_amount, @@ -369,10 +376,18 @@ class Asset(AccountsController): has_wdv_or_dd_non_yearly_pro_rata, ) elif n == 0 and has_wdv_or_dd_non_yearly_pro_rata and self.opening_accumulated_depreciation: - from_date = add_months( - getdate(self.available_for_use_date), - (self.number_of_depreciations_booked * finance_book.frequency_of_depreciation), - ) + if not is_first_day_of_the_month(getdate(self.available_for_use_date)): + from_date = get_last_day( + add_months( + getdate(self.available_for_use_date), + ((self.number_of_depreciations_booked - 1) * finance_book.frequency_of_depreciation), + ) + ) + else: + from_date = add_months( + getdate(add_days(self.available_for_use_date, -1)), + (self.number_of_depreciations_booked * finance_book.frequency_of_depreciation), + ) depreciation_amount, days, months = self.get_pro_rata_amt( finance_book, depreciation_amount, diff --git a/erpnext/assets/doctype/asset/depreciation.py b/erpnext/assets/doctype/asset/depreciation.py index 163752b65eb..0c8d5f527fd 100644 --- a/erpnext/assets/doctype/asset/depreciation.py +++ b/erpnext/assets/doctype/asset/depreciation.py @@ -4,7 +4,16 @@ import frappe from frappe import _ -from frappe.utils import add_months, cint, flt, get_last_day, getdate, nowdate, today +from frappe.utils import ( + add_months, + cint, + flt, + get_first_day, + get_last_day, + getdate, + nowdate, + today, +) from frappe.utils.data import get_link_to_form from frappe.utils.user import get_users_with_role @@ -591,3 +600,9 @@ def is_last_day_of_the_month(date): last_day_of_the_month = get_last_day(date) return getdate(last_day_of_the_month) == getdate(date) + + +def is_first_day_of_the_month(date): + first_day_of_the_month = get_first_day(date) + + return getdate(first_day_of_the_month) == getdate(date) diff --git a/erpnext/assets/doctype/asset/test_asset.py b/erpnext/assets/doctype/asset/test_asset.py index 1c0972f2374..fea6ed3d2bd 100644 --- a/erpnext/assets/doctype/asset/test_asset.py +++ b/erpnext/assets/doctype/asset/test_asset.py @@ -766,14 +766,14 @@ class TestDepreciationMethods(AssetSetup): number_of_depreciations_booked=1, opening_accumulated_depreciation=50000, expected_value_after_useful_life=10000, - depreciation_start_date="2030-12-31", + depreciation_start_date="2031-12-31", total_number_of_depreciations=3, frequency_of_depreciation=12, ) self.assertEqual(asset.status, "Draft") - expected_schedules = [["2030-12-31", 33333.50, 83333.50], ["2031-12-31", 6666.50, 90000.0]] + expected_schedules = [["2031-12-31", 33333.50, 83333.50], ["2032-12-31", 6666.50, 90000.0]] schedules = [ [cstr(d.schedule_date), d.depreciation_amount, d.accumulated_depreciation_amount] From 0ccb5a34bdd29095be247e107db6eaca731706b4 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Fri, 9 Jun 2023 16:55:54 +0000 Subject: [PATCH 03/16] chore(release): Bumped to Version 14.27.1 ## [14.27.1](https://github.com/frappe/erpnext/compare/v14.27.0...v14.27.1) (2023-06-09) ### Bug Fixes * calculate wdv depr schedule properly for existing assets [v14] ([#35613](https://github.com/frappe/erpnext/issues/35613)) ([a630db1](https://github.com/frappe/erpnext/commit/a630db1b2163ed4ca1a94c8387733deef9dc4e87)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 0d94fc1cd23..6bb61aa7f4f 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import inspect import frappe -__version__ = "14.27.0" +__version__ = "14.27.1" def get_default_company(user=None): From 08729b49e912b3125b397bd2b5a8df9d890ad3d7 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Wed, 14 Jun 2023 05:06:16 +0000 Subject: [PATCH 04/16] chore(release): Bumped to Version 14.27.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [14.27.2](https://github.com/frappe/erpnext/compare/v14.27.1...v14.27.2) (2023-06-14) ### Bug Fixes * `enqueue_after_commit` wherever it makes sense (backport [#35588](https://github.com/frappe/erpnext/issues/35588)) ([#35590](https://github.com/frappe/erpnext/issues/35590)) ([e505516](https://github.com/frappe/erpnext/commit/e5055160fbd8abe48cf0612eb68fa246caafaed3)) * `TypeError` in Closing Stock Balance ([32e5bbb](https://github.com/frappe/erpnext/commit/32e5bbbb46ebe0872363f87d430d0fa9559a00dd)) * **accounts:** validate payment entry references with latest data. ([#31166](https://github.com/frappe/erpnext/issues/31166)) ([4add1b4](https://github.com/frappe/erpnext/commit/4add1b4374273b90cbccdf9e3096564321360651)) * added process loss in job card ([6a21d61](https://github.com/frappe/erpnext/commit/6a21d617cebf46420ab166c817a98fc0dc97deec)) * allow user to set rounding loss allowance for accounts balance ([cf14858](https://github.com/frappe/erpnext/commit/cf14858909209fbe640803ed535004dd6138e160)) * attribute error on payment reconciliation tool ([25b3c77](https://github.com/frappe/erpnext/commit/25b3c7736b3f99a0193cfe58bc0238a4508223a9)) * based on status_update.py update opportunity status to converted… ([#35145](https://github.com/frappe/erpnext/issues/35145)) ([dee8275](https://github.com/frappe/erpnext/commit/dee82754abd186a8acc0602c8aa4d5c71d89aba3)) * calculate wdv depr schedule properly for existing assets [v14] ([#35613](https://github.com/frappe/erpnext/issues/35613)) ([feb5d00](https://github.com/frappe/erpnext/commit/feb5d0089b48ed48748c8383a7c4f324ef822bb9)) * conflicts ([2060a00](https://github.com/frappe/erpnext/commit/2060a003c87264a0601bf575898d0d36e881a29d)) * CSS not applied to product title ([#35630](https://github.com/frappe/erpnext/issues/35630)) ([2cf871c](https://github.com/frappe/erpnext/commit/2cf871c21e6081ccb8902669819a4eaff49aceb6)) * don't set default payment amount in case of invoice return ([#35645](https://github.com/frappe/erpnext/issues/35645)) ([79483cc](https://github.com/frappe/erpnext/commit/79483cc90eb71fa82d645b2cf54d9731502cf6c7)) * Lower deduction certificate not getting applied ([#35667](https://github.com/frappe/erpnext/issues/35667)) ([6f59fa9](https://github.com/frappe/erpnext/commit/6f59fa9e5bc4246cd4f1039f82da5577a26d4cfa)) * Make difference entry button not working ([#35622](https://github.com/frappe/erpnext/issues/35622)) ([043815e](https://github.com/frappe/erpnext/commit/043815e745807b6a99b1570e2aa1b4a84f7b52b1)) * make showing taxes as table in print configurable (backport [#35672](https://github.com/frappe/erpnext/issues/35672)) ([#35678](https://github.com/frappe/erpnext/issues/35678)) ([f39ae9d](https://github.com/frappe/erpnext/commit/f39ae9dbb1e9dc55927d104d91e982578a35623e)) * Payment against credit notes will be considered as payment against parent invoice in Accounts Receivable/Payable report ([#35642](https://github.com/frappe/erpnext/issues/35642)) ([81ef2ba](https://github.com/frappe/erpnext/commit/81ef2babe97fcaebd0765d48d1219a741162cf00)) * Project in item-wise sales register ([#35596](https://github.com/frappe/erpnext/issues/35596)) ([7737b90](https://github.com/frappe/erpnext/commit/7737b9061fe84841a35141dfd9e79592b09e1515)) * Stock Reconciliation document update while reposting ([8b617fb](https://github.com/frappe/erpnext/commit/8b617fb75e374f199a3d942bd03a4344f99bbbc0)) * test case ([7af0380](https://github.com/frappe/erpnext/commit/7af03800c9709b328f9b649e50edfea50edc6a6d)) * Update de.csv ([#35278](https://github.com/frappe/erpnext/issues/35278)) ([2077f6e](https://github.com/frappe/erpnext/commit/2077f6e89cff76f874ec2af2acd75fddf3f566c1)) * Validation for delivery date in Sales Order ([#35597](https://github.com/frappe/erpnext/issues/35597)) ([4a8ce22](https://github.com/frappe/erpnext/commit/4a8ce226f6204bf1ed484ffb2c3689ddccc19468)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 6bb61aa7f4f..7a3186804a3 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import inspect import frappe -__version__ = "14.27.1" +__version__ = "14.27.2" def get_default_company(user=None): From aa7c81a0bca0bef94ed35616d51eea3dd372654d Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Wed, 14 Jun 2023 20:28:28 +0530 Subject: [PATCH 05/16] fix: reference error while using exchange rate revaluation (cherry picked from commit cd538e138a755f6df013390afb3d8268dcf97157) --- .../exchange_rate_revaluation/exchange_rate_revaluation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js index 733a7616b21..f51b90d8f6a 100644 --- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js +++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js @@ -36,7 +36,7 @@ frappe.ui.form.on('Exchange Rate Revaluation', { }, validate_rounding_loss: function(frm) { - allowance = frm.doc.rounding_loss_allowance; + let allowance = frm.doc.rounding_loss_allowance; if (!(allowance > 0 && allowance < 1)) { frappe.throw(__("Rounding Loss Allowance should be between 0 and 1")); } From 975010c987e884ebe61d896713086f7c92172d03 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Wed, 14 Jun 2023 15:21:49 +0000 Subject: [PATCH 06/16] chore(release): Bumped to Version 14.27.3 ## [14.27.3](https://github.com/frappe/erpnext/compare/v14.27.2...v14.27.3) (2023-06-14) ### Bug Fixes * reference error while using exchange rate revaluation ([aa7c81a](https://github.com/frappe/erpnext/commit/aa7c81a0bca0bef94ed35616d51eea3dd372654d)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 7a3186804a3..433ea849005 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import inspect import frappe -__version__ = "14.27.2" +__version__ = "14.27.3" def get_default_company(user=None): From f3b7eedb25672f37d75a30464500bc411d8c9223 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 15 Jun 2023 11:46:28 +0530 Subject: [PATCH 07/16] fix: update `Stock Reconciliation` diff qty while reposting (backport #35700) (backport #35702) (#35703) fix: update `Stock Reconciliation` diff qty while reposting (cherry picked from commit 6a1b0a2fab64b4192063a529bfef33e97aeea47e) (cherry picked from commit bdb5cc8ad46585cc78deace8e97785b93776c4fb) Co-authored-by: s-aga-r --- erpnext/stock/stock_ledger.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index be2beb1bfb5..9c399168175 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -821,6 +821,7 @@ class update_entries_after(object): item.current_amount = flt(item.current_qty) * flt(item.current_valuation_rate) item.amount = flt(item.qty) * flt(item.valuation_rate) + item.quantity_difference = item.qty - item.current_qty item.amount_difference = item.amount - item.current_amount else: sr.difference_amount = sum([item.amount_difference for item in sr.items]) From c774c14b13e82c5b185df62f4d47e86cb51bcea5 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Thu, 15 Jun 2023 06:34:31 +0000 Subject: [PATCH 08/16] chore(release): Bumped to Version 14.27.4 ## [14.27.4](https://github.com/frappe/erpnext/compare/v14.27.3...v14.27.4) (2023-06-15) ### Bug Fixes * update `Stock Reconciliation` diff qty while reposting (backport [#35700](https://github.com/frappe/erpnext/issues/35700)) (backport [#35702](https://github.com/frappe/erpnext/issues/35702)) ([#35703](https://github.com/frappe/erpnext/issues/35703)) ([f3b7eed](https://github.com/frappe/erpnext/commit/f3b7eedb25672f37d75a30464500bc411d8c9223)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 433ea849005..7e03ef1f009 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import inspect import frappe -__version__ = "14.27.3" +__version__ = "14.27.4" def get_default_company(user=None): From d934dda410a3a4a783155660977e04c4cd07251e Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 15 Jun 2023 11:37:59 +0530 Subject: [PATCH 09/16] fix: typeerror on exchange rate revaluation (cherry picked from commit f8273f7db66ad1ba073474ddfdd7968ba6a08e9f) --- .../exchange_rate_revaluation/exchange_rate_revaluation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py index 043fbdd5d6c..5d239c91f71 100644 --- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py +++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py @@ -186,7 +186,7 @@ class ExchangeRateRevaluation(Document): # round off balance based on currency precision # and consider debit-credit difference allowance currency_precision = get_currency_precision() - rounding_loss_allowance = rounding_loss_allowance or 0.05 + rounding_loss_allowance = float(rounding_loss_allowance) or 0.05 for acc in account_details: acc.balance_in_account_currency = flt(acc.balance_in_account_currency, currency_precision) if abs(acc.balance_in_account_currency) <= rounding_loss_allowance: @@ -552,7 +552,7 @@ def calculate_exchange_rate_using_last_gle(company, account, party_type, party): @frappe.whitelist() def get_account_details( - company, posting_date, account, party_type=None, party=None, rounding_loss_allowance=None + company, posting_date, account, party_type=None, party=None, rounding_loss_allowance: float = None ): if not (company and posting_date): frappe.throw(_("Company and Posting Date is mandatory")) From 138133e11df43ec1abda3b56344553ba26cf28ae Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Thu, 15 Jun 2023 08:10:29 +0000 Subject: [PATCH 10/16] chore(release): Bumped to Version 14.27.5 ## [14.27.5](https://github.com/frappe/erpnext/compare/v14.27.4...v14.27.5) (2023-06-15) ### Bug Fixes * typeerror on exchange rate revaluation ([d934dda](https://github.com/frappe/erpnext/commit/d934dda410a3a4a783155660977e04c4cd07251e)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 7e03ef1f009..0a4822c559e 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import inspect import frappe -__version__ = "14.27.4" +__version__ = "14.27.5" def get_default_company(user=None): From 19203bb87d4fe0b662dc37f104329fe2a7377b91 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sat, 17 Jun 2023 12:18:01 +0530 Subject: [PATCH 11/16] fix: cannot start / stop Job Card (backport #35753) (#35754) fix: cannot start / stop jobs (cherry picked from commit 53ec2a9268ca41fd44f58859df02c1f0876ed757) Co-authored-by: Anoop Kurungadam --- erpnext/manufacturing/doctype/job_card/job_card.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/job_card/job_card.py b/erpnext/manufacturing/doctype/job_card/job_card.py index 496cbfd0a6b..2c17568d1b4 100644 --- a/erpnext/manufacturing/doctype/job_card/job_card.py +++ b/erpnext/manufacturing/doctype/job_card/job_card.py @@ -161,7 +161,7 @@ class JobCard(Document): self.total_completed_qty = flt(self.total_completed_qty, self.precision("total_completed_qty")) for row in self.sub_operations: - self.c += row.completed_qty + self.total_completed_qty += row.completed_qty def get_overlap_for(self, args, check_next_available_slot=False): production_capacity = 1 From 7ffa6b4fbdc3141e424786c7ee8bbd5080a0ee29 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Sat, 17 Jun 2023 06:58:24 +0000 Subject: [PATCH 12/16] chore(release): Bumped to Version 14.27.6 ## [14.27.6](https://github.com/frappe/erpnext/compare/v14.27.5...v14.27.6) (2023-06-17) ### Bug Fixes * cannot start / stop Job Card (backport [#35753](https://github.com/frappe/erpnext/issues/35753)) ([#35754](https://github.com/frappe/erpnext/issues/35754)) ([19203bb](https://github.com/frappe/erpnext/commit/19203bb87d4fe0b662dc37f104329fe2a7377b91)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 0a4822c559e..f57ef194f77 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import inspect import frappe -__version__ = "14.27.5" +__version__ = "14.27.6" def get_default_company(user=None): From e7abdc34d0481f9ae9bbdd9c96a5c858c2ce48e5 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Sat, 17 Jun 2023 12:14:32 +0530 Subject: [PATCH 13/16] fix: validation of job card in stock entry (cherry picked from commit df8c3f0888e06c28da0937190e97c3589d67c44d) (cherry picked from commit ce2bf5fb1c55d3bb4b566e50b9b12f3d89676ccd) --- erpnext/stock/doctype/stock_entry/stock_entry.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 3f5457c633e..ae9adc826c6 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -268,10 +268,10 @@ class StockEntry(StockController): return for row in self.items: - if row.job_card_item: + if row.job_card_item or not row.s_warehouse: continue - msg = f"""Row #{0}: The job card item reference + msg = f"""Row #{row.idx}: The job card item reference is missing. Kindly create the stock entry from the job card. If you have added the row manually then you won't be able to add job card item reference.""" From 58e304f64b6273122b6544d21146b63e76dce1bb Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Sat, 17 Jun 2023 08:35:04 +0000 Subject: [PATCH 14/16] chore(release): Bumped to Version 14.27.7 ## [14.27.7](https://github.com/frappe/erpnext/compare/v14.27.6...v14.27.7) (2023-06-17) ### Bug Fixes * validation of job card in stock entry ([e7abdc3](https://github.com/frappe/erpnext/commit/e7abdc34d0481f9ae9bbdd9c96a5c858c2ce48e5)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index f57ef194f77..60d0653a9da 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import inspect import frappe -__version__ = "14.27.6" +__version__ = "14.27.7" def get_default_company(user=None): From 3bf7115cdcc6d078f7397c53697fcd16acf2cf52 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 19 Jun 2023 12:52:06 +0530 Subject: [PATCH 15/16] fix: Allocated amount validation for other party types (#35741) fix: Allocated amount validation for other party types (#35741) * fix: Allocated amount validation for other party types * chore: Validation for return allocations * chore: minor typo --------- Co-authored-by: anandbaburajan (cherry picked from commit 9d27a25e5f2335386402f96f83a10729695b20c8) Co-authored-by: Deepesh Garg (cherry picked from commit 5541d68477d5d8c71ce19ff46343c285bb408455) --- .../doctype/payment_entry/payment_entry.py | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 118d5636769..63a1370de81 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -151,6 +151,19 @@ class PaymentEntry(AccountsController): if self.payment_type == "Internal Transfer": return + if self.party_type in ("Customer", "Supplier"): + self.validate_allocated_amount_with_latest_data() + else: + fail_message = _("Row #{0}: Allocated Amount cannot be greater than outstanding amount.") + for d in self.get("references"): + if (flt(d.allocated_amount)) > 0 and flt(d.allocated_amount) > flt(d.outstanding_amount): + frappe.throw(fail_message.format(d.idx)) + + # Check for negative outstanding invoices as well + if flt(d.allocated_amount) < 0 and flt(d.allocated_amount) < flt(d.outstanding_amount): + frappe.throw(fail_message.format(d.idx)) + + def validate_allocated_amount_with_latest_data(self): latest_references = get_outstanding_reference_documents( { "posting_date": self.posting_date, @@ -168,7 +181,7 @@ class PaymentEntry(AccountsController): d = frappe._dict(d) latest_lookup.update({(d.voucher_type, d.voucher_no): d}) - for d in self.get("references").copy(): + for d in self.get("references"): latest = latest_lookup.get((d.reference_doctype, d.reference_name)) # The reference has already been fully paid @@ -187,18 +200,14 @@ class PaymentEntry(AccountsController): ).format(d.reference_doctype, d.reference_name) ) - d.outstanding_amount = latest.outstanding_amount - fail_message = _("Row #{0}: Allocated Amount cannot be greater than outstanding amount.") - if (flt(d.allocated_amount)) > 0: - if flt(d.allocated_amount) > flt(d.outstanding_amount): - frappe.throw(fail_message.format(d.idx)) + if (flt(d.allocated_amount)) > 0 and flt(d.allocated_amount) > flt(latest.outstanding_amount): + frappe.throw(fail_message.format(d.idx)) # Check for negative outstanding invoices as well - if flt(d.allocated_amount) < 0: - if flt(d.allocated_amount) < flt(d.outstanding_amount): - frappe.throw(fail_message.format(d.idx)) + if flt(d.allocated_amount) < 0 and flt(d.allocated_amount) < flt(latest.outstanding_amount): + frappe.throw(fail_message.format(d.idx)) def delink_advance_entry_references(self): for reference in self.references: From 4c1befab8f0b8dfdcd6eb5acbffc15fb3d2db9f3 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Mon, 19 Jun 2023 11:38:53 +0000 Subject: [PATCH 16/16] chore(release): Bumped to Version 14.27.8 ## [14.27.8](https://github.com/frappe/erpnext/compare/v14.27.7...v14.27.8) (2023-06-19) ### Bug Fixes * Allocated amount validation for other party types ([#35741](https://github.com/frappe/erpnext/issues/35741)) ([3bf7115](https://github.com/frappe/erpnext/commit/3bf7115cdcc6d078f7397c53697fcd16acf2cf52)) --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 60d0653a9da..a36cdb55093 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -3,7 +3,7 @@ import inspect import frappe -__version__ = "14.27.7" +__version__ = "14.27.8" def get_default_company(user=None):