Search in sources :

Example 1 with IHUStatusBL

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);
}
Also used : IADReferenceDAO(org.adempiere.ad.service.IADReferenceDAO) IHUStatusBL(de.metas.handlingunits.IHUStatusBL)

Aggregations

IHUStatusBL (de.metas.handlingunits.IHUStatusBL)1 IADReferenceDAO (org.adempiere.ad.service.IADReferenceDAO)1