Skip to content

Instantly share code, notes, and snippets.

@nuclearglow
Last active April 25, 2022 19:06
Show Gist options
  • Save nuclearglow/026d64b2e6d247982e576cf56775aa90 to your computer and use it in GitHub Desktop.
Save nuclearglow/026d64b2e6d247982e576cf56775aa90 to your computer and use it in GitHub Desktop.
vscode-settings-sync
{"version":1,"resource":"file:///home/nuky/workspace/application/appserver/src/runtime/uiEngine/__tests__/uienginev3.spec.ts","entries":[{"id":"tc4Z.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650372563334},{"id":"xVgr.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650373365402},{"id":"TXTD.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650373391203},{"id":"I4Ze.ts","timestamp":1650375842181},{"id":"dJDC.ts","timestamp":1650375879715},{"id":"7Qo2.ts","timestamp":1650375902945},{"id":"sNXC.ts","timestamp":1650375947275},{"id":"Cf6g.ts","timestamp":1650375973805},{"id":"uy9R.ts","timestamp":1650375991510},{"id":"tCHj.ts","timestamp":1650376010063},{"id":"OGEq.ts","timestamp":1650382238870},{"id":"Ol3S.ts","timestamp":1650382289794},{"id":"KMkg.ts","timestamp":1650382306407},{"id":"58at.ts","timestamp":1650382342093},{"id":"aHFv.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650382408517},{"id":"uZzv.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650382520087},{"id":"gbjL.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650382554625},{"id":"4jV4.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650382613773},{"id":"S8vf.ts","timestamp":1650382620125},{"id":"XVkA.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650382649007},{"id":"1i7F.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650382753289},{"id":"G3ZB.ts","timestamp":1650382765866},{"id":"E6yn.ts","timestamp":1650382794704},{"id":"cLrp.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650382843899},{"id":"sH42.ts","timestamp":1650382870540},{"id":"jO5i.ts","timestamp":1650382925492},{"id":"xcMB.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650382956741},{"id":"BP0Q.ts","timestamp":1650382960022},{"id":"OxJZ.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650382969822},{"id":"SWmB.ts","timestamp":1650383015645},{"id":"nn41.ts","timestamp":1650383048927},{"id":"xRHI.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650383075616},{"id":"r7SQ.ts","timestamp":1650393638633},{"id":"Dgmv.ts","timestamp":1650393657498},{"id":"cuau.ts","timestamp":1650393695673},{"id":"5NrO.ts","timestamp":1650393721238},{"id":"1hyG.ts","timestamp":1650393761608},{"id":"TQmM.ts","timestamp":1650393798823},{"id":"p74H.ts","timestamp":1650393853038},{"id":"xR4l.ts","timestamp":1650393867191},{"id":"bbFO.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650393915706},{"id":"PoQT.ts","timestamp":1650393944395},{"id":"KNqd.ts","timestamp":1650394007259},{"id":"0YbV.ts","timestamp":1650394038521},{"id":"Musi.ts","timestamp":1650394076623},{"id":"SbPm.ts","timestamp":1650394099216},{"id":"6hoK.ts","timestamp":1650394116357},{"id":"kMVc.ts","timestamp":1650394141907},{"id":"PUyw.ts","timestamp":1650394167728},{"id":"OqnC.ts","timestamp":1650394183717}]}
{"version":1,"resource":"file:///home/nuky/workspace/content/rep/everest.fin.accounting/uinext/businessPartnerCreate.uitemplate.json","entries":[{"id":"wW9o.json","source":"Workspace Edit","timestamp":1650470414203}]}
{
"version": 2,
"uiview": {
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"uiModelName": "everest.fin.accounting/ui/accounting",
"title": "{{businessPartner.title}}",
"tabTitle": "{{businessPartner.title}}",
"actions": [
{
"align": "right",
"label": "{{businessPartner.apply}}",
"variant": "primary",
"onClick": "@controller:handleSubmit",
"disabled": "@controller:isFormDisabled()"
}
],
"sections": [
{
"size": "12",
"component": "Icons",
"draftEnabled": true
},
{
"component": "Block",
"size": "12",
"type": "secondary",
"elements": [
{
"action": "create",
"isEditing": true,
"absoluteBOName": "everest.fin.accounting/view/BusinessPartnerViewModel",
"value": "@binding:businessPartner.businessPartnerName"
},
{
"action": "create",
"isEditing": true,
"value": "@binding:businessPartner.businessPartnerType"
},
{
"action": "create",
"isEditing": true,
"value": "@binding:businessPartner.intercompanyPartner"
},
{
"action": "create",
"isEditing": true,
"value": "@binding:businessPartner.billingEmail"
},
{
"action": "create",
"isEditing": true,
"value": "@binding:businessPartner.mainContactEmail"
},
{
"action": "create",
"isEditing": true,
"value": "@binding:businessPartner.additionalContactEmail"
},
{
"action": "create",
"isEditing": true,
"value": "@binding:businessPartner.preferredLanguage"
}
]
},
{
"component": "Block",
"size": "6",
"type": "secondary",
"elements": [
{
"component": "MultiValue",
"action": "create",
"label": "{{businessPartner.billingAddress}}",
"isEditing": true,
"elements": [
{
"placeholder": "{{businessPartner.attention}}",
"isEditing": true,
"value": "@binding:businessPartner.billingAddressAttention",
"onChange": "@controller:setShippingAddressField('Attention')"
},
{
"placeholder": "{{businessPartner.line1}}",
"isEditing": true,
"value": "@binding:businessPartner.billingAddressLine1",
"onChange": "@controller:setShippingAddressField('Line1')"
},
{
"placeholder": "{{businessPartner.line2}}",
"isEditing": true,
"value": "@binding:businessPartner.billingAddressLine2",
"onChange": "@controller:setShippingAddressField('Line2')"
},
{
"placeholder": "{{businessPartner.city}}",
"isEditing": true,
"value": "@binding:businessPartner.billingAddressCity",
"onChange": "@controller:setShippingAddressField('City')"
},
{
"placeholder": "{{businessPartner.zipCode}}",
"isEditing": true,
"size": "8",
"value": "@binding:businessPartner.billingAddressZipCode",
"onChange": "@controller:setShippingAddressField('ZipCode')"
},
{
"placeholder": "{{businessPartner.stateProvince}}",
"isEditing": true,
"size": "4",
"value": "@binding:businessPartner.billingAddressStateProvince",
"onChange": "@controller:setShippingAddressField('StateProvince')"
},
{
"placeholder": "{{businessPartner.country}}",
"isEditing": true,
"value": "@binding:businessPartner.billingAddressCountry",
"onChange": "@controller:setShippingAddressField('Country')"
}
]
}
]
},
{
"component": "Block",
"size": "6",
"type": "secondary",
"elements": [
{
"component": "MultiValue",
"action": "create",
"label": "{{businessPartner.shippingAddress}}",
"isEditing": true,
"isDisabled": "@controller:isSameAsBillingAddress()",
"customAction": {
"isVisible": true,
"checkbox": {
"component": "Checkbox",
"isEditing": true,
"text": "{{businessPartner.sameAsBillingAddress}}",
"name": "sameAsBillingAddress",
"onChange": "@controller:handleSameAsBillingAddressChange"
}
},
"elements": [
{
"placeholder": "{{businessPartner.attention}}",
"isEditing": true,
"value": "@binding:businessPartner.shippingAddressAttention"
},
{
"placeholder": "{{businessPartner.line1}}",
"isEditing": true,
"value": "@binding:businessPartner.shippingAddressLine1"
},
{
"placeholder": "{{businessPartner.line2}}",
"isEditing": true,
"value": "@binding:businessPartner.shippingAddressLine2"
},
{
"placeholder": "{{businessPartner.city}}",
"isEditing": true,
"value": "@binding:businessPartner.shippingAddressCity"
},
{
"placeholder": "{{businessPartner.zipCode}}",
"isEditing": true,
"size": "8",
"value": "@binding:businessPartner.shippingAddressZipCode"
},
{
"placeholder": "{{businessPartner.stateProvince}}",
"isEditing": true,
"size": "4",
"value": "@binding:businessPartner.shippingAddressStateProvince"
},
{
"placeholder": "{{businessPartner.country}}",
"isEditing": true,
"value": "@binding:businessPartner.shippingAddressCountry"
}
]
}
]
}
]
},
"uimodel": {
"nodes": {
"businessPartner": {
"type": "struct",
"modelId": "everest.fin.accounting/view/BusinessPartnerViewModel.BusinessPartnerView"
}
}
},
"uicontroller": "businessPartnerCreate.uicontroller.js"
}
{"version":1,"resource":"file:///home/nuky/workspace/rest/bogodev/uiengine/bogo_uimodel_custom_query_sal.yml","entries":[{"id":"9ieU.yml","timestamp":1650657955707},{"id":"iLDI.yml","timestamp":1650659696183}]}
{"version":1,"resource":"file:///home/nuky/.functions","entries":[{"id":"CrXU","timestamp":1649193939854},{"id":"yN5U","timestamp":1649194019908},{"id":"edyG","timestamp":1649194130995},{"id":"NWsA","timestamp":1649194176816},{"id":"NO3Q","timestamp":1649194513933},{"id":"iXWx","timestamp":1650827003534}]}
{"version":1,"resource":"file:///home/nuky/workspace/application/appserver/src/setupTestProvider.ts","entries":[{"id":"AL9x.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1649351539449}]}
{"version":1,"resource":"file:///home/nuky/workspace/application/docs/rfcs/next-gen-uicontroller/samples/sales-arrangement-example/next-gen/example_uimodel_multiple_queries_response.jsonc","entries":[{"id":"qh8Y.jsonc","timestamp":1649421638092}]}
{"version":1,"resource":"file:///home/nuky/workspace/application/packages/content-core/src/uiEngine/index.ts","entries":[{"id":"5ZLg.ts","timestamp":1650371202649},{"id":"zvPp.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650371452716}]}
{"version":1,"resource":"file:///home/nuky/workspace/application/docs/rfcs/next-gen-uicontroller/samples/sales-arrangement-example/next-gen/example_uimodel_multiple_queries_request.jsonc","entries":[{"id":"JkWE.jsonc","timestamp":1649421598455}]}
{"version":1,"resource":"file:///home/nuky/workspace/application/docs/rfcs/next-gen-uicontroller/samples/sales-arrangement-example/next-gen/example_uimodel_query_request.jsonc","entries":[{"id":"KL5r.jsonc","timestamp":1649421415518},{"id":"mPrT.jsonc","timestamp":1649421490676}]}
{"version":1,"resource":"file:///home/nuky/workspace/application/docs/rfcs/next-gen-uicontroller/samples/sales-arrangement-example/next-gen/example_uimodel_query_response.jsonc","entries":[{"id":"mYd5.jsonc","timestamp":1649421529333}]}
{
"version": 2,
"uicontroller": "salesArrangement.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangementProducts",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModels",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "salesArrangementPriceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"status": "@binding:salesArrangement.salesArrangementStatus",
"subtitle": "@binding:salesArrangement.salesArrangementNumber"
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"subtitle": "@binding:salesArrangement.totalAmount",
"isDisabled": "@controller:isCreationMode()",
"onClick": "@controller:setActiveSegment(1)",
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"isDisabled": "@controller:isOrderDetailsDisabled()",
"onCollapseClick": "@controller:changeDetailsCollapsedState()",
"isVisible": "@controller:isDetailsCollapsedVisible()",
"collapsed": "@controller:isDetailsCollapsedCollapsed()",
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"id": "@binding:salesArrangement.businessPartnerId"
}
},
"value": "@binding:salesArrangement.businessPartnerId",
"list": "@binding:salesArrangement",
"text": "@binding:salesArrangement.businessPartnerName",
"modelId": "@binding:salesArrangement.id"
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"value": "@binding:salesArrangement.businessPartnerNumber"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"value": "@controller:getCompleteBillingAddress()"
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.mainContactEmail"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.billingEmail"
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"value": "@binding:salesArrangement.totalAmount"
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"value": "@binding:salesArrangement.totalAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"value": "@binding:salesArrangement.invoicedAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"value": "@binding:salesArrangement.revenueRecognizedTotal",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"value": "@binding:salesArrangement.remainingPerformanceObligation",
"parseAs": "currency"
}
]
},
{
"component": "Block",
"size": "11",
"title": "testing",
"isVisible": "@controller:isActiveSegment(1)",
"collapsible": true,
"elements": []
}
]
}
]
}
]
}
}
{
"version": 2,
"uicontroller": "salesArrangement.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangementProducts",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModels",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "salesArrangementPriceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"status": "@binding:salesArrangement.salesArrangementStatus",
"subtitle": "@binding:salesArrangement.salesArrangementNumber",
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"subtitle": "@binding:salesArrangement.totalAmount",
"isDisabled": "@controller:isCreationMode()",
"onClick": "@controller:setActiveSegment(1)",
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"isDisabled": "@controller:isOrderDetailsDisabled()",
"onCollapseClick": "@controller:changeDetailsCollapsedState()",
"isVisible": "@controller:isDetailsCollapsedVisible()",
"collapsed": "@controller:isDetailsCollapsedCollapsed()",
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"id": "@binding:salesArrangement.businessPartnerId"
}
},
"value": "@binding:salesArrangement.businessPartnerId",
"list": "@binding:salesArrangement",
"text": "@binding:salesArrangement.businessPartnerName",
"modelId": "@binding:salesArrangement.id"
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"value": "@binding:salesArrangement.businessPartnerNumber"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"value": "@controller:getCompleteBillingAddress()"
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.mainContactEmail"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.billingEmail"
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"value": "@binding:salesArrangement.totalAmount"
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"value": "@binding:salesArrangement.totalAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"value": "@binding:salesArrangement.invoicedAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"value": "@binding:salesArrangement.revenueRecognizedTotal",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"value": "@binding:salesArrangement.remainingPerformanceObligation",
"parseAs": "currency"
}
]
},
{
"component": "Block",
"size": "11",
"title": "testing",
"isVisible": "@controller:isActiveSegment(1)",
"collapsible": true,
"elements": []
}
]
}
]
}
]
}
}
{
"version": 2,
"uicontroller": "salesArrangementNext.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangementProducts",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModels",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "salesArrangementPriceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"uiModelBinding": {
"status": "SalesArrangement.salesArrangementStatus",
"subtitle": "SalesArrangement.salesArrangementNumber"
}
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"subtitle": "@binding:salesArrangement.totalAmount",
"isDisabled": "@controller:isCreationMode()",
"onClick": "@controller:setActiveSegment(1)",
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"isDisabled": "@controller:isOrderDetailsDisabled()",
"onCollapseClick": "@controller:changeDetailsCollapsedState()",
"isVisible": "@controller:isDetailsCollapsedVisible()",
"collapsed": "@controller:isDetailsCollapsedCollapsed()",
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"id": "@binding:salesArrangement.businessPartnerId"
}
},
"value": "@binding:salesArrangement.businessPartnerId",
"list": "@binding:salesArrangement",
"text": "@binding:salesArrangement.businessPartnerName",
"modelId": "@binding:salesArrangement.id"
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"value": "@binding:salesArrangement.businessPartnerNumber"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"value": "@controller:getCompleteBillingAddress()"
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.mainContactEmail"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.billingEmail"
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"value": "@binding:salesArrangement.totalAmount"
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"value": "@binding:salesArrangement.totalAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"value": "@binding:salesArrangement.invoicedAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"value": "@binding:salesArrangement.revenueRecognizedTotal",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"value": "@binding:salesArrangement.remainingPerformanceObligation",
"parseAs": "currency"
}
]
},
{
"component": "Block",
"size": "11",
"title": "testing",
"isVisible": "@controller:isActiveSegment(1)",
"collapsible": true,
"elements": []
}
]
}
]
}
]
}
}
{
"version": 2,
"uicontroller": "salesArrangement.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangementProducts",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModels",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "salesArrangementPriceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"status": "@binding:salesArrangement.salesArrangementStatus",
"subtitle": "@binding:salesArrangement.salesArrangementNumber"
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"subtitle": "@binding:salesArrangement.totalAmount",
"isDisabled": "@controller:isCreationMode()",
"onClick": "@controller:setActiveSegment(1)",
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"isDisabled": "@controller:isOrderDetailsDisabled()",
"onCollapseClick": "@controller:changeDetailsCollapsedState()",
"isVisible": "@controller:isDetailsCollapsedVisible()",
"collapsed": "@controller:isDetailsCollapsedCollapsed()",
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"id": "@binding:salesArrangement.businessPartnerId"
}
},
"value": "@binding:salesArrangement.businessPartnerId",
"list": "@binding:salesArrangement",
"text": "@binding:salesArrangement.businessPartnerName",
"modelId": "@binding:salesArrangement.id"
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"value": "@binding:salesArrangement.businessPartnerNumber"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"value": "@controller:getCompleteBillingAddress()"
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.mainContactEmail"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.billingEmail"
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"value": "@binding:salesArrangement.totalAmount"
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"value": "@binding:salesArrangement.totalAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"value": "@binding:salesArrangement.invoicedAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"value": "@binding:salesArrangement.revenueRecognizedTotal",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"value": "@binding:salesArrangement.remainingPerformanceObligation",
"parseAs": "currency"
}
]
},
{
"component": "Block",
"size": "11",
"title": "testing",
"isVisible": "@controller:isActiveSegment(1)",
"collapsible": true,
"elements": []
}
]
}
]
}
]
}
}
{
"version": 2,
"uicontroller": "salesArrangement.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangementProducts",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModels",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "salesArrangementPriceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"status": "@binding:salesArrangement.salesArrangementStatus",
"subtitle": "@binding:salesArrangement.salesArrangementNumber"
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"subtitle": "@binding:salesArrangement.totalAmount",
"isDisabled": "@controller:isCreationMode()",
"onClick": "@controller:setActiveSegment(1)",
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"isDisabled": "@controller:isOrderDetailsDisabled()",
"onCollapseClick": "@controller:changeDetailsCollapsedState()",
"isVisible": "@controller:isDetailsCollapsedVisible()",
"collapsed": "@controller:isDetailsCollapsedCollapsed()",
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"id": "@binding:salesArrangement.businessPartnerId"
}
},
"value": "@binding:salesArrangement.businessPartnerId",
"list": "@binding:salesArrangement",
"text": "@binding:salesArrangement.businessPartnerName",
"modelId": "@binding:salesArrangement.id"
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"value": "@binding:salesArrangement.businessPartnerNumber"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"value": "@controller:getCompleteBillingAddress()"
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.mainContactEmail"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.billingEmail"
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"value": "@binding:salesArrangement.totalAmount"
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"value": "@binding:salesArrangement.totalAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"value": "@binding:salesArrangement.invoicedAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"value": "@binding:salesArrangement.revenueRecognizedTotal",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"value": "@binding:salesArrangement.remainingPerformanceObligation",
"parseAs": "currency"
}
]
},
{
"component": "Block",
"size": "11",
"title": "testing",
"isVisible": "@controller:isActiveSegment(1)",
"collapsible": true,
"elements": []
}
]
}
]
}
]
}
}
{
"version": 2,
"uicontroller": "salesArrangement.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangementProducts",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModels",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "salesArrangementPriceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"uiModelBinding": {
"status": "SalesArrangement.salesArrangementStatus",
"subtitle": "SalesArrangement.salesArrangementNumber"
}
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"subtitle": "@binding:salesArrangement.totalAmount",
"isDisabled": "@controller:isCreationMode()",
"onClick": "@controller:setActiveSegment(1)",
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"isDisabled": "@controller:isOrderDetailsDisabled()",
"onCollapseClick": "@controller:changeDetailsCollapsedState()",
"isVisible": "@controller:isDetailsCollapsedVisible()",
"collapsed": "@controller:isDetailsCollapsedCollapsed()",
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"id": "@binding:salesArrangement.businessPartnerId"
}
},
"value": "@binding:salesArrangement.businessPartnerId",
"list": "@binding:salesArrangement",
"text": "@binding:salesArrangement.businessPartnerName",
"modelId": "@binding:salesArrangement.id"
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"value": "@binding:salesArrangement.businessPartnerNumber"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"value": "@controller:getCompleteBillingAddress()"
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.mainContactEmail"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.billingEmail"
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"value": "@binding:salesArrangement.totalAmount"
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"value": "@binding:salesArrangement.totalAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"value": "@binding:salesArrangement.invoicedAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"value": "@binding:salesArrangement.revenueRecognizedTotal",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"value": "@binding:salesArrangement.remainingPerformanceObligation",
"parseAs": "currency"
}
]
},
{
"component": "Block",
"size": "11",
"title": "testing",
"isVisible": "@controller:isActiveSegment(1)",
"collapsible": true,
"elements": []
}
]
}
]
}
]
}
}
{
"version": 2,
"uicontroller": "salesArrangement.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangementProducts",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModels",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "salesArrangementPriceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"uiModelBinding": {
"status": "SalesArrangement.salesArrangementStatus",
"subtitle": "SalesArrangement.salesArrangementNumber"
}
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"subtitle": "@binding:salesArrangement.totalAmount",
"isDisabled": "@controller:isCreationMode()",
"onClick": "@controller:setActiveSegment(1)",
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"isDisabled": "@controller:isOrderDetailsDisabled()",
"onCollapseClick": "@controller:changeDetailsCollapsedState()",
"isVisible": "@controller:isDetailsCollapsedVisible()",
"collapsed": "@controller:isDetailsCollapsedCollapsed()",
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"id": "@binding:salesArrangement.businessPartnerId"
}
},
"value": "@binding:salesArrangement.businessPartnerId",
"list": "@binding:salesArrangement",
"text": "@binding:salesArrangement.businessPartnerName",
"modelId": "@binding:salesArrangement.id"
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"value": "@binding:salesArrangement.businessPartnerNumber"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"value": "@controller:getCompleteBillingAddress()"
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.mainContactEmail"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.billingEmail"
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"value": "@binding:salesArrangement.totalAmount"
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"value": "@binding:salesArrangement.totalAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"value": "@binding:salesArrangement.invoicedAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"value": "@binding:salesArrangement.revenueRecognizedTotal",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"value": "@binding:salesArrangement.remainingPerformanceObligation",
"parseAs": "currency"
}
]
},
{
"component": "Block",
"size": "11",
"title": "testing",
"isVisible": "@controller:isActiveSegment(1)",
"collapsible": true,
"elements": []
}
]
}
]
}
]
}
}
{
"version": 2,
"uicontroller": "salesArrangementWRONG.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangementProducts",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModels",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "salesArrangementPriceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"status": {
"value": "@binding:salesArrangement.salesArrangementStatus"
},
"subtitle": "@binding:salesArrangement.salesArrangementNumber"
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"subtitle": "@binding:salesArrangement.totalAmount",
"isDisabled": "@controller:isCreationMode()",
"onClick": "@controller:setActiveSegment(1)",
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"isDisabled": "@controller:isOrderDetailsDisabled()",
"onCollapseClick": "@controller:changeDetailsCollapsedState()",
"isVisible": "@controller:isDetailsCollapsedVisible()",
"collapsed": "@controller:isDetailsCollapsedCollapsed()",
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"id": "@binding:salesArrangement.businessPartnerId"
}
},
"value": "@binding:salesArrangement.businessPartnerId",
"list": "@binding:salesArrangement",
"text": "@binding:salesArrangement.businessPartnerName",
"modelId": "@binding:salesArrangement.id"
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"value": "@binding:salesArrangement.businessPartnerNumber"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"value": "@controller:getCompleteBillingAddress()"
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.mainContactEmail"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.billingEmail"
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"value": "@binding:salesArrangement.totalAmount"
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"value": "@binding:salesArrangement.totalAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"value": "@binding:salesArrangement.invoicedAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"value": "@binding:salesArrangement.revenueRecognizedTotal",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"value": "@binding:salesArrangement.remainingPerformanceObligation",
"parseAs": "currency"
}
]
},
{
"component": "Block",
"size": "11",
"title": "testing",
"isVisible": "@controller:isActiveSegment(1)",
"collapsible": true,
"elements": []
}
]
}
]
}
]
}
}
{
"version": 2,
"uicontroller": "salesArrangement.uicontrollerNext.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangementProducts",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModels",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "salesArrangementPriceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"status": "@binding:salesArrangement.salesArrangementStatus",
"subtitle": "@binding:salesArrangement.salesArrangementNumber"
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"subtitle": "@binding:salesArrangement.totalAmount",
"isDisabled": "@controller:isCreationMode()",
"onClick": "@controller:setActiveSegment(1)",
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"isDisabled": "@controller:isOrderDetailsDisabled()",
"onCollapseClick": "@controller:changeDetailsCollapsedState()",
"isVisible": "@controller:isDetailsCollapsedVisible()",
"collapsed": "@controller:isDetailsCollapsedCollapsed()",
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"id": "@binding:salesArrangement.businessPartnerId"
}
},
"value": "@binding:salesArrangement.businessPartnerId",
"list": "@binding:salesArrangement",
"text": "@binding:salesArrangement.businessPartnerName",
"modelId": "@binding:salesArrangement.id"
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"value": "@binding:salesArrangement.businessPartnerNumber"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"value": "@controller:getCompleteBillingAddress()"
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.mainContactEmail"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.billingEmail"
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"value": "@binding:salesArrangement.totalAmount"
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"value": "@binding:salesArrangement.totalAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"value": "@binding:salesArrangement.invoicedAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"value": "@binding:salesArrangement.revenueRecognizedTotal",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"value": "@binding:salesArrangement.remainingPerformanceObligation",
"parseAs": "currency"
}
]
},
{
"component": "Block",
"size": "11",
"title": "testing",
"isVisible": "@controller:isActiveSegment(1)",
"collapsible": true,
"elements": []
}
]
}
]
}
]
}
}
{
"version": 2,
"uicontroller": "salesArrangementWRONG.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangementProducts",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModels",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "salesArrangementPriceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"status": "@binding:salesArrangement.salesArrangementStatus",
"subtitle": "@binding:salesArrangement.salesArrangementNumber"
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"subtitle": "@binding:salesArrangement.totalAmount",
"isDisabled": "@controller:isCreationMode()",
"onClick": "@controller:setActiveSegment(1)",
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"isDisabled": "@controller:isOrderDetailsDisabled()",
"onCollapseClick": "@controller:changeDetailsCollapsedState()",
"isVisible": "@controller:isDetailsCollapsedVisible()",
"collapsed": "@controller:isDetailsCollapsedCollapsed()",
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"id": "@binding:salesArrangement.businessPartnerId"
}
},
"value": "@binding:salesArrangement.businessPartnerId",
"list": "@binding:salesArrangement",
"text": "@binding:salesArrangement.businessPartnerName",
"modelId": "@binding:salesArrangement.id"
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"value": "@binding:salesArrangement.businessPartnerNumber"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"value": "@controller:getCompleteBillingAddress()"
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.mainContactEmail"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.billingEmail"
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"value": "@binding:salesArrangement.totalAmount"
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"value": "@binding:salesArrangement.totalAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"value": "@binding:salesArrangement.invoicedAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"value": "@binding:salesArrangement.revenueRecognizedTotal",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"value": "@binding:salesArrangement.remainingPerformanceObligation",
"parseAs": "currency"
}
]
},
{
"component": "Block",
"size": "11",
"title": "testing",
"isVisible": "@controller:isActiveSegment(1)",
"collapsible": true,
"elements": []
}
]
}
]
}
]
}
}
{
"version": 2,
"uicontroller": "salesArrangementNext.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangementProducts",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModels",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "salesArrangementPriceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"uiModelBinding": {
"status": "SalesArrangement.salesArrangementStatus",
"subtitle": "SalesArrangement.salesArrangementNumber"
}
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"subtitle": "@binding:salesArrangement.totalAmount",
"isDisabled": "@controller:isCreationMode()",
"onClick": "@controller:setActiveSegment(1)",
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"isDisabled": "@controller:isOrderDetailsDisabled()",
"onCollapseClick": "@controller:changeDetailsCollapsedState()",
"isVisible": "@controller:isDetailsCollapsedVisible()",
"collapsed": "@controller:isDetailsCollapsedCollapsed()",
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"id": "@binding:salesArrangement.businessPartnerId"
}
},
"value": "@binding:salesArrangement.businessPartnerId",
"list": "@binding:salesArrangement",
"text": "@binding:salesArrangement.businessPartnerName",
"modelId": "@binding:salesArrangement.id"
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"value": "@binding:salesArrangement.businessPartnerNumber"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"value": "@controller:getCompleteBillingAddress()"
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.mainContactEmail"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.billingEmail"
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"value": "@binding:salesArrangement.totalAmount"
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"value": "@binding:salesArrangement.totalAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"value": "@binding:salesArrangement.invoicedAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"value": "@binding:salesArrangement.revenueRecognizedTotal",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"value": "@binding:salesArrangement.remainingPerformanceObligation",
"parseAs": "currency"
}
]
},
{
"component": "Block",
"size": "11",
"title": "testing",
"isVisible": "@controller:isActiveSegment(1)",
"collapsible": true,
"elements": []
}
]
}
]
}
]
}
}
{
"version": 2,
"uicontroller": "salesArrangementWRONG.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangementProducts",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModels",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "salesArrangementPriceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"status": "@binding:salesArrangement.salesArrangementStatus",
"subtitle": "@binding:salesArrangement.salesArrangementNumber"
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"subtitle": "@binding:salesArrangement.totalAmount",
"isDisabled": "@controller:isCreationMode()",
"onClick": "@controller:setActiveSegment(1)",
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"isDisabled": "@controller:isOrderDetailsDisabled()",
"onCollapseClick": "@controller:changeDetailsCollapsedState()",
"isVisible": "@controller:isDetailsCollapsedVisible()",
"collapsed": "@controller:isDetailsCollapsedCollapsed()",
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"id": "@binding:salesArrangement.businessPartnerId"
}
},
"value": "@binding:salesArrangement.businessPartnerId",
"list": "@binding:salesArrangement",
"text": "@binding:salesArrangement.businessPartnerName",
"modelId": "@binding:salesArrangement.id"
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"value": "@binding:salesArrangement.businessPartnerNumber"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"value": "@controller:getCompleteBillingAddress()"
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.mainContactEmail"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.billingEmail"
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"value": "@binding:salesArrangement.totalAmount"
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"value": "@binding:salesArrangement.totalAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"value": "@binding:salesArrangement.invoicedAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"value": "@binding:salesArrangement.revenueRecognizedTotal",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"value": "@binding:salesArrangement.remainingPerformanceObligation",
"parseAs": "currency"
}
]
},
{
"component": "Block",
"size": "11",
"title": "testing",
"isVisible": "@controller:isActiveSegment(1)",
"collapsible": true,
"elements": []
}
]
}
]
}
]
}
}
{
"version": 2,
"uicontroller": "salesArrangement.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangementProducts",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModels",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "salesArrangementPriceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"status": {
"value": "@binding:salesArrangement.salesArrangementStatus"
},
"subtitle": "@binding:salesArrangement.salesArrangementNumber"
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"subtitle": "@binding:salesArrangement.totalAmount",
"isDisabled": "@controller:isCreationMode()",
"onClick": "@controller:setActiveSegment(1)",
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"isDisabled": "@controller:isOrderDetailsDisabled()",
"onCollapseClick": "@controller:changeDetailsCollapsedState()",
"isVisible": "@controller:isDetailsCollapsedVisible()",
"collapsed": "@controller:isDetailsCollapsedCollapsed()",
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"id": "@binding:salesArrangement.businessPartnerId"
}
},
"value": "@binding:salesArrangement.businessPartnerId",
"list": "@binding:salesArrangement",
"text": "@binding:salesArrangement.businessPartnerName",
"modelId": "@binding:salesArrangement.id"
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"value": "@binding:salesArrangement.businessPartnerNumber"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"value": "@controller:getCompleteBillingAddress()"
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.mainContactEmail"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.billingEmail"
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"value": "@binding:salesArrangement.totalAmount"
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"value": "@binding:salesArrangement.totalAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"value": "@binding:salesArrangement.invoicedAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"value": "@binding:salesArrangement.revenueRecognizedTotal",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"value": "@binding:salesArrangement.remainingPerformanceObligation",
"parseAs": "currency"
}
]
},
{
"component": "Block",
"size": "11",
"title": "testing",
"isVisible": "@controller:isActiveSegment(1)",
"collapsible": true,
"elements": []
}
]
}
]
}
]
}
}
{
"version": 2,
"uicontroller": "salesArrangement.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangementProducts",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModels",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "salesArrangementPriceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"uiModelBinding": {
"status": "SalesArrangement.salesArrangementStatus",
"subtitle": "SalesArrangement.salesArrangementNumber"
}
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"subtitle": "@binding:salesArrangement.totalAmount",
"isDisabled": "@controller:isCreationMode()",
"onClick": "@controller:setActiveSegment(1)",
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"isDisabled": "@controller:isOrderDetailsDisabled()",
"onCollapseClick": "@controller:changeDetailsCollapsedState()",
"isVisible": "@controller:isDetailsCollapsedVisible()",
"collapsed": "@controller:isDetailsCollapsedCollapsed()",
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"id": "@binding:salesArrangement.businessPartnerId"
}
},
"value": "@binding:salesArrangement.businessPartnerId",
"list": "@binding:salesArrangement",
"text": "@binding:salesArrangement.businessPartnerName",
"modelId": "@binding:salesArrangement.id"
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"value": "@binding:salesArrangement.businessPartnerNumber"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"value": "@controller:getCompleteBillingAddress()"
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.mainContactEmail"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.billingEmail"
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"value": "@binding:salesArrangement.totalAmount"
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"value": "@binding:salesArrangement.totalAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"value": "@binding:salesArrangement.invoicedAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"value": "@binding:salesArrangement.revenueRecognizedTotal",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"value": "@binding:salesArrangement.remainingPerformanceObligation",
"parseAs": "currency"
}
]
},
{
"component": "Block",
"size": "11",
"title": "testing",
"isVisible": "@controller:isActiveSegment(1)",
"collapsible": true,
"elements": []
}
]
}
]
}
]
}
}
{
"version": 2,
"uicontroller": "salesArrangement.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangementProducts",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModels",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "salesArrangementPriceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"status": "@binding:salesArrangement.salesArrangementStatus",
"subtitle": "@binding:salesArrangement.salesArrangementNumber"
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"subtitle": "@binding:salesArrangement.totalAmount",
"isDisabled": "@controller:isCreationMode()",
"onClick": "@controller:setActiveSegment(1)",
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"isDisabled": "@controller:isOrderDetailsDisabled()",
"onCollapseClick": "@controller:changeDetailsCollapsedState()",
"isVisible": "@controller:isDetailsCollapsedVisible()",
"collapsed": "@controller:isDetailsCollapsedCollapsed()",
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"id": "@binding:salesArrangement.businessPartnerId"
}
},
"value": "@binding:salesArrangement.businessPartnerId",
"list": "@binding:salesArrangement",
"text": "@binding:salesArrangement.businessPartnerName",
"modelId": "@binding:salesArrangement.id"
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"value": "@binding:salesArrangement.businessPartnerNumber"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"value": "@controller:getCompleteBillingAddress()"
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.mainContactEmail"
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"value": "@binding:salesArrangement.billingEmail"
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"value": "@binding:salesArrangement.totalAmount"
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"value": "@binding:salesArrangement.totalAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"value": "@binding:salesArrangement.invoicedAmount",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"value": "@binding:salesArrangement.revenueRecognizedTotal",
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"value": "@binding:salesArrangement.remainingPerformanceObligation",
"parseAs": "currency"
}
]
},
{
"component": "Block",
"size": "11",
"title": "testing",
"isVisible": "@controller:isActiveSegment(1)",
"collapsible": true,
"elements": []
}
]
}
]
}
]
}
}
{"version":1,"resource":"file:///home/nuky/workspace/application/appserver/src/compiler/settings.ts","entries":[{"id":"N6ma.ts","timestamp":1650376713211},{"id":"rN5M.ts","timestamp":1650382887081}]}
{"version":1,"resource":"file:///home/nuky/workspace/rest/local/uiengine/uimodel_custom_queries.yml","entries":[{"id":"CIyh.yml","timestamp":1650362576375}]}
{"version":1,"resource":"file:///home/nuky/workspace/ui/src/helpers/parseModelId/index.ts","entries":[{"id":"KdSQ.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650454199404},{"id":"AWM9.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650454312563},{"id":"ek9D.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650454529924},{"id":"DVOm.ts","source":"Fix all ESLint auto-fixable problems","timestamp":1650454840498},{"id":"Pya4.ts","timestamp":1650488010641}]}
{"version":1,"resource":"file:///home/nuky/.p10k.zsh","entries":[{"id":"EbeB.zsh","timestamp":1650827204305}]}
{
"version": 2,
"uicontroller": "salesArrangementNext.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangementProducts",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModels",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "salesArrangementPriceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"uiModelBinding": {
"status": "SalesArrangement.salesArrangementStatus",
"subtitle": "SalesArrangement.salesArrangementNumber"
}
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"uiModelBinding": {
"subtitle": "SalesArrangement.totalAmount"
},
"functions": {
"isDisabled": "state.mode === 'create'"
},
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"functions": {
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
}
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"functions": {
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
}
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"onCollapseClick": "(collapsed) => {setState('detailsCollapsed', !collapsed)}",
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.detailsCollapsed"
},
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"uiModelBinding": {
"id": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
]
}
}
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
],
"list": [
"everest.fin.accounting/BusinessPartnerModel.BusinessPartner"
],
"text": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerNumber"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"functions": {
"value": "const [address] = uiModelData?.['BillingAddress:everest.base/AddressModel.Address']?.result || [];if (address) {return `${address.line1}\n${address.line2}\n${address.city}, ${address.stateProvince} ${address.zipCode}\n${address.country}`;}return '';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"mainContactEmail"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"billingEmail"
]
}
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"component": "Block",
"collapsible": true,
"size": "12",
"title": "{{salesArrangement.orderDetails.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.orderDetailsCollapsed",
"onCollapseClick": "collapsed => setState('orderDetailsCollapsed', !collapsed)"
},
"disabledAction": {
"label": "{{salesArrangement.reviseDetails}}",
"functions": {
"onClick": "()=>setTemplateActiveSegment(1)"
}
},
"elements": [
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityName}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityName"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityId}}",
"link": {
"to": "https://www.google.com/",
"target": "_blank",
"rel": "noreferrer",
"isExternal": true
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityIdText"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.purchaseOrder}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"purchaseOrder"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesRep}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesRep"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.signDate}}",
"parseAs": "date",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"signDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.bookingDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"bookDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.effectiveDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesEffectiveDate"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesGroup}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesGroup"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.currency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.functionalCurrency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.notes}}",
"size": "2",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"memo"
]
}
}
]
},
{
"component": "Template",
"size": "11",
"functions": {
"link": "'/templates/everest.fin.accounting/ui/balanceRollforward?id=' + state.id"
}
},
{
"component": "SectionGroup",
"size": "1",
"sections": [
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"title": "{{salesArrangement.activity.title}}",
"component": "WidgetGroup",
"functions": {
"isDisabled": "state.mode === 'edit'"
},
"widgets": [
{
"label": "{{salesArrangement.activity.log}}",
"component": "Messaging",
"dateFormat": "P",
"uiModelBinding": {
"list": [
"TODO"
]
}
},
{
"component": "Messaging",
"label": "{{salesArrangement.activity.notes}}",
"uiModelBinding": {
"list": [
"TODO"
]
},
"dateFormat": "P"
}
]
}
]
}
]
},
{
"title": "{{salesArrangement.orderedProducts.title}}",
"functions": {
"subtitle": "state.mode === 'create' ? '{{salesArrangement.orderedProducts.notSaved}}' : '{{salesArrangement.orderedProducts.saved}}'"
},
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"functions": {
"label": "state.mode==='create'?'{{salesArrangement.callToAction.actions.save}}':'{{salesArrangement.callToAction.actions.activate}}'",
"disabled": "formState?.isSubmitting || state.mode==='edit' || isFetchingUiModelData || (state.mode === 'create' && formState?.hasError)",
"onClick": [
"() => {",
" if (state.mode === 'create') {",
" const removeEmpty = (rawLine, index, idProp, model) => {",
" if (index === 0 || getFormAction(model) !== 'create') return;",
" const { [idProp]: id, ...line } = rawLine || {};",
" const isEmpty =",
" helpers.isEmpty(line) ||",
" Object.values(line).every(",
" (v) => v == null || (typeof v === 'object' && helpers.isEmpty(v))",
" );",
" if (isEmpty) deleteFormModel(model, true, false);",
" };",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const { values: salesArrangementProducts, matchingKeys: saKeys } =",
" getFormValueList(salModel, ['create', 'update', 'delete']) || [];",
" salesArrangementProducts?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementId', saKeys[index]),",
" []",
" );",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: salesArrangementPriceModelLineLines, matchingKeys: salesArrangementPriceModelLineKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create', 'update', 'delete']) || [];",
" salesArrangementPriceModelLineLines?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementProductId', salesArrangementPriceModelLineKeys[index]),",
" []",
" );",
" defaultSubmit({",
" onSuccess: async () => {",
" navigate({",
" to: '/templates/everest.fin.accounting/ui/salesArrangements',",
" closeCurrentTab: true,",
" });",
" },",
" transform: (rawValues) => {",
" const saModel =",
" 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" let formValues = {",
" [saModel]: {",
" createSalesArrangementWithLines: {",
" salesArrangement: {",
" ...helpers.cloneDeep(",
" rawValues[saModel].createSalesArrangementWithLines",
" ),",
" },",
" salesArrangementProducts: [],",
" salesArrangementPriceModelLines: [],",
" },",
" },",
" };",
" delete formValues.billingAddressField;",
" const formKeys = Object.keys(rawValues);",
" formKeys.forEach((key) => {",
" if (key.includes('SalesArrangementProduct')) {",
" const charges = [];",
" const currentSAL = helpers.cloneDeep(rawValues[key].create);",
" delete currentSAL._id;",
" delete currentSAL.productCode",
" formKeys.forEach((entry) => {",
" if (",
" entry.includes('SalesArrangementPriceModelLine') &&",
" entry.startsWith(key.charAt(0))",
" ) {",
" const salesArrangementPriceModelLine = helpers.cloneDeep(rawValues[entry].create);",
" delete salesArrangementPriceModelLine._id;",
" delete salesArrangementPriceModelLine.childProduct;",
" charges.push(salesArrangementPriceModelLine);",
" }",
" });",
" formValues[",
" saModel",
" ].createSalesArrangementWithLines.salesArrangementProducts.push(",
" currentSAL",
" );",
" formValues[",
" saModel",
" ].createSalesArrangementWithLines.salesArrangementPriceModelLines.push(charges);",
" }",
" });",
"",
" Object.entries(formValues).forEach(([key, value]) => {",
" if(!!value?.update) {",
" formValues[key] = {...value, fieldlist: [\"id\"]}",
" }",
" });",
"",
" return formValues;",
" },",
" });",
" } else {",
" showToast({",
" type: 'warning',",
" title: '{{notImplementedR2.title}}',",
" message: '{{notImplementedR2.message}}',",
" });",
" }",
"}"
]
}
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"functions": {
"disabled": "state.mode === \"create\""
},
"actions": [
{
"functions": {
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "(state.mode ==='edit')?'{{salesArrangement.callToAction.actions.saveRevisions}}':'{{salesArrangement.callToAction.actions.revise}}'",
"onClick": [
"() => {",
" if (state.mode !== 'edit') {",
" setState('mode', 'edit');",
" setTemplateActiveSegment(1);",
" } else {",
" const removeEmpty = (rawLine, index, idProp, model) => {",
" if (index === 0 || getFormAction(model) !== 'create') return;",
" const { [idProp]: id, ...line } = rawLine || {};",
" const isEmpty =",
" helpers.isEmpty(line) ||",
" Object.values(line).every(",
" (v) => v == null || (typeof v === 'object' && helpers.isEmpty(v))",
" );",
" if (isEmpty) deleteFormModel(model, true, false);",
" };",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const { values: salesArrangementProducts, matchingKeys: saKeys } =",
" getFormValueList(salModel, ['create', 'update', 'delete']) || [];",
" salesArrangementProducts?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementId', saKeys[index]),",
" []",
" );",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: salesArrangementPriceModelLineLines, matchingKeys: salesArrangementPriceModelLineKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create', 'update', 'delete']) || [];",
" salesArrangementPriceModelLineLines?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementProductId', salesArrangementPriceModelLineKeys[index]),",
" []",
" );",
" defaultSubmit({",
" skipRefetchOnSuccess: true,",
" onSuccess: async () => {",
" const formValues = getFormValues();",
"",
" Object.keys(formValues)",
" ?.filter((key) => key.includes(salModel))",
" ?.forEach((key) => {",
" deleteFormAction(key, 'create');",
" deleteFormAction(key, 'delete');",
" });",
"",
" const boModel =",
" 'everest.fin.accounting/BOComposition/SalesArrangementBusinessObjectModel.SalesArrangementBusinessObject';",
" const { id } = getUiModelDataValue([boModel])?.[0] ?? {};",
"",
" if (id != null) {",
" const updateBoResponse = await everestAction({",
" uiModelName: 'everest.fin.accounting/ui/accounting',",
" model: boModel,",
" action: 'update',",
" body: { id, headerKey: state.id },",
" fieldlist: [\"id\"],",
" });",
" console.log('BO Updated:', updateBoResponse);",
" }",
" await refetchUiModelData();",
" setState(\"mode\", \"view\");",
" },",
" transform: (rawValues) => {",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" let formValues = helpers.cloneDeep(rawValues);",
" delete formValues.billingAddressField;",
" for (let key in formValues) {",
" delete formValues[key].update?.childProduct;",
" delete formValues[key].create?.childProduct;",
" delete formValues[key].delete?.childProduct;",
" delete formValues[key].update?._id;",
" delete formValues[key].create?._id;",
" delete formValues[key].delete?._id;",
" delete formValues[key].update?.productCode;",
" delete formValues[key].create?.productCode;",
" delete formValues[key].delete?.productCode;",
" }",
"",
" const { values: createsalesArrangementProducts, matchingKeys: createSaKeys } =",
" getFormValueList(salModel, ['create']) || [];",
"",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: createLcLines, matchingKeys: createLcKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create']) || [];",
" createLcKeys.forEach((key) => {",
" if (createSaKeys.includes(`${key.charAt(0)}:${salModel}`)) {",
" delete formValues[key];",
" }",
" });",
"",
" createSaKeys.forEach((salKey, salIndex) => {",
" const charges = [];",
" createLcKeys.forEach((salesArrangementPriceModelLineKey, salesArrangementPriceModelLineIndex) => {",
" if (salesArrangementPriceModelLineKey.startsWith(salKey.charAt(0))) {",
" const data = createLcLines[salesArrangementPriceModelLineIndex];",
" delete data._id;",
" delete data.childProduct;",
" charges.push(data);",
" }",
" });",
" delete formValues[salKey].create;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementProduct',",
" ],",
" helpers.cloneDeep(rawValues[salKey].create)",
" );",
" delete formValues[salKey].createSalesArrangementProductWithPriceModelLines",
" .salesArrangementProduct._id;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementPriceModelLines',",
" ],",
" charges",
" );",
" });",
"",
" const { matchingKeys: salUpdateKeys } = getFormValueList(salModel, [\"update\"]) ?? [];",
" salUpdateKeys.forEach(key => {",
" delete formValues?.[key]?.update?.startDate;",
" delete formValues?.[key]?.update?.endDate;",
" });",
"",
" Object.entries(formValues).forEach(([key, value]) => {",
" if(!!value?.update) {",
" formValues[key] = {...value, fieldlist: [\"id\"]}",
" }",
" });",
"",
" return formValues;",
" },",
" });",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.approve}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 2, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.reject}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" const runResponse=await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 1, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
}
]
}
}
},
{
"component": "Block",
"functions": {
"onCollapseClick": "(collapsed) => {setState('detailsCollapsed', !collapsed)}",
"collapsed": "!!state.detailsCollapsed"
},
"collapsible": true,
"size": "11",
"title": "{{salesArrangement.details.title}}",
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"prefixProp": "businessPartnerNumber",
"isDisabled": false,
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"uiModelBinding": {
"id": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
]
}
}
},
"customAction": {
"label": "{{salesArrangement.details.createNew}}",
"type": "dark-grey",
"functions": {
"isVisible": "state.mode==='edit' || state.mode==='create'",
"onClick": "()=>openModal({title:'{{salesArrangement.details.createCustomer}}',template:'/templates/everest.fin.accounting/ui/businessPartnerCreate',onModalSubmit:(createdBusinessPartner)=>{if(createdBusinessPartner==null)return;refetchUiModelData(); const action=state.mode==='create'?'createSalesArrangementWithLines':'update';setFormValue(['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'],action,createdBusinessPartner)}})"
}
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
],
"list": [
"everest.fin.accounting/BusinessPartnerModel.BusinessPartner"
],
"text": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"onChange": "(value)=>{const action=state.mode==='create' ? 'createSalesArrangementWithLines':'update';setFormValue(['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'],action,value)}"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"uiModelBinding": {
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
],
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerNumber"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find(b=>b.id==partnerId);return partner?.businessPartnerNumber||'';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"uiModelBinding": {},
"name": "billingAddressField",
"functions": {
"isEditing": "state.mode === 'create' || state.mode === 'edit'",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find((b)=>b.id==partnerId);const address=getUiModelDataValue(['everest.base/AddressModel.Address',])?.find((address)=>address.id==partner?.defaultBillingAddressId);const addressLines=[address?.line1,address?.line2,`${address?.city}, ${address?.stateProvince} ${address?.zipCode}`,address?.country,].filter(Boolean).join(`\n`);return address?addressLines:'';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"uiModelBinding": {
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
],
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"mainContactEmail"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update'",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId',];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find((b)=>b.id==partnerId);return partner?.mainContactEmail??'';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"uiModelBinding": {
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
],
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"billingEmail"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId',];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find((b)=>b.id==partnerId);return partner?.billingEmail??'';"
}
}
]
},
{
"component": "SummaryText",
"size": "1",
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"functions": {
"value": [
"if (state.mode !== \"edit\" && state.mode !== \"create\") {",
" return getUiModelDataValue([",
" \"everest.fin.accounting/SalesArrangementModel.SalesArrangement\", \"totalAmount\",",
" ]);",
"}",
"",
"const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"const salesArrangementPriceModelLines = getFormValueList(model, [\"update\", \"create\"])?.values || [];",
"",
"const total = salesArrangementPriceModelLines.reduce((acc, line) => {",
" const amount = new Decimal(line.amount);",
" if (amount.isNaN()) return acc;",
" return amount.plus(acc);",
"}, new Decimal(0));",
"",
"return total.toFixed();"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"component": "Block",
"collapsible": true,
"size": "12",
"title": "{{salesArrangement.orderDetails.title}}",
"functions": {
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.orderDetailsCollapsed",
"onCollapseClick": "collapsed => setState('orderDetailsCollapsed', !collapsed)"
},
"elements": [
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityName}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityId}}",
"link": {
"to": "https://www.google.com/",
"target": "_blank",
"rel": "noreferrer",
"isExternal": true
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityIdText"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.purchaseOrder}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"purchaseOrder"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesRep}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesRep"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.signDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"signDate"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.bookingDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"bookDate"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.effectiveDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesEffectiveDate"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesGroup}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesGroup"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Select",
"idProp": "codeNumber",
"textProp": "text",
"label": "{{salesArrangement.orderDetails.currency}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"currency"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"text": [
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const currencyId = getUiModelDataValue([\"everest.fin.accounting/SalesArrangementModel.SalesArrangement\",\"currency\"]);",
"const { text: currency } = currencies.find(({ codeNumber }) => codeNumber === currencyId) ?? {};",
"return currency"
],
"list": [
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const usDollar = 149;",
"const sortedCurrencies = currencies.sort((a, b) => {",
" if (a.codeNumber === usDollar) return -1;",
" if (b.codeNumber === usDollar) return 1;",
" return a.text.localeCompare(b.text);",
"});",
"return sortedCurrencies"
]
}
},
{
"component": "Select",
"idProp": "codeNumber",
"textProp": "text",
"label": "{{salesArrangement.orderDetails.functionalCurrency}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"functionalCurrency"
],
"list": [
"Currency:everest.appserver/ValueHelpModel.ValueHelp"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"text": [
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const currencyId = getUiModelDataValue([\"everest.fin.accounting/SalesArrangementModel.SalesArrangement\",\"functionalCurrency\"]);",
"const { text: currency } = currencies.find(({ codeNumber }) => codeNumber === currencyId) ?? {};",
"return currency"
],
"value": [
"const modelValue = getUiModelDataValue(['everest.fin.accounting/SalesArrangementModel.SalesArrangement', 'functionalCurrency'])",
"return state.mode === 'create' ? 149 : modelValue;"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.notes}}",
"size": "2",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"memo"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
}
]
},
{
"component": "MultipleSecondaryTable",
"title": "{{salesArrangement.orderedProducts.title}}",
"size": "12",
"disabledActions": [
"delete"
],
"functions": {
"isEditing": "state.mode === \"edit\" || state.mode === \"create\""
},
"extraAction": {
"functions": {
"isVisible": "state.mode==='edit' || state.mode==='create'",
"onClick": [
"const lineModel = \"everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct\";",
"const salesArrangementPriceModelLineModel = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"const isCreate = state.mode === \"create\";",
"return () => {",
" const _id = Number(helpers.uniqueId());",
" const initialIndex = getFormValueList(lineModel, [",
" \"create\",",
" \"update\",",
" \"delete\",",
" \"createSalesArrangementWithLines\",",
" ]).values.length;",
" setFormValue([`${initialIndex}:${lineModel}`], \"create\", { _id, salesArrangementId: Number(state.id) });",
" setFormValue([`${initialIndex}-0:${salesArrangementPriceModelLineModel}`], \"create\", { _id });",
" setFormValue([`${initialIndex}-1:${salesArrangementPriceModelLineModel}`], \"create\", { _id });",
" setFormValue([`${initialIndex}-2:${salesArrangementPriceModelLineModel}`], \"create\", { _id });",
"}"
]
},
"label": "{{salesArrangement.orderedProducts.addMore}}",
"icon": "plus-circle-havlock"
},
"tables": [
{
"relationshipKey": [
"_id"
],
"rowActionsIcon": "times-circle-brick",
"rowActions": [
{
"label": "{{salesArrangement.orderedProducts.undoDelete}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"onClick": "(_, tableIndex)=>modifyFormAction(`${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`,\"delete\", \"update\")",
"getIsRowVisible": "(_, tableIndex)=>getFormAction(`${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`) === \"delete\""
}
},
{
"color": "brick",
"label": "{{salesArrangement.orderedProducts.deleteLine}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"onClick": [
"(_, tableIndex) => {",
" const lineModel = `${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`;",
" const salesArrangementPriceModelLineModel = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"",
" const salesArrangementPriceModelLines = Object.keys(getFormValues()).filter(",
" key => key.match(`${tableIndex}+-[0-9]+:${salesArrangementPriceModelLineModel}`)",
" );",
"",
" const salAction = getFormAction(lineModel);",
" if(salAction === \"update\") modifyFormAction(lineModel, \"update\", \"delete\");",
" else deleteFormModel(lineModel);",
"",
" salesArrangementPriceModelLines.reverse().forEach(key => {",
" const lineAction = getFormAction(key);",
" if(lineAction === \"update\") modifyFormAction(key, \"update\", \"delete\");",
" else deleteFormModel(key);",
" });",
"}"
],
"getIsRowDisabled": "(_, tableIndex)=>getFormAction(`${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`) === \"delete\""
}
}
],
"uiModelBinding": {
"data": [
"everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct"
]
},
"editDisplayActions": [
"create",
"update",
"delete",
"createSalesArrangementWithLines"
],
"functions": {
"data": [
"const isCreate = state.mode === \"create\";",
"const model=\"everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct\";",
"const salesArrangementPriceModelLineModel = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"if (isCreate && !getFormValueList(model, [\"create\"])?.values.length) {",
" setFormValue([`0:${model}`], \"create\", { _id: 1 });",
" setFormValue([`0-0:${salesArrangementPriceModelLineModel}`], \"create\", { _id: 1 });",
" setFormValue([`0-1:${salesArrangementPriceModelLineModel}`], \"create\", { _id: 1 });",
" setFormValue([`0-2:${salesArrangementPriceModelLineModel}`], \"create\", { _id: 1 });",
" return;",
"};",
"const data = getUiModelDataValue([ model ]) ?? [];",
"return data?.map(sal => ({ ...sal, _id: sal?.id }));"
],
"defaultAction": "if (state.mode === \"create\") return \"createSalesArrangementWithLines\"; return \"update\";"
},
"columns": [
{
"Header": "{{salesArrangement.orderedProducts.salesArrangementProduct}}",
"dataBinding": [
"salesArrangementProductNumber"
],
"sticky": "left",
"isEditable": false
},
{
"Header": "{{salesArrangement.orderedProducts.product}}",
"dataBinding": [
"productCode"
],
"sticky": "left",
"alwaysEditableCellActions": [
"create"
],
"isEditable": false,
"functions": {
"onCellClick": "({column, row}) => navigate({ to: \"/templates/everest.fin.accounting/ui/product?id=\"+row.original.productId })",
"multiLevelSelectConfig": [
"const onChange = (e, { key, label, name }) => {",
" const [model] = name.split('.');",
" const [tableIndex] = name.split(':');",
" const [code, productName] = label.split(' - ');",
" const ppcId = e.key.split('-')[1];",
" const pcModel = 'everest.fin.accounting/ProductChargeModel.ProductCharge';",
" setFormValue([model, 'productName'], 'create', productName);",
" const productData =",
" uiModelData['everest.fin.accounting/ProductModel.Product']?.result;",
" if (productData) {",
" const { id } = productData.products.find(",
" (entry) => entry.productCode === code",
" ) ?? {};",
" setFormValue([model, 'productId'], getFormAction(model), id);",
" }",
" everestAction({",
" uiModelName: 'everest.fin.accounting/ui/accounting',",
" model: pcModel,",
" action: 'query',",
" body: { where: { productPriceConfigurationId: ppcId } },",
" }).then((result) => {",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const referenceKey = getFormValue([`${tableIndex}-0:${salesArrangementPriceModelLineModel}`, \"_id\"], \"create\");",
"",
" const salesArrangementPriceModelLines = Object.keys(getFormValues()).filter(",
" key => key.match(`${tableIndex}+-[0-9]+:${salesArrangementPriceModelLineModel}`)",
" );",
"",
" salesArrangementPriceModelLines.reverse().forEach((key) => {",
" deleteFormModel(key);",
" });",
"",
" const priceConfigurations = result[pcModel].result;",
" let pcCount = 0;",
" priceConfigurations.forEach((pc) => {",
" const props = [",
" 'productId',",
" 'productName',",
" 'priceModel',",
" 'priceType',",
" 'billingFrequency',",
" 'billingTiming',",
" 'unitOfMeasure',",
" 'listPrice',",
" ];",
" const indexedModel = `${tableIndex}-${pcCount++}:${salesArrangementPriceModelLineModel}`;",
" const values = {...helpers.pick(pc, props), _id: referenceKey };",
" setFormValue([indexedModel], 'create', values);",
" });",
" });",
"};",
"",
"const result = {",
" data: [],",
" onChange,",
" extraAction: { onClick: () => openModal({ template: '/templates/everest.fin.accounting/ui/productCatalog', title: '{{productCatalog.title}}' }), icon: 'list' },",
"};",
"",
"const fetchedData = getUiModelDataValue([",
" 'everest.fin.accounting/ProductModel.Product',",
"]);",
"",
"if (!fetchedData) return result;",
"const { products, productPriceConfigurations } = fetchedData;",
"const preparedData = [];",
"products.forEach(({ productCode, productName, id }, i) => {",
" const pc = productPriceConfigurations[i];",
" preparedData.push({",
" label: `${productCode} - ${productName}`,",
" value: id,",
" data: pc.map((entry) => ({",
" value: entry.id,",
" label: entry.productPriceConfigurationName,",
" })),",
" });",
"});",
"",
"return { ...result, data: preparedData };"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.productName}}",
"dataBinding": [
"productName"
],
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.amount}}",
"dataBinding": [
"amount"
],
"parseAs": "currency",
"isEditable": false
},
{
"Header": "{{salesArrangement.orderedProducts.billingStartDate}}",
"dataBinding": [
"startDate"
],
"parseAs": "date"
},
{
"Header": "{{salesArrangement.orderedProducts.billingEndDate}}",
"dataBinding": [
"endDate"
],
"parseAs": "date"
},
{
"Header": "{{salesArrangement.orderedProducts.paymentTerm}}",
"dataBinding": {
"rawValue": [
"paymentTerm"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "PaymentTerm"
},
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.totalInvoiced}}",
"dataBinding": [
"totalInvoiced"
],
"parseAs": "currency",
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.currency}}",
"dataBinding": {
"rawValue": [
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.functionalCurrency}}",
"dataBinding": {
"rawValue": [
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.functionalAmount}}",
"dataBinding": [
"functionalAmount"
],
"parseAs": "currency",
"functions": {
"format": [
"if (isFetchingUiModelData) return;",
"const model = \"everest.fin.accounting/SalesArrangementModel.SalesArrangement\";",
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const currencyId = getUiModelDataValue([model, \"functionalCurrency\"]);",
"const { codeValue: currency } = currencies?.find(({ codeNumber }) => codeNumber === currencyId) ?? {};",
"return currency;"
]
}
}
]
},
{
"rowActionsIcon": "plus-circle-havlock",
"rowActions": [
{
"label": "{{salesArrangement.orderedProducts.addAnotherLine}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"onClick": [
"(_, tableIndex) => {",
" const parentModel = `${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`;",
" const parentAction = getFormAction(parentModel);",
" const { id: _id } = getFormValue([parentModel], parentAction) ?? {};",
" const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"",
" const { id: salesArrangementProductId } = getFormValue([parentModel], \"update\") ?? {};",
" const { salesArrangementPriceModelId } = getUiModelDataValue([model])?.find(salesArrangementPriceModelLine => salesArrangementPriceModelLine.salesArrangementProductId === salesArrangementProductId) ?? {};",
"",
" const formKeys = Object.keys(getFormValues());",
" const alias = formKeys.filter(key => key.match(`${tableIndex}+-[0-9]:${model}`))?.length;",
" setFormValue([`${tableIndex}-${alias}:${model}`], \"create\", { _id, salesArrangementPriceModelId, salesArrangementProductId });",
"}"
]
}
},
{
"label": "{{salesArrangement.orderedProducts.duplicateLine}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"getIsRowDisabled": "(rowIndex, tableIndex)=>getFormAction(`${tableIndex}-${rowIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`) === \"delete\"",
"onClick": [
"(rowIndex, tableIndex) => {",
" const formKeys = Object.keys(getFormValues());",
" const salModel = `${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`;",
" const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
" const alias = formKeys.filter(key => key.match(`${tableIndex}+-[0-9]:${model}`))?.length;",
"",
" const { id, ...values } = getFormModelValue(`${tableIndex}-${rowIndex}:${model}`) ?? {};",
" const { id: salesArrangementProductId } = getFormValue([salModel], \"update\") ?? {};",
" const { salesArrangementPriceModelId } = getUiModelDataValue([model])?.find(salesArrangementPriceModelLine => salesArrangementPriceModelLine.salesArrangementProductId === salesArrangementProductId) ?? {};",
"",
" setFormValue([`${tableIndex}-${alias}:${model}`], \"create\", { ...values, salesArrangementPriceModelId, salesArrangementProductId });",
"}"
]
}
},
{
"color": "brick",
"label": "{{salesArrangement.orderedProducts.deleteLine}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"getIsRowVisible": "(rowIndex, tableIndex)=>getFormAction(`${tableIndex}-${rowIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`) !== \"delete\"",
"onClick": [
"(rowIndex, tableIndex) => {",
" const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
" const formModel = `${tableIndex}-${rowIndex}:${model}`;",
" const action = getFormAction(formModel);",
"",
" if (action === \"update\") {",
" modifyFormAction(`${tableIndex}-${rowIndex}:${model}`, \"update\", \"delete\");",
" return;",
" }",
"",
" const formKeys = Object.keys(getFormValues());",
" const alias = formKeys.filter(key => key.match(`${tableIndex}+-[0-9]:${model}`))?.length;",
" const { _id } = getFormValue([formModel], action) ?? {};",
" if (alias === 1) setFormValue([formModel], action, { _id });",
" else deleteFormModel(formModel);",
"}"
]
}
},
{
"label": "{{salesArrangement.orderedProducts.undoDelete}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"getIsRowVisible": "(rowIndex, tableIndex)=>getFormAction(`${tableIndex}-${rowIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`) === \"delete\"",
"onClick": [
"(rowIndex, tableIndex) => {",
" const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
" modifyFormAction(`${tableIndex}-${rowIndex}:${model}`, \"delete\", \"update\");",
"}"
]
}
}
],
"relationshipKey": [
"_id"
],
"uiModelBinding": {
"data": [
"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine"
]
},
"functions": {
"data": "getUiModelDataValue([\"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\"])?.map(salesArrangementPriceModelLine => ({...salesArrangementPriceModelLine, _id: salesArrangementPriceModelLine.salesArrangementProductId }))"
},
"defaultAction": "update",
"editDisplayActions": [
"create",
"update",
"delete"
],
"columns": [
{
"Header": "{{salesArrangement.orderedProducts.salesArrangementPriceModelLine}}",
"dataBinding": [
"salesArrangementPriceModelLineNumber"
],
"sticky": "left"
},
{
"Header": "{{salesArrangement.orderedProducts.referenceProduct}}",
"dataBinding": [
"productName"
],
"sticky": "left",
"selectConfig": {
"listBinding": [
"Flat:everest.fin.accounting/ProductModel.Product"
],
"textBinding": "productName",
"valueBinding": "productName"
},
"functions": {
"onCellChange": [
"({ rowAction, value, name }) => {",
" const productsModel = \"Flat:everest.fin.accounting/ProductModel.Product\";",
" const products = getUiModelDataValue([productsModel]) ?? [];",
" const selectedProduct = products.find(p => p.productName === value) ?? {};",
"",
" const [matrixIndex] = name.split(\":\") ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" setFormValue([model, \"productId\"], rowAction, selectedProduct.id);",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.priceType}}",
"dataBinding": {
"rawValue": [
"priceType"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "PriceType"
},
"functions": {
"onCellChange": [
"({ rowAction, value, previousValue, name }) => {",
" const [matrixIndex] = name.split(':') ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" if(value === 3) { // PriceType === Usage",
" setFormValue([model, 'quantity'], rowAction, '0');",
" } else if(previousValue === 3){",
" setFormValue([model, 'quantity'], rowAction, null);",
" }",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.amount}}",
"dataBinding": [
"amount"
],
"parseAs": "currency",
"footerFunc": "sum",
"functions": {
"onCellChange": [
"({ rowAction, value, name }) => {",
" const [matrixIndex] = name.split(\":\") ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" const amount = new Decimal(value);",
" const quantity = new Decimal(getFormValue([model, \"quantity\"], rowAction));",
" const rate = amount.dividedBy(quantity);",
" if (rate.isNaN()) return;",
" setFormValue([model, \"effectiveRate\"], rowAction, rate.toFixed());",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.billingFrequency}}",
"dataBinding": {
"rawValue": [
"billingFrequency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "BillingFrequency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.billingTiming}}",
"dataBinding": {
"rawValue": [
"billingTiming"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "BillingTiming"
}
},
{
"Header": "{{salesArrangement.orderedProducts.priceModel}}",
"dataBinding": {
"rawValue": [
"priceModel"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "PriceModel"
}
},
{
"Header": "{{salesArrangement.orderedProducts.quantity}}",
"dataBinding": [
"quantity"
],
"functions": {
"onCellChange": [
"({ rowAction, value, name }) => {",
" const [matrixIndex] = name.split(\":\") ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" const quantity = new Decimal(value);",
" const effectiveRate = getFormValue([model, \"effectiveRate\"], rowAction);",
" const rawAmount = getFormValue([model, \"amount\"], rowAction);",
"",
" if (effectiveRate) {",
" const rate = new Decimal(effectiveRate);",
" const amount = quantity.times(rate);",
" if (amount.isNaN()) return;",
" setFormValue([model, \"amount\"], rowAction, amount.toFixed());",
" } else if (rawAmount) {",
" const amount = new Decimal(rawAmount);",
" const rate = amount.dividedBy(quantity);",
" if (rate.isNaN()) return;",
" setFormValue([model, \"effectiveRate\"], rowAction, rate.toFixed());",
" }",
"}"
],
"isEditable": "({ row }) => { return row?.original?.priceType == 3 ? false : true; }"
}
},
{
"Header": "{{salesArrangement.orderedProducts.unitOfMeasure}}",
"dataBinding": {
"rawValue": [
"unitOfMeasure"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "UnitOfMeasureType"
}
},
{
"Header": "{{salesArrangement.orderedProducts.effectiveRate}}",
"dataBinding": [
"effectiveRate"
],
"parseAs": "currency",
"functions": {
"onCellChange": [
"({ rowAction, value, name }) => {",
" const [matrixIndex] = name.split(\":\") ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" const rate = new Decimal(value);",
" const quantity = new Decimal(getFormValue([model, \"quantity\"], rowAction));",
" const amount = quantity.times(rate);",
" if (amount.isNaN()) return;",
" setFormValue([model, \"amount\"], rowAction, amount.toFixed());",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.serviceStartDate}}",
"dataBinding": [
"serviceStartDate"
],
"parseAs": "date",
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.serviceEndDate}}",
"dataBinding": [
"serviceEndDate"
],
"parseAs": "date",
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.billingStartDate}}",
"dataBinding": [
"billingStartDate"
],
"parseAs": "date",
"functions": {
"onCellChange": [
"({ name }) => {",
" const [tableIndex] = name.split('-');",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
"",
" const { values: salesArrangementPriceModelLineValues, matchingKeys: salesArrangementPriceModelLineKeys } = getFormValueList(salesArrangementPriceModelLineModel, [",
" 'create',",
" 'update',",
" ]);",
"",
" let earliestBillingStart = null;",
"",
" const { compareAsc, compareDesc, parseISOWithoutTimezone } = helpers.dates;",
"",
" salesArrangementPriceModelLineKeys.forEach((key, arrayIndex) => {",
" if (key.startsWith(tableIndex)) {",
" const { billingStartDate } = salesArrangementPriceModelLineValues[arrayIndex];",
"",
" const parsedBillingStart =",
" typeof billingStartDate === 'string'",
" ? parseISOWithoutTimezone(billingStartDate)",
" : billingStartDate;",
"",
" earliestBillingStart =",
" !earliestBillingStart ||",
" compareAsc(earliestBillingStart, parsedBillingStart)",
" ? parsedBillingStart",
" : earliestBillingStart;",
"",
" }",
" });",
"",
" if (!earliestBillingStart) return;",
"",
" const salAction = getFormAction(`${tableIndex}:${salModel}`);",
" setFormValue(",
" [`${tableIndex}:${salModel}`, 'startDate'],",
" salAction,",
" earliestBillingStart.toISOString()",
" );",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.billingEndDate}}",
"dataBinding": [
"billingEndDate"
],
"parseAs": "date",
"functions": {
"onCellChange": [
"({ name }) => {",
" const [tableIndex] = name.split('-');",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
"",
" const { values: salesArrangementPriceModelLineValues, matchingKeys: salesArrangementPriceModelLineKeys } = getFormValueList(salesArrangementPriceModelLineModel, [",
" 'create',",
" 'update',",
" ]);",
"",
" let latestBillingEnd = null;",
"",
" const { compareAsc, compareDesc, parseISOWithoutTimezone } = helpers.dates;",
"",
" salesArrangementPriceModelLineKeys.forEach((key, arrayIndex) => {",
" if (key.startsWith(tableIndex)) {",
" const { billingEndDate } = salesArrangementPriceModelLineValues[arrayIndex];",
"",
" const parsedBillingEnd =",
" typeof billingEndDate === 'string'",
" ? parseISOWithoutTimezone(billingEndDate)",
" : billingEndDate;",
"",
" latestBillingEnd =",
" !latestBillingEnd || compareDesc(parsedBillingEnd, latestBillingEnd)",
" ? parsedBillingEnd",
" : latestBillingEnd;",
" }",
" });",
"",
" if (!latestBillingEnd) return;",
"",
" const salAction = getFormAction(`${tableIndex}:${salModel}`);",
" setFormValue(",
" [`${tableIndex}:${salModel}`, 'endDate'],",
" salAction,",
" latestBillingEnd.toISOString()",
" );",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.currency}}",
"dataBinding": {
"rawValue": [
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.functionalCurrency}}",
"dataBinding": {
"rawValue": [
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.exchangeRate}}",
"dataBinding": [
"exchangeRate"
]
},
{
"Header": "{{salesArrangement.orderedProducts.functionalAmount}}",
"dataBinding": [
"functionalAmount"
],
"parseAs": "currency",
"footerFunc": "sum",
"functions": {
"format": [
"if (isFetchingUiModelData) return;",
"const model = \"everest.fin.accounting/SalesArrangementModel.SalesArrangement\";",
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const currencyId = getUiModelDataValue([model, \"functionalCurrency\"]);",
"const { codeValue: currency } = currencies?.find(({ codeNumber }) => codeNumber === currencyId) ?? {};",
"return currency;"
]
}
}
]
}
]
}
]
},
{
"title": "{{salesArrangement.billing.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "${subtitle} {{salesArrangement.billing.subtitle}}",
"secondParsing": "percent"
},
"uiModelBinding": {
"subtitle": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"pctBilled"
]
},
"functions": {
"isDisabled": "state.mode === 'create'"
},
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"functions": {
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "()=>showToast({type:'warning',title:'{{notImplementedR2.title}}',message:'{{notImplementedR2.message}}'})"
}
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"functions": {
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "(state.mode ==='edit')?'{{salesArrangement.callToAction.actions.saveRevisions}}':'{{salesArrangement.callToAction.actions.revise}}'",
"onClick": [
"() => {",
" if (state.mode !== 'edit') {",
" setState('mode', 'edit');",
" setTemplateActiveSegment(1);",
" } else {",
" const removeEmpty = (rawLine, index, idProp, model) => {",
" if (index === 0 || getFormAction(model) !== 'create') return;",
" const { [idProp]: id, ...line } = rawLine || {};",
" const isEmpty =",
" helpers.isEmpty(line) ||",
" Object.values(line).every(",
" (v) => v == null || (typeof v === 'object' && helpers.isEmpty(v))",
" );",
" if (isEmpty) deleteFormModel(model, true, false);",
" };",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const { values: salesArrangementProducts, matchingKeys: saKeys } =",
" getFormValueList(salModel, ['create', 'update', 'delete']) || [];",
" salesArrangementProducts?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementId', saKeys[index]),",
" []",
" );",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: salesArrangementPriceModelLineLines, matchingKeys: salesArrangementPriceModelLineKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create', 'update', 'delete']) || [];",
" salesArrangementPriceModelLineLines?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementProductId', salesArrangementPriceModelLineKeys[index]),",
" []",
" );",
" defaultSubmit({",
" skipRefetchOnSuccess: true,",
" onSuccess: async () => {",
" const formValues = getFormValues();",
"",
" Object.keys(formValues)",
" ?.filter((key) => key.includes(salModel))",
" ?.forEach((key) => {",
" deleteFormAction(key, 'create');",
" deleteFormAction(key, 'delete');",
" });",
"",
" const boModel =",
" 'everest.fin.accounting/BOComposition/SalesArrangementBusinessObjectModel.SalesArrangementBusinessObject';",
" const { id } = getUiModelDataValue([boModel])?.[0] ?? {};",
"",
" if (id != null) {",
" const updateBoResponse = await everestAction({",
" uiModelName: 'everest.fin.accounting/ui/accounting',",
" model: boModel,",
" action: 'update',",
" body: { id, headerKey: state.id },",
" fieldlist: [\"id\"],",
" });",
" console.log('BO Updated:', updateBoResponse);",
" }",
" await refetchUiModelData();",
" setState(\"mode\", \"view\");",
" },",
" transform: (rawValues) => {",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" let formValues = helpers.cloneDeep(rawValues);",
" delete formValues.billingAddressField;",
" for (let key in formValues) {",
" delete formValues[key].update?.childProduct;",
" delete formValues[key].create?.childProduct;",
" delete formValues[key].delete?.childProduct;",
" delete formValues[key].update?._id;",
" delete formValues[key].create?._id;",
" delete formValues[key].delete?._id;",
" delete formValues[key].update?.productCode;",
" delete formValues[key].create?.productCode;",
" delete formValues[key].delete?.productCode;",
" }",
"",
" const { values: createsalesArrangementProducts, matchingKeys: createSaKeys } =",
" getFormValueList(salModel, ['create']) || [];",
"",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: createLcLines, matchingKeys: createLcKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create']) || [];",
" createLcKeys.forEach((key) => {",
" if (createSaKeys.includes(`${key.charAt(0)}:${salModel}`)) {",
" delete formValues[key];",
" }",
" });",
"",
" createSaKeys.forEach((salKey, salIndex) => {",
" const charges = [];",
" createLcKeys.forEach((salesArrangementPriceModelLineKey, salesArrangementPriceModelLineIndex) => {",
" if (salesArrangementPriceModelLineKey.startsWith(salKey.charAt(0))) {",
" const data = createLcLines[salesArrangementPriceModelLineIndex];",
" delete data._id;",
" delete data.childProduct;",
" charges.push(data);",
" }",
" });",
" delete formValues[salKey].create;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementProduct',",
" ],",
" helpers.cloneDeep(rawValues[salKey].create)",
" );",
" delete formValues[salKey].createSalesArrangementProductWithPriceModelLines",
" .salesArrangementProduct._id;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementPriceModelLines',",
" ],",
" charges",
" );",
" });",
"",
" const { matchingKeys: salUpdateKeys } = getFormValueList(salModel, [\"update\"]) ?? [];",
" salUpdateKeys.forEach(key => {",
" delete formValues?.[key]?.update?.startDate;",
" delete formValues?.[key]?.update?.endDate;",
" });",
"",
" Object.entries(formValues).forEach(([key, value]) => {",
" if(!!value?.update) {",
" formValues[key] = {...value, fieldlist: [\"id\"]}",
" }",
" });",
"",
" return formValues;",
" },",
" });",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.approve}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 2, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.reject}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" const runResponse=await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 1, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
}
]
}
}
},
{
"component": "Block",
"collapsible": true,
"size": "11",
"title": "{{salesArrangement.details.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"onCollapseClick": "(collapsed) => {setState('detailsCollapsed', !collapsed)}",
"collapsed": "!!state.detailsCollapsed"
},
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"uiModelBinding": {
"id": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
]
}
}
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
],
"list": [
"everest.fin.accounting/BusinessPartnerModel.BusinessPartner"
],
"text": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerNumber"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"functions": {
"value": "const [address] = uiModelData?.['BillingAddress:everest.base/AddressModel.Address']?.result || [];if (address) {return `${address.line1}\n${address.line2}\n${address.city}, ${address.stateProvince} ${address.zipCode}\n${address.country}`;}return '';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"mainContactEmail"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"billingEmail"
]
}
}
]
},
{
"component": "SummaryText",
"size": "1",
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"component": "Block",
"collapsible": true,
"size": "12",
"title": "{{salesArrangement.orderDetails.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.orderDetailsCollapsed",
"onCollapseClick": "collapsed => setState('orderDetailsCollapsed', !collapsed)"
},
"disabledAction": {
"label": "{{salesArrangement.reviseDetails}}",
"functions": {
"onClick": "()=>setTemplateActiveSegment(1)"
}
},
"elements": [
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityName}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityName"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityId}}",
"link": {
"to": "https://www.google.com/",
"target": "_blank",
"rel": "noreferrer",
"isExternal": true
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityIdText"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.purchaseOrder}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"purchaseOrder"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesRep}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesRep"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.signDate}}",
"parseAs": "date",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"signDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.bookingDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"bookDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.effectiveDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesEffectiveDate"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesGroup}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesGroup"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.currency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.functionalCurrency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.notes}}",
"size": "2",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"memo"
]
}
}
]
},
{
"title": "{{salesArrangement.invoices.title}}",
"component": "WidgetGroup",
"size": "12",
"functions": {
"isDisabled": "state.mode === 'edit'"
},
"widgets": [
{
"label": "{{salesArrangement.invoices.invoices}}",
"component": "SecondaryTable",
"uiModelBinding": {
"data": [
"everest.fin.accounting/BillingPlanLineModel.BillingPlanLine"
]
},
"functions": {
"data": [
"const invoices = getUiModelDataValue([\"everest.fin.accounting/BillingPlanLineModel.BillingPlanLine\"]) ?? [];",
"return helpers.orderBy(invoices, \"billDate\");"
]
},
"groupBy": [
"billDate"
],
"columns": [
{
"Header": "{{salesArrangement.invoices.billPlanDate}}",
"dataBinding": [
"billDate"
],
"parseAs": "date"
},
{
"Header": "",
"dataBinding": [
"billingPlanLineNumber"
]
},
{
"Header": "",
"dataBinding": [
"product"
]
},
{
"Header": "{{salesArrangement.invoices.billingPlan}}",
"dataBinding": [
"billingPlan"
],
"functions": {
"onCellClick": [
"({ row }) => {",
" const filterData = getUiModelDataValue([",
" \"everest.fin.accounting/BillingPlanModel.BillingPlan\",",
" ]) ?? [];",
" openModal({",
" title: \"{{billingPlansSalesArrangement.billingPlan}}\",",
" template:",
" \"/templates/everest.fin.accounting/ui/billingPlansSalesArrangement?saId=\" +",
" state.id + \"&selectedBillingPlan=\" + row.original.billingPlanId,",
" filter: {",
" defaultValue: row.original.billingPlanId,",
" items: filterData?.map(({ id: value, billingPlanNumber: label }) => ({ label, value })),",
" },",
" });",
"}"
]
}
},
{
"Header": "{{salesArrangement.invoices.amount}}",
"dataBinding": [
"amount"
],
"aggregate": "sum",
"parseAs": "currency"
},
{
"Header": "{{salesArrangement.invoices.startDate}}",
"dataBinding": [
"serviceStart"
],
"parseAs": "date",
"aggregate": "minDate"
},
{
"Header": "{{salesArrangement.invoices.endDate}}",
"dataBinding": [
"serviceEnd"
],
"parseAs": "date",
"aggregate": "maxDate"
},
{
"Header": "{{salesArrangement.invoices.status}}",
"dataBinding": {
"rawValue": [
"invoiceStatus"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "InvoiceStatus"
}
},
{
"Header": "{{salesArrangement.invoices.invoice}}",
"dataBinding": [
"invoice"
],
"functions": {
"onCellClick": "({column, row}) => navigate({ to: '/templates/everest.fin.accounting/ui/invoice?id='+row.original.invoiceId })"
}
}
]
},
{
"label": "{{salesArrangement.invoices.invoiceLines}}",
"component": "SecondaryTable",
"uiModelBinding": {
"data": [
"everest.fin.accounting/InvoiceLineModel.InvoiceLine"
]
},
"columns": [
{
"Header": "{{salesArrangement.invoices.product}}",
"dataBinding": [
"product"
],
"functions": {
"onCellClick": "({column, row}) => navigate({ to: '/templates/everest.fin.accounting/ui/product?id='+row.original.productId })"
}
},
{
"Header": "{{salesArrangement.invoices.billingPlan}}",
"dataBinding": [
"billingPlan"
],
"functions": {
"onCellClick": [
"({ row }) => {",
" const filterData = getUiModelDataValue([",
" \"everest.fin.accounting/BillingPlanModel.BillingPlan\",",
" ]) ?? [];",
" openModal({",
" title: \"{{billingPlansSalesArrangement.billingPlan}}\",",
" template:",
" \"/templates/everest.fin.accounting/ui/billingPlansSalesArrangement?saId=\" +",
" state.id + \"&selectedBillingPlan=\" + row.original.billingPlanId,",
" filter: {",
" defaultValue: row.original.billingPlanId,",
" items: filterData?.map(({ id: value, billingPlanNumber: label }) => ({ label, value })),",
" },",
" });",
"}"
]
}
},
{
"Header": "{{salesArrangement.invoices.salesArrLine}}",
"dataBinding": [
"salesArrLine"
]
},
{
"Header": "{{salesArrangement.invoices.startDate}}",
"dataBinding": [
"serviceStart"
],
"parseAs": "date",
"format": "P"
},
{
"Header": "{{salesArrangement.invoices.endDate}}",
"dataBinding": [
"serviceEnd"
],
"parseAs": "date",
"format": "P"
},
{
"Header": "{{salesArrangement.invoices.amount}}",
"dataBinding": [
"amount"
],
"parseAs": "currency"
}
]
}
]
},
{
"component": "Template",
"functions": {
"link": "'/templates/everest.fin.accounting/ui/billingSchedule?id=' + state.id"
}
}
]
},
{
"title": "{{salesArrangement.revenue.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "${subtitle} {{salesArrangement.revenue.subtitle}}",
"secondParsing": "shortPercent"
},
"uiModelBinding": {
"subtitle": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"pctRecognizedRevenue"
]
},
"functions": {
"isDisabled": "state.mode === 'create'"
},
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"functions": {
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "()=>showToast({type:'warning',title:'{{notImplementedR2.title}}',message:'{{notImplementedR2.message}}'})"
}
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"functions": {
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "(state.mode ==='edit')?'{{salesArrangement.callToAction.actions.saveRevisions}}':'{{salesArrangement.callToAction.actions.revise}}'",
"onClick": [
"() => {",
" if (state.mode !== 'edit') {",
" setState('mode', 'edit');",
" setTemplateActiveSegment(1);",
" } else {",
" const removeEmpty = (rawLine, index, idProp, model) => {",
" if (index === 0 || getFormAction(model) !== 'create') return;",
" const { [idProp]: id, ...line } = rawLine || {};",
" const isEmpty =",
" helpers.isEmpty(line) ||",
" Object.values(line).every(",
" (v) => v == null || (typeof v === 'object' && helpers.isEmpty(v))",
" );",
" if (isEmpty) deleteFormModel(model, true, false);",
" };",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const { values: salesArrangementProducts, matchingKeys: saKeys } =",
" getFormValueList(salModel, ['create', 'update', 'delete']) || [];",
" salesArrangementProducts?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementId', saKeys[index]),",
" []",
" );",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: salesArrangementPriceModelLineLines, matchingKeys: salesArrangementPriceModelLineKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create', 'update', 'delete']) || [];",
" salesArrangementPriceModelLineLines?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementProductId', salesArrangementPriceModelLineKeys[index]),",
" []",
" );",
" defaultSubmit({",
" skipRefetchOnSuccess: true,",
" onSuccess: async () => {",
" const formValues = getFormValues();",
"",
" Object.keys(formValues)",
" ?.filter((key) => key.includes(salModel))",
" ?.forEach((key) => {",
" deleteFormAction(key, 'create');",
" deleteFormAction(key, 'delete');",
" });",
"",
" const boModel =",
" 'everest.fin.accounting/BOComposition/SalesArrangementBusinessObjectModel.SalesArrangementBusinessObject';",
" const { id } = getUiModelDataValue([boModel])?.[0] ?? {};",
"",
" if (id != null) {",
" const updateBoResponse = await everestAction({",
" uiModelName: 'everest.fin.accounting/ui/accounting',",
" model: boModel,",
" action: 'update',",
" body: { id, headerKey: state.id },",
" fieldlist: [\"id\"],",
" });",
" console.log('BO Updated:', updateBoResponse);",
" }",
" await refetchUiModelData();",
" setState(\"mode\", \"view\");",
" },",
" transform: (rawValues) => {",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" let formValues = helpers.cloneDeep(rawValues);",
" delete formValues.billingAddressField;",
" for (let key in formValues) {",
" delete formValues[key].update?.childProduct;",
" delete formValues[key].create?.childProduct;",
" delete formValues[key].delete?.childProduct;",
" delete formValues[key].update?._id;",
" delete formValues[key].create?._id;",
" delete formValues[key].delete?._id;",
" delete formValues[key].update?.productCode;",
" delete formValues[key].create?.productCode;",
" delete formValues[key].delete?.productCode;",
" }",
"",
" const { values: createsalesArrangementProducts, matchingKeys: createSaKeys } =",
" getFormValueList(salModel, ['create']) || [];",
"",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: createLcLines, matchingKeys: createLcKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create']) || [];",
" createLcKeys.forEach((key) => {",
" if (createSaKeys.includes(`${key.charAt(0)}:${salModel}`)) {",
" delete formValues[key];",
" }",
" });",
"",
" createSaKeys.forEach((salKey, salIndex) => {",
" const charges = [];",
" createLcKeys.forEach((salesArrangementPriceModelLineKey, salesArrangementPriceModelLineIndex) => {",
" if (salesArrangementPriceModelLineKey.startsWith(salKey.charAt(0))) {",
" const data = createLcLines[salesArrangementPriceModelLineIndex];",
" delete data._id;",
" delete data.childProduct;",
" charges.push(data);",
" }",
" });",
" delete formValues[salKey].create;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementProduct',",
" ],",
" helpers.cloneDeep(rawValues[salKey].create)",
" );",
" delete formValues[salKey].createSalesArrangementProductWithPriceModelLines",
" .salesArrangementProduct._id;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementPriceModelLines',",
" ],",
" charges",
" );",
" });",
"",
" const { matchingKeys: salUpdateKeys } = getFormValueList(salModel, [\"update\"]) ?? [];",
" salUpdateKeys.forEach(key => {",
" delete formValues?.[key]?.update?.startDate;",
" delete formValues?.[key]?.update?.endDate;",
" });",
"",
" return formValues;",
" },",
" });",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.approve}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 2, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.reject}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" const runResponse=await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 1, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
}
]
}
}
},
{
"component": "Block",
"collapsible": true,
"size": "11",
"title": "{{salesArrangement.details.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"onCollapseClick": "(collapsed) => {setState('detailsCollapsed', !collapsed)}",
"collapsed": "!!state.detailsCollapsed"
},
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"uiModelBinding": {
"id": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
]
}
}
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
],
"list": [
"everest.fin.accounting/BusinessPartnerModel.BusinessPartner"
],
"text": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerNumber"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"functions": {
"value": "const [address] = uiModelData?.['BillingAddress:everest.base/AddressModel.Address']?.result || [];if (address) {return `${address.line1}\n${address.line2}\n${address.city}, ${address.stateProvince} ${address.zipCode}\n${address.country}`;}return '';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"mainContactEmail"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"billingEmail"
]
}
}
]
},
{
"component": "SummaryText",
"size": "1",
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"component": "Block",
"collapsible": true,
"size": "12",
"title": "{{salesArrangement.orderDetails.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.orderDetailsCollapsed",
"onCollapseClick": "collapsed => setState('orderDetailsCollapsed', !collapsed)"
},
"disabledAction": {
"label": "{{salesArrangement.reviseDetails}}",
"functions": {
"onClick": "()=>setTemplateActiveSegment(1)"
}
},
"elements": [
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityName}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityName"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityId}}",
"link": {
"to": "https://www.google.com/",
"target": "_blank",
"rel": "noreferrer",
"isExternal": true
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityIdText"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.purchaseOrder}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"purchaseOrder"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesRep}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesRep"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.signDate}}",
"parseAs": "date",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"signDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.bookingDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"bookDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.effectiveDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesEffectiveDate"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesGroup}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesGroup"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.currency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.functionalCurrency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.notes}}",
"size": "2",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"memo"
]
}
}
]
},
{
"component": "Template",
"functions": {
"link": "'/templates/everest.fin.accounting/ui/revenueWaterfall?id=' + state.id"
}
}
]
}
]
}
]
}
}
{
"version": 2,
"uicontroller": "salesArrangementNext.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModel": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLine": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModel",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "priceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"uiModelBinding": {
"status": "SalesArrangement.salesArrangementStatus",
"subtitle": "SalesArrangement.salesArrangementNumber"
}
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"uiModelBinding": {
"subtitle": "SalesArrangement.totalAmount"
},
"functions": {
"isDisabled": "state.mode === 'create'"
},
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"functions": {
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
}
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"functions": {
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
}
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"onCollapseClick": "(collapsed) => {setState('detailsCollapsed', !collapsed)}",
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.detailsCollapsed"
},
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"uiModelBinding": {
"id": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
]
}
}
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
],
"list": [
"everest.fin.accounting/BusinessPartnerModel.BusinessPartner"
],
"text": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerNumber"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"functions": {
"value": "const [address] = uiModelData?.['BillingAddress:everest.base/AddressModel.Address']?.result || [];if (address) {return `${address.line1}\n${address.line2}\n${address.city}, ${address.stateProvince} ${address.zipCode}\n${address.country}`;}return '';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"mainContactEmail"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"billingEmail"
]
}
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"component": "Block",
"collapsible": true,
"size": "12",
"title": "{{salesArrangement.orderDetails.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.orderDetailsCollapsed",
"onCollapseClick": "collapsed => setState('orderDetailsCollapsed', !collapsed)"
},
"disabledAction": {
"label": "{{salesArrangement.reviseDetails}}",
"functions": {
"onClick": "()=>setTemplateActiveSegment(1)"
}
},
"elements": [
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityName}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityName"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityId}}",
"link": {
"to": "https://www.google.com/",
"target": "_blank",
"rel": "noreferrer",
"isExternal": true
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityIdText"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.purchaseOrder}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"purchaseOrder"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesRep}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesRep"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.signDate}}",
"parseAs": "date",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"signDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.bookingDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"bookDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.effectiveDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesEffectiveDate"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesGroup}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesGroup"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.currency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.functionalCurrency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.notes}}",
"size": "2",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"memo"
]
}
}
]
},
{
"component": "Template",
"size": "11",
"functions": {
"link": "'/templates/everest.fin.accounting/ui/balanceRollforward?id=' + state.id"
}
},
{
"component": "SectionGroup",
"size": "1",
"sections": [
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"title": "{{salesArrangement.activity.title}}",
"component": "WidgetGroup",
"functions": {
"isDisabled": "state.mode === 'edit'"
},
"widgets": [
{
"label": "{{salesArrangement.activity.log}}",
"component": "Messaging",
"dateFormat": "P",
"uiModelBinding": {
"list": [
"TODO"
]
}
},
{
"component": "Messaging",
"label": "{{salesArrangement.activity.notes}}",
"uiModelBinding": {
"list": [
"TODO"
]
},
"dateFormat": "P"
}
]
}
]
}
]
},
{
"title": "{{salesArrangement.orderedProducts.title}}",
"functions": {
"subtitle": "state.mode === 'create' ? '{{salesArrangement.orderedProducts.notSaved}}' : '{{salesArrangement.orderedProducts.saved}}'"
},
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"functions": {
"label": "state.mode==='create'?'{{salesArrangement.callToAction.actions.save}}':'{{salesArrangement.callToAction.actions.activate}}'",
"disabled": "formState?.isSubmitting || state.mode==='edit' || isFetchingUiModelData || (state.mode === 'create' && formState?.hasError)",
"onClick": [
"() => {",
" if (state.mode === 'create') {",
" const removeEmpty = (rawLine, index, idProp, model) => {",
" if (index === 0 || getFormAction(model) !== 'create') return;",
" const { [idProp]: id, ...line } = rawLine || {};",
" const isEmpty =",
" helpers.isEmpty(line) ||",
" Object.values(line).every(",
" (v) => v == null || (typeof v === 'object' && helpers.isEmpty(v))",
" );",
" if (isEmpty) deleteFormModel(model, true, false);",
" };",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const { values: salesArrangementProducts, matchingKeys: saKeys } =",
" getFormValueList(salModel, ['create', 'update', 'delete']) || [];",
" salesArrangementProducts?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementId', saKeys[index]),",
" []",
" );",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: salesArrangementPriceModelLineLines, matchingKeys: salesArrangementPriceModelLineKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create', 'update', 'delete']) || [];",
" salesArrangementPriceModelLineLines?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementProductId', salesArrangementPriceModelLineKeys[index]),",
" []",
" );",
" defaultSubmit({",
" onSuccess: async () => {",
" navigate({",
" to: '/templates/everest.fin.accounting/ui/salesArrangements',",
" closeCurrentTab: true,",
" });",
" },",
" transform: (rawValues) => {",
" const saModel =",
" 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" let formValues = {",
" [saModel]: {",
" createSalesArrangementWithLines: {",
" salesArrangement: {",
" ...helpers.cloneDeep(",
" rawValues[saModel].createSalesArrangementWithLines",
" ),",
" },",
" salesArrangementProducts: [],",
" salesArrangementPriceModelLines: [],",
" },",
" },",
" };",
" delete formValues.billingAddressField;",
" const formKeys = Object.keys(rawValues);",
" formKeys.forEach((key) => {",
" if (key.includes('SalesArrangementProduct')) {",
" const charges = [];",
" const currentSAL = helpers.cloneDeep(rawValues[key].create);",
" delete currentSAL._id;",
" delete currentSAL.productCode",
" formKeys.forEach((entry) => {",
" if (",
" entry.includes('SalesArrangementPriceModelLine') &&",
" entry.startsWith(key.charAt(0))",
" ) {",
" const salesArrangementPriceModelLine = helpers.cloneDeep(rawValues[entry].create);",
" delete salesArrangementPriceModelLine._id;",
" delete salesArrangementPriceModelLine.childProduct;",
" charges.push(salesArrangementPriceModelLine);",
" }",
" });",
" formValues[",
" saModel",
" ].createSalesArrangementWithLines.salesArrangementProducts.push(",
" currentSAL",
" );",
" formValues[",
" saModel",
" ].createSalesArrangementWithLines.salesArrangementPriceModelLines.push(charges);",
" }",
" });",
"",
" Object.entries(formValues).forEach(([key, value]) => {",
" if(!!value?.update) {",
" formValues[key] = {...value, fieldlist: [\"id\"]}",
" }",
" });",
"",
" return formValues;",
" },",
" });",
" } else {",
" showToast({",
" type: 'warning',",
" title: '{{notImplementedR2.title}}',",
" message: '{{notImplementedR2.message}}',",
" });",
" }",
"}"
]
}
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"functions": {
"disabled": "state.mode === \"create\""
},
"actions": [
{
"functions": {
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "(state.mode ==='edit')?'{{salesArrangement.callToAction.actions.saveRevisions}}':'{{salesArrangement.callToAction.actions.revise}}'",
"onClick": [
"() => {",
" if (state.mode !== 'edit') {",
" setState('mode', 'edit');",
" setTemplateActiveSegment(1);",
" } else {",
" const removeEmpty = (rawLine, index, idProp, model) => {",
" if (index === 0 || getFormAction(model) !== 'create') return;",
" const { [idProp]: id, ...line } = rawLine || {};",
" const isEmpty =",
" helpers.isEmpty(line) ||",
" Object.values(line).every(",
" (v) => v == null || (typeof v === 'object' && helpers.isEmpty(v))",
" );",
" if (isEmpty) deleteFormModel(model, true, false);",
" };",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const { values: salesArrangementProducts, matchingKeys: saKeys } =",
" getFormValueList(salModel, ['create', 'update', 'delete']) || [];",
" salesArrangementProducts?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementId', saKeys[index]),",
" []",
" );",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: salesArrangementPriceModelLineLines, matchingKeys: salesArrangementPriceModelLineKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create', 'update', 'delete']) || [];",
" salesArrangementPriceModelLineLines?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementProductId', salesArrangementPriceModelLineKeys[index]),",
" []",
" );",
" defaultSubmit({",
" skipRefetchOnSuccess: true,",
" onSuccess: async () => {",
" const formValues = getFormValues();",
"",
" Object.keys(formValues)",
" ?.filter((key) => key.includes(salModel))",
" ?.forEach((key) => {",
" deleteFormAction(key, 'create');",
" deleteFormAction(key, 'delete');",
" });",
"",
" const boModel =",
" 'everest.fin.accounting/BOComposition/SalesArrangementBusinessObjectModel.SalesArrangementBusinessObject';",
" const { id } = getUiModelDataValue([boModel])?.[0] ?? {};",
"",
" if (id != null) {",
" const updateBoResponse = await everestAction({",
" uiModelName: 'everest.fin.accounting/ui/accounting',",
" model: boModel,",
" action: 'update',",
" body: { id, headerKey: state.id },",
" fieldlist: [\"id\"],",
" });",
" console.log('BO Updated:', updateBoResponse);",
" }",
" await refetchUiModelData();",
" setState(\"mode\", \"view\");",
" },",
" transform: (rawValues) => {",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" let formValues = helpers.cloneDeep(rawValues);",
" delete formValues.billingAddressField;",
" for (let key in formValues) {",
" delete formValues[key].update?.childProduct;",
" delete formValues[key].create?.childProduct;",
" delete formValues[key].delete?.childProduct;",
" delete formValues[key].update?._id;",
" delete formValues[key].create?._id;",
" delete formValues[key].delete?._id;",
" delete formValues[key].update?.productCode;",
" delete formValues[key].create?.productCode;",
" delete formValues[key].delete?.productCode;",
" }",
"",
" const { values: createsalesArrangementProducts, matchingKeys: createSaKeys } =",
" getFormValueList(salModel, ['create']) || [];",
"",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: createLcLines, matchingKeys: createLcKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create']) || [];",
" createLcKeys.forEach((key) => {",
" if (createSaKeys.includes(`${key.charAt(0)}:${salModel}`)) {",
" delete formValues[key];",
" }",
" });",
"",
" createSaKeys.forEach((salKey, salIndex) => {",
" const charges = [];",
" createLcKeys.forEach((salesArrangementPriceModelLineKey, salesArrangementPriceModelLineIndex) => {",
" if (salesArrangementPriceModelLineKey.startsWith(salKey.charAt(0))) {",
" const data = createLcLines[salesArrangementPriceModelLineIndex];",
" delete data._id;",
" delete data.childProduct;",
" charges.push(data);",
" }",
" });",
" delete formValues[salKey].create;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementProduct',",
" ],",
" helpers.cloneDeep(rawValues[salKey].create)",
" );",
" delete formValues[salKey].createSalesArrangementProductWithPriceModelLines",
" .salesArrangementProduct._id;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementPriceModelLines',",
" ],",
" charges",
" );",
" });",
"",
" const { matchingKeys: salUpdateKeys } = getFormValueList(salModel, [\"update\"]) ?? [];",
" salUpdateKeys.forEach(key => {",
" delete formValues?.[key]?.update?.startDate;",
" delete formValues?.[key]?.update?.endDate;",
" });",
"",
" Object.entries(formValues).forEach(([key, value]) => {",
" if(!!value?.update) {",
" formValues[key] = {...value, fieldlist: [\"id\"]}",
" }",
" });",
"",
" return formValues;",
" },",
" });",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.approve}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 2, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.reject}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" const runResponse=await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 1, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
}
]
}
}
},
{
"component": "Block",
"functions": {
"onCollapseClick": "(collapsed) => {setState('detailsCollapsed', !collapsed)}",
"collapsed": "!!state.detailsCollapsed"
},
"collapsible": true,
"size": "11",
"title": "{{salesArrangement.details.title}}",
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"prefixProp": "businessPartnerNumber",
"isDisabled": false,
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"uiModelBinding": {
"id": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
]
}
}
},
"customAction": {
"label": "{{salesArrangement.details.createNew}}",
"type": "dark-grey",
"functions": {
"isVisible": "state.mode==='edit' || state.mode==='create'",
"onClick": "()=>openModal({title:'{{salesArrangement.details.createCustomer}}',template:'/templates/everest.fin.accounting/ui/businessPartnerCreate',onModalSubmit:(createdBusinessPartner)=>{if(createdBusinessPartner==null)return;refetchUiModelData(); const action=state.mode==='create'?'createSalesArrangementWithLines':'update';setFormValue(['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'],action,createdBusinessPartner)}})"
}
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
],
"list": [
"everest.fin.accounting/BusinessPartnerModel.BusinessPartner"
],
"text": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"onChange": "(value)=>{const action=state.mode==='create' ? 'createSalesArrangementWithLines':'update';setFormValue(['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'],action,value)}"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"uiModelBinding": {
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
],
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerNumber"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find(b=>b.id==partnerId);return partner?.businessPartnerNumber||'';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"uiModelBinding": {},
"name": "billingAddressField",
"functions": {
"isEditing": "state.mode === 'create' || state.mode === 'edit'",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find((b)=>b.id==partnerId);const address=getUiModelDataValue(['everest.base/AddressModel.Address',])?.find((address)=>address.id==partner?.defaultBillingAddressId);const addressLines=[address?.line1,address?.line2,`${address?.city}, ${address?.stateProvince} ${address?.zipCode}`,address?.country,].filter(Boolean).join(`\n`);return address?addressLines:'';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"uiModelBinding": {
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
],
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"mainContactEmail"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update'",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId',];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find((b)=>b.id==partnerId);return partner?.mainContactEmail??'';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"uiModelBinding": {
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
],
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"billingEmail"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId',];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find((b)=>b.id==partnerId);return partner?.billingEmail??'';"
}
}
]
},
{
"component": "SummaryText",
"size": "1",
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"functions": {
"value": [
"if (state.mode !== \"edit\" && state.mode !== \"create\") {",
" return getUiModelDataValue([",
" \"everest.fin.accounting/SalesArrangementModel.SalesArrangement\", \"totalAmount\",",
" ]);",
"}",
"",
"const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"const salesArrangementPriceModelLines = getFormValueList(model, [\"update\", \"create\"])?.values || [];",
"",
"const total = salesArrangementPriceModelLines.reduce((acc, line) => {",
" const amount = new Decimal(line.amount);",
" if (amount.isNaN()) return acc;",
" return amount.plus(acc);",
"}, new Decimal(0));",
"",
"return total.toFixed();"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"component": "Block",
"collapsible": true,
"size": "12",
"title": "{{salesArrangement.orderDetails.title}}",
"functions": {
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.orderDetailsCollapsed",
"onCollapseClick": "collapsed => setState('orderDetailsCollapsed', !collapsed)"
},
"elements": [
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityName}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityId}}",
"link": {
"to": "https://www.google.com/",
"target": "_blank",
"rel": "noreferrer",
"isExternal": true
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityIdText"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.purchaseOrder}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"purchaseOrder"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesRep}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesRep"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.signDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"signDate"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.bookingDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"bookDate"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.effectiveDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesEffectiveDate"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesGroup}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesGroup"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Select",
"idProp": "codeNumber",
"textProp": "text",
"label": "{{salesArrangement.orderDetails.currency}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"currency"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"text": [
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const currencyId = getUiModelDataValue([\"everest.fin.accounting/SalesArrangementModel.SalesArrangement\",\"currency\"]);",
"const { text: currency } = currencies.find(({ codeNumber }) => codeNumber === currencyId) ?? {};",
"return currency"
],
"list": [
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const usDollar = 149;",
"const sortedCurrencies = currencies.sort((a, b) => {",
" if (a.codeNumber === usDollar) return -1;",
" if (b.codeNumber === usDollar) return 1;",
" return a.text.localeCompare(b.text);",
"});",
"return sortedCurrencies"
]
}
},
{
"component": "Select",
"idProp": "codeNumber",
"textProp": "text",
"label": "{{salesArrangement.orderDetails.functionalCurrency}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"functionalCurrency"
],
"list": [
"Currency:everest.appserver/ValueHelpModel.ValueHelp"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"text": [
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const currencyId = getUiModelDataValue([\"everest.fin.accounting/SalesArrangementModel.SalesArrangement\",\"functionalCurrency\"]);",
"const { text: currency } = currencies.find(({ codeNumber }) => codeNumber === currencyId) ?? {};",
"return currency"
],
"value": [
"const modelValue = getUiModelDataValue(['everest.fin.accounting/SalesArrangementModel.SalesArrangement', 'functionalCurrency'])",
"return state.mode === 'create' ? 149 : modelValue;"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.notes}}",
"size": "2",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"memo"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
}
]
},
{
"component": "MultipleSecondaryTable",
"title": "{{salesArrangement.orderedProducts.title}}",
"size": "12",
"disabledActions": [
"delete"
],
"functions": {
"isEditing": "state.mode === \"edit\" || state.mode === \"create\""
},
"extraAction": {
"functions": {
"isVisible": "state.mode==='edit' || state.mode==='create'",
"onClick": [
"const lineModel = \"everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct\";",
"const salesArrangementPriceModelLineModel = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"const isCreate = state.mode === \"create\";",
"return () => {",
" const _id = Number(helpers.uniqueId());",
" const initialIndex = getFormValueList(lineModel, [",
" \"create\",",
" \"update\",",
" \"delete\",",
" \"createSalesArrangementWithLines\",",
" ]).values.length;",
" setFormValue([`${initialIndex}:${lineModel}`], \"create\", { _id, salesArrangementId: Number(state.id) });",
" setFormValue([`${initialIndex}-0:${salesArrangementPriceModelLineModel}`], \"create\", { _id });",
" setFormValue([`${initialIndex}-1:${salesArrangementPriceModelLineModel}`], \"create\", { _id });",
" setFormValue([`${initialIndex}-2:${salesArrangementPriceModelLineModel}`], \"create\", { _id });",
"}"
]
},
"label": "{{salesArrangement.orderedProducts.addMore}}",
"icon": "plus-circle-havlock"
},
"tables": [
{
"relationshipKey": [
"_id"
],
"rowActionsIcon": "times-circle-brick",
"rowActions": [
{
"label": "{{salesArrangement.orderedProducts.undoDelete}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"onClick": "(_, tableIndex)=>modifyFormAction(`${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`,\"delete\", \"update\")",
"getIsRowVisible": "(_, tableIndex)=>getFormAction(`${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`) === \"delete\""
}
},
{
"color": "brick",
"label": "{{salesArrangement.orderedProducts.deleteLine}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"onClick": [
"(_, tableIndex) => {",
" const lineModel = `${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`;",
" const salesArrangementPriceModelLineModel = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"",
" const salesArrangementPriceModelLines = Object.keys(getFormValues()).filter(",
" key => key.match(`${tableIndex}+-[0-9]+:${salesArrangementPriceModelLineModel}`)",
" );",
"",
" const salAction = getFormAction(lineModel);",
" if(salAction === \"update\") modifyFormAction(lineModel, \"update\", \"delete\");",
" else deleteFormModel(lineModel);",
"",
" salesArrangementPriceModelLines.reverse().forEach(key => {",
" const lineAction = getFormAction(key);",
" if(lineAction === \"update\") modifyFormAction(key, \"update\", \"delete\");",
" else deleteFormModel(key);",
" });",
"}"
],
"getIsRowDisabled": "(_, tableIndex)=>getFormAction(`${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`) === \"delete\""
}
}
],
"uiModelBinding": {
"data": [
"everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct"
]
},
"editDisplayActions": [
"create",
"update",
"delete",
"createSalesArrangementWithLines"
],
"functions": {
"data": [
"const isCreate = state.mode === \"create\";",
"const model=\"everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct\";",
"const salesArrangementPriceModelLineModel = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"if (isCreate && !getFormValueList(model, [\"create\"])?.values.length) {",
" setFormValue([`0:${model}`], \"create\", { _id: 1 });",
" setFormValue([`0-0:${salesArrangementPriceModelLineModel}`], \"create\", { _id: 1 });",
" setFormValue([`0-1:${salesArrangementPriceModelLineModel}`], \"create\", { _id: 1 });",
" setFormValue([`0-2:${salesArrangementPriceModelLineModel}`], \"create\", { _id: 1 });",
" return;",
"};",
"const data = getUiModelDataValue([ model ]) ?? [];",
"return data?.map(sal => ({ ...sal, _id: sal?.id }));"
],
"defaultAction": "if (state.mode === \"create\") return \"createSalesArrangementWithLines\"; return \"update\";"
},
"columns": [
{
"Header": "{{salesArrangement.orderedProducts.salesArrangementProduct}}",
"dataBinding": [
"salesArrangementProductNumber"
],
"sticky": "left",
"isEditable": false
},
{
"Header": "{{salesArrangement.orderedProducts.product}}",
"dataBinding": [
"productCode"
],
"sticky": "left",
"alwaysEditableCellActions": [
"create"
],
"isEditable": false,
"functions": {
"onCellClick": "({column, row}) => navigate({ to: \"/templates/everest.fin.accounting/ui/product?id=\"+row.original.productId })",
"multiLevelSelectConfig": [
"const onChange = (e, { key, label, name }) => {",
" const [model] = name.split('.');",
" const [tableIndex] = name.split(':');",
" const [code, productName] = label.split(' - ');",
" const ppcId = e.key.split('-')[1];",
" const pcModel = 'everest.fin.accounting/ProductChargeModel.ProductCharge';",
" setFormValue([model, 'productName'], 'create', productName);",
" const productData =",
" uiModelData['everest.fin.accounting/ProductModel.Product']?.result;",
" if (productData) {",
" const { id } = productData.products.find(",
" (entry) => entry.productCode === code",
" ) ?? {};",
" setFormValue([model, 'productId'], getFormAction(model), id);",
" }",
" everestAction({",
" uiModelName: 'everest.fin.accounting/ui/accounting',",
" model: pcModel,",
" action: 'query',",
" body: { where: { productPriceConfigurationId: ppcId } },",
" }).then((result) => {",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const referenceKey = getFormValue([`${tableIndex}-0:${salesArrangementPriceModelLineModel}`, \"_id\"], \"create\");",
"",
" const salesArrangementPriceModelLines = Object.keys(getFormValues()).filter(",
" key => key.match(`${tableIndex}+-[0-9]+:${salesArrangementPriceModelLineModel}`)",
" );",
"",
" salesArrangementPriceModelLines.reverse().forEach((key) => {",
" deleteFormModel(key);",
" });",
"",
" const priceConfigurations = result[pcModel].result;",
" let pcCount = 0;",
" priceConfigurations.forEach((pc) => {",
" const props = [",
" 'productId',",
" 'productName',",
" 'priceModel',",
" 'priceType',",
" 'billingFrequency',",
" 'billingTiming',",
" 'unitOfMeasure',",
" 'listPrice',",
" ];",
" const indexedModel = `${tableIndex}-${pcCount++}:${salesArrangementPriceModelLineModel}`;",
" const values = {...helpers.pick(pc, props), _id: referenceKey };",
" setFormValue([indexedModel], 'create', values);",
" });",
" });",
"};",
"",
"const result = {",
" data: [],",
" onChange,",
" extraAction: { onClick: () => openModal({ template: '/templates/everest.fin.accounting/ui/productCatalog', title: '{{productCatalog.title}}' }), icon: 'list' },",
"};",
"",
"const fetchedData = getUiModelDataValue([",
" 'everest.fin.accounting/ProductModel.Product',",
"]);",
"",
"if (!fetchedData) return result;",
"const { products, productPriceConfigurations } = fetchedData;",
"const preparedData = [];",
"products.forEach(({ productCode, productName, id }, i) => {",
" const pc = productPriceConfigurations[i];",
" preparedData.push({",
" label: `${productCode} - ${productName}`,",
" value: id,",
" data: pc.map((entry) => ({",
" value: entry.id,",
" label: entry.productPriceConfigurationName,",
" })),",
" });",
"});",
"",
"return { ...result, data: preparedData };"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.productName}}",
"dataBinding": [
"productName"
],
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.amount}}",
"dataBinding": [
"amount"
],
"parseAs": "currency",
"isEditable": false
},
{
"Header": "{{salesArrangement.orderedProducts.billingStartDate}}",
"dataBinding": [
"startDate"
],
"parseAs": "date"
},
{
"Header": "{{salesArrangement.orderedProducts.billingEndDate}}",
"dataBinding": [
"endDate"
],
"parseAs": "date"
},
{
"Header": "{{salesArrangement.orderedProducts.paymentTerm}}",
"dataBinding": {
"rawValue": [
"paymentTerm"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "PaymentTerm"
},
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.totalInvoiced}}",
"dataBinding": [
"totalInvoiced"
],
"parseAs": "currency",
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.currency}}",
"dataBinding": {
"rawValue": [
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.functionalCurrency}}",
"dataBinding": {
"rawValue": [
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.functionalAmount}}",
"dataBinding": [
"functionalAmount"
],
"parseAs": "currency",
"functions": {
"format": [
"if (isFetchingUiModelData) return;",
"const model = \"everest.fin.accounting/SalesArrangementModel.SalesArrangement\";",
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const currencyId = getUiModelDataValue([model, \"functionalCurrency\"]);",
"const { codeValue: currency } = currencies?.find(({ codeNumber }) => codeNumber === currencyId) ?? {};",
"return currency;"
]
}
}
]
},
{
"rowActionsIcon": "plus-circle-havlock",
"rowActions": [
{
"label": "{{salesArrangement.orderedProducts.addAnotherLine}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"onClick": [
"(_, tableIndex) => {",
" const parentModel = `${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`;",
" const parentAction = getFormAction(parentModel);",
" const { id: _id } = getFormValue([parentModel], parentAction) ?? {};",
" const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"",
" const { id: salesArrangementProductId } = getFormValue([parentModel], \"update\") ?? {};",
" const { salesArrangementPriceModelId } = getUiModelDataValue([model])?.find(salesArrangementPriceModelLine => salesArrangementPriceModelLine.salesArrangementProductId === salesArrangementProductId) ?? {};",
"",
" const formKeys = Object.keys(getFormValues());",
" const alias = formKeys.filter(key => key.match(`${tableIndex}+-[0-9]:${model}`))?.length;",
" setFormValue([`${tableIndex}-${alias}:${model}`], \"create\", { _id, salesArrangementPriceModelId, salesArrangementProductId });",
"}"
]
}
},
{
"label": "{{salesArrangement.orderedProducts.duplicateLine}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"getIsRowDisabled": "(rowIndex, tableIndex)=>getFormAction(`${tableIndex}-${rowIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`) === \"delete\"",
"onClick": [
"(rowIndex, tableIndex) => {",
" const formKeys = Object.keys(getFormValues());",
" const salModel = `${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`;",
" const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
" const alias = formKeys.filter(key => key.match(`${tableIndex}+-[0-9]:${model}`))?.length;",
"",
" const { id, ...values } = getFormModelValue(`${tableIndex}-${rowIndex}:${model}`) ?? {};",
" const { id: salesArrangementProductId } = getFormValue([salModel], \"update\") ?? {};",
" const { salesArrangementPriceModelId } = getUiModelDataValue([model])?.find(salesArrangementPriceModelLine => salesArrangementPriceModelLine.salesArrangementProductId === salesArrangementProductId) ?? {};",
"",
" setFormValue([`${tableIndex}-${alias}:${model}`], \"create\", { ...values, salesArrangementPriceModelId, salesArrangementProductId });",
"}"
]
}
},
{
"color": "brick",
"label": "{{salesArrangement.orderedProducts.deleteLine}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"getIsRowVisible": "(rowIndex, tableIndex)=>getFormAction(`${tableIndex}-${rowIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`) !== \"delete\"",
"onClick": [
"(rowIndex, tableIndex) => {",
" const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
" const formModel = `${tableIndex}-${rowIndex}:${model}`;",
" const action = getFormAction(formModel);",
"",
" if (action === \"update\") {",
" modifyFormAction(`${tableIndex}-${rowIndex}:${model}`, \"update\", \"delete\");",
" return;",
" }",
"",
" const formKeys = Object.keys(getFormValues());",
" const alias = formKeys.filter(key => key.match(`${tableIndex}+-[0-9]:${model}`))?.length;",
" const { _id } = getFormValue([formModel], action) ?? {};",
" if (alias === 1) setFormValue([formModel], action, { _id });",
" else deleteFormModel(formModel);",
"}"
]
}
},
{
"label": "{{salesArrangement.orderedProducts.undoDelete}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"getIsRowVisible": "(rowIndex, tableIndex)=>getFormAction(`${tableIndex}-${rowIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`) === \"delete\"",
"onClick": [
"(rowIndex, tableIndex) => {",
" const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
" modifyFormAction(`${tableIndex}-${rowIndex}:${model}`, \"delete\", \"update\");",
"}"
]
}
}
],
"relationshipKey": [
"_id"
],
"uiModelBinding": {
"data": [
"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine"
]
},
"functions": {
"data": "getUiModelDataValue([\"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\"])?.map(salesArrangementPriceModelLine => ({...salesArrangementPriceModelLine, _id: salesArrangementPriceModelLine.salesArrangementProductId }))"
},
"defaultAction": "update",
"editDisplayActions": [
"create",
"update",
"delete"
],
"columns": [
{
"Header": "{{salesArrangement.orderedProducts.salesArrangementPriceModelLine}}",
"dataBinding": [
"salesArrangementPriceModelLineNumber"
],
"sticky": "left"
},
{
"Header": "{{salesArrangement.orderedProducts.referenceProduct}}",
"dataBinding": [
"productName"
],
"sticky": "left",
"selectConfig": {
"listBinding": [
"Flat:everest.fin.accounting/ProductModel.Product"
],
"textBinding": "productName",
"valueBinding": "productName"
},
"functions": {
"onCellChange": [
"({ rowAction, value, name }) => {",
" const productsModel = \"Flat:everest.fin.accounting/ProductModel.Product\";",
" const products = getUiModelDataValue([productsModel]) ?? [];",
" const selectedProduct = products.find(p => p.productName === value) ?? {};",
"",
" const [matrixIndex] = name.split(\":\") ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" setFormValue([model, \"productId\"], rowAction, selectedProduct.id);",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.priceType}}",
"dataBinding": {
"rawValue": [
"priceType"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "PriceType"
},
"functions": {
"onCellChange": [
"({ rowAction, value, previousValue, name }) => {",
" const [matrixIndex] = name.split(':') ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" if(value === 3) { // PriceType === Usage",
" setFormValue([model, 'quantity'], rowAction, '0');",
" } else if(previousValue === 3){",
" setFormValue([model, 'quantity'], rowAction, null);",
" }",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.amount}}",
"dataBinding": [
"amount"
],
"parseAs": "currency",
"footerFunc": "sum",
"functions": {
"onCellChange": [
"({ rowAction, value, name }) => {",
" const [matrixIndex] = name.split(\":\") ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" const amount = new Decimal(value);",
" const quantity = new Decimal(getFormValue([model, \"quantity\"], rowAction));",
" const rate = amount.dividedBy(quantity);",
" if (rate.isNaN()) return;",
" setFormValue([model, \"effectiveRate\"], rowAction, rate.toFixed());",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.billingFrequency}}",
"dataBinding": {
"rawValue": [
"billingFrequency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "BillingFrequency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.billingTiming}}",
"dataBinding": {
"rawValue": [
"billingTiming"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "BillingTiming"
}
},
{
"Header": "{{salesArrangement.orderedProducts.priceModel}}",
"dataBinding": {
"rawValue": [
"priceModel"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "PriceModel"
}
},
{
"Header": "{{salesArrangement.orderedProducts.quantity}}",
"dataBinding": [
"quantity"
],
"functions": {
"onCellChange": [
"({ rowAction, value, name }) => {",
" const [matrixIndex] = name.split(\":\") ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" const quantity = new Decimal(value);",
" const effectiveRate = getFormValue([model, \"effectiveRate\"], rowAction);",
" const rawAmount = getFormValue([model, \"amount\"], rowAction);",
"",
" if (effectiveRate) {",
" const rate = new Decimal(effectiveRate);",
" const amount = quantity.times(rate);",
" if (amount.isNaN()) return;",
" setFormValue([model, \"amount\"], rowAction, amount.toFixed());",
" } else if (rawAmount) {",
" const amount = new Decimal(rawAmount);",
" const rate = amount.dividedBy(quantity);",
" if (rate.isNaN()) return;",
" setFormValue([model, \"effectiveRate\"], rowAction, rate.toFixed());",
" }",
"}"
],
"isEditable": "({ row }) => { return row?.original?.priceType == 3 ? false : true; }"
}
},
{
"Header": "{{salesArrangement.orderedProducts.unitOfMeasure}}",
"dataBinding": {
"rawValue": [
"unitOfMeasure"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "UnitOfMeasureType"
}
},
{
"Header": "{{salesArrangement.orderedProducts.effectiveRate}}",
"dataBinding": [
"effectiveRate"
],
"parseAs": "currency",
"functions": {
"onCellChange": [
"({ rowAction, value, name }) => {",
" const [matrixIndex] = name.split(\":\") ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" const rate = new Decimal(value);",
" const quantity = new Decimal(getFormValue([model, \"quantity\"], rowAction));",
" const amount = quantity.times(rate);",
" if (amount.isNaN()) return;",
" setFormValue([model, \"amount\"], rowAction, amount.toFixed());",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.serviceStartDate}}",
"dataBinding": [
"serviceStartDate"
],
"parseAs": "date",
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.serviceEndDate}}",
"dataBinding": [
"serviceEndDate"
],
"parseAs": "date",
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.billingStartDate}}",
"dataBinding": [
"billingStartDate"
],
"parseAs": "date",
"functions": {
"onCellChange": [
"({ name }) => {",
" const [tableIndex] = name.split('-');",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
"",
" const { values: salesArrangementPriceModelLineValues, matchingKeys: salesArrangementPriceModelLineKeys } = getFormValueList(salesArrangementPriceModelLineModel, [",
" 'create',",
" 'update',",
" ]);",
"",
" let earliestBillingStart = null;",
"",
" const { compareAsc, compareDesc, parseISOWithoutTimezone } = helpers.dates;",
"",
" salesArrangementPriceModelLineKeys.forEach((key, arrayIndex) => {",
" if (key.startsWith(tableIndex)) {",
" const { billingStartDate } = salesArrangementPriceModelLineValues[arrayIndex];",
"",
" const parsedBillingStart =",
" typeof billingStartDate === 'string'",
" ? parseISOWithoutTimezone(billingStartDate)",
" : billingStartDate;",
"",
" earliestBillingStart =",
" !earliestBillingStart ||",
" compareAsc(earliestBillingStart, parsedBillingStart)",
" ? parsedBillingStart",
" : earliestBillingStart;",
"",
" }",
" });",
"",
" if (!earliestBillingStart) return;",
"",
" const salAction = getFormAction(`${tableIndex}:${salModel}`);",
" setFormValue(",
" [`${tableIndex}:${salModel}`, 'startDate'],",
" salAction,",
" earliestBillingStart.toISOString()",
" );",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.billingEndDate}}",
"dataBinding": [
"billingEndDate"
],
"parseAs": "date",
"functions": {
"onCellChange": [
"({ name }) => {",
" const [tableIndex] = name.split('-');",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
"",
" const { values: salesArrangementPriceModelLineValues, matchingKeys: salesArrangementPriceModelLineKeys } = getFormValueList(salesArrangementPriceModelLineModel, [",
" 'create',",
" 'update',",
" ]);",
"",
" let latestBillingEnd = null;",
"",
" const { compareAsc, compareDesc, parseISOWithoutTimezone } = helpers.dates;",
"",
" salesArrangementPriceModelLineKeys.forEach((key, arrayIndex) => {",
" if (key.startsWith(tableIndex)) {",
" const { billingEndDate } = salesArrangementPriceModelLineValues[arrayIndex];",
"",
" const parsedBillingEnd =",
" typeof billingEndDate === 'string'",
" ? parseISOWithoutTimezone(billingEndDate)",
" : billingEndDate;",
"",
" latestBillingEnd =",
" !latestBillingEnd || compareDesc(parsedBillingEnd, latestBillingEnd)",
" ? parsedBillingEnd",
" : latestBillingEnd;",
" }",
" });",
"",
" if (!latestBillingEnd) return;",
"",
" const salAction = getFormAction(`${tableIndex}:${salModel}`);",
" setFormValue(",
" [`${tableIndex}:${salModel}`, 'endDate'],",
" salAction,",
" latestBillingEnd.toISOString()",
" );",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.currency}}",
"dataBinding": {
"rawValue": [
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.functionalCurrency}}",
"dataBinding": {
"rawValue": [
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.exchangeRate}}",
"dataBinding": [
"exchangeRate"
]
},
{
"Header": "{{salesArrangement.orderedProducts.functionalAmount}}",
"dataBinding": [
"functionalAmount"
],
"parseAs": "currency",
"footerFunc": "sum",
"functions": {
"format": [
"if (isFetchingUiModelData) return;",
"const model = \"everest.fin.accounting/SalesArrangementModel.SalesArrangement\";",
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const currencyId = getUiModelDataValue([model, \"functionalCurrency\"]);",
"const { codeValue: currency } = currencies?.find(({ codeNumber }) => codeNumber === currencyId) ?? {};",
"return currency;"
]
}
}
]
}
]
}
]
},
{
"title": "{{salesArrangement.billing.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "${subtitle} {{salesArrangement.billing.subtitle}}",
"secondParsing": "percent"
},
"uiModelBinding": {
"subtitle": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"pctBilled"
]
},
"functions": {
"isDisabled": "state.mode === 'create'"
},
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"functions": {
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "()=>showToast({type:'warning',title:'{{notImplementedR2.title}}',message:'{{notImplementedR2.message}}'})"
}
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"functions": {
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "(state.mode ==='edit')?'{{salesArrangement.callToAction.actions.saveRevisions}}':'{{salesArrangement.callToAction.actions.revise}}'",
"onClick": [
"() => {",
" if (state.mode !== 'edit') {",
" setState('mode', 'edit');",
" setTemplateActiveSegment(1);",
" } else {",
" const removeEmpty = (rawLine, index, idProp, model) => {",
" if (index === 0 || getFormAction(model) !== 'create') return;",
" const { [idProp]: id, ...line } = rawLine || {};",
" const isEmpty =",
" helpers.isEmpty(line) ||",
" Object.values(line).every(",
" (v) => v == null || (typeof v === 'object' && helpers.isEmpty(v))",
" );",
" if (isEmpty) deleteFormModel(model, true, false);",
" };",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const { values: salesArrangementProducts, matchingKeys: saKeys } =",
" getFormValueList(salModel, ['create', 'update', 'delete']) || [];",
" salesArrangementProducts?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementId', saKeys[index]),",
" []",
" );",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: salesArrangementPriceModelLineLines, matchingKeys: salesArrangementPriceModelLineKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create', 'update', 'delete']) || [];",
" salesArrangementPriceModelLineLines?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementProductId', salesArrangementPriceModelLineKeys[index]),",
" []",
" );",
" defaultSubmit({",
" skipRefetchOnSuccess: true,",
" onSuccess: async () => {",
" const formValues = getFormValues();",
"",
" Object.keys(formValues)",
" ?.filter((key) => key.includes(salModel))",
" ?.forEach((key) => {",
" deleteFormAction(key, 'create');",
" deleteFormAction(key, 'delete');",
" });",
"",
" const boModel =",
" 'everest.fin.accounting/BOComposition/SalesArrangementBusinessObjectModel.SalesArrangementBusinessObject';",
" const { id } = getUiModelDataValue([boModel])?.[0] ?? {};",
"",
" if (id != null) {",
" const updateBoResponse = await everestAction({",
" uiModelName: 'everest.fin.accounting/ui/accounting',",
" model: boModel,",
" action: 'update',",
" body: { id, headerKey: state.id },",
" fieldlist: [\"id\"],",
" });",
" console.log('BO Updated:', updateBoResponse);",
" }",
" await refetchUiModelData();",
" setState(\"mode\", \"view\");",
" },",
" transform: (rawValues) => {",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" let formValues = helpers.cloneDeep(rawValues);",
" delete formValues.billingAddressField;",
" for (let key in formValues) {",
" delete formValues[key].update?.childProduct;",
" delete formValues[key].create?.childProduct;",
" delete formValues[key].delete?.childProduct;",
" delete formValues[key].update?._id;",
" delete formValues[key].create?._id;",
" delete formValues[key].delete?._id;",
" delete formValues[key].update?.productCode;",
" delete formValues[key].create?.productCode;",
" delete formValues[key].delete?.productCode;",
" }",
"",
" const { values: createsalesArrangementProducts, matchingKeys: createSaKeys } =",
" getFormValueList(salModel, ['create']) || [];",
"",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: createLcLines, matchingKeys: createLcKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create']) || [];",
" createLcKeys.forEach((key) => {",
" if (createSaKeys.includes(`${key.charAt(0)}:${salModel}`)) {",
" delete formValues[key];",
" }",
" });",
"",
" createSaKeys.forEach((salKey, salIndex) => {",
" const charges = [];",
" createLcKeys.forEach((salesArrangementPriceModelLineKey, salesArrangementPriceModelLineIndex) => {",
" if (salesArrangementPriceModelLineKey.startsWith(salKey.charAt(0))) {",
" const data = createLcLines[salesArrangementPriceModelLineIndex];",
" delete data._id;",
" delete data.childProduct;",
" charges.push(data);",
" }",
" });",
" delete formValues[salKey].create;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementProduct',",
" ],",
" helpers.cloneDeep(rawValues[salKey].create)",
" );",
" delete formValues[salKey].createSalesArrangementProductWithPriceModelLines",
" .salesArrangementProduct._id;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementPriceModelLines',",
" ],",
" charges",
" );",
" });",
"",
" const { matchingKeys: salUpdateKeys } = getFormValueList(salModel, [\"update\"]) ?? [];",
" salUpdateKeys.forEach(key => {",
" delete formValues?.[key]?.update?.startDate;",
" delete formValues?.[key]?.update?.endDate;",
" });",
"",
" Object.entries(formValues).forEach(([key, value]) => {",
" if(!!value?.update) {",
" formValues[key] = {...value, fieldlist: [\"id\"]}",
" }",
" });",
"",
" return formValues;",
" },",
" });",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.approve}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 2, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.reject}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" const runResponse=await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 1, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
}
]
}
}
},
{
"component": "Block",
"collapsible": true,
"size": "11",
"title": "{{salesArrangement.details.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"onCollapseClick": "(collapsed) => {setState('detailsCollapsed', !collapsed)}",
"collapsed": "!!state.detailsCollapsed"
},
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"uiModelBinding": {
"id": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
]
}
}
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
],
"list": [
"everest.fin.accounting/BusinessPartnerModel.BusinessPartner"
],
"text": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerNumber"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"functions": {
"value": "const [address] = uiModelData?.['BillingAddress:everest.base/AddressModel.Address']?.result || [];if (address) {return `${address.line1}\n${address.line2}\n${address.city}, ${address.stateProvince} ${address.zipCode}\n${address.country}`;}return '';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"mainContactEmail"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"billingEmail"
]
}
}
]
},
{
"component": "SummaryText",
"size": "1",
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"component": "Block",
"collapsible": true,
"size": "12",
"title": "{{salesArrangement.orderDetails.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.orderDetailsCollapsed",
"onCollapseClick": "collapsed => setState('orderDetailsCollapsed', !collapsed)"
},
"disabledAction": {
"label": "{{salesArrangement.reviseDetails}}",
"functions": {
"onClick": "()=>setTemplateActiveSegment(1)"
}
},
"elements": [
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityName}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityName"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityId}}",
"link": {
"to": "https://www.google.com/",
"target": "_blank",
"rel": "noreferrer",
"isExternal": true
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityIdText"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.purchaseOrder}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"purchaseOrder"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesRep}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesRep"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.signDate}}",
"parseAs": "date",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"signDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.bookingDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"bookDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.effectiveDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesEffectiveDate"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesGroup}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesGroup"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.currency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.functionalCurrency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.notes}}",
"size": "2",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"memo"
]
}
}
]
},
{
"title": "{{salesArrangement.invoices.title}}",
"component": "WidgetGroup",
"size": "12",
"functions": {
"isDisabled": "state.mode === 'edit'"
},
"widgets": [
{
"label": "{{salesArrangement.invoices.invoices}}",
"component": "SecondaryTable",
"uiModelBinding": {
"data": [
"everest.fin.accounting/BillingPlanLineModel.BillingPlanLine"
]
},
"functions": {
"data": [
"const invoices = getUiModelDataValue([\"everest.fin.accounting/BillingPlanLineModel.BillingPlanLine\"]) ?? [];",
"return helpers.orderBy(invoices, \"billDate\");"
]
},
"groupBy": [
"billDate"
],
"columns": [
{
"Header": "{{salesArrangement.invoices.billPlanDate}}",
"dataBinding": [
"billDate"
],
"parseAs": "date"
},
{
"Header": "",
"dataBinding": [
"billingPlanLineNumber"
]
},
{
"Header": "",
"dataBinding": [
"product"
]
},
{
"Header": "{{salesArrangement.invoices.billingPlan}}",
"dataBinding": [
"billingPlan"
],
"functions": {
"onCellClick": [
"({ row }) => {",
" const filterData = getUiModelDataValue([",
" \"everest.fin.accounting/BillingPlanModel.BillingPlan\",",
" ]) ?? [];",
" openModal({",
" title: \"{{billingPlansSalesArrangement.billingPlan}}\",",
" template:",
" \"/templates/everest.fin.accounting/ui/billingPlansSalesArrangement?saId=\" +",
" state.id + \"&selectedBillingPlan=\" + row.original.billingPlanId,",
" filter: {",
" defaultValue: row.original.billingPlanId,",
" items: filterData?.map(({ id: value, billingPlanNumber: label }) => ({ label, value })),",
" },",
" });",
"}"
]
}
},
{
"Header": "{{salesArrangement.invoices.amount}}",
"dataBinding": [
"amount"
],
"aggregate": "sum",
"parseAs": "currency"
},
{
"Header": "{{salesArrangement.invoices.startDate}}",
"dataBinding": [
"serviceStart"
],
"parseAs": "date",
"aggregate": "minDate"
},
{
"Header": "{{salesArrangement.invoices.endDate}}",
"dataBinding": [
"serviceEnd"
],
"parseAs": "date",
"aggregate": "maxDate"
},
{
"Header": "{{salesArrangement.invoices.status}}",
"dataBinding": {
"rawValue": [
"invoiceStatus"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "InvoiceStatus"
}
},
{
"Header": "{{salesArrangement.invoices.invoice}}",
"dataBinding": [
"invoice"
],
"functions": {
"onCellClick": "({column, row}) => navigate({ to: '/templates/everest.fin.accounting/ui/invoice?id='+row.original.invoiceId })"
}
}
]
},
{
"label": "{{salesArrangement.invoices.invoiceLines}}",
"component": "SecondaryTable",
"uiModelBinding": {
"data": [
"everest.fin.accounting/InvoiceLineModel.InvoiceLine"
]
},
"columns": [
{
"Header": "{{salesArrangement.invoices.product}}",
"dataBinding": [
"product"
],
"functions": {
"onCellClick": "({column, row}) => navigate({ to: '/templates/everest.fin.accounting/ui/product?id='+row.original.productId })"
}
},
{
"Header": "{{salesArrangement.invoices.billingPlan}}",
"dataBinding": [
"billingPlan"
],
"functions": {
"onCellClick": [
"({ row }) => {",
" const filterData = getUiModelDataValue([",
" \"everest.fin.accounting/BillingPlanModel.BillingPlan\",",
" ]) ?? [];",
" openModal({",
" title: \"{{billingPlansSalesArrangement.billingPlan}}\",",
" template:",
" \"/templates/everest.fin.accounting/ui/billingPlansSalesArrangement?saId=\" +",
" state.id + \"&selectedBillingPlan=\" + row.original.billingPlanId,",
" filter: {",
" defaultValue: row.original.billingPlanId,",
" items: filterData?.map(({ id: value, billingPlanNumber: label }) => ({ label, value })),",
" },",
" });",
"}"
]
}
},
{
"Header": "{{salesArrangement.invoices.salesArrLine}}",
"dataBinding": [
"salesArrLine"
]
},
{
"Header": "{{salesArrangement.invoices.startDate}}",
"dataBinding": [
"serviceStart"
],
"parseAs": "date",
"format": "P"
},
{
"Header": "{{salesArrangement.invoices.endDate}}",
"dataBinding": [
"serviceEnd"
],
"parseAs": "date",
"format": "P"
},
{
"Header": "{{salesArrangement.invoices.amount}}",
"dataBinding": [
"amount"
],
"parseAs": "currency"
}
]
}
]
},
{
"component": "Template",
"functions": {
"link": "'/templates/everest.fin.accounting/ui/billingSchedule?id=' + state.id"
}
}
]
},
{
"title": "{{salesArrangement.revenue.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "${subtitle} {{salesArrangement.revenue.subtitle}}",
"secondParsing": "shortPercent"
},
"uiModelBinding": {
"subtitle": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"pctRecognizedRevenue"
]
},
"functions": {
"isDisabled": "state.mode === 'create'"
},
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"functions": {
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "()=>showToast({type:'warning',title:'{{notImplementedR2.title}}',message:'{{notImplementedR2.message}}'})"
}
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"functions": {
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "(state.mode ==='edit')?'{{salesArrangement.callToAction.actions.saveRevisions}}':'{{salesArrangement.callToAction.actions.revise}}'",
"onClick": [
"() => {",
" if (state.mode !== 'edit') {",
" setState('mode', 'edit');",
" setTemplateActiveSegment(1);",
" } else {",
" const removeEmpty = (rawLine, index, idProp, model) => {",
" if (index === 0 || getFormAction(model) !== 'create') return;",
" const { [idProp]: id, ...line } = rawLine || {};",
" const isEmpty =",
" helpers.isEmpty(line) ||",
" Object.values(line).every(",
" (v) => v == null || (typeof v === 'object' && helpers.isEmpty(v))",
" );",
" if (isEmpty) deleteFormModel(model, true, false);",
" };",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const { values: salesArrangementProducts, matchingKeys: saKeys } =",
" getFormValueList(salModel, ['create', 'update', 'delete']) || [];",
" salesArrangementProducts?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementId', saKeys[index]),",
" []",
" );",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: salesArrangementPriceModelLineLines, matchingKeys: salesArrangementPriceModelLineKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create', 'update', 'delete']) || [];",
" salesArrangementPriceModelLineLines?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementProductId', salesArrangementPriceModelLineKeys[index]),",
" []",
" );",
" defaultSubmit({",
" skipRefetchOnSuccess: true,",
" onSuccess: async () => {",
" const formValues = getFormValues();",
"",
" Object.keys(formValues)",
" ?.filter((key) => key.includes(salModel))",
" ?.forEach((key) => {",
" deleteFormAction(key, 'create');",
" deleteFormAction(key, 'delete');",
" });",
"",
" const boModel =",
" 'everest.fin.accounting/BOComposition/SalesArrangementBusinessObjectModel.SalesArrangementBusinessObject';",
" const { id } = getUiModelDataValue([boModel])?.[0] ?? {};",
"",
" if (id != null) {",
" const updateBoResponse = await everestAction({",
" uiModelName: 'everest.fin.accounting/ui/accounting',",
" model: boModel,",
" action: 'update',",
" body: { id, headerKey: state.id },",
" fieldlist: [\"id\"],",
" });",
" console.log('BO Updated:', updateBoResponse);",
" }",
" await refetchUiModelData();",
" setState(\"mode\", \"view\");",
" },",
" transform: (rawValues) => {",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" let formValues = helpers.cloneDeep(rawValues);",
" delete formValues.billingAddressField;",
" for (let key in formValues) {",
" delete formValues[key].update?.childProduct;",
" delete formValues[key].create?.childProduct;",
" delete formValues[key].delete?.childProduct;",
" delete formValues[key].update?._id;",
" delete formValues[key].create?._id;",
" delete formValues[key].delete?._id;",
" delete formValues[key].update?.productCode;",
" delete formValues[key].create?.productCode;",
" delete formValues[key].delete?.productCode;",
" }",
"",
" const { values: createsalesArrangementProducts, matchingKeys: createSaKeys } =",
" getFormValueList(salModel, ['create']) || [];",
"",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: createLcLines, matchingKeys: createLcKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create']) || [];",
" createLcKeys.forEach((key) => {",
" if (createSaKeys.includes(`${key.charAt(0)}:${salModel}`)) {",
" delete formValues[key];",
" }",
" });",
"",
" createSaKeys.forEach((salKey, salIndex) => {",
" const charges = [];",
" createLcKeys.forEach((salesArrangementPriceModelLineKey, salesArrangementPriceModelLineIndex) => {",
" if (salesArrangementPriceModelLineKey.startsWith(salKey.charAt(0))) {",
" const data = createLcLines[salesArrangementPriceModelLineIndex];",
" delete data._id;",
" delete data.childProduct;",
" charges.push(data);",
" }",
" });",
" delete formValues[salKey].create;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementProduct',",
" ],",
" helpers.cloneDeep(rawValues[salKey].create)",
" );",
" delete formValues[salKey].createSalesArrangementProductWithPriceModelLines",
" .salesArrangementProduct._id;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementPriceModelLines',",
" ],",
" charges",
" );",
" });",
"",
" const { matchingKeys: salUpdateKeys } = getFormValueList(salModel, [\"update\"]) ?? [];",
" salUpdateKeys.forEach(key => {",
" delete formValues?.[key]?.update?.startDate;",
" delete formValues?.[key]?.update?.endDate;",
" });",
"",
" return formValues;",
" },",
" });",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.approve}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 2, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.reject}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" const runResponse=await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 1, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
}
]
}
}
},
{
"component": "Block",
"collapsible": true,
"size": "11",
"title": "{{salesArrangement.details.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"onCollapseClick": "(collapsed) => {setState('detailsCollapsed', !collapsed)}",
"collapsed": "!!state.detailsCollapsed"
},
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"uiModelBinding": {
"id": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
]
}
}
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
],
"list": [
"everest.fin.accounting/BusinessPartnerModel.BusinessPartner"
],
"text": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerNumber"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"functions": {
"value": "const [address] = uiModelData?.['BillingAddress:everest.base/AddressModel.Address']?.result || [];if (address) {return `${address.line1}\n${address.line2}\n${address.city}, ${address.stateProvince} ${address.zipCode}\n${address.country}`;}return '';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"mainContactEmail"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"billingEmail"
]
}
}
]
},
{
"component": "SummaryText",
"size": "1",
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"component": "Block",
"collapsible": true,
"size": "12",
"title": "{{salesArrangement.orderDetails.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.orderDetailsCollapsed",
"onCollapseClick": "collapsed => setState('orderDetailsCollapsed', !collapsed)"
},
"disabledAction": {
"label": "{{salesArrangement.reviseDetails}}",
"functions": {
"onClick": "()=>setTemplateActiveSegment(1)"
}
},
"elements": [
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityName}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityName"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityId}}",
"link": {
"to": "https://www.google.com/",
"target": "_blank",
"rel": "noreferrer",
"isExternal": true
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityIdText"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.purchaseOrder}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"purchaseOrder"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesRep}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesRep"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.signDate}}",
"parseAs": "date",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"signDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.bookingDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"bookDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.effectiveDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesEffectiveDate"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesGroup}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesGroup"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.currency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.functionalCurrency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.notes}}",
"size": "2",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"memo"
]
}
}
]
},
{
"component": "Template",
"functions": {
"link": "'/templates/everest.fin.accounting/ui/revenueWaterfall?id=' + state.id"
}
}
]
}
]
}
]
}
}
{
"version": 2,
"uicontroller": "salesArrangementNext.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangementProducts",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModel",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "priceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"uiModelBinding": {
"status": "SalesArrangement.salesArrangementStatus",
"subtitle": "SalesArrangement.salesArrangementNumber"
}
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"uiModelBinding": {
"subtitle": "SalesArrangement.totalAmount"
},
"functions": {
"isDisabled": "state.mode === 'create'"
},
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"functions": {
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
}
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"functions": {
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
}
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"onCollapseClick": "(collapsed) => {setState('detailsCollapsed', !collapsed)}",
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.detailsCollapsed"
},
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"uiModelBinding": {
"id": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
]
}
}
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
],
"list": [
"everest.fin.accounting/BusinessPartnerModel.BusinessPartner"
],
"text": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerNumber"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"functions": {
"value": "const [address] = uiModelData?.['BillingAddress:everest.base/AddressModel.Address']?.result || [];if (address) {return `${address.line1}\n${address.line2}\n${address.city}, ${address.stateProvince} ${address.zipCode}\n${address.country}`;}return '';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"mainContactEmail"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"billingEmail"
]
}
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"component": "Block",
"collapsible": true,
"size": "12",
"title": "{{salesArrangement.orderDetails.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.orderDetailsCollapsed",
"onCollapseClick": "collapsed => setState('orderDetailsCollapsed', !collapsed)"
},
"disabledAction": {
"label": "{{salesArrangement.reviseDetails}}",
"functions": {
"onClick": "()=>setTemplateActiveSegment(1)"
}
},
"elements": [
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityName}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityName"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityId}}",
"link": {
"to": "https://www.google.com/",
"target": "_blank",
"rel": "noreferrer",
"isExternal": true
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityIdText"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.purchaseOrder}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"purchaseOrder"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesRep}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesRep"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.signDate}}",
"parseAs": "date",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"signDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.bookingDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"bookDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.effectiveDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesEffectiveDate"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesGroup}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesGroup"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.currency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.functionalCurrency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.notes}}",
"size": "2",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"memo"
]
}
}
]
},
{
"component": "Template",
"size": "11",
"functions": {
"link": "'/templates/everest.fin.accounting/ui/balanceRollforward?id=' + state.id"
}
},
{
"component": "SectionGroup",
"size": "1",
"sections": [
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"title": "{{salesArrangement.activity.title}}",
"component": "WidgetGroup",
"functions": {
"isDisabled": "state.mode === 'edit'"
},
"widgets": [
{
"label": "{{salesArrangement.activity.log}}",
"component": "Messaging",
"dateFormat": "P",
"uiModelBinding": {
"list": [
"TODO"
]
}
},
{
"component": "Messaging",
"label": "{{salesArrangement.activity.notes}}",
"uiModelBinding": {
"list": [
"TODO"
]
},
"dateFormat": "P"
}
]
}
]
}
]
},
{
"title": "{{salesArrangement.orderedProducts.title}}",
"functions": {
"subtitle": "state.mode === 'create' ? '{{salesArrangement.orderedProducts.notSaved}}' : '{{salesArrangement.orderedProducts.saved}}'"
},
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"functions": {
"label": "state.mode==='create'?'{{salesArrangement.callToAction.actions.save}}':'{{salesArrangement.callToAction.actions.activate}}'",
"disabled": "formState?.isSubmitting || state.mode==='edit' || isFetchingUiModelData || (state.mode === 'create' && formState?.hasError)",
"onClick": [
"() => {",
" if (state.mode === 'create') {",
" const removeEmpty = (rawLine, index, idProp, model) => {",
" if (index === 0 || getFormAction(model) !== 'create') return;",
" const { [idProp]: id, ...line } = rawLine || {};",
" const isEmpty =",
" helpers.isEmpty(line) ||",
" Object.values(line).every(",
" (v) => v == null || (typeof v === 'object' && helpers.isEmpty(v))",
" );",
" if (isEmpty) deleteFormModel(model, true, false);",
" };",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const { values: salesArrangementProducts, matchingKeys: saKeys } =",
" getFormValueList(salModel, ['create', 'update', 'delete']) || [];",
" salesArrangementProducts?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementId', saKeys[index]),",
" []",
" );",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: salesArrangementPriceModelLineLines, matchingKeys: salesArrangementPriceModelLineKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create', 'update', 'delete']) || [];",
" salesArrangementPriceModelLineLines?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementProductId', salesArrangementPriceModelLineKeys[index]),",
" []",
" );",
" defaultSubmit({",
" onSuccess: async () => {",
" navigate({",
" to: '/templates/everest.fin.accounting/ui/salesArrangements',",
" closeCurrentTab: true,",
" });",
" },",
" transform: (rawValues) => {",
" const saModel =",
" 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" let formValues = {",
" [saModel]: {",
" createSalesArrangementWithLines: {",
" salesArrangement: {",
" ...helpers.cloneDeep(",
" rawValues[saModel].createSalesArrangementWithLines",
" ),",
" },",
" salesArrangementProducts: [],",
" salesArrangementPriceModelLines: [],",
" },",
" },",
" };",
" delete formValues.billingAddressField;",
" const formKeys = Object.keys(rawValues);",
" formKeys.forEach((key) => {",
" if (key.includes('SalesArrangementProduct')) {",
" const charges = [];",
" const currentSAL = helpers.cloneDeep(rawValues[key].create);",
" delete currentSAL._id;",
" delete currentSAL.productCode",
" formKeys.forEach((entry) => {",
" if (",
" entry.includes('SalesArrangementPriceModelLine') &&",
" entry.startsWith(key.charAt(0))",
" ) {",
" const salesArrangementPriceModelLine = helpers.cloneDeep(rawValues[entry].create);",
" delete salesArrangementPriceModelLine._id;",
" delete salesArrangementPriceModelLine.childProduct;",
" charges.push(salesArrangementPriceModelLine);",
" }",
" });",
" formValues[",
" saModel",
" ].createSalesArrangementWithLines.salesArrangementProducts.push(",
" currentSAL",
" );",
" formValues[",
" saModel",
" ].createSalesArrangementWithLines.salesArrangementPriceModelLines.push(charges);",
" }",
" });",
"",
" Object.entries(formValues).forEach(([key, value]) => {",
" if(!!value?.update) {",
" formValues[key] = {...value, fieldlist: [\"id\"]}",
" }",
" });",
"",
" return formValues;",
" },",
" });",
" } else {",
" showToast({",
" type: 'warning',",
" title: '{{notImplementedR2.title}}',",
" message: '{{notImplementedR2.message}}',",
" });",
" }",
"}"
]
}
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"functions": {
"disabled": "state.mode === \"create\""
},
"actions": [
{
"functions": {
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "(state.mode ==='edit')?'{{salesArrangement.callToAction.actions.saveRevisions}}':'{{salesArrangement.callToAction.actions.revise}}'",
"onClick": [
"() => {",
" if (state.mode !== 'edit') {",
" setState('mode', 'edit');",
" setTemplateActiveSegment(1);",
" } else {",
" const removeEmpty = (rawLine, index, idProp, model) => {",
" if (index === 0 || getFormAction(model) !== 'create') return;",
" const { [idProp]: id, ...line } = rawLine || {};",
" const isEmpty =",
" helpers.isEmpty(line) ||",
" Object.values(line).every(",
" (v) => v == null || (typeof v === 'object' && helpers.isEmpty(v))",
" );",
" if (isEmpty) deleteFormModel(model, true, false);",
" };",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const { values: salesArrangementProducts, matchingKeys: saKeys } =",
" getFormValueList(salModel, ['create', 'update', 'delete']) || [];",
" salesArrangementProducts?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementId', saKeys[index]),",
" []",
" );",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: salesArrangementPriceModelLineLines, matchingKeys: salesArrangementPriceModelLineKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create', 'update', 'delete']) || [];",
" salesArrangementPriceModelLineLines?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementProductId', salesArrangementPriceModelLineKeys[index]),",
" []",
" );",
" defaultSubmit({",
" skipRefetchOnSuccess: true,",
" onSuccess: async () => {",
" const formValues = getFormValues();",
"",
" Object.keys(formValues)",
" ?.filter((key) => key.includes(salModel))",
" ?.forEach((key) => {",
" deleteFormAction(key, 'create');",
" deleteFormAction(key, 'delete');",
" });",
"",
" const boModel =",
" 'everest.fin.accounting/BOComposition/SalesArrangementBusinessObjectModel.SalesArrangementBusinessObject';",
" const { id } = getUiModelDataValue([boModel])?.[0] ?? {};",
"",
" if (id != null) {",
" const updateBoResponse = await everestAction({",
" uiModelName: 'everest.fin.accounting/ui/accounting',",
" model: boModel,",
" action: 'update',",
" body: { id, headerKey: state.id },",
" fieldlist: [\"id\"],",
" });",
" console.log('BO Updated:', updateBoResponse);",
" }",
" await refetchUiModelData();",
" setState(\"mode\", \"view\");",
" },",
" transform: (rawValues) => {",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" let formValues = helpers.cloneDeep(rawValues);",
" delete formValues.billingAddressField;",
" for (let key in formValues) {",
" delete formValues[key].update?.childProduct;",
" delete formValues[key].create?.childProduct;",
" delete formValues[key].delete?.childProduct;",
" delete formValues[key].update?._id;",
" delete formValues[key].create?._id;",
" delete formValues[key].delete?._id;",
" delete formValues[key].update?.productCode;",
" delete formValues[key].create?.productCode;",
" delete formValues[key].delete?.productCode;",
" }",
"",
" const { values: createsalesArrangementProducts, matchingKeys: createSaKeys } =",
" getFormValueList(salModel, ['create']) || [];",
"",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: createLcLines, matchingKeys: createLcKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create']) || [];",
" createLcKeys.forEach((key) => {",
" if (createSaKeys.includes(`${key.charAt(0)}:${salModel}`)) {",
" delete formValues[key];",
" }",
" });",
"",
" createSaKeys.forEach((salKey, salIndex) => {",
" const charges = [];",
" createLcKeys.forEach((salesArrangementPriceModelLineKey, salesArrangementPriceModelLineIndex) => {",
" if (salesArrangementPriceModelLineKey.startsWith(salKey.charAt(0))) {",
" const data = createLcLines[salesArrangementPriceModelLineIndex];",
" delete data._id;",
" delete data.childProduct;",
" charges.push(data);",
" }",
" });",
" delete formValues[salKey].create;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementProduct',",
" ],",
" helpers.cloneDeep(rawValues[salKey].create)",
" );",
" delete formValues[salKey].createSalesArrangementProductWithPriceModelLines",
" .salesArrangementProduct._id;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementPriceModelLines',",
" ],",
" charges",
" );",
" });",
"",
" const { matchingKeys: salUpdateKeys } = getFormValueList(salModel, [\"update\"]) ?? [];",
" salUpdateKeys.forEach(key => {",
" delete formValues?.[key]?.update?.startDate;",
" delete formValues?.[key]?.update?.endDate;",
" });",
"",
" Object.entries(formValues).forEach(([key, value]) => {",
" if(!!value?.update) {",
" formValues[key] = {...value, fieldlist: [\"id\"]}",
" }",
" });",
"",
" return formValues;",
" },",
" });",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.approve}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 2, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.reject}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" const runResponse=await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 1, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
}
]
}
}
},
{
"component": "Block",
"functions": {
"onCollapseClick": "(collapsed) => {setState('detailsCollapsed', !collapsed)}",
"collapsed": "!!state.detailsCollapsed"
},
"collapsible": true,
"size": "11",
"title": "{{salesArrangement.details.title}}",
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"prefixProp": "businessPartnerNumber",
"isDisabled": false,
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"uiModelBinding": {
"id": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
]
}
}
},
"customAction": {
"label": "{{salesArrangement.details.createNew}}",
"type": "dark-grey",
"functions": {
"isVisible": "state.mode==='edit' || state.mode==='create'",
"onClick": "()=>openModal({title:'{{salesArrangement.details.createCustomer}}',template:'/templates/everest.fin.accounting/ui/businessPartnerCreate',onModalSubmit:(createdBusinessPartner)=>{if(createdBusinessPartner==null)return;refetchUiModelData(); const action=state.mode==='create'?'createSalesArrangementWithLines':'update';setFormValue(['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'],action,createdBusinessPartner)}})"
}
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
],
"list": [
"everest.fin.accounting/BusinessPartnerModel.BusinessPartner"
],
"text": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"onChange": "(value)=>{const action=state.mode==='create' ? 'createSalesArrangementWithLines':'update';setFormValue(['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'],action,value)}"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"uiModelBinding": {
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
],
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerNumber"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find(b=>b.id==partnerId);return partner?.businessPartnerNumber||'';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"uiModelBinding": {},
"name": "billingAddressField",
"functions": {
"isEditing": "state.mode === 'create' || state.mode === 'edit'",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find((b)=>b.id==partnerId);const address=getUiModelDataValue(['everest.base/AddressModel.Address',])?.find((address)=>address.id==partner?.defaultBillingAddressId);const addressLines=[address?.line1,address?.line2,`${address?.city}, ${address?.stateProvince} ${address?.zipCode}`,address?.country,].filter(Boolean).join(`\n`);return address?addressLines:'';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"uiModelBinding": {
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
],
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"mainContactEmail"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update'",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId',];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find((b)=>b.id==partnerId);return partner?.mainContactEmail??'';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"uiModelBinding": {
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
],
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"billingEmail"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId',];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find((b)=>b.id==partnerId);return partner?.billingEmail??'';"
}
}
]
},
{
"component": "SummaryText",
"size": "1",
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"functions": {
"value": [
"if (state.mode !== \"edit\" && state.mode !== \"create\") {",
" return getUiModelDataValue([",
" \"everest.fin.accounting/SalesArrangementModel.SalesArrangement\", \"totalAmount\",",
" ]);",
"}",
"",
"const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"const salesArrangementPriceModelLines = getFormValueList(model, [\"update\", \"create\"])?.values || [];",
"",
"const total = salesArrangementPriceModelLines.reduce((acc, line) => {",
" const amount = new Decimal(line.amount);",
" if (amount.isNaN()) return acc;",
" return amount.plus(acc);",
"}, new Decimal(0));",
"",
"return total.toFixed();"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"component": "Block",
"collapsible": true,
"size": "12",
"title": "{{salesArrangement.orderDetails.title}}",
"functions": {
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.orderDetailsCollapsed",
"onCollapseClick": "collapsed => setState('orderDetailsCollapsed', !collapsed)"
},
"elements": [
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityName}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityId}}",
"link": {
"to": "https://www.google.com/",
"target": "_blank",
"rel": "noreferrer",
"isExternal": true
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityIdText"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.purchaseOrder}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"purchaseOrder"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesRep}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesRep"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.signDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"signDate"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.bookingDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"bookDate"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.effectiveDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesEffectiveDate"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesGroup}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesGroup"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Select",
"idProp": "codeNumber",
"textProp": "text",
"label": "{{salesArrangement.orderDetails.currency}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"currency"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"text": [
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const currencyId = getUiModelDataValue([\"everest.fin.accounting/SalesArrangementModel.SalesArrangement\",\"currency\"]);",
"const { text: currency } = currencies.find(({ codeNumber }) => codeNumber === currencyId) ?? {};",
"return currency"
],
"list": [
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const usDollar = 149;",
"const sortedCurrencies = currencies.sort((a, b) => {",
" if (a.codeNumber === usDollar) return -1;",
" if (b.codeNumber === usDollar) return 1;",
" return a.text.localeCompare(b.text);",
"});",
"return sortedCurrencies"
]
}
},
{
"component": "Select",
"idProp": "codeNumber",
"textProp": "text",
"label": "{{salesArrangement.orderDetails.functionalCurrency}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"functionalCurrency"
],
"list": [
"Currency:everest.appserver/ValueHelpModel.ValueHelp"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"text": [
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const currencyId = getUiModelDataValue([\"everest.fin.accounting/SalesArrangementModel.SalesArrangement\",\"functionalCurrency\"]);",
"const { text: currency } = currencies.find(({ codeNumber }) => codeNumber === currencyId) ?? {};",
"return currency"
],
"value": [
"const modelValue = getUiModelDataValue(['everest.fin.accounting/SalesArrangementModel.SalesArrangement', 'functionalCurrency'])",
"return state.mode === 'create' ? 149 : modelValue;"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.notes}}",
"size": "2",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"memo"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
}
]
},
{
"component": "MultipleSecondaryTable",
"title": "{{salesArrangement.orderedProducts.title}}",
"size": "12",
"disabledActions": [
"delete"
],
"functions": {
"isEditing": "state.mode === \"edit\" || state.mode === \"create\""
},
"extraAction": {
"functions": {
"isVisible": "state.mode==='edit' || state.mode==='create'",
"onClick": [
"const lineModel = \"everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct\";",
"const salesArrangementPriceModelLineModel = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"const isCreate = state.mode === \"create\";",
"return () => {",
" const _id = Number(helpers.uniqueId());",
" const initialIndex = getFormValueList(lineModel, [",
" \"create\",",
" \"update\",",
" \"delete\",",
" \"createSalesArrangementWithLines\",",
" ]).values.length;",
" setFormValue([`${initialIndex}:${lineModel}`], \"create\", { _id, salesArrangementId: Number(state.id) });",
" setFormValue([`${initialIndex}-0:${salesArrangementPriceModelLineModel}`], \"create\", { _id });",
" setFormValue([`${initialIndex}-1:${salesArrangementPriceModelLineModel}`], \"create\", { _id });",
" setFormValue([`${initialIndex}-2:${salesArrangementPriceModelLineModel}`], \"create\", { _id });",
"}"
]
},
"label": "{{salesArrangement.orderedProducts.addMore}}",
"icon": "plus-circle-havlock"
},
"tables": [
{
"relationshipKey": [
"_id"
],
"rowActionsIcon": "times-circle-brick",
"rowActions": [
{
"label": "{{salesArrangement.orderedProducts.undoDelete}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"onClick": "(_, tableIndex)=>modifyFormAction(`${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`,\"delete\", \"update\")",
"getIsRowVisible": "(_, tableIndex)=>getFormAction(`${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`) === \"delete\""
}
},
{
"color": "brick",
"label": "{{salesArrangement.orderedProducts.deleteLine}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"onClick": [
"(_, tableIndex) => {",
" const lineModel = `${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`;",
" const salesArrangementPriceModelLineModel = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"",
" const salesArrangementPriceModelLines = Object.keys(getFormValues()).filter(",
" key => key.match(`${tableIndex}+-[0-9]+:${salesArrangementPriceModelLineModel}`)",
" );",
"",
" const salAction = getFormAction(lineModel);",
" if(salAction === \"update\") modifyFormAction(lineModel, \"update\", \"delete\");",
" else deleteFormModel(lineModel);",
"",
" salesArrangementPriceModelLines.reverse().forEach(key => {",
" const lineAction = getFormAction(key);",
" if(lineAction === \"update\") modifyFormAction(key, \"update\", \"delete\");",
" else deleteFormModel(key);",
" });",
"}"
],
"getIsRowDisabled": "(_, tableIndex)=>getFormAction(`${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`) === \"delete\""
}
}
],
"uiModelBinding": {
"data": [
"everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct"
]
},
"editDisplayActions": [
"create",
"update",
"delete",
"createSalesArrangementWithLines"
],
"functions": {
"data": [
"const isCreate = state.mode === \"create\";",
"const model=\"everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct\";",
"const salesArrangementPriceModelLineModel = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"if (isCreate && !getFormValueList(model, [\"create\"])?.values.length) {",
" setFormValue([`0:${model}`], \"create\", { _id: 1 });",
" setFormValue([`0-0:${salesArrangementPriceModelLineModel}`], \"create\", { _id: 1 });",
" setFormValue([`0-1:${salesArrangementPriceModelLineModel}`], \"create\", { _id: 1 });",
" setFormValue([`0-2:${salesArrangementPriceModelLineModel}`], \"create\", { _id: 1 });",
" return;",
"};",
"const data = getUiModelDataValue([ model ]) ?? [];",
"return data?.map(sal => ({ ...sal, _id: sal?.id }));"
],
"defaultAction": "if (state.mode === \"create\") return \"createSalesArrangementWithLines\"; return \"update\";"
},
"columns": [
{
"Header": "{{salesArrangement.orderedProducts.salesArrangementProduct}}",
"dataBinding": [
"salesArrangementProductNumber"
],
"sticky": "left",
"isEditable": false
},
{
"Header": "{{salesArrangement.orderedProducts.product}}",
"dataBinding": [
"productCode"
],
"sticky": "left",
"alwaysEditableCellActions": [
"create"
],
"isEditable": false,
"functions": {
"onCellClick": "({column, row}) => navigate({ to: \"/templates/everest.fin.accounting/ui/product?id=\"+row.original.productId })",
"multiLevelSelectConfig": [
"const onChange = (e, { key, label, name }) => {",
" const [model] = name.split('.');",
" const [tableIndex] = name.split(':');",
" const [code, productName] = label.split(' - ');",
" const ppcId = e.key.split('-')[1];",
" const pcModel = 'everest.fin.accounting/ProductChargeModel.ProductCharge';",
" setFormValue([model, 'productName'], 'create', productName);",
" const productData =",
" uiModelData['everest.fin.accounting/ProductModel.Product']?.result;",
" if (productData) {",
" const { id } = productData.products.find(",
" (entry) => entry.productCode === code",
" ) ?? {};",
" setFormValue([model, 'productId'], getFormAction(model), id);",
" }",
" everestAction({",
" uiModelName: 'everest.fin.accounting/ui/accounting',",
" model: pcModel,",
" action: 'query',",
" body: { where: { productPriceConfigurationId: ppcId } },",
" }).then((result) => {",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const referenceKey = getFormValue([`${tableIndex}-0:${salesArrangementPriceModelLineModel}`, \"_id\"], \"create\");",
"",
" const salesArrangementPriceModelLines = Object.keys(getFormValues()).filter(",
" key => key.match(`${tableIndex}+-[0-9]+:${salesArrangementPriceModelLineModel}`)",
" );",
"",
" salesArrangementPriceModelLines.reverse().forEach((key) => {",
" deleteFormModel(key);",
" });",
"",
" const priceConfigurations = result[pcModel].result;",
" let pcCount = 0;",
" priceConfigurations.forEach((pc) => {",
" const props = [",
" 'productId',",
" 'productName',",
" 'priceModel',",
" 'priceType',",
" 'billingFrequency',",
" 'billingTiming',",
" 'unitOfMeasure',",
" 'listPrice',",
" ];",
" const indexedModel = `${tableIndex}-${pcCount++}:${salesArrangementPriceModelLineModel}`;",
" const values = {...helpers.pick(pc, props), _id: referenceKey };",
" setFormValue([indexedModel], 'create', values);",
" });",
" });",
"};",
"",
"const result = {",
" data: [],",
" onChange,",
" extraAction: { onClick: () => openModal({ template: '/templates/everest.fin.accounting/ui/productCatalog', title: '{{productCatalog.title}}' }), icon: 'list' },",
"};",
"",
"const fetchedData = getUiModelDataValue([",
" 'everest.fin.accounting/ProductModel.Product',",
"]);",
"",
"if (!fetchedData) return result;",
"const { products, productPriceConfigurations } = fetchedData;",
"const preparedData = [];",
"products.forEach(({ productCode, productName, id }, i) => {",
" const pc = productPriceConfigurations[i];",
" preparedData.push({",
" label: `${productCode} - ${productName}`,",
" value: id,",
" data: pc.map((entry) => ({",
" value: entry.id,",
" label: entry.productPriceConfigurationName,",
" })),",
" });",
"});",
"",
"return { ...result, data: preparedData };"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.productName}}",
"dataBinding": [
"productName"
],
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.amount}}",
"dataBinding": [
"amount"
],
"parseAs": "currency",
"isEditable": false
},
{
"Header": "{{salesArrangement.orderedProducts.billingStartDate}}",
"dataBinding": [
"startDate"
],
"parseAs": "date"
},
{
"Header": "{{salesArrangement.orderedProducts.billingEndDate}}",
"dataBinding": [
"endDate"
],
"parseAs": "date"
},
{
"Header": "{{salesArrangement.orderedProducts.paymentTerm}}",
"dataBinding": {
"rawValue": [
"paymentTerm"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "PaymentTerm"
},
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.totalInvoiced}}",
"dataBinding": [
"totalInvoiced"
],
"parseAs": "currency",
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.currency}}",
"dataBinding": {
"rawValue": [
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.functionalCurrency}}",
"dataBinding": {
"rawValue": [
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.functionalAmount}}",
"dataBinding": [
"functionalAmount"
],
"parseAs": "currency",
"functions": {
"format": [
"if (isFetchingUiModelData) return;",
"const model = \"everest.fin.accounting/SalesArrangementModel.SalesArrangement\";",
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const currencyId = getUiModelDataValue([model, \"functionalCurrency\"]);",
"const { codeValue: currency } = currencies?.find(({ codeNumber }) => codeNumber === currencyId) ?? {};",
"return currency;"
]
}
}
]
},
{
"rowActionsIcon": "plus-circle-havlock",
"rowActions": [
{
"label": "{{salesArrangement.orderedProducts.addAnotherLine}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"onClick": [
"(_, tableIndex) => {",
" const parentModel = `${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`;",
" const parentAction = getFormAction(parentModel);",
" const { id: _id } = getFormValue([parentModel], parentAction) ?? {};",
" const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"",
" const { id: salesArrangementProductId } = getFormValue([parentModel], \"update\") ?? {};",
" const { salesArrangementPriceModelId } = getUiModelDataValue([model])?.find(salesArrangementPriceModelLine => salesArrangementPriceModelLine.salesArrangementProductId === salesArrangementProductId) ?? {};",
"",
" const formKeys = Object.keys(getFormValues());",
" const alias = formKeys.filter(key => key.match(`${tableIndex}+-[0-9]:${model}`))?.length;",
" setFormValue([`${tableIndex}-${alias}:${model}`], \"create\", { _id, salesArrangementPriceModelId, salesArrangementProductId });",
"}"
]
}
},
{
"label": "{{salesArrangement.orderedProducts.duplicateLine}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"getIsRowDisabled": "(rowIndex, tableIndex)=>getFormAction(`${tableIndex}-${rowIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`) === \"delete\"",
"onClick": [
"(rowIndex, tableIndex) => {",
" const formKeys = Object.keys(getFormValues());",
" const salModel = `${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`;",
" const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
" const alias = formKeys.filter(key => key.match(`${tableIndex}+-[0-9]:${model}`))?.length;",
"",
" const { id, ...values } = getFormModelValue(`${tableIndex}-${rowIndex}:${model}`) ?? {};",
" const { id: salesArrangementProductId } = getFormValue([salModel], \"update\") ?? {};",
" const { salesArrangementPriceModelId } = getUiModelDataValue([model])?.find(salesArrangementPriceModelLine => salesArrangementPriceModelLine.salesArrangementProductId === salesArrangementProductId) ?? {};",
"",
" setFormValue([`${tableIndex}-${alias}:${model}`], \"create\", { ...values, salesArrangementPriceModelId, salesArrangementProductId });",
"}"
]
}
},
{
"color": "brick",
"label": "{{salesArrangement.orderedProducts.deleteLine}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"getIsRowVisible": "(rowIndex, tableIndex)=>getFormAction(`${tableIndex}-${rowIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`) !== \"delete\"",
"onClick": [
"(rowIndex, tableIndex) => {",
" const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
" const formModel = `${tableIndex}-${rowIndex}:${model}`;",
" const action = getFormAction(formModel);",
"",
" if (action === \"update\") {",
" modifyFormAction(`${tableIndex}-${rowIndex}:${model}`, \"update\", \"delete\");",
" return;",
" }",
"",
" const formKeys = Object.keys(getFormValues());",
" const alias = formKeys.filter(key => key.match(`${tableIndex}+-[0-9]:${model}`))?.length;",
" const { _id } = getFormValue([formModel], action) ?? {};",
" if (alias === 1) setFormValue([formModel], action, { _id });",
" else deleteFormModel(formModel);",
"}"
]
}
},
{
"label": "{{salesArrangement.orderedProducts.undoDelete}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"getIsRowVisible": "(rowIndex, tableIndex)=>getFormAction(`${tableIndex}-${rowIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`) === \"delete\"",
"onClick": [
"(rowIndex, tableIndex) => {",
" const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
" modifyFormAction(`${tableIndex}-${rowIndex}:${model}`, \"delete\", \"update\");",
"}"
]
}
}
],
"relationshipKey": [
"_id"
],
"uiModelBinding": {
"data": [
"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine"
]
},
"functions": {
"data": "getUiModelDataValue([\"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\"])?.map(salesArrangementPriceModelLine => ({...salesArrangementPriceModelLine, _id: salesArrangementPriceModelLine.salesArrangementProductId }))"
},
"defaultAction": "update",
"editDisplayActions": [
"create",
"update",
"delete"
],
"columns": [
{
"Header": "{{salesArrangement.orderedProducts.salesArrangementPriceModelLine}}",
"dataBinding": [
"salesArrangementPriceModelLineNumber"
],
"sticky": "left"
},
{
"Header": "{{salesArrangement.orderedProducts.referenceProduct}}",
"dataBinding": [
"productName"
],
"sticky": "left",
"selectConfig": {
"listBinding": [
"Flat:everest.fin.accounting/ProductModel.Product"
],
"textBinding": "productName",
"valueBinding": "productName"
},
"functions": {
"onCellChange": [
"({ rowAction, value, name }) => {",
" const productsModel = \"Flat:everest.fin.accounting/ProductModel.Product\";",
" const products = getUiModelDataValue([productsModel]) ?? [];",
" const selectedProduct = products.find(p => p.productName === value) ?? {};",
"",
" const [matrixIndex] = name.split(\":\") ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" setFormValue([model, \"productId\"], rowAction, selectedProduct.id);",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.priceType}}",
"dataBinding": {
"rawValue": [
"priceType"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "PriceType"
},
"functions": {
"onCellChange": [
"({ rowAction, value, previousValue, name }) => {",
" const [matrixIndex] = name.split(':') ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" if(value === 3) { // PriceType === Usage",
" setFormValue([model, 'quantity'], rowAction, '0');",
" } else if(previousValue === 3){",
" setFormValue([model, 'quantity'], rowAction, null);",
" }",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.amount}}",
"dataBinding": [
"amount"
],
"parseAs": "currency",
"footerFunc": "sum",
"functions": {
"onCellChange": [
"({ rowAction, value, name }) => {",
" const [matrixIndex] = name.split(\":\") ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" const amount = new Decimal(value);",
" const quantity = new Decimal(getFormValue([model, \"quantity\"], rowAction));",
" const rate = amount.dividedBy(quantity);",
" if (rate.isNaN()) return;",
" setFormValue([model, \"effectiveRate\"], rowAction, rate.toFixed());",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.billingFrequency}}",
"dataBinding": {
"rawValue": [
"billingFrequency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "BillingFrequency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.billingTiming}}",
"dataBinding": {
"rawValue": [
"billingTiming"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "BillingTiming"
}
},
{
"Header": "{{salesArrangement.orderedProducts.priceModel}}",
"dataBinding": {
"rawValue": [
"priceModel"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "PriceModel"
}
},
{
"Header": "{{salesArrangement.orderedProducts.quantity}}",
"dataBinding": [
"quantity"
],
"functions": {
"onCellChange": [
"({ rowAction, value, name }) => {",
" const [matrixIndex] = name.split(\":\") ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" const quantity = new Decimal(value);",
" const effectiveRate = getFormValue([model, \"effectiveRate\"], rowAction);",
" const rawAmount = getFormValue([model, \"amount\"], rowAction);",
"",
" if (effectiveRate) {",
" const rate = new Decimal(effectiveRate);",
" const amount = quantity.times(rate);",
" if (amount.isNaN()) return;",
" setFormValue([model, \"amount\"], rowAction, amount.toFixed());",
" } else if (rawAmount) {",
" const amount = new Decimal(rawAmount);",
" const rate = amount.dividedBy(quantity);",
" if (rate.isNaN()) return;",
" setFormValue([model, \"effectiveRate\"], rowAction, rate.toFixed());",
" }",
"}"
],
"isEditable": "({ row }) => { return row?.original?.priceType == 3 ? false : true; }"
}
},
{
"Header": "{{salesArrangement.orderedProducts.unitOfMeasure}}",
"dataBinding": {
"rawValue": [
"unitOfMeasure"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "UnitOfMeasureType"
}
},
{
"Header": "{{salesArrangement.orderedProducts.effectiveRate}}",
"dataBinding": [
"effectiveRate"
],
"parseAs": "currency",
"functions": {
"onCellChange": [
"({ rowAction, value, name }) => {",
" const [matrixIndex] = name.split(\":\") ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" const rate = new Decimal(value);",
" const quantity = new Decimal(getFormValue([model, \"quantity\"], rowAction));",
" const amount = quantity.times(rate);",
" if (amount.isNaN()) return;",
" setFormValue([model, \"amount\"], rowAction, amount.toFixed());",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.serviceStartDate}}",
"dataBinding": [
"serviceStartDate"
],
"parseAs": "date",
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.serviceEndDate}}",
"dataBinding": [
"serviceEndDate"
],
"parseAs": "date",
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.billingStartDate}}",
"dataBinding": [
"billingStartDate"
],
"parseAs": "date",
"functions": {
"onCellChange": [
"({ name }) => {",
" const [tableIndex] = name.split('-');",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
"",
" const { values: salesArrangementPriceModelLineValues, matchingKeys: salesArrangementPriceModelLineKeys } = getFormValueList(salesArrangementPriceModelLineModel, [",
" 'create',",
" 'update',",
" ]);",
"",
" let earliestBillingStart = null;",
"",
" const { compareAsc, compareDesc, parseISOWithoutTimezone } = helpers.dates;",
"",
" salesArrangementPriceModelLineKeys.forEach((key, arrayIndex) => {",
" if (key.startsWith(tableIndex)) {",
" const { billingStartDate } = salesArrangementPriceModelLineValues[arrayIndex];",
"",
" const parsedBillingStart =",
" typeof billingStartDate === 'string'",
" ? parseISOWithoutTimezone(billingStartDate)",
" : billingStartDate;",
"",
" earliestBillingStart =",
" !earliestBillingStart ||",
" compareAsc(earliestBillingStart, parsedBillingStart)",
" ? parsedBillingStart",
" : earliestBillingStart;",
"",
" }",
" });",
"",
" if (!earliestBillingStart) return;",
"",
" const salAction = getFormAction(`${tableIndex}:${salModel}`);",
" setFormValue(",
" [`${tableIndex}:${salModel}`, 'startDate'],",
" salAction,",
" earliestBillingStart.toISOString()",
" );",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.billingEndDate}}",
"dataBinding": [
"billingEndDate"
],
"parseAs": "date",
"functions": {
"onCellChange": [
"({ name }) => {",
" const [tableIndex] = name.split('-');",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
"",
" const { values: salesArrangementPriceModelLineValues, matchingKeys: salesArrangementPriceModelLineKeys } = getFormValueList(salesArrangementPriceModelLineModel, [",
" 'create',",
" 'update',",
" ]);",
"",
" let latestBillingEnd = null;",
"",
" const { compareAsc, compareDesc, parseISOWithoutTimezone } = helpers.dates;",
"",
" salesArrangementPriceModelLineKeys.forEach((key, arrayIndex) => {",
" if (key.startsWith(tableIndex)) {",
" const { billingEndDate } = salesArrangementPriceModelLineValues[arrayIndex];",
"",
" const parsedBillingEnd =",
" typeof billingEndDate === 'string'",
" ? parseISOWithoutTimezone(billingEndDate)",
" : billingEndDate;",
"",
" latestBillingEnd =",
" !latestBillingEnd || compareDesc(parsedBillingEnd, latestBillingEnd)",
" ? parsedBillingEnd",
" : latestBillingEnd;",
" }",
" });",
"",
" if (!latestBillingEnd) return;",
"",
" const salAction = getFormAction(`${tableIndex}:${salModel}`);",
" setFormValue(",
" [`${tableIndex}:${salModel}`, 'endDate'],",
" salAction,",
" latestBillingEnd.toISOString()",
" );",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.currency}}",
"dataBinding": {
"rawValue": [
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.functionalCurrency}}",
"dataBinding": {
"rawValue": [
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.exchangeRate}}",
"dataBinding": [
"exchangeRate"
]
},
{
"Header": "{{salesArrangement.orderedProducts.functionalAmount}}",
"dataBinding": [
"functionalAmount"
],
"parseAs": "currency",
"footerFunc": "sum",
"functions": {
"format": [
"if (isFetchingUiModelData) return;",
"const model = \"everest.fin.accounting/SalesArrangementModel.SalesArrangement\";",
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const currencyId = getUiModelDataValue([model, \"functionalCurrency\"]);",
"const { codeValue: currency } = currencies?.find(({ codeNumber }) => codeNumber === currencyId) ?? {};",
"return currency;"
]
}
}
]
}
]
}
]
},
{
"title": "{{salesArrangement.billing.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "${subtitle} {{salesArrangement.billing.subtitle}}",
"secondParsing": "percent"
},
"uiModelBinding": {
"subtitle": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"pctBilled"
]
},
"functions": {
"isDisabled": "state.mode === 'create'"
},
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"functions": {
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "()=>showToast({type:'warning',title:'{{notImplementedR2.title}}',message:'{{notImplementedR2.message}}'})"
}
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"functions": {
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "(state.mode ==='edit')?'{{salesArrangement.callToAction.actions.saveRevisions}}':'{{salesArrangement.callToAction.actions.revise}}'",
"onClick": [
"() => {",
" if (state.mode !== 'edit') {",
" setState('mode', 'edit');",
" setTemplateActiveSegment(1);",
" } else {",
" const removeEmpty = (rawLine, index, idProp, model) => {",
" if (index === 0 || getFormAction(model) !== 'create') return;",
" const { [idProp]: id, ...line } = rawLine || {};",
" const isEmpty =",
" helpers.isEmpty(line) ||",
" Object.values(line).every(",
" (v) => v == null || (typeof v === 'object' && helpers.isEmpty(v))",
" );",
" if (isEmpty) deleteFormModel(model, true, false);",
" };",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const { values: salesArrangementProducts, matchingKeys: saKeys } =",
" getFormValueList(salModel, ['create', 'update', 'delete']) || [];",
" salesArrangementProducts?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementId', saKeys[index]),",
" []",
" );",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: salesArrangementPriceModelLineLines, matchingKeys: salesArrangementPriceModelLineKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create', 'update', 'delete']) || [];",
" salesArrangementPriceModelLineLines?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementProductId', salesArrangementPriceModelLineKeys[index]),",
" []",
" );",
" defaultSubmit({",
" skipRefetchOnSuccess: true,",
" onSuccess: async () => {",
" const formValues = getFormValues();",
"",
" Object.keys(formValues)",
" ?.filter((key) => key.includes(salModel))",
" ?.forEach((key) => {",
" deleteFormAction(key, 'create');",
" deleteFormAction(key, 'delete');",
" });",
"",
" const boModel =",
" 'everest.fin.accounting/BOComposition/SalesArrangementBusinessObjectModel.SalesArrangementBusinessObject';",
" const { id } = getUiModelDataValue([boModel])?.[0] ?? {};",
"",
" if (id != null) {",
" const updateBoResponse = await everestAction({",
" uiModelName: 'everest.fin.accounting/ui/accounting',",
" model: boModel,",
" action: 'update',",
" body: { id, headerKey: state.id },",
" fieldlist: [\"id\"],",
" });",
" console.log('BO Updated:', updateBoResponse);",
" }",
" await refetchUiModelData();",
" setState(\"mode\", \"view\");",
" },",
" transform: (rawValues) => {",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" let formValues = helpers.cloneDeep(rawValues);",
" delete formValues.billingAddressField;",
" for (let key in formValues) {",
" delete formValues[key].update?.childProduct;",
" delete formValues[key].create?.childProduct;",
" delete formValues[key].delete?.childProduct;",
" delete formValues[key].update?._id;",
" delete formValues[key].create?._id;",
" delete formValues[key].delete?._id;",
" delete formValues[key].update?.productCode;",
" delete formValues[key].create?.productCode;",
" delete formValues[key].delete?.productCode;",
" }",
"",
" const { values: createsalesArrangementProducts, matchingKeys: createSaKeys } =",
" getFormValueList(salModel, ['create']) || [];",
"",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: createLcLines, matchingKeys: createLcKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create']) || [];",
" createLcKeys.forEach((key) => {",
" if (createSaKeys.includes(`${key.charAt(0)}:${salModel}`)) {",
" delete formValues[key];",
" }",
" });",
"",
" createSaKeys.forEach((salKey, salIndex) => {",
" const charges = [];",
" createLcKeys.forEach((salesArrangementPriceModelLineKey, salesArrangementPriceModelLineIndex) => {",
" if (salesArrangementPriceModelLineKey.startsWith(salKey.charAt(0))) {",
" const data = createLcLines[salesArrangementPriceModelLineIndex];",
" delete data._id;",
" delete data.childProduct;",
" charges.push(data);",
" }",
" });",
" delete formValues[salKey].create;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementProduct',",
" ],",
" helpers.cloneDeep(rawValues[salKey].create)",
" );",
" delete formValues[salKey].createSalesArrangementProductWithPriceModelLines",
" .salesArrangementProduct._id;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementPriceModelLines',",
" ],",
" charges",
" );",
" });",
"",
" const { matchingKeys: salUpdateKeys } = getFormValueList(salModel, [\"update\"]) ?? [];",
" salUpdateKeys.forEach(key => {",
" delete formValues?.[key]?.update?.startDate;",
" delete formValues?.[key]?.update?.endDate;",
" });",
"",
" Object.entries(formValues).forEach(([key, value]) => {",
" if(!!value?.update) {",
" formValues[key] = {...value, fieldlist: [\"id\"]}",
" }",
" });",
"",
" return formValues;",
" },",
" });",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.approve}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 2, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.reject}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" const runResponse=await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 1, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
}
]
}
}
},
{
"component": "Block",
"collapsible": true,
"size": "11",
"title": "{{salesArrangement.details.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"onCollapseClick": "(collapsed) => {setState('detailsCollapsed', !collapsed)}",
"collapsed": "!!state.detailsCollapsed"
},
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"uiModelBinding": {
"id": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
]
}
}
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
],
"list": [
"everest.fin.accounting/BusinessPartnerModel.BusinessPartner"
],
"text": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerNumber"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"functions": {
"value": "const [address] = uiModelData?.['BillingAddress:everest.base/AddressModel.Address']?.result || [];if (address) {return `${address.line1}\n${address.line2}\n${address.city}, ${address.stateProvince} ${address.zipCode}\n${address.country}`;}return '';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"mainContactEmail"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"billingEmail"
]
}
}
]
},
{
"component": "SummaryText",
"size": "1",
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"component": "Block",
"collapsible": true,
"size": "12",
"title": "{{salesArrangement.orderDetails.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.orderDetailsCollapsed",
"onCollapseClick": "collapsed => setState('orderDetailsCollapsed', !collapsed)"
},
"disabledAction": {
"label": "{{salesArrangement.reviseDetails}}",
"functions": {
"onClick": "()=>setTemplateActiveSegment(1)"
}
},
"elements": [
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityName}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityName"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityId}}",
"link": {
"to": "https://www.google.com/",
"target": "_blank",
"rel": "noreferrer",
"isExternal": true
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityIdText"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.purchaseOrder}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"purchaseOrder"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesRep}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesRep"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.signDate}}",
"parseAs": "date",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"signDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.bookingDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"bookDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.effectiveDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesEffectiveDate"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesGroup}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesGroup"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.currency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.functionalCurrency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.notes}}",
"size": "2",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"memo"
]
}
}
]
},
{
"title": "{{salesArrangement.invoices.title}}",
"component": "WidgetGroup",
"size": "12",
"functions": {
"isDisabled": "state.mode === 'edit'"
},
"widgets": [
{
"label": "{{salesArrangement.invoices.invoices}}",
"component": "SecondaryTable",
"uiModelBinding": {
"data": [
"everest.fin.accounting/BillingPlanLineModel.BillingPlanLine"
]
},
"functions": {
"data": [
"const invoices = getUiModelDataValue([\"everest.fin.accounting/BillingPlanLineModel.BillingPlanLine\"]) ?? [];",
"return helpers.orderBy(invoices, \"billDate\");"
]
},
"groupBy": [
"billDate"
],
"columns": [
{
"Header": "{{salesArrangement.invoices.billPlanDate}}",
"dataBinding": [
"billDate"
],
"parseAs": "date"
},
{
"Header": "",
"dataBinding": [
"billingPlanLineNumber"
]
},
{
"Header": "",
"dataBinding": [
"product"
]
},
{
"Header": "{{salesArrangement.invoices.billingPlan}}",
"dataBinding": [
"billingPlan"
],
"functions": {
"onCellClick": [
"({ row }) => {",
" const filterData = getUiModelDataValue([",
" \"everest.fin.accounting/BillingPlanModel.BillingPlan\",",
" ]) ?? [];",
" openModal({",
" title: \"{{billingPlansSalesArrangement.billingPlan}}\",",
" template:",
" \"/templates/everest.fin.accounting/ui/billingPlansSalesArrangement?saId=\" +",
" state.id + \"&selectedBillingPlan=\" + row.original.billingPlanId,",
" filter: {",
" defaultValue: row.original.billingPlanId,",
" items: filterData?.map(({ id: value, billingPlanNumber: label }) => ({ label, value })),",
" },",
" });",
"}"
]
}
},
{
"Header": "{{salesArrangement.invoices.amount}}",
"dataBinding": [
"amount"
],
"aggregate": "sum",
"parseAs": "currency"
},
{
"Header": "{{salesArrangement.invoices.startDate}}",
"dataBinding": [
"serviceStart"
],
"parseAs": "date",
"aggregate": "minDate"
},
{
"Header": "{{salesArrangement.invoices.endDate}}",
"dataBinding": [
"serviceEnd"
],
"parseAs": "date",
"aggregate": "maxDate"
},
{
"Header": "{{salesArrangement.invoices.status}}",
"dataBinding": {
"rawValue": [
"invoiceStatus"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "InvoiceStatus"
}
},
{
"Header": "{{salesArrangement.invoices.invoice}}",
"dataBinding": [
"invoice"
],
"functions": {
"onCellClick": "({column, row}) => navigate({ to: '/templates/everest.fin.accounting/ui/invoice?id='+row.original.invoiceId })"
}
}
]
},
{
"label": "{{salesArrangement.invoices.invoiceLines}}",
"component": "SecondaryTable",
"uiModelBinding": {
"data": [
"everest.fin.accounting/InvoiceLineModel.InvoiceLine"
]
},
"columns": [
{
"Header": "{{salesArrangement.invoices.product}}",
"dataBinding": [
"product"
],
"functions": {
"onCellClick": "({column, row}) => navigate({ to: '/templates/everest.fin.accounting/ui/product?id='+row.original.productId })"
}
},
{
"Header": "{{salesArrangement.invoices.billingPlan}}",
"dataBinding": [
"billingPlan"
],
"functions": {
"onCellClick": [
"({ row }) => {",
" const filterData = getUiModelDataValue([",
" \"everest.fin.accounting/BillingPlanModel.BillingPlan\",",
" ]) ?? [];",
" openModal({",
" title: \"{{billingPlansSalesArrangement.billingPlan}}\",",
" template:",
" \"/templates/everest.fin.accounting/ui/billingPlansSalesArrangement?saId=\" +",
" state.id + \"&selectedBillingPlan=\" + row.original.billingPlanId,",
" filter: {",
" defaultValue: row.original.billingPlanId,",
" items: filterData?.map(({ id: value, billingPlanNumber: label }) => ({ label, value })),",
" },",
" });",
"}"
]
}
},
{
"Header": "{{salesArrangement.invoices.salesArrLine}}",
"dataBinding": [
"salesArrLine"
]
},
{
"Header": "{{salesArrangement.invoices.startDate}}",
"dataBinding": [
"serviceStart"
],
"parseAs": "date",
"format": "P"
},
{
"Header": "{{salesArrangement.invoices.endDate}}",
"dataBinding": [
"serviceEnd"
],
"parseAs": "date",
"format": "P"
},
{
"Header": "{{salesArrangement.invoices.amount}}",
"dataBinding": [
"amount"
],
"parseAs": "currency"
}
]
}
]
},
{
"component": "Template",
"functions": {
"link": "'/templates/everest.fin.accounting/ui/billingSchedule?id=' + state.id"
}
}
]
},
{
"title": "{{salesArrangement.revenue.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "${subtitle} {{salesArrangement.revenue.subtitle}}",
"secondParsing": "shortPercent"
},
"uiModelBinding": {
"subtitle": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"pctRecognizedRevenue"
]
},
"functions": {
"isDisabled": "state.mode === 'create'"
},
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"functions": {
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "()=>showToast({type:'warning',title:'{{notImplementedR2.title}}',message:'{{notImplementedR2.message}}'})"
}
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"functions": {
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "(state.mode ==='edit')?'{{salesArrangement.callToAction.actions.saveRevisions}}':'{{salesArrangement.callToAction.actions.revise}}'",
"onClick": [
"() => {",
" if (state.mode !== 'edit') {",
" setState('mode', 'edit');",
" setTemplateActiveSegment(1);",
" } else {",
" const removeEmpty = (rawLine, index, idProp, model) => {",
" if (index === 0 || getFormAction(model) !== 'create') return;",
" const { [idProp]: id, ...line } = rawLine || {};",
" const isEmpty =",
" helpers.isEmpty(line) ||",
" Object.values(line).every(",
" (v) => v == null || (typeof v === 'object' && helpers.isEmpty(v))",
" );",
" if (isEmpty) deleteFormModel(model, true, false);",
" };",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const { values: salesArrangementProducts, matchingKeys: saKeys } =",
" getFormValueList(salModel, ['create', 'update', 'delete']) || [];",
" salesArrangementProducts?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementId', saKeys[index]),",
" []",
" );",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: salesArrangementPriceModelLineLines, matchingKeys: salesArrangementPriceModelLineKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create', 'update', 'delete']) || [];",
" salesArrangementPriceModelLineLines?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementProductId', salesArrangementPriceModelLineKeys[index]),",
" []",
" );",
" defaultSubmit({",
" skipRefetchOnSuccess: true,",
" onSuccess: async () => {",
" const formValues = getFormValues();",
"",
" Object.keys(formValues)",
" ?.filter((key) => key.includes(salModel))",
" ?.forEach((key) => {",
" deleteFormAction(key, 'create');",
" deleteFormAction(key, 'delete');",
" });",
"",
" const boModel =",
" 'everest.fin.accounting/BOComposition/SalesArrangementBusinessObjectModel.SalesArrangementBusinessObject';",
" const { id } = getUiModelDataValue([boModel])?.[0] ?? {};",
"",
" if (id != null) {",
" const updateBoResponse = await everestAction({",
" uiModelName: 'everest.fin.accounting/ui/accounting',",
" model: boModel,",
" action: 'update',",
" body: { id, headerKey: state.id },",
" fieldlist: [\"id\"],",
" });",
" console.log('BO Updated:', updateBoResponse);",
" }",
" await refetchUiModelData();",
" setState(\"mode\", \"view\");",
" },",
" transform: (rawValues) => {",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" let formValues = helpers.cloneDeep(rawValues);",
" delete formValues.billingAddressField;",
" for (let key in formValues) {",
" delete formValues[key].update?.childProduct;",
" delete formValues[key].create?.childProduct;",
" delete formValues[key].delete?.childProduct;",
" delete formValues[key].update?._id;",
" delete formValues[key].create?._id;",
" delete formValues[key].delete?._id;",
" delete formValues[key].update?.productCode;",
" delete formValues[key].create?.productCode;",
" delete formValues[key].delete?.productCode;",
" }",
"",
" const { values: createsalesArrangementProducts, matchingKeys: createSaKeys } =",
" getFormValueList(salModel, ['create']) || [];",
"",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: createLcLines, matchingKeys: createLcKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create']) || [];",
" createLcKeys.forEach((key) => {",
" if (createSaKeys.includes(`${key.charAt(0)}:${salModel}`)) {",
" delete formValues[key];",
" }",
" });",
"",
" createSaKeys.forEach((salKey, salIndex) => {",
" const charges = [];",
" createLcKeys.forEach((salesArrangementPriceModelLineKey, salesArrangementPriceModelLineIndex) => {",
" if (salesArrangementPriceModelLineKey.startsWith(salKey.charAt(0))) {",
" const data = createLcLines[salesArrangementPriceModelLineIndex];",
" delete data._id;",
" delete data.childProduct;",
" charges.push(data);",
" }",
" });",
" delete formValues[salKey].create;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementProduct',",
" ],",
" helpers.cloneDeep(rawValues[salKey].create)",
" );",
" delete formValues[salKey].createSalesArrangementProductWithPriceModelLines",
" .salesArrangementProduct._id;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementPriceModelLines',",
" ],",
" charges",
" );",
" });",
"",
" const { matchingKeys: salUpdateKeys } = getFormValueList(salModel, [\"update\"]) ?? [];",
" salUpdateKeys.forEach(key => {",
" delete formValues?.[key]?.update?.startDate;",
" delete formValues?.[key]?.update?.endDate;",
" });",
"",
" return formValues;",
" },",
" });",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.approve}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 2, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.reject}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" const runResponse=await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 1, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
}
]
}
}
},
{
"component": "Block",
"collapsible": true,
"size": "11",
"title": "{{salesArrangement.details.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"onCollapseClick": "(collapsed) => {setState('detailsCollapsed', !collapsed)}",
"collapsed": "!!state.detailsCollapsed"
},
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"uiModelBinding": {
"id": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
]
}
}
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
],
"list": [
"everest.fin.accounting/BusinessPartnerModel.BusinessPartner"
],
"text": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerNumber"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"functions": {
"value": "const [address] = uiModelData?.['BillingAddress:everest.base/AddressModel.Address']?.result || [];if (address) {return `${address.line1}\n${address.line2}\n${address.city}, ${address.stateProvince} ${address.zipCode}\n${address.country}`;}return '';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"mainContactEmail"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"billingEmail"
]
}
}
]
},
{
"component": "SummaryText",
"size": "1",
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"component": "Block",
"collapsible": true,
"size": "12",
"title": "{{salesArrangement.orderDetails.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.orderDetailsCollapsed",
"onCollapseClick": "collapsed => setState('orderDetailsCollapsed', !collapsed)"
},
"disabledAction": {
"label": "{{salesArrangement.reviseDetails}}",
"functions": {
"onClick": "()=>setTemplateActiveSegment(1)"
}
},
"elements": [
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityName}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityName"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityId}}",
"link": {
"to": "https://www.google.com/",
"target": "_blank",
"rel": "noreferrer",
"isExternal": true
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityIdText"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.purchaseOrder}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"purchaseOrder"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesRep}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesRep"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.signDate}}",
"parseAs": "date",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"signDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.bookingDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"bookDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.effectiveDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesEffectiveDate"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesGroup}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesGroup"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.currency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.functionalCurrency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.notes}}",
"size": "2",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"memo"
]
}
}
]
},
{
"component": "Template",
"functions": {
"link": "'/templates/everest.fin.accounting/ui/revenueWaterfall?id=' + state.id"
}
}
]
}
]
}
]
}
}
{
"version": 2,
"uicontroller": "salesArrangementNext.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangementProducts",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModels",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "priceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"uiModelBinding": {
"status": "SalesArrangement.salesArrangementStatus",
"subtitle": "SalesArrangement.salesArrangementNumber"
}
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"uiModelBinding": {
"subtitle": "SalesArrangement.totalAmount"
},
"functions": {
"isDisabled": "state.mode === 'create'"
},
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"functions": {
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
}
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"functions": {
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
}
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"onCollapseClick": "(collapsed) => {setState('detailsCollapsed', !collapsed)}",
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.detailsCollapsed"
},
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"uiModelBinding": {
"id": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
]
}
}
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
],
"list": [
"everest.fin.accounting/BusinessPartnerModel.BusinessPartner"
],
"text": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerNumber"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"functions": {
"value": "const [address] = uiModelData?.['BillingAddress:everest.base/AddressModel.Address']?.result || [];if (address) {return `${address.line1}\n${address.line2}\n${address.city}, ${address.stateProvince} ${address.zipCode}\n${address.country}`;}return '';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"mainContactEmail"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"billingEmail"
]
}
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"component": "Block",
"collapsible": true,
"size": "12",
"title": "{{salesArrangement.orderDetails.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.orderDetailsCollapsed",
"onCollapseClick": "collapsed => setState('orderDetailsCollapsed', !collapsed)"
},
"disabledAction": {
"label": "{{salesArrangement.reviseDetails}}",
"functions": {
"onClick": "()=>setTemplateActiveSegment(1)"
}
},
"elements": [
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityName}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityName"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityId}}",
"link": {
"to": "https://www.google.com/",
"target": "_blank",
"rel": "noreferrer",
"isExternal": true
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityIdText"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.purchaseOrder}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"purchaseOrder"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesRep}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesRep"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.signDate}}",
"parseAs": "date",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"signDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.bookingDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"bookDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.effectiveDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesEffectiveDate"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesGroup}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesGroup"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.currency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.functionalCurrency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.notes}}",
"size": "2",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"memo"
]
}
}
]
},
{
"component": "Template",
"size": "11",
"functions": {
"link": "'/templates/everest.fin.accounting/ui/balanceRollforward?id=' + state.id"
}
},
{
"component": "SectionGroup",
"size": "1",
"sections": [
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"title": "{{salesArrangement.activity.title}}",
"component": "WidgetGroup",
"functions": {
"isDisabled": "state.mode === 'edit'"
},
"widgets": [
{
"label": "{{salesArrangement.activity.log}}",
"component": "Messaging",
"dateFormat": "P",
"uiModelBinding": {
"list": [
"TODO"
]
}
},
{
"component": "Messaging",
"label": "{{salesArrangement.activity.notes}}",
"uiModelBinding": {
"list": [
"TODO"
]
},
"dateFormat": "P"
}
]
}
]
}
]
},
{
"title": "{{salesArrangement.orderedProducts.title}}",
"functions": {
"subtitle": "state.mode === 'create' ? '{{salesArrangement.orderedProducts.notSaved}}' : '{{salesArrangement.orderedProducts.saved}}'"
},
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"functions": {
"label": "state.mode==='create'?'{{salesArrangement.callToAction.actions.save}}':'{{salesArrangement.callToAction.actions.activate}}'",
"disabled": "formState?.isSubmitting || state.mode==='edit' || isFetchingUiModelData || (state.mode === 'create' && formState?.hasError)",
"onClick": [
"() => {",
" if (state.mode === 'create') {",
" const removeEmpty = (rawLine, index, idProp, model) => {",
" if (index === 0 || getFormAction(model) !== 'create') return;",
" const { [idProp]: id, ...line } = rawLine || {};",
" const isEmpty =",
" helpers.isEmpty(line) ||",
" Object.values(line).every(",
" (v) => v == null || (typeof v === 'object' && helpers.isEmpty(v))",
" );",
" if (isEmpty) deleteFormModel(model, true, false);",
" };",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const { values: salesArrangementProducts, matchingKeys: saKeys } =",
" getFormValueList(salModel, ['create', 'update', 'delete']) || [];",
" salesArrangementProducts?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementId', saKeys[index]),",
" []",
" );",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: salesArrangementPriceModelLineLines, matchingKeys: salesArrangementPriceModelLineKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create', 'update', 'delete']) || [];",
" salesArrangementPriceModelLineLines?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementProductId', salesArrangementPriceModelLineKeys[index]),",
" []",
" );",
" defaultSubmit({",
" onSuccess: async () => {",
" navigate({",
" to: '/templates/everest.fin.accounting/ui/salesArrangements',",
" closeCurrentTab: true,",
" });",
" },",
" transform: (rawValues) => {",
" const saModel =",
" 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" let formValues = {",
" [saModel]: {",
" createSalesArrangementWithLines: {",
" salesArrangement: {",
" ...helpers.cloneDeep(",
" rawValues[saModel].createSalesArrangementWithLines",
" ),",
" },",
" salesArrangementProducts: [],",
" salesArrangementPriceModelLines: [],",
" },",
" },",
" };",
" delete formValues.billingAddressField;",
" const formKeys = Object.keys(rawValues);",
" formKeys.forEach((key) => {",
" if (key.includes('SalesArrangementProduct')) {",
" const charges = [];",
" const currentSAL = helpers.cloneDeep(rawValues[key].create);",
" delete currentSAL._id;",
" delete currentSAL.productCode",
" formKeys.forEach((entry) => {",
" if (",
" entry.includes('SalesArrangementPriceModelLine') &&",
" entry.startsWith(key.charAt(0))",
" ) {",
" const salesArrangementPriceModelLine = helpers.cloneDeep(rawValues[entry].create);",
" delete salesArrangementPriceModelLine._id;",
" delete salesArrangementPriceModelLine.childProduct;",
" charges.push(salesArrangementPriceModelLine);",
" }",
" });",
" formValues[",
" saModel",
" ].createSalesArrangementWithLines.salesArrangementProducts.push(",
" currentSAL",
" );",
" formValues[",
" saModel",
" ].createSalesArrangementWithLines.salesArrangementPriceModelLines.push(charges);",
" }",
" });",
"",
" Object.entries(formValues).forEach(([key, value]) => {",
" if(!!value?.update) {",
" formValues[key] = {...value, fieldlist: [\"id\"]}",
" }",
" });",
"",
" return formValues;",
" },",
" });",
" } else {",
" showToast({",
" type: 'warning',",
" title: '{{notImplementedR2.title}}',",
" message: '{{notImplementedR2.message}}',",
" });",
" }",
"}"
]
}
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"functions": {
"disabled": "state.mode === \"create\""
},
"actions": [
{
"functions": {
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "(state.mode ==='edit')?'{{salesArrangement.callToAction.actions.saveRevisions}}':'{{salesArrangement.callToAction.actions.revise}}'",
"onClick": [
"() => {",
" if (state.mode !== 'edit') {",
" setState('mode', 'edit');",
" setTemplateActiveSegment(1);",
" } else {",
" const removeEmpty = (rawLine, index, idProp, model) => {",
" if (index === 0 || getFormAction(model) !== 'create') return;",
" const { [idProp]: id, ...line } = rawLine || {};",
" const isEmpty =",
" helpers.isEmpty(line) ||",
" Object.values(line).every(",
" (v) => v == null || (typeof v === 'object' && helpers.isEmpty(v))",
" );",
" if (isEmpty) deleteFormModel(model, true, false);",
" };",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const { values: salesArrangementProducts, matchingKeys: saKeys } =",
" getFormValueList(salModel, ['create', 'update', 'delete']) || [];",
" salesArrangementProducts?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementId', saKeys[index]),",
" []",
" );",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: salesArrangementPriceModelLineLines, matchingKeys: salesArrangementPriceModelLineKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create', 'update', 'delete']) || [];",
" salesArrangementPriceModelLineLines?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementProductId', salesArrangementPriceModelLineKeys[index]),",
" []",
" );",
" defaultSubmit({",
" skipRefetchOnSuccess: true,",
" onSuccess: async () => {",
" const formValues = getFormValues();",
"",
" Object.keys(formValues)",
" ?.filter((key) => key.includes(salModel))",
" ?.forEach((key) => {",
" deleteFormAction(key, 'create');",
" deleteFormAction(key, 'delete');",
" });",
"",
" const boModel =",
" 'everest.fin.accounting/BOComposition/SalesArrangementBusinessObjectModel.SalesArrangementBusinessObject';",
" const { id } = getUiModelDataValue([boModel])?.[0] ?? {};",
"",
" if (id != null) {",
" const updateBoResponse = await everestAction({",
" uiModelName: 'everest.fin.accounting/ui/accounting',",
" model: boModel,",
" action: 'update',",
" body: { id, headerKey: state.id },",
" fieldlist: [\"id\"],",
" });",
" console.log('BO Updated:', updateBoResponse);",
" }",
" await refetchUiModelData();",
" setState(\"mode\", \"view\");",
" },",
" transform: (rawValues) => {",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" let formValues = helpers.cloneDeep(rawValues);",
" delete formValues.billingAddressField;",
" for (let key in formValues) {",
" delete formValues[key].update?.childProduct;",
" delete formValues[key].create?.childProduct;",
" delete formValues[key].delete?.childProduct;",
" delete formValues[key].update?._id;",
" delete formValues[key].create?._id;",
" delete formValues[key].delete?._id;",
" delete formValues[key].update?.productCode;",
" delete formValues[key].create?.productCode;",
" delete formValues[key].delete?.productCode;",
" }",
"",
" const { values: createsalesArrangementProducts, matchingKeys: createSaKeys } =",
" getFormValueList(salModel, ['create']) || [];",
"",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: createLcLines, matchingKeys: createLcKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create']) || [];",
" createLcKeys.forEach((key) => {",
" if (createSaKeys.includes(`${key.charAt(0)}:${salModel}`)) {",
" delete formValues[key];",
" }",
" });",
"",
" createSaKeys.forEach((salKey, salIndex) => {",
" const charges = [];",
" createLcKeys.forEach((salesArrangementPriceModelLineKey, salesArrangementPriceModelLineIndex) => {",
" if (salesArrangementPriceModelLineKey.startsWith(salKey.charAt(0))) {",
" const data = createLcLines[salesArrangementPriceModelLineIndex];",
" delete data._id;",
" delete data.childProduct;",
" charges.push(data);",
" }",
" });",
" delete formValues[salKey].create;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementProduct',",
" ],",
" helpers.cloneDeep(rawValues[salKey].create)",
" );",
" delete formValues[salKey].createSalesArrangementProductWithPriceModelLines",
" .salesArrangementProduct._id;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementPriceModelLines',",
" ],",
" charges",
" );",
" });",
"",
" const { matchingKeys: salUpdateKeys } = getFormValueList(salModel, [\"update\"]) ?? [];",
" salUpdateKeys.forEach(key => {",
" delete formValues?.[key]?.update?.startDate;",
" delete formValues?.[key]?.update?.endDate;",
" });",
"",
" Object.entries(formValues).forEach(([key, value]) => {",
" if(!!value?.update) {",
" formValues[key] = {...value, fieldlist: [\"id\"]}",
" }",
" });",
"",
" return formValues;",
" },",
" });",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.approve}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 2, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.reject}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" const runResponse=await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 1, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
}
]
}
}
},
{
"component": "Block",
"functions": {
"onCollapseClick": "(collapsed) => {setState('detailsCollapsed', !collapsed)}",
"collapsed": "!!state.detailsCollapsed"
},
"collapsible": true,
"size": "11",
"title": "{{salesArrangement.details.title}}",
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"prefixProp": "businessPartnerNumber",
"isDisabled": false,
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"uiModelBinding": {
"id": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
]
}
}
},
"customAction": {
"label": "{{salesArrangement.details.createNew}}",
"type": "dark-grey",
"functions": {
"isVisible": "state.mode==='edit' || state.mode==='create'",
"onClick": "()=>openModal({title:'{{salesArrangement.details.createCustomer}}',template:'/templates/everest.fin.accounting/ui/businessPartnerCreate',onModalSubmit:(createdBusinessPartner)=>{if(createdBusinessPartner==null)return;refetchUiModelData(); const action=state.mode==='create'?'createSalesArrangementWithLines':'update';setFormValue(['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'],action,createdBusinessPartner)}})"
}
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
],
"list": [
"everest.fin.accounting/BusinessPartnerModel.BusinessPartner"
],
"text": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"onChange": "(value)=>{const action=state.mode==='create' ? 'createSalesArrangementWithLines':'update';setFormValue(['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'],action,value)}"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"uiModelBinding": {
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
],
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerNumber"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find(b=>b.id==partnerId);return partner?.businessPartnerNumber||'';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"uiModelBinding": {},
"name": "billingAddressField",
"functions": {
"isEditing": "state.mode === 'create' || state.mode === 'edit'",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find((b)=>b.id==partnerId);const address=getUiModelDataValue(['everest.base/AddressModel.Address',])?.find((address)=>address.id==partner?.defaultBillingAddressId);const addressLines=[address?.line1,address?.line2,`${address?.city}, ${address?.stateProvince} ${address?.zipCode}`,address?.country,].filter(Boolean).join(`\n`);return address?addressLines:'';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"uiModelBinding": {
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
],
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"mainContactEmail"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update'",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId',];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find((b)=>b.id==partnerId);return partner?.mainContactEmail??'';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"uiModelBinding": {
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
],
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"billingEmail"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId',];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find((b)=>b.id==partnerId);return partner?.billingEmail??'';"
}
}
]
},
{
"component": "SummaryText",
"size": "1",
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"functions": {
"value": [
"if (state.mode !== \"edit\" && state.mode !== \"create\") {",
" return getUiModelDataValue([",
" \"everest.fin.accounting/SalesArrangementModel.SalesArrangement\", \"totalAmount\",",
" ]);",
"}",
"",
"const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"const salesArrangementPriceModelLines = getFormValueList(model, [\"update\", \"create\"])?.values || [];",
"",
"const total = salesArrangementPriceModelLines.reduce((acc, line) => {",
" const amount = new Decimal(line.amount);",
" if (amount.isNaN()) return acc;",
" return amount.plus(acc);",
"}, new Decimal(0));",
"",
"return total.toFixed();"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"component": "Block",
"collapsible": true,
"size": "12",
"title": "{{salesArrangement.orderDetails.title}}",
"functions": {
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.orderDetailsCollapsed",
"onCollapseClick": "collapsed => setState('orderDetailsCollapsed', !collapsed)"
},
"elements": [
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityName}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityId}}",
"link": {
"to": "https://www.google.com/",
"target": "_blank",
"rel": "noreferrer",
"isExternal": true
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityIdText"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.purchaseOrder}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"purchaseOrder"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesRep}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesRep"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.signDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"signDate"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.bookingDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"bookDate"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.effectiveDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesEffectiveDate"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesGroup}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesGroup"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Select",
"idProp": "codeNumber",
"textProp": "text",
"label": "{{salesArrangement.orderDetails.currency}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"currency"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"text": [
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const currencyId = getUiModelDataValue([\"everest.fin.accounting/SalesArrangementModel.SalesArrangement\",\"currency\"]);",
"const { text: currency } = currencies.find(({ codeNumber }) => codeNumber === currencyId) ?? {};",
"return currency"
],
"list": [
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const usDollar = 149;",
"const sortedCurrencies = currencies.sort((a, b) => {",
" if (a.codeNumber === usDollar) return -1;",
" if (b.codeNumber === usDollar) return 1;",
" return a.text.localeCompare(b.text);",
"});",
"return sortedCurrencies"
]
}
},
{
"component": "Select",
"idProp": "codeNumber",
"textProp": "text",
"label": "{{salesArrangement.orderDetails.functionalCurrency}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"functionalCurrency"
],
"list": [
"Currency:everest.appserver/ValueHelpModel.ValueHelp"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"text": [
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const currencyId = getUiModelDataValue([\"everest.fin.accounting/SalesArrangementModel.SalesArrangement\",\"functionalCurrency\"]);",
"const { text: currency } = currencies.find(({ codeNumber }) => codeNumber === currencyId) ?? {};",
"return currency"
],
"value": [
"const modelValue = getUiModelDataValue(['everest.fin.accounting/SalesArrangementModel.SalesArrangement', 'functionalCurrency'])",
"return state.mode === 'create' ? 149 : modelValue;"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.notes}}",
"size": "2",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"memo"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
}
]
},
{
"component": "MultipleSecondaryTable",
"title": "{{salesArrangement.orderedProducts.title}}",
"size": "12",
"disabledActions": [
"delete"
],
"functions": {
"isEditing": "state.mode === \"edit\" || state.mode === \"create\""
},
"extraAction": {
"functions": {
"isVisible": "state.mode==='edit' || state.mode==='create'",
"onClick": [
"const lineModel = \"everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct\";",
"const salesArrangementPriceModelLineModel = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"const isCreate = state.mode === \"create\";",
"return () => {",
" const _id = Number(helpers.uniqueId());",
" const initialIndex = getFormValueList(lineModel, [",
" \"create\",",
" \"update\",",
" \"delete\",",
" \"createSalesArrangementWithLines\",",
" ]).values.length;",
" setFormValue([`${initialIndex}:${lineModel}`], \"create\", { _id, salesArrangementId: Number(state.id) });",
" setFormValue([`${initialIndex}-0:${salesArrangementPriceModelLineModel}`], \"create\", { _id });",
" setFormValue([`${initialIndex}-1:${salesArrangementPriceModelLineModel}`], \"create\", { _id });",
" setFormValue([`${initialIndex}-2:${salesArrangementPriceModelLineModel}`], \"create\", { _id });",
"}"
]
},
"label": "{{salesArrangement.orderedProducts.addMore}}",
"icon": "plus-circle-havlock"
},
"tables": [
{
"relationshipKey": [
"_id"
],
"rowActionsIcon": "times-circle-brick",
"rowActions": [
{
"label": "{{salesArrangement.orderedProducts.undoDelete}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"onClick": "(_, tableIndex)=>modifyFormAction(`${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`,\"delete\", \"update\")",
"getIsRowVisible": "(_, tableIndex)=>getFormAction(`${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`) === \"delete\""
}
},
{
"color": "brick",
"label": "{{salesArrangement.orderedProducts.deleteLine}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"onClick": [
"(_, tableIndex) => {",
" const lineModel = `${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`;",
" const salesArrangementPriceModelLineModel = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"",
" const salesArrangementPriceModelLines = Object.keys(getFormValues()).filter(",
" key => key.match(`${tableIndex}+-[0-9]+:${salesArrangementPriceModelLineModel}`)",
" );",
"",
" const salAction = getFormAction(lineModel);",
" if(salAction === \"update\") modifyFormAction(lineModel, \"update\", \"delete\");",
" else deleteFormModel(lineModel);",
"",
" salesArrangementPriceModelLines.reverse().forEach(key => {",
" const lineAction = getFormAction(key);",
" if(lineAction === \"update\") modifyFormAction(key, \"update\", \"delete\");",
" else deleteFormModel(key);",
" });",
"}"
],
"getIsRowDisabled": "(_, tableIndex)=>getFormAction(`${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`) === \"delete\""
}
}
],
"uiModelBinding": {
"data": [
"everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct"
]
},
"editDisplayActions": [
"create",
"update",
"delete",
"createSalesArrangementWithLines"
],
"functions": {
"data": [
"const isCreate = state.mode === \"create\";",
"const model=\"everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct\";",
"const salesArrangementPriceModelLineModel = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"if (isCreate && !getFormValueList(model, [\"create\"])?.values.length) {",
" setFormValue([`0:${model}`], \"create\", { _id: 1 });",
" setFormValue([`0-0:${salesArrangementPriceModelLineModel}`], \"create\", { _id: 1 });",
" setFormValue([`0-1:${salesArrangementPriceModelLineModel}`], \"create\", { _id: 1 });",
" setFormValue([`0-2:${salesArrangementPriceModelLineModel}`], \"create\", { _id: 1 });",
" return;",
"};",
"const data = getUiModelDataValue([ model ]) ?? [];",
"return data?.map(sal => ({ ...sal, _id: sal?.id }));"
],
"defaultAction": "if (state.mode === \"create\") return \"createSalesArrangementWithLines\"; return \"update\";"
},
"columns": [
{
"Header": "{{salesArrangement.orderedProducts.salesArrangementProduct}}",
"dataBinding": [
"salesArrangementProductNumber"
],
"sticky": "left",
"isEditable": false
},
{
"Header": "{{salesArrangement.orderedProducts.product}}",
"dataBinding": [
"productCode"
],
"sticky": "left",
"alwaysEditableCellActions": [
"create"
],
"isEditable": false,
"functions": {
"onCellClick": "({column, row}) => navigate({ to: \"/templates/everest.fin.accounting/ui/product?id=\"+row.original.productId })",
"multiLevelSelectConfig": [
"const onChange = (e, { key, label, name }) => {",
" const [model] = name.split('.');",
" const [tableIndex] = name.split(':');",
" const [code, productName] = label.split(' - ');",
" const ppcId = e.key.split('-')[1];",
" const pcModel = 'everest.fin.accounting/ProductChargeModel.ProductCharge';",
" setFormValue([model, 'productName'], 'create', productName);",
" const productData =",
" uiModelData['everest.fin.accounting/ProductModel.Product']?.result;",
" if (productData) {",
" const { id } = productData.products.find(",
" (entry) => entry.productCode === code",
" ) ?? {};",
" setFormValue([model, 'productId'], getFormAction(model), id);",
" }",
" everestAction({",
" uiModelName: 'everest.fin.accounting/ui/accounting',",
" model: pcModel,",
" action: 'query',",
" body: { where: { productPriceConfigurationId: ppcId } },",
" }).then((result) => {",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const referenceKey = getFormValue([`${tableIndex}-0:${salesArrangementPriceModelLineModel}`, \"_id\"], \"create\");",
"",
" const salesArrangementPriceModelLines = Object.keys(getFormValues()).filter(",
" key => key.match(`${tableIndex}+-[0-9]+:${salesArrangementPriceModelLineModel}`)",
" );",
"",
" salesArrangementPriceModelLines.reverse().forEach((key) => {",
" deleteFormModel(key);",
" });",
"",
" const priceConfigurations = result[pcModel].result;",
" let pcCount = 0;",
" priceConfigurations.forEach((pc) => {",
" const props = [",
" 'productId',",
" 'productName',",
" 'priceModel',",
" 'priceType',",
" 'billingFrequency',",
" 'billingTiming',",
" 'unitOfMeasure',",
" 'listPrice',",
" ];",
" const indexedModel = `${tableIndex}-${pcCount++}:${salesArrangementPriceModelLineModel}`;",
" const values = {...helpers.pick(pc, props), _id: referenceKey };",
" setFormValue([indexedModel], 'create', values);",
" });",
" });",
"};",
"",
"const result = {",
" data: [],",
" onChange,",
" extraAction: { onClick: () => openModal({ template: '/templates/everest.fin.accounting/ui/productCatalog', title: '{{productCatalog.title}}' }), icon: 'list' },",
"};",
"",
"const fetchedData = getUiModelDataValue([",
" 'everest.fin.accounting/ProductModel.Product',",
"]);",
"",
"if (!fetchedData) return result;",
"const { products, productPriceConfigurations } = fetchedData;",
"const preparedData = [];",
"products.forEach(({ productCode, productName, id }, i) => {",
" const pc = productPriceConfigurations[i];",
" preparedData.push({",
" label: `${productCode} - ${productName}`,",
" value: id,",
" data: pc.map((entry) => ({",
" value: entry.id,",
" label: entry.productPriceConfigurationName,",
" })),",
" });",
"});",
"",
"return { ...result, data: preparedData };"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.productName}}",
"dataBinding": [
"productName"
],
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.amount}}",
"dataBinding": [
"amount"
],
"parseAs": "currency",
"isEditable": false
},
{
"Header": "{{salesArrangement.orderedProducts.billingStartDate}}",
"dataBinding": [
"startDate"
],
"parseAs": "date"
},
{
"Header": "{{salesArrangement.orderedProducts.billingEndDate}}",
"dataBinding": [
"endDate"
],
"parseAs": "date"
},
{
"Header": "{{salesArrangement.orderedProducts.paymentTerm}}",
"dataBinding": {
"rawValue": [
"paymentTerm"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "PaymentTerm"
},
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.totalInvoiced}}",
"dataBinding": [
"totalInvoiced"
],
"parseAs": "currency",
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.currency}}",
"dataBinding": {
"rawValue": [
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.functionalCurrency}}",
"dataBinding": {
"rawValue": [
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.functionalAmount}}",
"dataBinding": [
"functionalAmount"
],
"parseAs": "currency",
"functions": {
"format": [
"if (isFetchingUiModelData) return;",
"const model = \"everest.fin.accounting/SalesArrangementModel.SalesArrangement\";",
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const currencyId = getUiModelDataValue([model, \"functionalCurrency\"]);",
"const { codeValue: currency } = currencies?.find(({ codeNumber }) => codeNumber === currencyId) ?? {};",
"return currency;"
]
}
}
]
},
{
"rowActionsIcon": "plus-circle-havlock",
"rowActions": [
{
"label": "{{salesArrangement.orderedProducts.addAnotherLine}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"onClick": [
"(_, tableIndex) => {",
" const parentModel = `${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`;",
" const parentAction = getFormAction(parentModel);",
" const { id: _id } = getFormValue([parentModel], parentAction) ?? {};",
" const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"",
" const { id: salesArrangementProductId } = getFormValue([parentModel], \"update\") ?? {};",
" const { salesArrangementPriceModelId } = getUiModelDataValue([model])?.find(salesArrangementPriceModelLine => salesArrangementPriceModelLine.salesArrangementProductId === salesArrangementProductId) ?? {};",
"",
" const formKeys = Object.keys(getFormValues());",
" const alias = formKeys.filter(key => key.match(`${tableIndex}+-[0-9]:${model}`))?.length;",
" setFormValue([`${tableIndex}-${alias}:${model}`], \"create\", { _id, salesArrangementPriceModelId, salesArrangementProductId });",
"}"
]
}
},
{
"label": "{{salesArrangement.orderedProducts.duplicateLine}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"getIsRowDisabled": "(rowIndex, tableIndex)=>getFormAction(`${tableIndex}-${rowIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`) === \"delete\"",
"onClick": [
"(rowIndex, tableIndex) => {",
" const formKeys = Object.keys(getFormValues());",
" const salModel = `${tableIndex}:everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct`;",
" const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
" const alias = formKeys.filter(key => key.match(`${tableIndex}+-[0-9]:${model}`))?.length;",
"",
" const { id, ...values } = getFormModelValue(`${tableIndex}-${rowIndex}:${model}`) ?? {};",
" const { id: salesArrangementProductId } = getFormValue([salModel], \"update\") ?? {};",
" const { salesArrangementPriceModelId } = getUiModelDataValue([model])?.find(salesArrangementPriceModelLine => salesArrangementPriceModelLine.salesArrangementProductId === salesArrangementProductId) ?? {};",
"",
" setFormValue([`${tableIndex}-${alias}:${model}`], \"create\", { ...values, salesArrangementPriceModelId, salesArrangementProductId });",
"}"
]
}
},
{
"color": "brick",
"label": "{{salesArrangement.orderedProducts.deleteLine}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"getIsRowVisible": "(rowIndex, tableIndex)=>getFormAction(`${tableIndex}-${rowIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`) !== \"delete\"",
"onClick": [
"(rowIndex, tableIndex) => {",
" const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
" const formModel = `${tableIndex}-${rowIndex}:${model}`;",
" const action = getFormAction(formModel);",
"",
" if (action === \"update\") {",
" modifyFormAction(`${tableIndex}-${rowIndex}:${model}`, \"update\", \"delete\");",
" return;",
" }",
"",
" const formKeys = Object.keys(getFormValues());",
" const alias = formKeys.filter(key => key.match(`${tableIndex}+-[0-9]:${model}`))?.length;",
" const { _id } = getFormValue([formModel], action) ?? {};",
" if (alias === 1) setFormValue([formModel], action, { _id });",
" else deleteFormModel(formModel);",
"}"
]
}
},
{
"label": "{{salesArrangement.orderedProducts.undoDelete}}",
"functions": {
"isVisible": "state.mode === \"edit\" || state.mode === \"create\"",
"getIsRowVisible": "(rowIndex, tableIndex)=>getFormAction(`${tableIndex}-${rowIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`) === \"delete\"",
"onClick": [
"(rowIndex, tableIndex) => {",
" const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
" modifyFormAction(`${tableIndex}-${rowIndex}:${model}`, \"delete\", \"update\");",
"}"
]
}
}
],
"relationshipKey": [
"_id"
],
"uiModelBinding": {
"data": [
"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine"
]
},
"functions": {
"data": "getUiModelDataValue([\"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\"])?.map(salesArrangementPriceModelLine => ({...salesArrangementPriceModelLine, _id: salesArrangementPriceModelLine.salesArrangementProductId }))"
},
"defaultAction": "update",
"editDisplayActions": [
"create",
"update",
"delete"
],
"columns": [
{
"Header": "{{salesArrangement.orderedProducts.salesArrangementPriceModelLine}}",
"dataBinding": [
"salesArrangementPriceModelLineNumber"
],
"sticky": "left"
},
{
"Header": "{{salesArrangement.orderedProducts.referenceProduct}}",
"dataBinding": [
"productName"
],
"sticky": "left",
"selectConfig": {
"listBinding": [
"Flat:everest.fin.accounting/ProductModel.Product"
],
"textBinding": "productName",
"valueBinding": "productName"
},
"functions": {
"onCellChange": [
"({ rowAction, value, name }) => {",
" const productsModel = \"Flat:everest.fin.accounting/ProductModel.Product\";",
" const products = getUiModelDataValue([productsModel]) ?? [];",
" const selectedProduct = products.find(p => p.productName === value) ?? {};",
"",
" const [matrixIndex] = name.split(\":\") ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" setFormValue([model, \"productId\"], rowAction, selectedProduct.id);",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.priceType}}",
"dataBinding": {
"rawValue": [
"priceType"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "PriceType"
},
"functions": {
"onCellChange": [
"({ rowAction, value, previousValue, name }) => {",
" const [matrixIndex] = name.split(':') ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" if(value === 3) { // PriceType === Usage",
" setFormValue([model, 'quantity'], rowAction, '0');",
" } else if(previousValue === 3){",
" setFormValue([model, 'quantity'], rowAction, null);",
" }",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.amount}}",
"dataBinding": [
"amount"
],
"parseAs": "currency",
"footerFunc": "sum",
"functions": {
"onCellChange": [
"({ rowAction, value, name }) => {",
" const [matrixIndex] = name.split(\":\") ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" const amount = new Decimal(value);",
" const quantity = new Decimal(getFormValue([model, \"quantity\"], rowAction));",
" const rate = amount.dividedBy(quantity);",
" if (rate.isNaN()) return;",
" setFormValue([model, \"effectiveRate\"], rowAction, rate.toFixed());",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.billingFrequency}}",
"dataBinding": {
"rawValue": [
"billingFrequency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "BillingFrequency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.billingTiming}}",
"dataBinding": {
"rawValue": [
"billingTiming"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "BillingTiming"
}
},
{
"Header": "{{salesArrangement.orderedProducts.priceModel}}",
"dataBinding": {
"rawValue": [
"priceModel"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "PriceModel"
}
},
{
"Header": "{{salesArrangement.orderedProducts.quantity}}",
"dataBinding": [
"quantity"
],
"functions": {
"onCellChange": [
"({ rowAction, value, name }) => {",
" const [matrixIndex] = name.split(\":\") ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" const quantity = new Decimal(value);",
" const effectiveRate = getFormValue([model, \"effectiveRate\"], rowAction);",
" const rawAmount = getFormValue([model, \"amount\"], rowAction);",
"",
" if (effectiveRate) {",
" const rate = new Decimal(effectiveRate);",
" const amount = quantity.times(rate);",
" if (amount.isNaN()) return;",
" setFormValue([model, \"amount\"], rowAction, amount.toFixed());",
" } else if (rawAmount) {",
" const amount = new Decimal(rawAmount);",
" const rate = amount.dividedBy(quantity);",
" if (rate.isNaN()) return;",
" setFormValue([model, \"effectiveRate\"], rowAction, rate.toFixed());",
" }",
"}"
],
"isEditable": "({ row }) => { return row?.original?.priceType == 3 ? false : true; }"
}
},
{
"Header": "{{salesArrangement.orderedProducts.unitOfMeasure}}",
"dataBinding": {
"rawValue": [
"unitOfMeasure"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "UnitOfMeasureType"
}
},
{
"Header": "{{salesArrangement.orderedProducts.effectiveRate}}",
"dataBinding": [
"effectiveRate"
],
"parseAs": "currency",
"functions": {
"onCellChange": [
"({ rowAction, value, name }) => {",
" const [matrixIndex] = name.split(\":\") ?? [];",
" const model = `${matrixIndex}:everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine`;",
" const rate = new Decimal(value);",
" const quantity = new Decimal(getFormValue([model, \"quantity\"], rowAction));",
" const amount = quantity.times(rate);",
" if (amount.isNaN()) return;",
" setFormValue([model, \"amount\"], rowAction, amount.toFixed());",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.serviceStartDate}}",
"dataBinding": [
"serviceStartDate"
],
"parseAs": "date",
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.serviceEndDate}}",
"dataBinding": [
"serviceEndDate"
],
"parseAs": "date",
"alwaysEditableCellActions": [
"create"
]
},
{
"Header": "{{salesArrangement.orderedProducts.billingStartDate}}",
"dataBinding": [
"billingStartDate"
],
"parseAs": "date",
"functions": {
"onCellChange": [
"({ name }) => {",
" const [tableIndex] = name.split('-');",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
"",
" const { values: salesArrangementPriceModelLineValues, matchingKeys: salesArrangementPriceModelLineKeys } = getFormValueList(salesArrangementPriceModelLineModel, [",
" 'create',",
" 'update',",
" ]);",
"",
" let earliestBillingStart = null;",
"",
" const { compareAsc, compareDesc, parseISOWithoutTimezone } = helpers.dates;",
"",
" salesArrangementPriceModelLineKeys.forEach((key, arrayIndex) => {",
" if (key.startsWith(tableIndex)) {",
" const { billingStartDate } = salesArrangementPriceModelLineValues[arrayIndex];",
"",
" const parsedBillingStart =",
" typeof billingStartDate === 'string'",
" ? parseISOWithoutTimezone(billingStartDate)",
" : billingStartDate;",
"",
" earliestBillingStart =",
" !earliestBillingStart ||",
" compareAsc(earliestBillingStart, parsedBillingStart)",
" ? parsedBillingStart",
" : earliestBillingStart;",
"",
" }",
" });",
"",
" if (!earliestBillingStart) return;",
"",
" const salAction = getFormAction(`${tableIndex}:${salModel}`);",
" setFormValue(",
" [`${tableIndex}:${salModel}`, 'startDate'],",
" salAction,",
" earliestBillingStart.toISOString()",
" );",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.billingEndDate}}",
"dataBinding": [
"billingEndDate"
],
"parseAs": "date",
"functions": {
"onCellChange": [
"({ name }) => {",
" const [tableIndex] = name.split('-');",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
"",
" const { values: salesArrangementPriceModelLineValues, matchingKeys: salesArrangementPriceModelLineKeys } = getFormValueList(salesArrangementPriceModelLineModel, [",
" 'create',",
" 'update',",
" ]);",
"",
" let latestBillingEnd = null;",
"",
" const { compareAsc, compareDesc, parseISOWithoutTimezone } = helpers.dates;",
"",
" salesArrangementPriceModelLineKeys.forEach((key, arrayIndex) => {",
" if (key.startsWith(tableIndex)) {",
" const { billingEndDate } = salesArrangementPriceModelLineValues[arrayIndex];",
"",
" const parsedBillingEnd =",
" typeof billingEndDate === 'string'",
" ? parseISOWithoutTimezone(billingEndDate)",
" : billingEndDate;",
"",
" latestBillingEnd =",
" !latestBillingEnd || compareDesc(parsedBillingEnd, latestBillingEnd)",
" ? parsedBillingEnd",
" : latestBillingEnd;",
" }",
" });",
"",
" if (!latestBillingEnd) return;",
"",
" const salAction = getFormAction(`${tableIndex}:${salModel}`);",
" setFormValue(",
" [`${tableIndex}:${salModel}`, 'endDate'],",
" salAction,",
" latestBillingEnd.toISOString()",
" );",
"}"
]
}
},
{
"Header": "{{salesArrangement.orderedProducts.currency}}",
"dataBinding": {
"rawValue": [
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.functionalCurrency}}",
"dataBinding": {
"rawValue": [
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
},
{
"Header": "{{salesArrangement.orderedProducts.exchangeRate}}",
"dataBinding": [
"exchangeRate"
]
},
{
"Header": "{{salesArrangement.orderedProducts.functionalAmount}}",
"dataBinding": [
"functionalAmount"
],
"parseAs": "currency",
"footerFunc": "sum",
"functions": {
"format": [
"if (isFetchingUiModelData) return;",
"const model = \"everest.fin.accounting/SalesArrangementModel.SalesArrangement\";",
"const currencies = getUiModelDataValue([\"Currency:everest.appserver/ValueHelpModel.ValueHelp\"]) ?? [];",
"const currencyId = getUiModelDataValue([model, \"functionalCurrency\"]);",
"const { codeValue: currency } = currencies?.find(({ codeNumber }) => codeNumber === currencyId) ?? {};",
"return currency;"
]
}
}
]
}
]
}
]
},
{
"title": "{{salesArrangement.billing.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "${subtitle} {{salesArrangement.billing.subtitle}}",
"secondParsing": "percent"
},
"uiModelBinding": {
"subtitle": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"pctBilled"
]
},
"functions": {
"isDisabled": "state.mode === 'create'"
},
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"functions": {
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "()=>showToast({type:'warning',title:'{{notImplementedR2.title}}',message:'{{notImplementedR2.message}}'})"
}
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"functions": {
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "(state.mode ==='edit')?'{{salesArrangement.callToAction.actions.saveRevisions}}':'{{salesArrangement.callToAction.actions.revise}}'",
"onClick": [
"() => {",
" if (state.mode !== 'edit') {",
" setState('mode', 'edit');",
" setTemplateActiveSegment(1);",
" } else {",
" const removeEmpty = (rawLine, index, idProp, model) => {",
" if (index === 0 || getFormAction(model) !== 'create') return;",
" const { [idProp]: id, ...line } = rawLine || {};",
" const isEmpty =",
" helpers.isEmpty(line) ||",
" Object.values(line).every(",
" (v) => v == null || (typeof v === 'object' && helpers.isEmpty(v))",
" );",
" if (isEmpty) deleteFormModel(model, true, false);",
" };",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const { values: salesArrangementProducts, matchingKeys: saKeys } =",
" getFormValueList(salModel, ['create', 'update', 'delete']) || [];",
" salesArrangementProducts?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementId', saKeys[index]),",
" []",
" );",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: salesArrangementPriceModelLineLines, matchingKeys: salesArrangementPriceModelLineKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create', 'update', 'delete']) || [];",
" salesArrangementPriceModelLineLines?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementProductId', salesArrangementPriceModelLineKeys[index]),",
" []",
" );",
" defaultSubmit({",
" skipRefetchOnSuccess: true,",
" onSuccess: async () => {",
" const formValues = getFormValues();",
"",
" Object.keys(formValues)",
" ?.filter((key) => key.includes(salModel))",
" ?.forEach((key) => {",
" deleteFormAction(key, 'create');",
" deleteFormAction(key, 'delete');",
" });",
"",
" const boModel =",
" 'everest.fin.accounting/BOComposition/SalesArrangementBusinessObjectModel.SalesArrangementBusinessObject';",
" const { id } = getUiModelDataValue([boModel])?.[0] ?? {};",
"",
" if (id != null) {",
" const updateBoResponse = await everestAction({",
" uiModelName: 'everest.fin.accounting/ui/accounting',",
" model: boModel,",
" action: 'update',",
" body: { id, headerKey: state.id },",
" fieldlist: [\"id\"],",
" });",
" console.log('BO Updated:', updateBoResponse);",
" }",
" await refetchUiModelData();",
" setState(\"mode\", \"view\");",
" },",
" transform: (rawValues) => {",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" let formValues = helpers.cloneDeep(rawValues);",
" delete formValues.billingAddressField;",
" for (let key in formValues) {",
" delete formValues[key].update?.childProduct;",
" delete formValues[key].create?.childProduct;",
" delete formValues[key].delete?.childProduct;",
" delete formValues[key].update?._id;",
" delete formValues[key].create?._id;",
" delete formValues[key].delete?._id;",
" delete formValues[key].update?.productCode;",
" delete formValues[key].create?.productCode;",
" delete formValues[key].delete?.productCode;",
" }",
"",
" const { values: createsalesArrangementProducts, matchingKeys: createSaKeys } =",
" getFormValueList(salModel, ['create']) || [];",
"",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: createLcLines, matchingKeys: createLcKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create']) || [];",
" createLcKeys.forEach((key) => {",
" if (createSaKeys.includes(`${key.charAt(0)}:${salModel}`)) {",
" delete formValues[key];",
" }",
" });",
"",
" createSaKeys.forEach((salKey, salIndex) => {",
" const charges = [];",
" createLcKeys.forEach((salesArrangementPriceModelLineKey, salesArrangementPriceModelLineIndex) => {",
" if (salesArrangementPriceModelLineKey.startsWith(salKey.charAt(0))) {",
" const data = createLcLines[salesArrangementPriceModelLineIndex];",
" delete data._id;",
" delete data.childProduct;",
" charges.push(data);",
" }",
" });",
" delete formValues[salKey].create;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementProduct',",
" ],",
" helpers.cloneDeep(rawValues[salKey].create)",
" );",
" delete formValues[salKey].createSalesArrangementProductWithPriceModelLines",
" .salesArrangementProduct._id;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementPriceModelLines',",
" ],",
" charges",
" );",
" });",
"",
" const { matchingKeys: salUpdateKeys } = getFormValueList(salModel, [\"update\"]) ?? [];",
" salUpdateKeys.forEach(key => {",
" delete formValues?.[key]?.update?.startDate;",
" delete formValues?.[key]?.update?.endDate;",
" });",
"",
" Object.entries(formValues).forEach(([key, value]) => {",
" if(!!value?.update) {",
" formValues[key] = {...value, fieldlist: [\"id\"]}",
" }",
" });",
"",
" return formValues;",
" },",
" });",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.approve}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 2, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.reject}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" const runResponse=await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 1, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
}
]
}
}
},
{
"component": "Block",
"collapsible": true,
"size": "11",
"title": "{{salesArrangement.details.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"onCollapseClick": "(collapsed) => {setState('detailsCollapsed', !collapsed)}",
"collapsed": "!!state.detailsCollapsed"
},
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"uiModelBinding": {
"id": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
]
}
}
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
],
"list": [
"everest.fin.accounting/BusinessPartnerModel.BusinessPartner"
],
"text": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerNumber"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"functions": {
"value": "const [address] = uiModelData?.['BillingAddress:everest.base/AddressModel.Address']?.result || [];if (address) {return `${address.line1}\n${address.line2}\n${address.city}, ${address.stateProvince} ${address.zipCode}\n${address.country}`;}return '';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"mainContactEmail"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"billingEmail"
]
}
}
]
},
{
"component": "SummaryText",
"size": "1",
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"component": "Block",
"collapsible": true,
"size": "12",
"title": "{{salesArrangement.orderDetails.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.orderDetailsCollapsed",
"onCollapseClick": "collapsed => setState('orderDetailsCollapsed', !collapsed)"
},
"disabledAction": {
"label": "{{salesArrangement.reviseDetails}}",
"functions": {
"onClick": "()=>setTemplateActiveSegment(1)"
}
},
"elements": [
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityName}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityName"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityId}}",
"link": {
"to": "https://www.google.com/",
"target": "_blank",
"rel": "noreferrer",
"isExternal": true
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityIdText"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.purchaseOrder}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"purchaseOrder"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesRep}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesRep"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.signDate}}",
"parseAs": "date",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"signDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.bookingDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"bookDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.effectiveDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesEffectiveDate"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesGroup}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesGroup"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.currency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.functionalCurrency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.notes}}",
"size": "2",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"memo"
]
}
}
]
},
{
"title": "{{salesArrangement.invoices.title}}",
"component": "WidgetGroup",
"size": "12",
"functions": {
"isDisabled": "state.mode === 'edit'"
},
"widgets": [
{
"label": "{{salesArrangement.invoices.invoices}}",
"component": "SecondaryTable",
"uiModelBinding": {
"data": [
"everest.fin.accounting/BillingPlanLineModel.BillingPlanLine"
]
},
"functions": {
"data": [
"const invoices = getUiModelDataValue([\"everest.fin.accounting/BillingPlanLineModel.BillingPlanLine\"]) ?? [];",
"return helpers.orderBy(invoices, \"billDate\");"
]
},
"groupBy": [
"billDate"
],
"columns": [
{
"Header": "{{salesArrangement.invoices.billPlanDate}}",
"dataBinding": [
"billDate"
],
"parseAs": "date"
},
{
"Header": "",
"dataBinding": [
"billingPlanLineNumber"
]
},
{
"Header": "",
"dataBinding": [
"product"
]
},
{
"Header": "{{salesArrangement.invoices.billingPlan}}",
"dataBinding": [
"billingPlan"
],
"functions": {
"onCellClick": [
"({ row }) => {",
" const filterData = getUiModelDataValue([",
" \"everest.fin.accounting/BillingPlanModel.BillingPlan\",",
" ]) ?? [];",
" openModal({",
" title: \"{{billingPlansSalesArrangement.billingPlan}}\",",
" template:",
" \"/templates/everest.fin.accounting/ui/billingPlansSalesArrangement?saId=\" +",
" state.id + \"&selectedBillingPlan=\" + row.original.billingPlanId,",
" filter: {",
" defaultValue: row.original.billingPlanId,",
" items: filterData?.map(({ id: value, billingPlanNumber: label }) => ({ label, value })),",
" },",
" });",
"}"
]
}
},
{
"Header": "{{salesArrangement.invoices.amount}}",
"dataBinding": [
"amount"
],
"aggregate": "sum",
"parseAs": "currency"
},
{
"Header": "{{salesArrangement.invoices.startDate}}",
"dataBinding": [
"serviceStart"
],
"parseAs": "date",
"aggregate": "minDate"
},
{
"Header": "{{salesArrangement.invoices.endDate}}",
"dataBinding": [
"serviceEnd"
],
"parseAs": "date",
"aggregate": "maxDate"
},
{
"Header": "{{salesArrangement.invoices.status}}",
"dataBinding": {
"rawValue": [
"invoiceStatus"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "InvoiceStatus"
}
},
{
"Header": "{{salesArrangement.invoices.invoice}}",
"dataBinding": [
"invoice"
],
"functions": {
"onCellClick": "({column, row}) => navigate({ to: '/templates/everest.fin.accounting/ui/invoice?id='+row.original.invoiceId })"
}
}
]
},
{
"label": "{{salesArrangement.invoices.invoiceLines}}",
"component": "SecondaryTable",
"uiModelBinding": {
"data": [
"everest.fin.accounting/InvoiceLineModel.InvoiceLine"
]
},
"columns": [
{
"Header": "{{salesArrangement.invoices.product}}",
"dataBinding": [
"product"
],
"functions": {
"onCellClick": "({column, row}) => navigate({ to: '/templates/everest.fin.accounting/ui/product?id='+row.original.productId })"
}
},
{
"Header": "{{salesArrangement.invoices.billingPlan}}",
"dataBinding": [
"billingPlan"
],
"functions": {
"onCellClick": [
"({ row }) => {",
" const filterData = getUiModelDataValue([",
" \"everest.fin.accounting/BillingPlanModel.BillingPlan\",",
" ]) ?? [];",
" openModal({",
" title: \"{{billingPlansSalesArrangement.billingPlan}}\",",
" template:",
" \"/templates/everest.fin.accounting/ui/billingPlansSalesArrangement?saId=\" +",
" state.id + \"&selectedBillingPlan=\" + row.original.billingPlanId,",
" filter: {",
" defaultValue: row.original.billingPlanId,",
" items: filterData?.map(({ id: value, billingPlanNumber: label }) => ({ label, value })),",
" },",
" });",
"}"
]
}
},
{
"Header": "{{salesArrangement.invoices.salesArrLine}}",
"dataBinding": [
"salesArrLine"
]
},
{
"Header": "{{salesArrangement.invoices.startDate}}",
"dataBinding": [
"serviceStart"
],
"parseAs": "date",
"format": "P"
},
{
"Header": "{{salesArrangement.invoices.endDate}}",
"dataBinding": [
"serviceEnd"
],
"parseAs": "date",
"format": "P"
},
{
"Header": "{{salesArrangement.invoices.amount}}",
"dataBinding": [
"amount"
],
"parseAs": "currency"
}
]
}
]
},
{
"component": "Template",
"functions": {
"link": "'/templates/everest.fin.accounting/ui/billingSchedule?id=' + state.id"
}
}
]
},
{
"title": "{{salesArrangement.revenue.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "${subtitle} {{salesArrangement.revenue.subtitle}}",
"secondParsing": "shortPercent"
},
"uiModelBinding": {
"subtitle": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"pctRecognizedRevenue"
]
},
"functions": {
"isDisabled": "state.mode === 'create'"
},
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"functions": {
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "()=>showToast({type:'warning',title:'{{notImplementedR2.title}}',message:'{{notImplementedR2.message}}'})"
}
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"functions": {
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "(state.mode ==='edit')?'{{salesArrangement.callToAction.actions.saveRevisions}}':'{{salesArrangement.callToAction.actions.revise}}'",
"onClick": [
"() => {",
" if (state.mode !== 'edit') {",
" setState('mode', 'edit');",
" setTemplateActiveSegment(1);",
" } else {",
" const removeEmpty = (rawLine, index, idProp, model) => {",
" if (index === 0 || getFormAction(model) !== 'create') return;",
" const { [idProp]: id, ...line } = rawLine || {};",
" const isEmpty =",
" helpers.isEmpty(line) ||",
" Object.values(line).every(",
" (v) => v == null || (typeof v === 'object' && helpers.isEmpty(v))",
" );",
" if (isEmpty) deleteFormModel(model, true, false);",
" };",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const { values: salesArrangementProducts, matchingKeys: saKeys } =",
" getFormValueList(salModel, ['create', 'update', 'delete']) || [];",
" salesArrangementProducts?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementId', saKeys[index]),",
" []",
" );",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: salesArrangementPriceModelLineLines, matchingKeys: salesArrangementPriceModelLineKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create', 'update', 'delete']) || [];",
" salesArrangementPriceModelLineLines?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementProductId', salesArrangementPriceModelLineKeys[index]),",
" []",
" );",
" defaultSubmit({",
" skipRefetchOnSuccess: true,",
" onSuccess: async () => {",
" const formValues = getFormValues();",
"",
" Object.keys(formValues)",
" ?.filter((key) => key.includes(salModel))",
" ?.forEach((key) => {",
" deleteFormAction(key, 'create');",
" deleteFormAction(key, 'delete');",
" });",
"",
" const boModel =",
" 'everest.fin.accounting/BOComposition/SalesArrangementBusinessObjectModel.SalesArrangementBusinessObject';",
" const { id } = getUiModelDataValue([boModel])?.[0] ?? {};",
"",
" if (id != null) {",
" const updateBoResponse = await everestAction({",
" uiModelName: 'everest.fin.accounting/ui/accounting',",
" model: boModel,",
" action: 'update',",
" body: { id, headerKey: state.id },",
" fieldlist: [\"id\"],",
" });",
" console.log('BO Updated:', updateBoResponse);",
" }",
" await refetchUiModelData();",
" setState(\"mode\", \"view\");",
" },",
" transform: (rawValues) => {",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" let formValues = helpers.cloneDeep(rawValues);",
" delete formValues.billingAddressField;",
" for (let key in formValues) {",
" delete formValues[key].update?.childProduct;",
" delete formValues[key].create?.childProduct;",
" delete formValues[key].delete?.childProduct;",
" delete formValues[key].update?._id;",
" delete formValues[key].create?._id;",
" delete formValues[key].delete?._id;",
" delete formValues[key].update?.productCode;",
" delete formValues[key].create?.productCode;",
" delete formValues[key].delete?.productCode;",
" }",
"",
" const { values: createsalesArrangementProducts, matchingKeys: createSaKeys } =",
" getFormValueList(salModel, ['create']) || [];",
"",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: createLcLines, matchingKeys: createLcKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create']) || [];",
" createLcKeys.forEach((key) => {",
" if (createSaKeys.includes(`${key.charAt(0)}:${salModel}`)) {",
" delete formValues[key];",
" }",
" });",
"",
" createSaKeys.forEach((salKey, salIndex) => {",
" const charges = [];",
" createLcKeys.forEach((salesArrangementPriceModelLineKey, salesArrangementPriceModelLineIndex) => {",
" if (salesArrangementPriceModelLineKey.startsWith(salKey.charAt(0))) {",
" const data = createLcLines[salesArrangementPriceModelLineIndex];",
" delete data._id;",
" delete data.childProduct;",
" charges.push(data);",
" }",
" });",
" delete formValues[salKey].create;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementProduct',",
" ],",
" helpers.cloneDeep(rawValues[salKey].create)",
" );",
" delete formValues[salKey].createSalesArrangementProductWithPriceModelLines",
" .salesArrangementProduct._id;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementPriceModelLines',",
" ],",
" charges",
" );",
" });",
"",
" const { matchingKeys: salUpdateKeys } = getFormValueList(salModel, [\"update\"]) ?? [];",
" salUpdateKeys.forEach(key => {",
" delete formValues?.[key]?.update?.startDate;",
" delete formValues?.[key]?.update?.endDate;",
" });",
"",
" return formValues;",
" },",
" });",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.approve}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 2, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.reject}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" const runResponse=await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 1, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
}
]
}
}
},
{
"component": "Block",
"collapsible": true,
"size": "11",
"title": "{{salesArrangement.details.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"onCollapseClick": "(collapsed) => {setState('detailsCollapsed', !collapsed)}",
"collapsed": "!!state.detailsCollapsed"
},
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"uiModelBinding": {
"id": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
]
}
}
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
],
"list": [
"everest.fin.accounting/BusinessPartnerModel.BusinessPartner"
],
"text": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerNumber"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"functions": {
"value": "const [address] = uiModelData?.['BillingAddress:everest.base/AddressModel.Address']?.result || [];if (address) {return `${address.line1}\n${address.line2}\n${address.city}, ${address.stateProvince} ${address.zipCode}\n${address.country}`;}return '';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"mainContactEmail"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"billingEmail"
]
}
}
]
},
{
"component": "SummaryText",
"size": "1",
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"component": "Block",
"collapsible": true,
"size": "12",
"title": "{{salesArrangement.orderDetails.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.orderDetailsCollapsed",
"onCollapseClick": "collapsed => setState('orderDetailsCollapsed', !collapsed)"
},
"disabledAction": {
"label": "{{salesArrangement.reviseDetails}}",
"functions": {
"onClick": "()=>setTemplateActiveSegment(1)"
}
},
"elements": [
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityName}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityName"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityId}}",
"link": {
"to": "https://www.google.com/",
"target": "_blank",
"rel": "noreferrer",
"isExternal": true
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityIdText"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.purchaseOrder}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"purchaseOrder"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesRep}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesRep"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.signDate}}",
"parseAs": "date",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"signDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.bookingDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"bookDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.effectiveDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesEffectiveDate"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesGroup}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesGroup"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.currency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.functionalCurrency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.notes}}",
"size": "2",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"memo"
]
}
}
]
},
{
"component": "Template",
"functions": {
"link": "'/templates/everest.fin.accounting/ui/revenueWaterfall?id=' + state.id"
}
}
]
}
]
}
]
}
}
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

