fix: correct item valuation when "Deduct" is used in Purchase Invoice and Receipt.

This commit is contained in:
ljain112
2026-03-13 11:53:08 +05:30
parent ac8f3d7f96
commit e68f149d3a
2 changed files with 65 additions and 2 deletions

View File

@@ -503,11 +503,15 @@ class BuyingController(SubcontractingController):
if d.category not in ["Valuation", "Valuation and Total"]:
continue
amount = flt(d.base_tax_amount_after_discount_amount) * (
-1 if d.get("add_deduct_tax") == "Deduct" else 1
)
if d.charge_type == "On Net Total":
total_valuation_amount += flt(d.base_tax_amount_after_discount_amount)
total_valuation_amount += amount
tax_accounts.append(d.account_head)
else:
total_actual_tax_amount += flt(d.base_tax_amount_after_discount_amount)
total_actual_tax_amount += amount
return tax_accounts, total_valuation_amount, total_actual_tax_amount