diff --git a/frontend/src/components/Settings/TransactionDetails.vue b/frontend/src/components/Settings/TransactionDetails.vue index ac5b8e1d..07d97e90 100644 --- a/frontend/src/components/Settings/TransactionDetails.vue +++ b/frontend/src/components/Settings/TransactionDetails.vue @@ -69,7 +69,7 @@ diff --git a/lms/lms/doctype/lms_payment/lms_payment.json b/lms/lms/doctype/lms_payment/lms_payment.json index 7a5a549e..77485198 100644 --- a/lms/lms/doctype/lms_payment/lms_payment.json +++ b/lms/lms/doctype/lms_payment/lms_payment.json @@ -29,7 +29,8 @@ "address", "column_break_monu", "gstin", - "pan" + "pan", + "coupon_code" ], "fields": [ { @@ -173,6 +174,11 @@ "options": "currency", "read_only": 1, "reqd": 1 + }, + { + "fieldname": "coupon_code", + "fieldtype": "Data", + "label": "Coupon Code" } ], "index_web_pages_for_search": 1, @@ -186,7 +192,7 @@ "link_fieldname": "payment" } ], - "modified": "2025-10-13 15:25:56.127625", + "modified": "2025-10-13 18:52:13.542556", "modified_by": "Administrator", "module": "LMS", "name": "LMS Payment", diff --git a/lms/lms/payments.py b/lms/lms/payments.py index 4c8ab330..f69137aa 100644 --- a/lms/lms/payments.py +++ b/lms/lms/payments.py @@ -117,6 +117,7 @@ def record_payment( "discount_type": coupon_context.get("discount_type"), "discount_percent": coupon_context.get("discount_percent"), "discount_amount": coupon_context.get("discount_amount"), + "coupon_code": coupon_context.get("coupon_code"), } ) payment_doc.save(ignore_permissions=True) diff --git a/lms/lms/utils.py b/lms/lms/utils.py index c571b56c..50f54cfd 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -1017,6 +1017,7 @@ def apply_coupon(doctype, docname, code, country=None): "gst_amount_formatted": fmt_money(gst_applied, 0, currency) if gst_applied else None, "total_amount_formatted": fmt_money(final_amount, 0, currency), "coupon": coupon.name, + "coupon_code": coupon.code, "discount_type": coupon.discount_type, "discount_percent": coupon.percent_off if coupon.discount_type == "Percent" else None, }