use of de.metas.inoutcandidate.api.ShipmentScheduleId in project metasfresh-webui-api by metasfresh.
the class PickingTerminalViewInvalidationAdvisor method findAffectedRowIds.
@Override
public Set<DocumentId> findAffectedRowIds(final TableRecordReferenceSet recordRefs, final IView view) {
final Set<ShipmentScheduleId> shipmentScheduleIds = extractShipmentScheduleIds(recordRefs);
if (shipmentScheduleIds.isEmpty()) {
return ImmutableSet.of();
}
final SqlViewKeyColumnNamesMap keyColumnNamesMap = SqlViewKeyColumnNamesMap.ofIntKeyField(I_M_Packageable_V.COLUMNNAME_M_ShipmentSchedule_ID);
return SqlViewRowIdsOrderedSelectionFactory.retrieveRowIdsForLineIds(keyColumnNamesMap, view.getViewId(), ShipmentScheduleId.toIntSet(shipmentScheduleIds));
}
use of de.metas.inoutcandidate.api.ShipmentScheduleId in project metasfresh-webui-api by metasfresh.
the class PickingTerminalViewInvalidationAdvisor method extractShipmentScheduleIds.
private Set<ShipmentScheduleId> extractShipmentScheduleIds(final TableRecordReferenceSet recordRefs) {
if (recordRefs.isEmpty()) {
return ImmutableSet.of();
}
final Set<ShipmentScheduleId> shipmentScheduleIds = new HashSet<>();
final Set<PickingCandidateId> pickingCandidateIds = new HashSet<>();
for (TableRecordReference recordRef : recordRefs) {
final String tableName = recordRef.getTableName();
if (I_M_ShipmentSchedule.Table_Name.equals(tableName)) {
shipmentScheduleIds.add(ShipmentScheduleId.ofRepoId(recordRef.getRecord_ID()));
} else if (I_M_Picking_Candidate.Table_Name.equals(tableName)) {
pickingCandidateIds.add(PickingCandidateId.ofRepoId(recordRef.getRecord_ID()));
}
}
if (!pickingCandidateIds.isEmpty()) {
shipmentScheduleIds.addAll(pickingCandidateRepository.getShipmentScheduleIdsByPickingCandidateIds(pickingCandidateIds));
}
return shipmentScheduleIds;
}
use of de.metas.inoutcandidate.api.ShipmentScheduleId in project metasfresh-webui-api by metasfresh.
the class WEBUI_Picking_With_M_Source_HU_Base method retrieveQtyToPick.
protected final Quantity retrieveQtyToPick() {
final ShipmentScheduleId shipmentScheduleId = getCurrentShipmentScheduleId();
final I_M_ShipmentSchedule shipmentSchedule = getCurrentShipmentSchedule();
final Quantity qtyToDeliverTarget = Services.get(IShipmentScheduleBL.class).getQtyToDeliver(shipmentSchedule);
final Quantity qtyPickedPlanned = Services.get(IPackagingDAO.class).retrieveQtyPickedPlanned(shipmentScheduleId).orElse(null);
if (qtyPickedPlanned == null) {
return qtyToDeliverTarget.toZero();
}
return qtyToDeliverTarget.subtract(qtyPickedPlanned).toZeroIfNegative();
}
use of de.metas.inoutcandidate.api.ShipmentScheduleId in project metasfresh-webui-api by metasfresh.
the class WEBUI_Picking_M_Picking_Candidate_Process method doIt.
@Override
protected String doIt() throws Exception {
final PickingSlotRow rowToProcess = getSingleSelectedRow();
final ShipmentScheduleId shipmentScheduleId = null;
pickingCandidateService.processForHUIds(ImmutableSet.of(rowToProcess.getHuId()), shipmentScheduleId);
return MSG_OK;
}
use of de.metas.inoutcandidate.api.ShipmentScheduleId in project metasfresh-webui-api by metasfresh.
the class WEBUI_M_HU_Pick method pickHU.
private void pickHU(final HURow row) {
final HuId huId = row.getHuId();
final PickingSlotId pickingSlotId = PickingSlotId.ofRepoId(pickingSlotIdInt);
final ShipmentScheduleId shipmentScheduleId = ShipmentScheduleId.ofRepoId(shipmentScheduleIdInt);
pickingCandidateService.pickHU(PickRequest.builder().shipmentScheduleId(shipmentScheduleId).pickFrom(PickFrom.ofHuId(huId)).pickingSlotId(pickingSlotId).build());
// NOTE: we are not moving the HU to shipment schedule's locator.
pickingCandidateService.processForHUIds(ImmutableSet.of(huId), shipmentScheduleId);
}
Aggregations