use of com.axelor.apps.bankpayment.db.BankOrder in project axelor-open-suite by axelor.
the class BankOrderLineController method setBankDetailsDomain.
// settings the domain for the bank details view.
public void setBankDetailsDomain(ActionRequest request, ActionResponse response) {
BankOrderLine bankOrderLine = request.getContext().asType(BankOrderLine.class);
BankOrder bankOrder = request.getContext().getParent().asType(BankOrder.class);
String domain = Beans.get(BankOrderLineService.class).createDomainForBankDetails(bankOrderLine, bankOrder);
// if nothing was found for the domain, we set it at a default value.
if (domain.equals("")) {
response.setAttr("receiverBankDetails", "domain", "self.id IN (0)");
} else {
response.setAttr("receiverBankDetails", "domain", domain);
}
}
use of com.axelor.apps.bankpayment.db.BankOrder in project axelor-open-suite by axelor.
the class InvoicePaymentCancelServiceBankPayImpl method cancel.
/**
* Method to cancel an invoice Payment
*
* <p>Cancel the eventual Move and Reconcile Compute the total amount paid on the linked invoice
* Change the status to cancel
*
* @param invoicePayment An invoice payment
* @throws AxelorException
*/
@Override
@Transactional(rollbackOn = { Exception.class })
public void cancel(InvoicePayment invoicePayment) throws AxelorException {
if (!Beans.get(AppBankPaymentService.class).isApp("bank-payment")) {
super.cancel(invoicePayment);
return;
}
BankOrder paymentBankOrder = invoicePayment.getBankOrder();
if (paymentBankOrder != null) {
if (paymentBankOrder.getStatusSelect() == BankOrderRepository.STATUS_CARRIED_OUT || paymentBankOrder.getStatusSelect() == BankOrderRepository.STATUS_REJECTED) {
throw new AxelorException(invoicePayment, TraceBackRepository.CATEGORY_INCONSISTENCY, I18n.get(IExceptionMessage.INVOICE_PAYMENT_CANCEL));
} else if (paymentBankOrder.getStatusSelect() != BankOrderRepository.STATUS_CANCELED) {
bankOrderService.cancelBankOrder(paymentBankOrder);
this.updateCancelStatus(invoicePayment);
}
}
super.cancel(invoicePayment);
}
use of com.axelor.apps.bankpayment.db.BankOrder in project axelor-open-suite by axelor.
the class InvoicePaymentValidateServiceBankPayImpl method createBankOrder.
/**
* Method to create a bank order for an invoice Payment
*
* @param invoicePayment An invoice payment
* @throws AxelorException
* @throws DatatypeConfigurationException
* @throws IOException
* @throws JAXBException
*/
@Transactional(rollbackOn = { Exception.class })
public void createBankOrder(InvoicePayment invoicePayment) throws AxelorException, JAXBException, IOException, DatatypeConfigurationException {
BankOrder bankOrder = bankOrderCreateService.createBankOrder(invoicePayment);
if (invoicePayment.getPaymentMode().getAutoConfirmBankOrder()) {
bankOrderService.confirm(bankOrder);
}
invoicePayment.setBankOrder(bankOrder);
invoicePaymentRepository.save(invoicePayment);
}
Aggregations