Search in sources :

Example 6 with PaymentLine

use of org.estatio.module.capex.dom.payment.PaymentLine 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

PaymentLine (org.estatio.module.capex.dom.payment.PaymentLine)6 IncomingInvoice (org.estatio.module.capex.dom.invoice.IncomingInvoice)4 PaymentBatch (org.estatio.module.capex.dom.payment.PaymentBatch)4 CreditTransfer (org.estatio.module.capex.dom.payment.CreditTransfer)3 Action (org.apache.isis.applib.annotation.Action)2 Expectations (org.jmock.Expectations)2 Test (org.junit.Test)2 Lists (com.google.common.collect.Lists)1 IOException (java.io.IOException)1 BigDecimal (java.math.BigDecimal)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Nullable (javax.annotation.Nullable)1 Inject (javax.inject.Inject)1 AccessLevel (lombok.AccessLevel)1 Getter (lombok.Getter)1 Setter (lombok.Setter)1