fix: discount accounting

This commit is contained in:
0xD0M1M0
2025-02-15 21:23:05 +01:00
committed by GitHub
parent 9e4c82e055
commit 03d515208a

View File

@@ -3456,7 +3456,7 @@ def add_income_discount_loss(pe, doc, total_discount_percent) -> float:
{ {
"account": frappe.get_cached_value("Company", pe.company, "default_discount_account"), "account": frappe.get_cached_value("Company", pe.company, "default_discount_account"),
"cost_center": pe.cost_center or frappe.get_cached_value("Company", pe.company, "cost_center"), "cost_center": pe.cost_center or frappe.get_cached_value("Company", pe.company, "cost_center"),
"amount": flt(base_loss_on_income, precision), "amount": flt(base_loss_on_income, precision) * -1,
}, },
) )
@@ -3490,7 +3490,7 @@ def add_tax_discount_loss(pe, doc, total_discount_percentage) -> float:
"account": account, "account": account,
"cost_center": pe.cost_center "cost_center": pe.cost_center
or frappe.get_cached_value("Company", pe.company, "cost_center"), or frappe.get_cached_value("Company", pe.company, "cost_center"),
"amount": flt(loss, precision), "amount": flt(loss, precision) * -1,
}, },
) )