Search in sources :

Example 1 with PaymentBatchApprovalState

use of org.estatio.module.capex.dom.payment.approval.PaymentBatchApprovalState in project estatio by estatio.

the class IncomingInvoice_reject method disableAct.

public String disableAct() {
    final List<PaymentLine> paymentLines = paymentLineRepository.findByInvoice(incomingInvoice);
    for (PaymentLine paymentLine : paymentLines) {
        final PaymentBatch paymentBatch = paymentLine.getBatch();
        final PaymentBatchApprovalState state = paymentBatch.getApprovalState();
        if (state != PaymentBatchApprovalState.NEW && state != PaymentBatchApprovalState.DISCARDED) {
            return String.format("Invoice is in batch %s", titleService.titleOf(paymentBatch));
        }
    }
    return reasonGuardNotSatisified();
}
Also used : PaymentBatchApprovalState(org.estatio.module.capex.dom.payment.approval.PaymentBatchApprovalState) PaymentLine(org.estatio.module.capex.dom.payment.PaymentLine) PaymentBatch(org.estatio.module.capex.dom.payment.PaymentBatch)

Aggregations

PaymentBatch (org.estatio.module.capex.dom.payment.PaymentBatch)1 PaymentLine (org.estatio.module.capex.dom.payment.PaymentLine)1 PaymentBatchApprovalState (org.estatio.module.capex.dom.payment.approval.PaymentBatchApprovalState)1