From 17718906454fe72a33b2058f4c7fa30a5330ed13 Mon Sep 17 00:00:00 2001 From: Pascal Neub <p.neub@adito.de> Date: Mon, 15 Nov 2021 10:42:33 +0100 Subject: [PATCH] =?UTF-8?q?[Projekt:=20xRM-Sales][TicketNr.:=202001368][Ve?= =?UTF-8?q?rkn=C3=BCpfung=20von=20Produkten=20und=20Angeboten]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entity/Offer_entity/Offer_entity.aod | 32 ++++ .../containername_param/valueProcess.js | 4 + .../recordcontainers/db/conditionProcess.js | 2 +- .../product_filter/filterConditionProcess.js | 7 + .../filterConditionProcess.js | 8 + entity/Offeritem_entity/Offeritem_entity.aod | 156 +++++++++++++++- .../entityfields/discount/onValidation.js | 7 +- .../entityfields/offer_image/valueProcess.js | 4 + .../offer_net/displayValueProcess.js | 10 ++ .../entityfields/price/displayValueProcess.js | 24 +-- .../entityfields/price/minValueProcess.js | 24 +-- .../entityfields/price/onValidation.js | 27 --- .../product_id/displayValueProcess.js | 10 -- .../entityfields/quantity/onValidation.js | 11 -- .../totalprice/displayValueProcess.js | 24 +-- .../recordcontainers/db/conditionProcess.js | 4 +- .../recordcontainers/db/fromClauseProcess.js | 12 ++ .../offer_code.displayvalue/expression.js | 10 ++ .../expression.js | 4 + .../offer_status.displayvalue/expression.js | 6 + .../product_id.displayvalue/expression.js | 6 - entity/Order_entity/Order_entity.aod | 32 ++++ .../containername_param/valueProcess.js | 4 + .../product_filter/filterConditionProcess.js | 7 + .../filterConditionProcess.js | 8 + entity/Orderitem_entity/Orderitem_entity.aod | 166 +++++++++++++++++- .../entityfields/discount/onValidation.js | 11 ++ .../entityfields/order_image/valueProcess.js | 4 + .../order_net/displayValueProcess.js | 10 ++ .../entityfields/price/displayValueProcess.js | 23 +-- .../entityfields/price/minValueProcess.js | 24 +-- .../entityfields/price/onValidation.js | 27 --- .../product_id/displayValueProcess.js | 10 -- .../totalprice/displayValueProcess.js | 22 +-- .../recordcontainers/db/conditionProcess.js | 4 +- .../recordcontainers/db/fromClauseProcess.js | 12 ++ .../expression.js | 4 + .../order_type.displayvalue/expression.js | 6 + .../product_id.displayvalue/expression.js | 6 - entity/Product_entity/Product_entity.aod | 28 +++ .../children/productid_param/valueProcess.js | 4 + .../children/productid_param/valueProcess.js | 4 + .../_____LANGUAGE_de/_____LANGUAGE_de.aod | 10 +- neonContext/Offeritem/Offeritem.aod | 4 + neonContext/Order/Order.aod | 4 + neonContext/Orderitem/Orderitem.aod | 4 + neonContext/Product/Product.aod | 4 + .../OfferitemProduct_view.aod | 67 +++++++ .../OrderDrawer_view/OrderDrawer_view.aod | 19 ++ .../OrderitemProduct_view.aod | 71 ++++++++ .../ProductMain_view/ProductMain_view.aod | 5 + .../ProductOfferOrder_view.aod | 23 +++ process/Sql_lib/process.js | 1 + 53 files changed, 787 insertions(+), 233 deletions(-) create mode 100644 entity/Offer_entity/entityfields/keywordproductgroup/children/containername_param/valueProcess.js create mode 100644 entity/Offer_entity/recordcontainers/db/filterextensions/product_filter/filterConditionProcess.js create mode 100644 entity/Offer_entity/recordcontainers/db/filterextensions/productgroup_filter/filterConditionProcess.js create mode 100644 entity/Offeritem_entity/entityfields/offer_image/valueProcess.js create mode 100644 entity/Offeritem_entity/entityfields/offer_net/displayValueProcess.js delete mode 100644 entity/Offeritem_entity/entityfields/price/onValidation.js delete mode 100644 entity/Offeritem_entity/entityfields/product_id/displayValueProcess.js delete mode 100644 entity/Offeritem_entity/entityfields/quantity/onValidation.js create mode 100644 entity/Offeritem_entity/recordcontainers/db/fromClauseProcess.js create mode 100644 entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/offer_code.displayvalue/expression.js create mode 100644 entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/offer_person_id.displayvalue/expression.js create mode 100644 entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/offer_status.displayvalue/expression.js delete mode 100644 entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/product_id.displayvalue/expression.js create mode 100644 entity/Order_entity/entityfields/keywordproductgroup/children/containername_param/valueProcess.js create mode 100644 entity/Order_entity/recordcontainers/db/filterextensions/product_filter/filterConditionProcess.js create mode 100644 entity/Order_entity/recordcontainers/db/filterextensions/productgroup_filter/filterConditionProcess.js create mode 100644 entity/Orderitem_entity/entityfields/discount/onValidation.js create mode 100644 entity/Orderitem_entity/entityfields/order_image/valueProcess.js create mode 100644 entity/Orderitem_entity/entityfields/order_net/displayValueProcess.js delete mode 100644 entity/Orderitem_entity/entityfields/price/onValidation.js delete mode 100644 entity/Orderitem_entity/entityfields/product_id/displayValueProcess.js create mode 100644 entity/Orderitem_entity/recordcontainers/db/fromClauseProcess.js create mode 100644 entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/order_person_id.displayvalue/expression.js create mode 100644 entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/order_type.displayvalue/expression.js delete mode 100644 entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/product_id.displayvalue/expression.js create mode 100644 entity/Product_entity/entityfields/offeritems/children/productid_param/valueProcess.js create mode 100644 entity/Product_entity/entityfields/orderitems/children/productid_param/valueProcess.js create mode 100644 neonView/OfferitemProduct_view/OfferitemProduct_view.aod create mode 100644 neonView/OrderDrawer_view/OrderDrawer_view.aod create mode 100644 neonView/OrderitemProduct_view/OrderitemProduct_view.aod create mode 100644 neonView/ProductOfferOrder_view/ProductOfferOrder_view.aod diff --git a/entity/Offer_entity/Offer_entity.aod b/entity/Offer_entity/Offer_entity.aod index 6d1230ed16..0d46bf7b97 100644 --- a/entity/Offer_entity/Offer_entity.aod +++ b/entity/Offer_entity/Offer_entity.aod @@ -1188,6 +1188,20 @@ <onActionProcess>%aditoprj%/entity/Offer_entity/entityfields/newsupportticket/onActionProcess.js</onActionProcess> <iconId>VAADIN:TICKET</iconId> </entityActionField> + <entityConsumer> + <name>KeywordProductGroup</name> + <dependency> + <name>dependency</name> + <entityName>KeywordEntry_entity</entityName> + <fieldName>SpecificContainerKeywords</fieldName> + </dependency> + <children> + <entityParameter> + <name>ContainerName_param</name> + <valueProcess>%aditoprj%/entity/Offer_entity/entityfields/keywordproductgroup/children/containername_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> @@ -1477,6 +1491,24 @@ <filterConditionProcess>%aditoprj%/entity/Offer_entity/recordcontainers/db/filterextensions/favorite_filter/filterConditionProcess.js</filterConditionProcess> <filtertype>BASIC</filtertype> </filterExtension> + <filterExtension> + <name>Product_filter</name> + <title>Product</title> + <contentType>TEXT</contentType> + <useConsumer v="true" /> + <consumer>Products</consumer> + <filterConditionProcess>%aditoprj%/entity/Offer_entity/recordcontainers/db/filterextensions/product_filter/filterConditionProcess.js</filterConditionProcess> + <filtertype>BASIC</filtertype> + </filterExtension> + <filterExtension> + <name>ProductGroup_filter</name> + <title>Product Group</title> + <contentType>TEXT</contentType> + <useConsumer v="true" /> + <consumer>KeywordProductGroup</consumer> + <filterConditionProcess>%aditoprj%/entity/Offer_entity/recordcontainers/db/filterextensions/productgroup_filter/filterConditionProcess.js</filterConditionProcess> + <filtertype>BASIC</filtertype> + </filterExtension> </filterExtensions> </dbRecordContainer> <indexRecordContainer> diff --git a/entity/Offer_entity/entityfields/keywordproductgroup/children/containername_param/valueProcess.js b/entity/Offer_entity/entityfields/keywordproductgroup/children/containername_param/valueProcess.js new file mode 100644 index 0000000000..348d170e28 --- /dev/null +++ b/entity/Offer_entity/entityfields/keywordproductgroup/children/containername_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("KeywordRegistry_basic"); + +result.string($KeywordRegistry.productGroupcode()); diff --git a/entity/Offer_entity/recordcontainers/db/conditionProcess.js b/entity/Offer_entity/recordcontainers/db/conditionProcess.js index 687c5f8bf9..19f424e179 100644 --- a/entity/Offer_entity/recordcontainers/db/conditionProcess.js +++ b/entity/Offer_entity/recordcontainers/db/conditionProcess.js @@ -25,4 +25,4 @@ else if(approval == 2) cond.andIfSet("OFFER.STATUS", "$param.OfferStatus_param") -result.string(cond.toString()); \ No newline at end of file +result.string(cond.toString()); diff --git a/entity/Offer_entity/recordcontainers/db/filterextensions/product_filter/filterConditionProcess.js b/entity/Offer_entity/recordcontainers/db/filterextensions/product_filter/filterConditionProcess.js new file mode 100644 index 0000000000..312b90d057 --- /dev/null +++ b/entity/Offer_entity/recordcontainers/db/filterextensions/product_filter/filterConditionProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("Sql_lib"); + +var sql = newSelect("OFFERITEM.OFFERITEMID").from("OFFERITEM") + .where("OFFER.OFFERID = OFFERITEM.OFFER_ID") + .and("OFFERITEM.PRODUCT_ID", "$local.rawvalue", SqlUtils.getSqlConditionalOperator()); +result.string("exists (" + sql.toString() + ")"); diff --git a/entity/Offer_entity/recordcontainers/db/filterextensions/productgroup_filter/filterConditionProcess.js b/entity/Offer_entity/recordcontainers/db/filterextensions/productgroup_filter/filterConditionProcess.js new file mode 100644 index 0000000000..083921950f --- /dev/null +++ b/entity/Offer_entity/recordcontainers/db/filterextensions/productgroup_filter/filterConditionProcess.js @@ -0,0 +1,8 @@ +import("system.result"); +import("Sql_lib"); + +var sql = newSelect("OFFERITEM.OFFERITEMID").from("OFFERITEM") + .join("PRODUCT", "PRODUCT.PRODUCTID = OFFERITEM.PRODUCT_ID") + .where("OFFER.OFFERID = OFFERITEM.OFFER_ID") + .and("PRODUCT.GROUPCODEID", "$local.rawvalue", SqlUtils.getSqlConditionalOperator()); +result.string("exists (" + sql.toString() + ")"); diff --git a/entity/Offeritem_entity/Offeritem_entity.aod b/entity/Offeritem_entity/Offeritem_entity.aod index 5596dfc0c5..11fa680716 100644 --- a/entity/Offeritem_entity/Offeritem_entity.aod +++ b/entity/Offeritem_entity/Offeritem_entity.aod @@ -23,8 +23,6 @@ <name>DISCOUNT</name> <title>Discount</title> <contentType>NUMBER</contentType> - <maxValue v="100" /> - <minValue v="0" /> <outputFormat>0.00'%'</outputFormat> <inputFormat>0.00</inputFormat> <onValidation>%aditoprj%/entity/Offeritem_entity/entityfields/discount/onValidation.js</onValidation> @@ -76,7 +74,6 @@ <inputFormat>#,##0.00</inputFormat> <mandatory v="true" /> <displayValueProcess>%aditoprj%/entity/Offeritem_entity/entityfields/price/displayValueProcess.js</displayValueProcess> - <onValidation>%aditoprj%/entity/Offeritem_entity/entityfields/price/onValidation.js</onValidation> </entityField> <entityField> <name>PRODUCT_ID</name> @@ -87,7 +84,6 @@ <mandatory v="true" /> <stateProcess>%aditoprj%/entity/Offeritem_entity/entityfields/product_id/stateProcess.js</stateProcess> <valueProcess>%aditoprj%/entity/Offeritem_entity/entityfields/product_id/valueProcess.js</valueProcess> - <displayValueProcess>%aditoprj%/entity/Offeritem_entity/entityfields/product_id/displayValueProcess.js</displayValueProcess> <onValueChange>%aditoprj%/entity/Offeritem_entity/entityfields/product_id/onValueChange.js</onValueChange> <onValueChangeTypes> <element>MASK</element> @@ -108,7 +104,6 @@ <onValueChangeTypes> <element>MASK</element> </onValueChangeTypes> - <onValidation>%aditoprj%/entity/Offeritem_entity/entityfields/quantity/onValidation.js</onValidation> </entityField> <entityField> <name>UNIT</name> @@ -301,6 +296,65 @@ <state>READONLY</state> <valueProcess>%aditoprj%/entity/Offeritem_entity/entityfields/currency/valueProcess.js</valueProcess> </entityField> + <entityField> + <name>OFFER_CODE</name> + <title>Offer number</title> + <linkedContext>Offer</linkedContext> + <state>READONLY</state> + </entityField> + <entityField> + <name>OFFER_PERSON_ID</name> + <title>Person</title> + <linkedContext>Person</linkedContext> + <state>READONLY</state> + </entityField> + <entityField> + <name>OFFER_ORGANISATION_ID</name> + <title>Company</title> + <linkedContext>Organisation</linkedContext> + <state>READONLY</state> + </entityField> + <entityField> + <name>OFFER_STATUS</name> + <title>Status</title> + <state>READONLY</state> + </entityField> + <entityField> + <name>OFFER_IMAGE</name> + <contentType>IMAGE</contentType> + <state>READONLY</state> + <valueProcess>%aditoprj%/entity/Offeritem_entity/entityfields/offer_image/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>OFFER_NET</name> + <title>Total net</title> + <contentType>NUMBER</contentType> + <state>READONLY</state> + <displayValueProcess>%aditoprj%/entity/Offeritem_entity/entityfields/offer_net/displayValueProcess.js</displayValueProcess> + </entityField> + <entityField> + <name>OFFER_CURRENCY</name> + <title>Currency</title> + <state>READONLY</state> + </entityField> + <entityField> + <name>OFFER_DATE</name> + <title>Date</title> + <contentType>DATE</contentType> + <resolution>DAY</resolution> + <outputFormat>dd.MM.yyyy</outputFormat> + <state>READONLY</state> + </entityField> + <entityField> + <name>OFFER_PROBABILITY</name> + <title>Probability</title> + <contentType>NUMBER</contentType> + <outputFormat>0'%'</outputFormat> + <state>READONLY</state> + </entityField> + <entityField> + <name>PRODUCT_GROUPCODEID</name> + </entityField> <entityField> <name>PICTURE</name> <contentType>IMAGE</contentType> @@ -317,6 +371,7 @@ <maximumDbRows v="0" /> <isPageable v="false" /> <hasDependentRecords v="true" /> + <fromClauseProcess>%aditoprj%/entity/Offeritem_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess> <conditionProcess>%aditoprj%/entity/Offeritem_entity/recordcontainers/db/conditionProcess.js</conditionProcess> <orderClauseProcess>%aditoprj%/entity/Offeritem_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess> <onDBInsert>%aditoprj%/entity/Offeritem_entity/recordcontainers/db/onDBInsert.js</onDBInsert> @@ -416,12 +471,64 @@ </dbRecordFieldMapping> <dbRecordFieldMapping> <name>PRODUCT_ID.displayValue</name> - <expression>%aditoprj%/entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/product_id.displayvalue/expression.js</expression> + <recordfield>PRODUCT.PRODUCTNAME</recordfield> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>DISCOUNT.displayValue</name> <expression>%aditoprj%/entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/discount.displayvalue/expression.js</expression> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OFFER_CODE.value</name> + <recordfield>OFFER.OFFERID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OFFER_CODE.displayValue</name> + <expression>%aditoprj%/entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/offer_code.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OFFER_PERSON_ID.value</name> + <recordfield>CONTACT.PERSON_ID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OFFER_ORGANISATION_ID.value</name> + <recordfield>CONTACT.ORGANISATION_ID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OFFER_PERSON_ID.displayValue</name> + <expression>%aditoprj%/entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/offer_person_id.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OFFER_ORGANISATION_ID.displayValue</name> + <recordfield>ORGANISATION.NAME</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OFFER_STATUS.value</name> + <recordfield>OFFER.STATUS</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OFFER_STATUS.displayValue</name> + <expression>%aditoprj%/entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/offer_status.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OFFER_NET.value</name> + <recordfield>OFFER.NET</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OFFER_CURRENCY.value</name> + <recordfield>OFFER.CURRENCY</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OFFER_DATE.value</name> + <recordfield>OFFER.OFFERDATE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OFFER_PROBABILITY.value</name> + <recordfield>OFFER.PROBABILITY</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>PRODUCT_GROUPCODEID.value</name> + <recordfield>PRODUCT.GROUPCODEID</recordfield> + </dbRecordFieldMapping> <dbRecordFieldMapping> <name>PICTURE.value</name> <expression>%aditoprj%/entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/picture.value/expression.js</expression> @@ -433,12 +540,47 @@ </recordFieldMappings> <linkInformation> <linkInformation> - <name>1894a7fa-bc31-43c2-9ba9-d432892efdaa</name> + <name>94b18d52-4cb7-4685-bf9f-44fc50b34812</name> <tableName>OFFERITEM</tableName> <primaryKey>OFFERITEMID</primaryKey> <isUIDTable v="true" /> <readonly v="false" /> </linkInformation> + <linkInformation> + <name>321ad9b2-5d2e-4bb6-8c55-924a00b80178</name> + <tableName>PRODUCT</tableName> + <primaryKey>PRODUCTID</primaryKey> + <isUIDTable v="false" /> + <readonly v="true" /> + </linkInformation> + <linkInformation> + <name>813cea70-5156-4f5c-8b11-ebdaff5f3d76</name> + <tableName>OFFER</tableName> + <primaryKey>OFFERID</primaryKey> + <isUIDTable v="false" /> + <readonly v="true" /> + </linkInformation> + <linkInformation> + <name>d4a5de75-fb96-4836-996c-b28d74158879</name> + <tableName>CONTACT</tableName> + <primaryKey>CONTACTID</primaryKey> + <isUIDTable v="false" /> + <readonly v="true" /> + </linkInformation> + <linkInformation> + <name>691e743c-4996-44b6-9f95-14befae0edb9</name> + <tableName>ORGANISATION</tableName> + <primaryKey>ORGANISATIONID</primaryKey> + <isUIDTable v="false" /> + <readonly v="true" /> + </linkInformation> + <linkInformation> + <name>d2849657-01db-4ddc-804e-7e7df8a98acc</name> + <tableName>PERSON</tableName> + <primaryKey>PERSONID</primaryKey> + <isUIDTable v="false" /> + <readonly v="true" /> + </linkInformation> </linkInformation> </dbRecordContainer> </recordContainers> diff --git a/entity/Offeritem_entity/entityfields/discount/onValidation.js b/entity/Offeritem_entity/entityfields/discount/onValidation.js index 595a5d9aae..0b9a98a1ed 100644 --- a/entity/Offeritem_entity/entityfields/discount/onValidation.js +++ b/entity/Offeritem_entity/entityfields/discount/onValidation.js @@ -1,10 +1,11 @@ import("system.result"); import("system.vars"); import("Util_lib"); -import("Entity_lib"); var value = vars.get("local.value"); var validationResult = NumberUtils.validateIsBetweenFloat("Discount", value, 0, 100); -if (validationResult) - result.string(validationResult); \ No newline at end of file +if(validationResult) +{ + result.string(validationResult); +} diff --git a/entity/Offeritem_entity/entityfields/offer_image/valueProcess.js b/entity/Offeritem_entity/entityfields/offer_image/valueProcess.js new file mode 100644 index 0000000000..864c2a3fc4 --- /dev/null +++ b/entity/Offeritem_entity/entityfields/offer_image/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("system.vars"); + +result.string("TEXT:" + vars.get("$field.OFFER_STATUS.displayValue")); diff --git a/entity/Offeritem_entity/entityfields/offer_net/displayValueProcess.js b/entity/Offeritem_entity/entityfields/offer_net/displayValueProcess.js new file mode 100644 index 0000000000..a68fd5e543 --- /dev/null +++ b/entity/Offeritem_entity/entityfields/offer_net/displayValueProcess.js @@ -0,0 +1,10 @@ +import("system.result"); +import("system.vars"); +import("system.translate"); +import("Util_lib"); + +result.string(NumberUtils.formatWithCurrency( + vars.get("$this.value"), + translate.text("#,##0.00"), + vars.get("$field.OFFER_CURRENCY")) +); diff --git a/entity/Offeritem_entity/entityfields/price/displayValueProcess.js b/entity/Offeritem_entity/entityfields/price/displayValueProcess.js index e637f9b6ad..9e3aa2e595 100644 --- a/entity/Offeritem_entity/entityfields/price/displayValueProcess.js +++ b/entity/Offeritem_entity/entityfields/price/displayValueProcess.js @@ -1,22 +1,8 @@ -import("Sql_lib"); -import("system.db"); -import("Util_lib"); +import("system.result"); import("system.vars"); import("system.translate"); -import("system.result"); - - if (vars.get("$param.Currency_param")) - { -var curr = vars.get("$param.Currency_param") - - -} - -else { - curr = newSelect("CURRENCY") - .from("OFFER") - .whereIfSet("OFFER.OFFERID", "$field.OFFER_ID") - .cell(true); -} +import("Util_lib"); -result.string(NumberUtils.formatWithCurrency(vars.get("$field.PRICE"), translate.text("#,##0.00"), curr)); \ No newline at end of file +var currency = vars.get("$param.Currency_param") || vars.get("$field.OFFER_CURRENCY"); +result.string(NumberUtils.formatWithCurrency( + vars.get("$this.value"), translate.text("#,##0.00"), currency)); diff --git a/entity/Offeritem_entity/entityfields/price/minValueProcess.js b/entity/Offeritem_entity/entityfields/price/minValueProcess.js index 451af92dfd..9e32e3b8c7 100644 --- a/entity/Offeritem_entity/entityfields/price/minValueProcess.js +++ b/entity/Offeritem_entity/entityfields/price/minValueProcess.js @@ -1,23 +1,7 @@ -import("KeywordRegistry_basic"); import("system.result"); -import("Sql_lib"); import("system.vars"); +import("KeywordRegistry_basic"); -//allow negative values if product is discount -var minValue = 0; - -var productId = vars.get("$field.PRODUCT_ID"); -if(productId) -{ - var productGroup = newSelect("PRODUCT.GROUPCODEID") - .from("PRODUCT") - .where("PRODUCT.PRODUCTID", productId) - .cell(); - - if(productGroup == $KeywordRegistry.productGroupcode$discount()) - { - minValue = ""; - } -} - -result.string(minValue); \ No newline at end of file +// allow negative values if product is discount +var allowNegative = vars.get("$field.GROUPCODEID") == $KeywordRegistry.productGroupcode$discount(); +result.string(allowNegative ? "" : 0); diff --git a/entity/Offeritem_entity/entityfields/price/onValidation.js b/entity/Offeritem_entity/entityfields/price/onValidation.js deleted file mode 100644 index 3ccd297cc7..0000000000 --- a/entity/Offeritem_entity/entityfields/price/onValidation.js +++ /dev/null @@ -1,27 +0,0 @@ -import("system.result"); -import("Util_lib"); -import("KeywordRegistry_basic"); -import("system.vars"); -import("Sql_lib"); - -var value = vars.get("local.value"); -var minValue = 0; - -var productId = vars.get("$field.PRODUCT_ID"); -if(productId) -{ - var productGroup = newSelect("PRODUCT.GROUPCODEID") - .from("PRODUCT") - .where("PRODUCT.PRODUCTID", productId) - .cell(); - - if(productGroup != $KeywordRegistry.productGroupcode$discount()) - { - var validationResult = NumberUtils.validateIsBetweenFloat("Unit price", value, minValue, Number.MAX_VALUE); - - if (validationResult) - { - result.string(validationResult); - } - } -} \ No newline at end of file diff --git a/entity/Offeritem_entity/entityfields/product_id/displayValueProcess.js b/entity/Offeritem_entity/entityfields/product_id/displayValueProcess.js deleted file mode 100644 index 34b95afc4d..0000000000 --- a/entity/Offeritem_entity/entityfields/product_id/displayValueProcess.js +++ /dev/null @@ -1,10 +0,0 @@ -import("system.neon"); -import("Product_lib"); -import("system.vars"); -import("system.result"); -import("Sql_lib"); - -if(vars.get("$field.PRODUCT_ID") && vars.get("$sys.viewmode") != neon.FRAME_VIEWMODE_TABLE) -{ - result.string(ProductUtils.getProductName(vars.get("$field.PRODUCT_ID"))); -} \ No newline at end of file diff --git a/entity/Offeritem_entity/entityfields/quantity/onValidation.js b/entity/Offeritem_entity/entityfields/quantity/onValidation.js deleted file mode 100644 index 0e56a1cc62..0000000000 --- a/entity/Offeritem_entity/entityfields/quantity/onValidation.js +++ /dev/null @@ -1,11 +0,0 @@ -import("system.translate"); -import("system.result"); -import("system.vars"); -import("Entity_lib"); - -var quatity = vars.get("$local.value") ? vars.get("$local.value") : ""; - -if (parseInt(quatity) <= 0) -{ - result.string(translate.text("${QUANTITY_LOWER_THAN_1}")); -} diff --git a/entity/Offeritem_entity/entityfields/totalprice/displayValueProcess.js b/entity/Offeritem_entity/entityfields/totalprice/displayValueProcess.js index f23c116341..9e3aa2e595 100644 --- a/entity/Offeritem_entity/entityfields/totalprice/displayValueProcess.js +++ b/entity/Offeritem_entity/entityfields/totalprice/displayValueProcess.js @@ -1,22 +1,8 @@ -import("Sql_lib"); -import("system.db"); -import("Util_lib"); +import("system.result"); import("system.vars"); import("system.translate"); -import("system.result"); - - if (vars.get("$param.Currency_param")) - { -var curr = vars.get("$param.Currency_param") - - -} - -else { - curr = newSelect("CURRENCY") - .from("OFFER") - .whereIfSet("OFFER.OFFERID", "$field.OFFER_ID") - .cell(true); -} +import("Util_lib"); -result.string(NumberUtils.formatWithCurrency(vars.get("$field.TotalPrice"), translate.text("#,##0.00"), curr)); \ No newline at end of file +var currency = vars.get("$param.Currency_param") || vars.get("$field.OFFER_CURRENCY"); +result.string(NumberUtils.formatWithCurrency( + vars.get("$this.value"), translate.text("#,##0.00"), currency)); diff --git a/entity/Offeritem_entity/recordcontainers/db/conditionProcess.js b/entity/Offeritem_entity/recordcontainers/db/conditionProcess.js index ee1e6cbd84..e814182694 100644 --- a/entity/Offeritem_entity/recordcontainers/db/conditionProcess.js +++ b/entity/Offeritem_entity/recordcontainers/db/conditionProcess.js @@ -4,5 +4,5 @@ import("system.result"); import("system.vars"); var cond = newWhereIfSet("OFFERITEM.OFFER_ID", "$param.OfferId_param") - -result.string(cond.toString()); \ No newline at end of file +cond.andIfSet("OFFERITEM.PRODUCT_ID", "$param.ProductId_param"); +result.string(cond.toString()); diff --git a/entity/Offeritem_entity/recordcontainers/db/fromClauseProcess.js b/entity/Offeritem_entity/recordcontainers/db/fromClauseProcess.js new file mode 100644 index 0000000000..13de50c53b --- /dev/null +++ b/entity/Offeritem_entity/recordcontainers/db/fromClauseProcess.js @@ -0,0 +1,12 @@ +import("system.result"); +import("Sql_lib"); + +result.string( + new SqlBuilder().from("OFFERITEM") + .leftJoin("PRODUCT", "OFFERITEM.PRODUCT_ID = PRODUCT.PRODUCTID") + .leftJoin("OFFER", "OFFERITEM.OFFER_ID = OFFER.OFFERID") + .leftJoin("CONTACT", "OFFER.CONTACT_ID = CONTACT.CONTACTID") + .leftJoin("ORGANISATION", "CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID") + .leftJoin("PERSON", "CONTACT.PERSON_ID = PERSON.PERSONID") + .toString() +); diff --git a/entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/offer_code.displayvalue/expression.js b/entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/offer_code.displayvalue/expression.js new file mode 100644 index 0000000000..f8f8ed97d2 --- /dev/null +++ b/entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/offer_code.displayvalue/expression.js @@ -0,0 +1,10 @@ +import("system.result"); +import("system.SQLTYPES"); +import("Sql_lib"); + +var maskingUtils = new SqlMaskingUtils(); +var fields = [ + maskingUtils.cast("OFFER.OFFERCODE", SQLTYPES.CHAR, 20), + maskingUtils.cast("OFFER.VERSNR", SQLTYPES.CHAR, 20) +]; +result.string(maskingUtils.concatWithSeparator(fields, "-", false)); diff --git a/entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/offer_person_id.displayvalue/expression.js b/entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/offer_person_id.displayvalue/expression.js new file mode 100644 index 0000000000..d4103521bd --- /dev/null +++ b/entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/offer_person_id.displayvalue/expression.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Person_lib"); + +result.string(PersUtils.getDisplaySqlExpression()); diff --git a/entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/offer_status.displayvalue/expression.js b/entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/offer_status.displayvalue/expression.js new file mode 100644 index 0000000000..1c6eb20489 --- /dev/null +++ b/entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/offer_status.displayvalue/expression.js @@ -0,0 +1,6 @@ +import("system.result"); +import("Keyword_lib"); +import("KeywordRegistry_basic"); + +result.string(KeywordUtils.getResolvedTitleSqlPart( + $KeywordRegistry.offerStatus(), "OFFER.STATUS")); diff --git a/entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/product_id.displayvalue/expression.js b/entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/product_id.displayvalue/expression.js deleted file mode 100644 index a3c7e1a4b0..0000000000 --- a/entity/Offeritem_entity/recordcontainers/db/recordfieldmappings/product_id.displayvalue/expression.js +++ /dev/null @@ -1,6 +0,0 @@ -import("Product_lib"); -import("system.vars"); -import("system.result"); - -// TODO: remove when #title is used as display value for lookups -result.string(ProductUtils.getProductNameSubSql("OFFERITEM.PRODUCT_ID")); \ No newline at end of file diff --git a/entity/Order_entity/Order_entity.aod b/entity/Order_entity/Order_entity.aod index 009030c597..7e2f377619 100644 --- a/entity/Order_entity/Order_entity.aod +++ b/entity/Order_entity/Order_entity.aod @@ -1030,6 +1030,20 @@ <expose v="true" /> <documentation>%aditoprj%/entity/Order_entity/entityfields/links_param/documentation.adoc</documentation> </entityParameter> + <entityConsumer> + <name>KeywordProductGroup</name> + <dependency> + <name>dependency</name> + <entityName>KeywordEntry_entity</entityName> + <fieldName>SpecificContainerKeywords</fieldName> + </dependency> + <children> + <entityParameter> + <name>ContainerName_param</name> + <valueProcess>%aditoprj%/entity/Order_entity/entityfields/keywordproductgroup/children/containername_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> @@ -1294,6 +1308,24 @@ <filterConditionProcess>%aditoprj%/entity/Order_entity/recordcontainers/db/filterextensions/favorite_filter/filterConditionProcess.js</filterConditionProcess> <filtertype>BASIC</filtertype> </filterExtension> + <filterExtension> + <name>Product_filter</name> + <title>Product</title> + <contentType>TEXT</contentType> + <useConsumer v="true" /> + <consumer>Products</consumer> + <filterConditionProcess>%aditoprj%/entity/Order_entity/recordcontainers/db/filterextensions/product_filter/filterConditionProcess.js</filterConditionProcess> + <filtertype>BASIC</filtertype> + </filterExtension> + <filterExtension> + <name>ProductGroup_filter</name> + <title>Product Group</title> + <contentType>TEXT</contentType> + <useConsumer v="true" /> + <consumer>KeywordProductGroup</consumer> + <filterConditionProcess>%aditoprj%/entity/Order_entity/recordcontainers/db/filterextensions/productgroup_filter/filterConditionProcess.js</filterConditionProcess> + <filtertype>BASIC</filtertype> + </filterExtension> </filterExtensions> </dbRecordContainer> <indexRecordContainer> diff --git a/entity/Order_entity/entityfields/keywordproductgroup/children/containername_param/valueProcess.js b/entity/Order_entity/entityfields/keywordproductgroup/children/containername_param/valueProcess.js new file mode 100644 index 0000000000..348d170e28 --- /dev/null +++ b/entity/Order_entity/entityfields/keywordproductgroup/children/containername_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("KeywordRegistry_basic"); + +result.string($KeywordRegistry.productGroupcode()); diff --git a/entity/Order_entity/recordcontainers/db/filterextensions/product_filter/filterConditionProcess.js b/entity/Order_entity/recordcontainers/db/filterextensions/product_filter/filterConditionProcess.js new file mode 100644 index 0000000000..722a004ef2 --- /dev/null +++ b/entity/Order_entity/recordcontainers/db/filterextensions/product_filter/filterConditionProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("Sql_lib"); + +var sql = newSelect("SALESORDERITEM.SALESORDERITEMID").from("SALESORDERITEM") + .where("SALESORDER.SALESORDERID = SALESORDERITEM.SALESORDER_ID") + .and("SALESORDERITEM.PRODUCT_ID", "$local.rawvalue", SqlUtils.getSqlConditionalOperator()); +result.string("exists (" + sql.toString() + ")"); diff --git a/entity/Order_entity/recordcontainers/db/filterextensions/productgroup_filter/filterConditionProcess.js b/entity/Order_entity/recordcontainers/db/filterextensions/productgroup_filter/filterConditionProcess.js new file mode 100644 index 0000000000..c3610fbcd8 --- /dev/null +++ b/entity/Order_entity/recordcontainers/db/filterextensions/productgroup_filter/filterConditionProcess.js @@ -0,0 +1,8 @@ +import("system.result"); +import("Sql_lib"); + +var sql = newSelect("SALESORDERITEM.SALESORDERITEMID").from("SALESORDERITEM") + .join("PRODUCT", "PRODUCT.PRODUCTID = SALESORDERITEM.PRODUCT_ID") + .where("SALESORDER.SALESORDERID = SALESORDERITEM.SALESORDER_ID") + .and("PRODUCT.GROUPCODEID", "$local.rawvalue", SqlUtils.getSqlConditionalOperator()); +result.string("exists (" + sql.toString() + ")"); diff --git a/entity/Orderitem_entity/Orderitem_entity.aod b/entity/Orderitem_entity/Orderitem_entity.aod index 5fc6306507..d88495d1e7 100644 --- a/entity/Orderitem_entity/Orderitem_entity.aod +++ b/entity/Orderitem_entity/Orderitem_entity.aod @@ -23,8 +23,8 @@ <name>DISCOUNT</name> <title>Discount</title> <contentType>NUMBER</contentType> - <minValue v="0" /> <outputFormat>#,##0.00</outputFormat> + <onValidation>%aditoprj%/entity/Orderitem_entity/entityfields/discount/onValidation.js</onValidation> </entityField> <entityField> <name>GROUPCODEID</name> @@ -64,7 +64,6 @@ <inputFormat>#,##0.00</inputFormat> <mandatory v="true" /> <displayValueProcess>%aditoprj%/entity/Orderitem_entity/entityfields/price/displayValueProcess.js</displayValueProcess> - <onValidation>%aditoprj%/entity/Orderitem_entity/entityfields/price/onValidation.js</onValidation> </entityField> <entityField> <name>PRODUCT_ID</name> @@ -73,7 +72,6 @@ <consumer>Products</consumer> <linkedContext>Product</linkedContext> <valueProcess>%aditoprj%/entity/Orderitem_entity/entityfields/product_id/valueProcess.js</valueProcess> - <displayValueProcess>%aditoprj%/entity/Orderitem_entity/entityfields/product_id/displayValueProcess.js</displayValueProcess> <onValueChange>%aditoprj%/entity/Orderitem_entity/entityfields/product_id/onValueChange.js</onValueChange> <onValueChangeTypes> <element>MASK</element> @@ -92,7 +90,6 @@ <onValueChangeTypes> <element>MASK</element> </onValueChangeTypes> - <onValidation></onValidation> </entityField> <entityField> <name>UNIT</name> @@ -135,7 +132,6 @@ <state>READONLY</state> <valueProcess>%aditoprj%/entity/Orderitem_entity/entityfields/totalprice/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/Orderitem_entity/entityfields/totalprice/displayValueProcess.js</displayValueProcess> - <onValidation></onValidation> </entityField> <entityField> <name>IMAGE</name> @@ -283,6 +279,70 @@ <state>READONLY</state> <valueProcess>%aditoprj%/entity/Orderitem_entity/entityfields/currency/valueProcess.js</valueProcess> </entityField> + <entityField> + <name>ORDER_CODE</name> + <title>Receipt number</title> + <linkedContext>Order</linkedContext> + <state>READONLY</state> + </entityField> + <entityField> + <name>ORDER_PERSON_ID</name> + <title>Person</title> + <linkedContext>Person</linkedContext> + <state>READONLY</state> + </entityField> + <entityField> + <name>ORDER_ORGANISATION_ID</name> + <title>Company</title> + <linkedContext>Organisation</linkedContext> + <state>READONLY</state> + </entityField> + <entityField> + <name>ORDER_TYPE</name> + <title>Order Type</title> + <state>READONLY</state> + </entityField> + <entityField> + <name>ORDER_IMAGE</name> + <contentType>IMAGE</contentType> + <state>READONLY</state> + <valueProcess>%aditoprj%/entity/Orderitem_entity/entityfields/order_image/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>ORDER_NET</name> + <title>Total net</title> + <contentType>NUMBER</contentType> + <state>READONLY</state> + <displayValueProcess>%aditoprj%/entity/Orderitem_entity/entityfields/order_net/displayValueProcess.js</displayValueProcess> + </entityField> + <entityField> + <name>ORDER_CURRENCY</name> + <title>Currency</title> + <state>READONLY</state> + </entityField> + <entityField> + <name>ORDER_DATE</name> + <title>Date</title> + <contentType>DATE</contentType> + <resolution>DAY</resolution> + <outputFormat>dd.MM.yyyy</outputFormat> + <state>READONLY</state> + </entityField> + <entityField> + <name>ORDER_STATUS</name> + <title>Sent</title> + <contentType>BOOLEAN</contentType> + <state>READONLY</state> + </entityField> + <entityField> + <name>ORDER_CANCELLATION</name> + <title>${ORDER_CANCELLED}</title> + <contentType>BOOLEAN</contentType> + <state>READONLY</state> + </entityField> + <entityField> + <name>PRODUCT_GROUPCODEID</name> + </entityField> <entityField> <name>PICTURE</name> <contentType>IMAGE</contentType> @@ -294,6 +354,7 @@ <maximumDbRows v="0" /> <isPageable v="false" /> <hasDependentRecords v="true" /> + <fromClauseProcess>%aditoprj%/entity/Orderitem_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess> <conditionProcess>%aditoprj%/entity/Orderitem_entity/recordcontainers/db/conditionProcess.js</conditionProcess> <orderClauseProcess>%aditoprj%/entity/Orderitem_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess> <onDBInsert>%aditoprj%/entity/Orderitem_entity/recordcontainers/db/onDBInsert.js</onDBInsert> @@ -369,7 +430,7 @@ </dbRecordFieldMapping> <dbRecordFieldMapping> <name>PRODUCT_ID.displayValue</name> - <expression>%aditoprj%/entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/product_id.displayvalue/expression.js</expression> + <recordfield>PRODUCT.PRODUCTNAME</recordfield> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>INFO.value</name> @@ -377,6 +438,62 @@ <isFilterable v="true" /> <isLookupFilter v="true" /> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ORDER_CODE.value</name> + <recordfield>SALESORDER.SALESORDERID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ORDER_CODE.displayValue</name> + <recordfield>SALESORDER.SALESORDERCODE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ORDER_PERSON_ID.value</name> + <recordfield>CONTACT.PERSON_ID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ORDER_ORGANISATION_ID.value</name> + <recordfield>CONTACT.ORGANISATION_ID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ORDER_PERSON_ID.displayValue</name> + <expression>%aditoprj%/entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/order_person_id.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ORDER_ORGANISATION_ID.displayValue</name> + <recordfield>ORGANISATION.NAME</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ORDER_TYPE.value</name> + <recordfield>SALESORDER.ORDERTYPE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ORDER_TYPE.displayValue</name> + <expression>%aditoprj%/entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/order_type.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ORDER_NET.value</name> + <recordfield>SALESORDER.NET</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ORDER_CURRENCY.value</name> + <recordfield>SALESORDER.CURRENCY</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ORDER_CANCELLATION.value</name> + <recordfield>SALESORDER.CANCELLATION</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ORDER_DATE.value</name> + <recordfield>SALESORDER.SALESORDERDATE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ORDER_STATUS.value</name> + <recordfield>SALESORDER.ORDERSTATUS</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>PRODUCT_GROUPCODEID.value</name> + <recordfield>PRODUCT.GROUPCODEID</recordfield> + </dbRecordFieldMapping> <dbRecordFieldMapping> <name>PICTURE.value</name> <expression>%aditoprj%/entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/picture.value/expression.js</expression> @@ -384,12 +501,47 @@ </recordFieldMappings> <linkInformation> <linkInformation> - <name>cb0f1bfa-92eb-4ee9-bb02-8ac0ef3f987d</name> + <name>ee2c33c1-dfef-433c-8f39-48f9cb38bb34</name> <tableName>SALESORDERITEM</tableName> <primaryKey>SALESORDERITEMID</primaryKey> <isUIDTable v="true" /> <readonly v="false" /> </linkInformation> + <linkInformation> + <name>9f18fe6b-c7d5-42ba-a101-d1b2533c782e</name> + <tableName>PRODUCT</tableName> + <primaryKey>PRODUCTID</primaryKey> + <isUIDTable v="false" /> + <readonly v="true" /> + </linkInformation> + <linkInformation> + <name>db05edd5-c3be-4b90-acfd-a9d58c467651</name> + <tableName>SALESORDER</tableName> + <primaryKey>SALESORDERID</primaryKey> + <isUIDTable v="false" /> + <readonly v="true" /> + </linkInformation> + <linkInformation> + <name>d78b1f3f-280b-44a0-aabe-c01876ae3f21</name> + <tableName>CONTACT</tableName> + <primaryKey>CONTACTID</primaryKey> + <isUIDTable v="false" /> + <readonly v="true" /> + </linkInformation> + <linkInformation> + <name>6b072218-faa8-47c8-984d-e641d81733df</name> + <tableName>ORGANISATION</tableName> + <primaryKey>ORGANISATIONID</primaryKey> + <isUIDTable v="false" /> + <readonly v="true" /> + </linkInformation> + <linkInformation> + <name>2767e19d-01ff-46bf-8c9c-626665d36758</name> + <tableName>PERSON</tableName> + <primaryKey>PERSONID</primaryKey> + <isUIDTable v="false" /> + <readonly v="true" /> + </linkInformation> </linkInformation> </dbRecordContainer> </recordContainers> diff --git a/entity/Orderitem_entity/entityfields/discount/onValidation.js b/entity/Orderitem_entity/entityfields/discount/onValidation.js new file mode 100644 index 0000000000..0b9a98a1ed --- /dev/null +++ b/entity/Orderitem_entity/entityfields/discount/onValidation.js @@ -0,0 +1,11 @@ +import("system.result"); +import("system.vars"); +import("Util_lib"); + +var value = vars.get("local.value"); +var validationResult = NumberUtils.validateIsBetweenFloat("Discount", value, 0, 100); + +if(validationResult) +{ + result.string(validationResult); +} diff --git a/entity/Orderitem_entity/entityfields/order_image/valueProcess.js b/entity/Orderitem_entity/entityfields/order_image/valueProcess.js new file mode 100644 index 0000000000..f73b1f79ff --- /dev/null +++ b/entity/Orderitem_entity/entityfields/order_image/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("system.vars"); + +result.string("TEXT:" + vars.get("$field.ORDER_TYPE.displayValue")); diff --git a/entity/Orderitem_entity/entityfields/order_net/displayValueProcess.js b/entity/Orderitem_entity/entityfields/order_net/displayValueProcess.js new file mode 100644 index 0000000000..daee08ce7b --- /dev/null +++ b/entity/Orderitem_entity/entityfields/order_net/displayValueProcess.js @@ -0,0 +1,10 @@ +import("system.result"); +import("system.vars"); +import("system.translate"); +import("Util_lib"); + +result.string(NumberUtils.formatWithCurrency( + vars.get("$this.value"), + translate.text("#,##0.00"), + vars.get("$field.ORDER_CURRENCY")) +); diff --git a/entity/Orderitem_entity/entityfields/price/displayValueProcess.js b/entity/Orderitem_entity/entityfields/price/displayValueProcess.js index 489768c652..371d20d026 100644 --- a/entity/Orderitem_entity/entityfields/price/displayValueProcess.js +++ b/entity/Orderitem_entity/entityfields/price/displayValueProcess.js @@ -1,21 +1,8 @@ -import("Sql_lib"); -import("system.db"); -import("Util_lib"); +import("system.result"); import("system.vars"); import("system.translate"); -import("system.result"); - -var curr; -if (vars.get("$param.Currency_param")) -{ - curr = vars.get("$param.Currency_param"); -} -else -{ - curr = newSelect("CURRENCY") - .from("SALESORDER") - .whereIfSet("SALESORDER.SALESORDERID", "$field.SALESORDER_ID") - .cell(true); -} +import("Util_lib"); -result.string(NumberUtils.formatWithCurrency(vars.get("$field.PRICE"), translate.text("#,##0.00"), curr)); \ No newline at end of file +var currency = vars.get("$param.Currency_param") || vars.get("$field.ORDER_CURRENCY"); +result.string(NumberUtils.formatWithCurrency( + vars.get("$this.value"), translate.text("#,##0.00"), currency)); diff --git a/entity/Orderitem_entity/entityfields/price/minValueProcess.js b/entity/Orderitem_entity/entityfields/price/minValueProcess.js index 451af92dfd..9e32e3b8c7 100644 --- a/entity/Orderitem_entity/entityfields/price/minValueProcess.js +++ b/entity/Orderitem_entity/entityfields/price/minValueProcess.js @@ -1,23 +1,7 @@ -import("KeywordRegistry_basic"); import("system.result"); -import("Sql_lib"); import("system.vars"); +import("KeywordRegistry_basic"); -//allow negative values if product is discount -var minValue = 0; - -var productId = vars.get("$field.PRODUCT_ID"); -if(productId) -{ - var productGroup = newSelect("PRODUCT.GROUPCODEID") - .from("PRODUCT") - .where("PRODUCT.PRODUCTID", productId) - .cell(); - - if(productGroup == $KeywordRegistry.productGroupcode$discount()) - { - minValue = ""; - } -} - -result.string(minValue); \ No newline at end of file +// allow negative values if product is discount +var allowNegative = vars.get("$field.GROUPCODEID") == $KeywordRegistry.productGroupcode$discount(); +result.string(allowNegative ? "" : 0); diff --git a/entity/Orderitem_entity/entityfields/price/onValidation.js b/entity/Orderitem_entity/entityfields/price/onValidation.js deleted file mode 100644 index 0a8a01d7ce..0000000000 --- a/entity/Orderitem_entity/entityfields/price/onValidation.js +++ /dev/null @@ -1,27 +0,0 @@ -import("system.result"); -import("Util_lib"); -import("KeywordRegistry_basic"); -import("Sql_lib"); -import("system.vars"); - -var value = vars.get("local.value"); -var minValue = 0; - -var productId = vars.get("$field.PRODUCT_ID"); -if(productId) -{ - var productGroup = newSelect("PRODUCT.GROUPCODEID") - .from("PRODUCT") - .where("PRODUCT.PRODUCTID", productId) - .cell(); - - if(productGroup != $KeywordRegistry.productGroupcode$discount()) - { - var validationResult = NumberUtils.validateIsBetweenFloat("Unit price", value, minValue, Number.MAX_VALUE); - - if (validationResult) - { - result.string(validationResult); - } - } -} diff --git a/entity/Orderitem_entity/entityfields/product_id/displayValueProcess.js b/entity/Orderitem_entity/entityfields/product_id/displayValueProcess.js deleted file mode 100644 index 99ef423450..0000000000 --- a/entity/Orderitem_entity/entityfields/product_id/displayValueProcess.js +++ /dev/null @@ -1,10 +0,0 @@ -import("Product_lib"); -import("system.neon"); -import("system.vars"); -import("system.result"); -import("Sql_lib"); - -if(vars.get("$field.PRODUCT_ID") && vars.get("$sys.viewmode") != neon.FRAME_VIEWMODE_TABLE) -{ - result.string(ProductUtils.getProductName(vars.get("$field.PRODUCT_ID"))); -} \ No newline at end of file diff --git a/entity/Orderitem_entity/entityfields/totalprice/displayValueProcess.js b/entity/Orderitem_entity/entityfields/totalprice/displayValueProcess.js index 8085abfa37..371d20d026 100644 --- a/entity/Orderitem_entity/entityfields/totalprice/displayValueProcess.js +++ b/entity/Orderitem_entity/entityfields/totalprice/displayValueProcess.js @@ -1,20 +1,8 @@ -import("system.translate"); -import("Util_lib"); import("system.result"); -import("Sql_lib"); import("system.vars"); +import("system.translate"); +import("Util_lib"); -var curr; -if (vars.get("$param.Currency_param")) -{ - curr = vars.get("$param.Currency_param"); -} -else -{ - curr = newSelect("CURRENCY") - .from("SALESORDER") - .whereIfSet("SALESORDER.SALESORDERID", "$field.SALESORDER_ID") - .cell(true); -} - -result.string(NumberUtils.formatWithCurrency(vars.get("$field.TotalPrice"), translate.text("#,##0.00"), curr)); \ No newline at end of file +var currency = vars.get("$param.Currency_param") || vars.get("$field.ORDER_CURRENCY"); +result.string(NumberUtils.formatWithCurrency( + vars.get("$this.value"), translate.text("#,##0.00"), currency)); diff --git a/entity/Orderitem_entity/recordcontainers/db/conditionProcess.js b/entity/Orderitem_entity/recordcontainers/db/conditionProcess.js index 6794f43bc9..84af1c615d 100644 --- a/entity/Orderitem_entity/recordcontainers/db/conditionProcess.js +++ b/entity/Orderitem_entity/recordcontainers/db/conditionProcess.js @@ -4,5 +4,5 @@ import("system.result"); import("system.vars"); var cond = newWhereIfSet("SALESORDERITEM.SALESORDER_ID", "$param.OrderId_param") - -result.string(cond.toString()); \ No newline at end of file +cond.andIfSet("SALESORDERITEM.PRODUCT_ID", "$param.ProductId_param"); +result.string(cond.toString()); diff --git a/entity/Orderitem_entity/recordcontainers/db/fromClauseProcess.js b/entity/Orderitem_entity/recordcontainers/db/fromClauseProcess.js new file mode 100644 index 0000000000..7eebea002d --- /dev/null +++ b/entity/Orderitem_entity/recordcontainers/db/fromClauseProcess.js @@ -0,0 +1,12 @@ +import("system.result"); +import("Sql_lib"); + +result.string( + new SqlBuilder().from("SALESORDERITEM") + .leftJoin("PRODUCT", "SALESORDERITEM.PRODUCT_ID = PRODUCT.PRODUCTID") + .leftJoin("SALESORDER", "SALESORDERITEM.SALESORDER_ID = SALESORDER.SALESORDERID") + .leftJoin("CONTACT", "SALESORDER.CONTACT_ID = CONTACT.CONTACTID") + .leftJoin("ORGANISATION", "CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID") + .leftJoin("PERSON", "CONTACT.PERSON_ID = PERSON.PERSONID") + .toString() +); diff --git a/entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/order_person_id.displayvalue/expression.js b/entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/order_person_id.displayvalue/expression.js new file mode 100644 index 0000000000..d4103521bd --- /dev/null +++ b/entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/order_person_id.displayvalue/expression.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Person_lib"); + +result.string(PersUtils.getDisplaySqlExpression()); diff --git a/entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/order_type.displayvalue/expression.js b/entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/order_type.displayvalue/expression.js new file mode 100644 index 0000000000..d5641dae10 --- /dev/null +++ b/entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/order_type.displayvalue/expression.js @@ -0,0 +1,6 @@ +import("system.result"); +import("Keyword_lib"); +import("KeywordRegistry_basic"); + +result.string(KeywordUtils.getResolvedTitleSqlPart( + $KeywordRegistry.orderType(), "SALESORDER.ORDERTYPE")); diff --git a/entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/product_id.displayvalue/expression.js b/entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/product_id.displayvalue/expression.js deleted file mode 100644 index 60e5f9a443..0000000000 --- a/entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/product_id.displayvalue/expression.js +++ /dev/null @@ -1,6 +0,0 @@ -import("Product_lib"); -import("system.vars"); -import("system.result"); - -// TODO: remove when #title is used as display value for lookups -result.string(ProductUtils.getProductNameSubSql("SALESORDERITEM.PRODUCT_ID")); \ No newline at end of file diff --git a/entity/Product_entity/Product_entity.aod b/entity/Product_entity/Product_entity.aod index 5c71823a29..bf2d0e8493 100644 --- a/entity/Product_entity/Product_entity.aod +++ b/entity/Product_entity/Product_entity.aod @@ -550,6 +550,34 @@ <name>ADVERTISING_TILEVIEW</name> <documentation>%aditoprj%/entity/Product_entity/entityfields/advertising_tileview/documentation.adoc</documentation> </entityField> + <entityConsumer> + <name>Offeritems</name> + <dependency> + <name>dependency</name> + <entityName>Offeritem_entity</entityName> + <fieldName>OfferItems</fieldName> + </dependency> + <children> + <entityParameter> + <name>ProductId_param</name> + <valueProcess>%aditoprj%/entity/Product_entity/entityfields/offeritems/children/productid_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityConsumer> + <name>Orderitems</name> + <dependency> + <name>dependency</name> + <entityName>Orderitem_entity</entityName> + <fieldName>Orderitems</fieldName> + </dependency> + <children> + <entityParameter> + <name>ProductId_param</name> + <valueProcess>%aditoprj%/entity/Product_entity/entityfields/orderitems/children/productid_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Product_entity/entityfields/offeritems/children/productid_param/valueProcess.js b/entity/Product_entity/entityfields/offeritems/children/productid_param/valueProcess.js new file mode 100644 index 0000000000..85f8124d67 --- /dev/null +++ b/entity/Product_entity/entityfields/offeritems/children/productid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("system.vars"); + +result.string(vars.get("$field.PRODUCTID")); diff --git a/entity/Product_entity/entityfields/orderitems/children/productid_param/valueProcess.js b/entity/Product_entity/entityfields/orderitems/children/productid_param/valueProcess.js new file mode 100644 index 0000000000..85f8124d67 --- /dev/null +++ b/entity/Product_entity/entityfields/orderitems/children/productid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("system.vars"); + +result.string(vars.get("$field.PRODUCTID")); diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index d62cbad3ec..6f6dbc6a56 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -14646,7 +14646,7 @@ Bitte Datumseingabe prüfen</value> <key>Service ticket category</key> </entry> <entry> - <key>Use all service ticket categories</key> + <key>Use all serviceticket categories</key> </entry> <entry> <key>Contact & Service ticket</key> @@ -14655,6 +14655,14 @@ Bitte Datumseingabe prüfen</value> <key>Reveal the price in the offer</key> <value>Preis im Angebot ausweisen</value> </entry> + <entry> + <key>Offers / Receipts</key> + <value>Angebote / Belege</value> + </entry> + <entry> + <key>Calculate sum</key> + <value>Summe berechnen</value> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/neonContext/Offeritem/Offeritem.aod b/neonContext/Offeritem/Offeritem.aod index 052bf2f4d3..b42f5346f0 100644 --- a/neonContext/Offeritem/Offeritem.aod +++ b/neonContext/Offeritem/Offeritem.aod @@ -24,5 +24,9 @@ <name>9571eef4-1b84-4f4f-9109-7c5f63571a93</name> <view>OfferitemEdit_view</view> </neonViewReference> + <neonViewReference> + <name>3acc3773-580f-40ec-948e-23a70a46cd5e</name> + <view>OfferitemProduct_view</view> + </neonViewReference> </references> </neonContext> diff --git a/neonContext/Order/Order.aod b/neonContext/Order/Order.aod index 21a230bfa7..06062207e4 100644 --- a/neonContext/Order/Order.aod +++ b/neonContext/Order/Order.aod @@ -55,5 +55,9 @@ <name>777804d0-fe8d-43b6-9599-18fc46951d8f</name> <view>OrderAddress_view</view> </neonViewReference> + <neonViewReference> + <name>511215ef-6813-49c5-ac11-6841d046de62</name> + <view>OrderDrawer_view</view> + </neonViewReference> </references> </neonContext> diff --git a/neonContext/Orderitem/Orderitem.aod b/neonContext/Orderitem/Orderitem.aod index 7317e72be6..8c9590905f 100644 --- a/neonContext/Orderitem/Orderitem.aod +++ b/neonContext/Orderitem/Orderitem.aod @@ -23,5 +23,9 @@ <name>7da75934-7cc5-4271-a054-a6e82007b25c</name> <view>OrderitemEdit_view</view> </neonViewReference> + <neonViewReference> + <name>099ed5c4-0905-44a9-b547-459f44f60d15</name> + <view>OrderitemProduct_view</view> + </neonViewReference> </references> </neonContext> diff --git a/neonContext/Product/Product.aod b/neonContext/Product/Product.aod index 4a1a49078e..a351e04778 100644 --- a/neonContext/Product/Product.aod +++ b/neonContext/Product/Product.aod @@ -35,5 +35,9 @@ <name>8088a294-78dd-4f7b-8bd3-add1b9fe3d90</name> <view>ProductDescritption_view</view> </neonViewReference> + <neonViewReference> + <name>bcc36a52-f97f-4883-b1eb-21b9daef82f4</name> + <view>ProductOfferOrder_view</view> + </neonViewReference> </references> </neonContext> diff --git a/neonView/OfferitemProduct_view/OfferitemProduct_view.aod b/neonView/OfferitemProduct_view/OfferitemProduct_view.aod new file mode 100644 index 0000000000..c59eb6c5bd --- /dev/null +++ b/neonView/OfferitemProduct_view/OfferitemProduct_view.aod @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.8" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.8"> + <name>OfferitemProduct_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <drawerLayout> + <name>layout</name> + <layoutCaption>Offers</layoutCaption> + <fixedDrawer v="true" /> + </drawerLayout> + </layout> + <children> + <tableViewTemplate> + <name>table</name> + <columns> + <neonTableColumn> + <name>b79722bf-cc93-4cf2-814b-a23271a66972</name> + <entityField>OFFER_IMAGE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>95dc000b-be3f-4c8e-8791-b94011aa2989</name> + <entityField>OFFER_CODE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>60ee7841-f38e-495a-bc21-eed1e5da2d01</name> + <entityField>QUANTITY</entityField> + </neonTableColumn> + <neonTableColumn> + <name>5b87fdd1-c222-4b4d-856c-4f93aa239d07</name> + <entityField>UNIT</entityField> + </neonTableColumn> + <neonTableColumn> + <name>1ce4d845-5377-4040-8603-d85624afaf22</name> + <entityField>PRICE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>1004b07f-13b3-4f95-ab37-69bfe49d8702</name> + <entityField>DISCOUNT</entityField> + </neonTableColumn> + <neonTableColumn> + <name>8e31c124-59e9-4a33-8e0b-9ca3956ec740</name> + <entityField>OFFER_ORGANISATION_ID</entityField> + </neonTableColumn> + <neonTableColumn> + <name>8bff92d5-3fcb-4bdc-8e15-e4735b58770c</name> + <entityField>OFFER_PERSON_ID</entityField> + </neonTableColumn> + <neonTableColumn> + <name>9a209746-67a7-4eb9-ac60-9cb2ee8fa8b9</name> + <entityField>OFFER_STATUS</entityField> + </neonTableColumn> + <neonTableColumn> + <name>c079f182-8f72-491c-95d8-05152a951c15</name> + <entityField>OFFER_DATE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>fd2eebae-ef6e-4d3e-a2ce-b8473f63696a</name> + <entityField>OFFER_NET</entityField> + </neonTableColumn> + <neonTableColumn> + <name>67cec124-9243-4844-9f58-77e76521b6f2</name> + <entityField>OFFER_PROBABILITY</entityField> + </neonTableColumn> + </columns> + </tableViewTemplate> + </children> +</neonView> diff --git a/neonView/OrderDrawer_view/OrderDrawer_view.aod b/neonView/OrderDrawer_view/OrderDrawer_view.aod new file mode 100644 index 0000000000..592ec2f30c --- /dev/null +++ b/neonView/OrderDrawer_view/OrderDrawer_view.aod @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.8" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.8"> + <name>OrderDrawer_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <drawerLayout> + <name>layout</name> + <layoutCaption>Receipts</layoutCaption> + <fixedDrawer v="true" /> + </drawerLayout> + </layout> + <children> + <neonViewReference> + <name>2f7a251b-7bfb-42ac-b19f-4682ccf33996</name> + <entityField>#ENTITY</entityField> + <view>OrderFilter_view</view> + </neonViewReference> + </children> +</neonView> diff --git a/neonView/OrderitemProduct_view/OrderitemProduct_view.aod b/neonView/OrderitemProduct_view/OrderitemProduct_view.aod new file mode 100644 index 0000000000..fbe940c2b2 --- /dev/null +++ b/neonView/OrderitemProduct_view/OrderitemProduct_view.aod @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.8" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.8"> + <name>OrderitemProduct_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <drawerLayout> + <name>layout</name> + <layoutCaption>Receipts</layoutCaption> + <fixedDrawer v="true" /> + </drawerLayout> + </layout> + <children> + <tableViewTemplate> + <name>table</name> + <columns> + <neonTableColumn> + <name>ed0bd6a4-e097-4a06-936e-48fa11b150ca</name> + <entityField>ORDER_IMAGE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>7a415c49-45b2-4ad6-987b-4f22ae50d4b4</name> + <entityField>ORDER_CODE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>f205ed09-b2b9-419b-9895-b5f491b63f5c</name> + <entityField>QUANTITY</entityField> + </neonTableColumn> + <neonTableColumn> + <name>3b8afd79-15aa-4726-8ce6-59ef66132603</name> + <entityField>UNIT</entityField> + </neonTableColumn> + <neonTableColumn> + <name>5f0f750c-9508-4e1b-ab39-c4d9cf7db4ca</name> + <entityField>PRICE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>63dfff3b-01f3-47c1-bd65-58e9c1d2d3b4</name> + <entityField>DISCOUNT</entityField> + </neonTableColumn> + <neonTableColumn> + <name>d357bef5-4057-4f66-88ad-5b753802114b</name> + <entityField>ORDER_TYPE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>22c35bad-ebda-443e-bb14-2804051ad16f</name> + <entityField>ORDER_ORGANISATION_ID</entityField> + </neonTableColumn> + <neonTableColumn> + <name>935ac8a0-04f0-41ec-ad14-534f3b01f8bd</name> + <entityField>ORDER_PERSON_ID</entityField> + </neonTableColumn> + <neonTableColumn> + <name>a64577dc-00fc-4899-9738-795ee93fb731</name> + <entityField>ORDER_STATUS</entityField> + </neonTableColumn> + <neonTableColumn> + <name>8c4afba0-3e80-463d-8e8d-3c0fd3e3c5f5</name> + <entityField>ORDER_DATE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>286852c4-8749-4f39-8eb8-c01117afd650</name> + <entityField>ORDER_CANCELLATION</entityField> + </neonTableColumn> + <neonTableColumn> + <name>f245b6d4-1018-42be-bfee-c0d88b5ae7ea</name> + <entityField>ORDER_NET</entityField> + </neonTableColumn> + </columns> + </tableViewTemplate> + </children> +</neonView> diff --git a/neonView/ProductMain_view/ProductMain_view.aod b/neonView/ProductMain_view/ProductMain_view.aod index ef39735d81..27dc6309ff 100644 --- a/neonView/ProductMain_view/ProductMain_view.aod +++ b/neonView/ProductMain_view/ProductMain_view.aod @@ -29,6 +29,11 @@ <entityField>#ENTITY</entityField> <view>ProductDescritption_view</view> </neonViewReference> + <neonViewReference> + <name>db635367-7397-45d6-835c-c8ce7f75a38b</name> + <entityField>#ENTITY</entityField> + <view>ProductOfferOrder_view</view> + </neonViewReference> <neonViewReference> <name>6ee1258f-b571-45c1-b833-f292361b5a04</name> <entityField>AttributeTree</entityField> diff --git a/neonView/ProductOfferOrder_view/ProductOfferOrder_view.aod b/neonView/ProductOfferOrder_view/ProductOfferOrder_view.aod new file mode 100644 index 0000000000..178f190a76 --- /dev/null +++ b/neonView/ProductOfferOrder_view/ProductOfferOrder_view.aod @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.8" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.8"> + <name>ProductOfferOrder_view</name> + <title>Offers / Receipts</title> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <neonViewReference> + <name>b56f3664-bb9f-4b84-8963-32704f9752a3</name> + <entityField>Offeritems</entityField> + <view>OfferitemProduct_view</view> + </neonViewReference> + <neonViewReference> + <name>6f8f14a2-c5b0-4697-a0b6-bd12ae89bb43</name> + <entityField>Orderitems</entityField> + <view>OrderitemProduct_view</view> + </neonViewReference> + </children> +</neonView> diff --git a/process/Sql_lib/process.js b/process/Sql_lib/process.js index c9189834b5..2a72f32794 100644 --- a/process/Sql_lib/process.js +++ b/process/Sql_lib/process.js @@ -4297,6 +4297,7 @@ SqlUtils.escapeVars = function (pValue) SqlUtils.getSqlConditionalOperator = function(pOperator) { + pOperator = pOperator || vars.get("$local.operator"); switch(parseInt(pOperator)) { case 1: -- GitLab