This file has been truncated, but you can view the full file.
{
"version": 2,
"uicontroller": "salesArrangementNext.uicontroller.js",
"uimodel": {
"state": {
"mode": "view"
},
"nodes": {
"businessPartners": {
"type": "list",
"modelId": "everest.fin.accounting/BusinessPartnerModel.BusinessPartner",
"query": {}
},
"salesArrangement": {
"type": "struct",
"modelId": "everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"query": {
"where": {
"id": "@state:param.id"
}
}
},
"shippingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "shippingAddressId-id"
},
"billingAddress": {
"type": "struct",
"modelId": "everest.base/AddressModel.Address",
"parent": "salesArrangement",
"joinKey": "billingAddressId-id"
},
"salesArrangementProducts": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementId"
},
"salesArrangementPriceModels": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelModel.SalesArrangementPriceModel",
"parent": "salesArrangement",
"joinKey": "id-salesArrangementProductId"
},
"salesArrangementPriceModelLines": {
"type": "list",
"modelId": "everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine",
"parent": "salesArrangementPriceModel",
"joinKey": "id-salesArrangementPriceModelId"
},
"billingPlan": {
"type": "struct",
"modelId": "everest.fin.accounting/BillingPlanModel.BillingPlan",
"parent": "priceModelLines",
"joinKey": "id-salesArrangementPriceModelLineId"
},
"billingPlanLines": {
"type": "list",
"modelId": "everest.fin.accounting/BillingPlanLineModel.BillingPlanLine",
"parent": "billingPlan",
"joinKey": "billingPlanId-id"
},
"invoiceLines": {
"type": "list",
"modelId": "everest.fin.accounting/InvoiceLineModel.InvoiceLine",
"parent": "billingPlanLines",
"joinKey": "billingPlanLineId-id"
},
"products": {
"type": "list",
"modelId": "everest.fin.accounting/ProductModel.Product",
"parent": "salesArrangementProducts",
"joinKey": "productId-id"
}
}
},
"uiview": {
"title": "{{salesArrangement.title}}",
"templateType": "details",
"grid": {
"limited": false,
"sidebarSize": "360px"
},
"i18n": "everest.fin.accounting/ui/i18n/accounting",
"sections": [
{
"component": "StatusHeader",
"title": "{{salesArrangement.title}}",
"size": "11",
"uiModelBinding": {
"status": "SalesArrangement.salesArrangementStatus",
"subtitle": "SalesArrangement.salesArrangementNumber"
}
},
{
"component": "Icons",
"refreshData": true,
"draftEnabled": "@controller:isDraftEnabled()",
"size": "1"
},
{
"component": "Segments",
"size": "12",
"controlSize": "11",
"grid": {
"sidebarSize": "324px",
"margin": {
"left": "0",
"right": "0",
"top": "0",
"bottom": "48px"
}
},
"segments": [
{
"title": "{{salesArrangement.overview.title}}",
"subtitleConfig": {
"parseAs": "templateString",
"format": "{{salesArrangement.overview.subtitle}} - ${subtitle}",
"secondParsing": "shortCurrency"
},
"uiModelBinding": {
"subtitle": "SalesArrangement.totalAmount"
},
"functions": {
"isDisabled": "state.mode === 'create'"
},
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"label": "{{salesArrangement.callToAction.actions.activate}}",
"functions": {
"disabled": "state.mode === 'edit' || isFetchingUiModelData",
"onClick": "@controller:displayNotImplementedWarning()"
}
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"actions": [
{
"functions": {
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "@controller:getSalesArrangementActionLabel()",
"onClick": "@controller:submitSalesArrangement()"
}
},
{
"label": "{{salesArrangement.approve}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(2)"
},
{
"label": "{{salesArrangement.reject}}",
"visible": "@controller:isApprovalVisible()",
"onClick": "@controller:updateSalesArrangementStatus(1)"
}
]
}
}
},
{
"component": "Block",
"size": "11",
"title": "{{salesArrangement.details.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"onCollapseClick": "(collapsed) => {setState('detailsCollapsed', !collapsed)}",
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.detailsCollapsed"
},
"collapsible": true,
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"uiModelBinding": {
"id": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
]
}
}
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
],
"list": [
"everest.fin.accounting/BusinessPartnerModel.BusinessPartner"
],
"text": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerNumber"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"functions": {
"value": "const [address] = uiModelData?.['BillingAddress:everest.base/AddressModel.Address']?.result || [];if (address) {return `${address.line1}\n${address.line2}\n${address.city}, ${address.stateProvince} ${address.zipCode}\n${address.country}`;}return '';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"mainContactEmail"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"billingEmail"
]
}
}
]
},
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"component": "Block",
"collapsible": true,
"size": "12",
"title": "{{salesArrangement.orderDetails.title}}",
"functions": {
"isDisabled": "state.mode === 'edit'",
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.orderDetailsCollapsed",
"onCollapseClick": "collapsed => setState('orderDetailsCollapsed', !collapsed)"
},
"disabledAction": {
"label": "{{salesArrangement.reviseDetails}}",
"functions": {
"onClick": "()=>setTemplateActiveSegment(1)"
}
},
"elements": [
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityName}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityName"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityId}}",
"link": {
"to": "https://www.google.com/",
"target": "_blank",
"rel": "noreferrer",
"isExternal": true
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityIdText"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.purchaseOrder}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"purchaseOrder"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesRep}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesRep"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.signDate}}",
"parseAs": "date",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"signDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.bookingDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"bookDate"
]
}
},
{
"component": "DatePicker",
"label": "{{salesArrangement.orderDetails.effectiveDate}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesEffectiveDate"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesGroup}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesGroup"
]
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.currency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"currency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.functionalCurrency}}",
"uiModelBinding": {
"value": {
"rawValue": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"functionalCurrency"
],
"origin": "everest.appserver/ValueHelpModel.ValueHelp",
"dataType": "Currency"
}
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.notes}}",
"size": "2",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"memo"
]
}
}
]
},
{
"component": "Template",
"size": "11",
"functions": {
"link": "'/templates/everest.fin.accounting/ui/balanceRollforward?id=' + state.id"
}
},
{
"component": "SectionGroup",
"size": "1",
"sections": [
{
"component": "SummaryText",
"size": "1",
"functions": {
"isVisible": "!!state.detailsCollapsed"
},
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"title": "{{salesArrangement.activity.title}}",
"component": "WidgetGroup",
"functions": {
"isDisabled": "state.mode === 'edit'"
},
"widgets": [
{
"label": "{{salesArrangement.activity.log}}",
"component": "Messaging",
"dateFormat": "P",
"uiModelBinding": {
"list": [
"TODO"
]
}
},
{
"component": "Messaging",
"label": "{{salesArrangement.activity.notes}}",
"uiModelBinding": {
"list": [
"TODO"
]
},
"dateFormat": "P"
}
]
}
]
}
]
},
{
"title": "{{salesArrangement.orderedProducts.title}}",
"functions": {
"subtitle": "state.mode === 'create' ? '{{salesArrangement.orderedProducts.notSaved}}' : '{{salesArrangement.orderedProducts.saved}}'"
},
"sections": [
{
"component": "CallToAction",
"size": "1",
"actions": {
"permissionsRequired": [
{
"resource": "everest.fin.accounting/SalesArrangementModel",
"action": "update"
}
],
"primary": {
"functions": {
"label": "state.mode==='create'?'{{salesArrangement.callToAction.actions.save}}':'{{salesArrangement.callToAction.actions.activate}}'",
"disabled": "formState?.isSubmitting || state.mode==='edit' || isFetchingUiModelData || (state.mode === 'create' && formState?.hasError)",
"onClick": [
"() => {",
" if (state.mode === 'create') {",
" const removeEmpty = (rawLine, index, idProp, model) => {",
" if (index === 0 || getFormAction(model) !== 'create') return;",
" const { [idProp]: id, ...line } = rawLine || {};",
" const isEmpty =",
" helpers.isEmpty(line) ||",
" Object.values(line).every(",
" (v) => v == null || (typeof v === 'object' && helpers.isEmpty(v))",
" );",
" if (isEmpty) deleteFormModel(model, true, false);",
" };",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const { values: salesArrangementProducts, matchingKeys: saKeys } =",
" getFormValueList(salModel, ['create', 'update', 'delete']) || [];",
" salesArrangementProducts?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementId', saKeys[index]),",
" []",
" );",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: salesArrangementPriceModelLineLines, matchingKeys: salesArrangementPriceModelLineKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create', 'update', 'delete']) || [];",
" salesArrangementPriceModelLineLines?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementProductId', salesArrangementPriceModelLineKeys[index]),",
" []",
" );",
" defaultSubmit({",
" onSuccess: async () => {",
" navigate({",
" to: '/templates/everest.fin.accounting/ui/salesArrangements',",
" closeCurrentTab: true,",
" });",
" },",
" transform: (rawValues) => {",
" const saModel =",
" 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" let formValues = {",
" [saModel]: {",
" createSalesArrangementWithLines: {",
" salesArrangement: {",
" ...helpers.cloneDeep(",
" rawValues[saModel].createSalesArrangementWithLines",
" ),",
" },",
" salesArrangementProducts: [],",
" salesArrangementPriceModelLines: [],",
" },",
" },",
" };",
" delete formValues.billingAddressField;",
" const formKeys = Object.keys(rawValues);",
" formKeys.forEach((key) => {",
" if (key.includes('SalesArrangementProduct')) {",
" const charges = [];",
" const currentSAL = helpers.cloneDeep(rawValues[key].create);",
" delete currentSAL._id;",
" delete currentSAL.productCode",
" formKeys.forEach((entry) => {",
" if (",
" entry.includes('SalesArrangementPriceModelLine') &&",
" entry.startsWith(key.charAt(0))",
" ) {",
" const salesArrangementPriceModelLine = helpers.cloneDeep(rawValues[entry].create);",
" delete salesArrangementPriceModelLine._id;",
" delete salesArrangementPriceModelLine.childProduct;",
" charges.push(salesArrangementPriceModelLine);",
" }",
" });",
" formValues[",
" saModel",
" ].createSalesArrangementWithLines.salesArrangementProducts.push(",
" currentSAL",
" );",
" formValues[",
" saModel",
" ].createSalesArrangementWithLines.salesArrangementPriceModelLines.push(charges);",
" }",
" });",
"",
" Object.entries(formValues).forEach(([key, value]) => {",
" if(!!value?.update) {",
" formValues[key] = {...value, fieldlist: [\"id\"]}",
" }",
" });",
"",
" return formValues;",
" },",
" });",
" } else {",
" showToast({",
" type: 'warning',",
" title: '{{notImplementedR2.title}}',",
" message: '{{notImplementedR2.message}}',",
" });",
" }",
"}"
]
}
},
"more": {
"label": "{{salesArrangement.moreActions}}",
"functions": {
"disabled": "state.mode === \"create\""
},
"actions": [
{
"functions": {
"disabled": "isFetchingUiModelData || state.mode === 'create' || formState?.hasError || formState?.isSubmitting",
"label": "(state.mode ==='edit')?'{{salesArrangement.callToAction.actions.saveRevisions}}':'{{salesArrangement.callToAction.actions.revise}}'",
"onClick": [
"() => {",
" if (state.mode !== 'edit') {",
" setState('mode', 'edit');",
" setTemplateActiveSegment(1);",
" } else {",
" const removeEmpty = (rawLine, index, idProp, model) => {",
" if (index === 0 || getFormAction(model) !== 'create') return;",
" const { [idProp]: id, ...line } = rawLine || {};",
" const isEmpty =",
" helpers.isEmpty(line) ||",
" Object.values(line).every(",
" (v) => v == null || (typeof v === 'object' && helpers.isEmpty(v))",
" );",
" if (isEmpty) deleteFormModel(model, true, false);",
" };",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" const { values: salesArrangementProducts, matchingKeys: saKeys } =",
" getFormValueList(salModel, ['create', 'update', 'delete']) || [];",
" salesArrangementProducts?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementId', saKeys[index]),",
" []",
" );",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: salesArrangementPriceModelLineLines, matchingKeys: salesArrangementPriceModelLineKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create', 'update', 'delete']) || [];",
" salesArrangementPriceModelLineLines?.reduceRight(",
" (_, rawLine, index) =>",
" removeEmpty(rawLine, index, 'salesArrangementProductId', salesArrangementPriceModelLineKeys[index]),",
" []",
" );",
" defaultSubmit({",
" skipRefetchOnSuccess: true,",
" onSuccess: async () => {",
" const formValues = getFormValues();",
"",
" Object.keys(formValues)",
" ?.filter((key) => key.includes(salModel))",
" ?.forEach((key) => {",
" deleteFormAction(key, 'create');",
" deleteFormAction(key, 'delete');",
" });",
"",
" const boModel =",
" 'everest.fin.accounting/BOComposition/SalesArrangementBusinessObjectModel.SalesArrangementBusinessObject';",
" const { id } = getUiModelDataValue([boModel])?.[0] ?? {};",
"",
" if (id != null) {",
" const updateBoResponse = await everestAction({",
" uiModelName: 'everest.fin.accounting/ui/accounting',",
" model: boModel,",
" action: 'update',",
" body: { id, headerKey: state.id },",
" fieldlist: [\"id\"],",
" });",
" console.log('BO Updated:', updateBoResponse);",
" }",
" await refetchUiModelData();",
" setState(\"mode\", \"view\");",
" },",
" transform: (rawValues) => {",
" const salModel =",
" 'everest.fin.accounting/SalesArrangementProductModel.SalesArrangementProduct';",
" let formValues = helpers.cloneDeep(rawValues);",
" delete formValues.billingAddressField;",
" for (let key in formValues) {",
" delete formValues[key].update?.childProduct;",
" delete formValues[key].create?.childProduct;",
" delete formValues[key].delete?.childProduct;",
" delete formValues[key].update?._id;",
" delete formValues[key].create?._id;",
" delete formValues[key].delete?._id;",
" delete formValues[key].update?.productCode;",
" delete formValues[key].create?.productCode;",
" delete formValues[key].delete?.productCode;",
" }",
"",
" const { values: createsalesArrangementProducts, matchingKeys: createSaKeys } =",
" getFormValueList(salModel, ['create']) || [];",
"",
" const salesArrangementPriceModelLineModel = 'everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine';",
" const { values: createLcLines, matchingKeys: createLcKeys } =",
" getFormValueList(salesArrangementPriceModelLineModel, ['create']) || [];",
" createLcKeys.forEach((key) => {",
" if (createSaKeys.includes(`${key.charAt(0)}:${salModel}`)) {",
" delete formValues[key];",
" }",
" });",
"",
" createSaKeys.forEach((salKey, salIndex) => {",
" const charges = [];",
" createLcKeys.forEach((salesArrangementPriceModelLineKey, salesArrangementPriceModelLineIndex) => {",
" if (salesArrangementPriceModelLineKey.startsWith(salKey.charAt(0))) {",
" const data = createLcLines[salesArrangementPriceModelLineIndex];",
" delete data._id;",
" delete data.childProduct;",
" charges.push(data);",
" }",
" });",
" delete formValues[salKey].create;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementProduct',",
" ],",
" helpers.cloneDeep(rawValues[salKey].create)",
" );",
" delete formValues[salKey].createSalesArrangementProductWithPriceModelLines",
" .salesArrangementProduct._id;",
" helpers.set(",
" formValues,",
" [",
" salKey,",
" 'createSalesArrangementProductWithPriceModelLines',",
" 'salesArrangementPriceModelLines',",
" ],",
" charges",
" );",
" });",
"",
" const { matchingKeys: salUpdateKeys } = getFormValueList(salModel, [\"update\"]) ?? [];",
" salUpdateKeys.forEach(key => {",
" delete formValues?.[key]?.update?.startDate;",
" delete formValues?.[key]?.update?.endDate;",
" });",
"",
" Object.entries(formValues).forEach(([key, value]) => {",
" if(!!value?.update) {",
" formValues[key] = {...value, fieldlist: [\"id\"]}",
" }",
" });",
"",
" return formValues;",
" },",
" });",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.approve}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 2, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
},
{
"label": "{{salesArrangement.reject}}",
"functions": {
"visible": [
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" return data.salesArrangementStatus === 1 && data.approverUserId === currentUserData.userId && !isFetchingUiModelData",
" }",
" return false;"
],
"onClick": [
"async () => {",
" const model= 'everest.fin.accounting/SalesArrangementModel.SalesArrangement';",
" const data = getUiModelDataValue([model]);",
" if(data){",
" const runResponse=await everestAction(",
" { uiModelName:'everest.fin.accounting/ui/salesArrangement',",
" model:'everest.fin.accounting/SalesArrangementModel.SalesArrangement',",
" action:'setSalesArrangementStatus',",
" body: {newStatus: 1, salesArrangementID: data.id}",
" }",
" );",
" refetchUiModelData()",
" }",
"}"
]
}
}
]
}
}
},
{
"component": "Block",
"functions": {
"onCollapseClick": "(collapsed) => {setState('detailsCollapsed', !collapsed)}",
"collapsed": "!!state.detailsCollapsed"
},
"collapsible": true,
"size": "11",
"title": "{{salesArrangement.details.title}}",
"elements": [
{
"component": "Select",
"label": "{{salesArrangement.details.customerName}}",
"idProp": "id",
"textProp": "businessPartnerName",
"prefixProp": "businessPartnerNumber",
"isDisabled": false,
"link": {
"to": "/templates/everest.fin.accounting/ui/businessPartner",
"qs": {
"uiModelBinding": {
"id": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
]
}
}
},
"customAction": {
"label": "{{salesArrangement.details.createNew}}",
"type": "dark-grey",
"functions": {
"isVisible": "state.mode==='edit' || state.mode==='create'",
"onClick": "()=>openModal({title:'{{salesArrangement.details.createCustomer}}',template:'/templates/everest.fin.accounting/ui/businessPartnerCreate',onModalSubmit:(createdBusinessPartner)=>{if(createdBusinessPartner==null)return;refetchUiModelData(); const action=state.mode==='create'?'createSalesArrangementWithLines':'update';setFormValue(['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'],action,createdBusinessPartner)}})"
}
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerId"
],
"list": [
"everest.fin.accounting/BusinessPartnerModel.BusinessPartner"
],
"text": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"onChange": "(value)=>{const action=state.mode==='create' ? 'createSalesArrangementWithLines':'update';setFormValue(['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'],action,value)}"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.customerId}}",
"isDisabled": true,
"uiModelBinding": {
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
],
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"businessPartnerNumber"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find(b=>b.id==partnerId);return partner?.businessPartnerNumber||'';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingAddress}}",
"multiline": true,
"isDisabled": true,
"uiModelBinding": {},
"name": "billingAddressField",
"functions": {
"isEditing": "state.mode === 'create' || state.mode === 'edit'",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId'];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find((b)=>b.id==partnerId);const address=getUiModelDataValue(['everest.base/AddressModel.Address',])?.find((address)=>address.id==partner?.defaultBillingAddressId);const addressLines=[address?.line1,address?.line2,`${address?.city}, ${address?.stateProvince} ${address?.zipCode}`,address?.country,].filter(Boolean).join(`\n`);return address?addressLines:'';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.mainContactEmail}}",
"isDisabled": true,
"uiModelBinding": {
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
],
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"mainContactEmail"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update'",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId',];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find((b)=>b.id==partnerId);return partner?.mainContactEmail??'';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.details.billingEmail}}",
"isDisabled": true,
"uiModelBinding": {
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
],
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"billingEmail"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';",
"value": "const action=state.mode==='create'?'createSalesArrangementWithLines':'update';const path=['everest.fin.accounting/SalesArrangementModel.SalesArrangement','businessPartnerId',];const partnerId=state.mode==='view'?getUiModelDataValue(path):getFormValue(path,action)??getUiModelDataValue(path);const partner=getUiModelDataValue(['everest.fin.accounting/BusinessPartnerModel.BusinessPartner',])?.find((b)=>b.id==partnerId);return partner?.billingEmail??'';"
}
}
]
},
{
"component": "SummaryText",
"size": "1",
"summary": {
"label": "{{salesArrangement.summary.total}}",
"parseAs": "currency",
"functions": {
"value": [
"if (state.mode !== \"edit\" && state.mode !== \"create\") {",
" return getUiModelDataValue([",
" \"everest.fin.accounting/SalesArrangementModel.SalesArrangement\", \"totalAmount\",",
" ]);",
"}",
"",
"const model = \"everest.fin.accounting/SalesArrangementPriceModelLineModel.SalesArrangementPriceModelLine\";",
"const salesArrangementPriceModelLines = getFormValueList(model, [\"update\", \"create\"])?.values || [];",
"",
"const total = salesArrangementPriceModelLines.reduce((acc, line) => {",
" const amount = new Decimal(line.amount);",
" if (amount.isNaN()) return acc;",
" return amount.plus(acc);",
"}, new Decimal(0));",
"",
"return total.toFixed();"
]
}
},
"fields": [
{
"label": "{{salesArrangement.summary.bookings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"totalAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.billings}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"invoicedAmount"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.revenue}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"revenueRecognizedTotal"
]
},
"parseAs": "currency"
},
{
"label": "{{salesArrangement.summary.remainingPerformanceObligation}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"remainingPerformanceObligation"
]
},
"parseAs": "currency"
}
]
},
{
"component": "Block",
"collapsible": true,
"size": "12",
"title": "{{salesArrangement.orderDetails.title}}",
"functions": {
"isVisible": "!state.detailsCollapsed",
"collapsed": "!!state.orderDetailsCollapsed",
"onCollapseClick": "collapsed => setState('orderDetailsCollapsed', !collapsed)"
},
"elements": [
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityName}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityName"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.opportunityId}}",
"link": {
"to": "https://www.google.com/",
"target": "_blank",
"rel": "noreferrer",
"isExternal": true
},
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"opportunityIdText"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.purchaseOrder}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"purchaseOrder"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'createSalesArrangementWithLines'; return 'update';"
}
},
{
"component": "Input",
"label": "{{salesArrangement.orderDetails.salesRep}}",
"uiModelBinding": {
"value": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"salesRep"
],
"modelId": [
"everest.fin.accounting/SalesArrangementModel.SalesArrangement",
"id"
]
},
"functions": {
"isEditing": "state.mode === 'edit' || state.mode === 'create'",
"action": "if (state.mode === 'create') return 'creat
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment