diff --git a/schemas/app/AccountingSettings.json b/schemas/app/AccountingSettings.json index 4360352b..eda1a88b 100644 --- a/schemas/app/AccountingSettings.json +++ b/schemas/app/AccountingSettings.json @@ -107,6 +107,13 @@ "default": false, "section": "Features" }, + { + "fieldname": "enablePricingRule", + "label": "Enable Pricing Rule", + "fieldtype": "Check", + "default": false, + "section": "Features" + }, { "fieldname": "fiscalYearStart", "label": "Fiscal Year Start Date", diff --git a/schemas/app/NumberSeries.json b/schemas/app/NumberSeries.json index 0526e587..ceb717e6 100644 --- a/schemas/app/NumberSeries.json +++ b/schemas/app/NumberSeries.json @@ -62,6 +62,10 @@ { "value": "PurchaseReceipt", "label": "Purchase Receipt" + }, + { + "value": "PricingRule", + "label": "Pricing Rule" } ], "default": "-", diff --git a/schemas/app/PricingRule.json b/schemas/app/PricingRule.json new file mode 100644 index 00000000..552e7cbe --- /dev/null +++ b/schemas/app/PricingRule.json @@ -0,0 +1,242 @@ +{ + "name": "PricingRule", + "label": "Pricing Rule", + "naming": "numberSeries", + "isSubmittable": false, + "fields": [ + { + "fieldname": "numberSeries", + "label": "Number Series", + "fieldtype": "Link", + "target": "NumberSeries", + "create": true, + "required": true, + "default": "PRLE-", + "section": "Default" + }, + { + "fieldname": "isEnabled", + "label": "Is Pricing Rule Enabled", + "fieldtype": "Check", + "default": true, + "section": "Default" + }, + { + "fieldname": "title", + "label": "Title", + "fieldtype": "Data", + "required": true, + "section": "Default" + }, + { + "fieldname": "appliedItems", + "label": "Applied Items", + "fieldtype": "Table", + "target": "PricingRuleItem", + "required": true, + "edit": true, + "section": "Items" + }, + { + "fieldname": "discountType", + "label": "Discount Type", + "fieldtype": "Select", + "required": true, + "section": "Default", + "options": [ + { + "value": "Price Discount", + "label": "Price Discount" + }, + { + "value": "Product Discount", + "label": "Product Discount" + } + ] + }, + { + "fieldname": "priceDiscountType", + "label": "Price Discount Type", + "fieldtype": "Select", + "section": "Price Discount Scheme", + "options": [ + { + "value": "rate", + "label": "Rate" + }, + { + "value": "percentage", + "label": "Discount Percentage" + }, + { + "value": "amount", + "label": "Discount Amount" + } + ] + }, + { + "fieldname": "discountRate", + "label": "Rate", + "fieldtype": "Currency", + "section": "Price Discount Scheme" + }, + { + "fieldname": "discountPercentage", + "label": "Discount Percentage", + "fieldtype": "Float", + "section": "Price Discount Scheme" + }, + { + "fieldname": "discountAmount", + "label": "Discount Amount", + "fieldtype": "Currency", + "section": "Price Discount Scheme" + }, + { + "fieldname": "forPriceList", + "label": "For Price List", + "fieldtype": "Link", + "target": "PriceList", + "section": "Price Discount Scheme" + }, + { + "fieldname": "freeItem", + "label": "Free Item", + "fieldtype": "Link", + "target": "Item", + "section": "Product Discount Scheme" + }, + { + "fieldname": "freeItemQuantity", + "label": "Quantity", + "fieldtype": "Float", + "section": "Product Discount Scheme" + }, + { + "fieldname": "freeItemUnit", + "label": "UOM", + "fieldtype": "Link", + "target": "UOM", + "section": "Product Discount Scheme" + }, + { + "fieldname": "freeItemRate", + "label": "Rate", + "fieldtype": "Currency", + "section": "Product Discount Scheme" + }, + { + "fieldname": "roundFreeItemQty", + "label": "Round Free Item Quantity", + "fieldtype": "Check", + "default": false, + "section": "Product Discount Scheme" + }, + { + "fieldname": "roundingMethod", + "label": "Rounding Method", + "fieldtype": "Select", + "required": true, + "default": "round", + "section": "Product Discount Scheme", + "options": [ + { + "value": "floor", + "label": "Floor" + }, + { + "value": "round", + "label": "Round" + }, + { + "value": "ceil", + "label": "Ceil" + } + ] + }, + { + "fieldname": "isRecursive", + "label": "Is Recursive", + "fieldtype": "Check", + "default": false, + "section": "Product Discount Scheme" + }, + { + "fieldname": "recurseEvery", + "label": "Recurse Every (As Per Transaction UOM)", + "fieldtype": "Float", + "section": "Product Discount Scheme" + }, + { + "fieldname": "minQuantity", + "label": "Min Qty (As Per Stock Unit)", + "fieldtype": "Float", + "section": "Quantity and Amount" + }, + { + "fieldname": "maxQuantity", + "label": "Max Qty (As Per Stock UOM)", + "fieldtype": "Float", + "section": "Quantity and Amount" + }, + { + "fieldname": "minAmount", + "label": "Min Amount", + "fieldtype": "Currency", + "section": "Quantity and Amount" + }, + { + "fieldname": "maxAmount", + "label": "Max Amount", + "fieldtype": "Currency", + "section": "Quantity and Amount" + }, + { + "fieldname": "validFrom", + "label": "Valid From", + "fieldtype": "Date", + "section": "Validity" + }, + { + "fieldname": "validTo", + "label": "Valid To", + "fieldtype": "Date", + "section": "Validity" + }, + { + "fieldname": "thresholdForSuggestion", + "label": "Threshold for Suggestion", + "fieldtype": "Float", + "section": "Threshold and Priority" + }, + { + "fieldname": "priority", + "label": "Priority", + "fieldtype": "Select", + "section": "Threshold and Priority", + "required": true, + "options": [ + { "value": "1", "label": 1 }, + { "value": "2", "label": 2 }, + { "value": "3", "label": 3 }, + { "value": "4", "label": 4 }, + { "value": "5", "label": 5 }, + { "value": "6", "label": 6 }, + { "value": "7", "label": 7 }, + { "value": "8", "label": 8 }, + { "value": "9", "label": 9 }, + { "value": "10", "label": 10 }, + { "value": "11", "label": 11 }, + { "value": "12", "label": 12 }, + { "value": "13", "label": 13 }, + { "value": "14", "label": 14 }, + { "value": "15", "label": 15 }, + { "value": "16", "label": 16 }, + { "value": "17", "label": 17 }, + { "value": "18", "label": 18 }, + { "value": "19", "label": 19 }, + { "value": "20", "label": 20 } + ] + } + ] +} diff --git a/schemas/app/PricingRuleDetail.json b/schemas/app/PricingRuleDetail.json new file mode 100644 index 00000000..febee44e --- /dev/null +++ b/schemas/app/PricingRuleDetail.json @@ -0,0 +1,23 @@ +{ + "name": "PricingRuleDetail", + "label": "Pricing Rule Detail", + "isSingle": false, + "isChild": true, + "fields": [ + { + "label": "Pricing Rule", + "fieldname": "referenceName", + "fieldtype": "Link", + "target": "PricingRule", + "readOnly": true + }, + { + "label": "Item", + "fieldname": "referenceItem", + "fieldtype": "Link", + "target": "Item", + "readOnly": true + } + ], + "tableFields": ["referenceName", "referenceItem"] +} diff --git a/schemas/app/PricingRuleItem.json b/schemas/app/PricingRuleItem.json new file mode 100644 index 00000000..6062bf92 --- /dev/null +++ b/schemas/app/PricingRuleItem.json @@ -0,0 +1,25 @@ +{ + "name": "PricingRuleItem", + "label": "Pricing Rule Item", + "isChild": true, + "fields": [ + { + "fieldname": "item", + "label": "Item", + "fieldtype": "Link", + "target": "Item", + "required": true + }, + { + "fieldname": "unit", + "label": "Unit Type", + "placeholder": "Unit Type", + "fieldtype": "Link", + "target": "UOM", + "create": true, + "section": "Default" + } + ], + "tableFields": ["item", "unit"], + "quickEditFields": ["item", "unit"] +} diff --git a/schemas/app/SalesInvoice.json b/schemas/app/SalesInvoice.json index 84e0dfd0..9b8de0fc 100644 --- a/schemas/app/SalesInvoice.json +++ b/schemas/app/SalesInvoice.json @@ -75,6 +75,21 @@ "fieldtype": "Check", "default": false, "hidden": true + }, + { + "fieldname": "isPricingRuleApplied", + "fieldtype": "Check", + "default": false, + "hidden": true + }, + { + "fieldname": "pricingRuleDetail", + "fieldtype": "Table", + "label": "Pricing Rule Detail", + "target": "PricingRuleDetail", + "edit": false, + "readOnly": true, + "section": "References" } ], "keywordFields": ["name", "party"] diff --git a/schemas/app/SalesInvoiceItem.json b/schemas/app/SalesInvoiceItem.json index bff7b705..6e8e26d1 100644 --- a/schemas/app/SalesInvoiceItem.json +++ b/schemas/app/SalesInvoiceItem.json @@ -1,5 +1,19 @@ { "name": "SalesInvoiceItem", "label": "Sales Invoice Item", - "extends": "InvoiceItem" + "extends": "InvoiceItem", + "fields": [ + { + "fieldname": "isFreeItem", + "fieldtype": "Check", + "default": false, + "hidden": true + }, + { + "fieldname": "isPricingRuleAppliedItem", + "fieldtype": "Check", + "default": false, + "hidden": true + } + ] }