2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 10:58:59 +00:00

feat: loyalty program schemas

This commit is contained in:
AbleKSaju 2024-08-22 14:32:45 +05:30
parent ec5a645290
commit b3daab2e1e
6 changed files with 211 additions and 0 deletions

View File

@ -114,6 +114,13 @@
"default": false,
"section": "Features"
},
{
"fieldname": "enableLoyaltyProgram",
"label": "Enable Loyalty Program",
"fieldtype": "Check",
"default": false,
"section": "Features"
},
{
"fieldname": "fiscalYearStart",
"label": "Fiscal Year Start Date",

View File

@ -0,0 +1,23 @@
{
"name": "CollectionRulesItems",
"label": "Collection Rules",
"isChild": true,
"fields": [
{
"fieldname": "tierName",
"label": "Tier Name",
"fieldtype": "Data"
},
{
"fieldname": "collectionFactor",
"label": "Collection Factor (=1 LP)",
"fieldtype": "Float"
},
{
"fieldname": "minimumTotalSpent",
"label": "Minimum Total Spent",
"fieldtype": "Currency"
}
],
"tableFields": ["tierName", "collectionFactor", "minimumTotalSpent"]
}

View File

@ -0,0 +1,70 @@
{
"name": "LoyaltyPointEntry",
"label": "Loyalty Point Entry",
"create": false,
"naming": "random",
"fields": [
{
"label": "Entry No.",
"fieldname": "name",
"fieldtype": "Data",
"required": true,
"readOnly": true,
"section": "Default"
},
{
"fieldname": "loyaltyProgram",
"readOnly": true,
"label": "Loyalty Program",
"fieldtype": "Data",
"required": true
},
{
"fieldname": "loyaltyProgramTier",
"readOnly": true,
"label": "Loyalty Program Tier",
"fieldtype": "Data"
},
{
"fieldname": "customer",
"readOnly": true,
"label": "Customer",
"fieldtype": "Link",
"target": "Party",
"required": true
},
{
"fieldname": "invoice",
"readOnly": true,
"label": "Invoice",
"fieldtype": "Link",
"target": "SalesInvoice",
"required": true
},
{
"fieldname": "loyaltyPoints",
"readOnly": true,
"label": "Loyalty Points",
"fieldtype": "Int"
},
{
"fieldname": "purchaseAmount",
"readOnly": true,
"label": "Purchase Amount",
"fieldtype": "Currency",
"required": true
},
{
"fieldname": "expiryDate",
"readOnly": true,
"label": "Expiry Date",
"fieldtype": "Date"
},
{
"fieldname": "postingDate",
"readOnly": true,
"label": "Posting Date",
"fieldtype": "Date"
}
]
}

View File

@ -0,0 +1,72 @@
{
"name": "LoyaltyProgram",
"label": "Loyalty Program",
"naming": "manual",
"fields": [
{
"fieldname": "name",
"label": "Name",
"fieldtype": "Data",
"required": true,
"placeholder": "Full Name",
"section": "Default"
},
{
"fieldname": "fromDate",
"label": "From Date",
"fieldtype": "Date",
"required": true
},
{
"fieldname": "toDate",
"label": "To Date",
"fieldtype": "Date",
"required": true
},
{
"fieldname": "isEnabled",
"label": "Is Enabled",
"fieldtype": "Check",
"default": true,
"required": true
},
{
"fieldname": "collectionRules",
"label": "Collection Rules",
"fieldtype": "Table",
"target": "CollectionRulesItems",
"required": false
},
{
"fieldname": "conversionFactor",
"label": "Conversion Factor",
"fieldtype": "Float",
"default": 1,
"required": true
},
{
"fieldname": "expiryDuration",
"label": "Expiry Duration",
"fieldtype": "Int",
"default": 1,
"required": true
},
{
"fieldname": "expenseAccount",
"label": "Expense Account",
"fieldtype": "Link",
"target": "Account",
"required": true
}
],
"quickEditFields": [
"name",
"fromDate",
"toDate",
"conversionFactor",
"expenseAccount",
"expiryDuration"
],
"keywordFields": ["name"]
}

View File

@ -86,6 +86,23 @@
"readOnly": true,
"section": "References"
},
{
"fieldname": "loyaltyProgram",
"label": "Loyalty Program",
"fieldtype": "Link",
"target": "LoyaltyProgram",
"create": true,
"section": "Loyalty Program"
},
{
"fieldname": "loyaltyPoints",
"label": "Loyalty Points",
"fieldtype": "Int",
"readOnly": true,
"default": 0,
"section": "Loyalty Program"
},
{
"fieldname": "taxId",
"label": "Tax ID",
@ -104,6 +121,7 @@
"phone",
"address",
"defaultAccount",
"loyaltyProgram",
"currency",
"role",
"taxId"

View File

@ -70,6 +70,27 @@
"label": "Return Against",
"section": "References"
},
{
"fieldname": "loyaltyProgram",
"fieldtype": "Link",
"target": "LoyaltyProgram",
"label": "Loyalty Program",
"section": "References",
"readOnly": true
},
{
"fieldname": "redeemLoyaltyPoints",
"fieldtype": "Check",
"default": false,
"label": "Redeem Loyalty Points",
"section": "Loyalty Points Redemption"
},
{
"fieldname": "loyaltyPoints",
"fieldtype": "Int",
"label": "Loyalty Points",
"section": "Loyalty Points Redemption"
},
{
"fieldname": "isPOS",
"fieldtype": "Check",