Search in sources :

Example 1 with I_M_Locator

use of org.compiere.model.I_M_Locator in project metasfresh-webui-api by metasfresh.

the class WEBUI_Picking_PickQtyToNewHU method createAndAddHU.

private I_M_HU createAndAddHU(@NonNull final PickingSlotRow pickingSlotRow) {
    final I_M_Locator pickingSlotLocator = getPickingSlotLocator(pickingSlotRow);
    // Create a new empty TU
    final I_M_HU hu = createTU(huPIItemProduct, pickingSlotLocator);
    // Add the TU to picking slot (as candidate)
    final int pickingSlotId = pickingSlotRow.getPickingSlotId();
    final int shipmentScheduleId = getView().getCurrentShipmentScheduleId();
    pickingCandidateService.addHUToPickingSlot(hu.getM_HU_ID(), pickingSlotId, shipmentScheduleId);
    return hu;
}
Also used : I_M_HU(de.metas.handlingunits.model.I_M_HU) I_M_Locator(org.compiere.model.I_M_Locator)

Example 2 with I_M_Locator

use of org.compiere.model.I_M_Locator in project metasfresh-webui-api by metasfresh.

the class WEBUI_Picking_PickQtyToNewHU method getPickingSlotLocator.

private static final I_M_Locator getPickingSlotLocator(final PickingSlotRow pickingSlotRow) {
    final int pickingSlotWarehouseId = pickingSlotRow.getPickingSlotWarehouseId();
    if (pickingSlotWarehouseId <= 0) {
        throw new AdempiereException("Picking slot with M_PickingSlot_ID=" + pickingSlotRow.getPickingSlotId() + " has no warehouse configured");
    }
    final I_M_Warehouse pickingSlotWarehouse = InterfaceWrapperHelper.loadOutOfTrx(pickingSlotWarehouseId, I_M_Warehouse.class);
    final I_M_Locator pickingSlotLocator = Services.get(IWarehouseBL.class).getDefaultLocator(pickingSlotWarehouse);
    return pickingSlotLocator;
}
Also used : AdempiereException(org.adempiere.exceptions.AdempiereException) IWarehouseBL(org.adempiere.warehouse.api.IWarehouseBL) I_M_Warehouse(org.compiere.model.I_M_Warehouse) I_M_Locator(org.compiere.model.I_M_Locator)

Aggregations

I_M_Locator (org.compiere.model.I_M_Locator)2 I_M_HU (de.metas.handlingunits.model.I_M_HU)1 AdempiereException (org.adempiere.exceptions.AdempiereException)1 IWarehouseBL (org.adempiere.warehouse.api.IWarehouseBL)1 I_M_Warehouse (org.compiere.model.I_M_Warehouse)1