Search in sources :

Example 6 with SaleOrderLineService

use of com.axelor.apps.sale.service.saleorder.SaleOrderLineService in project axelor-open-suite by axelor.

the class SaleOrderLineController method computeSubMargin.

public void computeSubMargin(ActionRequest request, ActionResponse response) throws AxelorException {
    Context context = request.getContext();
    SaleOrderLine saleOrderLine = context.asType(SaleOrderLine.class);
    SaleOrderLineService saleOrderLineService = Beans.get(SaleOrderLineService.class);
    SaleOrder saleOrder = saleOrderLineService.getSaleOrder(context);
    saleOrderLine.setSaleOrder(saleOrder);
    Map<String, BigDecimal> map = saleOrderLineService.computeSubMargin(saleOrder, saleOrderLine);
    response.setValues(map);
}
Also used : Context(com.axelor.rpc.Context) SaleOrderLineService(com.axelor.apps.sale.service.saleorder.SaleOrderLineService) SaleOrderLine(com.axelor.apps.sale.db.SaleOrderLine) SaleOrder(com.axelor.apps.sale.db.SaleOrder) BigDecimal(java.math.BigDecimal)

Example 7 with SaleOrderLineService

use of com.axelor.apps.sale.service.saleorder.SaleOrderLineService in project axelor-open-suite by axelor.

the class SaleOrderServiceSupplychainImpl method createShippingCostLine.

@Override
public SaleOrderLine createShippingCostLine(SaleOrder saleOrder, Product shippingCostProduct) throws AxelorException {
    SaleOrderLine shippingCostLine = new SaleOrderLine();
    shippingCostLine.setSaleOrder(saleOrder);
    shippingCostLine.setProduct(shippingCostProduct);
    SaleOrderLineService saleOrderLineService = Beans.get(SaleOrderLineService.class);
    saleOrderLineService.computeProductInformation(shippingCostLine, saleOrder);
    saleOrderLineService.computeValues(saleOrder, shippingCostLine);
    return shippingCostLine;
}
Also used : SaleOrderLineService(com.axelor.apps.sale.service.saleorder.SaleOrderLineService) SaleOrderLine(com.axelor.apps.sale.db.SaleOrderLine)

Aggregations

SaleOrderLine (com.axelor.apps.sale.db.SaleOrderLine)7 SaleOrderLineService (com.axelor.apps.sale.service.saleorder.SaleOrderLineService)7 SaleOrder (com.axelor.apps.sale.db.SaleOrder)5 Context (com.axelor.rpc.Context)5 AxelorException (com.axelor.exception.AxelorException)4 BigDecimal (java.math.BigDecimal)3 Product (com.axelor.apps.base.db.Product)1