use of org.kuali.rice.core.api.util.type.KualiDecimal in project cu-kfs by CU-CommunityApps.
the class CuCreditMemoServiceImplTest method setupVendorCreditMemoDocument.
private CuVendorCreditMemoDocument setupVendorCreditMemoDocument() {
ArrayList<String> methodNames = new ArrayList<>();
for (Method method : VendorCreditMemoDocument.class.getMethods()) {
if (!Modifier.isFinal(method.getModifiers()) && !method.getName().startsWith("set") && !method.getName().startsWith("get") && !method.getName().startsWith("is")) {
methodNames.add(method.getName());
}
}
IMockBuilder<CuVendorCreditMemoDocument> builder = EasyMock.createMockBuilder(CuVendorCreditMemoDocument.class).addMockedMethods(methodNames.toArray(new String[0]));
creditMemoDocument = builder.createNiceMock();
creditMemoDocument.setDocumentHeader(new MockFinancialSystemDocumentHeader());
creditMemoDocument.getDocumentHeader().setDocumentDescription("Description");
creditMemoDocument.setVendorDetailAssignedIdentifier(0);
creditMemoDocument.setVendorHeaderGeneratedIdentifier(4291);
creditMemoDocument.setCreditMemoNumber("12345");
creditMemoDocument.setCreditMemoDate(dateTimeService.getCurrentSqlDate());
creditMemoDocument.setCreditMemoAmount(new KualiDecimal(100));
return creditMemoDocument;
}
use of org.kuali.rice.core.api.util.type.KualiDecimal in project cu-kfs by CU-CommunityApps.
the class CuLaborPendingEntryConverterServiceImplTest method testGetBenefitClearingPendingEntry.
public void testGetBenefitClearingPendingEntry() throws IllegalAccessException, InstantiationException, WorkflowException {
CuSalaryExpenseTransferDocument document = CuSalaryExpenseTransferDocumentFixture.GOOD_ST.createSalaryExpenseDocument();
AccountingDocumentTestUtils.saveDocument(document, documentService);
GeneralLedgerPendingEntrySequenceHelper sequenceHelper = new GeneralLedgerPendingEntrySequenceHelper();
LaborLedgerPendingEntry laborLedgerPendingEntry = ((CuLaborPendingEntryConverterServiceImpl) laborPendingEntryConverterService).getBenefitClearingPendingEntry(document, sequenceHelper, "R704750", "IT", "MX", new KualiDecimal(6916.68), "5200");
assertEquals("1", laborLedgerPendingEntry.getEmplid());
}
use of org.kuali.rice.core.api.util.type.KualiDecimal in project cu-kfs by CU-CommunityApps.
the class CuDisbursementVoucherDocumentIntegrationTest method testToCopy.
@Test
public void testToCopy() throws WorkflowException {
String payeeidNumber = cuDisbursementVoucherDocument.getDvPayeeDetail().getDisbVchrPayeeIdNumber();
cuDisbursementVoucherDocument.toCopy();
assertEquals("Test Document Description", cuDisbursementVoucherDocument.getDocumentHeader().getDocumentDescription());
assertEquals("Salino, Catherine C.", cuDisbursementVoucherDocument.getDisbVchrContactPersonName());
assertEquals("IT", cuDisbursementVoucherDocument.getCampusCode());
Calendar calendar = dateTimeService.getCurrentCalendar();
calendar.add(Calendar.DAY_OF_MONTH, 1);
assertEquals(new Date(calendar.getTimeInMillis()), cuDisbursementVoucherDocument.getDisbursementVoucherDueDate());
assertEquals("O", cuDisbursementVoucherDocument.getDisbursementVoucherDocumentationLocationCode());
assertEquals("DISB", cuDisbursementVoucherDocument.getDisbVchrBankCode());
assertEquals("607-255-9466", cuDisbursementVoucherDocument.getDisbVchrContactPhoneNumber());
assertEquals("ccs1@cornell.edu", cuDisbursementVoucherDocument.getDisbVchrContactEmailId());
assertEquals(StringUtils.EMPTY, cuDisbursementVoucherDocument.getDisbVchrPayeeTaxControlCode());
assertEquals(new KualiDecimal(86.00), cuDisbursementVoucherDocument.getDisbVchrCheckTotalAmount());
DisbursementVoucherNonResidentAlienTax disbursementVoucherNonResidentAlienTax = cuDisbursementVoucherDocument.getDvNonResidentAlienTax();
assertNull(disbursementVoucherNonResidentAlienTax.getDocumentNumber());
assertNull(disbursementVoucherNonResidentAlienTax.getFederalIncomeTaxPercent());
assertNull(disbursementVoucherNonResidentAlienTax.getStateIncomeTaxPercent());
assertNull(disbursementVoucherNonResidentAlienTax.getIncomeClassCode());
assertNull(disbursementVoucherNonResidentAlienTax.getPostalCountryCode());
assertFalse(disbursementVoucherNonResidentAlienTax.isIncomeTaxTreatyExemptCode());
assertFalse(disbursementVoucherNonResidentAlienTax.isForeignSourceIncomeCode());
assertFalse(disbursementVoucherNonResidentAlienTax.isIncomeTaxGrossUpCode());
assertNull(disbursementVoucherNonResidentAlienTax.getReferenceFinancialSystemOriginationCode());
assertNull(disbursementVoucherNonResidentAlienTax.getReferenceFinancialDocumentNumber());
assertNull(disbursementVoucherNonResidentAlienTax.getFinancialDocumentAccountingLineText());
assertNull(disbursementVoucherNonResidentAlienTax.getTaxNQIId());
assertFalse(disbursementVoucherNonResidentAlienTax.isTaxOtherExemptIndicator());
assertFalse(disbursementVoucherNonResidentAlienTax.isTaxUSAIDPerDiemIndicator());
assertNull(disbursementVoucherNonResidentAlienTax.getTaxSpecialW4Amount());
assertNull(disbursementVoucherNonResidentAlienTax.getIncomeClass());
assertFalse(cuDisbursementVoucherDocument.getWireTransfer().isWireTransferFeeWaiverIndicator());
assertNull(cuDisbursementVoucherDocument.getExtractDate());
assertNull(cuDisbursementVoucherDocument.getPaidDate());
assertNull(cuDisbursementVoucherDocument.getCancelDate());
assertEquals(KFSConstants.DocumentStatusCodes.INITIATED, cuDisbursementVoucherDocument.getFinancialSystemDocumentHeader().getFinancialDocumentStatusCode());
assertEquals(0, KNSGlobalVariables.getMessageList().size());
assertEquals(payeeidNumber, cuDisbursementVoucherDocument.getDvPayeeDetail().getDisbVchrPayeeIdNumber());
}
use of org.kuali.rice.core.api.util.type.KualiDecimal in project cu-kfs by CU-CommunityApps.
the class ezraUpdateAwardImplTest method testUpdateAwards.
public void testUpdateAwards() {
Map fields = new HashMap();
String awardProjectTitle = "ezraUpdateTest";
String awardProjectTitleAfter = "";
Date today = SpringContext.getBean(DateTimeService.class).getCurrentSqlDate();
Date sqlDate = today;
Date budgetStartDate = generateYear1970StartDate();
Date budgetEndDate = generateDateOneDayLater(budgetStartDate);
Date budgetStartDateAfter = generateDateOneDayLater(budgetEndDate);
Date budgetEndDateAfter = generateDateOneDayLater(budgetStartDateAfter);
KualiDecimal budgetTotal = new KualiDecimal(-1);
KualiDecimal budgetTotalAfter = new KualiDecimal(-2);
EzraProposalAward ezraAward = null;
List<EzraProposalAward> awards = ezraAwardProposalDao.getAwardsUpdatedSince(sqlDate);
int count = 0;
if (awards.isEmpty()) {
do {
count--;
Calendar c = Calendar.getInstance();
c.setTime(today);
c.add(Calendar.DATE, count);
sqlDate = new java.sql.Date(c.getTimeInMillis());
awards = ezraAwardProposalDao.getAwardsUpdatedSince(sqlDate);
if (!awards.isEmpty()) {
count = -12;
}
} while (count > -11);
}
LOG.info("The Sql Date is " + sqlDate);
awards = ezraAwardProposalDao.getAwardsUpdatedSince(sqlDate);
if (!awards.isEmpty()) {
ezraAward = awards.get(0);
fields.clear();
fields.put("proposalNumber", ezraAward.getProjectId());
Award award = (CuAward) businessObjectService.findByPrimaryKey(CuAward.class, fields);
award.setAwardProjectTitle(awardProjectTitle);
getAwardExtension(award).setBudgetBeginningDate(new Date(budgetStartDate.getTime()));
getAwardExtension(award).setBudgetEndingDate(new Date(budgetEndDate.getTime()));
getAwardExtension(award).setBudgetTotalAmount(budgetTotal);
businessObjectService.save(award);
assertTrue(ezraService.updateAwardsSince(sqlDate));
Award awardAfter = (CuAward) businessObjectService.findByPrimaryKey(CuAward.class, fields);
awardProjectTitleAfter = awardAfter.getAwardProjectTitle();
budgetStartDateAfter = getAwardExtension(awardAfter).getBudgetBeginningDate();
budgetEndDateAfter = getAwardExtension(awardAfter).getBudgetEndingDate();
budgetTotalAfter = getAwardExtension(awardAfter).getBudgetTotalAmount();
LOG.info("Project Title before update " + awardProjectTitle + " Project Title after update " + awardProjectTitleAfter);
}
if (awardProjectTitle.equalsIgnoreCase(awardProjectTitleAfter)) {
fail("Ezra failed to update Award");
}
assertNotEquals("Ezra failed to update Award Budget Start Date", budgetStartDate, budgetStartDateAfter);
assertNotEquals("Ezra failed to update Award Budget Stop Date", budgetEndDate, budgetEndDateAfter);
assertNotEquals("Ezra failed to update Award Budget Total Amount", budgetTotal, budgetTotalAfter);
}
use of org.kuali.rice.core.api.util.type.KualiDecimal in project cu-kfs by CU-CommunityApps.
the class RemovePlusSignKualiDecimalFormatterTest method convertEmptyString.
@Test
public void convertEmptyString() {
KualiDecimal expected = null;
KualiDecimal actual = (KualiDecimal) kualiDecimalFormatter.convertToObject("");
assertEquals(ASSERT_SHOULD_EQUAL_MESSAGE, expected, actual);
}
Aggregations