use of com.axelor.apps.contract.service.ContractService in project axelor-open-suite by axelor.
the class ContractController method close.
public void close(ActionRequest request, ActionResponse response) {
Contract contract = Beans.get(ContractRepository.class).find(request.getContext().asType(Contract.class).getId());
ContractService service = Beans.get(ContractService.class);
try {
service.checkCanTerminateContract(contract);
service.close(contract, contract.getTerminatedDate());
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.contract.service.ContractService in project axelor-open-suite by axelor.
the class ContractController method terminated.
public void terminated(ActionRequest request, ActionResponse response) {
Contract contract = Beans.get(ContractRepository.class).find(request.getContext().asType(Contract.class).getId());
try {
ContractService service = Beans.get(ContractService.class);
service.checkCanTerminateContract(contract);
service.terminateContract(contract, true, contract.getTerminatedDate());
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
Aggregations