diff --git a/erpnext/accounts/doctype/loyalty_program/loyalty_program.py b/erpnext/accounts/doctype/loyalty_program/loyalty_program.py index e9870af18c8..17b18c17f23 100644 --- a/erpnext/accounts/doctype/loyalty_program/loyalty_program.py +++ b/erpnext/accounts/doctype/loyalty_program/loyalty_program.py @@ -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