Skip to content

Commit

Permalink
Merge pull request #45786 from barredterra/skip-warning-for-free-items
Browse files Browse the repository at this point in the history
fix: skip warning for free items
  • Loading branch information
rohitwaghchaure authored Feb 12, 2025
2 parents b839094 + 772776a commit 5f554e1
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 @@ -1892,22 +1892,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 5f554e1

Please sign in to comment.