use of org.kuali.kfs.module.ar.document.PaymentApplicationDocument in project cu-kfs by CU-CommunityApps.
the class PaymentApplicationForm method getPaidAppliedForInvoiceDetail.
/**
* For a given invoiceDocNumber and invoiceItemNumber, this method will return any paidApplieds that match those
* two fields, if any exists. Otherwise it will return null.
*/
public InvoicePaidApplied getPaidAppliedForInvoiceDetail(String invoiceDocNumber, Integer invoiceItemNumber) {
if (StringUtils.isBlank(invoiceDocNumber)) {
throw new IllegalArgumentException("The parameter [invoiceDocNumber] passed in was blank or null.");
}
if (invoiceItemNumber == null || invoiceItemNumber < 1) {
throw new IllegalArgumentException("The parameter [invoiceItemNumber] passed in was blank, zero or negative.");
}
PaymentApplicationDocument payAppDoc = getPaymentApplicationDocument();
List<InvoicePaidApplied> paidApplieds = payAppDoc.getInvoicePaidApplieds();
for (InvoicePaidApplied paidApplied : paidApplieds) {
if (invoiceDocNumber.equalsIgnoreCase(paidApplied.getFinancialDocumentReferenceInvoiceNumber())) {
if (invoiceItemNumber.equals(paidApplied.getInvoiceItemNumber())) {
return paidApplied;
}
}
}
return null;
}
Aggregations