use of de.metas.handlingunits.IHUStatusBL in project metasfresh-webui-api by metasfresh.
the class SqlHUEditorViewRepository method createHUStatusDisplayLookupValue.
private static JSONLookupValue createHUStatusDisplayLookupValue(@NonNull final I_M_HU hu) {
final IHUStatusBL huStatusBL = Services.get(IHUStatusBL.class);
final String huStatusKey;
final String huStatusDisplayName;
if (// if e.g. a reserved HU was shipped, it shall be shown as "shipped" not "reserved"
hu.isReserved() && huStatusBL.isPhysicalHU(hu)) {
huStatusKey = MSG_HU_RESERVED;
huStatusDisplayName = Services.get(IMsgBL.class).getMsg(Env.getCtx(), huStatusKey);
} else {
final IADReferenceDAO adReferenceDAO = Services.get(IADReferenceDAO.class);
huStatusKey = hu.getHUStatus();
huStatusDisplayName = adReferenceDAO.retrieveListNameTrl(X_M_HU.HUSTATUS_AD_Reference_ID, huStatusKey);
}
return JSONLookupValue.of(huStatusKey, huStatusDisplayName);
}
Aggregations