fix(ux): better error message
Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
This commit is contained in:
committed by
Ankush Menat
parent
5e4fbba753
commit
21a955d20b
@@ -993,8 +993,8 @@ class AccountsController(TransactionBase):
|
|||||||
item.get(item_ref_dn), based_on), self.precision(based_on, item))
|
item.get(item_ref_dn), based_on), self.precision(based_on, item))
|
||||||
if not ref_amt:
|
if not ref_amt:
|
||||||
frappe.msgprint(
|
frappe.msgprint(
|
||||||
_("Warning: System will not check overbilling since amount for Item {0} in {1} is zero")
|
_("System will not check overbilling since amount for Item {0} in {1} is zero")
|
||||||
.format(item.item_code, ref_dt))
|
.format(item.item_code, ref_dt), title=_("Warning"), indicator="orange")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
already_billed = frappe.db.sql("""
|
already_billed = frappe.db.sql("""
|
||||||
@@ -1027,8 +1027,8 @@ class AccountsController(TransactionBase):
|
|||||||
self.throw_overbill_exception(item, max_allowed_amt)
|
self.throw_overbill_exception(item, max_allowed_amt)
|
||||||
|
|
||||||
if role_allowed_to_over_bill in user_roles and total_overbilled_amt > 0.1:
|
if role_allowed_to_over_bill in user_roles and total_overbilled_amt > 0.1:
|
||||||
frappe.msgprint(_("INFO: Overbilling of {} ignored because you have {} role.")
|
frappe.msgprint(_("Overbilling of {} ignored because you have {} role.")
|
||||||
.format(total_overbilled_amt, role_allowed_to_over_bill))
|
.format(total_overbilled_amt, role_allowed_to_over_bill), title=_("Warning"), indicator="orange")
|
||||||
|
|
||||||
def throw_overbill_exception(self, item, max_allowed_amt):
|
def throw_overbill_exception(self, item, max_allowed_amt):
|
||||||
frappe.throw(_("Cannot overbill for Item {0} in row {1} more than {2}. To allow over-billing, please set allowance in Accounts Settings")
|
frappe.throw(_("Cannot overbill for Item {0} in row {1} more than {2}. To allow over-billing, please set allowance in Accounts Settings")
|
||||||
|
|||||||
Reference in New Issue
Block a user