Search in sources :

Example 16 with InvoiceDetailAccountObjectCode

use of org.kuali.kfs.module.ar.businessobject.InvoiceDetailAccountObjectCode in project cu-kfs by CU-CommunityApps.

the class ContractsGrantsInvoiceCreateDocumentServiceImpl method mapInvoiceDetailAccountObjectCodesByCategoryCode.

/**
 * Converts a List of InvoiceDetailAccountObjectCodes into a map where the key is the category code
 *
 * @param invoiceDetailAccountObjectCodes a List of InvoiceDetailAccountObjectCodes
 * @return that List converted to a Map, keyed by category code
 */
protected Map<String, List<InvoiceDetailAccountObjectCode>> mapInvoiceDetailAccountObjectCodesByCategoryCode(List<InvoiceDetailAccountObjectCode> invoiceDetailAccountObjectCodes) {
    Map<String, List<InvoiceDetailAccountObjectCode>> invoiceDetailAccountObjectCodesMap = new HashMap<>();
    for (InvoiceDetailAccountObjectCode invoiceDetailAccountObjectCode : invoiceDetailAccountObjectCodes) {
        List<InvoiceDetailAccountObjectCode> invoiceDetailAccountObjectCodesForCategory = invoiceDetailAccountObjectCodesMap.get(invoiceDetailAccountObjectCode.getCategoryCode());
        if (invoiceDetailAccountObjectCodesForCategory == null) {
            invoiceDetailAccountObjectCodesForCategory = new ArrayList<>();
        }
        invoiceDetailAccountObjectCodesForCategory.add(invoiceDetailAccountObjectCode);
        invoiceDetailAccountObjectCodesMap.put(invoiceDetailAccountObjectCode.getCategoryCode(), invoiceDetailAccountObjectCodesForCategory);
    }
    return invoiceDetailAccountObjectCodesMap;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) List(java.util.List) InvoiceDetailAccountObjectCode(org.kuali.kfs.module.ar.businessobject.InvoiceDetailAccountObjectCode)

Aggregations

InvoiceDetailAccountObjectCode (org.kuali.kfs.module.ar.businessobject.InvoiceDetailAccountObjectCode)16 KualiDecimal (org.kuali.kfs.core.api.util.type.KualiDecimal)10 HashMap (java.util.HashMap)8 AbstractKualiDecimal (org.kuali.kfs.core.api.util.type.AbstractKualiDecimal)7 ArrayList (java.util.ArrayList)5 List (java.util.List)5 InvoiceAccountDetail (org.kuali.kfs.module.ar.businessobject.InvoiceAccountDetail)5 ContractsGrantsInvoiceDetail (org.kuali.kfs.module.ar.businessobject.ContractsGrantsInvoiceDetail)4 AwardAccountObjectCodeTotalBilled (org.kuali.kfs.module.ar.businessobject.AwardAccountObjectCodeTotalBilled)3 CostCategory (org.kuali.kfs.module.ar.businessobject.CostCategory)3 BigDecimal (java.math.BigDecimal)2 ContractsAndGrantsBillingAwardAccount (org.kuali.kfs.integration.cg.ContractsAndGrantsBillingAwardAccount)2 ContractsGrantsLetterOfCreditReviewDetail (org.kuali.kfs.module.ar.businessobject.ContractsGrantsLetterOfCreditReviewDetail)2 InvoiceAddressDetail (org.kuali.kfs.module.ar.businessobject.InvoiceAddressDetail)2 InvoiceMilestone (org.kuali.kfs.module.ar.businessobject.InvoiceMilestone)2 Date (java.sql.Date)1 Timestamp (java.sql.Timestamp)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 AccountingPeriod (org.kuali.kfs.coa.businessobject.AccountingPeriod)1 ObjectCodeCurrent (org.kuali.kfs.coa.businessobject.ObjectCodeCurrent)1