From 285344eb0e0ccdf70718f85cf061b2ac3d6ad667 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Fri, 11 Oct 2019 11:02:11 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20over-bill=20error=20while=20making=20deb?= =?UTF-8?q?it=20note=20against=20purchase=20return=20e=E2=80=A6=20(#19270)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: overbill error while making debit note against purchase return entry * Update accounts_controller.py --- erpnext/controllers/accounts_controller.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 3bc05582d4f..1d4a25e3e2d 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -606,8 +606,13 @@ class AccountsController(TransactionBase): max_allowed_amt = flt(ref_amt * (100 + allowance) / 100) + if total_billed_amt < 0 and max_allowed_amt < 0: + # while making debit note against purchase return entry(purchase receipt) getting overbill error + total_billed_amt = abs(total_billed_amt) + max_allowed_amt = abs(max_allowed_amt) + if total_billed_amt - max_allowed_amt > 0.01: - frappe.throw(_("Cannot overbill for Item {0} in row {1} more than {2}. To allow over-billing, please set in Stock Settings") + frappe.throw(_("Cannot overbill for Item {0} in row {1} more than {2}. To allow over-billing, please set allowance in Accounts Settings") .format(item.item_code, item.idx, max_allowed_amt)) def get_company_default(self, fieldname):