Search in sources :

Example 16 with KualiDecimal

use of org.kuali.rice.core.api.util.type.KualiDecimal in project cu-kfs by CU-CommunityApps.

the class AdvanceDepositServiceImpl method getEmailMessageText.

private String getEmailMessageText(AchIncomeFile achIncomeFile, String payerMessage) {
    StringBuilder message = new StringBuilder();
    int totalPostedTransation = achTotalPostedTransactions + wiredTotalPostedTransactions;
    KualiDecimal totalPostedTransactionAmount = achTotalPostedTransactionAmount.add(wiredTotalPostedTransactionAmount);
    String fileDateTime;
    try {
        fileDateTime = getFormattedTimestamp(achIncomeFile, "fileDate/Time").toString();
    } catch (FormatException e) {
        // use the original file Date/Time string if encountered invalid format
        fileDateTime = achIncomeFile.getFileDate() + " " + achIncomeFile.getFileTime();
    }
    message.append("File Date: " + fileDateTime);
    message.append("\n");
    message.append("                    ");
    message.append("COUNT               ");
    message.append("        AMOUNT     ");
    message.append("\n");
    message.append(StringUtils.rightPad("ACH Posted", 20));
    message.append(StringUtils.rightPad(achTotalPostedTransactions + "", 20));
    message.append(StringUtils.leftPad(getFormattedAmount("##,##,##0.00", achTotalPostedTransactionAmount), 20));
    message.append("\n");
    message.append(StringUtils.rightPad("Wire Posted", 20));
    message.append(StringUtils.rightPad(wiredTotalPostedTransactions + "", 20));
    message.append(StringUtils.leftPad(getFormattedAmount("##,##,##0.00", wiredTotalPostedTransactionAmount), 20));
    message.append("\n");
    message.append(StringUtils.rightPad("Total Posted", 20));
    message.append(StringUtils.rightPad(totalPostedTransation + "", 20));
    message.append(StringUtils.leftPad(getFormattedAmount("##,##,##0.00", totalPostedTransactionAmount), 20));
    message.append("\n");
    message.append("\n");
    message.append(StringUtils.rightPad("ACH Skipped", 20));
    message.append(StringUtils.rightPad(achTotalSkippedTransactions + "", 20));
    message.append(StringUtils.leftPad(getFormattedAmount("##,##,##0.00", achTotalSkippedTransactionAmount), 20));
    message.append("\n");
    message.append(StringUtils.rightPad("Wire Skipped", 20));
    message.append(StringUtils.rightPad(wiredTotalSkippedTransactions + "", 20));
    message.append(StringUtils.leftPad(getFormattedAmount("##,##,##0.00", wiredTotalSkippedTransactionAmount), 20));
    message.append("\n");
    if (StringUtils.isNotBlank(payerMessage)) {
        message.append("\n");
        message.append("Transactions Missing Payer Name: ");
        message.append("\n");
        message.append(payerMessage);
    }
    return message.toString();
}
Also used : KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) FormatException(org.kuali.rice.core.web.format.FormatException)

Example 17 with KualiDecimal

use of org.kuali.rice.core.api.util.type.KualiDecimal in project cu-kfs by CU-CommunityApps.

the class AdvanceDepositServiceImpl method initializeTransactionCountsAndAmounts.

protected void initializeTransactionCountsAndAmounts() {
    achTotalPostedTransactions = 0;
    achTotalSkippedTransactions = 0;
    wiredTotalPostedTransactions = 0;
    wiredTotalSkippedTransactions = 0;
    achTotalPostedTransactionAmount = new KualiDecimal(0.00);
    achTotalSkippedTransactionAmount = new KualiDecimal(0.00);
    wiredTotalPostedTransactionAmount = new KualiDecimal(0.00);
    wiredTotalSkippedTransactionAmount = new KualiDecimal(0.00);
}
Also used : KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal)

Example 18 with KualiDecimal

use of org.kuali.rice.core.api.util.type.KualiDecimal in project cu-kfs by CU-CommunityApps.

the class ProcurementCardFlatInputFileType method initialize.

