mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-05 03:23:35 +00:00
fix: POS Invoice can't use Loyalty Points when Global Rounded Total is Disabled (#47491)
This commit is contained in:
committed by
GitHub
parent
dfc4aa9a57
commit
b541b536c3
@@ -178,8 +178,9 @@ def validate_loyalty_points(ref_doc, points_to_redeem):
|
||||
|
||||
loyalty_amount = flt(points_to_redeem * loyalty_program_details.conversion_factor)
|
||||
|
||||
if loyalty_amount > ref_doc.rounded_total:
|
||||
frappe.throw(_("You can't redeem Loyalty Points having more value than the Rounded Total."))
|
||||
total_amount = ref_doc.grand_total if ref_doc.is_rounded_total_disabled() else ref_doc.rounded_total
|
||||
if loyalty_amount > total_amount:
|
||||
frappe.throw(_("You can't redeem Loyalty Points having more value than the Total Amount."))
|
||||
|
||||
if not ref_doc.loyalty_amount and ref_doc.loyalty_amount != loyalty_amount:
|
||||
ref_doc.loyalty_amount = loyalty_amount
|
||||
|
||||
Reference in New Issue
Block a user