mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-28 01:14:46 +00:00
fix: decimal break for discount amount
This commit is contained in:
@@ -208,12 +208,18 @@ class calculate_taxes_and_totals:
|
|||||||
if item.discount_amount and not item.discount_percentage:
|
if item.discount_amount and not item.discount_percentage:
|
||||||
item.rate = item.rate_with_margin - item.discount_amount
|
item.rate = item.rate_with_margin - item.discount_amount
|
||||||
else:
|
else:
|
||||||
item.discount_amount = item.rate_with_margin - item.rate
|
item.discount_amount = flt(
|
||||||
|
item.rate_with_margin - item.rate, item.precision("discount_amount")
|
||||||
|
)
|
||||||
|
|
||||||
elif flt(item.price_list_rate) > 0:
|
elif flt(item.price_list_rate) > 0:
|
||||||
item.discount_amount = item.price_list_rate - item.rate
|
item.discount_amount = flt(
|
||||||
|
item.price_list_rate - item.rate, item.precision("discount_amount")
|
||||||
|
)
|
||||||
elif flt(item.price_list_rate) > 0 and not item.discount_amount:
|
elif flt(item.price_list_rate) > 0 and not item.discount_amount:
|
||||||
item.discount_amount = item.price_list_rate - item.rate
|
item.discount_amount = flt(
|
||||||
|
item.price_list_rate - item.rate, item.precision("discount_amount")
|
||||||
|
)
|
||||||
|
|
||||||
item.net_rate = item.rate
|
item.net_rate = item.rate
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user