use of de.metas.handlingunits.IHUPIItemProductDAO in project metasfresh-webui-api by metasfresh.
the class PackingInfoProcessParams method getDefaultLUTUConfig.
public I_M_HU_LUTU_Configuration getDefaultLUTUConfig() {
if (_defaultLUTUConfig == null) {
final I_M_HU_LUTU_Configuration defaultLUTUConfig = defaultLUTUConfigManager.getCreateLUTUConfiguration();
// Apply adjustment rules to default LU/TU config
if (enforceOneLUorTU) {
adjustDefaultLUTUConfig_EnforceOneLUorTU(defaultLUTUConfig, enforceAvailableQtyTU);
} else if (enforceAvailableQtyTU != null) {
// IMPORTANT: this rule shall be applied if not enforceOneLUorTU
adjustDefaultLUTUConfig_EnforceAvailableTUs(defaultLUTUConfig, enforceAvailableQtyTU);
}
if (enforcePhysicalTU) {
// check if we need to do something
boolean needToFallback;
if (defaultLUTUConfig.getM_HU_PI_Item_Product_ID() <= 0) {
// no piip specified at all
needToFallback = true;
} else {
// check if the piip that we got is the virtual one. If yes, we need to fallback
final IHUPIItemProductDAO hupiItemProductDAO = Services.get(IHUPIItemProductDAO.class);
needToFallback = defaultLUTUConfig.getM_HU_PI_Item_Product_ID() == hupiItemProductDAO.retrieveVirtualPIMaterialItemProduct(Env.getCtx()).getM_HU_PI_Item_Product_ID();
}
if (needToFallback) {
insertPhysicalFallbackTU(defaultLUTUConfig);
}
}
// Make sure nobody is overriding the existing configuration
if (defaultLUTUConfig.getM_HU_LUTU_Configuration_ID() > 0) {
InterfaceWrapperHelper.setSaveDeleteDisabled(defaultLUTUConfig, true);
}
_defaultLUTUConfig = defaultLUTUConfig;
}
return _defaultLUTUConfig;
}
use of de.metas.handlingunits.IHUPIItemProductDAO in project metasfresh-webui-api by metasfresh.
the class WEBUI_ProcessHelper method retrieveHUPIItemProductRecords.
public List<I_M_HU_PI_Item_Product> retrieveHUPIItemProductRecords(@NonNull final Properties ctx, @NonNull final I_M_Product product, @Nullable final I_C_BPartner bPartner, final boolean includeVirtualItem) {
final IHUPIItemProductDAO hupiItemProductDAO = Services.get(IHUPIItemProductDAO.class);
final ISysConfigBL sysConfigBL = Services.get(ISysConfigBL.class);
final boolean allowInfiniteCapacity = sysConfigBL.getBooleanValue(SYSCONFIG_ALLOW_INFINIT_CAPACITY_TUS, true, Env.getAD_Client_ID(ctx), Env.getAD_Org_ID(ctx));
final List<I_M_HU_PI_Item_Product> list = hupiItemProductDAO.retrieveTUs(ctx, product, bPartner, allowInfiniteCapacity);
if (includeVirtualItem) {
list.add(hupiItemProductDAO.retrieveVirtualPIMaterialItemProduct(ctx));
}
return list;
}
Aggregations