fix: correctly show coupon code in transactions
This commit is contained in:
@@ -69,7 +69,7 @@
|
|||||||
<FormControl
|
<FormControl
|
||||||
v-if="transactionData.coupon"
|
v-if="transactionData.coupon"
|
||||||
:label="__('Coupon Code')"
|
:label="__('Coupon Code')"
|
||||||
v-model="transactionData.coupon"
|
v-model="transactionData.coupon_code"
|
||||||
:disabled="true"
|
:disabled="true"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -29,7 +29,8 @@
|
|||||||
"address",
|
"address",
|
||||||
"column_break_monu",
|
"column_break_monu",
|
||||||
"gstin",
|
"gstin",
|
||||||
"pan"
|
"pan",
|
||||||
|
"coupon_code"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
@@ -173,6 +174,11 @@
|
|||||||
"options": "currency",
|
"options": "currency",
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "coupon_code",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"label": "Coupon Code"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
@@ -186,7 +192,7 @@
|
|||||||
"link_fieldname": "payment"
|
"link_fieldname": "payment"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modified": "2025-10-13 15:25:56.127625",
|
"modified": "2025-10-13 18:52:13.542556",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "LMS Payment",
|
"name": "LMS Payment",
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ def record_payment(
|
|||||||
"discount_type": coupon_context.get("discount_type"),
|
"discount_type": coupon_context.get("discount_type"),
|
||||||
"discount_percent": coupon_context.get("discount_percent"),
|
"discount_percent": coupon_context.get("discount_percent"),
|
||||||
"discount_amount": coupon_context.get("discount_amount"),
|
"discount_amount": coupon_context.get("discount_amount"),
|
||||||
|
"coupon_code": coupon_context.get("coupon_code"),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
payment_doc.save(ignore_permissions=True)
|
payment_doc.save(ignore_permissions=True)
|
||||||
|
|||||||
@@ -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,
|
"gst_amount_formatted": fmt_money(gst_applied, 0, currency) if gst_applied else None,
|
||||||
"total_amount_formatted": fmt_money(final_amount, 0, currency),
|
"total_amount_formatted": fmt_money(final_amount, 0, currency),
|
||||||
"coupon": coupon.name,
|
"coupon": coupon.name,
|
||||||
|
"coupon_code": coupon.code,
|
||||||
"discount_type": coupon.discount_type,
|
"discount_type": coupon.discount_type,
|
||||||
"discount_percent": coupon.percent_off if coupon.discount_type == "Percent" else None,
|
"discount_percent": coupon.percent_off if coupon.discount_type == "Percent" else None,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user