use of com.axelor.apps.contract.service.ContractLineService in project axelor-open-suite by axelor.
the class ContractController method changeProduct.
public void changeProduct(ActionRequest request, ActionResponse response) {
ContractLineService contractLineService = Beans.get(ContractLineService.class);
ContractLine contractLine = new ContractLine();
try {
contractLine = request.getContext().asType(ContractLine.class);
Contract contract = request.getContext().getParent().asType(Contract.class);
Product product = contractLine.getProduct();
contractLine = contractLineService.fillAndCompute(contractLine, contract, product);
response.setValues(contractLine);
} catch (Exception e) {
response.setValues(contractLineService.reset(contractLine));
}
}
use of com.axelor.apps.contract.service.ContractLineService in project axelor-open-suite by axelor.
the class ContractVersionController method changeProduct.
public void changeProduct(ActionRequest request, ActionResponse response) {
ContractLineService contractLineService = Beans.get(ContractLineService.class);
ContractLine contractLine = new ContractLine();
try {
contractLine = request.getContext().asType(ContractLine.class);
ContractVersion contractVersion = request.getContext().getParent().asType(ContractVersion.class);
Contract contract = contractVersion.getNextContract() == null ? contractVersion.getContract() : contractVersion.getNextContract();
Product product = contractLine.getProduct();
contractLine = contractLineService.fillAndCompute(contractLine, contract, product);
response.setValues(contractLine);
} catch (Exception e) {
response.setValues(contractLineService.reset(contractLine));
}
}
use of com.axelor.apps.contract.service.ContractLineService in project axelor-open-suite by axelor.
the class ContractLineController method computeTotal.
public void computeTotal(ActionRequest request, ActionResponse response) {
ContractLine contractLine = request.getContext().asType(ContractLine.class);
ContractLineService contractLineService = Beans.get(ContractLineService.class);
try {
contractLine = contractLineService.computeTotal(contractLine);
response.setValues(contractLine);
} catch (Exception e) {
response.setValues(contractLineService.reset(contractLine));
}
}
use of com.axelor.apps.contract.service.ContractLineService in project axelor-open-suite by axelor.
the class ContractTemplateController method changeProduct.
public void changeProduct(ActionRequest request, ActionResponse response) {
ContractLineService contractLineService = Beans.get(ContractLineService.class);
ContractLine contractLine = new ContractLine();
try {
contractLine = request.getContext().asType(ContractLine.class);
Product product = contractLine.getProduct();
contractLine = contractLineService.fill(contractLine, product);
response.setValues(contractLine);
} catch (Exception e) {
response.setValues(contractLineService.reset(contractLine));
}
}
Aggregations