diff --git a/entity/Productprice_entity/entityfields/currency/valueProcess.js b/entity/Productprice_entity/entityfields/currency/valueProcess.js index f07b41ba6feeb577ba324ece8c0be4a29387d888..7b9758eece838fc7690866c7ba831802a1e180ab 100644 --- a/entity/Productprice_entity/entityfields/currency/valueProcess.js +++ b/entity/Productprice_entity/entityfields/currency/valueProcess.js @@ -3,7 +3,7 @@ import("system.neon"); import("system.vars"); import("KeywordRegistry_basic"); -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null) { result.string($KeywordRegistry.currency$eur()); } \ No newline at end of file diff --git a/entity/Productprice_entity/entityfields/fromquantity/valueProcess.js b/entity/Productprice_entity/entityfields/fromquantity/valueProcess.js index d471ab772a44717ed2cc4dab0d9314ad3b2b1d74..e216f703872113ba24531698c8c5935cf890b685 100644 --- a/entity/Productprice_entity/entityfields/fromquantity/valueProcess.js +++ b/entity/Productprice_entity/entityfields/fromquantity/valueProcess.js @@ -3,6 +3,4 @@ import("system.result"); import("system.neon"); if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value")) - result.string("1"); -else - result.string(vars.get("$this.value")); \ No newline at end of file + result.string("1"); \ No newline at end of file diff --git a/entity/Productprice_entity/entityfields/pricelist/valueProcess.js b/entity/Productprice_entity/entityfields/pricelist/valueProcess.js index deff487595e534b9934221494c1573b9b758980f..5e19924138c7b1be48daf411660ba65980deca24 100644 --- a/entity/Productprice_entity/entityfields/pricelist/valueProcess.js +++ b/entity/Productprice_entity/entityfields/pricelist/valueProcess.js @@ -3,5 +3,5 @@ import("system.neon"); import("system.vars"); import("KeywordRegistry_basic"); -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$field.CONTACT_ID")) +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$field.CONTACT_ID") && vars.get("$this.value") == null) result.string($KeywordRegistry.productPricelist$standardList()); \ No newline at end of file diff --git a/entity/Productprice_entity/entityfields/product_id/valueProcess.js b/entity/Productprice_entity/entityfields/product_id/valueProcess.js index bb3ee6de138992e53d180ea512defaa60975e6c2..99cbed8d31968136304c0f94b686708aea34a84e 100644 --- a/entity/Productprice_entity/entityfields/product_id/valueProcess.js +++ b/entity/Productprice_entity/entityfields/product_id/valueProcess.js @@ -1,7 +1,7 @@ import("system.result"); import("system.vars"); -if(vars.exists("$param.ProductId_param") && vars.get("$param.ProductId_param")) +if(vars.exists("$param.ProductId_param") && vars.get("$param.ProductId_param") && vars.get("$this.value") == null) { result.string(vars.getString("$param.ProductId_param")); } \ 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 98c06869e1502756cb5749aaa1447932d3c44bff..20e9d87a63c30b2ad2bf4937fcf74160202978c8 100644 --- a/entity/Productprice_entity/entityfields/vat/valueProcess.js +++ b/entity/Productprice_entity/entityfields/vat/valueProcess.js @@ -3,8 +3,7 @@ import("system.vars"); import("system.result"); import("system.neon"); - // '!+' -> "0", "", 0 will result in false -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) { if (vars.get("$field.PRODUCT_ID")) { diff --git a/entity/Productprice_entity/onValidation.js b/entity/Productprice_entity/onValidation.js index fddde143c2d4bb6186ae78d6032f09866ff77610..2f63d928b700c2bdaeead263bf14265f93b4a6ab 100644 --- a/entity/Productprice_entity/onValidation.js +++ b/entity/Productprice_entity/onValidation.js @@ -1,3 +1,4 @@ +import("system.logging"); import("Product_lib"); import("system.translate"); import("system.result"); @@ -22,7 +23,7 @@ var priceList = { validFrom: vars.get("$field.VALID_FROM"), validTo: vars.get("$field.VALID_TO") }; - +logging.log(JSON.stringify([priceList], null, "\t")) var identicalPriceList = ProductUtils.checkForIndenticalPriceLists(vars.get("$field.PRODUCT_ID"), priceList); if(identicalPriceList != null) {