fix: coupon code changes suggested by prasad (#19352)

* changes suggested by prasad

* codacy correction
This commit is contained in:
Ashish Shah 2019-10-31 16:09:06 +05:30 committed by Nabin Hait
parent 45c18b3184
commit 28710cdf99
2 changed files with 15 additions and 4 deletions

View File

@ -2,6 +2,15 @@
// For license information, please see license.txt
frappe.ui.form.on('Coupon Code', {
setup: function(frm) {
frm.set_query("pricing_rule", function() {
return {
filters: [
["Pricing Rule","coupon_code_based", "=", "1"]
]
};
});
},
coupon_name:function(frm){
if (frm.doc.__islocal===1) {
frm.trigger("make_coupon_code");

View File

@ -24,6 +24,7 @@
],
"fields": [
{
"description": "e.g. \"Summer Holiday 2019 Offer 20\"",
"fieldname": "coupon_name",
"fieldtype": "Data",
"label": "Coupon Name",
@ -50,7 +51,7 @@
"fieldtype": "Column Break"
},
{
"description": "To be used to get discount",
"description": "unique e.g. SAVE20 To be used to get discount",
"fieldname": "coupon_code",
"fieldtype": "Data",
"label": "Coupon Code",
@ -62,12 +63,13 @@
"fieldname": "pricing_rule",
"fieldtype": "Link",
"label": "Pricing Rule",
"options": "Pricing Rule"
"options": "Pricing Rule",
"reqd": 1
},
{
"fieldname": "uses",
"fieldtype": "Section Break",
"label": "Uses"
"label": "Validity and Usage"
},
{
"fieldname": "valid_from",
@ -113,7 +115,7 @@
"read_only": 1
}
],
"modified": "2019-10-15 14:12:22.686986",
"modified": "2019-10-19 14:48:14.602481",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Coupon Code",