Skip to content

Commit

Permalink
feat: separate lp and discount
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Jun 2, 2024
1 parent bcd0bad commit 0796d71
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions erpnext/accounts/doctype/payment_request/payment_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,13 @@ def get_tx_data(self):
else:
address = {}
ref_doc = frappe.get_doc(self.reference_doctype, self.reference_name)
lpm, lpp = party.get("loyalty_program"), ref_doc.get("loyalty_points")
if lpm and lpp:
loyalty_points = [lpm, lpp]
lpm, lpp, lpa = (
party.get("loyalty_program"),
ref_doc.get("loyalty_points"),
ref_doc.get("loyalty_amount"),
)
if lpm and lpp and lpa:
loyalty_points = [lpm, lpp, lpa]
else:
loyalty_points = None
return frappe._dict(
Expand All @@ -208,7 +212,7 @@ def get_tx_data(self):
"payer_contact": contact,
"payer_address": address,
"loyalty_points": loyalty_points,
"discount_amount": ref_doc.get("loyalty_amount") or ref_doc.get("discount_amount"),
"discount_amount": ref_doc.get("discount_amount"),
}
)

Expand Down

0 comments on commit 0796d71

Please sign in to comment.