From b2e79067da9e885a1b33b019f1d37930392b6345 Mon Sep 17 00:00:00 2001 From: Teo Sarca Date: Tue, 25 Apr 2017 15:44:13 +0300 Subject: [PATCH] set PPOrderLine icons as described on https://github.com/metasfresh/metasfresh-webui-frontend/issues/675#issuecomment-297016790 --- .../metas/ui/web/pporder/PPOrderLineType.java | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/main/java/de/metas/ui/web/pporder/PPOrderLineType.java b/src/main/java/de/metas/ui/web/pporder/PPOrderLineType.java index 7afe2d5bc..be138460f 100644 --- a/src/main/java/de/metas/ui/web/pporder/PPOrderLineType.java +++ b/src/main/java/de/metas/ui/web/pporder/PPOrderLineType.java @@ -33,9 +33,9 @@ public enum PPOrderLineType implements IDocumentViewType { - MainProduct("MP") // - , BOMLine_Component("CO") // - , BOMLine_ByCoProduct("BY") // + MainProduct("MP", true) // + , BOMLine_Component("CO", false) // + , BOMLine_ByCoProduct("BY", true) // // , HU_LU(HUDocumentViewType.LU) // , HU_TU(HUDocumentViewType.TU) // @@ -46,12 +46,18 @@ public enum PPOrderLineType implements IDocumentViewType private final String name; private final String iconName; private final HUDocumentViewType huDocumentViewType; + + private final boolean canReceive; + private final boolean canIssue; - private PPOrderLineType(final String name) + private PPOrderLineType(final String name, final boolean canReceive) { this.name = name; - this.iconName = HUDocumentViewType.LU.getIconName(); // FIXME: just use the LU icon for now + this.iconName = canReceive ? "PP_Order_Receive" : "PP_Order_Issue"; // see https://github.com/metasfresh/metasfresh-webui-frontend/issues/675#issuecomment-297016790 this.huDocumentViewType = null; + + this.canReceive = canReceive; + this.canIssue = !canReceive; } private PPOrderLineType(HUDocumentViewType huType) @@ -59,6 +65,9 @@ private PPOrderLineType(HUDocumentViewType huType) this.name = huType.getName(); this.iconName = huType.getIconName(); this.huDocumentViewType = huType; + + canReceive = false; + canIssue = false; } @Override @@ -80,12 +89,12 @@ public static final PPOrderLineType cast(final IDocumentViewType type) public boolean canReceive() { - return MainProduct == this || BOMLine_ByCoProduct == this; + return canReceive; } public boolean canIssue() { - return BOMLine_Component == this; + return canIssue; } public static final PPOrderLineType ofHUDocumentViewType(final HUDocumentViewType huType)