use of de.metas.ui.web.order.products_proposal.model.ProductsProposalRow in project metasfresh-webui-api by metasfresh.
the class WEBUI_ProductsProposal_ShowProductsSoldToOtherCustomers method doIt.
@Override
protected String doIt() {
final ProductsProposalView view = getView();
final List<ProductsProposalRow> selectedRows = getSelectedRows();
final ProductsProposalView otherSalesPricesView = otherSalePricesProductsProposalViewFactory.createView(view, selectedRows);
afterCloseOpenView(otherSalesPricesView.getViewId());
return MSG_OK;
}
use of de.metas.ui.web.order.products_proposal.model.ProductsProposalRow in project metasfresh-webui-api by metasfresh.
the class OrderLinesFromProductProposalsProducer method produceInTrx.
private void produceInTrx() {
final Properties ctx = Env.getCtx();
final I_C_Order order = ordersRepo.getById(orderId);
final ImmutableMap<OrderLineId, I_C_OrderLine> existingOrderLines = Maps.uniqueIndex(ordersRepo.retrieveOrderLines(orderId, I_C_OrderLine.class), orderLineRecord -> OrderLineId.ofRepoId(orderLineRecord.getC_OrderLine_ID()));
for (final ProductsProposalRow row : rows) {
final I_C_OrderLine existingOrderLine = row.getExistingOrderLineId() != null ? existingOrderLines.get(row.getExistingOrderLineId()) : null;
if (existingOrderLine == null) {
if (row.isQtySet()) {
OrderFastInput.addOrderLine(ctx, order, orderLine -> updateOrderLine(order, orderLine, row));
} else {
// if qty is not set, don't create the row
}
} else {
if (row.isQtySet()) {
updateOrderLine(order, existingOrderLine, row);
ordersRepo.save(existingOrderLine);
} else {
ordersRepo.delete(existingOrderLine);
}
}
}
}
Aggregations