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);
}
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());
}
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());
}
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;
}
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());
}
Aggregations