Search in sources :

Example 91 with KualiDecimal

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

the class AmazonWebServicesBillingServiceImplTest method testConvertCostStringToKualiDecimal4.

@Test
public void testConvertCostStringToKualiDecimal4() {
    KualiDecimal results = amazonService.convertCostStringToKualiDecimal("-50");
    double expected = 0;
    assertEquals(expected, results.doubleValue(), allowableVarianceAmount);
}
Also used : KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) Test(org.junit.Test)

Example 92 with KualiDecimal

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

the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileTransactionWithDate.

@Test
public void testParseLineIntoObjectAchIncomeFileTransactionWithDate() throws Exception {
    AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
    List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
    setFlatFileProperty(parseProperties, 2, "transactionAmount", KualiDecimalFormatter.class);
    setFlatFileProperty(parseProperties, 3, "creditDebitIndicator");
    setFlatFileProperty(parseProperties, 4, "paymentMethodCode");
    setFlatFileProperty(parseProperties, 16, "effectiveDate", BatchDateFormatter.class, DATE_FORMAT);
    setFlatFileProperty(parseProperties, 10, "companyId");
    flatFileObjectSpecification.setParseProperties(parseProperties);
    AchIncomeFileTransaction achIncomeFileTransaction = new AchIncomeFileTransaction();
    achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, BPR_LINE2, achIncomeFileTransaction, 1);
    Date expectedDate = new SimpleDateFormat(DATE_FORMAT).parse("20160223");
    assertEquals(new KualiDecimal("3131.04"), achIncomeFileTransaction.getTransactionAmount());
    assertEquals("C", achIncomeFileTransaction.getCreditDebitIndicator());
    assertEquals("ACH", achIncomeFileTransaction.getPaymentMethodCode());
    assertEquals(expectedDate, achIncomeFileTransaction.getEffectiveDate());
    assertEquals("3041036004", achIncomeFileTransaction.getCompanyId());
}
Also used : AchIncomeFileTransaction(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransaction) FlatFilePrefixObjectSpecification(org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification) ArrayList(java.util.ArrayList) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) FlatFilePropertySpecification(org.kuali.kfs.sys.batch.FlatFilePropertySpecification) DelimitedFlatFilePropertySpecification(org.kuali.kfs.sys.batch.DelimitedFlatFilePropertySpecification) SimpleDateFormat(java.text.SimpleDateFormat) AbstractFlatFileObjectSpecification(org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification) Date(java.util.Date) Test(org.junit.Test)

Example 93 with KualiDecimal

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

the class AdvanceDepositServiceImplTest method testSetupSourceAccountingLine_NegativeAmount.

@Test
public void testSetupSourceAccountingLine_NegativeAmount() {
    SourceAccountingLine sourceAccountingLine = new SourceAccountingLine();
    AchIncomeTransaction achIncomeTransaction = new AchIncomeTransaction();
    achIncomeTransaction.setTransactionAmount(new KualiDecimal(10));
    advanceDepositService.setupSourceAccountingLine(achIncomeTransaction, advanceDepositDocument, "IT", EXPENSE_OBJECT_CODE, "1234567");
    assertEquals("Accounting line amount should be the transaction amount negated", achIncomeTransaction.getTransactionAmount().negated(), advanceDepositDocument.getSourceAccountingLine(0).getAmount());
}
Also used : AchIncomeTransaction(edu.cornell.kfs.fp.businessobject.AchIncomeTransaction) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) SourceAccountingLine(org.kuali.kfs.sys.businessobject.SourceAccountingLine) Test(org.junit.Test)

Example 94 with KualiDecimal

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

the class AdvanceDepositServiceImplTest method setupOpenItemReference.

private AchIncomeFileTransactionOpenItemReference setupOpenItemReference(String type, String invoiceNumber) {
    AchIncomeFileTransactionOpenItemReference openItemReference = new AchIncomeFileTransactionOpenItemReference();
    openItemReference.setInvoiceAmount(new KualiDecimal("12761.79"));
    openItemReference.setNetAmount(new KualiDecimal("12761.79"));
    openItemReference.setType(type);
    openItemReference.setInvoiceNumber(invoiceNumber);
    return openItemReference;
}
Also used : AchIncomeFileTransactionOpenItemReference(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionOpenItemReference) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal)

Example 95 with KualiDecimal

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

the class AdvanceDepositServiceImplTest method testSetupSourceAccountingLine_PositiveAmount.

@Test
public void testSetupSourceAccountingLine_PositiveAmount() {
    SourceAccountingLine sourceAccountingLine = new SourceAccountingLine();
    AchIncomeTransaction achIncomeTransaction = new AchIncomeTransaction();
    achIncomeTransaction.setTransactionAmount(new KualiDecimal(10));
    advanceDepositService.setupSourceAccountingLine(achIncomeTransaction, advanceDepositDocument, "IT", NON_ASSET_EXPENSE_OBJECT_CODE, "1234567");
    assertEquals("Accounting line amount should equal the transaction amount", achIncomeTransaction.getTransactionAmount(), advanceDepositDocument.getSourceAccountingLine(0).getAmount());
}
Also used : AchIncomeTransaction(edu.cornell.kfs.fp.businessobject.AchIncomeTransaction) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) SourceAccountingLine(org.kuali.kfs.sys.businessobject.SourceAccountingLine) Test(org.junit.Test)

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