fix: make free qty round on large transaction qty

(cherry picked from commit f9b8165385)
This commit is contained in:
venkat102
2024-11-21 18:27:15 +05:30
committed by Mergify
parent c0e6f3f4df
commit 4856a9633e

View File

@@ -655,7 +655,7 @@ def get_product_discount_rule(pricing_rule, item_details, args=None, doc=None):
if transaction_qty:
qty = flt(transaction_qty) * qty / pricing_rule.recurse_for
if pricing_rule.round_free_qty:
qty = math.floor(qty)
qty = (flt(transaction_qty) // pricing_rule.recurse_for) * (pricing_rule.free_qty or 1)
if not qty:
return