Search in sources :

Example 16 with PaymentApplicationDocument

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;
}
Also used : InvoicePaidApplied(org.kuali.kfs.module.ar.businessobject.InvoicePaidApplied) PaymentApplicationDocument(org.kuali.kfs.module.ar.document.PaymentApplicationDocument)

Aggregations

PaymentApplicationDocument (org.kuali.kfs.module.ar.document.PaymentApplicationDocument)16 InvoicePaidApplied (org.kuali.kfs.module.ar.businessobject.InvoicePaidApplied)6 ArrayList (java.util.ArrayList)4 KualiDecimal (org.kuali.kfs.core.api.util.type.KualiDecimal)3 AccountsReceivableDocumentHeader (org.kuali.kfs.module.ar.businessobject.AccountsReceivableDocumentHeader)3 NonAppliedHolding (org.kuali.kfs.module.ar.businessobject.NonAppliedHolding)3 NonInvoiced (org.kuali.kfs.module.ar.businessobject.NonInvoiced)3 PaymentApplicationForm (org.kuali.kfs.module.ar.document.web.struts.PaymentApplicationForm)3 HashMap (java.util.HashMap)2 WorkflowDocument (org.kuali.kfs.kew.api.WorkflowDocument)2 WorkflowException (org.kuali.kfs.kew.api.exception.WorkflowException)2 Document (org.kuali.kfs.krad.document.Document)2 CashControlDocument (org.kuali.kfs.module.ar.document.CashControlDocument)2 CustomerInvoiceDocument (org.kuali.kfs.module.ar.document.CustomerInvoiceDocument)2 PaymentApplicationAdjustmentDocument (org.kuali.kfs.module.ar.document.PaymentApplicationAdjustmentDocument)2 LinkedList (java.util.LinkedList)1 KualiDocumentFormBase (org.kuali.kfs.kns.web.struts.form.KualiDocumentFormBase)1 DocumentService (org.kuali.kfs.krad.service.DocumentService)1 CashControlDetail (org.kuali.kfs.module.ar.businessobject.CashControlDetail)1 Customer (org.kuali.kfs.module.ar.businessobject.Customer)1