Search in sources :

Example 1 with InvoicePaymentValidateServiceBankPayImpl

use of com.axelor.apps.bankpayment.service.invoice.payment.InvoicePaymentValidateServiceBankPayImpl in project axelor-open-suite by axelor.

the class BankOrderServiceImpl method validatePayment.

@Override
@Transactional(rollbackOn = { Exception.class })
public void validatePayment(BankOrder bankOrder) throws AxelorException {
    List<InvoicePayment> invoicePaymentList = invoicePaymentRepo.findByBankOrder(bankOrder).fetch();
    InvoicePaymentValidateServiceBankPayImpl invoicePaymentValidateServiceBankPayImpl = Beans.get(InvoicePaymentValidateServiceBankPayImpl.class);
    for (InvoicePayment invoicePayment : invoicePaymentList) {
        if (invoicePayment != null && invoicePayment.getStatusSelect() != InvoicePaymentRepository.STATUS_VALIDATED && invoicePayment.getInvoice() != null) {
            if (bankOrderLineOriginService.existBankOrderLineOrigin(bankOrder, invoicePayment.getInvoice())) {
                invoicePaymentValidateServiceBankPayImpl.validateFromBankOrder(invoicePayment, true);
            }
        }
    }
}
Also used : InvoicePayment(com.axelor.apps.account.db.InvoicePayment) InvoicePaymentValidateServiceBankPayImpl(com.axelor.apps.bankpayment.service.invoice.payment.InvoicePaymentValidateServiceBankPayImpl) Transactional(com.google.inject.persist.Transactional)

Aggregations

InvoicePayment (com.axelor.apps.account.db.InvoicePayment)1 InvoicePaymentValidateServiceBankPayImpl (com.axelor.apps.bankpayment.service.invoice.payment.InvoicePaymentValidateServiceBankPayImpl)1 Transactional (com.google.inject.persist.Transactional)1