Returns full details of the logic, including all sub-elements.
Information: The
id
is thetypedId
without the F suffix. For example, theid
attribute of the logic withtypedId
= 2147484823.F is 2147484823.
Required Permission | Roles with the Required Permission |
---|---|
PRICINGFORMULA_FETCH | Administer Policy Records (PO_MODELRECORDS_ADMIN ), Manage PA Calculation Logics (PA_FORMULAS ), Manage Plans Calculation Logics (DP_FORMULAS ), Manage Contracts Calculation Logics (CM_FORMULAS ), Manage Rebate Agreement Templates (RM_RAT ), Administer PriceOptimizer (PO_MANAGER ), Investigate for Support (SUPPORT ), Administer Plasma (PLASMA ), Manage PromotionManager (CM_CONTRACTMANAGER ), Administer RebateManager (RM_REBATEMANAGER ), Administer QuoteConfigurator (PRICESHOP_QUOTEADMIN ), Administer Plans (DP_PLANS_ADMIN ), Manage Calculation Logics (PB_FORMULAS ), Manage Claims (CLM_CLAIMMANAGER ), Manage Rebate Calculation Logics (RM_FORMULAS ) |
OK
{- "response": {
- "node": "<node>",
- "csrfToken": "<token>",
- "data": [
- {
- "version": 1,
- "typedId": "2147484839.F",
- "uniqueName": "QuoteLogic",
- "label": "QuoteLogic",
- "validAfter": "2021-07-13",
- "status": "ACTIVE",
- "simulationSet": null,
- "userGroupEdit": null,
- "userGroupViewDetails": null,
- "formulaNature": null,
- "lastUpdateByName": "admin",
- "elements": [
- {
- "version": 1,
- "typedId": "2147494046.FE",
- "elementName": "DeclareInputParameters",
- "elementLabel": "DeclareInputParameters",
- "elementDescription": null,
- "elementGroups": [ ],
- "conditionElementName": null,
- "hideWarnings": false,
- "excludeFromExport": false,
- "protectedExpression": false,
- "elementTimeout": 0,
- "displayOptions": 0,
- "formatType": null,
- "elementSuffix": null,
- "allowOverride": false,
- "summarize": false,
- "hideOnNull": false,
- "userGroup": null,
- "cssProperties": null,
- "resultGroup": null,
- "combinationType": "FUNCTION",
- "criticalAlert": null,
- "redAlert": null,
- "yellowAlert": null,
- "labelTranslations": null,
- "createDate": "2021-11-04T14:56:13",
- "createdBy": 2147490696,
- "lastUpdateDate": "2021-11-04T14:56:13",
- "lastUpdateBy": 2147490696,
- "formulaExpression": "if(api.isSyntaxCheck()){\r\n api.integerUserEntry(\"Quantity\")\r\n def quantityParam = api.getParameter(\"Quantity\")\r\n quantityParam.setLabel(\"Required Quantity\")\r\n quantityParam.setRequired(true)\r\n\r\n quantityParam.setConfigParameter(\"inputType\", \"range\")\r\n quantityParam.setConfigParameter(\"from\", 1)\r\n\r\n api.userEntry(\"SalesDiscountPct\")\r\n def discountParam = api.getParameter(\"SalesDiscountPct\")\r\n discountParam.setLabel(\"Sales Discount (%)\")\r\n discountParam.setRequired(false)\r\n discountParam.setValue(0)\r\n discountParam.setConfigParameter(\"formatType\", \"PERCENT\")\r\n\r\n discountParam.setConfigParameter(\"inputType\", \"range\")\r\n discountParam.setConfigParameter(\"from\", 0)\r\n discountParam.setConfigParameter(\"to\", 1)\r\n\r\n\r\n api.abortCalculation()\r\n}"
}, - {
- "version": 1,
- "typedId": "2147494047.FE",
- "elementName": "Quantity",
- "elementLabel": "Quantity",
- "elementDescription": null,
- "elementGroups": [ ],
- "conditionElementName": null,
- "hideWarnings": false,
- "excludeFromExport": false,
- "protectedExpression": false,
- "elementTimeout": 0,
- "displayOptions": 18,
- "formatType": "INTEGER",
- "elementSuffix": null,
- "allowOverride": false,
- "summarize": false,
- "hideOnNull": false,
- "userGroup": null,
- "cssProperties": null,
- "resultGroup": null,
- "combinationType": "FUNCTION",
- "criticalAlert": null,
- "redAlert": null,
- "yellowAlert": null,
- "labelTranslations": null,
- "createDate": "2021-11-04T14:56:13",
- "createdBy": 2147490696,
- "lastUpdateDate": "2021-11-04T14:56:13",
- "lastUpdateBy": 2147490696,
- "formulaExpression": "return input.Quantity"
}, - {
- "version": 1,
- "typedId": "2147494048.FE",
- "elementName": "SalesDiscountPct",
- "elementLabel": "Sales Discount %",
- "elementDescription": null,
- "elementGroups": [ ],
- "conditionElementName": null,
- "hideWarnings": false,
- "excludeFromExport": false,
- "protectedExpression": false,
- "elementTimeout": 0,
- "displayOptions": 2,
- "formatType": "PERCENT",
- "elementSuffix": null,
- "allowOverride": false,
- "summarize": false,
- "hideOnNull": false,
- "userGroup": null,
- "cssProperties": null,
- "resultGroup": null,
- "combinationType": "FUNCTION",
- "criticalAlert": null,
- "redAlert": null,
- "yellowAlert": null,
- "labelTranslations": null,
- "createDate": "2021-11-04T14:56:13",
- "createdBy": 2147490696,
- "lastUpdateDate": "2021-11-04T14:56:13",
- "lastUpdateBy": 2147490696,
- "formulaExpression": "return input.SalesDiscountPct?:0.0"
}, - {
- "version": 1,
- "typedId": "2147494049.FE",
- "elementName": "ListPrice",
- "elementLabel": "List Price",
- "elementDescription": null,
- "elementGroups": [ ],
- "conditionElementName": null,
- "hideWarnings": false,
- "excludeFromExport": false,
- "protectedExpression": false,
- "elementTimeout": 0,
- "displayOptions": 16,
- "formatType": "MONEY_EUR",
- "elementSuffix": null,
- "allowOverride": false,
- "summarize": false,
- "hideOnNull": false,
- "userGroup": null,
- "cssProperties": null,
- "resultGroup": null,
- "combinationType": "FUNCTION",
- "criticalAlert": null,
- "redAlert": null,
- "yellowAlert": null,
- "labelTranslations": null,
- "createDate": "2021-11-04T14:56:13",
- "createdBy": 2147490696,
- "lastUpdateDate": "2021-11-04T14:56:13",
- "lastUpdateBy": 2147490696,
- "formulaExpression": "return api.pricelist(\"GlobalPriceList\")"
}, - {
- "version": 1,
- "typedId": "2147494050.FE",
- "elementName": "SalesDiscountAbs",
- "elementLabel": "Sales Discount EUR",
- "elementDescription": null,
- "elementGroups": [ ],
- "conditionElementName": null,
- "hideWarnings": false,
- "excludeFromExport": false,
- "protectedExpression": false,
- "elementTimeout": 0,
- "displayOptions": 18,
- "formatType": "MONEY_EUR",
- "elementSuffix": null,
- "allowOverride": false,
- "summarize": false,
- "hideOnNull": false,
- "userGroup": null,
- "cssProperties": null,
- "resultGroup": null,
- "combinationType": "FUNCTION",
- "criticalAlert": null,
- "redAlert": null,
- "yellowAlert": null,
- "labelTranslations": null,
- "createDate": "2021-11-04T14:56:13",
- "createdBy": 2147490696,
- "lastUpdateDate": "2021-11-04T14:56:13",
- "lastUpdateBy": 2147490696,
- "formulaExpression": "if (out.ListPrice == null ||\r\nout.SalesDiscountPct == null) {\r\n api.addWarning(\"Sales Discount cannot be calculated: missing parameter(s)\")\r\n return null\r\n}\r\n\r\nreturn out.ListPrice * out.SalesDiscountPct"
}, - {
- "version": 1,
- "typedId": "2147494051.FE",
- "elementName": "FreightSurcharge",
- "elementLabel": "Freight Surcharge",
- "elementDescription": null,
- "elementGroups": [ ],
- "conditionElementName": null,
- "hideWarnings": false,
- "excludeFromExport": false,
- "protectedExpression": false,
- "elementTimeout": 0,
- "displayOptions": 2,
- "formatType": "MONEY_EUR",
- "elementSuffix": null,
- "allowOverride": false,
- "summarize": false,
- "hideOnNull": false,
- "userGroup": null,
- "cssProperties": null,
- "resultGroup": null,
- "combinationType": "FUNCTION",
- "criticalAlert": null,
- "redAlert": null,
- "yellowAlert": null,
- "labelTranslations": null,
- "createDate": "2021-11-04T14:56:13",
- "createdBy": 2147490696,
- "lastUpdateDate": "2021-11-04T14:56:13",
- "lastUpdateBy": 2147490696,
- "formulaExpression": "if(api.isDebugMode()) {\r\n input.Customer = \"CD-00004\"\r\n input.DeliveryType = \"Standard\"\r\n}\r\n\r\ndef country = api.customer(\"Country\", input.Customer)\r\n\r\ndef keys = [\r\n \"Country\": country,\r\n \"DeliveryType\": input.DeliveryType\r\n]\r\n\r\nreturn api.vLookup(\"FreightSurcharge\", \"FreightSurcharge\", keys)"
}, - {
- "version": 1,
- "typedId": "2147494052.FE",
- "elementName": "InvoicePrice",
- "elementLabel": "Invoice Price",
- "elementDescription": null,
- "elementGroups": [ ],
- "conditionElementName": null,
- "hideWarnings": false,
- "excludeFromExport": false,
- "protectedExpression": false,
- "elementTimeout": 0,
- "displayOptions": 18,
- "formatType": "MONEY_EUR",
- "elementSuffix": null,
- "allowOverride": false,
- "summarize": false,
- "hideOnNull": false,
- "userGroup": null,
- "cssProperties": null,
- "resultGroup": null,
- "combinationType": "FUNCTION",
- "criticalAlert": null,
- "redAlert": null,
- "yellowAlert": null,
- "labelTranslations": null,
- "createDate": "2021-11-04T14:56:13",
- "createdBy": 2147490696,
- "lastUpdateDate": "2021-11-04T14:56:13",
- "lastUpdateBy": 2147490696,
- "formulaExpression": "if (out.ListPrice == null ||\r\nout.SalesDiscountAbs == null) {\r\n api.addWarning(\"InvoicePrice cannot be calculated: missing parameter(s)\")\r\n return null\r\n}\r\n\r\nreturn out.ListPrice - out.SalesDiscountAbs"
}, - {
- "version": 1,
- "typedId": "2147494053.FE",
- "elementName": "TotalInvoicePrice",
- "elementLabel": "Total Invoice Price",
- "elementDescription": null,
- "elementGroups": [ ],
- "conditionElementName": null,
- "hideWarnings": false,
- "excludeFromExport": false,
- "protectedExpression": false,
- "elementTimeout": 0,
- "displayOptions": 18,
- "formatType": "MONEY_EUR",
- "elementSuffix": null,
- "allowOverride": false,
- "summarize": false,
- "hideOnNull": false,
- "userGroup": null,
- "cssProperties": null,
- "resultGroup": null,
- "combinationType": "FUNCTION",
- "criticalAlert": null,
- "redAlert": null,
- "yellowAlert": null,
- "labelTranslations": null,
- "createDate": "2021-11-04T14:56:13",
- "createdBy": 2147490696,
- "lastUpdateDate": "2021-11-04T14:56:13",
- "lastUpdateBy": 2147490696,
- "formulaExpression": "if (out.InvoicePrice == null\r\n || out.Quantity == null\r\n || out.FreightSurcharge == null) {\r\n api.addWarning(\"Total Invoice Price cannot be calculated: missing parameter(s)\")\r\n return null\r\n}\r\n\r\nreturn out.InvoicePrice * out.Quantity + out.FreightSurcharge"
}, - {
- "version": 1,
- "typedId": "2147494054.FE",
- "elementName": "Cost",
- "elementLabel": "Cost",
- "elementDescription": null,
- "elementGroups": [ ],
- "conditionElementName": null,
- "hideWarnings": false,
- "excludeFromExport": false,
- "protectedExpression": false,
- "elementTimeout": 0,
- "displayOptions": 18,
- "formatType": "MONEY_EUR",
- "elementSuffix": null,
- "allowOverride": false,
- "summarize": false,
- "hideOnNull": false,
- "userGroup": null,
- "cssProperties": null,
- "resultGroup": null,
- "combinationType": "FUNCTION",
- "criticalAlert": null,
- "redAlert": null,
- "yellowAlert": null,
- "labelTranslations": null,
- "createDate": "2021-11-04T14:56:13",
- "createdBy": 2147490696,
- "lastUpdateDate": "2021-11-04T14:56:13",
- "lastUpdateBy": 2147490696,
- "formulaExpression": "return cost = (api.productExtension(\"ProductCost\")?:null)?.first()?.attribute1"
}, - {
- "version": 1,
- "typedId": "2147494055.FE",
- "elementName": "PocketMarginAbs",
- "elementLabel": "Pocket Margin EUR",
- "elementDescription": null,
- "elementGroups": [ ],
- "conditionElementName": null,
- "hideWarnings": false,
- "excludeFromExport": false,
- "protectedExpression": false,
- "elementTimeout": 0,
- "displayOptions": 18,
- "formatType": "MONEY_EUR",
- "elementSuffix": null,
- "allowOverride": false,
- "summarize": false,
- "hideOnNull": false,
- "userGroup": null,
- "cssProperties": null,
- "resultGroup": null,
- "combinationType": "FUNCTION",
- "criticalAlert": null,
- "redAlert": null,
- "yellowAlert": null,
- "labelTranslations": null,
- "createDate": "2021-11-04T14:56:13",
- "createdBy": 2147490696,
- "lastUpdateDate": "2021-11-04T14:56:13",
- "lastUpdateBy": 2147490696,
- "formulaExpression": "if (out.InvoicePrice == null\r\n || out.Cost == null) {\r\n api.addWarning(\"Pocket Margin cannot be calculated: missing parameter(s)\")\r\n return null\r\n}\r\n\r\nreturn out.InvoicePrice - out.Cost"
}, - {
- "version": 1,
- "typedId": "2147494056.FE",
- "elementName": "PocketMarginPct",
- "elementLabel": "Pocket Margin %",
- "elementDescription": null,
- "elementGroups": [ ],
- "conditionElementName": null,
- "hideWarnings": false,
- "excludeFromExport": false,
- "protectedExpression": false,
- "elementTimeout": 0,
- "displayOptions": 18,
- "formatType": "MONEY_EUR",
- "elementSuffix": null,
- "allowOverride": false,
- "summarize": false,
- "hideOnNull": false,
- "userGroup": null,
- "cssProperties": null,
- "resultGroup": null,
- "combinationType": "FUNCTION",
- "criticalAlert": null,
- "redAlert": null,
- "yellowAlert": null,
- "labelTranslations": null,
- "createDate": "2021-11-04T14:56:13",
- "createdBy": 2147490696,
- "lastUpdateDate": "2021-11-04T14:56:13",
- "lastUpdateBy": 2147490696,
- "formulaExpression": "if (out.PocketMarginAbs == null\r\n || out.ListPrice == null) {\r\n api.addWarning(\"Pocket Margin % cannot be calculated: missing parameter(s)\")\r\n return null\r\n}\r\n\r\nif (out.ListPrice == 0) {\r\n api.addWarning(\"List Price is 0, which means that Pocket Margin cannot be \" +\r\n \"calculated, since this would lead to division by 0\")\r\n return null\r\n}\r\n\r\n\r\ndef pocketMarginPct = out.PocketMarginAbs / out.ListPrice\r\n\r\nString productGroup = api.product(\"ProductGroup\")\r\nString thresholdTableName = \"PocketMarginAlertThreshold\"\r\ndef yellowThreshold = api.vLookup(thresholdTableName, \"Threshold\", productGroup, \"Yellow\")\r\ndef redThreshold = api.vLookup(thresholdTableName, \"Threshold\", productGroup, \"Red\")\r\ndef criticalThreshold = api.vLookup(thresholdTableName, \"Threshold\", productGroup, \"Critical\")\r\n\r\nif (criticalThreshold && pocketMarginPct < criticalThreshold) {\r\n api.criticalAlert(\"Pocket Margin % is unacceptable low\")\r\n}\r\nelse if (redThreshold && pocketMarginPct < redThreshold){\r\n api.redAlert(\"Pocket Margin % is very low\")\r\n}\r\nelse if (yellowThreshold && pocketMarginPct < yellowThreshold) {\r\n api.yellowAlert(\"Pocket Margin % is low\")\r\n}\r\n\r\nreturn pocketMarginPct"
}
], - "inputDescriptors": [ ],
- "formulaType": "PRICING",
- "createdByName": null,
- "createDate": "2021-11-04T14:56:12",
- "createdBy": 2147490696,
- "lastUpdateDate": "2021-11-04T14:56:13",
- "lastUpdateBy": 2147490696
}
], - "status": 0
}
}