Search in sources :

Example 1 with ItemType

use of org.kuali.kfs.module.purap.businessobject.ItemType in project cu-kfs by CU-CommunityApps.

the class PurchaseOrderDocument method getTotalPreTaxDollarAmount.

/**
 * Gets the pre tax total dollar amount for this Purchase Order.
 *
 * @param includeInactive indicates whether inactive items shall be included.
 * @param includeBelowTheLine indicates whether below the line items shall be included.
 * @return the total dollar amount for this Purchase Order.
 */
public KualiDecimal getTotalPreTaxDollarAmount(boolean includeInactive, boolean includeBelowTheLine) {
    KualiDecimal total = new KualiDecimal(BigDecimal.ZERO);
    for (PurchaseOrderItem item : (List<PurchaseOrderItem>) getItems()) {
        ItemType it = item.getItemType();
        if ((includeBelowTheLine || it.isLineItemIndicator()) && (includeInactive || item.isItemActiveIndicator())) {
            KualiDecimal extendedPrice = item.getExtendedPrice();
            KualiDecimal itemTotal = (extendedPrice != null) ? extendedPrice : KualiDecimal.ZERO;
            total = total.add(itemTotal);
        }
    }
    return total;
}
Also used : PurchaseOrderItem(org.kuali.kfs.module.purap.businessobject.PurchaseOrderItem) ItemType(org.kuali.kfs.module.purap.businessobject.ItemType) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) ArrayList(java.util.ArrayList) List(java.util.List)

Example 2 with ItemType

use of org.kuali.kfs.module.purap.businessobject.ItemType in project cu-kfs by CU-CommunityApps.

the class PurchasingAccountsPayableDocumentBase method getTotalDollarAmountWithExclusionsSubsetItems.

/**
 * This method...
 *
 * @param excludedTypes
 * @param includeBelowTheLine
 * @param itemsForTotal
 * @return
 */
protected KualiDecimal getTotalDollarAmountWithExclusionsSubsetItems(String[] excludedTypes, boolean includeBelowTheLine, List<PurApItem> itemsForTotal) {
    if (excludedTypes == null) {
        excludedTypes = new String[] {};
    }
    KualiDecimal total = new KualiDecimal(BigDecimal.ZERO);
    for (PurApItem item : itemsForTotal) {
        item.refreshReferenceObject(PurapPropertyConstants.ITEM_TYPE);
        ItemType it = item.getItemType();
        if ((includeBelowTheLine || it.isLineItemIndicator()) && !ArrayUtils.contains(excludedTypes, it.getItemTypeCode())) {
            KualiDecimal totalAmount = item.getTotalAmount();
            KualiDecimal itemTotal = (totalAmount != null) ? totalAmount : KualiDecimal.ZERO;
            total = total.add(itemTotal);
        }
    }
    return total;
}
Also used : PurApItem(org.kuali.kfs.module.purap.businessobject.PurApItem) ItemType(org.kuali.kfs.module.purap.businessobject.ItemType) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal)

Example 3 with ItemType

use of org.kuali.kfs.module.purap.businessobject.ItemType in project cu-kfs by CU-CommunityApps.

the class PurchaseOrderDocument method getTotalDollarAmount.

/**
 * Gets the total dollar amount for this Purchase Order.
 *
 * @param includeInactive indicates whether inactive items shall be included.
 * @param includeBelowTheLine indicates whether below the line items shall be included.
 * @return the total dollar amount for this Purchase Order.
 */
public KualiDecimal getTotalDollarAmount(boolean includeInactive, boolean includeBelowTheLine) {
    KualiDecimal total = new KualiDecimal(BigDecimal.ZERO);
    for (PurApItem item : (List<PurApItem>) getItems()) {
        if (item.getPurapDocument() == null) {
            item.setPurapDocument(this);
        }
        ItemType it = item.getItemType();
        if ((includeBelowTheLine || it.isLineItemIndicator()) && (includeInactive || PurApItemUtils.checkItemActive(item))) {
            KualiDecimal totalAmount = item.getTotalAmount();
            KualiDecimal itemTotal = (totalAmount != null) ? totalAmount : KualiDecimal.ZERO;
            total = total.add(itemTotal);
        }
    }
    return total;
}
Also used : PurApItem(org.kuali.kfs.module.purap.businessobject.PurApItem) ItemType(org.kuali.kfs.module.purap.businessobject.ItemType) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) ArrayList(java.util.ArrayList) List(java.util.List)

