use of de.metas.handlingunits.reservation.ReserveHUsRequest in project metasfresh-webui-api by metasfresh.
the class WEBUI_C_OrderLineSO_Make_HUReservation method doIt.
@Override
protected String doIt() {
final SalesOrderLine salesOrderLine = WEBUI_C_OrderLineSO_Util.retrieveSalesOrderLine(getView(), salesOrderLineRepository).get();
final ImmutableList<HuId> selectedHuIds = streamSelectedHUIds(Select.ALL).collect(ImmutableList.toImmutableList());
if (selectedHuIds.isEmpty()) {
throw new AdempiereException("@NoSelection@");
}
final Quantity qtyToReserve = Quantity.of(qtyToReserveBD, salesOrderLine.getOrderedQty().getUOM());
final ReserveHUsRequest reservationRequest = ReserveHUsRequest.builder().huIds(selectedHuIds).productId(salesOrderLine.getProductId()).qtyToReserve(qtyToReserve).salesOrderLineId(salesOrderLine.getId().getOrderLineId()).build();
huReservationService.makeReservation(reservationRequest);
return MSG_OK;
}
Aggregations