private void initialize() {
    parent = null;
    duplicateTransactions = false;
    transactionCount = 0;
    headerTransactionCount = 0;
    footerTransactionCount = 0;
    lineCount = 1;
    accumulatedDebits = new KualiDecimal(0);
    accumulatedCredits = new KualiDecimal(0);
    totalDebits = new KualiDecimal(0);
    totalCredits = new KualiDecimal(0);
    fileFooterCredits = new KualiDecimal(0);
    fileFooterDebits = new KualiDecimal(0);
}
Also used : KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal)

Example 19 with KualiDecimal

use of org.kuali.rice.core.api.util.type.KualiDecimal in project cu-kfs by CU-CommunityApps.

the class CuPurchaseOrderAmendmentDocument method isSeparationOfDutiesReviewRequired.

protected boolean isSeparationOfDutiesReviewRequired() {
    try {
        Set<Person> priorApprovers = getAllPriorApprovers();
        // then no need for separation of duties
        if (priorApprovers.size() > 0) {
            return false;
        }
    } catch (WorkflowException we) {
        LOG.error("Exception while attempting to retrieve all prior approvers from workflow: " + we);
    }
    ParameterService parameterService = SpringContext.getBean(ParameterService.class);
    KualiDecimal maxAllowedAmount = new KualiDecimal(parameterService.getParameterValueAsString(RequisitionDocument.class, PurapParameterConstants.SEPARATION_OF_DUTIES_DOLLAR_AMOUNT));
    // if app param amount is greater than or equal to documentTotalAmount... no need for separation of duties
    KualiDecimal totalAmount = getFinancialSystemDocumentHeader().getFinancialDocumentTotalAmount();
    if (ObjectUtils.isNotNull(maxAllowedAmount) && ObjectUtils.isNotNull(totalAmount) && (maxAllowedAmount.compareTo(totalAmount) >= 0)) {
        return false;
    } else {
        return true;
    }
}
Also used : RequisitionDocument(org.kuali.kfs.module.purap.document.RequisitionDocument) ParameterService(org.kuali.kfs.coreservice.framework.parameter.ParameterService) WorkflowException(org.kuali.rice.kew.api.exception.WorkflowException) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) Person(org.kuali.rice.kim.api.identity.Person)

Example 20 with KualiDecimal

use of org.kuali.rice.core.api.util.type.KualiDecimal in project cu-kfs by CU-CommunityApps.

the class CuRequisitionDocument method isAwardAmountGreaterThanThreshold.

protected boolean isAwardAmountGreaterThanThreshold() {
    ParameterService parameterService = SpringContext.getBean(ParameterService.class);
    String dollarThreshold = parameterService.getParameterValueAsString("KFS-PURAP", "Requisition", DOLLAR_THRESHOLD_REQUIRING_AWARD_REVIEW);
    KualiDecimal dollarThresholdDecimal = new KualiDecimal(dollarThreshold);
    if (this.getTotalPreTaxDollarAmount().isGreaterEqual(dollarThresholdDecimal)) {
        return true;
    }
    return false;
}
Also used : ParameterService(org.kuali.kfs.coreservice.framework.parameter.ParameterService) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal)

Aggregations

KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)209 ArrayList (java.util.ArrayList)37 HashMap (java.util.HashMap)19 Test (org.junit.Test)19 List (java.util.List)15 SourceAccountingLine (org.kuali.kfs.sys.businessobject.SourceAccountingLine)15 CapitalAssetInformation (org.kuali.kfs.fp.businessobject.CapitalAssetInformation)14 BigDecimal (java.math.BigDecimal)13 Date (java.sql.Date)13 Iterator (java.util.Iterator)12 PurchaseOrderDocument (org.kuali.kfs.module.purap.document.PurchaseOrderDocument)12 KualiInteger (org.kuali.rice.core.api.util.type.KualiInteger)12 PaymentRequestItem (org.kuali.kfs.module.purap.businessobject.PaymentRequestItem)11 IOException (java.io.IOException)10 ParameterService (org.kuali.kfs.coreservice.framework.parameter.ParameterService)10 Map (java.util.Map)9 CapitalAccountingLines (org.kuali.kfs.fp.businessobject.CapitalAccountingLines)9 PurchaseOrderItem (org.kuali.kfs.module.purap.businessobject.PurchaseOrderItem)9 PaymentGroup (org.kuali.kfs.pdp.businessobject.PaymentGroup)9 RequisitionDocument (org.kuali.kfs.module.purap.document.RequisitionDocument)8