Search in sources :

Example 16 with ShipmentScheduleId

use of de.metas.inoutcandidate.api.ShipmentScheduleId in project metasfresh-webui-api by metasfresh.

the class WEBUI_Picking_HUEditor_Launcher method createHUsToPickView.

private IView createHUsToPickView() {
    final PickingSlotView pickingSlotsView = getView();
    final PickingSlotRowId pickingSlotRowId = getSingleSelectedRow().getPickingSlotRowId();
    final ViewId pickingSlotViewId = pickingSlotsView.getViewId();
    final ShipmentScheduleId shipmentScheduleId = pickingSlotsView.getCurrentShipmentScheduleId();
    final CreateViewRequest createRequest = husToPickViewFactory.createViewRequest(pickingSlotViewId, pickingSlotRowId, shipmentScheduleId);
    final IView husToPickView = viewsRepo.createView(createRequest);
    return husToPickView;
}
Also used : PickingSlotRowId(de.metas.ui.web.picking.pickingslot.PickingSlotRowId) IView(de.metas.ui.web.view.IView) PickingSlotView(de.metas.ui.web.picking.pickingslot.PickingSlotView) ViewId(de.metas.ui.web.view.ViewId) ShipmentScheduleId(de.metas.inoutcandidate.api.ShipmentScheduleId) CreateViewRequest(de.metas.ui.web.view.CreateViewRequest)

Example 17 with ShipmentScheduleId

use of de.metas.inoutcandidate.api.ShipmentScheduleId in project metasfresh-webui-api by metasfresh.

the class WEBUI_HUsToPick_PickCU method autoProcessPicking.

private void autoProcessPicking(final HuId splitCUId) {
    final ShipmentScheduleId shipmentScheduleId = null;
    pickingCandidateService.processForHUIds(ImmutableSet.of(splitCUId), shipmentScheduleId);
}
Also used : ShipmentScheduleId(de.metas.inoutcandidate.api.ShipmentScheduleId)

Example 18 with ShipmentScheduleId

use of de.metas.inoutcandidate.api.ShipmentScheduleId in project metasfresh-webui-api by metasfresh.

the class PickingHURowsRepositoryTest method testRetrieveActiveSourceHusQuery_fromShipmentSchedules.

@Test
public void testRetrieveActiveSourceHusQuery_fromShipmentSchedules() {
    final WarehouseId warehouseId = createWarehouse();
    final ProductId productId = createProduct();
    final ShipmentScheduleId shipmentScheduleId1 = createShipmentSchedule(warehouseId, productId);
    final ShipmentScheduleId shipmentScheduleId2 = createShipmentSchedule(warehouseId, productId);
    final MatchingSourceHusQuery query = PickingHURowsRepository.createMatchingSourceHusQuery(PickingSlotRepoQuery.builder().currentShipmentScheduleId(shipmentScheduleId1).shipmentScheduleId(shipmentScheduleId1).shipmentScheduleId(shipmentScheduleId2).build());
    assertThat(query.getWarehouseId()).isEqualTo(warehouseId);
    assertThat(query.getProductIds()).containsExactly(productId);
}
Also used : MatchingSourceHusQuery(de.metas.handlingunits.sourcehu.SourceHUsService.MatchingSourceHusQuery) ShipmentScheduleId(de.metas.inoutcandidate.api.ShipmentScheduleId) ProductId(de.metas.product.ProductId) WarehouseId(org.adempiere.warehouse.WarehouseId) Test(org.junit.jupiter.api.Test)

Example 19 with ShipmentScheduleId

use of de.metas.inoutcandidate.api.ShipmentScheduleId in project metasfresh-webui-api by metasfresh.

the class PickingSlotViewRepositoryTests method testRetrievePickingSlotRows_No_HUs_show_PickingSlotsOnly.

/**
 * Verifies {@link PickingSlotViewRepository#retrieveRows(PickingSlotRepoQuery)}<br>
 * when there are no HUs (no picking candidates) assigned to a picking slot, but still the picking slot itself shall be shown.
 */
@Test
public void testRetrievePickingSlotRows_No_HUs_show_PickingSlotsOnly() {
    final ShipmentScheduleId shipmentScheduleId = createShipmentSchedule();
    createPickingSlot(pickingSlot -> {
        pickingSlot.setIsPickingRackSystem(true);
    });
    Mockito.when(pickingHUsRepo.retrievePickedHUsIndexedByPickingSlotId(PickingCandidatesQuery.builder().shipmentScheduleId(shipmentScheduleId).onlyNotClosedOrNotRackSystem(true).build())).thenReturn(ImmutableListMultimap.of());
    final PickingSlotViewRepository pickingSlotViewRepository = createPickingSlotViewRepository();
    final PickingSlotRepoQuery query = PickingSlotRepoQuery.of(shipmentScheduleId);
    final List<PickingSlotRow> pickingSlotRows = pickingSlotViewRepository.retrievePickingSlotRows(query);
    // even if there are no HUs, there shall still be a row for our picking slot.
    assertThat(pickingSlotRows).hasSize(1);
    final PickingSlotRow pickingSlotRow = pickingSlotRows.get(0);
    assertThat(pickingSlotRow.getType()).isEqualTo(PickingSlotRowType.forPickingSlotRow());
}
Also used : ShipmentScheduleId(de.metas.inoutcandidate.api.ShipmentScheduleId) Test(org.junit.jupiter.api.Test)

Aggregations

ShipmentScheduleId (de.metas.inoutcandidate.api.ShipmentScheduleId)19 ViewId (de.metas.ui.web.view.ViewId)5 I_M_ShipmentSchedule (de.metas.handlingunits.model.I_M_ShipmentSchedule)3 IShipmentSchedulePA (de.metas.inoutcandidate.api.IShipmentSchedulePA)3 PickingSlotId (de.metas.picking.api.PickingSlotId)3 ProductId (de.metas.product.ProductId)3 Test (org.junit.jupiter.api.Test)3 HuId (de.metas.handlingunits.HuId)2 IShipmentScheduleEffectiveBL (de.metas.inoutcandidate.api.IShipmentScheduleEffectiveBL)2 PickingSlotRow (de.metas.ui.web.picking.pickingslot.PickingSlotRow)2 PickingSlotView (de.metas.ui.web.picking.pickingslot.PickingSlotView)2 CreateViewRequest (de.metas.ui.web.view.CreateViewRequest)2 DocumentId (de.metas.ui.web.window.datatypes.DocumentId)2 WarehouseId (org.adempiere.warehouse.WarehouseId)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableListMultimap (com.google.common.collect.ImmutableListMultimap)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 ListMultimap (com.google.common.collect.ListMultimap)1 BPartnerId (de.metas.bpartner.BPartnerId)1