From ab5e951107b1f08850ba5abd4ef354d51a7e3067 Mon Sep 17 00:00:00 2001 From: "p.neub" <p.neub@adito.de> Date: Tue, 6 Apr 2021 09:45:32 +0200 Subject: [PATCH] =?UTF-8?q?[Projekt:=20xRM-Sales][TicketNr.:=201075968][Pr?= =?UTF-8?q?eise=20in=20Fremdw=C3=A4hrung=20werden=20nicht=20ins=20Angebot?= =?UTF-8?q?=20=C3=BCbernommen]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entityfields/currency/stateProcess.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/entity/Offer_entity/entityfields/currency/stateProcess.js b/entity/Offer_entity/entityfields/currency/stateProcess.js index 3625a84172..20a5979a75 100644 --- a/entity/Offer_entity/entityfields/currency/stateProcess.js +++ b/entity/Offer_entity/entityfields/currency/stateProcess.js @@ -2,5 +2,18 @@ import("system.vars"); import("system.result"); import("system.neon"); import("Offer_lib"); +import("system.entities"); -result.string(OfferUtils.isEditable(vars.get("$field.STATUS")) ? neon.COMPONENTSTATE_AUTO : neon.COMPONENTSTATE_DISABLED); \ No newline at end of file +var loadConfig = entities.createConfigForLoadingRows() + .entity("OfferItem_entity") + .addParameter("OfferId_param", vars.get("$field.OFFERID")); +var offerItemCount = entities.getRowCount(loadConfig); + +if(offerItemCount > 0) +{ + result.string(neon.COMPONENTSTATE_DISABLED); +} +else +{ + result.string(OfferUtils.isEditable(vars.get("$field.STATUS")) ? neon.COMPONENTSTATE_AUTO : neon.COMPONENTSTATE_DISABLED); +} -- GitLab