Skip to content

Commit

Permalink
fix: skip warning for free items
Browse files Browse the repository at this point in the history
(cherry picked from commit 772776a)
  • Loading branch information
barredterra authored and mergify[bot] committed Feb 12, 2025
1 parent 70bac1a commit 2adab1d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions erpnext/controllers/accounts_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1903,22 +1903,22 @@ def validate_multiple_billing(self, ref_dt, item_ref_dn, based_on):
continue

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:
frappe.msgprint(
_("System will not check over billing since amount for Item {0} in {1} is zero").format(
item.item_code, ref_dt
),
title=_("Warning"),
indicator="orange",
)
if based_on_amt: # Skip warning for free items
frappe.msgprint(
_(
"System will not check over billing since amount for Item {0} in {1} is zero"
).format(item.item_code, ref_dt),
title=_("Warning"),
indicator="orange",
)
continue

already_billed = self.get_billed_amount_for_item(item, item_ref_dn, based_on)

total_billed_amt = flt(
flt(already_billed) + flt(item.get(based_on)), self.precision(based_on, item)
)
total_billed_amt = flt(flt(already_billed) + based_on_amt, self.precision(based_on, item))

allowance, item_allowance, global_qty_allowance, global_amount_allowance = get_allowance_for(
item.item_code, item_allowance, global_qty_allowance, global_amount_allowance, "amount"
Expand Down

0 comments on commit 2adab1d

Please sign in to comment.