mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-06 03:52:15 +00:00
fix: tiered loyalty program
This commit is contained in:
@@ -86,10 +86,9 @@ def get_loyalty_program_details_with_points(
|
||||
tier_spent_level = sorted(
|
||||
[d.as_dict() for d in loyalty_program.collection_rules],
|
||||
key=lambda rule: rule.min_spent,
|
||||
reverse=True,
|
||||
)
|
||||
for i, d in enumerate(tier_spent_level):
|
||||
if i == 0 or (lp_details.total_spent + current_transaction_amount) <= d.min_spent:
|
||||
if i == 0 or (lp_details.total_spent + current_transaction_amount) >= d.min_spent:
|
||||
lp_details.tier_name = d.tier_name
|
||||
lp_details.collection_factor = d.collection_factor
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user