Merge pull request #45884 from frappe/mergify/bp/version-15-hotfix/pr-45786

fix: skip warning for free items (backport #45786)
This commit is contained in:
rohitwaghchaure
2025-02-12 15:16:29 +05:30
committed by GitHub

View File

@@ -1903,12 +1903,14 @@ class AccountsController(TransactionBase):
continue continue
ref_amt = flt(reference_details.get(item.get(item_ref_dn)), self.precision(based_on, item)) ref_amt = flt(reference_details.get(item.get(item_ref_dn)), self.precision(based_on, item))
based_on_amt = flt(item.get(based_on))
if not ref_amt: if not ref_amt:
if based_on_amt: # Skip warning for free items
frappe.msgprint( frappe.msgprint(
_("System will not check over billing since amount for Item {0} in {1} is zero").format( _(
item.item_code, ref_dt "System will not check over billing since amount for Item {0} in {1} is zero"
), ).format(item.item_code, ref_dt),
title=_("Warning"), title=_("Warning"),
indicator="orange", indicator="orange",
) )
@@ -1916,9 +1918,7 @@ class AccountsController(TransactionBase):
already_billed = self.get_billed_amount_for_item(item, item_ref_dn, based_on) already_billed = self.get_billed_amount_for_item(item, item_ref_dn, based_on)
total_billed_amt = flt( total_billed_amt = flt(flt(already_billed) + based_on_amt, self.precision(based_on, item))
flt(already_billed) + flt(item.get(based_on)), self.precision(based_on, item)
)
allowance, item_allowance, global_qty_allowance, global_amount_allowance = get_allowance_for( allowance, item_allowance, global_qty_allowance, global_amount_allowance = get_allowance_for(
item.item_code, item_allowance, global_qty_allowance, global_amount_allowance, "amount" item.item_code, item_allowance, global_qty_allowance, global_amount_allowance, "amount"