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();
}
Aggregations