Skip to content

Commit

Permalink
set PPOrderLine icons
Browse files Browse the repository at this point in the history
  • Loading branch information
teosarca committed Apr 25, 2017
1 parent 7dc9f9f commit b2e7906
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/main/java/de/metas/ui/web/pporder/PPOrderLineType.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) //
Expand All @@ -46,19 +46,28 @@ 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)
{
this.name = huType.getName();
this.iconName = huType.getIconName();
this.huDocumentViewType = huType;

canReceive = false;
canIssue = false;
}

@Override
Expand All @@ -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)
Expand Down

0 comments on commit b2e7906

Please sign in to comment.