use of com.axelor.apps.supplychain.service.SaleOrderLineServiceSupplyChain in project axelor-open-suite by axelor.
the class SaleOrderController method updateStockReservationDate.
/**
* Called from sale order view, on delivery date change. <br>
* Update stock reservation date for each sale order line by calling {@link
* SaleOrderLineServiceSupplyChain#updateStockMoveReservationDateTime(SaleOrderLine)}.
*
* @param request
* @param response
*/
public void updateStockReservationDate(ActionRequest request, ActionResponse response) {
try {
SaleOrder saleOrder = request.getContext().asType(SaleOrder.class);
saleOrder = Beans.get(SaleOrderRepository.class).find(saleOrder.getId());
for (SaleOrderLine saleOrderLine : saleOrder.getSaleOrderLineList()) {
Beans.get(SaleOrderLineServiceSupplyChain.class).updateStockMoveReservationDateTime(saleOrderLine);
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.supplychain.service.SaleOrderLineServiceSupplyChain in project axelor-open-suite by axelor.
the class SaleOrderLineController method checkInvoicedOrDeliveredOrderQty.
public void checkInvoicedOrDeliveredOrderQty(ActionRequest request, ActionResponse response) {
SaleOrderLine saleOrderLine = request.getContext().asType(SaleOrderLine.class);
SaleOrderLineServiceSupplyChain saleOrderLineService = Beans.get(SaleOrderLineServiceSupplyChain.class);
BigDecimal qty = saleOrderLineService.checkInvoicedOrDeliveredOrderQty(saleOrderLine);
saleOrderLineService.updateDeliveryState(saleOrderLine);
response.setValue("qty", qty);
response.setValue("deliveryState", saleOrderLine.getDeliveryState());
}
use of com.axelor.apps.supplychain.service.SaleOrderLineServiceSupplyChain in project axelor-open-suite by axelor.
the class SaleOrderLineController method updateReservationDate.
/**
* Called from sale order line, on desired delivery date change. Call {@link
* SaleOrderLineServiceSupplyChain#updateStockMoveReservationDateTime(SaleOrderLine)}.
*
* @param request
* @param response
*/
public void updateReservationDate(ActionRequest request, ActionResponse response) {
try {
SaleOrderLine saleOrderLine = request.getContext().asType(SaleOrderLine.class);
saleOrderLine = Beans.get(SaleOrderLineRepository.class).find(saleOrderLine.getId());
Beans.get(SaleOrderLineServiceSupplyChain.class).updateStockMoveReservationDateTime(saleOrderLine);
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
Aggregations