Example 4 with ItemType

use of org.kuali.kfs.module.purap.businessobject.ItemType in project cu-kfs by CU-CommunityApps.

the class PurchaseOrderDocument method getTotalTaxAmount.

/**
 * Gets the tax total amount for this Purchase Order.
 *
 * @param includeInactive indicates whether inactive items shall be included.
 * @param includeBelowTheLine indicates whether below the line items shall be included.
 * @return the total dollar amount for this Purchase Order.
 */
public KualiDecimal getTotalTaxAmount(boolean includeInactive, boolean includeBelowTheLine) {
    KualiDecimal total = new KualiDecimal(BigDecimal.ZERO);
    for (PurchaseOrderItem item : (List<PurchaseOrderItem>) getItems()) {
        ItemType it = item.getItemType();
        if ((includeBelowTheLine || it.isLineItemIndicator()) && (includeInactive || item.isItemActiveIndicator())) {
            KualiDecimal taxAmount = item.getItemTaxAmount();
            KualiDecimal itemTotal = (taxAmount != null) ? taxAmount : KualiDecimal.ZERO;
            total = total.add(itemTotal);
        }
    }
    return total;
}
Also used : PurchaseOrderItem(org.kuali.kfs.module.purap.businessobject.PurchaseOrderItem) ItemType(org.kuali.kfs.module.purap.businessobject.ItemType) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) ArrayList(java.util.ArrayList) List(java.util.List)

Example 5 with ItemType

use of org.kuali.kfs.module.purap.businessobject.ItemType in project cu-kfs by CU-CommunityApps.

the class PurchasingAccountsPayableDocumentBase method getTotalTaxAmountWithExclusions.

@Override
public KualiDecimal getTotalTaxAmountWithExclusions(String[] excludedTypes, boolean includeBelowTheLine) {
    if (excludedTypes == null) {
        excludedTypes = new String[] {};
    }
    KualiDecimal total = new KualiDecimal(BigDecimal.ZERO);
    for (PurApItem item : (List<PurApItem>) getItems()) {
        item.refreshReferenceObject(PurapPropertyConstants.ITEM_TYPE);
        ItemType it = item.getItemType();
        if ((includeBelowTheLine || it.isLineItemIndicator()) && !ArrayUtils.contains(excludedTypes, it.getItemTypeCode())) {
            KualiDecimal taxAmount = item.getItemTaxAmount();
            KualiDecimal itemTotal = (taxAmount != null) ? taxAmount : KualiDecimal.ZERO;
            total = total.add(itemTotal);
        }
    }
    return total;
}
Also used : PurApItem(org.kuali.kfs.module.purap.businessobject.PurApItem) ItemType(org.kuali.kfs.module.purap.businessobject.ItemType) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) List(java.util.List) ArrayList(java.util.ArrayList)

Aggregations

ItemType (org.kuali.kfs.module.purap.businessobject.ItemType)7 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)6 ArrayList (java.util.ArrayList)5 List (java.util.List)5 PurApItem (org.kuali.kfs.module.purap.businessobject.PurApItem)4 PurchaseOrderItem (org.kuali.kfs.module.purap.businessobject.PurchaseOrderItem)2 CuElectronicInvoiceRejectDocument (edu.cornell.kfs.module.purap.document.CuElectronicInvoiceRejectDocument)1 CuPaymentRequestDocument (edu.cornell.kfs.module.purap.document.CuPaymentRequestDocument)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 RemoteException (java.rmi.RemoteException)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 ValidationException (org.kuali.kfs.krad.exception.ValidationException)1 BusinessObjectService (org.kuali.kfs.krad.service.BusinessObjectService)1 ElectronicInvoiceStep (org.kuali.kfs.module.purap.batch.ElectronicInvoiceStep)1 ElectronicInvoice (org.kuali.kfs.module.purap.businessobject.ElectronicInvoice)1 ElectronicInvoiceItem (org.kuali.kfs.module.purap.businessobject.ElectronicInvoiceItem)1 ElectronicInvoiceItemMapping (org.kuali.kfs.module.purap.businessobject.ElectronicInvoiceItemMapping)1