2
0
mirror of https://github.com/frappe/books.git synced 2024-11-14 17:34:04 +00:00

feat: added coupon codes to sidebar and formatted

This commit is contained in:
AbleKSaju 2024-08-20 10:38:50 +05:30
parent dbde1748a2
commit e278f9aa32
2 changed files with 75 additions and 69 deletions

View File

@ -1,71 +1,70 @@
{
"name": "CouponCode",
"label": "Coupon Code",
"naming": "manual",
"name": "CouponCode",
"label": "Coupon Code",
"naming": "manual",
"fields": [
{
"fieldname": "name",
"label": "Name",
"fieldtype": "Data",
"required": true,
"placeholder": "Coupon Name",
"section": "Default"
},
{
"fieldname": "couponCode",
"label": "Coupon Code",
"fieldtype": "Data",
"required": true
},
{
"fieldname": "isEnabled",
"label": "Is Enabled",
"fieldtype": "Check",
"default": true,
"required": true,
"section": "Validity and Usage"
},
{
"fieldname": "validFrom",
"label": "Valid From",
"fieldtype": "Date",
"required": true,
"section": "Validity and Usage"
},
{
"fieldname": "validTo",
"label": "Valid To",
"fieldtype": "Date",
"required": true,
"section": "Validity and Usage"
},
{
"fieldname": "maximumUse",
"label": "Maximum Use",
"fieldtype": "Int",
"default":0,
"required": true,
"section": "Validity and Usage"
},
{
"fieldname": "used",
"label": "Used",
"fieldtype": "Int",
"default":0,
"required": true,
"readOnly": true,
"section": "Validity and Usage"
}
],
"quickEditFields": [
"name",
"couponCode",
"validFrom",
"validTo",
"maximumUse",
"used"
],
"keywordFields": ["name"]
}
"fields": [
{
"fieldname": "name",
"label": "Name",
"fieldtype": "Data",
"required": true,
"placeholder": "Coupon Name",
"section": "Default"
},
{
"fieldname": "couponCode",
"label": "Coupon Code",
"fieldtype": "Data",
"required": true
},
{
"fieldname": "isEnabled",
"label": "Is Enabled",
"fieldtype": "Check",
"default": true,
"required": true,
"section": "Validity and Usage"
},
{
"fieldname": "validFrom",
"label": "Valid From",
"fieldtype": "Date",
"required": true,
"section": "Validity and Usage"
},
{
"fieldname": "validTo",
"label": "Valid To",
"fieldtype": "Date",
"required": true,
"section": "Validity and Usage"
},
{
"fieldname": "maximumUse",
"label": "Maximum Use",
"fieldtype": "Int",
"default": 0,
"required": true,
"section": "Validity and Usage"
},
{
"fieldname": "used",
"label": "Used",
"fieldtype": "Int",
"default": 0,
"required": true,
"readOnly": true,
"section": "Validity and Usage"
}
],
"quickEditFields": [
"name",
"couponCode",
"validFrom",
"validTo",
"maximumUse",
"used"
],
"keywordFields": ["name"]
}

View File

@ -216,6 +216,13 @@ function getCompleteSidebar(): SidebarConfig {
schemaName: 'Lead',
hidden: () => !fyo.singles.AccountingSettings?.enableLead,
},
{
label: t`Coupon Code`,
name: 'coupon-code',
route: `/list/CouponCode/CouponCode`,
schemaName: 'CouponCode',
hidden: () => !fyo.singles.AccountingSettings?.enableCouponCode,
},
] as SidebarItem[],
},
{