diff --git a/entity/Address_entity/Address_entity.aod b/entity/Address_entity/Address_entity.aod index e8d7c87318a80c316dba31bd8b307876fc67a7c2..4873f86ea5ed1b7bd92f6322b21865fa5448987d 100644 --- a/entity/Address_entity/Address_entity.aod +++ b/entity/Address_entity/Address_entity.aod @@ -23,6 +23,7 @@ </entityField> <entityField> <name>ADDRESSADDITION</name> + <title>Address addition</title> </entityField> <entityField> <name>ADDRESSID</name> diff --git a/entity/AttributeRelation_entity/entityfields/specificattribute/children/attributetypes_param/valueProcess.js b/entity/AttributeRelation_entity/entityfields/specificattribute/children/attributetypes_param/valueProcess.js index d940f3ac530d0079362be73944a1d6093b82ff45..8a91185ddf26e070218c0793881aceb78648a8cb 100644 --- a/entity/AttributeRelation_entity/entityfields/specificattribute/children/attributetypes_param/valueProcess.js +++ b/entity/AttributeRelation_entity/entityfields/specificattribute/children/attributetypes_param/valueProcess.js @@ -1,9 +1,7 @@ +import("system.vars"); import("system.result"); import("Attribute_lib"); var isTheme = vars.exists("$param.IsTheme_param") && vars.getString("$param.IsTheme_param") == "true"; if (isTheme) - sqlCondition.andPrepare("AB_ATTRIBUTE.ATTRIBUTE_TYPE", $AttributeTypes.THEME); -else - sqlCondition.andPrepare("AB_ATTRIBUTE.ATTRIBUTE_TYPE", $AttributeTypes.THEME, "# != ?"); -result.object([$AttributeTypes.THEME.toString()]); \ No newline at end of file + result.object([$AttributeTypes.THEME.toString()]); \ No newline at end of file diff --git a/entity/Productprice_entity/Productprice_entity.aod b/entity/Productprice_entity/Productprice_entity.aod index f1f3f109b920bef5c6d2ffe7b6197ee526609eeb..9aff525cbe0da3f68ee53d578251adfa679a21d1 100644 --- a/entity/Productprice_entity/Productprice_entity.aod +++ b/entity/Productprice_entity/Productprice_entity.aod @@ -17,6 +17,7 @@ <title>PP/SP</title> <mandatory v="true" /> <dropDownProcess>%aditoprj%/entity/Productprice_entity/entityfields/buysell/dropDownProcess.js</dropDownProcess> + <stateProcess>%aditoprj%/entity/Productprice_entity/entityfields/buysell/stateProcess.js</stateProcess> <valueProcess>%aditoprj%/entity/Productprice_entity/entityfields/buysell/valueProcess.js</valueProcess> </entityField> <entityField> @@ -91,6 +92,7 @@ <outputFormat>#,##0.00</outputFormat> <inputFormat>#,##0.00</inputFormat> <mandatory v="true" /> + <stateProcess>%aditoprj%/entity/Productprice_entity/entityfields/vat/stateProcess.js</stateProcess> <valueProcess>%aditoprj%/entity/Productprice_entity/entityfields/vat/valueProcess.js</valueProcess> <onValidation>%aditoprj%/entity/Productprice_entity/entityfields/vat/onValidation.js</onValidation> </entityField> diff --git a/entity/Productprice_entity/entityfields/buysell/stateProcess.js b/entity/Productprice_entity/entityfields/buysell/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..980235b375c67faab9281318115fd7e31b4ec151 --- /dev/null +++ b/entity/Productprice_entity/entityfields/buysell/stateProcess.js @@ -0,0 +1,8 @@ +import("system.neon"); +import("system.vars"); +import("system.result"); + +if (vars.get("$field.CONTACT_ID")) + result.string(neon.COMPONENTSTATE_READONLY); +else + result.string(neon.COMPONENTSTATE_EDITABLE); \ No newline at end of file diff --git a/entity/Productprice_entity/entityfields/buysell/valueProcess.js b/entity/Productprice_entity/entityfields/buysell/valueProcess.js index 01ee58248bff468509662ad0996dbe1677f50c87..0da2dddbb8cd6a989dad5ff2b55f813770d0887e 100644 --- a/entity/Productprice_entity/entityfields/buysell/valueProcess.js +++ b/entity/Productprice_entity/entityfields/buysell/valueProcess.js @@ -2,5 +2,5 @@ import("system.vars"); import("system.result"); import("system.neon"); -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value")) +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null) result.string("SP"); \ No newline at end of file diff --git a/entity/Productprice_entity/entityfields/contact_id/valueProcess.js b/entity/Productprice_entity/entityfields/contact_id/valueProcess.js index e9e20dba72e7a1820ad9d7b7b8570e58631f30dd..ebfa36528a52773185f164d4ecd96bc17b6e4a80 100644 --- a/entity/Productprice_entity/entityfields/contact_id/valueProcess.js +++ b/entity/Productprice_entity/entityfields/contact_id/valueProcess.js @@ -4,7 +4,7 @@ import("system.vars"); if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) { - if(vars.exists("$param.ContactId_param") && vars.get("$param.ContactId_param") != "") + if(vars.exists("$param.ContactId_param") && vars.get("$param.ContactId_param")) result.string(vars.get("$param.ContactId_param")); } diff --git a/entity/Productprice_entity/entityfields/pricelist/displayValueProcess.js b/entity/Productprice_entity/entityfields/pricelist/displayValueProcess.js index 96cfba0a256a31f864715f71bc0016b2248878df..7a3a89b39d202c168a9daa1ec7cfeced91144ce3 100644 --- a/entity/Productprice_entity/entityfields/pricelist/displayValueProcess.js +++ b/entity/Productprice_entity/entityfields/pricelist/displayValueProcess.js @@ -8,7 +8,7 @@ import("system.text"); import("KeywordRegistry_basic"); var pricelistname = vars.get("$field.PRICELIST"); -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW && !pricelistname) +if (!pricelistname) { var preparedStatement = SqlCondition.begin().andPrepare("CONTACT.CONTACTID", vars.get("$field.CONTACT_ID")); var dbresult = preparedStatement.buildSql("select ORGANISATION.NAME from CONTACT inner join ORGANISATION on CONTACT.ORGANISATION_ID=ORGANISATION.ORGANISATIONID", "1=2", "order by NAME"); diff --git a/entity/Productprice_entity/entityfields/pricelist/stateProcess.js b/entity/Productprice_entity/entityfields/pricelist/stateProcess.js index 5dee6ef7d089d4e2ddb435f2fac536d133500fb1..6f9cb1641974987d696a5dccea4428bc190d2cde 100644 --- a/entity/Productprice_entity/entityfields/pricelist/stateProcess.js +++ b/entity/Productprice_entity/entityfields/pricelist/stateProcess.js @@ -2,7 +2,7 @@ import("system.vars"); import("system.result"); import("system.neon"); -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$field.CONTACT_ID") != "") - result.string("READONLY"); //invisible +if (vars.get("$field.CONTACT_ID")) + result.string(neon.COMPONENTSTATE_READONLY); //invisible else - result.string("EDITABLE"); + result.string(neon.COMPONENTSTATE_EDITABLE); diff --git a/entity/Productprice_entity/entityfields/pricelist/valueProcess.js b/entity/Productprice_entity/entityfields/pricelist/valueProcess.js index 02f050e0d94e76f13b349e68c5582aa8be78e031..deff487595e534b9934221494c1573b9b758980f 100644 --- a/entity/Productprice_entity/entityfields/pricelist/valueProcess.js +++ b/entity/Productprice_entity/entityfields/pricelist/valueProcess.js @@ -3,7 +3,5 @@ import("system.neon"); import("system.vars"); import("KeywordRegistry_basic"); -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) -{ - result.string($KeywordRegistry.productPricelist$standardList()); -} \ No newline at end of file +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$field.CONTACT_ID")) + result.string($KeywordRegistry.productPricelist$standardList()); \ No newline at end of file diff --git a/entity/Productprice_entity/entityfields/vat/stateProcess.js b/entity/Productprice_entity/entityfields/vat/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..980235b375c67faab9281318115fd7e31b4ec151 --- /dev/null +++ b/entity/Productprice_entity/entityfields/vat/stateProcess.js @@ -0,0 +1,8 @@ +import("system.neon"); +import("system.vars"); +import("system.result"); + +if (vars.get("$field.CONTACT_ID")) + result.string(neon.COMPONENTSTATE_READONLY); +else + result.string(neon.COMPONENTSTATE_EDITABLE); \ No newline at end of file diff --git a/entity/Productprice_entity/entityfields/vat/valueProcess.js b/entity/Productprice_entity/entityfields/vat/valueProcess.js index 6a149abd471bbbe7fe5a7b63a8a15b98e43ff89d..98c06869e1502756cb5749aaa1447932d3c44bff 100644 --- a/entity/Productprice_entity/entityfields/vat/valueProcess.js +++ b/entity/Productprice_entity/entityfields/vat/valueProcess.js @@ -1,6 +1,16 @@ +import("Product_lib"); import("system.vars"); import("system.result"); import("system.neon"); -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null) - result.string("0"); \ No newline at end of file + // '!+' -> "0", "", 0 will result in false +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !+vars.get("$this.value")) +{ + if (vars.get("$field.PRODUCT_ID")) + { + var price = ProductUtils.getCurrentProductPrice(vars.get("$field.PRODUCT_ID"), "SP", true); + result.string(price[2] || "0"); + } + else + result.string("0"); +} \ No newline at end of file diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index d1eadd3c4ef4182054a9be5997b4fb6c1ec08eef..5f7a544ec344f5de8353d2c96732a976ceb25d78 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -4397,7 +4397,8 @@ <key>Required fields</key> </entry> <entry> - <key>Address addition</key> + <key>Address addition</key> + <value>Adresszusatz</value> </entry> <entry> <key>the \"%0\" table is configured to get logged but this is the logging-stoarge itself and cannot be monitored</key> diff --git a/neonView/AddressList_view/AddressList_view.aod b/neonView/AddressList_view/AddressList_view.aod index f108e9adc2318366a3c02887429e9b4d44f799eb..10095234b558f9901fbf2462387c9117b99826dc 100644 --- a/neonView/AddressList_view/AddressList_view.aod +++ b/neonView/AddressList_view/AddressList_view.aod @@ -50,6 +50,10 @@ <name>935bcecf-fdd9-4e82-a53f-3c3082c85340</name> <entityField>BUILDINGNO</entityField> </neonTableColumn> + <neonTableColumn> + <name>6e369a01-965f-41d9-9b0a-6128a3827e47</name> + <entityField>ADDRESSADDITION</entityField> + </neonTableColumn> <neonTableColumn> <name>6af52273-25bf-4286-83cc-217aea94ad09</name> <entityField>ADDRIDENTIFIER</entityField> diff --git a/neonView/AddressLookup_view/AddressLookup_view.aod b/neonView/AddressLookup_view/AddressLookup_view.aod index de556c1bcfd64f959c15a8dc17e00dda7fd57205..c6053b4adbd4b46642c61ed37098b62f354ee477 100644 --- a/neonView/AddressLookup_view/AddressLookup_view.aod +++ b/neonView/AddressLookup_view/AddressLookup_view.aod @@ -48,6 +48,10 @@ <name>9651a718-ab01-4c97-8da0-6e7133f26466</name> <entityField>REGION</entityField> </neonTableColumn> + <neonTableColumn> + <name>9a5b1c97-c2b5-4f3a-b845-7cf56c0cb4eb</name> + <entityField>ADDRESSADDITION</entityField> + </neonTableColumn> <neonTableColumn> <name>24f73ac8-ac90-4beb-83fe-bdaa2d0806b6</name> <entityField>ADDRIDENTIFIER</entityField> diff --git a/neonView/AdressMultiEdit_view/AdressMultiEdit_view.aod b/neonView/AdressMultiEdit_view/AdressMultiEdit_view.aod index 92c6d10ee43549b6440cf480efc47c16f40c98f3..e7a369269f249718e54c683682892202a415a3b0 100644 --- a/neonView/AdressMultiEdit_view/AdressMultiEdit_view.aod +++ b/neonView/AdressMultiEdit_view/AdressMultiEdit_view.aod @@ -50,6 +50,10 @@ <name>61261845-740e-4f4b-a1f8-5e6aeac2deba</name> <entityField>BUILDINGNO</entityField> </neonTableColumn> + <neonTableColumn> + <name>37df9198-cb7b-4080-a040-21ed32e26948</name> + <entityField>ADDRESSADDITION</entityField> + </neonTableColumn> <neonTableColumn> <name>443b9d7d-dac2-40b2-bb2b-d5e0091877a9</name> <entityField>ADDRIDENTIFIER</entityField> diff --git a/process/Product_lib/process.js b/process/Product_lib/process.js index 2a6a2343c21c61db089af4231d0a5f1780b6cef0..979fa29aa2c359791721559fd5afc0fa55206b5c 100644 --- a/process/Product_lib/process.js +++ b/process/Product_lib/process.js @@ -28,7 +28,7 @@ function ProductUtils() {} * * @example productUtils.getCurrentProductPrice(vars.get("$field.PRODUCTID"), "PP") * - * @return {Array[]} currently valid product price with currency: [price, "CURRENCY"] or [] if no price found + * @return {Array[]} currently valid product price with currency: [price, "CURRENCY", "VAT"] or [] if no price found */ ProductUtils.getCurrentProductPrice = function(pid, buySell, onlyStandard) { if (pid != undefined && pid != "" && buySell != undefined && buySell != "") @@ -48,10 +48,10 @@ ProductUtils.getCurrentProductPrice = function(pid, buySell, onlyStandard) { .orPrepare("PRODUCTPRICE.VALID_TO", today, "# >= ?") .or("PRODUCTPRICE.VALID_TO is null"), "1 = 2"); - var productPriceData = db.array(db.ROW, actualPriceCondition.buildSql("select PRICE, CURRENCY from PRODUCTPRICE", "1 = 2", "order by VALID_FROM desc")); + var productPriceData = db.array(db.ROW, actualPriceCondition.buildSql("select PRICE, CURRENCY, VAT from PRODUCTPRICE", "1 = 2", "order by VALID_FROM desc")); if (productPriceData[0] && productPriceData[1]) - return [productPriceData[0], KeywordUtils.getViewValue($KeywordRegistry.currency(), productPriceData[1])]; + return [productPriceData[0], KeywordUtils.getViewValue($KeywordRegistry.currency(), productPriceData[1]), productPriceData[2]]; else return []; } else {